@charset "UTF-8";
/* Shared dashboard shell -- sidebar + topbar + hero + stat tiles. Used by
   every role-gated dashboard page so navigation and the page opener look
   and behave identically everywhere. */

.shell-wrap {
    display: flex;
    min-height: 100vh;
}

.shell-sidebar {
    width: var(--sidebar-w-expanded);
    flex-shrink: 0;
    background: var(--sb-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.shell-sidebar.is-collapsed { width: var(--sidebar-w-collapsed); }

.shell-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.shell-logo img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: cover;
}
.shell-logo span {
    font-family: var(--font-ui);
    font-weight: var(--fw-semibold);
    font-size: var(--text-lg);
    letter-spacing: -0.01em;
}
.shell-sidebar.is-collapsed .shell-logo span { display: none; }

.shell-nav {
    padding: var(--space-4) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}
.shell-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--duration-fast) linear, color var(--duration-fast) linear;
}
.shell-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.shell-nav a.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    position: relative;
}
.shell-nav a.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--color-accent);
}
.shell-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.shell-nav a span.lbl,
.shell-nav-group > summary span.lbl {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shell-sidebar.is-collapsed .shell-nav a span.lbl { display: none; }

/* Nav groups — plain <details>/<summary>, no JS needed. Keeps a long list
   (Academics, Admin Tools, Finance, Library) collapsible per-user instead
   of every item sitting flat in the sidebar all the time. */
.shell-nav-group { border-radius: var(--radius-sm); }
.shell-nav-group > summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    transition: background var(--duration-fast) linear;
}
.shell-nav-group > summary::-webkit-details-marker { display: none; }
.shell-nav-group > summary:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.shell-nav-group > summary svg:not(.chevron) { width: 18px; height: 18px; flex-shrink: 0; }
.shell-nav-group > summary svg.chevron { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; transition: transform var(--duration-base) var(--ease-standard); }
.shell-nav-group[open] > summary svg.chevron { transform: rotate(90deg); }
.shell-nav-group-items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 2px var(--space-5); }
.shell-nav-group-items a { padding-left: 0.5rem; }
.shell-sidebar.is-collapsed .shell-nav-group > summary span.lbl,
.shell-sidebar.is-collapsed .shell-nav-group > summary svg.chevron { display: none; }
.shell-sidebar.is-collapsed .shell-nav-group-items { padding-left: 0; }

.shell-collapse-btn {
    margin: var(--space-3);
    background: rgba(255, 255, 255, 0.07);
    border: none;
    color: rgba(255, 255, 255, 0.82);
    border-radius: var(--radius-sm);
    padding: 0.55rem;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: var(--fw-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: background var(--duration-fast) linear;
}
.shell-collapse-btn:hover { background: rgba(255, 255, 255, 0.14); }
.shell-collapse-btn svg { width: 15px; height: 15px; transition: transform var(--duration-base) var(--ease-standard); }
.shell-sidebar.is-collapsed .shell-collapse-btn svg { transform: rotate(180deg); }
.shell-sidebar.is-collapsed .shell-collapse-btn span.lbl { display: none; }

.shell-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-bg);
}

.shell-topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 88%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: var(--z-menu);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    gap: var(--space-4);
}
.shell-topbar h1 {
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    margin: 0;
    letter-spacing: -0.01em;
}
.shell-topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.shell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-weight: var(--fw-semibold);
    font-size: var(--text-xs);
    flex-shrink: 0;
    object-fit: cover;
}
.shell-topbar-logout {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* ---- Theme switcher ---- */
.theme-switch { position: relative; }
.theme-switch-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: border-color var(--duration-fast) linear, color var(--duration-fast) linear;
}
.theme-switch-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.theme-switch-btn svg { width: 16px; height: 16px; }
.theme-switch-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-modal);
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: var(--space-2); width: 200px;
    display: none; flex-direction: column; gap: 2px;
}
.theme-switch.is-open .theme-switch-menu { display: flex; }
.theme-switch-opt {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
    border: none; background: none; width: 100%; text-align: left; cursor: pointer;
    font-family: var(--font-ui); font-size: var(--text-sm); color: var(--color-text);
}
.theme-switch-opt:hover { background: var(--color-bg); }
.theme-switch-opt.is-active { background: var(--color-primary-soft); font-weight: var(--fw-semibold); }
.theme-switch-opt .swatch { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1.5px rgba(0,0,0,0.06); }
.theme-switch-opt .swatch-check { margin-left: auto; width: 15px; height: 15px; color: var(--color-primary); visibility: hidden; }
.theme-switch-opt.is-active .swatch-check { visibility: visible; }

.shell-content {
    padding: var(--space-6);
    flex: 1;
}

/* Mobile hamburger toggle -- hidden on desktop, shown only under the
   drawer breakpoint below. */
.shell-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    padding: var(--space-2);
    cursor: pointer;
}
.shell-mobile-toggle svg { width: 22px; height: 22px; }

.shell-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 20, 0.55);
    z-index: calc(var(--z-menu) - 1);
    opacity: 0;
    transition: opacity var(--duration-base) var(--ease-standard);
}

@media (max-width: 900px) {
    .shell-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .shell-collapse-btn { display: none; }

    /* Off-canvas drawer -- full nav, full width, slides in over content
       rather than shrinking to an icon strip (icon-only stops being
       legible at touch scale). */
    .shell-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: var(--z-menu);
        width: min(82vw, 300px);
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .shell-sidebar.is-mobile-open { transform: translateX(0); }
    .shell-sidebar.is-collapsed { width: min(82vw, 300px); }
    .shell-sidebar .shell-nav a span.lbl,
    .shell-sidebar .shell-logo span { display: inline; }
    .shell-sidebar.is-collapsed .shell-nav a span.lbl,
    .shell-sidebar.is-collapsed .shell-logo span { display: inline; }

    .shell-main { margin-left: 0; }
    .shell-content { padding: var(--space-4); }
    .shell-topbar { padding: 0 var(--space-4); gap: var(--space-2); }
    .shell-topbar h1 { font-size: var(--text-base); }
    .shell-topbar-user span:not(.shell-avatar) { display: none; }
    .theme-switch-menu { right: -8px; width: 188px; }

    .shell-backdrop.is-visible { display: block; opacity: 1; }
}

/* ---------- Hero banner + stat tiles ----------
   Shared shape used by every role dashboard (see dashboard-hero.php). A
   solid brand panel with a faint dot-grid texture and an accent rail —
   premium and calm, deliberately not a soft blurred gradient. */
.dash-hero {
    position: relative;
    overflow: hidden;
    background: var(--color-primary-dark);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-8);
    margin-bottom: var(--space-6);
    box-shadow: 0 16px 34px -16px color-mix(in srgb, var(--color-primary-dark) 65%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}
.dash-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.09;
    background-image: radial-gradient(circle, #fff 1px, transparent 1.6px);
    background-size: 18px 18px;
    pointer-events: none;
}
.dash-hero::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--color-accent);
}
.dash-hero-text, .dash-hero-cta { position: relative; z-index: 1; }
.dash-hero-label { font-family: var(--font-ui); font-size: var(--text-sm); color: rgba(255, 255, 255, 0.78); font-weight: var(--fw-medium); }
.dash-hero-name { font-family: var(--font-ui); font-size: var(--text-2xl); font-weight: 800; line-height: 1.2; margin: 3px 0 5px; letter-spacing: -0.01em; }
.dash-hero-meta { font-family: var(--font-body); font-size: var(--text-sm); color: rgba(255, 255, 255, 0.75); }
.dash-hero-cta {
    flex-shrink: 0;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.1rem;
    font-family: var(--font-ui);
    font-weight: var(--fw-semibold);
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.35);
    transition: filter var(--duration-fast) linear;
}
.dash-hero-cta:hover { filter: brightness(1.06); color: var(--color-primary-dark); }
.dash-hero-cta svg { width: 15px; height: 15px; }

.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--space-4) var(--space-5);
    border-top: 3px solid var(--tile-accent, var(--color-primary));
    transition: transform var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-tile-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.stat-tile-icon svg { width: 20px; height: 20px; }
.stat-tile-trend { font-family: var(--font-ui); font-size: 0.72rem; font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 3px; }
.stat-tile-trend svg { width: 11px; height: 11px; }
.stat-tile-trend.is-up { color: var(--status-good-text); }
.stat-tile-trend.is-down { color: var(--status-danger-text); }
.stat-tile-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-2xl); font-weight: 700; color: var(--color-text); line-height: 1.1; }
.stat-tile-label { font-family: var(--font-ui); font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: var(--fw-medium); }

@media (max-width: 576px) {
    .dash-hero { padding: var(--space-5); flex-direction: column; align-items: flex-start; }
    .dash-hero-name { font-size: var(--text-xl); }
    .dash-hero-cta { width: 100%; justify-content: center; }
}

/* ---------- Chart cards ---------- */
.chart-card-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-3); font-family: var(--font-ui); font-size: var(--text-xs); color: var(--color-text-muted); }
.chart-card-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-card-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
