/* ============================================================
   GateGuard — Admin Panel Styles
   File: /assets/css/admin.css
   C Sky Solutions, Jaunpur

   VISUAL REDESIGN (this revision): full rebuild to match approved
   Admin_Dashboard_Mockup.png + Brand Design System v1.0. This file is
   shared across admin/*.php AND manager/*.php (manager pages reuse
   admin.css directly, per project file structure — no separate
   manager.css exists). Every class name already in use by existing
   pages (.app-shell, .sidebar, .topbar, .content, .stats-grid,
   .stat-card + accent-green/orange/red, .panel, .data-table, .badge,
   .empty-state) is PRESERVED so untouched pages don't break — new
   classes are additive only, for the new dashboard components.

   Colors: Navy #163A63 / Dark #102A46, Brass Gold #B88A2D / Light
   #D8B15A, Admin BG #F8F6F2, Card #FFFFFF, Border #D7DEE6,
   Text Primary #1F2937, Text Secondary #667085,
   Success #1E9E64, Warning #D98C10, Error #B3261E
   Fonts: Manrope (headings), Inter (body)
   Radii: Button 16px, Card 20px, Input 14px, Modal 24px
   Sidebar width: 280px (was 240px)

   RESPONSIVE: sidebar is a fixed 280px column at desktop (1024px+),
   and an off-canvas slide-in drawer (triggered by a hamburger button
   in the topbar) at phone/tablet — since admin/manager panels are
   expected mostly on mobile/tablet, this is a primary-experience
   fix, not a cosmetic add-on. JS hook classes: .sidebar-open on
   .app-shell toggles the drawer + backdrop; wired in each page's
   own <script> (starting with dashboard.php).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --navy-dark: #102A46;
    --navy: #163A63;
    --gold: #B88A2D;
    --gold-light: #D8B15A;
    --gold-glow: #E2BF6A;
    --bg: #F8F6F2;
    --card: #FFFFFF;
    --border: #D7DEE6;
    --text-primary: #1F2937;
    --text-secondary: #667085;
    --success: #1E9E64;
    --warning: #D98C10;
    --error: #B3261E;
    --r-btn: 16px;
    --r-card: 20px;
    --r-input: 14px;
    --r-modal: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, .font-heading { font-family: 'Manrope', sans-serif; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--navy-dark) 0%, #0B2340 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
}
.app-shell.sidebar-open .sidebar { transform: translateX(0); }

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 190;
    background: rgba(11, 35, 64, 0.55);
}
.app-shell.sidebar-open .sidebar-backdrop { display: block; }

.sidebar .brand {
    padding: 22px 22px 18px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar .brand img { width: 36px; height: 36px; flex-shrink: 0; }
.sidebar .brand .brand-text { font-size: 19px; font-weight: 800; font-family: 'Manrope', sans-serif; line-height: 1.1; }
.sidebar .brand small {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--gold-glow);
    margin-top: 2px;
}
.sidebar .sidebar-close {
    margin-left: auto; background: none; border: none; color: #cfd8e6;
    font-size: 20px; cursor: pointer; display: none; padding: 4px;
    line-height: 1;
}

.sidebar nav {
    flex: 1;
    padding: 10px 12px 16px;
    overflow-y: auto;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cfd8e6;
    text-decoration: none;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.sidebar nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar nav a.active {
    background: rgba(216,177,90,0.14);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--gold-glow);
}
.sidebar nav a.active svg { opacity: 1; color: var(--gold-glow); }

.sidebar nav .section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6f83a3;
    padding: 18px 14px 8px;
}
.sidebar nav .section-label:first-child { padding-top: 6px; }

.sidebar .logout {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar .logout a {
    display: flex; align-items: center; gap: 10px;
    color: #ff9b9b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}
.sidebar .logout a svg { width: 17px; height: 17px; }

/* ---------------- Main content ---------------- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.topbar {
    background: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e3e7ee;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.hamburger-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    cursor: pointer; color: var(--navy-dark);
}
.hamburger-btn svg { width: 20px; height: 20px; }

.topbar h1 {
    font-size: 16px;
    font-weight: 800;
    color: var(--navy-dark);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .school-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.gate-status-pill {
    display: none;
    align-items: center; gap: 6px;
    background: rgba(30,158,100,0.1); color: var(--success);
    border: 1px solid rgba(30,158,100,0.3); border-radius: 20px;
    padding: 6px 12px; font-size: 12px; font-weight: 700;
}
.gate-status-pill svg { width: 13px; height: 13px; }
.gate-status-pill .pulse-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--success);
}

.topbar .user-info {
    display: flex; align-items: center; gap: 10px;
}
.topbar .user-info .avatar-circle {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; font-family: 'Manrope', sans-serif;
    overflow: hidden;
}
.topbar .user-info .avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.topbar .user-info .u-text { display: none; text-align: right; line-height: 1.25; }
.topbar .user-info .u-text strong { color: var(--text-primary); display: block; font-size: 13.5px; font-weight: 700; }
.topbar .user-info .u-text span { font-size: 11.5px; color: var(--text-secondary); }

.content {
    padding: 18px 16px 32px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
}

/* ============================================================
   SECURITY STATUS BANNER
   ============================================================ */
.security-banner {
    background: linear-gradient(135deg, var(--navy-dark) 0%, #0B2340 100%);
    border-radius: var(--r-card);
    padding: 16px 18px;
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.security-banner .sb-headline { display: flex; align-items: center; gap: 12px; }
.security-banner .sb-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: rgba(216,177,90,0.16); border: 1.5px solid rgba(184,138,45,0.4);
    display: flex; align-items: center; justify-content: center;
}
.security-banner .sb-icon svg { width: 22px; height: 22px; color: var(--gold-glow); }
.security-banner .sb-title { font-size: 12px; color: #9fb0c9; font-weight: 600; }
.security-banner .sb-status { font-size: 15px; font-weight: 800; color: var(--success); }

.security-banner .sb-stats {
    display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto;
}
.security-banner .sb-stat { display: flex; align-items: center; gap: 8px; }
.security-banner .sb-stat .sbs-icon {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center;
}
.security-banner .sb-stat .sbs-icon svg { width: 15px; height: 15px; color: var(--gold-glow); }
.security-banner .sb-stat .sbs-value { font-size: 16px; font-weight: 800; line-height: 1.1; }
.security-banner .sb-stat .sbs-label { font-size: 10.5px; color: #9fb0c9; }
.security-banner .sb-stat.alert .sbs-value { color: #ff9b9b; }
.security-banner .sb-stat.alert .sbs-icon { background: rgba(255,155,155,0.14); }
.security-banner .sb-stat.alert .sbs-icon svg { color: #ff9b9b; }

/* ============================================================
   STAT CARDS (accented) — mockup's 4 primary metric cards
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--r-card);
    padding: 18px 18px 16px;
    box-shadow: 0 1px 4px rgba(16,42,70,0.06);
    border-left: 4px solid var(--navy);
    position: relative;
    overflow: hidden;
}
.stat-card .sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-card .sc-icon {
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(22,58,99,0.08);
}
.stat-card .sc-icon svg { width: 19px; height: 19px; color: var(--navy); }
.stat-card .sc-trend { font-size: 11px; font-weight: 700; color: var(--success); }

.stat-card .label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }
.stat-card .value { font-size: 30px; font-weight: 800; color: var(--navy-dark); font-family: 'Manrope', sans-serif; line-height: 1; }
.stat-card .sc-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 4px; }

.stat-card .sc-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; opacity: 0.5; }

.stat-card.accent-green  { border-left-color: var(--success); }
.stat-card.accent-green  .sc-icon { background: rgba(30,158,100,0.12); }
.stat-card.accent-green  .sc-icon svg { color: var(--success); }

.stat-card.accent-blue   { border-left-color: #2F6FE0; }
.stat-card.accent-blue   .sc-icon { background: rgba(47,111,224,0.12); }
.stat-card.accent-blue   .sc-icon svg { color: #2F6FE0; }

.stat-card.accent-purple { border-left-color: #7B5FE0; }
.stat-card.accent-purple .sc-icon { background: rgba(123,95,224,0.12); }
.stat-card.accent-purple .sc-icon svg { color: #7B5FE0; }

.stat-card.accent-orange { border-left-color: var(--warning); }
.stat-card.accent-orange .sc-icon { background: rgba(217,140,16,0.12); }
.stat-card.accent-orange .sc-icon svg { color: var(--warning); }

.stat-card.accent-red    { border-left-color: var(--error); }
.stat-card.accent-red    .sc-icon { background: rgba(179,38,30,0.1); }
.stat-card.accent-red    .sc-icon svg { color: var(--error); }

/* ---------------- Secondary stats strip (Students/Staff/Guardians/Guards/Gates) ---------------- */
.mini-stats-strip {
    background: var(--card);
    border-radius: var(--r-card);
    padding: 14px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(16,42,70,0.06);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.mini-stat { display: flex; align-items: center; gap: 10px; }
.mini-stat .ms-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.mini-stat .ms-icon svg { width: 17px; height: 17px; color: var(--navy); }
.mini-stat .ms-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; }
.mini-stat .ms-value { font-size: 17px; font-weight: 800; color: var(--navy-dark); font-family: 'Manrope', sans-serif; }

/* ============================================================
   DASHBOARD GRID (activity + charts | quick actions + timeline)
   ============================================================ */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.dash-col-main, .dash-col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------------- Panels / tables ---------------- */
.panel {
    background: var(--card);
    border-radius: var(--r-card);
    padding: 18px 18px 16px;
    box-shadow: 0 1px 4px rgba(16,42,70,0.06);
}

.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 10px;
}
.panel-header h2 {
    font-size: 15px; font-weight: 800; color: var(--navy-dark);
}
.panel-header .panel-link {
    font-size: 12.5px; font-weight: 700; color: var(--gold); text-decoration: none;
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.panel-header select.chart-range {
    font-size: 12px; font-weight: 700; color: var(--navy-dark);
    border: 1px solid var(--border); border-radius: 10px; padding: 5px 10px;
    background: var(--bg);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data-table th {
    text-align: left;
    padding: 10px 10px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
}

table.data-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #eef1f5;
}

.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: #999;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.badge.in    { background: #e6f7ec; color: var(--success); }
.badge.out   { background: #eee; color: #777; }
.badge.waiting { background: #FDF3DE; color: var(--warning); }
.badge.blacklisted { background: #fdecea; color: var(--error); }

/* ============================================================
   LIST / FORM PATTERN — shared across Staff, Students, Guardians,
   Blacklist, Gates, Users, Expected Visitors, and the Manager panel.
   Built using admin/staff.php as the template (Master Reference
   Guide Section 22.1). Purely additive — no class name here
   collides with anything already defined above.
   ============================================================ */

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: var(--r-btn);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }

.btn-secondary { background: var(--bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #EEF1F5; }

.btn-danger { background: rgba(179,38,30,0.1); color: var(--error); }
.btn-danger:hover { background: rgba(179,38,30,0.16); }

.btn-success { background: rgba(30,158,100,0.1); color: var(--success); }
.btn-success:hover { background: rgba(30,158,100,0.16); }

.btn-small { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 13px 16px;
    border-radius: var(--r-input);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: rgba(30,158,100,0.1); color: var(--success); }
.alert-error { background: rgba(179,38,30,0.1); color: var(--error); }

/* ---------------- Table toolbar (search + Add New) ---------------- */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    padding: 0 6px 0 14px;
    flex: 1;
    min-width: 180px;
    max-width: 360px;
}
.toolbar-search svg { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.toolbar-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    min-width: 0;
}
.toolbar-search input:focus { outline: none; }
.toolbar-search button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
}
.toolbar-search button:hover { color: var(--navy); }
.toolbar-search .clear-link {
    display: flex; align-items: center; color: var(--text-secondary);
}
.toolbar-search .clear-link:hover { color: var(--error); }

.table-toolbar select {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--navy-dark);
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    padding: 9px 12px;
    background: var(--card);
    font-family: 'Inter', sans-serif;
}

/* ---------------- Panel spacing + section accents ---------------- */
/* Fixes bare stacked .panel elements (e.g. students.php, staff.php)
   reading as one continuous page — dashboard.php never showed this
   because its panels sit inside .dash-grid, which has its own gap. */
.content > .panel + .panel { margin-top: 20px; }

/* Optional colored top accent so visually distinct page sections
   (e.g. List / Add / Import) are told apart at a glance. */
.panel.accent-navy { border-top: 4px solid var(--navy); }
.panel.accent-gold { border-top: 4px solid var(--gold); }
.panel.accent-blue { border-top: 4px solid #2F6FE0; }

/* ---------------- Photo verification lightbox ---------------- */
/* Shared across every list page with a photo column (Staff, Students,
   Guardians, Photo Submissions, and any future page) — click any
   .row-avatar / .clickable-photo thumbnail to see it full-size.
   Security-relevant: a 36px circle isn't enough to actually verify
   someone's identity. */
.row-avatar.clickable-photo { cursor: pointer; transition: transform 0.1s; }
.row-avatar.clickable-photo:hover { transform: scale(1.15); }

.photo-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(16,42,70,0.75);
    z-index: 1000; align-items: center; justify-content: center; padding: 24px;
}
.photo-modal-overlay.open { display: flex; }
.photo-modal-box {
    background: #fff; border-radius: var(--r-card); padding: 16px; max-width: 360px; width: 100%;
    text-align: center; position: relative;
}
.photo-modal-box img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; }
.photo-modal-name { font-weight: 700; color: var(--navy-dark); margin-top: 12px; font-size: 15px; }
.photo-modal-close {
    position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%;
    background: var(--navy-dark); color: #fff; border: 2px solid #fff; font-size: 18px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ---------------- Form grid / fields ---------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="file"],
.form-group select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: #fff;
}
.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,138,45,0.15);
}
.form-group input[type="file"] { padding: 9px 10px; font-size: 12.5px; }
.form-hint { font-size: 11.5px; color: var(--text-secondary); margin-top: 5px; }

/* ---------------- Table row avatar + actions ---------------- */
/* Reusable across every list page with a photo column (Staff,
   Students, Guardians, Blacklist). Intentionally NOT named after
   any one page (e.g. not ".staff-photo") since it's shared. */
.row-name-cell { display: flex; align-items: center; gap: 10px; }
.row-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    background: var(--bg); border: 1px solid var(--border); flex-shrink: 0;
}
.row-avatar-fallback {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12.5px; font-family: 'Manrope', sans-serif;
}
.actions-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- Live Campus Activity feed ---------------- */
.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #F1F3F6;
}
.activity-item:last-child { border-bottom: none; }
.activity-item .ai-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
    background: var(--bg); border: 1px solid var(--border);
}
.activity-item .ai-avatar-fallback {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; font-family: 'Manrope', sans-serif;
}
.activity-item .ai-info { flex: 1; min-width: 0; }
.activity-item .ai-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.activity-item .ai-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item .ai-right { text-align: right; flex-shrink: 0; }
.activity-item .ai-time { font-size: 10.5px; color: var(--text-secondary); margin-top: 4px; }

/* ---------------- Chart cards ---------------- */
.chart-card canvas { max-width: 100%; }
.chart-legend { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.chart-legend li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-primary); }
.chart-legend .leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chart-legend .leg-label { flex: 1; }
.chart-legend .leg-value { font-weight: 700; color: var(--text-secondary); font-size: 11.5px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-canvas-box { position: relative; width: 140px; height: 140px; flex-shrink: 0; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .dc-value { font-size: 22px; font-weight: 800; color: var(--navy-dark); font-family: 'Manrope', sans-serif; line-height: 1; }
.donut-center .dc-label { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

/* ---------------- Quick Actions ---------------- */
.quick-actions { display: flex; flex-direction: column; gap: 6px; }
.qa-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 10px; border-radius: 12px;
    text-decoration: none; color: var(--text-primary);
    transition: background 0.15s;
}
.qa-row:hover { background: var(--bg); }
.qa-row .qa-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.qa-row .qa-icon svg { width: 16px; height: 16px; }
.qa-row .qa-label { flex: 1; font-size: 13.5px; font-weight: 700; }
.qa-row .qa-chevron { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }

.qa-row.qa-navy  .qa-icon { background: var(--navy); }
.qa-row.qa-gold  .qa-icon { background: var(--gold); }
.qa-row.qa-green .qa-icon { background: var(--success); }
.qa-row.qa-blue  .qa-icon { background: #2F6FE0; }
.qa-row.qa-purple .qa-icon { background: #7B5FE0; }
.qa-row.qa-red   .qa-icon { background: var(--error); }

/* ---------------- Today's Timeline ---------------- */
.timeline-list { display: flex; flex-direction: column; }
.timeline-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 4px; position: relative; }
.timeline-item .tl-time { font-size: 11px; color: var(--text-secondary); font-weight: 700; width: 58px; flex-shrink: 0; padding-top: 2px; }
.timeline-item .tl-dot-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.timeline-item .tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--navy); margin-top: 5px; }
.timeline-item .tl-line { width: 1.5px; flex: 1; background: #EBEEF3; margin-top: 2px; }
.timeline-item:last-child .tl-line { display: none; }
.timeline-item .tl-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.timeline-item .tl-status { font-size: 11px; color: var(--text-secondary); margin-left: auto; flex-shrink: 0; padding-top: 1px; }
.timeline-item .tl-dot.done { background: var(--success); }
.timeline-item .tl-dot.waiting { background: var(--warning); }
.timeline-item .tl-dot.upcoming { background: var(--border); }

/* ============================================================
   TABLET — 700px+
   ============================================================ */
@media (min-width: 700px) {
    .content { padding: 24px 24px 36px; }
    .mini-stats-strip { grid-template-columns: repeat(3, 1fr); }
    .topbar .user-info .u-text { display: block; }
    .gate-status-pill { display: flex; }
}

/* ============================================================
   DESKTOP — 1024px+  (sidebar becomes fixed/visible, no drawer)
   ============================================================ */
@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        transform: none;
        height: 100vh;
        height: 100dvh;
    }
    .sidebar-backdrop { display: none !important; }
    .hamburger-btn { display: none; }
    .sidebar .sidebar-close { display: none; }

    .content { padding: 28px 32px 40px; }
    .mini-stats-strip { grid-template-columns: repeat(5, 1fr); }

    .dash-grid { grid-template-columns: 2.1fr 1fr; align-items: start; }

    .topbar { padding: 16px 28px; }
    .topbar h1 { font-size: 18px; }
}

@media (min-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
