/* ───────────────────────────────────────────────
   Spark Design System — base.css
   ─────────────────────────────────────────────── */

:root {
    /* ── Surfaces ───────────────────────────── */
    --bg:           #F4F5F7;
    --surface:      #FFFFFF;
    --surface-2:    #F1F3F8;

    /* ── Ink & Text ─────────────────────────── */
    --ink:          #0E1116;
    --text:         #1A1F29;
    --muted:        #6B7280;
    --dim:          #666E80;
    --line:         #E6E8EE;

    /* ── Brand Blues ────────────────────────── */
    --blue:         #3B5BFF;
    --blue-deep:    #2A3FB8;
    --blue-mid:     #4A6BFF;
    --blue-ink:     #1B2470;
    --blue-soft:    #E5EAFF;
    --blue-tint:    #DCE3FF;

    /* ── Status ─────────────────────────────── */
    --success:      #16A34A;
    --error:        #DC2626;
    --warning:      #D97706;
    --ok:           #059669;
    --gold:         #FCD34D;

    /* ── Shadows ────────────────────────────── */
    --sh-sm:   0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.03);
    --sh-md:   0 8px 24px rgba(20,30,80,.08);
    --sh-blue: 0 10px 28px rgba(59,91,255,.28);

    /* ── Radii ──────────────────────────────── */
    --r-sm:   10px;
    --r-md:   14px;
    --r-lg:   20px;
    --r-xl:   28px;
    --r-pill: 999px;

    /* ── Spacing scale (4px base) ───────────── */
    --s-1:  4px;
    --s-2:  8px;
    --s-3:  12px;
    --s-4:  16px;
    --s-5:  20px;
    --s-6:  24px;
    --s-7:  32px;
    --s-8:  40px;

    /* ── Typography ─────────────────────────── */
    --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-body:    'Figtree', system-ui, -apple-system, sans-serif;
    --font-mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

    --fs-display: 64px;
    --fs-h1:      40px;
    --fs-h2:      28px;
    --fs-h3:      20px;
    --fs-body:    15px;
    --fs-small:   13px;
    --fs-caption: 11px;

    /* ── Legacy aliases (backward compat) ───── */
    --bg2:          var(--surface-2);
    --nav-bg:       var(--surface);
    --card:         var(--surface);
    --card-dark:    var(--blue-deep);
    --card-dark2:   var(--blue-mid);
    --accent:       var(--blue);
    --accent-mid:   var(--blue-mid);
    --accent-dark:  var(--blue-deep);
    --accent-soft:  var(--blue-soft);
    --accent-tag:   var(--blue-tint);
    --border:       var(--line);
    --border-hover: rgba(59,91,255,0.30);
    --hover:        var(--surface-2);
    --shadow:       var(--sh-sm);
    --shadow-lg:    var(--sh-md);
    --shadow-blue:  var(--sh-blue);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ── */
body {
    font-family: var(--font-body);
    background-color: var(--bg);
    background-image: url('/static/img/bg-desktop.webp?v=1');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
@media (max-width: 768px) {
    body {
        background-image: url('/static/img/bg-mobile.webp?v=1');
        background-attachment: scroll;
    }
}

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -0.025em;
}

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-deep); }

/* ── Skip link (accessibility) ── */
.skip-link {
    position: absolute; top: -100%; left: 8px;
    background: var(--blue); color: #fff;
    padding: 8px 16px; border-radius: 0 0 8px 8px;
    font-size: 14px; font-weight: 700; z-index: 10000;
    transition: top 0.1s;
}
.skip-link:focus { top: 0; color: #fff; opacity: 1; }

/* ── Nav loader ── */
#nav-loader {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    height: 3px; background: var(--blue);
    transform: scaleX(0); transform-origin: left;
    pointer-events: none;
}
#nav-loader.active {
    transform: scaleX(0.85);
    transition: transform 0.4s cubic-bezier(0.1, 0.6, 0.3, 1);
}

/* ── Floating widgets ── */
.floating-widget-tray {
    position: fixed;
    right: 18px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: none;
}
.notif-bell {
    position: relative;
    flex: 0 0 auto;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--line);
    box-shadow: var(--sh-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.15s;
    color: var(--blue);
    pointer-events: auto;
}
.notif-bell:hover { box-shadow: 0 8px 28px rgba(20,30,80,.14); transform: translateY(-2px); opacity: 1; }
.notif-bell-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: #DC2626; color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
    border: 2px solid var(--surface);
}

/* ── Main ── */
.main {
    flex: 1; max-width: 1000px; width: 100%; margin: 0 auto;
    padding: 24px 24px calc(80px + env(safe-area-inset-bottom, 0px));
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 22px;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: rgba(59,91,255,.18); }

.card-dark {
    background: var(--blue-deep);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 22px;
    color: #fff;
    transition: box-shadow .2s, transform .2s;
}
.card-dark:hover { box-shadow: 0 8px 32px rgba(20,30,80,.22); transform: translateY(-2px); }

.card-blue {
    background: linear-gradient(165deg, #6F8BFF 0%, var(--blue) 100%);
    border: none;
    border-radius: var(--r-lg);
    box-shadow: var(--sh-blue);
    padding: 22px;
    color: #fff;
    transition: box-shadow .2s, transform .2s;
}
.card-blue:hover { box-shadow: 0 12px 36px rgba(59,91,255,.38); transform: translateY(-2px); }

.card-icon { font-size: 28px; margin-bottom: 14px; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.015em; }
.card-desc { font-size: 13px; line-height: 1.55; }
.card .card-title { color: var(--ink); }
.card .card-desc { color: var(--muted); }
.card-dark .card-title, .card-blue .card-title { color: #fff; }
.card-dark .card-desc, .card-blue .card-desc { color: rgba(255,255,255,.72); }

/* Card icon variants */
.card-icon-wrap {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    background: var(--blue-soft);
    color: var(--blue);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.card-dark .card-icon-wrap,
.card-blue .card-icon-wrap { background: rgba(255,255,255,.16); color: #fff; }

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

/* Dark pill (primary Spark button) */
.btn-dark {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink); color: #fff;
    font-size: 14px; font-weight: 600;
    padding: 13px 22px; border-radius: var(--r-pill);
    border: none; cursor: pointer; font-family: inherit;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
.btn-dark:hover { background: #000; transform: translateY(-1px); color: #fff; opacity: 1; }
.btn-dark .arrow {
    width: 22px; height: 22px;
    background: var(--blue);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px;
}

/* Blue brand button */
.btn-blue {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--blue); color: #fff;
    font-size: 14px; font-weight: 600;
    padding: 13px 22px; border-radius: var(--r-pill);
    border: none; cursor: pointer; font-family: inherit;
    box-shadow: var(--sh-blue);
    text-decoration: none;
    transition: filter .15s, transform .15s;
}
.btn-blue:hover { filter: brightness(1.05); transform: translateY(-1px); color: #fff; opacity: 1; }

/* Outline button */
.btn-outline {
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; color: var(--ink);
    font-size: 14px; font-weight: 600;
    padding: 12px 22px; border-radius: var(--r-pill);
    border: 1.5px solid var(--line);
    cursor: pointer; font-family: inherit;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); opacity: 1; }

/* Legacy primary button (kept for template compat) */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--blue); color: #fff;
    padding: 13px 28px; border-radius: var(--r-pill);
    font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: inherit; border: none;
    width: 100%; text-align: center;
    transition: filter .15s, box-shadow .2s, transform .15s;
    box-shadow: var(--sh-blue);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 12px 32px rgba(59,91,255,.38); transform: translateY(-1px); color: #fff; opacity: 1; }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.btn-primary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ═══════════════════════════════════════
   PILL NAVIGATION
   ═══════════════════════════════════════ */
.nav-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 6px;
    border-radius: var(--r-pill);
}
.nav-pill-item {
    font-size: 14px; font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 16px; border-radius: var(--r-pill);
    transition: color .15s, background .15s;
    border: none; cursor: pointer; font-family: inherit; background: transparent;
}
.nav-pill-item:hover { color: var(--ink); opacity: 1; }
.nav-pill-item.active,
.nav-pill-item--active {
    background: var(--blue);
    color: #fff;
}

/* ═══════════════════════════════════════
   CHIPS / TAGS
   ═══════════════════════════════════════ */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--blue-soft);
    color: var(--blue-ink);
    border: 1px solid var(--blue-tint);
    font-size: 12px; font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--r-pill);
}
.chip.dark {
    background: rgba(255,255,255,.16);
    color: #fff;
    border-color: rgba(255,255,255,.28);
}
.chip-x { opacity: 0.55; font-weight: 400; }

/* Legacy tag-pill */
.tag-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: var(--r-pill);
    font-size: 12px; font-weight: 600;
    background: var(--blue-soft); color: var(--blue);
}
.tag-pill-muted {
    background: var(--bg); color: var(--muted);
    border: 1px solid var(--line);
}

/* ═══════════════════════════════════════
   STAT TILE / METRIC
   ═══════════════════════════════════════ */
.stat-tile {
    background: var(--surface-2);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    display: flex; flex-direction: column;
    justify-content: space-between;
}
.stat-tile-head {
    display: flex; align-items: center; gap: 8px;
    color: var(--muted);
    font-size: 13px; font-weight: 500;
}
.stat-tile-head .ico {
    width: 28px; height: 28px;
    background: var(--blue-soft);
    color: var(--blue);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.stat-tile-value {
    font-family: var(--font-display);
    font-size: 30px; font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-top: 18px;
}

/* ═══════════════════════════════════════
   SEGMENTED CONTROL
   ═══════════════════════════════════════ */
.seg {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: var(--r-pill);
    padding: 4px;
}
.seg-btn {
    background: transparent;
    border: none; cursor: pointer; font-family: inherit;
    color: var(--muted);
    font-size: 13px; font-weight: 500;
    padding: 8px 18px;
    border-radius: var(--r-pill);
    transition: background .15s, color .15s;
}
.seg-btn.active {
    background: var(--blue);
    color: #fff;
}

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-label,
.field-label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.form-select, .form-input,
.field-input, .field-select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 14px 18px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.form-select::placeholder, .form-input::placeholder,
.field-input::placeholder { color: var(--dim); }
.form-select:focus, .form-input:focus,
.field-input:focus, .field-select:focus {
    background: var(--surface);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,91,255,.15);
}
.form-select option, .field-select option { background: var(--surface); }

/* Select with custom arrow */
.field-select, select.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ── Radio buttons ── */
.radio-group { display: flex; gap: 10px; }
.radio-btn {
    flex: 1; padding: 11px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
    text-align: center; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s;
    font-size: 14px; font-weight: 500; color: var(--muted);
}
.radio-btn:hover { border-color: rgba(59,91,255,.30); color: var(--blue); }
.radio-btn input { display: none; }
.radio-btn.active, .radio-btn:has(input:checked) {
    border-color: var(--blue); color: var(--blue);
    background: var(--blue-soft);
}

/* ── File input area ── */
.file-input-wrap {
    border: 2px dashed var(--line); border-radius: var(--r-md);
    padding: 32px; text-align: center; cursor: pointer;
    background: var(--surface-2); transition: border-color 0.25s, background 0.25s;
}
.file-input-wrap:hover { border-color: var(--blue); background: var(--blue-soft); }
.file-input-wrap input[type="file"] { display: none; }

/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert { padding: 14px 18px; border-radius: var(--r-md); font-size: 14px; line-height: 1.5; }
.alert-success { background: rgba(22,163,74,0.08); border: 1px solid rgba(22,163,74,0.18); color: var(--success); }
.alert-error   { background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.18); color: var(--error); }

/* ═══════════════════════════════════════
   GRIDS & LAYOUT UTILITIES
   ═══════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ═══════════════════════════════════════
   TEXT UTILITIES
   ═══════════════════════════════════════ */
.text-gradient { font-weight: 800; color: var(--blue); }
.text-muted { color: var(--muted); }
.footer { text-align: center; padding: 20px; font-size: 12px; color: var(--dim); }

/* ── Badges ── */
.badge { display: inline-block; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.badge-before { background: rgba(220,38,38,0.08); color: var(--error); }
.badge-after  { background: rgba(22,163,74,0.10); color: var(--success); }

/* ── Caption ── */
.caption {
    font-size: var(--fs-caption); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--dim);
}

/* ═══════════════════════════════════════
   PHOTO GRID
   ═══════════════════════════════════════ */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* ═══════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════ */
.lightbox {
    position: fixed; inset: 0; background: rgba(10,10,30,0.9);
    z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-stage {
    position: relative; display: flex; flex-direction: column; align-items: center;
    gap: 12px; width: min(100%, 1100px); max-height: 100%;
}
#lightbox-img { max-width: 100%; max-height: 75vh; border-radius: var(--r-md); box-shadow: 0 24px 80px rgba(0,0,0,.5); object-fit: contain; background: #000; }
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer;
    transition: background 0.2s; z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,.28); }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.32); }
.lightbox-prev { left: -8px; }
.lightbox-next { right: -8px; }
.lightbox.is-single .lightbox-nav,
.lightbox.is-single .lightbox-thumbs,
.lightbox.is-single .lightbox-counter { display: none; }
.lightbox-counter { color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
.lightbox-thumbs {
    display: flex; gap: 8px; overflow-x: auto; max-width: 100%;
    padding: 4px 2px; scrollbar-width: thin;
}
.lightbox-thumbs::-webkit-scrollbar { height: 6px; }
.lightbox-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.lightbox-thumb {
    flex: 0 0 auto; padding: 0; background: none; cursor: pointer;
    border: 2px solid transparent; border-radius: 8px; overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.lightbox-thumb img { width: 72px; height: 54px; object-fit: cover; display: block; opacity: 0.7; transition: opacity .15s; }
.lightbox-thumb:hover { border-color: rgba(255,255,255,.4); }
.lightbox-thumb:hover img { opacity: 0.9; }
.lightbox-thumb.is-current { border-color: var(--blue); }
.lightbox-thumb.is-current img { opacity: 1; }

/* ── Spinner ── */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
    display: inline-block; vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Inline SVG icons ── */
.svg-icon {
    display: inline-block;
    width: 1em; height: 1em;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.svg-icon-fill { fill: currentColor; stroke: none; }

/* ═══════════════════════════════════════
   DESKTOP SIDEBAR (≥1024px)
   ═══════════════════════════════════════ */
.app-sidebar, .staff-aside { display: none; }

@media (min-width: 1024px) {
    body { flex-direction: row; align-items: stretch; }

    .app-sidebar, .staff-aside {
        display: flex;
        flex-direction: column;
        width: 220px;
        flex-shrink: 0;
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        background: var(--surface);
        border-right: 1px solid var(--line);
        z-index: 50;
        overflow-y: auto;
        padding: 0;
    }

    .main {
        margin-left: 220px;
        max-width: none;
        padding: 32px 40px 48px;
        width: calc(100% - 220px);
    }

    .bottom-nav { display: none !important; }

    .floating-widget-tray {
        top: auto;
        right: 24px;
        bottom: 24px;
        z-index: 250;
    }
}

@media (max-width: 767px) {
    .floating-widget-tray {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px;
        bottom: auto;
        gap: 8px;
    }
    .notif-bell {
        width: 44px;
        height: 44px;
    }
}

@media (min-width: 1400px) {
    .main { padding: 40px 64px 48px; }
}

/* ── Desktop sidebar inner styles ── */
.desk-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--line);
}
.desk-brand-name { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }

.desk-nav {
    flex: 1;
    display: flex; flex-direction: column;
    padding: 12px 10px;
    gap: 2px;
}
.desk-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-sm);
    font-size: 14px; font-weight: 600;
    color: var(--muted); text-decoration: none;
    transition: background .15s, color .15s;
}
.desk-nav-item:hover { background: var(--surface-2); color: var(--ink); opacity: 1; }
.desk-nav-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: var(--r-sm); }
.desk-nav-item.desk-nav-active { background: var(--blue-soft); color: var(--blue); }
.desk-nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.desk-nav-divider { height: 1px; background: var(--line); margin: 8px 10px; }
.desk-nav-footer {
    padding: 12px 10px 20px;
    border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 2px;
}
.desk-nav-logout { color: var(--dim) !important; }
.desk-nav-logout:hover { color: var(--error) !important; background: rgba(220,38,38,.06) !important; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .nav { display: none; }
    .nav-mobile { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .main { padding: 16px 16px calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
    .lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
    .lightbox-thumb img { width: 56px; height: 42px; }
    #lightbox-img { max-height: 65vh; }
}
@media (max-width: 480px) {
    .grid-3 { grid-template-columns: 1fr; }
    .main { padding: 12px 12px calc(80px + env(safe-area-inset-bottom, 0px)); }
    .card, .card-dark, .card-blue { padding: 18px; border-radius: var(--r-md); }
    .card-title { font-size: 15px; }
}

/* ── Touch devices ── */
@media (hover: none), (pointer: coarse) {
    .btn-primary:hover, .btn-dark:hover, .btn-blue:hover { transform: none; box-shadow: none; filter: none; }
    .card:hover, .card-dark:hover, .card-blue:hover { transform: none; box-shadow: var(--sh-sm); }
    .desk-nav-item:hover { background: none; color: var(--muted); }
    .btn-primary:active { filter: brightness(0.95); }
    .card:active { border-color: rgba(59,91,255,.18); }
}

/* ── focus-visible ── */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ── Student tag pills (admin LK) ───────────────────────────────── */
.tag-pill {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--r-pill);
    font-size: 11px; font-weight: 800; line-height: 1.4;
    letter-spacing: 0.02em; white-space: nowrap;
}
.tag-pill--exam         { background: var(--blue-soft);            color: var(--blue-ink); }
.tag-pill--mode-offline { background: rgba(22,163,74,0.12);        color: var(--success); }
.tag-pill--mode-online  { background: rgba(59,91,255,0.12);        color: var(--blue); }
.tag-pill--case         { background: rgba(252,211,77,0.22);       color: #92590A; }
.tag-pill--publish      { background: rgba(124,58,237,0.12);       color: #7C3AED; }
.tag-pill--curator      { background: rgba(107,114,128,0.10);      color: var(--dim); }

.student-tag-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
