:root {
    --app-blue: #2563eb;
    --app-blue-dark: #1d4ed8;
    --app-blue-soft: #eff6ff;
    --app-sidebar: #111827;
    --app-sidebar-muted: #94a3b8;
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-text: #1f2937;
    --app-muted: #64748b;
    --app-border: #e5e7eb;
    --app-success: #16a34a;
    --app-warning: #f59e0b;
    --app-danger: #dc2626;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
    --sidebar-width: 278px;
    --sidebar-collapsed-width: 88px;
}

html.dark-mode {
    color-scheme: dark;
}

html.dark-mode {
    --app-bg: #0b1120;
    --app-surface: #111827;
    --app-text: #e2e8f0;
    --app-muted: #94a3b8;
    --app-border: rgba(148, 163, 184, 0.24);
    --app-sidebar: #0f172a;
    --app-sidebar-muted: #94a3b8;
    --app-blue-soft: rgba(59, 130, 246, 0.16);
    --shadow-sm: 0 12px 28px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.22);
}

html.dark-mode body {
    background: var(--app-bg);
    color: var(--app-text);
}

html.dark-mode .app-layout {
    background: linear-gradient(180deg, #060b17 0%, #0b1120 100%);
}

html.dark-mode .app-sidebar {
    background: var(--app-sidebar);
    border-right-color: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

html.dark-mode .nav-item {
    color: #cbd5e1;
}

html.dark-mode .nav-item:hover,
html.dark-mode .nav-item.active {
    background: rgba(96, 165, 250, 0.16);
    color: #fff;
}

html.dark-mode .app-topbar {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

html.dark-mode .topbar-search,
html.dark-mode .topbar-date,
html.dark-mode .icon-button,
html.dark-mode .user-pill,
html.dark-mode .content-panel,
html.dark-mode .hero-card,
html.dark-mode .stat-card,
html.dark-mode .table-card,
html.dark-mode .chart-card,
html.dark-mode .action-panel {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.16);
}

html.dark-mode .hero-copy,
html.dark-mode .panel-copy,
html.dark-mode .stat-caption,
html.dark-mode .activity-list p,
html.dark-mode .activity-time,
html.dark-mode .user-meta span,
html.dark-mode .topbar-date,
html.dark-mode .status-pill,
html.dark-mode .badge {
    color: #94a3b8;
}

html.dark-mode .hero-title,
html.dark-mode .panel-title,
html.dark-mode .stat-label,
html.dark-mode .activity-list strong,
html.dark-mode .brand-text,
html.dark-mode .topbar-breadcrumb {
    color: #f8fafc;
}

html.dark-mode .status-pill,
html.dark-mode .badge {
    background: rgba(99, 102, 241, 0.12);
    color: #dbeafe;
}

html.dark-mode .action-button {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

html.dark-mode .action-button:hover {
    background: #334155;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--app-text);
    background: var(--app-bg);
}

a {
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #f8fafc 100%);
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100vh;
    padding: 24px 16px 20px;
    background: var(--app-sidebar);
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.24s ease, transform 0.24s ease;
}

.app-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 8px 10px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--app-blue), #60a5fa);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.brand-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-group {
    margin-top: 8px;
}

.sidebar-group-title {
    margin: 10px 10px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--app-sidebar-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    transform: translateX(2px);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: #fff;
    background: rgba(37, 99, 235, 0.2);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.nav-item i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    color: inherit;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-footer .nav-item {
    color: #cbd5e1;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    background: rgba(248, 250, 252, 0.8);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.topbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--shadow-sm);
}

.topbar-toggle:hover {
    background: #f8fafc;
}

.topbar-breadcrumb {
    display: none;
}

.breadcrumb-footer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 6px;
}

.breadcrumb-footer .breadcrumb-current {
    color: var(--app-text);
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.breadcrumb-link:hover {
    color: var(--app-blue);
}

.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--app-text);
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.topbar-date i {
    color: var(--app-blue);
}

.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.topbar-row-primary {
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 18px;
    width: 100%;
}

.topbar-row-secondary {
    display: none;
}

.breadcrumb-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.topbar-date-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    min-width: auto;
}

.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--app-text);
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-footer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.breadcrumb-footer .breadcrumb-current {
    color: var(--app-text);
}

.topbar-breadcrumb .breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-link:hover {
    color: var(--app-blue);
}

.topbar-search {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    padding: 0 12px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--shadow-sm);
}
.topbar-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--app-text);
    font-size: 1rem;
    padding: 14px 0;
}

.topbar-search i {
    color: var(--app-muted);
    font-size: 1rem;
}

.topbar-search input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--app-text);
    font-size: 0.95rem;
    padding: 12px 0;
}

.topbar-search input::placeholder {
    color: var(--app-muted);
}

.topbar-search input::placeholder {
    color: var(--app-muted);
}

@media (min-width: 992px) {
    .topbar-row-primary {
        justify-content: flex-start;
        align-items: center;
        flex-wrap: nowrap;
        gap: 18px;
    }

    .breadcrumb-wrapper,
    .topbar-date-wrapper,
    .topbar-actions {
        flex: 0 0 auto;
    }

    .topbar-search {
        flex: 1 1 520px;
        min-width: 260px;
        max-width: 560px;
    }

    .app-topbar {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions .dropdown {
    position: relative;
}

.topbar-actions .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    transform: none !important;
    min-width: 180px;
    z-index: 2050;
}

.topbar-actions .dropdown-menu.show {
    display: block;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: var(--shadow-sm);
}

.icon-button:hover {
    background: #f8fafc;
}

#darkModeToggle.dark-mode i,
.dark-mode .bi-moon-stars {
    color: #fbbf24;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-blue), #93c5fd);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.user-meta {
    display: none;
}

.user-meta strong {
    font-size: 0.92rem;
}

.user-meta span {
    font-size: 0.78rem;
    color: var(--app-muted);
}

.app-content {
    flex: 1;
    padding: 20px 22px 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid var(--app-border);
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-sm);
}

.hero-card-extended {
    flex-direction: row;
    padding: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
    align-items: center;
    justify-content: space-between;
}

.hero-copygroup {
    flex: 1 1 0;
    min-width: 0;
    max-width: 640px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.hero-actions-large {
    justify-content: flex-end;
}

.hero-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 1.6vw, 1.75rem);
    font-weight: 800;
    color: var(--app-text);
}

.hero-copy {
    margin: 0;
    color: var(--app-muted);
    max-width: 620px;
    line-height: 1.6;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--app-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.meta-pill-success {
    border-color: rgba(34, 197, 94, 0.18);
    background: rgba(34, 197, 94, 0.08);
    color: var(--app-success);
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.hero-actions-large {
    justify-content: flex-end;
}

.stats-grid,
.stats-grid-wide {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.35fr 1.35fr 0.9fr;
    gap: 16px;
    margin-bottom: 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.95fr;
    gap: 16px;
}

.content-grid-wide {
    grid-template-columns: 1.35fr 0.95fr;
}

.chart-card,
.action-panel,
.activity-card,
.table-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.chart-card canvas,
.action-panel canvas {
    width: 100% !important;
    min-height: 220px;
}

.counter {
    font-feature-settings: 'tnum';
}

.action-panel .quick-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--app-text);
    border: 1px solid var(--app-border);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.action-button:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    box-shadow: var(--shadow-sm);
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 16px;
    border-radius: 18px;
    border: 1px solid var(--app-border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    overflow-x: auto;
}

.table-modern th,
.table-modern td {
    border-bottom: 1px solid var(--app-border);
    padding: 16px 14px;
    vertical-align: middle;
}

.table-modern thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--app-muted);
}

@media (max-width: 1199.98px) {
    .chart-grid,
    .content-grid,
    .content-grid-wide,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .action-panel .quick-actions {
        grid-template-columns: 1fr;
    }
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.trend-positive {
    background: rgba(34, 197, 94, 0.14);
    color: var(--app-success);
}

.trend-neutral {
    background: rgba(96, 165, 250, 0.12);
    color: #2563eb;
}

.trend-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--app-warning);
}

.stat-footer {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-icon-primary {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}

.stat-icon-accent {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.12);
}

.stat-icon-success {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.12);
}

.stat-icon-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.7fr 1.7fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}

.action-panel .quick-actions {
    display: grid;
    gap: 12px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--app-text);
    border: 1px solid var(--app-border);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.action-button:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    box-shadow: var(--shadow-sm);
}

.content-grid-wide {
    grid-template-columns: 1.4fr 1fr;
}

.activity-card .activity-list {
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.activity-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 16px;
    border-radius: 18px;
    border: 1px solid var(--app-border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.activity-list li strong {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.activity-list p {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.95rem;
}

.activity-time {
    color: var(--app-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern th,
.table-modern td {
    border-bottom: 1px solid var(--app-border);
    padding: 16px 14px;
    vertical-align: middle;
}

.table-modern thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--app-muted);
}

.table-modern tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

@media (max-width: 1199.98px) {
    .chart-grid,
    .content-grid,
    .content-grid-wide,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--app-blue);
    border-color: var(--app-blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--app-blue-dark);
    border-color: var(--app-blue-dark);
}

.btn-outline {
    background: var(--app-surface);
    color: var(--app-text);
    border: 1px solid var(--app-border);
}

html.dark-mode .btn-outline {
    background: #111827;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.16);
}

html.dark-mode .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

html.dark-mode .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

html.dark-mode .hero-actions .btn {
    background: #111827;
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.16);
}

html.dark-mode .hero-actions .btn:hover {
    background: #1f2937;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--app-blue), #60a5fa);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.1);
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.stat-value {
    display: block;
    margin-top: 12px;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--app-text);
}

.stat-label {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    color: #1e40af;
    background: rgba(37, 99, 235, 0.12);
    font-size: 1.3rem;
}

.stat-caption {
    font-size: 0.84rem;
    color: var(--app-muted);
    margin-top: 8px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 18px;
}

.content-panel {
    padding: 20px;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-xl);
    background: var(--app-surface);
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-title {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--app-text);
}

.panel-copy {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.status-list {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.status-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--app-border);
}

.status-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.status-list .status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--app-text);
}

.status-list i {
    color: var(--app-success);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--app-success);
    background: rgba(22, 163, 74, 0.1);
}

.chart-card canvas {
    width: 100% !important;
    height: 250px !important;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 28px 26px;
    color: var(--app-muted);
    font-size: 0.9rem;
}

main.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 40px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.login-shell {
    width: min(1040px, calc(100% - 40px));
    padding: 0;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.login-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
}

.login-panel {
    padding: 36px 40px;
    background: var(--app-surface);
}

.login-panel--brand {
    background: linear-gradient(180deg, var(--app-blue) 0%, #60a5fa 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 22px;
}

.login-brand {
    max-width: 320px;
}

.login-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

.login-brand p.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.login-form-header {
    margin-bottom: 24px;
}

.login-form-header .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--app-blue);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.login-form-header h2 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 800;
}

.login-form-header p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.8;
    max-width: 420px;
}

.login-form .form-label {
    font-weight: 700;
    color: var(--app-text);
}

.login-form .form-control {
    border-radius: 16px;
    border: 1px solid var(--app-border);
    box-shadow: inset 0 4px 18px rgba(15, 23, 42, 0.05);
}

.login-form .form-control:focus {
    border-color: var(--app-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-form button {
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 1rem;
}

.login-footer {
    margin: 24px 0 0;
    text-align: center;
    color: var(--app-muted);
    font-size: 0.95rem;
}

@media (max-width: 991.98px) {
    .login-grid {
        grid-template-columns: 1fr;
    }

    .login-panel {
        padding: 30px 28px;
    }
}

@media (max-width: 575.98px) {
    main.login-page {
        padding: 24px 16px 28px;
    }

    .login-shell {
        border-radius: 24px;
    }

    .login-panel {
        padding: 24px 20px;
    }
}

.sidebar-backdrop {
    display: none;
}

/* Collapsed sidebar */
.app-layout.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
}

.app-layout.sidebar-collapsed .brand-text,
.app-layout.sidebar-collapsed .sidebar-group-title,
.app-layout.sidebar-collapsed .nav-label,
.app-layout.sidebar-collapsed .sidebar-footer-label {
    display: none;
}

.app-layout.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-inline: 10px;
}

.app-layout.sidebar-collapsed .nav-item i {
    width: auto;
}

@media (max-width: 1199.98px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(17, 24, 39, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .topbar-search {
        display: inline-flex;
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    .topbar-search input {
        font-size: 0.9rem;
        min-width: 0;
    }

    .topbar-row-primary {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .topbar-toggle {
        order: 1;
        flex: 0 0 auto;
    }

    .topbar-actions {
        order: 3;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .hero-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .hero-actions .btn {
        flex: 0 0 auto;
    }

    .app-topbar {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .topbar-row-secondary {
        display: flex;
    }

    .topbar-row-secondary .breadcrumb-wrapper {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-row-secondary .topbar-date-wrapper {
        flex: 0 0 auto;
        margin-left: auto;
    }
}

    .app-content {
        padding: 20px 20px 24px;
    }

    .hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .hero-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .hero-meta {
        justify-content: center;
        width: 100%;
        gap: 8px;
        margin-top: 12px;
    }
}

@media (max-width: 767.98px) {
    .app-topbar {
        padding: 14px 16px;
    }

    .app-content {
        padding: 16px 16px 22px;
    }

    .hero-card,
    .content-panel {
        padding: 18px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-meta {
        display: none;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .topbar-actions .user-pill {
        width: 100%;
        justify-content: space-between;
    }

    .hero-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
}

@media (max-width: 575.98px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-copygroup,
    .hero-meta {
        width: 100%;
    }

    .hero-meta {
        justify-content: flex-start;
    }
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.topbar-school-context {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    padding: 7px 11px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
    color: var(--app-blue);
}

.topbar-school-context select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text);
    font-weight: 700;
}

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

.dashboard-chart-canvas {
    position: relative;
    height: 300px;
}

@media (max-width: 991.98px) {
    .dashboard-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199.98px) {
    .topbar-school-context {
        min-width: 180px;
    }
}

@media (max-width: 991.98px) {
    .topbar-school-context {
        flex: 1 1 100%;
        order: 5;
    }
}

.page-header .page-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.1vw, 2rem);
    font-weight: 800;
    color: var(--app-text);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-panel {
    border: 1px solid var(--app-border);
    border-radius: var(--radius-lg);
    background: var(--app-surface);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--app-surface);
}

thead {
    background: #f8fafc;
}

th,
td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    vertical-align: middle;
}

th {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--app-muted);
    text-align: left;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.status-tag,
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-tag--success {
    color: var(--app-success);
    background: rgba(22, 163, 74, 0.1);
}

.status-tag--warning {
    color: var(--app-warning);
    background: rgba(245, 158, 11, 0.12);
}

.status-tag--danger {
    color: var(--app-danger);
    background: rgba(220, 38, 38, 0.1);
}
