:root {
    --admin-bg: #090b12;
    --admin-surface: #171a24;
    --admin-surface-soft: #1e2230;
    --admin-surface-elevated: #242938;
    --admin-line: rgba(255, 255, 255, 0.08);
    --admin-text: #f4f7ff;
    --admin-muted: #9aa2b4;
    --admin-accent: #19b408;
    --admin-accent-soft: rgba(0, 223, 143, 0.18);
    --admin-sidebar: #05070d;
}

body.admin-body {
    margin: 0;
    background: radial-gradient(circle at 30% -20%, rgba(0, 223, 143, 0.14), transparent 48%), var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Barlow', sans-serif;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.25s ease;
}

.admin-shell.sidebar-collapsed {
    grid-template-columns: 92px 1fr;
}

.admin-shell.sidebar-collapsed .sidebar-brand,
.admin-shell.sidebar-collapsed .menu-group-title,
.admin-shell.sidebar-collapsed .admin-link span {
    display: none;
}

.admin-shell.sidebar-collapsed .sidebar-brand-wrap {
    justify-content: center;
}

.admin-shell.sidebar-collapsed .admin-link {
    justify-content: center;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
}

.admin-sidebar {
    background: var(--admin-sidebar);
    color: #fff;
    padding: 1rem 0.75rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--admin-line);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.55rem;
}

.sidebar-fit-badge {
    background: #c9ec1a;
    color: #050505;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.2rem 0.38rem;
    border-radius: 0.2rem;
}

.sidebar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.65rem;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.menu-group {
    margin-bottom: 0.7rem;
}

.menu-group-title {
    color: #7f889f;
    text-transform: none;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    margin: 0.55rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.5rem;
    color: #d8deef;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.92rem;
}

.admin-link i {
    color: #7e869d;
}

.admin-link:hover,
.admin-link:focus,
.admin-link.active {
    background: var(--admin-accent-soft);
    color: #b0ffd5;
    border-color: rgba(0, 223, 143, 0.3);
}

.admin-link:hover i,
.admin-link:focus i,
.admin-link.active i {
    color: var(--admin-accent);
}

.admin-link.is-disabled {
    opacity: 0.72;
    pointer-events: none;
}

.sidebar-footer {
    padding-top: 0.9rem;
}

.sidebar-footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.24);
    color: #dbe2f5;
    border-radius: 0.55rem;
    font-size: 0.9rem;
}

.sidebar-footer .btn-outline-light:hover,
.sidebar-footer .btn-outline-light:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--admin-line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.sidebar-toggle {
    border: 1px solid var(--admin-line);
    background: var(--admin-surface);
    border-radius: 0.5rem;
    padding: 0.55rem 0.7rem;
    color: #d6ddf2;
}

.topbar-heading {
    flex: 1;
}

.topbar-title,
.metric-card h2,
.panel-card h3 {
    font-family: 'Space Grotesk', sans-serif;
}

.topbar-title {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 0.45rem;
    border: 1px solid var(--admin-line);
    background: var(--admin-surface);
    padding: 0.35rem 0.55rem;
    min-width: 150px;
}

.topbar-search i {
    color: #73809a;
}

.topbar-search input {
    background: transparent;
    border: 0;
    color: var(--admin-text);
    font-size: 0.82rem;
    width: 100%;
    outline: none;
}

.topbar-search input::placeholder {
    color: #758099;
}

.admin-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #3c6ba9;
    color: #fff;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.admin-content {
    padding: 1.25rem;
}

.metric-label,
.panel-kicker {
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.73rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-card,
.panel-card,
.challenge-row,
.empty-state {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--admin-line);
    border-radius: 0.6rem;
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.metric-card h2 {
    margin: 0;
    font-size: 2rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.8rem;
}

.metric-card--icon {
    display: flex;
    align-items: end;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.metric-card--icon i {
    font-size: 2rem;
    color: rgba(0, 223, 143, 0.55);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.chart-panel h3 {
    margin: 0;
    font-size: 1rem;
}

.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.chart-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 0.45rem;
    border: 1px solid var(--admin-line);
    color: #b3bcce;
    font-size: 0.78rem;
}

.chart-placeholder {
    min-height: 220px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 0.55rem;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    background-color: rgba(0, 0, 0, 0.12);
}

.chart-placeholder--circle {
    border-style: solid;
    background-image: radial-gradient(circle at center, rgba(0, 223, 143, 0.15) 0 34%, transparent 34% 100%);
}

.chart-placeholder--bars {
    position: relative;
    overflow: hidden;
}

.chart-placeholder--bars::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 60%;
    background:
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 14% 100% / 6% 75% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 24% 100% / 6% 48% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 34% 100% / 6% 60% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 44% 100% / 6% 38% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 54% 100% / 6% 54% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 64% 100% / 6% 24% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 74% 100% / 6% 62% no-repeat,
        linear-gradient(to top, rgba(0, 223, 143, 0.45), rgba(0, 223, 143, 0.15)) 84% 100% / 6% 40% no-repeat;
}

.accent-panel {
    background: linear-gradient(145deg, #143128, #182738);
    border-color: rgba(0, 223, 143, 0.3);
}

.accent-panel .panel-kicker,
.accent-panel p {
    color: rgba(255, 255, 255, 0.82);
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.btn-brand {
    background: #00c77f;
    border: 0;
    color: #042015;
    box-shadow: 0 10px 22px rgba(0, 199, 127, 0.22);
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background: #00df8f;
    color: #04170f;
}

.btn-outline-dark {
    border-color: rgba(255, 255, 255, 0.22);
    color: #d7deef;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.form-control,
.form-select,
.admin-textarea {
    background: var(--admin-surface);
    border-color: var(--admin-line);
    color: var(--admin-text);
    border-radius: 0.6rem;
}

.form-control:disabled,
.form-select:disabled {
    background: var(--admin-surface);
    border-color: var(--admin-line);
    color: var(--admin-muted, rgba(215, 222, 239, 0.45));
    opacity: 1;
    cursor: default;
}

.form-control:focus,
.form-select:focus,
.admin-textarea:focus {
    border-color: rgba(0, 223, 143, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(0, 223, 143, 0.14);
    color: var(--admin-text);
    background: var(--admin-surface-soft);
}

.admin-textarea {
    min-height: 220px;
}

.admin-table {
    color: #d7deef;
}

.admin-table thead th {
    color: var(--admin-muted);
    border-bottom-color: var(--admin-line);
}

.admin-table tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.table-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.62rem;
    border-radius: 999px;
    background: rgba(0, 223, 143, 0.16);
    color: #005e2f;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 0.26rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    text-transform: uppercase;
}

.status-pill--pending {
    color: #7a4a00;
    background: #ffd580;
    border-color: #f5a623;
}

.status-pill--approved {
    color: #004d2e;
    background: #6effc0;
    border-color: #00c87f;
}

.status-pill--rejected {
    color: #5c0a0a;
    background: #ffb3b3;
    border-color: #e05555;
}

/* ── WORKOUT TABS ──────────────────────────────────────────── */
.workout-tabs {
    border-bottom: 1px solid var(--admin-line);
    gap: 0.25rem;
}

.workout-tabs .nav-link {
    color: var(--admin-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.45rem 0.45rem 0 0;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.workout-tabs .nav-link:hover {
    color: var(--admin-fg);
    background: rgba(255, 255, 255, 0.04);
}

.workout-tabs .nav-link.active {
    color: var(--admin-fg);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--admin-line) var(--admin-line) transparent;
}

.workout-tab-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.workout-tab-filter {
    width: min(280px, 100%);
    margin-left: auto;
}

.workout-tab-filter .form-label {
    font-size: 0.8rem;
    color: var(--admin-muted);
}

.chart-pill--alert {
    color: #ffd89b;
    background: rgba(255, 174, 66, 0.2);
    border-color: rgba(255, 174, 66, 0.4);
}

/* ── PENDING PREVIEW CARD ──────────────────────────────────── */
.workout-preview-card {
    border-left: 3px solid rgba(255, 174, 66, 0.5);
}

.workout-description {
    font-size: 0.88rem;
    color: var(--admin-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

.workout-reject-input {
    min-width: 200px;
    max-width: 320px;
}

/* ── REJECT MODAL ──────────────────────────────────────────── */
.reject-modal-content {
    background: #1a1c20;
    border: 1px solid var(--admin-line);
    border-radius: 0.75rem;
    color: var(--admin-fg);
}

.reject-modal-content .modal-header,
.reject-modal-content .modal-footer {
    border-color: var(--admin-line);
}

.reject-textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--admin-line);
    color: var(--admin-fg);
    border-radius: 0.5rem;
    resize: vertical;
}

.reject-textarea:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 174, 66, 0.5);
    color: var(--admin-fg);
    box-shadow: 0 0 0 3px rgba(255, 174, 66, 0.12);
}

.shake-modal-content {
    background: linear-gradient(180deg, rgba(23, 26, 36, 0.98), rgba(13, 16, 24, 0.98));
    border: 1px solid var(--admin-line);
    border-radius: 1rem;
    color: var(--admin-text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.shake-modal-header,
.shake-modal-footer {
    border-color: var(--admin-line);
    background: rgba(255, 255, 255, 0.02);
}

.shake-modal-body {
    background:
        radial-gradient(circle at top right, rgba(0, 223, 143, 0.08), transparent 28%),
        transparent;
}

.shake-modal-subtitle {
    color: var(--admin-muted);
    font-size: 0.92rem;
}

.shake-suggestion-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--admin-line);
    border-radius: 0.9rem;
    padding: 1rem;
}

.shake-suggestion-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: var(--admin-text);
}

.shake-suggestion-copy,
.shake-supplemental-copy,
.shake-empty-copy {
    color: var(--admin-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.shake-detail-card {
    height: 100%;
    background: rgba(9, 11, 18, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 0.85rem;
}

.shake-detail-list {
    margin: 0;
    padding-left: 1rem;
    color: #dfe6f6;
    font-size: 0.9rem;
}

.shake-detail-list li + li {
    margin-top: 0.4rem;
}


    color: var(--admin-muted);
    text-align: center;
}

.alert {
    border-radius: 0.65rem;
    border: 1px solid var(--admin-line);
}

.alert-danger {
    color: #ffd6d6;
    background: rgba(221, 69, 69, 0.12);
}

.alert-success {
    color: #c0ffe0;
    background: rgba(0, 199, 127, 0.12);
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .topbar-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 991.98px) {
    .admin-shell,
    .admin-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

    .admin-topbar {
        flex-wrap: wrap;
    }

    .topbar-heading {
        order: 3;
        width: 100%;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .workout-tab-filter {
        width: 100%;
    }
}

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

/* ── AUTH LAYOUT ─────────────────────────────────────────── */
body.auth-body {
    background: #0e0f11;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow', sans-serif;
    overflow-x: hidden;
}

.auth-wrap {
    width: 100%;
    padding: 2rem 1rem;
}

.auth-card {
    background: #1a1c1f;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1.4rem;
    padding: 3rem 2.5rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 32px 72px rgba(0, 0, 0, 0.55);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.fit-badge {
    background: var(--admin-accent);
    color: #111;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.22rem 0.65rem;
    border-radius: 0.35rem;
    line-height: 1.4;
}

.brand-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

h1.auth-heading {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.75rem;
}

body.auth-body .form-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

body.auth-body .form-control {
    background: #252629;
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 0.65rem;
    padding: 0.7rem 1rem;
}

body.auth-body .form-control:focus {
    background: #252629;
    border-color: var(--admin-accent-dark);
    box-shadow: 0 0 0 0.25rem rgba(185, 219, 16, 0.15);
    color: #fff;
}

body.auth-body .form-control::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

body.auth-body .form-control:-webkit-autofill,
body.auth-body .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #252629 inset !important;
    -webkit-text-fill-color: #fff !important;
}

.btn-eye {
    background: #252629;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
    color: rgba(255, 255, 255, 0.4);
    border-radius: 0 0.65rem 0.65rem 0;
    padding: 0.7rem 1rem;
    transition: color 0.15s, background 0.15s;
}

.btn-eye:hover,
.btn-eye:focus {
    color: #fff;
    background: #2e3033;
    outline: none;
    box-shadow: none;
}

body.auth-body .btn-brand {
    background: #22c55e;
    border: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.8rem;
    border-radius: 0.65rem;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.25);
    transition: background 0.2s;
}

body.auth-body .btn-brand:hover,
body.auth-body .btn-brand:focus {
    background: #16a34a;
    color: #fff;
}

.auth-link {
    color: #22c55e;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-link:hover {
    color: #4ade80;
    text-decoration: underline;
}

body.auth-body .form-check-input {
    background-color: #252629;
    border-color: rgba(255, 255, 255, 0.2);
}

body.auth-body .form-check-input:checked {
    background-color: #22c55e;
    border-color: #22c55e;
}

body.auth-body .form-check-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.auth-footnote {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.85rem;
    text-align: center;
}

.auth-footnote a {
    color: #22c55e;
    text-decoration: none;
}

.auth-footnote a:hover {
    text-decoration: underline;
}