/* ==========================================================================
   Admin panel — same shell as the user cabinet
   ========================================================================== */

/* ---------- header badge ---------- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  padding: 6px 12px;
  border-radius: 999px;
}
.admin-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- sections ---------- */
.admin-section { display: none; }
.admin-section.is-active { display: block; animation: adminRise 0.5s var(--ease-out); }
@keyframes adminRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.admin-head { display: grid; gap: 6px; }
.admin-head__title {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.admin-head__sub { font-size: 15px; color: var(--muted); }

/* ---------- stats ---------- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: clamp(16px, 3vw, 26px);
}
@media (min-width: 800px) {
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.5vw, 24px);
  display: grid;
  gap: 8px;
  transition: transform 0.35s var(--ease-out), background-color 0.35s var(--ease-out);
}
.stat-card:hover { transform: translateY(-4px); background: #ececef; }
.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid rgba(12, 12, 13, 0.16);
  background: var(--white);
  display: grid;
  place-items: center;
  color: var(--ink);
  margin-bottom: 4px;
}
.stat-card__icon svg { width: 20px; height: 20px; }
.stat-card--lime .stat-card__icon {
  border-color: rgba(12, 12, 13, 0.4);
  background: rgba(255, 255, 255, 0.45);
}
.stat-card__num {
  font-family: var(--mono);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-card__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.stat-card--alert .stat-card__num { color: var(--danger); }
.stat-card--lime { background: var(--lime); }
.stat-card--lime .stat-card__label { color: rgba(12, 12, 13, 0.65); }

/* ---------- tables ---------- */
.admin-table-wrap {
  margin-top: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}
.admin-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background-color 0.25s var(--ease-out); }
.admin-table tbody tr:hover { background: var(--surface); }
.admin-table tr[data-href] { cursor: pointer; }
.admin-table tr[data-href]:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: -2px;
}
.admin-table .mono { font-family: var(--mono); font-size: 13.5px; }
.admin-table a.row-link { font-weight: 600; color: var(--ink); }
.admin-table a.row-link:hover { color: var(--olive-deep); }

.table-scroll { overflow-x: auto; }
.table-scroll .admin-table { min-width: 720px; }

/* status chips → shared in cabinet.css */

/* ---------- settings ---------- */
.admin-cards { margin-top: clamp(16px, 3vw, 26px); display: grid; gap: 14px; }
.admin-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: clamp(20px, 3.5vw, 40px);
  animation: adminRise 0.5s var(--ease-out) both;
}
.admin-card:nth-child(2) { animation-delay: 0.07s; }
.admin-card:nth-child(3) { animation-delay: 0.14s; }
.admin-card__head { display: grid; gap: 5px; }
.admin-card__title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.admin-card__desc { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 620px; }

.admin-form { margin-top: 22px; display: grid; gap: 18px; }
.admin-cols {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 800px) {
  .admin-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .admin-cols .dfield + .dfield { margin-top: 0; }
}

.admin-checks { display: grid; gap: 4px; }
.admin-checks .checkbox { margin-top: 10px; }

.fee-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(210, 250, 50, 0.3);
  color: var(--ink-soft);
}
.fee-hint.is-error { background: rgba(229, 83, 60, 0.12); color: var(--danger); }

.admin-form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .admin-section.is-active, .admin-card { animation: none; }
}

/* поля формы аккаунта — валидация */
.admin-form .dfield { display: grid; gap: 6px; }
.admin-form .dfield__label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft, #3d3d43);
}
.admin-form .dinput {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid var(--line, #e3e3e7);
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  background: var(--white);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.admin-form .dinput:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 4px rgba(130, 170, 60, 0.12);
}
.admin-form .dinput.has-error {
  border-color: #e5533c;
}
.admin-form .dfield__error {
  display: none;
  font-size: 12.5px;
  color: #e5533c;
  font-weight: 500;
}
.admin-form .dfield__error:not([hidden]) {
  display: block;
}
.admin-form .admin-form__footer {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

/* кнопка загрузки */
.admin-form .btn.is-loading { opacity: 0.6; pointer-events: none; }
.admin-form .btn.is-done { background: var(--olive); border-color: var(--olive-deep); }

/* глаз — точно как в профиле (auth.css) */
.admin-form .pass-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.2s, background 0.2s;
}
.admin-form .pass-toggle:hover { color: var(--ink); background: var(--surface); }
.admin-form .pass-toggle svg { width: 18px; height: 18px; }
.admin-form .pass-toggle .pass-toggle__off { display: none; }
.admin-form .pass-toggle.is-visible .pass-toggle__on { display: none; }
.admin-form .pass-toggle.is-visible .pass-toggle__off { display: block; }
