:root {
  --gwft-primary: #565656;
  --gwft-primary-light: #989898;
  --gwft-secondary: #f06b6b;
  --gwft-neutral-light: #f4f4f4;
  --gwft-neutral-white: #ffffff;
  --gwft-neutral-black: #000000;
  --gwft-layer-background: linear-gradient(135deg, #989898 0%, #cfcfcf 34%, #ffffff 100%);
  --gwft-primary-gradient: linear-gradient(135deg, var(--gwft-primary) 0%, #f06b6b 58%, #ffffff 100%);
  --gwft-secondary-gradient: linear-gradient(135deg, var(--gwft-secondary) 0%, #f06b6b 58%, #ffffff 100%);
  --gwft-font: Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--gwft-font);
  color: var(--gwft-primary);
  background: var(--gwft-layer-background);
}

button,
a,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

.gwft-app {
  min-height: 100vh;
}

.gwft-auth-check {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--gwft-layer-background);
}

.gwft-app[data-auth-state="checking"] .gwft-auth-check,
.gwft-app[data-auth-state="anonymous"] .gwft-auth-check,
.gwft-app[data-auth-state="error"] .gwft-auth-check {
  display: flex;
}

.gwft-app[data-auth-state="authenticated"] .gwft-auth-check {
  display: none;
}

.gwft-auth-check__card {
  width: min(440px, 100%);
  border: 1px solid rgba(86, 86, 86, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.gwft-auth-check__brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--gwft-primary);
  margin-bottom: 12px;
}

.gwft-auth-check__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--gwft-neutral-black);
}

.gwft-shell {
  display: none;
  min-height: 100vh;
}

.gwft-app[data-auth-state="authenticated"] .gwft-shell {
  display: block;
}

.gwft-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: center;
  height: 60px;
  border-bottom: 1px solid rgba(86, 86, 86, 0.22);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.gwft-header__brand-area {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
}

.gwft-header__brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--gwft-primary);
  white-space: nowrap;
}

.gwft-header__context {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
}

.gwft-header__module-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gwft-secondary);
}

.gwft-header__module-description {
  max-width: 680px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  color: var(--gwft-neutral-black);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gwft-header__auth {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 0 16px;
}

.gwft-header__user {
  text-align: right;
}

.gwft-header__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gwft-primary);
}

.gwft-header__user-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--gwft-neutral-black);
}

.gwft-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--gwft-neutral-black);
  border-radius: 8px;
  background: var(--gwft-primary-gradient);
  color: var(--gwft-neutral-white);
  font-size: 13px;
  font-weight: 600;
}

.gwft-nav {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 54px;
  overflow: hidden;
  border-right: 1px solid rgba(86, 86, 86, 0.2);
  background: transparent;
  transition: width 160ms ease;
}

.gwft-nav.is-expanded {
  width: 172px;
}

.gwft-nav__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px;
}

.gwft-nav__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  width: 152px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--gwft-primary);
  border-radius: 8px;
  background: var(--gwft-neutral-light);
  color: var(--gwft-primary);
  text-align: left;
}

.gwft-nav:not(.is-expanded) .gwft-nav__item {
  grid-template-columns: 32px;
  width: 32px;
}

.gwft-nav:not(.is-expanded) .gwft-nav__label {
  display: none;
}

.gwft-nav__toggle {
  margin-bottom: 8px;
  border-color: var(--gwft-neutral-black);
  background: var(--gwft-neutral-light);
}

.gwft-nav__item.is-active {
  border-color: var(--gwft-secondary);
  background: var(--gwft-secondary-gradient);
  color: var(--gwft-neutral-white);
}

.gwft-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  color: currentColor;
}

.gwft-nav__label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.gwft-workspace {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: 0;
  left: 54px;
  overflow: hidden;
  background: transparent;
}

.gwft-module-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  gap: 16px;
}

.gwft-module-shell__sticky {
  flex: 0 0 auto;
}

.gwft-module-shell__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.gwft-kontakte-search {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  padding: 22px;
  border: 1px solid rgba(86, 86, 86, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.gwft-kontakte-search__row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gwft-kontakte-search__field {
  display: grid;
  grid-template-columns: minmax(220px, 420px) 34px;
  height: 34px;
}

.gwft-kontakte-search__field input {
  min-width: 0;
  border: 1px solid var(--gwft-primary-light);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  padding: 0 12px;
  background: var(--gwft-neutral-white);
  color: var(--gwft-neutral-black);
  font-size: 13px;
  font-weight: 500;
  outline: none;
}

.gwft-kontakte-search__field > span {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gwft-primary-light);
  border-radius: 0 8px 8px 0;
  background: var(--gwft-neutral-white);
  color: var(--gwft-primary);
  font-size: 21px;
}

.gwft-kontakte-search__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gwft-kontakte-filter,
.gwft-kontakte-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 96px;
  border-radius: 8px;
  border: 1px solid var(--gwft-primary);
  background: var(--gwft-neutral-light);
  color: var(--gwft-primary);
  font-size: 13px;
  font-weight: 600;
}

.gwft-kontakte-filter.is-active {
  border-color: var(--gwft-secondary);
  background: var(--gwft-secondary-gradient);
  color: var(--gwft-neutral-white);
}

.gwft-kontakte-action {
  min-width: 34px;
  width: 34px;
  padding: 0;
}

.gwft-kontakte-action--neutral {
  border-color: var(--gwft-neutral-black);
}

.gwft-kontakte-status {
  margin-left: 12px;
  color: var(--gwft-primary-light);
  font-size: 13px;
  font-weight: 500;
}

.gwft-kontakte-list-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0 22px 22px;
  overflow: hidden;
  border: 1px solid var(--gwft-primary-light);
  border-radius: 16px;
  background: var(--gwft-neutral-light);
}

.gwft-kontakte-table-header,
.gwft-kontakte-card {
  display: grid;
  grid-template-columns: 44px 1.6fr 54px 1.35fr 1.45fr;
  column-gap: 12px;
  align-items: center;
}

.gwft-kontakte-table-header {
  flex: 0 0 auto;
  min-height: 42px;
  border-bottom: 1px solid rgba(86, 86, 86, 0.24);
  color: var(--gwft-secondary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.gwft-kontakte-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding-top: 10px;
  scrollbar-width: none;
}

.gwft-kontakte-list::-webkit-scrollbar {
  display: none;
}

.gwft-kontakte-card {
  min-height: 72px;
  padding: 10px 16px;
  border: 1px solid var(--gwft-primary-light);
  border-radius: 12px;
  background: var(--gwft-neutral-white);
  color: var(--gwft-primary);
}

.gwft-kontakte-card__type,
.gwft-kontakte-card__route {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--gwft-primary);
}

.gwft-kontakte-card__type .material-symbols-rounded {
  font-size: 29px;
}

.gwft-kontakte-card__route .material-symbols-rounded {
  font-size: 24px;
}

.gwft-kontakte-card__name,
.gwft-kontakte-card__address,
.gwft-kontakte-card__contact {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gwft-kontakte-card__title {
  overflow: hidden;
  color: var(--gwft-primary);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.gwft-kontakte-card__rating {
  color: var(--gwft-primary-light);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1px;
}

.gwft-kontakte-card__rating--low {
  color: var(--gwft-secondary);
}

.gwft-kontakte-card__street,
.gwft-kontakte-card__meta,
.gwft-kontakte-card__contact a,
.gwft-kontakte-empty,
.gwft-kontakte-error {
  overflow: hidden;
  color: var(--gwft-primary-light);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gwft-kontakte-card__meta {
  color: var(--gwft-primary);
  font-weight: 600;
}

.gwft-kontakte-card__contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-decoration: none;
}

.gwft-kontakte-card__contact .material-symbols-rounded {
  flex: 0 0 auto;
  color: var(--gwft-primary);
  font-size: 18px;
}

.gwft-kontakte-empty,
.gwft-kontakte-error {
  padding: 18px 2px;
  color: var(--gwft-primary);
  white-space: normal;
}

.gwft-kontakte-error {
  color: var(--gwft-secondary);
}

@media (max-width: 820px) {
  .gwft-header {
    grid-template-columns: 1fr auto;
  }

  .gwft-header__context {
    display: none;
  }

  .gwft-header__brand {
    font-size: 18px;
  }

  .gwft-header__user {
    display: none;
  }

  .gwft-module-shell {
    padding: 16px;
  }

  .gwft-kontakte-search {
    width: 100%;
  }

  .gwft-kontakte-table-header,
  .gwft-kontakte-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .gwft-kontakte-table-header span:nth-child(n+3),
  .gwft-kontakte-card__route,
  .gwft-kontakte-card__address {
    display: none;
  }

  .gwft-kontakte-card__contact {
    grid-column: 2;
  }
}
