/* Unified admin cabinet UI. Loaded after page-level admin styles. */
body.has-admin-tabbar {
    --admin-ui-green: #198754;
    --admin-ui-green-dark: #0f5132;
    --admin-ui-mint: #20c997;
    --admin-ui-ink: #10231a;
    --admin-ui-muted: #667085;
    --admin-ui-line: rgba(15, 81, 50, 0.1);
    --admin-ui-soft: #f8fbf9;
    --admin-ui-shadow: 0 0.7rem 1.55rem rgba(15, 81, 50, 0.08);
}

@media (min-width: 992px) {
    body.has-admin-tabbar > main {
        background:
            radial-gradient(ellipse 70% 34% at 50% 0%, rgba(25, 135, 84, 0.11), transparent 72%),
            radial-gradient(ellipse 38% 28% at 94% 18%, rgba(32, 201, 151, 0.08), transparent 68%);
        border-radius: 1.25rem;
    }

    body.has-admin-tabbar .admin-shell {
        width: min(1140px, 100%) !important;
        max-width: 1140px !important;
        margin-inline: auto !important;
        padding-bottom: 1.4rem;
    }

    body.has-admin-tabbar .admin-shell,
    body.has-admin-tabbar .admin-stats-shell,
    body.has-admin-tabbar .admin-page-shell {
        animation: adminSurfaceIn 0.28s ease-out;
    }
}

body.has-admin-tabbar .admin-hero,
body.has-admin-tabbar .admin-hero-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden !important;
    border: 1px solid rgba(15, 81, 50, 0.08) !important;
    border-radius: 1.15rem !important;
    color: #fff;
    background:
        radial-gradient(circle at 92% 8%, rgba(32, 201, 151, 0.42), transparent 18rem),
        linear-gradient(135deg, #157347 0%, #198754 62%, #20c997 100%) !important;
    box-shadow: 0 1rem 2.2rem rgba(15, 81, 50, 0.12) !important;
}

body.has-admin-tabbar .admin-hero::before,
body.has-admin-tabbar .admin-hero-panel::before {
    content: none !important;
}

body.has-admin-tabbar .admin-hero-header {
    min-height: 6.2rem;
    display: grid;
    align-content: center;
    padding: 1.45rem 1.65rem !important;
    background: transparent !important;
    color: #fff !important;
}

body.has-admin-tabbar .admin-hero-header::before {
    content: none !important;
}

body.has-admin-tabbar .admin-hero-header h1,
body.has-admin-tabbar .admin-hero-title {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(1.55rem, 2.2vw, 1.9rem) !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
}

body.has-admin-tabbar .admin-hero-header p,
body.has-admin-tabbar .admin-hero-text {
    max-width: 46rem;
    margin: 0.45rem 0 0 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.94rem !important;
    line-height: 1.4 !important;
}

body.has-admin-tabbar .admin-hero-body {
    padding: 0.95rem 1.65rem !important;
    background: linear-gradient(180deg, #fff 0%, var(--admin-ui-soft) 100%) !important;
    color: var(--admin-ui-muted) !important;
}

body.has-admin-tabbar .admin-hero-body > p,
body.has-admin-tabbar .admin-hero-body > span,
body.has-admin-tabbar .admin-hero-body .text-muted {
    color: var(--admin-ui-muted) !important;
}

body.has-admin-tabbar .admin-hero-body > a.btn-light:only-child,
body.has-admin-tabbar .admin-hero-body > a.btn-outline-secondary:only-child,
body.has-admin-tabbar .admin-hero-body > a.btn-admin-gradient:only-child {
    display: none !important;
}

body.has-admin-tabbar .admin-hero-body:has(> a.btn-light:only-child),
body.has-admin-tabbar .admin-hero-body:has(> a.btn-outline-secondary:only-child),
body.has-admin-tabbar .admin-hero-body:has(> a.btn-admin-gradient:only-child) {
    display: none !important;
}

body.has-admin-tabbar .admin-card,
body.has-admin-tabbar .admin-work-card,
body.has-admin-tabbar .dashboard-metric,
body.has-admin-tabbar .stats-card,
body.has-admin-tabbar .card.admin-card,
body.has-admin-tabbar main > .container .card:not(.admin-stats-choice-modal):not(.legal-docs-modal .card) {
    border: 1px solid var(--admin-ui-line) !important;
    border-radius: 1rem !important;
    background: #fff !important;
    box-shadow: var(--admin-ui-shadow) !important;
    overflow: hidden !important;
}

body.has-admin-tabbar .admin-card-header,
body.has-admin-tabbar .admin-work-card__head,
body.has-admin-tabbar .card-header.admin-card-header {
    min-height: 3.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem !important;
    background: linear-gradient(180deg, #fff 0%, var(--admin-ui-soft) 100%) !important;
    border-bottom: 1px solid var(--admin-ui-line) !important;
    color: var(--admin-ui-green-dark) !important;
}

body.has-admin-tabbar .admin-card-header h2,
body.has-admin-tabbar .admin-card-header h3,
body.has-admin-tabbar .admin-work-card__title {
    margin: 0 !important;
    color: var(--admin-ui-green-dark) !important;
    font-size: 1.02rem !important;
    font-weight: 900 !important;
    line-height: 1.18 !important;
}

body.has-admin-tabbar .admin-card-body,
body.has-admin-tabbar .admin-work-card__body,
body.has-admin-tabbar .card.admin-card > .card-body,
body.has-admin-tabbar main > .container .card:not(.admin-stats-choice-modal) > .card-body {
    padding: 1rem !important;
}

body.has-admin-tabbar main > .container.py-4 {
    max-width: 920px !important;
}

body.has-admin-tabbar main > .container .card h1,
body.has-admin-tabbar main > .container .card .h4 {
    color: var(--admin-ui-green-dark);
    font-weight: 900;
    line-height: 1.15;
}

body.has-admin-tabbar .admin-card .small,
body.has-admin-tabbar .admin-card p,
body.has-admin-tabbar .admin-work-card p {
    line-height: 1.35;
}

body.has-admin-tabbar .admin-card a:not(.btn),
body.has-admin-tabbar .admin-work-card a:not(.btn) {
    color: var(--admin-ui-green-dark);
    font-weight: 750;
}

body.has-admin-tabbar .btn-admin-gradient,
body.has-admin-tabbar .admin-primary-btn {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #157347 0%, #198754 60%, #20c997 100%) !important;
    color: #fff !important;
    font-weight: 850 !important;
    box-shadow: 0 0.45rem 1rem rgba(25, 135, 84, 0.16);
}

body.has-admin-tabbar .admin-card .btn,
body.has-admin-tabbar .admin-hero-body .btn,
body.has-admin-tabbar .filter-form .btn {
    border-radius: 999px;
    font-weight: 800;
}

body.has-admin-tabbar .form-control,
body.has-admin-tabbar .form-select,
body.has-admin-tabbar textarea,
body.has-admin-tabbar input[type="text"],
body.has-admin-tabbar input[type="date"],
body.has-admin-tabbar input[type="number"],
body.has-admin-tabbar input[type="password"],
body.has-admin-tabbar input[type="email"] {
    border-color: rgba(15, 81, 50, 0.14);
    border-radius: 0.82rem;
}

body.has-admin-tabbar .form-control:focus,
body.has-admin-tabbar .form-select:focus {
    border-color: rgba(25, 135, 84, 0.42);
    box-shadow: 0 0 0 0.18rem rgba(25, 135, 84, 0.1);
}

body.has-admin-tabbar .form-label {
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 850;
}

body.has-admin-tabbar .filter-form,
body.has-admin-tabbar form.filter-form,
body.has-admin-tabbar .admin-filters-card form {
    --bs-gutter-x: 0.7rem;
    --bs-gutter-y: 0.65rem;
}

body.has-admin-tabbar .table-responsive,
body.has-admin-tabbar .admin-table-wrap {
    border: 1px solid var(--admin-ui-line);
    border-radius: 0.95rem;
    overflow: auto;
    background: #fff;
}

body.has-admin-tabbar .table {
    margin-bottom: 0 !important;
    border-color: var(--admin-ui-line);
}

body.has-admin-tabbar .table thead th {
    border-color: var(--admin-ui-line) !important;
    background: var(--admin-ui-soft) !important;
    color: var(--admin-ui-green-dark) !important;
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

body.has-admin-tabbar .table tbody td,
body.has-admin-tabbar .table tbody th {
    border-color: rgba(15, 81, 50, 0.08) !important;
    color: #334155;
    vertical-align: middle;
}

body.has-admin-tabbar .table tbody tr:hover {
    background: rgba(25, 135, 84, 0.035);
}

body.has-admin-tabbar .badge {
    border-radius: 999px;
    font-weight: 800;
}

body.has-admin-tabbar .alert {
    border-radius: 0.95rem;
    border-width: 1px;
}

body.has-admin-tabbar .admin-section-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
    align-items: stretch;
}

body.has-admin-tabbar .admin-section-tile,
body.has-admin-tabbar .student-home-tile.admin-section-tile {
    min-height: 7rem !important;
    border: 1px solid var(--admin-ui-line) !important;
    border-radius: 1rem !important;
    background: #fff !important;
    box-shadow: var(--admin-ui-shadow) !important;
}

body.has-admin-tabbar .admin-mobile-tabbar--sections {
    font-family: inherit;
}

body.has-admin-tabbar .admin-mobile-tabbar__item {
    border: 0;
    background: transparent;
    text-decoration: none;
}

body.has-admin-tabbar #globalBackButtonWrap,
body.has-admin-tabbar .app-breadcrumb {
    display: none !important;
}

body.has-admin-tabbar .page-loader.hidden,
body.has-admin-tabbar.page-enter-done .page-loader {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.has-admin-tabbar .admin-stats-choice-modal {
    border: 0 !important;
    border-radius: 1.05rem !important;
    overflow: hidden;
    box-shadow: 0 1.1rem 2.4rem rgba(15, 81, 50, 0.18);
}

body.has-admin-tabbar .admin-stats-choice-modal .modal-header {
    color: #fff;
    background: linear-gradient(135deg, #157347 0%, #198754 62%, #20c997 100%);
    border: 0;
}

body.has-admin-tabbar .admin-stats-choice-modal .modal-body {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    background: var(--admin-ui-soft);
}

body.has-admin-tabbar .admin-stats-choice-link {
    min-height: 4rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(25, 135, 84, 0.12);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--admin-ui-ink);
    text-decoration: none;
    box-shadow: 0 0.35rem 0.9rem rgba(15, 81, 50, 0.055);
}

body.has-admin-tabbar .admin-stats-choice-icon {
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(25, 135, 84, 0.1);
    color: var(--admin-ui-green);
    font-size: 1.08rem;
}

body.has-admin-tabbar .admin-stats-choice-title,
body.has-admin-tabbar .admin-stats-choice-sub {
    display: block;
}

body.has-admin-tabbar .admin-stats-choice-title {
    color: var(--admin-ui-green-dark);
    font-weight: 900;
    line-height: 1.15;
}

body.has-admin-tabbar .admin-stats-choice-sub {
    margin-top: 0.08rem;
    color: var(--admin-ui-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

body.has-admin-tabbar .admin-stats-choice-arrow {
    color: #8aa69a;
}

@media (max-width: 991.98px), (hover: none) and (pointer: coarse) {
    body.has-admin-tabbar #globalBackButtonWrap,
    body.has-admin-tabbar .app-breadcrumb {
        display: none !important;
    }

    body.has-admin-tabbar > main.container {
        width: 100%;
        max-width: none;
        padding: 0.75rem 0.75rem calc(4.75rem + env(safe-area-inset-bottom)) !important;
    }

    body.has-admin-tabbar .admin-shell {
        max-width: none !important;
        margin: 0 !important;
        padding-bottom: 0.25rem !important;
    }

    body.has-admin-tabbar .admin-hero,
    body.has-admin-tabbar .admin-hero-panel {
        border-radius: 0.95rem !important;
        margin-bottom: 0.7rem !important;
    }

    body.has-admin-tabbar .admin-hero-header {
        min-height: 4.3rem;
        padding: 0.9rem 1rem !important;
    }

    body.has-admin-tabbar .admin-hero-header h1,
    body.has-admin-tabbar .admin-hero-title {
        font-size: 1.12rem !important;
        line-height: 1.16 !important;
    }

    body.has-admin-tabbar .admin-hero-header p,
    body.has-admin-tabbar .admin-hero-text {
        display: none !important;
    }

    body.has-admin-tabbar .admin-hero-body {
        display: none !important;
    }

    body.has-admin-tabbar .admin-card,
    body.has-admin-tabbar .admin-work-card,
    body.has-admin-tabbar .dashboard-metric,
    body.has-admin-tabbar .stats-card {
        border-radius: 0.9rem !important;
        box-shadow: 0 0.25rem 0.85rem rgba(15, 81, 50, 0.07) !important;
    }

    body.has-admin-tabbar .admin-card-header {
        min-height: 2.7rem;
        padding: 0.62rem 0.75rem !important;
    }

    body.has-admin-tabbar .admin-card-header h2,
    body.has-admin-tabbar .admin-card-header h3 {
        font-size: 0.92rem !important;
    }

    body.has-admin-tabbar .admin-card-body,
    body.has-admin-tabbar .card.admin-card > .card-body {
        padding: 0.7rem !important;
        overflow-x: auto;
    }

    body.has-admin-tabbar .row {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    body.has-admin-tabbar .row.g-3 > [class*="col-"] {
        margin-top: 0 !important;
    }

    body.has-admin-tabbar .admin-section-grid {
        gap: 0.65rem !important;
    }

    body.has-admin-tabbar .admin-section-tile,
    body.has-admin-tabbar .student-home-tile.admin-section-tile {
        min-height: 6.7rem !important;
    }

    body.has-admin-tabbar .table-responsive,
    body.has-admin-tabbar .admin-table-wrap {
        max-width: 100%;
        border-radius: 0.82rem;
    }

    body.has-admin-tabbar .admin-card-body > table,
    body.has-admin-tabbar .table-responsive > table {
        min-width: 680px;
    }

    body.has-admin-tabbar .btn,
    body.has-admin-tabbar .form-control,
    body.has-admin-tabbar .form-select {
        min-height: 2.25rem;
        font-size: 0.84rem;
    }

    body.has-admin-tabbar .form-label {
        margin-bottom: 0.2rem;
        font-size: 0.72rem;
    }

    body.has-admin-tabbar .admin-mobile-tabbar--sections {
        min-height: 4.1rem;
        padding-inline: 0.55rem;
        gap: 0.15rem;
    }

    body.has-admin-tabbar .admin-mobile-tabbar__item {
        min-width: 0;
        flex: 1 1 0;
        color: #6b7280;
    }

    body.has-admin-tabbar .admin-mobile-tabbar__item.active,
    body.has-admin-tabbar .admin-mobile-tabbar__item.is-active,
    body.has-admin-tabbar .admin-mobile-tabbar__item[aria-current="page"] {
        color: var(--admin-ui-green);
    }
}

@keyframes adminSurfaceIn {
    from { transform: translateY(8px); }
    to { transform: translateY(0); }
}
