.tabs,
.admin-tabs {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 14px 0 18px;
  padding: 6px;
  border: 1px solid rgba(167, 170, 99, .18);
  border-radius: 17px;
  background: rgba(18, 26, 27, .88);
  box-shadow:
    0 14px 34px rgba(18, 26, 27, .48),
    inset 0 1px 0 rgba(234, 230, 210, .05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.admin-tabs {
  grid-template-columns: repeat(6, 1fr);
}

.tab,
.admin-tab {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 9px;
  color: rgba(234, 230, 210, .57);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.tab:hover,
.admin-tab:hover {
  color: var(--cream);
  background: rgba(80, 80, 57, .24);
}

.tab.active,
.admin-tab.active {
  border-color: rgba(167, 170, 99, .34);
  color: var(--ink);
  background: var(--olive);
  box-shadow:
    0 8px 22px rgba(18, 26, 27, .30),
    inset 0 1px 0 rgba(234, 230, 210, .34);
}

.panel,
.admin-panel {
  display: none;
}

.panel.active,
.admin-panel.active {
  display: block;
  animation: panel-in .22s ease both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.summary-label {
  color: rgba(234, 230, 210, .76);
  font-size: 15px;
  font-weight: 600;
}

.summary-row strong {
  color: var(--cream);
  font-size: clamp(22px, 5.4vw, 28px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(167, 170, 99, .18);
  border-radius: var(--radius-md);
  padding: 17px;
  background:
    linear-gradient(135deg, rgba(80, 80, 57, .35), rgba(18, 26, 27, .72));
  box-shadow:
    0 14px 34px rgba(18, 26, 27, .25),
    inset 0 1px 0 rgba(234, 230, 210, .045);
  transition:
    border-color .2s ease,
    background-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 170, 99, .35), transparent);
}

.card-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.card-title {
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.badge {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  border: 1px solid rgba(167, 170, 99, .32);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--olive);
  background: rgba(167, 170, 99, .08);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--olive);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.02em;
}

form {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(167, 170, 99, .17);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(80, 80, 57, .25), rgba(18, 26, 27, .56));
  box-shadow: inset 0 1px 0 rgba(234, 230, 210, .04);
}

label {
  display: grid;
  gap: 7px;
  color: rgba(234, 230, 210, .83);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(167, 170, 99, .20);
  border-radius: var(--radius-sm);
  outline: none;
  padding: 11px 13px;
  color: var(--cream);
  background: rgba(18, 26, 27, .70);
  box-shadow: inset 0 1px 0 rgba(234, 230, 210, .035);
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background-color .18s ease;
}

input::placeholder {
  color: rgba(234, 230, 210, .35);
}

input:hover,
select:hover {
  border-color: rgba(167, 170, 99, .36);
}

input:focus,
select:focus {
  border-color: var(--olive);
  background: rgba(18, 26, 27, .88);
  box-shadow: 0 0 0 3px rgba(167, 170, 99, .10);
}

input[type="date"],
input[type="file"],
select {
  color-scheme: dark;
}

.check {
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 9px;
  padding: 4px 0;
  color: rgba(234, 230, 210, .67);
  font-weight: 500;
  line-height: 1.45;
}

.check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--olive);
}

/* «Мои реквизиты» на главной партнерского кабинета. */
.requisites-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.requisites-card .card-row {
  align-items: center;
}

.requisites-card .secondary {
  min-height: 40px;
  padding: 8px 14px;
}

.requisites-text {
  position: relative;
  z-index: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.5;
}

.requisites-updated {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
}

.requisites-form {
  position: relative;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.requisites-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 11px 13px;
  border: 1px solid rgba(167, 170, 99, .20);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--cream);
  background: rgba(18, 26, 27, .70);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
}

/* Общие правила (form { display: grid }) не должны показывать скрытое. */
.requisites-card [hidden],
.requisites-card .form-message:empty {
  display: none;
}

.requisites-form textarea:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(167, 170, 99, .10);
}

/* Регионы в анкете кандидата: галочки-плашки, можно отметить несколько. */
.region-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.region-picker legend {
  margin-bottom: 7px;
  padding: 0;
  color: rgba(234, 230, 210, .83);
  font-size: 13px;
  font-weight: 650;
}

.region-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}

.region-option input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
}

.region-option span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(234, 230, 210, .18);
  border-radius: 999px;
  color: rgba(234, 230, 210, .78);
  background: rgba(18, 26, 27, .55);
  font-size: 14px;
  font-weight: 650;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.region-option input:checked + span {
  border-color: var(--olive);
  color: var(--ink);
  background: var(--olive);
}

.region-option input:focus-visible + span {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

/* Поле формы, где подпись, поле ввода и подсказка идут отдельными блоками. */
.field {
  display: grid;
  gap: 7px;
}

.field-hint {
  color: rgba(234, 230, 210, .48);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.field-hint.is-error {
  color: var(--cream);
  font-weight: 650;
}

/* Дата рождения: текстовое поле + кнопка-календарь справа. */
/* Шрифт как у остальных полей формы (они берут его от <label>). */
.date-field {
  position: relative;
  font-size: 13px;
  font-weight: 650;
}

.date-field > input[type="text"] {
  padding-right: 56px;
  letter-spacing: .02em;
}

.date-field > input.is-invalid {
  border-color: rgba(234, 230, 210, .70);
  box-shadow: 0 0 0 3px rgba(234, 230, 210, .08);
}

.date-field-button {
  position: absolute;
  top: 5px;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 42px;
  border: 1px solid rgba(167, 170, 99, .22);
  border-radius: 10px;
  color: var(--olive);
  background: rgba(80, 80, 57, .38);
  transition:
    color .18s ease,
    background-color .18s ease,
    border-color .18s ease;
}

.date-field-button:hover,
.date-field-button:focus-within {
  border-color: var(--olive);
  color: var(--cream);
  background: var(--olive-deep);
}

.date-field-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Настоящий календарь браузера лежит прозрачным слоем поверх кнопки:
   нажатие по кнопке открывает его и на телефоне, и на компьютере. */
.date-field-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* меньше 16px iPhone приближает экран при нажатии */
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
}

.date-field-picker::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.primary,
.secondary,
.danger {
  min-height: 44px;
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  border: 1px solid var(--olive);
  color: var(--ink);
  background: var(--olive);
  box-shadow:
    0 10px 24px rgba(18, 26, 27, .30),
    inset 0 1px 0 rgba(234, 230, 210, .30);
}

.secondary {
  border: 1px solid rgba(167, 170, 99, .25);
  color: var(--cream);
  background: var(--olive-deep);
}

.danger {
  border: 1px solid rgba(234, 230, 210, .26);
  color: var(--cream);
  background: rgba(80, 80, 57, .72);
}

.primary:hover,
.secondary:hover,
.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(18, 26, 27, .36);
}

.primary:active,
.secondary:active,
.danger:active {
  transform: translateY(0) scale(.985);
}

.primary:focus-visible,
.secondary:focus-visible,
.danger:focus-visible,
.tab:focus-visible,
.admin-tab:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.form-message {
  min-height: 22px;
  color: var(--olive);
  font-size: 13px;
  font-weight: 650;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(167, 170, 99, .18);
  border-radius: var(--radius-md);
  background: rgba(18, 26, 27, .58);
  box-shadow:
    0 18px 44px rgba(18, 26, 27, .30),
    inset 0 1px 0 rgba(234, 230, 210, .04);
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(167, 170, 99, .13);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: rgba(234, 230, 210, .68);
  background: rgba(18, 26, 27, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color .18s ease;
}

tbody tr:hover {
  background: rgba(167, 170, 99, .055);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td input,
td select {
  min-width: 140px;
  min-height: 38px;
  padding: 8px 9px;
  border-radius: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-link {
  color: var(--olive);
  font-weight: 750;
  text-decoration-color: rgba(167, 170, 99, .32);
  text-underline-offset: 3px;
}

.admin-link:hover {
  color: var(--cream);
  text-decoration-color: var(--cream);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(167, 170, 99, .32);
    box-shadow:
      0 18px 42px rgba(18, 26, 27, .34),
      inset 0 1px 0 rgba(234, 230, 210, .07);
  }

  .card:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 680px) {
  .app-shell,
  .admin-shell {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .admin-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-row {
    gap: 9px;
  }

  .badge {
    max-width: 44%;
  }

  form {
    padding: 15px;
    border-radius: 20px;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 31px;
  }

  .tabs {
    gap: 4px;
    padding: 5px;
  }

  .tab {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 12px;
  }

  .card {
    padding: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Мои кандидаты: поиск и «Показать еще» ---------- */
.candidate-search {
  margin-bottom: 10px;
}

.candidate-search[hidden],
.candidate-more[hidden] {
  display: none;
}

.candidate-more {
  width: 100%;
  margin-top: 10px;
}
