/**
 * Общий UI подстраниц админки (/admin/stats, техника, тарифы, …).
 * Подключать после admin_theme.css. Классы stats-* — общие блоки.
 */

body.admin-portal {
    --muted: rgba(248, 250, 252, 0.48);
    margin: 0;
    color: #f1f5f9;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding: 0 0 max(40px, env(safe-area-inset-bottom));
    min-height: 100vh;
}

body.admin-portal * {
    box-sizing: border-box;
}

body.admin-portal a {
    color: inherit;
    text-decoration: none;
}

.stats-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) clamp(14px, 3.5vw, 28px) 0;
}

/* ——— Навигация ——— */
.stats-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    padding: 14px 18px;
    margin-bottom: 28px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(155deg, rgba(26, 26, 28, 0.88) 0%, rgba(10, 10, 12, 0.82) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 20px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
}

.stats-nav__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.stats-nav__logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.stats-nav__titles {
    min-width: 0;
}

.stats-nav__eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.45);
    margin: 0 0 2px;
}

.stats-nav__title {
    font-family: "Montserrat", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-nav__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.stats-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.82);
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.stats-nav__link:hover {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fff;
}

.stats-nav__link.is-active {
    background: linear-gradient(145deg, #dc2626 0%, #991b1b 100%);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 4px 22px rgba(220, 38, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stats-nav__link--ghost {
    border-color: rgba(248, 113, 113, 0.28);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.15);
}

.stats-nav__link--ghost:hover {
    border-color: rgba(248, 113, 113, 0.55);
    color: #fff;
}

button.stats-nav__link {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}

/* ——— Flash ——— */
.stats-flash {
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
}

.stats-flash--error {
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.stats-flash--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
}

.stats-flash--warning {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(250, 204, 21, 0.35);
    color: #fef08a;
}

.stats-flash--info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
}

/* ——— Hero ——— */
.stats-hero {
    margin-bottom: 28px;
}

.stats-hero__h1 {
    font-family: "Montserrat", sans-serif;
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 0 0 10px;
    line-height: 1.15;
    background: linear-gradient(105deg, #fff 0%, rgba(248, 250, 252, 0.82) 45%, rgba(252, 165, 165, 0.95) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stats-hero__sub {
    margin: 0 0 16px;
    max-width: 52ch;
    color: rgba(248, 250, 252, 0.55);
    font-size: 0.95rem;
    font-weight: 500;
}

.stats-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.stats-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: rgba(248, 250, 252, 0.9);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-chip--accent {
    border-color: rgba(220, 38, 38, 0.45);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(0, 0, 0, 0.35) 100%);
    box-shadow: 0 0 24px rgba(220, 38, 38, 0.12);
}

.stats-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

/* ——— Фильтры ——— */
.stats-filter {
    border-radius: 22px;
    padding: 22px 24px 20px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(165deg, rgba(24, 24, 26, 0.92) 0%, rgba(12, 12, 14, 0.88) 100%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stats-filter__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.stats-filter__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.45);
    margin: 0;
}

.stats-filter__hint {
    font-size: 12px;
    color: rgba(248, 250, 252, 0.4);
    margin: 0;
}

.stats-filter__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px 16px;
    align-items: end;
}

.stats-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-field span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.45);
}

.stats-field input[type="date"],
.stats-field input[type="time"],
.stats-field input[type="tel"],
.stats-field input[type="number"],
.stats-field input[type="text"],
.stats-field input[type="password"],
.stats-field input[type="email"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.stats-field input[type="password"]::placeholder,
.stats-field input[type="text"]::placeholder {
    color: rgba(248, 250, 252, 0.45);
}

/* Поля в строках таблицы (смена пароля): без .stats-field наследуют светлый фон браузера */
body.admin-portal .stats-table-wrap input[type="password"],
body.admin-portal .stats-table-wrap input[type="text"] {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

body.admin-portal .stats-table-wrap input[type="password"]:focus,
body.admin-portal .stats-table-wrap input[type="text"]:focus {
    outline: none;
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.stats-field input:focus,
.stats-field select:focus,
.stats-field textarea:focus {
    outline: none;
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.stats-btn-primary {
    min-height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 48%, #e11d48 100%);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stats-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 32px rgba(220, 38, 38, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.stats-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-presets__cap {
    font-size: 11px;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.38);
    margin-right: 4px;
}

.stats-preset {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(147, 197, 253, 0.95);
    background: rgba(30, 58, 138, 0.22);
    border: 1px solid rgba(59, 130, 246, 0.28);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.stats-preset:hover {
    background: rgba(37, 99, 235, 0.28);
    border-color: rgba(96, 165, 250, 0.45);
}

/* ——— Глобальная сводка ——— */
.stats-summary {
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 22px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.28);
    line-height: 1.65;
}

.stats-summary strong {
    color: #fff;
    font-weight: 700;
}

/* ——— KPI ——— */
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.stats-kpi {
    position: relative;
    border-radius: 18px;
    padding: 18px 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(155deg, rgba(28, 28, 30, 0.95) 0%, rgba(14, 14, 16, 0.88) 100%);
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stats-kpi::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -25%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.stats-kpi--accent {
    border-color: rgba(220, 38, 38, 0.28);
    background:
        radial-gradient(ellipse 80% 80% at 100% 0%, rgba(220, 38, 38, 0.12) 0%, transparent 55%),
        linear-gradient(155deg, rgba(32, 22, 24, 0.96) 0%, rgba(14, 10, 12, 0.9) 100%);
}

.stats-kpi__label {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.42);
    margin-bottom: 8px;
}

.stats-kpi__val {
    position: relative;
    z-index: 1;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(1.25rem, 2.8vw, 1.55rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    line-height: 1.2;
}

.stats-kpi--accent .stats-kpi__val {
    color: #fecaca;
    text-shadow: 0 0 40px rgba(220, 38, 38, 0.25);
}

.stats-kpi__suffix {
    font-size: 12px;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.45);
    margin-left: 4px;
}

/* ——— Панели секций ——— */
.stats-panel {
    border-radius: 24px;
    padding: 26px 26px 28px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(168deg, rgba(26, 26, 28, 0.94) 0%, rgba(12, 12, 14, 0.9) 100%);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stats-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.stats-panel__title {
    font-family: "Montserrat", sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 0 6px;
    color: #fff;
}

.stats-panel__lede {
    margin: 0;
    font-size: 13px;
    color: rgba(248, 250, 252, 0.5);
    max-width: 56ch;
    line-height: 1.55;
}

.stats-mini-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 22px;
    margin-bottom: 18px;
    font-size: 14px;
}

.stats-mini-row span {
    color: rgba(248, 250, 252, 0.5);
}

.stats-mini-row strong {
    color: #fff;
    font-weight: 800;
}

.stats-h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.42);
    margin: 22px 0 12px;
}

.stats-h3:first-of-type {
    margin-top: 0;
}

.stats-empty {
    color: rgba(248, 250, 252, 0.42);
    font-size: 14px;
    margin: 8px 0;
}

/* ——— Таблицы ——— */
.stats-table-wrap {
    margin: 0 -8px;
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}

.stats-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
    padding: 12px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
}

.stats-table th {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.45);
    background: rgba(0, 0, 0, 0.35);
}

.stats-table tbody tr {
    transition: background 0.12s ease;
}

.stats-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* ——— Сотрудники: форма «Новый сотрудник» — ровная сетка ——— */
body.admin-portal .staff-add-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(132px, 160px);
    gap: 12px 14px;
    align-items: end;
}

body.admin-portal .staff-add-form .stats-field {
    min-width: 0;
}

body.admin-portal .staff-add-form .stats-field > span:first-child {
    min-height: 30px;
    display: flex;
    align-items: flex-end;
    line-height: 1.25;
}

body.admin-portal .staff-add-form .staff-add-form__submit {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

body.admin-portal .staff-add-form .staff-add-form__submit .stats-btn-primary {
    width: 100%;
    min-height: 44px;
}

@media (max-width: 1180px) {
    body.admin-portal .staff-add-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body.admin-portal .staff-add-form .staff-add-form__submit {
        grid-column: 1 / -1;
        max-width: 280px;
    }
}

@media (max-width: 720px) {
    body.admin-portal .staff-add-form {
        grid-template-columns: 1fr;
    }
    body.admin-portal .staff-add-form .staff-add-form__submit {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Форма сотрудника: явный цвет текста и каретки + Chrome autofill на тёмном фоне */
body.admin-portal .staff-add-form input[type="text"],
body.admin-portal .staff-add-form input[type="password"],
body.admin-portal .staff-add-form select {
    color: #f8fafc !important;
    caret-color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
}

body.admin-portal .staff-add-form input[type="text"]::placeholder,
body.admin-portal .staff-add-form input[type="password"]::placeholder {
    color: rgba(248, 250, 252, 0.45) !important;
    -webkit-text-fill-color: rgba(248, 250, 252, 0.45);
}

body.admin-portal .staff-add-form input:-webkit-autofill,
body.admin-portal .staff-add-form input:-webkit-autofill:hover,
body.admin-portal .staff-add-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.95) inset !important;
    transition: background-color 99999s ease-out 0s;
}

body.admin-portal .staff-add-form select option {
    background: #0f172a;
    color: #f8fafc;
}

/* Блок списка сотрудников */
body.admin-portal .staff-list-panel {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 14, 22, 0.55);
    padding: 18px 18px 8px;
}

body.admin-portal .staff-list-panel__title {
    margin-bottom: 14px !important;
    letter-spacing: 0.06em;
}

body.admin-portal .staff-table-wrap {
    margin: 0;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.25);
}

body.admin-portal .stats-table--staff-card thead th {
    background: rgba(15, 23, 42, 0.85);
}

body.admin-portal .stats-table--staff tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

body.admin-portal .staff-table__login {
    font-weight: 700;
    letter-spacing: 0.02em;
}

body.admin-portal .staff-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

body.admin-portal .staff-badge--admin {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

body.admin-portal .staff-badge--operator {
    color: #a5b4fc;
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(99, 102, 241, 0.1);
}

body.admin-portal .staff-badge--instructor {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

body.admin-portal .staff-status {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

body.admin-portal .staff-status--on {
    color: #86efac;
}

body.admin-portal .staff-status--off {
    color: rgba(248, 250, 252, 0.45);
}

/* Компактные кнопки (~половина от стандартных) */
body.admin-portal .staff-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

body.admin-portal .staff-btn-compact:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.admin-portal .staff-btn-compact--danger {
    color: #fecaca;
    background: linear-gradient(180deg, rgba(185, 28, 28, 0.55), rgba(127, 29, 29, 0.45));
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.admin-portal .staff-btn-compact--secondary {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.55);
    border-color: rgba(148, 163, 184, 0.35);
}

body.admin-portal .staff-btn-compact--outline-danger {
    color: #fca5a5;
    background: transparent;
    border-color: rgba(248, 113, 113, 0.45);
}

body.admin-portal .staff-btn-compact--outline-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

body.admin-portal .staff-btn-compact:not(:disabled):hover {
    transform: translateY(-1px);
}

/* Таблица сотрудников */
body.admin-portal .stats-table--staff {
    min-width: 760px;
}

body.admin-portal .stats-table--staff .stats-table__col-actions {
    min-width: 380px;
    width: 36%;
    text-align: right;
}

body.admin-portal .stats-table--staff .stats-table__cell-actions {
    vertical-align: middle;
}

body.admin-portal .staff-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
}

body.admin-portal .staff-row-actions__toggle {
    display: inline-flex;
    flex: 0 0 auto;
}

body.admin-portal .staff-row-actions__pwd {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 220px;
    justify-content: flex-end;
    min-width: min(100%, 320px);
}

body.admin-portal .staff-row-actions__pwd-input {
    flex: 1 1 130px;
    width: 150px;
    max-width: 190px;
    min-height: 30px !important;
    min-width: 120px;
    padding: 6px 10px !important;
    font-size: 13px !important;
    box-sizing: border-box;
    color: #f8fafc !important;
    caret-color: #f8fafc;
    -webkit-text-fill-color: #f8fafc;
}

body.admin-portal .staff-row-actions__pwd-input:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc !important;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.95) inset !important;
}

body.admin-portal .staff-row-actions__delete {
    display: inline-flex;
    flex: 0 0 auto;
}

/* ——— Экспорт ——— */
.stats-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-action {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(191, 219, 254, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(15, 23, 42, 0.55);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.stats-action:hover {
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(30, 41, 59, 0.65);
}

/* ——— Возврат ——— */
.stats-refund {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
}

.stats-btn-secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
    transition: border-color 0.15s ease;
}

.stats-btn-secondary:hover {
    border-color: rgba(248, 250, 252, 0.35);
}

/* ——— Бары ——— */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.stats-bar__lbl {
    width: 44px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.48);
    font-variant-numeric: tabular-nums;
}

.stats-bar__track {
    flex: 1;
    height: 26px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    min-width: 0;
}

.stats-bar__fill {
    height: 100%;
    min-width: 3px;
    border-radius: 9px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.25) 0%, rgba(52, 211, 153, 0.85) 55%, rgba(16, 185, 129, 0.95) 100%);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.25);
}

.stats-bar__num {
    width: 40px;
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .stats-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-nav__links {
        justify-content: flex-start;
    }

    .stats-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-filter__grid {
        grid-template-columns: 1fr;
    }

    .stats-btn-primary {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .stats-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ——— Формы подстраниц (тарифы, картинги, трасса) ——— */
body.admin-portal .stats-field select,
body.admin-portal .stats-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

body.admin-portal .stats-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

body.admin-portal .stats-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

body.admin-portal .stats-form-row .stats-field {
    flex: 1 1 160px;
    min-width: 0;
}

body.admin-portal .stats-form-row .stats-field--narrow {
    flex: 0 1 120px;
}

body.admin-portal .stats-form-row .stats-field--ip input {
    max-width: 200px;
}

body.admin-portal .stats-btn-danger {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.2);
    transition: border-color 0.15s ease, background 0.15s ease;
}

body.admin-portal .stats-btn-danger:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(185, 28, 28, 0.35);
}

body.admin-portal .stats-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.admin-portal .stats-panel > p {
    color: rgba(248, 250, 252, 0.52);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 14px;
}

body.admin-portal .stats-panel .stats-muted {
    color: rgba(248, 250, 252, 0.48);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
}

body.admin-portal .stats-panel .stats-muted a {
    color: rgba(147, 197, 253, 0.95);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.admin-portal .stats-panel code {
    font-size: 0.88em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

body.admin-portal .stats-hex {
    word-break: break-all;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: rgba(147, 197, 253, 0.95);
    font-size: 12px;
    line-height: 1.5;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

body.admin-portal .stats-callout {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

body.admin-portal .stats-callout__title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.5);
    margin: 0 0 10px;
}

body.admin-portal .stats-callout__result {
    margin-top: 10px;
    font-size: 0.88rem;
    color: rgba(248, 250, 252, 0.55);
    line-height: 1.5;
}

body.admin-portal .stats-board-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

body.admin-portal .stats-board-list {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    display: none;
}

body.admin-portal .stats-board-list.is-open {
    display: block;
}

body.admin-portal .stats-board-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    align-items: flex-end;
}

body.admin-portal .stats-board-item:last-child {
    border-bottom: none;
}

body.admin-portal .stats-board-item input[type="text"],
body.admin-portal .stats-board-item input[type="number"] {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: inherit;
    width: 160px;
}

body.admin-portal .stats-board-rank {
    min-width: 48px;
    font-weight: 800;
    color: rgba(248, 250, 252, 0.55);
    align-self: center;
}

body.admin-portal .stats-field--w-sm input {
    max-width: 140px;
}

body.admin-portal .stats-table--fit {
    min-width: 0;
}

body.admin-portal .stats-subtab {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.45);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(220, 38, 38, 0.12);
    color: rgba(254, 226, 226, 0.95);
}

body.admin-portal .stats-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

body.admin-portal .stats-reveal {
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.55;
}

body.admin-portal .stats-link-box {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    word-break: break-all;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(226, 232, 240, 0.9);
}

body.admin-portal .stats-warn {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(254, 243, 199, 0.95);
}

body.admin-portal .stats-radio-block {
    margin-bottom: 12px;
}

body.admin-portal .stats-radio-block label {
    cursor: pointer;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: rgba(248, 250, 252, 0.85);
    line-height: 1.45;
}

body.admin-portal .stats-radio-block input {
    margin-top: 3px;
    flex-shrink: 0;
}

body.admin-portal.admin-portal--narrow .stats-shell {
    max-width: 800px;
}

body.admin-portal.admin-portal--settings .stats-shell {
    max-width: 920px;
}

body.admin-portal .settings-slides {
    margin-bottom: 28px;
}

body.admin-portal .settings-slides__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.admin-portal .settings-slides__tab {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(248, 250, 252, 0.85);
    font-family: inherit;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.admin-portal .settings-slides__tab:hover {
    border-color: rgba(220, 38, 38, 0.55);
    color: #fff;
}

body.admin-portal .settings-slides__tab.is-active {
    border-color: rgba(220, 38, 38, 0.65);
    background: rgba(220, 38, 38, 0.18);
    color: rgba(254, 226, 226, 0.98);
}

body.admin-portal .settings-slides__panel {
    display: none;
}

body.admin-portal .settings-slides__panel.is-active {
    display: block;
}

body.admin-portal .settings-hub-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

body.admin-portal .settings-hub-links__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

body.admin-portal .settings-hub-links__card:hover {
    border-color: rgba(229, 9, 20, 0.45);
    background: rgba(229, 9, 20, 0.08);
}

body.admin-portal .settings-hub-links__title {
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #fecaca;
}

body.admin-portal .settings-hub-links__desc {
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(148, 163, 184, 0.95);
}

body.admin-portal .settings-hub-links__card--ext .settings-hub-links__title {
    color: #93c5fd;
}

body.admin-portal .stats-nav__links {
    flex-wrap: wrap;
    gap: 6px 4px;
}

@media (max-width: 720px) {
    body.admin-portal .stats-nav {
        flex-direction: column;
        align-items: stretch;
    }
    body.admin-portal .stats-nav__links {
        justify-content: flex-start;
    }
}

body.admin-portal .stats-hero__sub a {
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

body.admin-portal .stats-hero__sub a:hover {
    text-decoration: underline;
}

/* ——— Вход в админку ——— */
body.admin-login {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    font-family: "Manrope", system-ui, sans-serif;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
}

body.admin-login * {
    box-sizing: border-box;
}

body.admin-login .login-card {
    width: min(420px, 100%);
    padding: 32px 28px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(165deg, rgba(28, 28, 30, 0.96) 0%, rgba(12, 12, 14, 0.94) 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.admin-login .login-card h1 {
    margin: 0 0 8px;
    font-family: "Montserrat", sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    background: linear-gradient(105deg, #fff 0%, rgba(252, 165, 165, 0.9) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.admin-login .login-card > p {
    margin: 0 0 22px;
    font-size: 14px;
    color: rgba(148, 163, 184, 0.95);
    line-height: 1.55;
}

body.admin-login label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.9);
    margin-bottom: 8px;
}

body.admin-login input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 16px;
}

body.admin-login input:focus {
    outline: none;
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

body.admin-login button[type="submit"] {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 48%, #e11d48 100%);
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.35);
}

body.admin-login .login-err {
    margin-top: 14px;
    font-size: 13px;
    color: #fecaca;
    font-weight: 700;
}

body.admin-login .login-theme-row {
    margin: 16px 0 0;
    text-align: center;
}

body.admin-login .login-foot {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(147, 197, 253, 0.9);
    text-decoration: none;
    font-weight: 600;
}

body.admin-login .login-foot:hover {
    text-decoration: underline;
}

/* ——— Публичные /booking и «бронь принята» (тот же визуальный язык, без навигации админки) ——— */
body.admin-portal.booking-public {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: max(28px, env(safe-area-inset-top));
    padding-bottom: max(48px, env(safe-area-inset-bottom));
}

body.admin-portal.booking-public .stats-shell {
    width: 100%;
    max-width: 560px;
}

body.admin-portal.booking-public .booking-brand {
    text-align: center;
    margin-bottom: 24px;
}

body.admin-portal.booking-public .booking-brand__logo {
    display: block;
    margin: 0 auto 14px;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    border-radius: 12px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.admin-portal.booking-public .booking-brand__tag {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(248, 250, 252, 0.52);
    line-height: 1.45;
}

body.admin-portal.booking-public .stats-hero {
    text-align: center;
    margin-bottom: 22px;
}

body.admin-portal.booking-public .stats-hero__sub {
    margin-left: auto;
    margin-right: auto;
}

body.admin-portal.booking-public .stats-panel .stats-form-row {
    margin-top: 4px;
}

body.admin-portal.booking-public .booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    text-align: left;
}

body.admin-portal.booking-public .booking-grid-full {
    grid-column: 1 / -1;
}

@media (max-width: 520px) {
    body.admin-portal.booking-public .booking-grid {
        grid-template-columns: 1fr;
    }
}

body.admin-portal.booking-public .booking-submit-wrap {
    margin-top: 22px;
}

body.admin-portal.booking-public .booking-submit-wrap .stats-btn-primary {
    width: 100%;
}

body.admin-portal.booking-public .stats-field textarea {
    min-height: 96px;
}

body.admin-portal.booking-public.booking-success .stats-chip {
    font-size: 14px;
    padding: 10px 18px;
}

body.admin-portal.booking-public.booking-success .stats-actions {
    margin-top: 20px;
    margin-bottom: 0;
    justify-content: center;
}

/* Контроль смены / журнал действий */
.activity-summary-panel {
    margin-bottom: 20px;
}
.activity-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.activity-summary-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    font-size: 13px;
}
.activity-summary-chip__who {
    font-weight: 700;
    color: #f1f5f9;
}
.activity-summary-chip__n {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #22c55e;
}
.activity-summary-chip__lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.85);
}
.activity-filter-form {
    margin: 0;
}
.activity-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 16px;
    align-items: end;
}
.activity-filter-grid .stats-btn-primary,
.activity-filter-grid .stats-btn-secondary {
    align-self: end;
    height: 42px;
}

.activity-detail-cell {
    max-width: 420px;
    font-size: 13px;
    line-height: 1.45;
}

.activity-detail-text {
    display: inline-block;
    word-break: break-word;
    color: rgba(248, 250, 252, 0.92);
}

html[data-admin-theme="light"] .activity-detail-text {
    color: rgba(17, 24, 39, 0.88);
}

.stats-btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    font-size: 13px;
}
/* ===== Читаемость: контент админки (навигация .stats-nav без изменений) ===== */
body.admin-portal {
    font-size: 16px;
}

body.admin-portal .stats-filter__label,
body.admin-portal .stats-field span,
body.admin-portal .stats-kpi__label {
    font-size: 12px;
}

body.admin-portal .stats-btn-primary,
body.admin-portal .stats-btn-secondary,
body.admin-portal .stats-btn-clear {
    font-size: 13px;
}

body.admin-portal .stats-table th {
    font-size: 12px;
}

body.admin-portal .stats-table td {
    font-size: 15px;
}

body.admin-portal .stats-h3 {
    font-size: 13px;
}

body.admin-portal .stats-panel__lede {
    font-size: 14px;
}

body.admin-portal .stats-mini-row {
    font-size: 15px;
}

body.admin-portal .stats-chip {
    font-size: 13px;
}

body.admin-portal .activity-summary-chip__lbl {
    font-size: 12px;
}

/* ——— Поднавигация «Разделы» (журналы, техника, сотрудники) ——— */
body.admin-portal .admin-sections-subnav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 10px;
    margin: -12px 0 22px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(155deg, rgba(20, 20, 22, 0.92) 0%, rgba(10, 10, 12, 0.88) 100%);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

body.admin-portal .admin-sections-subnav__label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.4);
    padding-right: 4px;
}

body.admin-portal .admin-sections-subnav__link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(248, 250, 252, 0.82);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body.admin-portal .admin-sections-subnav__link:hover {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.22);
    color: #fff;
}

body.admin-portal .admin-sections-subnav__link.is-active {
    border-color: rgba(220, 38, 38, 0.65);
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

.stats-btn-clear:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
}
