/* ============================================================
   JP Skating Club — Admin Dashboard
   Design: Ultra-Luxury — obsidian & champagne-gold, full mobile support
   ============================================================ */

:root {
    --ink: #0A0B0D;
    --ink-2: #101216;
    --rink: #C9A24B;
    --rink-dark: #A9832F;
    --rink-light: #2A2311;
    --frost: #0F1013;
    --amber: #D9A441;
    --amber-light: #2B2413;
    --coral: #E6685F;
    --coral-light: #2B1616;
    --mint: #38B08A;
    --mint-light: #12251E;
    --white: #15171C;
    --surface: #1A1D23;
    --surface-2: #20232B;
    --border: #2C3038;
    --text: #EDE7DA;
    --text-muted: #9A9488;
    --gold: #C9A24B;
    --gold-soft: #E6CE94;
    --sidebar-w: 252px;

    --font-display: 'Cormorant Garamond', 'Playfair Display', 'Space Grotesk', serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.35), 0 16px 40px rgba(0,0,0,0.35);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --gold-grad: linear-gradient(135deg, #E6CE94 0%, #C9A24B 45%, #9C7A2E 100%);
}

/* ---- Light mode override ----
   Same gold/champagne accent, but swapped onto a warm cream/ivory surface
   instead of obsidian. Toggled via html[data-theme="light"] (see the
   dark/light button in the topbar, header.php). */
html[data-theme="light"] {
    --ink: #FFFFFF;
    --ink-2: #F7F4EC;
    --rink-light: #F3E9CC;
    --frost: #FAF7F0;
    --amber-light: #FBF0DA;
    --coral-light: #FCEAE8;
    --mint-light: #E6F5EF;
    --white: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F5F1E8;
    --border: #E3DCC9;
    --text: #2A2416;
    --text-muted: #786F5C;
    --gold-soft: #8A6A1E;
    --shadow: 0 2px 8px rgba(60,45,10,0.08), 0 16px 40px rgba(60,45,10,0.10);
    --shadow-sm: 0 1px 3px rgba(60,45,10,0.08);
}
html[data-theme="light"] body {
    background: radial-gradient(1200px 700px at 10% -10%, #FBF3DC 0%, transparent 55%),
                radial-gradient(1000px 600px at 110% 10%, #F1F6F5 0%, transparent 50%),
                var(--frost);
}
html[data-theme="light"] ::selection { background: rgba(201,162,75,0.25); color: #2A2416; }
html[data-theme="light"] .scanner-card { background: linear-gradient(135deg, #F3E9CC, #FFFFFF); color: #2A2416; }
html[data-theme="light"] .scanner-card h3 { color: #2A2416; }
html[data-theme="light"] .scan-input { border-color: rgba(42,36,22,0.2); background: rgba(42,36,22,0.05); color: #2A2416; }
html[data-theme="light"] .scan-input::placeholder { color: rgba(42,36,22,0.45); }

/* ---- Theme toggle button (topbar) ---- */
.theme-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    cursor: pointer; font-size: 16px; transition: background .15s, border-color .15s;
}
.theme-toggle-btn:hover { background: var(--frost); border-color: var(--gold); }
html[data-theme="light"] .theme-toggle-btn .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle-btn .icon-sun { display: inline; }
html:not([data-theme="light"]) .theme-toggle-btn .icon-sun { display: none; }
html:not([data-theme="light"]) .theme-toggle-btn .icon-moon { display: inline; }

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: radial-gradient(1200px 700px at 10% -10%, #16130a 0%, transparent 55%),
                radial-gradient(1000px 600px at 110% 10%, #10151a 0%, transparent 50%),
                var(--frost);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gold-soft);
    letter-spacing: 0.01em;
    margin: 0 0 4px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--gold-soft); }
table { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

::selection { background: rgba(201,162,75,0.35); color: #fff; }

/* thin gold scrollbar for that luxury touch */
* { scrollbar-width: thin; scrollbar-color: var(--rink-dark) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #3a3223; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =============================================
   LAYOUT SHELL
   ============================================= */

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

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, #0C0D10 0%, #08090b 100%);
    color: #C9C2B2;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    border-right: 1px solid rgba(201,162,75,0.16);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.28s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px;
    border-bottom: 1px solid rgba(201,162,75,0.14);
    flex-shrink: 0;
}

.sidebar-brand img { height: 34px; width: auto; border-radius: 6px; }
.sidebar-brand .brand-icon {
    height: 38px; width: 38px; border-radius: 10px;
    background: var(--gold-grad); color: #1A1408;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(201,162,75,0.35);
}
.sidebar-brand .brand-name {
    font-family: var(--font-display); font-weight: 600; color: var(--gold-soft);
    font-size: 17px; line-height: 1.25; flex: 1; min-width: 0; letter-spacing: 0.02em;
}

/* Close button inside sidebar (mobile) */
.sidebar-close-btn {
    display: none;
    background: none; border: none; color: #9FB2B8; cursor: pointer;
    padding: 4px; border-radius: 6px; line-height: 1;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { color: white; background: rgba(255,255,255,0.1); }

.sidebar-nav { padding: 12px 10px; flex: 1; }

.sidebar-section-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
    color: #6B7C82; margin: 18px 10px 5px; font-weight: 600;
}

.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px; color: #ADA795;
    font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { background: rgba(201,162,75,0.08); text-decoration: none; color: var(--gold-soft); }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(201,162,75,0.18), rgba(201,162,75,0.03));
    color: var(--gold-soft);
    border-left-color: var(--gold);
}
.sidebar-nav .dot { width: 6px; height: 6px; border-radius: 50%; background: #57676E; flex-shrink: 0; }
.sidebar-nav a.active .dot { background: var(--gold); }
.sidebar-nav .nav-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; filter: grayscale(0.3); }

.sidebar-foot {
    padding: 14px 20px; border-top: 1px solid rgba(201,162,75,0.12);
    font-size: 13px; flex-shrink: 0;
}
.sidebar-foot a { color: #9A9488; }
.sidebar-foot a:hover { color: var(--gold-soft); }

/* =============================================
   SIDEBAR OVERLAY (mobile)
   ============================================= */

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 199;
    background: rgba(16,21,27,0.55);
    opacity: 0;
    transition: opacity 0.28s ease;
}

/* =============================================
   MAIN AREA
   ============================================= */

.main {
    flex: 1; min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-height: 100vh;
}

/* =============================================
   TOP BAR
   ============================================= */

.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px; height: 64px;
    background: rgba(21,23,28,0.85);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-bottom: 1px solid rgba(201,162,75,0.14);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 100px; padding: 7px 14px; font-size: 13px;
    color: var(--text-muted); max-width: 260px; flex: 1;
}
.topbar-search input {
    border: none; background: transparent; padding: 0; width: 100%;
    color: var(--text); font-size: 13px;
}
.topbar-search input:focus { outline: none; box-shadow: none; }
.topbar-clock {
    font-family: var(--font-mono); font-size: 12.5px; color: var(--gold-soft);
    background: var(--surface); border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 100px; letter-spacing: 0.03em;
}

/* Hamburger button */
.hamburger-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: 8px;
    color: var(--text); flex-shrink: 0;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--frost); }
.hamburger-btn svg { display: block; }

.topbar-spacer { flex: 1; }

.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.who { font-size: 13px; color: var(--text-muted); }
.who strong { color: var(--text); }

/* =============================================
   CONTENT
   ============================================= */

.content {
    padding: 26px 28px;
    max-width: 1220px;
    flex: 1;
}

/* =============================================
   PAGE HEADER
   ============================================= */

.page-head { margin-bottom: 24px; }
.page-head .lane-line {
    margin-top: 10px; height: 4px; width: 64px; border-radius: 4px;
    background: repeating-linear-gradient(90deg, var(--rink) 0 14px, var(--rink-light) 14px 20px);
}
.page-head-row {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.page-head p.subtitle { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }

/* =============================================
   STAT GRID
   ============================================= */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(160deg, var(--surface) 0%, var(--white) 100%);
    border: 1px solid var(--border); position: relative; overflow: hidden;
    border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.stat-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--gold-grad); opacity: 0.7;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: rgba(201,162,75,0.35); }

.stat-card .label {
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.stat-card .value {
    font-family: var(--font-display); font-size: 34px; font-weight: 700;
    color: var(--gold-soft); margin-top: 8px; font-variant-numeric: tabular-nums;
    line-height: 1;
}
.stat-card .value.accent-rink { color: var(--gold); }
.stat-card .value.accent-amber { color: var(--amber); }
.stat-card .value.accent-coral { color: var(--coral); }
.stat-card .value.accent-mint { color: var(--mint); }

/* =============================================
   CARDS
   ============================================= */

.card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 22px 24px; margin-bottom: 20px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.card-head h3 { font-size: 17px; }

/* =============================================
   FORMS
   ============================================= */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-group .hint { font-size: 12px; color: var(--text-muted); }

input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="tel"], input[type="email"], input[type="file"],
select, textarea {
    font-family: var(--font-body); font-size: 14px; padding: 10px 13px;
    border: 1.5px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text); width: 100%;
    transition: border-color 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: var(--gold); outline: none;
    box-shadow: 0 0 0 3px rgba(201,162,75,0.15);
}

.radio-row, .check-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-row label, .check-row label { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 6px; }

input[readonly] {
    background: var(--frost); color: var(--text-muted); cursor: not-allowed;
}
input[readonly]:focus { box-shadow: none; }

fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
fieldset legend { font-size: 12.5px; font-weight: 600; color: var(--text-muted); padding: 0 4px; }

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
    padding: 9px 16px; border-radius: 8px; border: 1.5px solid transparent;
    cursor: pointer; background: var(--surface); color: var(--text);
    border-color: var(--border); text-decoration: none; line-height: 1.2;
    transition: all 0.15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-primary { background: var(--gold-grad); border-color: transparent; color: #1A1408; font-weight: 700; box-shadow: 0 3px 10px rgba(201,162,75,0.25); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 16px rgba(201,162,75,0.4); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #1A1408; }
.btn-coral { background: var(--coral); border-color: var(--coral); color: white; }
.btn-mint { background: var(--mint); border-color: var(--mint); color: white; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* =============================================
   TABLES
   ============================================= */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
table.data th {
    text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--gold-soft); border-bottom: 1px solid rgba(201,162,75,0.25);
    padding: 11px 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2);
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover { background: rgba(201,162,75,0.05); }
table.data .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state h4 { color: var(--text); margin-bottom: 6px; }

/* =============================================
   BADGES
   ============================================= */

.badge {
    display: inline-block; font-size: 10.5px; font-weight: 700;
    padding: 3px 10px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--border); color: var(--text-muted);
}
.badge-active { background: var(--mint-light); color: var(--mint); border: 1px solid rgba(56,176,138,0.3); }
.badge-paused { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(217,164,65,0.3); }
.badge-expired { background: var(--coral-light); color: var(--coral); border: 1px solid rgba(230,104,95,0.3); }

.pill-muted {
    font-size: 12px; color: var(--text-muted); background: var(--surface);
    border: 1px solid var(--border); padding: 2px 9px; border-radius: 100px;
}

/* =============================================
   ALERTS
   ============================================= */

.alert {
    border-radius: 8px; padding: 12px 16px; margin-bottom: 18px;
    font-size: 14px; border: 1px solid transparent;
}
.alert-success { background: var(--mint-light); color: var(--mint); border-color: rgba(56,176,138,0.3); }
.alert-error { background: var(--coral-light); color: var(--coral); border-color: rgba(230,104,95,0.3); }
.alert-info { background: var(--rink-light); color: var(--gold-soft); border-color: rgba(201,162,75,0.3); }

/* =============================================
   AUTH PAGES
   ============================================= */

.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(201,162,75,0.10), transparent 60%),
        radial-gradient(700px 500px at 100% 100%, rgba(201,162,75,0.06), transparent 55%),
        linear-gradient(160deg, #050607 0%, #0c0e12 55%, #050607 100%);
    padding: 20px;
}
.auth-card {
    background: linear-gradient(160deg, #16181d 0%, #101216 100%);
    border: 1px solid rgba(201,162,75,0.2);
    border-radius: 18px;
    padding: 40px 34px; width: 100%; max-width: 390px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}
.auth-card .brand-icon {
    height: 48px; width: 48px; border-radius: 12px; background: var(--gold-grad); color: #1A1408;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 19px; margin-bottom: 18px;
    box-shadow: 0 6px 18px rgba(201,162,75,0.3);
}
.auth-card h1 { font-size: 24px; }
.auth-card p.lede { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 22px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 12.5px; color: rgba(237,231,218,0.55); }

/* =============================================
   MISC UTILITIES
   ============================================= */

.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

.kv {
    display: flex; justify-content: space-between; padding: 7px 0;
    border-bottom: 1px dashed var(--border); font-size: 13.5px;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-muted); }
.kv .v { font-weight: 600; text-align: right; }

.logo-preview { height: 48px; border-radius: 8px; border: 1px solid var(--border); padding: 4px; background: var(--surface); }

/* =============================================
   MODAL
   ============================================= */

.modal { display: none; position: fixed; inset: 0; z-index: 300; }
.modal.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,6,7,0.7); backdrop-filter: blur(3px); }
.modal-dialog {
    position: relative; max-width: 500px; margin: 5vh auto;
    background: linear-gradient(160deg, #17191f 0%, #101216 100%);
    border: 1px solid rgba(201,162,75,0.2);
    border-radius: 16px;
    padding: 26px; box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    max-height: 90vh; overflow-y: auto;
}
.modal-dialog h3 { margin-bottom: 4px; }
.modal-close-row { display: flex; justify-content: flex-end; margin-top: 18px; gap: 10px; }

/* =============================================
   LUXURY EXTRAS — chart cards, timeline, flourishes
   ============================================= */

.section-title-flourish {
    display: flex; align-items: center; gap: 12px; margin: 4px 0 18px;
}
.section-title-flourish::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(201,162,75,0.4), transparent);
}

.chart-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 22px 24px; margin-bottom: 20px;
}

.badge-gold {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.06em;
    background: var(--rink-light); color: var(--gold-soft);
    border: 1px solid rgba(201,162,75,0.35);
}

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1px;
    background: linear-gradient(180deg, rgba(201,162,75,0.5), rgba(201,162,75,0.05));
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
    content: ""; position: absolute; left: -22px; top: 3px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--gold-grad); box-shadow: 0 0 0 3px rgba(201,162,75,0.15);
}
.timeline-item .t-title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.timeline-item .t-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.kbd {
    font-family: var(--font-mono); font-size: 11px; background: var(--surface-2);
    border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
    padding: 1px 6px; color: var(--text-muted);
}

/* =============================================
   PRINT
   ============================================= */

@media print {
    .no-print { display: none !important; }
    body { background: white; }
}

/* =============================================
   RESPONSIVE — TABLET  (max 1024px)
   ============================================= */

@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .content { padding: 20px; }
    .topbar { padding: 0 20px; }
    .filter-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 12px !important;
    }
    .filter-grid .search-group {
        grid-column: 1 / -1;
    }
}

/* =============================================
   RESPONSIVE — MOBILE SIDEBAR  (max 880px)
   Mobile: sidebar slides in from left as drawer
   ============================================= */

@media (max-width: 880px) {
    /* Sidebar becomes off-canvas drawer */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(16,21,27,0.3);
    }
    .sidebar-close-btn { display: flex; }

    /* Overlay becomes active */
    .sidebar-overlay.is-open {
        display: block;
        opacity: 1;
    }

    /* Main fills full width */
    .main { margin-left: 0; }

    /* Show hamburger */
    .hamburger-btn { display: flex; }

    /* Topbar adjustments */
    .topbar { height: 56px; padding: 0 16px; }
    .topbar-right .who:first-child { display: none; }

    .content { padding: 16px; }
    .page-head { margin-bottom: 18px; }
    .page-head-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* =============================================
   RESPONSIVE — SMALL MOBILE  (max 560px)
   ============================================= */

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 16px; }
    .stat-card .value { font-size: 24px; }

    .card { padding: 16px; }
    .modal-dialog { margin: 0; border-radius: 14px 14px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%; max-height: 92vh; }

    .btn-row { gap: 6px; }
    .btn { padding: 8px 13px; font-size: 13px; }
    .btn-sm { padding: 6px 10px; font-size: 12px; }

    table.data th, table.data td { padding: 9px 10px; }

    .topbar { gap: 8px; }
    .who { font-size: 12px; }
}

/* =============================================
   RESPONSIVE — STUDENTS FILTER (max 720px)
   ============================================= */

@media (max-width: 720px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .filter-grid .search-group {
        grid-column: 1 / -1;
    }
}

/* =============================================
   MOBILE CARD TABLE — cards instead of rows
   ============================================= */

@media (max-width: 640px) {
    .table-wrap.mobile-cards { overflow-x: visible; }
    .table-wrap.mobile-cards table.data { display: block; min-width: unset; }
    .table-wrap.mobile-cards table.data thead { display: none; }
    .table-wrap.mobile-cards table.data tbody { display: flex; flex-direction: column; gap: 10px; }
    .table-wrap.mobile-cards table.data tr {
        display: grid; grid-template-columns: 1fr 1fr;
        background: var(--white); border: 1px solid var(--border);
        border-radius: 10px; padding: 14px; gap: 8px 12px;
    }
    .table-wrap.mobile-cards table.data tr:hover { background: var(--white); }
    .table-wrap.mobile-cards table.data td {
        padding: 0; border-bottom: none;
        font-size: 13.5px; position: relative;
        display: flex; flex-direction: column;
    }
    .table-wrap.mobile-cards table.data td::before {
        content: attr(data-label);
        font-size: 10.5px; font-weight: 700; color: var(--text-muted);
        text-transform: uppercase; letter-spacing: 0.04em;
        margin-bottom: 2px;
    }
    .table-wrap.mobile-cards table.data td:last-child {
        grid-column: 1 / -1;
        flex-direction: row; align-items: center; gap: 6px;
        margin-top: 4px; padding-top: 10px;
        border-top: 1px solid var(--border);
    }
    .table-wrap.mobile-cards table.data td:last-child::before { display: none; }
}
