/* =========================================================
   Alwise Quran Academy — v3 Theme
   Trendy: gradients, glassmorphism, soft shadows, motion
   Palette: Purple / Slate / White
   ========================================================= */

:root,
[data-bs-theme="light"] {
    /* Legacy token names retained; values remapped to purple palette */
    --aqa-forest:        #7C3AED; /* main brand */
    --aqa-forest-deep:   #6D28D9; /* active / pressed */
    --aqa-forest-soft:   #6D28D9; /* hover */
    --aqa-forest-glow:   #A78BFA; /* soft purple */
    --aqa-cream:         #F8FAFC; /* on-dark text accent */
    --aqa-cream-soft:    #F3E8FF; /* light purple wash */
    --aqa-gold:          #A78BFA; /* accent (was gold) */
    --aqa-gold-soft:     #C4B5FD;
    --aqa-gold-glow:     #DDD6FE;
    --aqa-ink:           #111827; /* main text */
    --aqa-muted:         #6B7280; /* secondary text */
    --aqa-surface:       #FFFFFF; /* card */
    --aqa-surface-2:     #F8FAFC;
    --aqa-border:        #E5E7EB;
    --aqa-shadow:        0 10px 30px -12px rgba(17, 24, 39, .12);
    --aqa-shadow-lg:     0 20px 50px -18px rgba(17, 24, 39, .22);
    --aqa-radius:        18px;
    --aqa-radius-sm:     12px;

    --aqa-grad-hero:     linear-gradient(135deg,#6D28D9 0%, #7C3AED 50%, #8B5CF6 100%);
    --aqa-grad-gold:     linear-gradient(135deg,#7C3AED 0%, #A78BFA 100%);
    --aqa-grad-card:     linear-gradient(160deg,#ffffff 0%, #F8FAFC 100%);
    --aqa-glass-bg:      rgba(255,255,255,.72);
    --aqa-glass-border:  rgba(255,255,255,.6);

    --bs-body-bg:        #F8FAFC;
    --bs-body-color:     var(--aqa-ink);
    --bs-primary:        #7C3AED;
    --bs-primary-rgb:    124,58,237;
    --bs-link-color:     #7C3AED;
    --bs-link-hover-color: #6D28D9;
    --bs-border-color:   var(--aqa-border);
}

[data-bs-theme="dark"] {
    --aqa-forest:        #A78BFA; /* brand glow on dark */
    --aqa-forest-deep:   #020617;
    --aqa-forest-soft:   #8B5CF6; /* hover */
    --aqa-forest-glow:   #C4B5FD;
    --aqa-cream:         #F8FAFC; /* sidebar text */
    --aqa-cream-soft:    #1E293B; /* hover bg */
    --aqa-gold:          #A78BFA;
    --aqa-gold-soft:     #8B5CF6;
    --aqa-gold-glow:     #C4B5FD;
    --aqa-ink:           #F8FAFC;
    --aqa-muted:         #94A3B8;
    --aqa-surface:       #111827; /* card */
    --aqa-surface-2:     #0F172A;
    --aqa-border:        #1E293B;
    --aqa-shadow:        0 10px 30px -12px rgba(0,0,0,.6);
    --aqa-shadow-lg:     0 25px 60px -20px rgba(0,0,0,.75);

    --aqa-grad-hero:     linear-gradient(135deg,#020617 0%, #0F172A 45%, #4C1D95 100%);
    --aqa-grad-gold:     linear-gradient(135deg,#7C3AED 0%, #A78BFA 100%);
    --aqa-grad-card:     linear-gradient(160deg, #111827 0%, #0F172A 100%);
    --aqa-glass-bg:      rgba(15,23,42,.72);
    --aqa-glass-border:  rgba(255,255,255,.06);

    --bs-body-bg:        #0F172A;
    --bs-body-color:     var(--aqa-ink);
    --bs-primary:        #7C3AED;
    --bs-primary-rgb:    124,58,237;
    --bs-link-color:     #A78BFA;
    --bs-link-hover-color: #C4B5FD;
    --bs-border-color:   var(--aqa-border);
}

* { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Plus Jakarta Sans','Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(800px 500px at -10% -20%, rgba(124,58,237,.10), transparent 60%),
        radial-gradient(700px 500px at 110% 110%, rgba(167,139,250,.10), transparent 60%);
    background-attachment: fixed;
}
[data-bs-theme="dark"] body {
    background-image:
        radial-gradient(900px 600px at -10% -20%, rgba(124,58,237,.20), transparent 60%),
        radial-gradient(700px 500px at 110% 110%, rgba(139,92,246,.12), transparent 60%);
}

/* Brand logo image */
.aqa-brand-logo {
    display: inline-block;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 2px;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.25);
}
/* On hero/sidebar (coloured bg) lift with a brighter shadow */
.aqa-auth__brand .aqa-brand-logo,
.aqa-sidebar     .aqa-brand-logo { box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); }

/* Brand */
.aqa-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    color: var(--aqa-forest);
    letter-spacing: -0.02em;
}
.aqa-brand .aqa-dot {
    color: var(--aqa-gold);
    text-shadow: 0 0 16px rgba(167,139,250,.6);
}
.aqa-logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 14px;
    background: var(--aqa-grad-gold);
    color: #fff;
    font-weight: 900; font-size: 1.1rem;
    box-shadow: 0 8px 22px -8px rgba(124,58,237,.55);
}

/* Buttons */
.btn { border-radius: 12px; font-weight: 600; letter-spacing: .01em; }
.btn-lg { border-radius: 14px; padding: .85rem 1.4rem; }
.btn-primary {
    --bs-btn-bg: #7C3AED;
    --bs-btn-border-color: #7C3AED;
    --bs-btn-hover-bg: #6D28D9;
    --bs-btn-hover-border-color: #6D28D9;
    --bs-btn-active-bg: #5B21B6;
    --bs-btn-active-border-color: #5B21B6;
    color: #fff;
    box-shadow: 0 8px 22px -10px rgba(124,58,237,.55);
}
[data-bs-theme="dark"] .btn-primary {
    --bs-btn-hover-bg: #8B5CF6;
    --bs-btn-hover-border-color: #8B5CF6;
    box-shadow: 0 8px 22px -10px rgba(124,58,237,.45);
}
.btn-gold {
    background: var(--aqa-grad-gold);
    border: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 25px -10px rgba(124,58,237,.6);
}
.btn-gold:hover { transform: translateY(-1px); color: #fff; filter: brightness(1.05); }
.btn-outline-primary {
    --bs-btn-color: var(--aqa-forest);
    --bs-btn-border-color: var(--aqa-forest);
    --bs-btn-hover-bg: var(--aqa-forest);
    --bs-btn-hover-border-color: var(--aqa-forest);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--aqa-forest-glow); --bs-btn-border-color: var(--aqa-forest-glow); }
.btn-ghost {
    background: transparent;
    color: var(--aqa-ink);
    border: 1px solid var(--aqa-border);
}
.btn-ghost:hover { background: var(--aqa-cream-soft); }

/* Forms */
.form-control, .form-select {
    border-radius: 12px;
    padding: .75rem 1rem;
    background: var(--aqa-surface);
    border: 1px solid var(--aqa-border);
    color: var(--bs-body-color);
}
.form-control:focus, .form-select:focus {
    border-color: #A78BFA;
    box-shadow: 0 0 0 4px rgba(124,58,237,.20);
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background: rgba(255,255,255,.04); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }

/* Cards / surfaces */
.card, .aqa-surface {
    background: var(--aqa-grad-card);
    border: 1px solid var(--aqa-border);
    border-radius: var(--aqa-radius);
    box-shadow: var(--aqa-shadow);
}
.aqa-surface-2 { background: var(--aqa-surface-2); }
.aqa-glass {
    background: var(--aqa-glass-bg);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--aqa-glass-border);
    border-radius: var(--aqa-radius);
}

/* ============ AUTH (split-screen) ============ */
.aqa-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bs-body-bg);
}
.aqa-auth__brand {
    position: relative;
    color: #fff;
    background: var(--aqa-grad-hero);
    padding: 3rem;
    overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
}
.aqa-auth__brand::before,
.aqa-auth__brand::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.aqa-auth__brand::before { width: 380px; height: 380px; background: rgba(167,139,250,.55); top: -100px; right: -120px; }
.aqa-auth__brand::after  { width: 480px; height: 480px; background: rgba(124,58,237,.55); bottom: -180px; left: -160px; }
.aqa-auth__brand > * { position: relative; z-index: 1; }
.aqa-auth__hero h1 {
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-top: 1.25rem;
}
.aqa-auth__hero p { color: rgba(255,255,255,.78); max-width: 460px; margin-top: 1rem; }
.aqa-auth__chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.aqa-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff; font-size: .78rem; font-weight: 600;
    backdrop-filter: blur(10px);
}
.aqa-chip i { color: var(--aqa-gold-glow); }

.aqa-auth__form-pane {
    display: flex; align-items: center; justify-content: center;
    padding: 3rem 1.5rem;
    position: relative;
}
.aqa-auth__card {
    width: 100%; max-width: 440px;
    background: var(--aqa-surface);
    border: 1px solid var(--aqa-border);
    border-radius: 22px;
    padding: 2.25rem;
    box-shadow: var(--aqa-shadow-lg);
}
.aqa-auth__card h2 { font-weight: 800; letter-spacing: -.01em; }
.aqa-auth__quick {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: .5rem; margin-top: 1rem; font-size: .78rem;
}
.aqa-auth__quick button {
    border: 1px dashed var(--aqa-border);
    border-radius: 10px;
    background: transparent;
    color: var(--aqa-muted);
    padding: .45rem .6rem;
    text-align: left;
    transition: .15s;
}
.aqa-auth__quick button:hover { border-color: var(--aqa-forest); color: var(--aqa-forest); background: var(--aqa-cream-soft); }
[data-bs-theme="dark"] .aqa-auth__quick button:hover { background: rgba(255,255,255,.05); }
.aqa-auth__quick small { display: block; font-size: .7rem; color: var(--aqa-muted); }

@media (max-width: 900px) {
    /* ===== Mobile-app style auth: hero strip + rising bottom sheet ===== */
    .aqa-auth {
        grid-template-columns: 1fr;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        background: var(--aqa-surface);
        position: relative;     /* anchor for floating top toolbar */
        overflow-x: hidden;
    }

    /* Gradient hero strip with deep curved bottom */
    .aqa-auth__brand {
        flex: 0 0 auto;
        padding: calc(env(safe-area-inset-top, 0px) + 3.25rem) 1.5rem 4.5rem;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: .25rem;
        min-height: 38vh;
    }
    .aqa-auth__brand::before { width: 280px; height: 280px; top: -80px; right: -80px; opacity: .65; }
    .aqa-auth__brand::after  { width: 320px; height: 320px; bottom: -120px; left: -100px; opacity: .55; }

    /* Brand row → centered logo column */
    .aqa-auth__brand > .d-flex:first-child {
        flex-direction: column;
        gap: .85rem !important;
        justify-content: center;
        font-size: 1rem;
    }
    .aqa-auth__brand .aqa-brand-logo {
        width: 74px !important; height: 74px !important;
        border-radius: 22px;
        box-shadow: 0 10px 28px -6px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.25);
    }
    .aqa-auth__brand > .d-flex:first-child > span { font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; }
    .aqa-auth__brand > .d-flex:last-child { display: none !important; }

    /* Condensed hero text */
    .aqa-auth__brand .aqa-auth__hero { display: block; margin-top: .35rem; }
    .aqa-auth__hero .badge-soft { display: none; }
    .aqa-auth__hero h1 {
        font-size: 1.4rem; margin-top: .15rem; line-height: 1.2;
        text-shadow: 0 2px 12px rgba(0,0,0,.18);
    }
    .aqa-auth__hero p {
        font-size: .82rem; max-width: 280px; margin: .4rem auto 0;
        color: rgba(255,255,255,.85);
    }
    .aqa-auth__chips { display: none; }

    /* ---- Hide install / lang / theme toolbar completely on mobile ---- */
    .aqa-auth__form-pane > .position-absolute { display: none !important; }
    /* Also suppress the fixed install FAB on auth pages on mobile */
    .aqa-auth .aqa-install-fab { display: none !important; }

    /* ---- Bottom sheet form pane ---- */
    .aqa-auth__form-pane {
        flex: 1 1 auto;
        padding: 0;
        margin-top: -32px;
        position: relative;
        z-index: 2;
        background: var(--aqa-surface);
        border-radius: 28px 28px 0 0;
        box-shadow: 0 -12px 40px rgba(0,0,0,.10);
        display: flex;
        flex-direction: column;
    }
    /* iOS-style drag handle */
    .aqa-auth__form-pane::before {
        content: "";
        position: absolute;
        top: 10px; left: 50%;
        transform: translateX(-50%);
        width: 44px; height: 5px;
        border-radius: 999px;
        background: var(--aqa-border);
        opacity: .9;
    }

    /* Card body: transparent, full height */
    .aqa-auth__card {
        flex: 1;
        padding: 1.75rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 2.5rem);
        max-width: 100%;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .aqa-auth__card h2 { font-size: 1.5rem; font-weight: 800; }

    /* App-style inputs: taller, rounded, soft surface */
    .aqa-auth__card .form-control {
        height: 52px;
        border-radius: 14px;
        background: var(--aqa-surface-2);
        border-color: transparent;
        font-size: .95rem;
    }
    .aqa-auth__card .form-control:focus {
        background: var(--aqa-surface);
        border-color: var(--aqa-forest);
        box-shadow: 0 0 0 4px rgba(124,58,237,.12);
    }
    /* Bigger primary CTA */
    .aqa-auth__card .btn-primary {
        height: 54px;
        border-radius: 16px;
        font-weight: 700;
        font-size: 1rem;
        background: var(--aqa-grad-gold);
        border: 0;
        box-shadow: 0 12px 28px -10px rgba(124,58,237,.55);
    }

    .aqa-auth__quick { grid-template-columns: 1fr; }
    .aqa-auth__quick button[style*="span 2"] { grid-column: auto !important; }
}
[data-bs-theme="dark"] .aqa-auth__form-pane { box-shadow: 0 -12px 48px rgba(0,0,0,.55); }
[data-bs-theme="dark"] .aqa-auth__form-pane::before { background: rgba(255,255,255,.15); }

@media (max-width: 480px) {
    .aqa-auth__brand { padding-top: calc(env(safe-area-inset-top, 0px) + 2.75rem); padding-bottom: 4rem; min-height: 36vh; }
    .aqa-auth__brand .aqa-brand-logo { width: 66px !important; height: 66px !important; }
    .aqa-auth__hero h1 { font-size: 1.3rem; }
    .aqa-auth__card { padding: 1.5rem 1rem calc(env(safe-area-inset-bottom, 0px) + 2rem); }
    .aqa-auth__card h2 { font-size: 1.35rem; }
}

/* ============ WEB SHELL ============ */
.aqa-web-shell { display: flex; min-height: 100vh; }
.aqa-sidebar {
    width: 260px;
    background: var(--aqa-grad-hero);
    color: var(--aqa-cream);
    padding: 1.25rem 0 6rem;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.05);
}
.aqa-sidebar .aqa-brand-row {
    display: flex; align-items: center; gap: .65rem; padding: 0 1.25rem 1.25rem;
}
.aqa-sidebar .aqa-brand { color: #fff; font-size: 1.1rem; }
.aqa-sidebar a {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.25rem;
    color: rgba(255,255,255,.78); text-decoration: none;
    border-left: 3px solid transparent;
    font-weight: 500; font-size: .92rem;
    margin: 1px .5rem; border-radius: 10px;
    transition: background .15s, color .15s;
}
.aqa-sidebar a i { font-size: 1.05rem; opacity: .85; }
.aqa-sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.aqa-sidebar a.active {
    background: linear-gradient(90deg, rgba(167,139,250,.22), transparent);
    color: #fff;
    box-shadow: inset 3px 0 0 #A78BFA;
    border-left: 0;
}

.aqa-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.aqa-topbar {
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: var(--aqa-glass-bg);
    border-bottom: 1px solid var(--aqa-border);
    padding: .85rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.aqa-topbar .aqa-search {
    position: relative; flex: 1; max-width: 420px;
}
.aqa-topbar .aqa-search input {
    width: 100%;
    background: var(--aqa-cream-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: .55rem 1rem .55rem 2.5rem;
    color: var(--bs-body-color);
    font-size: .9rem;
}
[data-bs-theme="dark"] .aqa-topbar .aqa-search input { background: rgba(255,255,255,.06); }
.aqa-topbar .aqa-search i {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--aqa-muted);
}
.aqa-content { padding: 1.75rem 1.5rem; flex: 1; }
.aqa-footer {
    border-top: 1px solid var(--aqa-border);
    padding: 1rem 1.5rem;
    color: var(--aqa-muted); font-size: .82rem;
}

/* Page header */
.aqa-page-head {
    display: flex; flex-wrap: wrap; align-items: end; gap: 1rem;
    margin-bottom: 1.5rem;
}
.aqa-page-head h1 {
    font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 0;
}
.aqa-page-head .subtitle { color: var(--aqa-muted); margin: 0; }

/* KPI cards */
.aqa-kpi {
    position: relative;
    padding: 1.25rem;
    border-radius: var(--aqa-radius);
    border: 1px solid var(--aqa-border);
    background: var(--aqa-grad-card);
    box-shadow: var(--aqa-shadow);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.aqa-kpi:hover { transform: translateY(-3px); box-shadow: var(--aqa-shadow-lg); }
.aqa-kpi__icon {
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: rgba(124,58,237,.12);
    color: #7C3AED;
    font-size: 1.25rem;
    margin-bottom: .75rem;
}
.aqa-kpi.gold   .aqa-kpi__icon { background: rgba(167,139,250,.18); color: #7C3AED; }
.aqa-kpi.green  .aqa-kpi__icon { background: rgba(16,185,129,.14);  color: #10B981; }
.aqa-kpi.indigo .aqa-kpi__icon { background: rgba(99,102,241,.14);  color: #6366F1; }
.aqa-kpi.rose   .aqa-kpi__icon { background: rgba(244,114,182,.16); color: #EC4899; }
.aqa-kpi__label { color: var(--aqa-muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.aqa-kpi__value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: .15rem; }
.aqa-kpi__trend { font-size: .78rem; font-weight: 600; color: #7C3AED; }
[data-bs-theme="dark"] .aqa-kpi__trend { color: #A78BFA; }
.aqa-kpi__trend.down { color: #E11D48; }

/* Quick action tiles */
.aqa-quick-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: .85rem; }
.aqa-quick-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .6rem;
    padding: 1rem;
    border-radius: 16px;
    background: var(--aqa-grad-card);
    border: 1px solid var(--aqa-border);
    text-decoration: none; color: inherit;
    box-shadow: var(--aqa-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}
.aqa-quick-tile:hover { transform: translateY(-3px); box-shadow: var(--aqa-shadow-lg); color: inherit; }
.aqa-quick-tile .aqa-ico {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--aqa-grad-gold); color: #fff; font-size: 1.15rem;
}
.aqa-quick-tile .label { font-weight: 700; font-size: .92rem; }
.aqa-quick-tile .hint  { font-size: .75rem; color: var(--aqa-muted); }

/* Hero greeting (mobile) */
.aqa-hero {
    position: relative;
    border-radius: 24px;
    padding: 1.5rem;
    color: #fff;
    background: var(--aqa-grad-hero);
    box-shadow: var(--aqa-shadow-lg);
    overflow: hidden;
}
.aqa-hero::before, .aqa-hero::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55;
}
.aqa-hero::before { width: 220px; height: 220px; background: rgba(167,139,250,.55); top: -80px; right: -60px; }
.aqa-hero::after  { width: 280px; height: 280px; background: rgba(124,58,237,.55); bottom: -120px; left: -100px; }
.aqa-hero > * { position: relative; z-index: 1; }
.aqa-hero h2 { font-weight: 800; letter-spacing: -.01em; }
.aqa-hero .greeting { color: rgba(255,255,255,.7); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }

/* Theme toggle */
.aqa-theme-toggle {
    border: 1px solid var(--aqa-border);
    background: var(--aqa-surface);
    color: var(--bs-body-color);
    border-radius: 999px;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: .15s;
}
.aqa-theme-toggle:hover { background: var(--aqa-cream-soft); transform: rotate(15deg); }
[data-bs-theme="dark"] .aqa-theme-toggle:hover { background: rgba(255,255,255,.06); }

.aqa-icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--aqa-border);
    background: var(--aqa-surface);
    color: var(--bs-body-color);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: .15s;
}
.aqa-icon-btn:hover { background: var(--aqa-cream-soft); }

/* ============ MOBILE (app-like) ============ */
.aqa-mobile-shell {
    min-height: 100vh;
    background: var(--bs-body-bg);
}
.aqa-mobile-header {
    position: sticky; top: 0; z-index: 1020;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    background: var(--aqa-glass-bg);
    border-bottom: 1px solid var(--aqa-border);
    padding: .75rem 1rem;
    padding-top: calc(.75rem + env(safe-area-inset-top, 0));
    display: flex; align-items: center; gap: .65rem;
}
.aqa-mobile-header .aqa-brand { color: var(--aqa-forest); font-size: 1.05rem; }
[data-bs-theme="dark"] .aqa-mobile-header .aqa-brand { color: var(--aqa-forest-glow); }
.aqa-mobile-content { padding: 1rem; }

.aqa-bottom-nav {
    position: fixed; left: 12px; right: 12px; bottom: 12px;
    background: var(--aqa-glass-bg);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--aqa-glass-border);
    border-radius: 22px;
    box-shadow: var(--aqa-shadow-lg);
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: .35rem;
    padding-bottom: calc(.35rem + env(safe-area-inset-bottom, 0));
    z-index: 1030;
}
.aqa-bottom-nav a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--aqa-muted); text-decoration: none;
    font-size: .68rem; font-weight: 600;
    padding: .5rem .25rem;
    border-radius: 16px;
    transition: .2s;
}
.aqa-bottom-nav a .aqa-ico { font-size: 1.25rem; }
.aqa-bottom-nav a.active {
    color: #fff;
    background: var(--aqa-grad-hero);
    box-shadow: 0 8px 18px -8px rgba(124,58,237,.55);
}
.aqa-bottom-nav a.active .aqa-ico { color: #DDD6FE; }

/* Mobile section title */
.aqa-section-title { display: flex; align-items: end; justify-content: space-between; margin: 1.25rem 0 .65rem; }
.aqa-section-title h3 { font-size: 1rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.aqa-section-title a  { font-size: .82rem; font-weight: 600; text-decoration: none; color: var(--aqa-forest-soft); }

/* Course / item card (used in many phases) */
.aqa-list-card {
    display: flex; align-items: center; gap: .85rem;
    background: var(--aqa-grad-card);
    border: 1px solid var(--aqa-border);
    border-radius: 16px;
    padding: .8rem;
    box-shadow: var(--aqa-shadow);
}
.aqa-list-card .thumb {
    width: 46px; height: 46px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--aqa-grad-gold); color: #fff; font-size: 1.2rem;
    flex: 0 0 auto;
}
.aqa-list-card .meta { flex: 1; min-width: 0; }
.aqa-list-card .meta .t { font-weight: 700; font-size: .92rem; }
.aqa-list-card .meta .s { color: var(--aqa-muted); font-size: .78rem; }

/* Badges */
.badge.bg-forest { background: #7C3AED !important; color: #fff; }
.badge.bg-gold   { background: var(--aqa-grad-gold) !important; color: #fff; }
.badge-soft {
    background: rgba(124,58,237,.12);
    color: #6D28D9;
    padding: .35rem .65rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700;
}
[data-bs-theme="dark"] .badge-soft { background: rgba(124,58,237,.20); color: #C4B5FD; }

/* Utilities */
.text-gold { color: #7C3AED !important; }
[data-bs-theme="dark"] .text-gold { color: #A78BFA !important; }
.bg-forest { background: #7C3AED !important; color:#fff; }
.border-gold { border-color: #A78BFA !important; }
.aqa-divider { height: 1px; background: var(--aqa-border); margin: 1.5rem 0; }

/* Animations */
@keyframes aqa-rise { from { opacity: 0; } to { opacity: 1; } }
.aqa-rise > * { animation: aqa-rise .35s ease both; }
.aqa-rise > *:nth-child(2) { animation-delay: .04s; }
.aqa-rise > *:nth-child(3) { animation-delay: .08s; }
.aqa-rise > *:nth-child(4) { animation-delay: .12s; }
.aqa-rise > *:nth-child(5) { animation-delay: .16s; }
.aqa-rise > *:nth-child(6) { animation-delay: .20s; }

/* PWA install banner */
.aqa-install-fab {
    position: fixed; right: 18px; bottom: 96px; z-index: 1040;
    background: var(--aqa-grad-gold); color: #fff;
    border: none; border-radius: 999px;
    padding: .65rem 1.1rem; font-weight: 700;
    box-shadow: 0 12px 30px -10px rgba(124,58,237,.55);
    display: none; align-items: center; gap: .45rem;
}
.aqa-install-fab.show { display: inline-flex; animation: aqa-rise .4s ease; }
@media (min-width: 992px) { .aqa-install-fab { bottom: 18px; } }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 10px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

/* RTL */
html[dir="rtl"] .aqa-sidebar a.active { box-shadow: inset -3px 0 0 var(--aqa-gold); }
html[dir="rtl"] .aqa-topbar .aqa-search input { padding: .55rem 2.5rem .55rem 1rem; }
html[dir="rtl"] .aqa-topbar .aqa-search i { left: auto; right: .85rem; }
html[dir="rtl"] .aqa-install-fab { right: auto; left: 18px; }
html[dir="rtl"] .form-control.ps-5 { padding-left: 1rem !important; padding-right: 2.75rem !important; }
html[dir="rtl"] .position-relative > .bi.position-absolute[style*="left"] { left: auto !important; right: 14px !important; }
html[dir="rtl"] .aqa-kpi { text-align: right; }
html[dir="rtl"] .aqa-list-card { text-align: right; }
html[dir="rtl"] .aqa-bottom-nav a { font-family: inherit; }
html[dir="rtl"] .aqa-auth__quick button { text-align: right; }
html[dir="rtl"] .me-1, html[dir="rtl"] .me-2, html[dir="rtl"] .me-3 { margin-right: 0 !important; }
html[dir="rtl"] .me-1 { margin-left: .25rem !important; }
html[dir="rtl"] .me-2 { margin-left: .5rem !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; }
html[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }

/* ============ MOBILE APP-LIKE OVERRIDES (added in Phase 6 polish) ============ */

/* More sheet (bottom offcanvas) */
.aqa-more-sheet {
    height: auto; max-height: 85vh;
    border-top-left-radius: 22px; border-top-right-radius: 22px;
    background: var(--aqa-surface);
    border: 1px solid var(--aqa-border);
    border-bottom: 0;
    box-shadow: 0 -20px 50px -20px rgba(0,0,0,.25);
}
.aqa-more-handle {
    width: 42px; height: 4px; border-radius: 4px;
    background: var(--aqa-border);
    margin: .65rem auto 0;
}
.aqa-more-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: .55rem; padding: 1rem;
}
@media (max-width: 360px) { .aqa-more-grid { grid-template-columns: repeat(3, 1fr); } }
.aqa-more-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    padding: .85rem .35rem;
    background: var(--aqa-cream-soft);
    border: 1px solid var(--aqa-border);
    border-radius: 16px;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: .72rem; font-weight: 600;
    text-align: center; line-height: 1.1;
    min-height: 78px;
    transition: .15s;
}
.aqa-more-tile i { font-size: 1.35rem; color: var(--aqa-forest-soft); }
[data-bs-theme="dark"] .aqa-more-tile { background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .aqa-more-tile i { color: var(--aqa-forest-glow); }
.aqa-more-tile:hover { background: var(--aqa-glass-bg); transform: translateY(-1px); }

/* Mobile: tables auto-scroll & cards take full width */
@media (max-width: 767.98px) {
    .aqa-mobile-shell .table-responsive { border-radius: 14px; border: 1px solid var(--aqa-border); }
    .aqa-mobile-shell .table { font-size: .82rem; margin-bottom: 0; }
    .aqa-mobile-shell .table thead th { white-space: nowrap; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

    /* Stack columns to single column */
    .aqa-mobile-shell .row > [class*="col-"] { width: 100%; flex: 0 0 100%; max-width: 100%; }

    /* Cards full bleed */
    .aqa-mobile-shell .card { border-radius: 14px; }
    .aqa-mobile-shell .aqa-page-head { flex-direction: column; align-items: flex-start; gap: .65rem; }
    .aqa-mobile-shell .aqa-page-head h1 { font-size: 1.2rem; }
    .aqa-mobile-shell .aqa-page-head .ms-auto { margin-left: 0 !important; width: 100%; display: flex; gap: .5rem; flex-wrap: wrap; }

    /* Buttons larger tap target */
    .aqa-mobile-shell .btn-sm { padding: .45rem .8rem; font-size: .82rem; }

    /* Hide bulky empty filter rows on mobile */
    .aqa-mobile-shell .aqa-filter-bar { flex-wrap: wrap; }
}

/* Truly tiny screens: hide bottom-nav labels to save space */
@media (max-width: 360px) {
    .aqa-bottom-nav a span { font-size: .62rem; }
}

/* Sidebar inside offcanvas — make it look native */
.offcanvas .aqa-sidebar { height: 100%; border-radius: 0; }

/* ===== Collapsible sidebar (desktop web view) ===== */
.aqa-sidebar {
    transition: width .25s cubic-bezier(.4, 0, .2, 1);
    overflow-x: hidden;
    will-change: width;
}
/* Prevent text from wrapping during the width animation */
.aqa-sidebar nav a,
.aqa-sidebar nav > div { white-space: nowrap; }

/* Collapsed state — triggered by .aqa-shell--collapsed on .aqa-web-shell */
.aqa-shell--collapsed .aqa-sidebar { width: 64px; }

/* Brand row: center the logo, hide the name */
.aqa-shell--collapsed .aqa-sidebar .aqa-brand-row { justify-content: center; gap: 0; }
.aqa-shell--collapsed .aqa-sidebar .aqa-brand      { display: none; }

/* Hide section headers */
.aqa-shell--collapsed .aqa-sidebar nav > div { display: none; }

/* Center icon in each nav link */
.aqa-shell--collapsed .aqa-sidebar nav a {
    justify-content: center;
    padding: .65rem 0;
    margin: 1px 4px;
}
.aqa-shell--collapsed .aqa-sidebar nav a span { display: none; }
.aqa-shell--collapsed .aqa-sidebar nav a i    { font-size: 1.15rem; }

/* Logout form */
.aqa-shell--collapsed .aqa-sidebar .aqa-sidebar-logout               { padding: 0 4px !important; }
.aqa-shell--collapsed .aqa-sidebar .aqa-sidebar-logout button         { justify-content: center; padding: .55rem; }
.aqa-shell--collapsed .aqa-sidebar .aqa-sidebar-logout button span    { display: none; }
/* Copyright note at the bottom of the sidebar (replaces footer on mobile) */
.aqa-sidebar-footer {
  padding: 12px 16px 14px;
  font-size: .72rem;
  color: rgba(255,255,255,.30);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: 8px;
}
.aqa-shell--collapsed .aqa-sidebar-footer { display: none; }

/* Avatar initials (student/tutor profile pages) */
.aqa-avatar-initial,
.aqa-avatar-initial-lg {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--aqa-grad-gold);
    color: #fff; font-weight: 800; border-radius: 50%;
    flex-shrink: 0;
}
.aqa-avatar-initial    { width: 48px; height: 48px; font-size: 1.1rem; }
.aqa-avatar-initial-lg { width: 64px; height: 64px; font-size: 1.5rem; }

/* Ensure FAB doesn't overlap last content row */
.aqa-mobile-shell .aqa-mobile-content { padding-bottom: 1.25rem; }

/* =========================================================
   DASHBOARD v3 � Mobile-app components (2026-05-23)
   Used by per-role dashboards under /resources/views/client/{role}/dashboard
   ========================================================= */

/* Shell � center on desktop so the mobile layout feels intentional, not stretched */
.aqa-dash-shell { max-width: 600px; margin-inline: auto; padding-inline: .75rem; }
@media (min-width: 768px){
    .aqa-dash-shell { max-width: 100%; padding-inline: 0; }
}

/* Hero � role-tinted, shorter than aqa-hero and supports right-side avatar/CTA */
.aqa-dash-hero {
    position: relative; overflow: hidden;
    border-radius: 26px; color: #fff;
    padding: 1.25rem 1.25rem 1.4rem;
    background: var(--aqa-grad-hero);
    box-shadow: 0 22px 40px -22px rgba(76, 29, 149, .55);
}
.aqa-dash-hero::before,
.aqa-dash-hero::after { content:""; position:absolute; border-radius:50%; filter:blur(50px); opacity:.55; pointer-events:none; }
.aqa-dash-hero::before { width:220px; height:220px; background: rgba(255,255,255,.35); top:-80px; right:-60px; }
.aqa-dash-hero::after  { width:260px; height:260px; background: rgba(124,58,237,.55); bottom:-130px; left:-90px; }
.aqa-dash-hero > * { position: relative; z-index: 1; }
.aqa-dash-hero .eyebrow { font-size:.72rem; text-transform:uppercase; letter-spacing:.1em; opacity:.85; font-weight:700; }
.aqa-dash-hero h1 { font-size:1.5rem; font-weight:800; margin:.15rem 0 .25rem; letter-spacing:-.01em; }
.aqa-dash-hero .sub { opacity:.88; font-size:.85rem; }
.aqa-dash-hero .aqa-mini-avatar {
    width:44px; height:44px; border-radius:14px;
    background: rgba(255,255,255,.18);
    display:inline-flex; align-items:center; justify-content:center;
    font-weight:800; color:#fff; backdrop-filter: blur(8px);
}

/* Role-tinted hero variants */
.aqa-dash-hero.hero-super  { background: linear-gradient(135deg,#0F172A 0%,#312E81 55%,#7C3AED 100%); }
.aqa-dash-hero.hero-admin  { background: linear-gradient(135deg,#6D28D9 0%,#7C3AED 55%,#EC4899 100%); }
.aqa-dash-hero.hero-tutor  { background: linear-gradient(135deg,#065F46 0%,#0F766E 55%,#0EA5E9 100%); }
.aqa-dash-hero.hero-student{ background: linear-gradient(135deg,#BE185D 0%,#7C3AED 55%,#3730A3 100%); }

/* Inline pill stats inside hero */
.aqa-hero-stats {
    display:grid; grid-template-columns: repeat(3,1fr); gap:.55rem;
    margin-top:1rem;
}
.aqa-hero-stats .pill {
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border:1px solid rgba(255,255,255,.18);
    border-radius:14px; padding:.55rem .65rem; color:#fff;
    text-align:left;
}
.aqa-hero-stats .pill .v { font-weight:800; font-size:1.05rem; line-height:1.1; }
.aqa-hero-stats .pill .l { font-size:.66rem; opacity:.85; letter-spacing:.04em; text-transform:uppercase; font-weight:700; margin-top:.15rem; }

/* Section header (compact, app-style) */
.aqa-dash-section { display:flex; align-items:center; justify-content:space-between; margin: 1.25rem 0 .65rem; }
.aqa-dash-section .t { font-size:1rem; font-weight:800; letter-spacing:-.01em; margin:0; }
.aqa-dash-section .t i { color: var(--aqa-forest-soft); margin-right:.4rem; }
.aqa-dash-section a, .aqa-dash-section .link { font-size:.78rem; font-weight:700; text-decoration:none; color: var(--aqa-forest-soft); }

/* Stat tile row � 2x2 on mobile, 4 across on desktop */
.aqa-stat-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:.7rem; }
@media (min-width: 768px){ .aqa-stat-grid.lg-4 { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 768px){ .aqa-stat-grid.lg-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.aqa-stat-tile {
    position:relative;
    background: var(--aqa-grad-card);
    border:1px solid var(--aqa-border);
    border-radius:18px; padding:.9rem;
    box-shadow: var(--aqa-shadow);
    overflow:hidden;
}
.aqa-stat-tile .ico {
    width:36px; height:36px; border-radius:11px;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:1.05rem; margin-bottom:.55rem;
}
.aqa-stat-tile .v { font-size:1.55rem; font-weight:800; line-height:1.05; letter-spacing:-.02em; }
.aqa-stat-tile .l { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color: var(--aqa-muted); margin-top:.15rem; }
.aqa-stat-tile .delta { font-size:.7rem; font-weight:700; margin-top:.35rem; display:inline-flex; align-items:center; gap:.2rem; }
.aqa-stat-tile .delta.up   { color:#10B981; }
.aqa-stat-tile .delta.down { color:#E11D48; }
.aqa-stat-tile.t-violet .ico { background: rgba(124,58,237,.14);  color:#7C3AED; }
.aqa-stat-tile.t-emerald .ico{ background: rgba(16,185,129,.14);  color:#10B981; }
.aqa-stat-tile.t-amber .ico  { background: rgba(245,158,11,.14);  color:#D97706; }
.aqa-stat-tile.t-rose .ico   { background: rgba(244,63,94,.14);   color:#E11D48; }
.aqa-stat-tile.t-sky .ico    { background: rgba(14,165,233,.14);  color:#0284C7; }
.aqa-stat-tile.t-indigo .ico { background: rgba(99,102,241,.14);  color:#4F46E5; }

/* Generic surface card used inside dashboards */
.aqa-dash-card {
    background: var(--aqa-grad-card);
    border:1px solid var(--aqa-border);
    border-radius:20px; padding:1rem;
    box-shadow: var(--aqa-shadow);
}
.aqa-dash-card.tinted { background: linear-gradient(160deg, rgba(124,58,237,.06), rgba(167,139,250,.10)); }
.aqa-dash-card .ttl { font-weight:800; font-size:.95rem; margin:0 0 .15rem; }
.aqa-dash-card .ttl i { margin-right:.4rem; color: var(--aqa-forest-soft); }
.aqa-dash-card .sub { color: var(--aqa-muted); font-size:.78rem; }

/* Progress ring (SVG) */
.aqa-ring { position:relative; width:120px; height:120px; }
.aqa-ring svg { width:100%; height:100%; transform: rotate(-90deg); }
.aqa-ring .track  { stroke: var(--aqa-border); stroke-width:10; fill:none; }
.aqa-ring .meter  { stroke: url(#aqaRingGrad); stroke-width:10; stroke-linecap:round; fill:none; transition: stroke-dashoffset .6s ease; }
.aqa-ring .center {
    position:absolute; inset:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center;
}
.aqa-ring .center .v { font-size:1.6rem; font-weight:800; line-height:1; letter-spacing:-.02em; }
.aqa-ring .center .l { font-size:.65rem; text-transform:uppercase; letter-spacing:.08em; color:var(--aqa-muted); font-weight:700; margin-top:.1rem; }

/* Linear progress bar */
.aqa-bar { height:8px; border-radius:999px; background: var(--aqa-border); overflow:hidden; }
.aqa-bar > i { display:block; height:100%; border-radius:999px; background: var(--aqa-grad-gold); }
.aqa-bar.thin { height:6px; }
.aqa-bar.success > i { background: linear-gradient(90deg,#10B981,#34D399); }
.aqa-bar.warn    > i { background: linear-gradient(90deg,#F59E0B,#FBBF24); }
.aqa-bar.danger  > i { background: linear-gradient(90deg,#E11D48,#FB7185); }

/* Quick action row (icon + label, mobile-app style) */
.aqa-qa-grid { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:.6rem; }
@media (max-width: 360px){ .aqa-qa-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.aqa-qa-tile {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.4rem;
    background: var(--aqa-surface);
    border:1px solid var(--aqa-border);
    border-radius:16px; padding:.85rem .4rem; min-height:84px;
    text-decoration:none; color: var(--bs-body-color);
    transition:.15s; text-align:center;
}
.aqa-qa-tile:hover { transform: translateY(-2px); color: var(--bs-body-color); box-shadow: var(--aqa-shadow); }
.aqa-qa-tile .qi {
    width:38px; height:38px; border-radius:12px; font-size:1.1rem;
    display:inline-flex; align-items:center; justify-content:center;
    background: rgba(124,58,237,.12); color:#7C3AED;
}
.aqa-qa-tile.t-emerald .qi{ background: rgba(16,185,129,.14);  color:#10B981; }
.aqa-qa-tile.t-amber .qi  { background: rgba(245,158,11,.14);  color:#D97706; }
.aqa-qa-tile.t-rose .qi   { background: rgba(244,63,94,.14);   color:#E11D48; }
.aqa-qa-tile.t-sky .qi    { background: rgba(14,165,233,.14);  color:#0284C7; }
.aqa-qa-tile.t-indigo .qi { background: rgba(99,102,241,.14);  color:#4F46E5; }
.aqa-qa-tile .lbl { font-weight:700; font-size:.72rem; line-height:1.1; }

/* Schedule card (today/upcoming classes) */
.aqa-sched-list { display:flex; flex-direction:column; gap:.55rem; }
.aqa-sched {
    display:grid; grid-template-columns: 56px 1fr auto; align-items:center; gap:.75rem;
    background: var(--aqa-surface);
    border:1px solid var(--aqa-border);
    border-radius:16px; padding:.6rem .75rem; box-shadow: var(--aqa-shadow);
}
.aqa-sched .time {
    background: var(--aqa-cream-soft);
    color: #6D28D9;
    border-radius:12px; padding:.4rem; text-align:center; font-weight:800;
    line-height:1.05;
}
[data-bs-theme="dark"] .aqa-sched .time { background: rgba(124,58,237,.22); color:#C4B5FD; }
.aqa-sched .time .hh { font-size:.95rem; }
.aqa-sched .time .ap { font-size:.62rem; opacity:.7; }
.aqa-sched .title { font-weight:700; font-size:.88rem; }
.aqa-sched .meta  { font-size:.72rem; color: var(--aqa-muted); margin-top:.1rem; }
.aqa-sched .right { display:flex; flex-direction:column; align-items:flex-end; gap:.2rem; }
.aqa-sched .chip {
    font-size:.65rem; font-weight:700; padding:.2rem .5rem; border-radius:999px;
    background: rgba(16,185,129,.14); color:#059669; text-transform:uppercase; letter-spacing:.04em;
}
.aqa-sched .chip.live { background: rgba(244,63,94,.14); color:#E11D48; }
.aqa-sched .chip.soon { background: rgba(245,158,11,.18); color:#B45309; }
.aqa-sched .chip.done { background: rgba(107,114,128,.16); color:#4B5563; }

/* Horizontal scrollable card carousel */
.aqa-hscroll { display:flex; gap:.7rem; overflow-x:auto; padding-bottom:.35rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.aqa-hscroll::-webkit-scrollbar { display:none; }
.aqa-hscroll > * { scroll-snap-align: start; flex: 0 0 78%; }
@media (min-width: 576px){ .aqa-hscroll > * { flex: 0 0 46%; } }
@media (min-width: 992px){ .aqa-hscroll > * { flex: 0 0 32%; } }

/* Big colored class card (carousel slide) */
.aqa-class-card {
    border-radius:20px; padding:1rem; color:#fff;
    background: var(--aqa-grad-hero);
    box-shadow: 0 18px 36px -18px rgba(76,29,149,.5);
    min-height:140px; display:flex; flex-direction:column; justify-content:space-between;
}
.aqa-class-card.c-emerald { background: linear-gradient(135deg,#047857,#10B981); box-shadow: 0 18px 36px -18px rgba(4,120,87,.5); }
.aqa-class-card.c-sky     { background: linear-gradient(135deg,#0369A1,#0EA5E9); box-shadow: 0 18px 36px -18px rgba(3,105,161,.5); }
.aqa-class-card.c-rose    { background: linear-gradient(135deg,#BE185D,#F472B6); box-shadow: 0 18px 36px -18px rgba(190,24,93,.5); }
.aqa-class-card.c-amber   { background: linear-gradient(135deg,#B45309,#F59E0B); box-shadow: 0 18px 36px -18px rgba(180,83,9,.5); }
.aqa-class-card .top    { display:flex; align-items:center; justify-content:space-between; }
.aqa-class-card .title  { font-weight:800; font-size:1.05rem; letter-spacing:-.01em; }
.aqa-class-card .sub    { opacity:.85; font-size:.78rem; }
.aqa-class-card .pill   { background: rgba(255,255,255,.2); padding:.25rem .55rem; border-radius:999px; font-size:.66rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.aqa-class-card .bot    { display:flex; align-items:center; justify-content:space-between; }
.aqa-class-card .who    { font-size:.78rem; opacity:.9; }
.aqa-class-card .go     { width:36px; height:36px; border-radius:50%; background: rgba(255,255,255,.18); display:inline-flex; align-items:center; justify-content:center; color:#fff; text-decoration:none; }

/* Mini week calendar (chip strip) */
.aqa-week { display:grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap:.4rem; }
.aqa-week .day {
    display:flex; flex-direction:column; align-items:center; gap:.25rem;
    padding:.5rem .25rem; border-radius:14px;
    background: var(--aqa-surface);
    border:1px solid var(--aqa-border);
    text-decoration:none; color:var(--bs-body-color);
    min-height:64px;
}
.aqa-week .day .dn { font-size:.6rem; text-transform:uppercase; letter-spacing:.05em; color:var(--aqa-muted); font-weight:700; }
.aqa-week .day .dd { font-size:1rem; font-weight:800; }
.aqa-week .day.today {
    background: var(--aqa-grad-hero); color:#fff; border-color:transparent;
    box-shadow: 0 12px 22px -12px rgba(124,58,237,.55);
}
.aqa-week .day.today .dn { color:rgba(255,255,255,.85); }
.aqa-week .day .dot { width:6px; height:6px; border-radius:50%; background: transparent; }
.aqa-week .day.has-class .dot   { background:#10B981; }
.aqa-week .day.has-exam  .dot   { background:#E11D48; }
.aqa-week .day.has-task  .dot   { background:#F59E0B; }
.aqa-week .day.is-holiday       { background: rgba(244,63,94,.10); border-color: rgba(244,63,94,.25); }
.aqa-week .day.is-holiday .dd   { color:#E11D48; }
.aqa-week .day.is-free          { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.25); }
.aqa-week .day.is-free .dd      { color:#059669; }

/* Calendar legend pills */
.aqa-cal-legend { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.65rem; }
.aqa-cal-legend .lg { display:inline-flex; align-items:center; gap:.35rem; font-size:.7rem; color:var(--aqa-muted); font-weight:600; }
.aqa-cal-legend .lg .d { width:9px; height:9px; border-radius:50%; display:inline-block; }
.aqa-cal-legend .lg.cls .d { background:#10B981; }
.aqa-cal-legend .lg.exm .d { background:#E11D48; }
.aqa-cal-legend .lg.tsk .d { background:#F59E0B; }
.aqa-cal-legend .lg.hol .d { background:#F472B6; }
.aqa-cal-legend .lg.fre .d { background:#34D399; }

/* Timeline (today's schedule, tasks) */
.aqa-tl { position:relative; padding-left:1.25rem; }
.aqa-tl::before { content:""; position:absolute; left:8px; top:6px; bottom:6px; width:2px; background: var(--aqa-border); border-radius:2px; }
.aqa-tl .ev { position:relative; padding:.25rem 0 .9rem; }
.aqa-tl .ev::before {
    content:""; position:absolute; left:-1.25rem; top:.45rem;
    width:14px; height:14px; border-radius:50%;
    background: #fff; border:3px solid #7C3AED; box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.aqa-tl .ev.exam::before    { border-color:#E11D48; box-shadow: 0 0 0 3px rgba(244,63,94,.15); }
.aqa-tl .ev.task::before    { border-color:#F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.aqa-tl .ev.done::before    { border-color:#10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.aqa-tl .ev .tm  { font-size:.7rem; font-weight:800; color: var(--aqa-forest-soft); text-transform:uppercase; letter-spacing:.06em; }
.aqa-tl .ev .ti  { font-weight:700; font-size:.9rem; }
.aqa-tl .ev .sb  { font-size:.74rem; color: var(--aqa-muted); }

/* Activity feed */
.aqa-feed { display:flex; flex-direction:column; gap:.55rem; }
.aqa-feed .row-item {
    display:grid; grid-template-columns:38px 1fr auto; gap:.65rem; align-items:center;
    padding:.55rem .65rem; border-radius:14px;
    background: var(--aqa-surface); border:1px solid var(--aqa-border);
}
.aqa-feed .row-item .av {
    width:38px; height:38px; border-radius:12px;
    display:inline-flex; align-items:center; justify-content:center;
    background: rgba(124,58,237,.12); color:#7C3AED; font-size:1rem;
}
.aqa-feed .row-item .t { font-weight:700; font-size:.85rem; }
.aqa-feed .row-item .s { font-size:.72rem; color:var(--aqa-muted); }
.aqa-feed .row-item .at { font-size:.68rem; color:var(--aqa-muted); white-space:nowrap; }

/* Notifications */
.aqa-notif {
    display:grid; grid-template-columns:auto 1fr auto; gap:.7rem; align-items:start;
    background: var(--aqa-surface); border:1px solid var(--aqa-border);
    border-left:3px solid #7C3AED;
    border-radius:14px; padding:.6rem .7rem;
}
.aqa-notif.success { border-left-color:#10B981; }
.aqa-notif.warn    { border-left-color:#F59E0B; }
.aqa-notif.danger  { border-left-color:#E11D48; }
.aqa-notif .ic { width:34px; height:34px; border-radius:11px; background: rgba(124,58,237,.12); color:#7C3AED; display:inline-flex; align-items:center; justify-content:center; }
.aqa-notif.success .ic { background: rgba(16,185,129,.14);  color:#10B981; }
.aqa-notif.warn    .ic { background: rgba(245,158,11,.14);  color:#D97706; }
.aqa-notif.danger  .ic { background: rgba(244,63,94,.14);   color:#E11D48; }
.aqa-notif .t { font-weight:700; font-size:.84rem; }
.aqa-notif .s { font-size:.72rem; color:var(--aqa-muted); }
.aqa-notif .at{ font-size:.66rem; color:var(--aqa-muted); white-space:nowrap; }

/* Inline person row (top students etc.) */
.aqa-person {
    display:grid; grid-template-columns: 38px 1fr auto; gap:.7rem; align-items:center;
    padding:.5rem .25rem;
}
.aqa-person .av {
    width:38px; height:38px; border-radius:50%;
    background: var(--aqa-grad-gold); color:#fff;
    display:inline-flex; align-items:center; justify-content:center; font-weight:800;
}
.aqa-person .nm { font-weight:700; font-size:.85rem; }
.aqa-person .meta { font-size:.7rem; color:var(--aqa-muted); }
.aqa-person .val { font-weight:800; font-size:.85rem; color: var(--aqa-forest-soft); }

/* Misc chip rows */
.aqa-chip-line { display:flex; flex-wrap:wrap; gap:.4rem; }
.aqa-chip-line .ch {
    background: var(--aqa-cream-soft); color:#6D28D9;
    padding:.3rem .6rem; border-radius:999px; font-size:.7rem; font-weight:700;
    display:inline-flex; align-items:center; gap:.3rem;
}
[data-bs-theme="dark"] .aqa-chip-line .ch { background: rgba(124,58,237,.22); color:#C4B5FD; }
.aqa-chip-line .ch.success { background: rgba(16,185,129,.14); color:#059669; }
.aqa-chip-line .ch.warn    { background: rgba(245,158,11,.18); color:#B45309; }
.aqa-chip-line .ch.danger  { background: rgba(244,63,94,.14);  color:#BE123C; }

/* Greeting wave (decoration) */
.aqa-wave { display:inline-block; animation: aqa-wave 1.8s ease-in-out infinite; transform-origin:70% 70%; }
@keyframes aqa-wave { 0%,100%{transform:rotate(0)} 20%{transform:rotate(14deg)} 40%{transform:rotate(-8deg)} 60%{transform:rotate(14deg)} 80%{transform:rotate(-4deg)} }


/* =================================================================
   DATA MANAGER v1 � Admin CRUD index pages (Students/Tutors/Batches/Courses)
   Mobile: contacts-app style list. Desktop: table with inline filters.
   ================================================================= */
.aqa-dm-wrap { padding-bottom: 24px; }

/* Page header */
.aqa-dm-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.aqa-dm-title  { font-size:1.35rem; font-weight:700; margin:0; color:#0F172A; }
.aqa-dm-subtitle { color:#64748B; font-size:.9rem; margin-top:2px; }
.aqa-dm-actions { display:flex; gap:8px; flex-wrap:wrap; }
.aqa-dm-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:10px; font-weight:600; font-size:.875rem; border:1px solid transparent; transition:all .15s ease; text-decoration:none; cursor:pointer; }
.aqa-dm-btn-primary { background:#0E7C66; color:#fff; }
.aqa-dm-btn-primary:hover { background:#0a5e4d; color:#fff; }
.aqa-dm-btn-outline { background:#fff; color:#0E7C66; border-color:#cbd5e1; }
.aqa-dm-btn-outline:hover { background:#f1f5f9; color:#0E7C66; }
.aqa-dm-btn-ghost { background:transparent; color:#475569; }
.aqa-dm-btn-ghost:hover { background:#f1f5f9; color:#0F172A; }

/* Toolbar (search + filters + actions) */
.aqa-dm-toolbar { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:12px; margin-bottom:12px; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.aqa-dm-toolbar-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.aqa-dm-search { flex:1 1 220px; position:relative; }
.aqa-dm-search input { width:100%; padding:9px 12px 9px 36px; border:1px solid #cbd5e1; border-radius:10px; font-size:.9rem; background:#fff; }
.aqa-dm-search input:focus { outline:none; border-color:#0E7C66; box-shadow:0 0 0 3px rgba(14,124,102,.12); }
.aqa-dm-search i.search-ico { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#94a3b8; pointer-events:none; }
.aqa-dm-select { padding:9px 12px; border:1px solid #cbd5e1; border-radius:10px; font-size:.9rem; background:#fff; min-width:130px; }
.aqa-dm-select:focus { outline:none; border-color:#0E7C66; box-shadow:0 0 0 3px rgba(14,124,102,.12); }

/* Active filter chips */
.aqa-dm-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.aqa-dm-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; background:#e0f2ef; color:#0E7C66; border-radius:999px; font-size:.78rem; font-weight:600; }
.aqa-dm-chip a { color:#0E7C66; text-decoration:none; }
.aqa-dm-chip a:hover { color:#BE123C; }

/* Desktop table */
.aqa-dm-card-table { background:#fff; border:1px solid #e2e8f0; border-radius:14px; overflow:hidden; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.aqa-dm-table-wrap { overflow-x:auto; }
.aqa-dm-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.aqa-dm-table thead th { background:#F8FAFC; color:#475569; font-weight:600; text-align:left; padding:10px 12px; border-bottom:1px solid #e2e8f0; white-space:nowrap; position:sticky; top:0; z-index:2; }
.aqa-dm-table thead th a { color:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:4px; }
.aqa-dm-table thead th a:hover { color:#0E7C66; }
.aqa-dm-table thead th .sort-ico { font-size:.7rem; opacity:.5; }
.aqa-dm-table thead th .sort-ico.active { opacity:1; color:#0E7C66; }
.aqa-dm-table thead.filters th { background:#fff; padding:6px 10px; }
.aqa-dm-table thead.filters input, .aqa-dm-table thead.filters select { width:100%; padding:6px 8px; border:1px solid #e2e8f0; border-radius:6px; font-size:.78rem; background:#fff; }
.aqa-dm-table tbody td { padding:12px; border-bottom:1px solid #f1f5f9; vertical-align:middle; color:#1e293b; }
.aqa-dm-table tbody tr:hover { background:#f8fafc; }
.aqa-dm-table tbody tr:last-child td { border-bottom:none; }
.aqa-dm-name-cell { display:flex; align-items:center; gap:10px; }
.aqa-dm-avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#0E7C66,#10A37F); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.85rem; flex-shrink:0; overflow:hidden; }
.aqa-dm-avatar img { width:100%; height:100%; object-fit:cover; }
.aqa-dm-name-cell .name { font-weight:600; color:#0F172A; }
.aqa-dm-name-cell .sub  { font-size:.75rem; color:#64748B; }

/* Status pills */
.aqa-dm-pill { display:inline-block; padding:3px 10px; border-radius:999px; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.02em; }
.aqa-dm-pill-success { background:#dcfce7; color:#166534; }
.aqa-dm-pill-warn    { background:#fef3c7; color:#92400e; }
.aqa-dm-pill-danger  { background:#fee2e2; color:#991b1b; }
.aqa-dm-pill-info    { background:#dbeafe; color:#1e40af; }
.aqa-dm-pill-muted   { background:#e2e8f0; color:#475569; }

/* Row actions dropdown */
.aqa-dm-row-actions { position:relative; }
.aqa-dm-row-actions .kebab { background:transparent; border:0; padding:6px 8px; border-radius:6px; color:#64748B; cursor:pointer; }
.aqa-dm-row-actions .kebab:hover { background:#f1f5f9; color:#0F172A; }
.aqa-dm-row-actions .dropdown-menu { position: absolute !important; z-index: 1000 !important; }
.aqa-dm-table tbody td:last-child { position: relative; overflow: visible; padding-right: 48px; }

/* Mobile kebab button */
.kebab-mobile { background:transparent; border:0; padding:8px 8px; border-radius:50%; color:#64748B; cursor:pointer; font-size:1.1rem; display:flex; align-items:center; justify-content:center; }
.kebab-mobile:hover { background:#f1f5f9; color:#0F172A; }
.kebab-mobile:focus { outline:none; background:#e2e8f0; }

.aqa-mobile-dropdown { position: relative !important; }
.aqa-mobile-dropdown .dropdown-menu { position: absolute !important; z-index: 1001 !important; top: 100% !important; right: 0 !important; }

/* Mobile Floating Action Button Bar */
.aqa-mobile-fab-bar { position: fixed; bottom: 16px; right: 16px; display: flex; gap: 12px; flex-direction: column; z-index: 500; }
.aqa-mobile-fab-bar .fab { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: all .2s ease; position: relative; }
.aqa-mobile-fab-bar .fab-primary { background: #0E7C66; color: #fff; }
.aqa-mobile-fab-bar .fab-primary:active { transform: scale(0.95); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.aqa-mobile-fab-bar .fab-secondary { background: #64748B; color: #fff; }
.aqa-mobile-fab-bar .fab-secondary:active { transform: scale(0.95); }
.aqa-mobile-fab-bar .fab-menu { min-width: 160px; }
.aqa-mobile-fab-bar .fab-menu .dropdown-header { padding: 8px 12px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #64748B; }
.aqa-mobile-fab-bar .fab-menu .dropdown-item { padding: 10px 12px; font-size: 0.875rem; }
.aqa-mobile-fab-bar .fab-menu .dropdown-item i { margin-right: 8px; }

/* Mobile list (contacts-app style) */
.aqa-dm-mobile-search { position:sticky; top:0; z-index:5; background:#F8FAFC; padding:10px 0 8px; }
.aqa-dm-mobile-search .aqa-dm-search input { background:#fff; }
.aqa-dm-chipstrip { display:flex; gap:6px; overflow-x:auto; padding:6px 2px 2px; scrollbar-width:none; }
.aqa-dm-chipstrip::-webkit-scrollbar { display:none; }
.aqa-dm-chipstrip .chip { flex:0 0 auto; padding:5px 12px; background:#fff; border:1px solid #e2e8f0; border-radius:999px; font-size:.78rem; color:#475569; text-decoration:none; white-space:nowrap; font-weight:600; }
.aqa-dm-chipstrip .chip.active { background:#0E7C66; border-color:#0E7C66; color:#fff; }

.aqa-dm-list { display:flex; flex-direction:column; gap:8px; }
/* Card = visual shell only */
.aqa-dm-list .aqa-dm-card { display:flex; align-items:stretch; background:#fff; border:1px solid #e2e8f0; border-radius:14px; min-height:76px; transition:all .12s ease; overflow:visible; }
.aqa-dm-list .aqa-dm-card:hover { border-color:#0E7C66; box-shadow:0 2px 8px rgba(14,124,102,.08); }
/* Tappable link area (avatar + body) */
.aqa-dm-list .aqa-dm-card-link { display:flex; align-items:center; gap:12px; padding:14px 8px 14px 14px; flex:1; min-width:0; text-decoration:none; color:inherit; }
.aqa-dm-list .aqa-dm-card-link:hover { color:inherit; text-decoration:none; }
/* Full-card link (batches/courses — no contact btn) */
.aqa-dm-list a.aqa-dm-card { gap:12px; padding:14px; text-decoration:none; color:inherit; align-items:center; }
.aqa-dm-list .aqa-dm-card .body { flex:1; min-width:0; }
.aqa-dm-list .aqa-dm-card .body .name { font-weight:600; color:#0F172A; font-size:.95rem; line-height:1.2; }
.aqa-dm-list .aqa-dm-card .body .meta { color:#64748B; font-size:.78rem; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Old .end (batches/courses) */
.aqa-dm-list .aqa-dm-card .end { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
/* Right aside: status pill stacked above 3-dots (students/tutors/admins) */
.aqa-dm-card-aside { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px 12px 12px 0; flex-shrink:0; }
/* Contact quick-action button */
.aqa-contact-btn { width:34px; height:34px; border-radius:50%; border:1px solid #e2e8f0; background:#f8fafc; color:#64748B; display:flex; align-items:center; justify-content:center; font-size:.9rem; cursor:pointer; transition:all .15s ease; }
.aqa-contact-btn:hover, .aqa-contact-btn:focus { background:#0E7C66; color:#fff; border-color:#0E7C66; outline:none; }
.aqa-dm-card-aside .dropdown-menu { min-width:180px; }
.aqa-dm-card-aside .dropdown-item { font-size:.9rem; padding:10px 16px; display:flex; align-items:center; gap:10px; }
.aqa-dm-card-aside .dropdown-item i { font-size:1rem; width:20px; text-align:center; flex-shrink:0; }

/* Empty state */
.aqa-dm-empty { text-align:center; padding:48px 16px; color:#64748B; }
.aqa-dm-empty .icon { font-size:3rem; color:#cbd5e1; margin-bottom:12px; }
.aqa-dm-empty .title { font-weight:600; color:#0F172A; margin-bottom:4px; }

/* Import offcanvas */
.aqa-dm-import-drop { border:2px dashed #cbd5e1; border-radius:12px; padding:24px; text-align:center; background:#F8FAFC; cursor:pointer; transition:all .15s ease; }
.aqa-dm-import-drop:hover, .aqa-dm-import-drop.dragover { border-color:#0E7C66; background:#e0f2ef; }
.aqa-dm-import-drop .icon { font-size:2.5rem; color:#94a3b8; }
.aqa-dm-import-errors { max-height:240px; overflow-y:auto; background:#fef2f2; border:1px solid #fecaca; border-radius:8px; padding:8px 12px; margin-top:12px; font-size:.78rem; color:#991b1b; }
.aqa-dm-import-errors li { padding:2px 0; }

/* Pagination spacing */
.aqa-dm-pagination { margin-top:14px; display:flex; justify-content:center; }

@media (max-width: 575.98px) {
  .aqa-dm-header { flex-direction:column; align-items:flex-start; }
  .aqa-dm-actions { width:100%; }
  .aqa-dm-actions .aqa-dm-btn { flex:1; justify-content:center; }
}

/* =========================================================
   THEME PARITY FIX v1 (2026-05-24)
   Comprehensive dark-mode overrides for every component that
   previously used hardcoded light colors. Also tightens a few
   Bootstrap surfaces (modal, dropdown, offcanvas, pagination,
   alerts, tables) so they react to data-bs-theme.
   ========================================================= */

/* ---------- DATA MANAGER v1: dark overrides ---------- */
[data-bs-theme="dark"] .aqa-dm-title          { color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-subtitle       { color: var(--aqa-muted); }

[data-bs-theme="dark"] .aqa-dm-btn-primary    { background: var(--aqa-forest); color:#fff; }
[data-bs-theme="dark"] .aqa-dm-btn-primary:hover { background: var(--aqa-forest-soft); color:#fff; }
[data-bs-theme="dark"] .aqa-dm-btn-outline    { background: var(--aqa-surface); color: var(--aqa-forest-glow); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .aqa-dm-btn-outline:hover { background: rgba(167,139,250,.10); color: var(--aqa-forest-glow); border-color: var(--aqa-forest); }
[data-bs-theme="dark"] .aqa-dm-btn-ghost      { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-btn-ghost:hover{ background: rgba(255,255,255,.06); color: var(--aqa-ink); }

[data-bs-theme="dark"] .aqa-dm-toolbar        { background: var(--aqa-surface); border-color: var(--aqa-border); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .aqa-dm-search input,
[data-bs-theme="dark"] .aqa-dm-select         { background: rgba(255,255,255,.04); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-search input::placeholder { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-search input:focus,
[data-bs-theme="dark"] .aqa-dm-select:focus   { border-color: var(--aqa-forest-glow); box-shadow: 0 0 0 3px rgba(167,139,250,.18); }
[data-bs-theme="dark"] .aqa-dm-search i.search-ico { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-select option  { background: var(--aqa-surface); color: var(--aqa-ink); }

[data-bs-theme="dark"] .aqa-dm-chips          {}
[data-bs-theme="dark"] .aqa-dm-chip           { background: rgba(167,139,250,.16); color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .aqa-dm-chip a         { color: var(--aqa-forest-glow); }

[data-bs-theme="dark"] .aqa-dm-card-table     { background: var(--aqa-surface); border-color: var(--aqa-border); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .aqa-dm-table thead th { background: var(--aqa-surface-2); color: var(--aqa-muted); border-bottom-color: var(--aqa-border); }
[data-bs-theme="dark"] .aqa-dm-table thead th a:hover     { color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .aqa-dm-table thead th .sort-ico.active { color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .aqa-dm-table thead.filters th     { background: var(--aqa-surface); }
[data-bs-theme="dark"] .aqa-dm-table thead.filters input,
[data-bs-theme="dark"] .aqa-dm-table thead.filters select { background: rgba(255,255,255,.04); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-table tbody td             { color: var(--aqa-ink); border-bottom-color: rgba(255,255,255,.05); }
[data-bs-theme="dark"] .aqa-dm-table tbody tr:hover       { background: rgba(255,255,255,.03); }

[data-bs-theme="dark"] .aqa-dm-name-cell .name { color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-name-cell .sub  { color: var(--aqa-muted); }

/* Status pills: more contrast in dark mode (richer bg + lighter text) */
[data-bs-theme="dark"] .aqa-dm-pill-success { background: rgba(16,185,129,.18);  color:#6EE7B7; }
[data-bs-theme="dark"] .aqa-dm-pill-warn    { background: rgba(245,158,11,.20);  color:#FCD34D; }
[data-bs-theme="dark"] .aqa-dm-pill-danger  { background: rgba(244,63,94,.20);   color:#FCA5A5; }
[data-bs-theme="dark"] .aqa-dm-pill-info    { background: rgba(59,130,246,.20);  color:#93C5FD; }
[data-bs-theme="dark"] .aqa-dm-pill-muted   { background: rgba(148,163,184,.18); color:#CBD5E1; }

[data-bs-theme="dark"] .aqa-dm-row-actions .kebab        { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-row-actions .kebab:hover  { background: rgba(255,255,255,.06); color: var(--aqa-ink); }

[data-bs-theme="dark"] .kebab-mobile { color: var(--aqa-muted); }
[data-bs-theme="dark"] .kebab-mobile:hover { background: rgba(255,255,255,.06); color: var(--aqa-ink); }

[data-bs-theme="dark"] .aqa-mobile-fab-bar .fab-primary { background: var(--aqa-forest); }
[data-bs-theme="dark"] .aqa-mobile-fab-bar .fab-secondary { background: var(--aqa-muted); }

[data-bs-theme="dark"] .aqa-dm-mobile-search             { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .aqa-dm-mobile-search .aqa-dm-search input { background: var(--aqa-surface); }

[data-bs-theme="dark"] .aqa-dm-chipstrip .chip           { background: var(--aqa-surface); border-color: var(--aqa-border); color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-chipstrip .chip.active    { background: var(--aqa-forest); border-color: var(--aqa-forest); color:#fff; }

[data-bs-theme="dark"] .aqa-dm-list .aqa-dm-card         { background: var(--aqa-surface); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .aqa-dm-list .aqa-dm-card:hover   { border-color: var(--aqa-forest-glow); box-shadow: 0 2px 10px rgba(167,139,250,.18); }
[data-bs-theme="dark"] .aqa-dm-list .aqa-dm-card-link    { color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-list a.aqa-dm-card        { color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-list .aqa-dm-card .body .name { color: var(--aqa-ink); }
[data-bs-theme="dark"] .aqa-dm-list .aqa-dm-card .body .meta { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-contact-btn { background: var(--aqa-surface-2); border-color: var(--aqa-border); color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-contact-btn:hover { background: var(--aqa-forest); color: #fff; border-color: var(--aqa-forest); }

[data-bs-theme="dark"] .aqa-dm-empty             { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-empty .icon       { color: rgba(255,255,255,.18); }
[data-bs-theme="dark"] .aqa-dm-empty .title      { color: var(--aqa-ink); }

[data-bs-theme="dark"] .aqa-dm-import-drop       { background: rgba(255,255,255,.04); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .aqa-dm-import-drop:hover,
[data-bs-theme="dark"] .aqa-dm-import-drop.dragover { background: rgba(167,139,250,.10); border-color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .aqa-dm-import-drop .icon { color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-dm-import-errors     { background: rgba(244,63,94,.10); border-color: rgba(244,63,94,.30); color:#FCA5A5; }

/* =========================================================
   DATA MANAGER — MOBILE TOOLBAR REFINEMENT v2 (2026-05-24)
   Goals:
   1) Compact toolbar (no card padding, single tight row with
      search + a single filter); chipstrip already handles
      status filtering on mobile.
   2) Import / Export = small icon buttons in the header.
   3) "Add new" inline button hidden on mobile, replaced by a
      Floating Action Button (FAB) at bottom-right.
   4) Hide the copyright footer on mobile to reclaim vertical
      space (drawer / bottom-nav already provides navigation).
   ========================================================= */

/* ---- Speed-dial FAB ---- */
/* Hidden by default; shown only on mobile via media query below */
.aqa-dm-fab-wrap {
  display: none;          /* hidden on desktop/tablet by default */
  position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1050;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
/* Main round trigger button */
.aqa-dm-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--aqa-forest, #7C3AED);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 6px 18px rgba(124,58,237,.4), 0 2px 6px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}
.aqa-dm-fab:focus { outline: none; }
.aqa-dm-fab-wrap:not(.is-open) .aqa-dm-fab { transform: rotate(0deg); }
.aqa-dm-fab-wrap.is-open  .aqa-dm-fab { transform: rotate(45deg); box-shadow: 0 10px 28px rgba(124,58,237,.5); }
/* Toggle which icon shows */
.aqa-dm-fab .aqa-fab-ico-close { display: none; }
.aqa-dm-fab-wrap.is-open .aqa-dm-fab .aqa-fab-ico-plus  { display: none; }
.aqa-dm-fab-wrap.is-open .aqa-dm-fab .aqa-fab-ico-close { display: inline; }
/* Speed-dial item list */
.aqa-dm-fab-items {
    position: absolute;
    right: 0;
    bottom: 66px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}
.aqa-dm-fab-wrap.is-open .aqa-dm-fab-items {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* Each speed-dial action row: label + icon */
.aqa-dm-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.aqa-dm-fab-label {
  background: var(--aqa-surface, #fff);
  color: var(--aqa-ink, #111827);
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  white-space: nowrap;
  border: 1px solid var(--aqa-border, #e5e7eb);
}
.aqa-dm-fab-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--aqa-surface, #fff);
  color: var(--aqa-forest, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.16);
  border: 1px solid var(--aqa-border, #e5e7eb);
  flex-shrink: 0;
}
.aqa-dm-fab-item:hover .aqa-dm-fab-icon,
.aqa-dm-fab-item:focus .aqa-dm-fab-icon {
  background: var(--aqa-forest, #7C3AED);
  color: #fff;
}
/* Tap-outside backdrop */
.aqa-dm-fab-backdrop {
  display: none;
  position: fixed; inset: 0;
  z-index: 1049;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.aqa-dm-fab-wrap.is-open ~ .aqa-dm-fab-backdrop { display: block; }
/* Dark mode */
[data-bs-theme="dark"] .aqa-dm-fab       { box-shadow: 0 6px 20px rgba(124,58,237,.6), 0 2px 6px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .aqa-dm-fab-label { box-shadow: 0 2px 8px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .aqa-dm-fab-icon  { box-shadow: 0 3px 10px rgba(0,0,0,.5); }

/* ---- Mobile breakpoints ---- */
@media (max-width: 767.98px) {
  /* Show speed-dial FAB on phones/small tablets */
    .aqa-dm-fab-wrap {
        display: flex;
        right: 10px !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }

  /* Header layout — compact */
  .aqa-dm-header { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .aqa-dm-header > div:first-child { flex: 1 1 100%; min-width: 0; }
  .aqa-dm-title { font-size: 1.1rem; margin-bottom: 2px; }
  .aqa-dm-subtitle { font-size: .75rem; }
  /* All header action buttons replaced by FAB */
  .aqa-dm-actions { display: none; }

  /* Compact filter toolbar */
  .aqa-dm-toolbar { padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; margin-bottom: 8px; }
  .aqa-dm-toolbar-row { gap: 6px; }
  .aqa-dm-search { flex: 1 1 100%; min-width: 0; }
  .aqa-dm-search input {
    padding: 8px 12px 8px 34px;
    font-size: .85rem;
    border-radius: 10px;
    background: var(--aqa-surface, #fff);
    border: 1px solid var(--aqa-border, #e2e8f0);
  }
  .aqa-dm-search i.search-ico { left: 11px; font-size: .9rem; }
  /* Hide filter selects — chipstrip handles filtering */
  .aqa-dm-toolbar .aqa-dm-select,
  .aqa-dm-toolbar .aqa-dm-btn-ghost { display: none; }
    .aqa-dm-chipstrip { padding-top: 2px; }

    .aqa-dm-list { gap: 10px; }
    .aqa-dm-list .aqa-dm-card { border-radius: 14px; min-height: 80px; }
    .aqa-dm-list .aqa-dm-card-link,
    .aqa-dm-list a.aqa-dm-card { align-items: center; }
    .aqa-dm-list .aqa-dm-card .body .name { font-size: .93rem; line-height: 1.25; margin-bottom: 2px; }
    .aqa-dm-list .aqa-dm-card .body .meta {
        white-space: normal; overflow: visible;
        display: -webkit-box; -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3; font-size: .76rem;
    }
    .aqa-dm-card-aside { gap: 6px; padding: 10px 10px 10px 0; }
    .aqa-dm-list .aqa-dm-card .end { min-width: 56px; }

    .aqa-dm-pagination {
        margin-top: 12px;
        margin-bottom: 14px;
    }

    /* Import as app-like bottom sheet on mobile */
    .aqa-dm-import-canvas.offcanvas-end {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: min(82vh, 620px);
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        border-left: 0;
        transform: translateY(100%);
    }
    .aqa-dm-import-canvas.offcanvas-end.show {
        transform: translateY(0);
    }

    .aqa-dm-import-canvas .offcanvas-header {
        padding: .85rem 1rem;
    }
    .aqa-dm-import-canvas .offcanvas-body {
        padding: .9rem 1rem 1.05rem;
    }

  /* Padding so FAB doesn't overlap last row / pagination */
    .aqa-content, .aqa-mobile-content { padding-bottom: 124px; }
    .aqa-dm-wrap { padding-bottom: 112px; }
}
@media (max-width: 991.98px) {
  /* Hide page footer — copyright lives in the sidebar drawer */
  .aqa-footer { display: none; }
}

/* ---------- Bootstrap surfaces ---------- */
/* Cards already use vars, but legacy `.card` overrides in some pages set bg-white */
[data-bs-theme="dark"] .bg-white                { background-color: var(--aqa-surface) !important; color: var(--aqa-ink); }
[data-bs-theme="dark"] .bg-light                { background-color: var(--aqa-surface-2) !important; color: var(--aqa-ink); }
[data-bs-theme="dark"] .text-dark               { color: var(--aqa-ink) !important; }
[data-bs-theme="dark"] .text-muted              { color: var(--aqa-muted) !important; }
[data-bs-theme="dark"] .text-body               { color: var(--aqa-ink) !important; }
[data-bs-theme="dark"] .text-secondary          { color: var(--aqa-muted) !important; }
[data-bs-theme="dark"] .border                  { border-color: var(--aqa-border) !important; }
[data-bs-theme="dark"] hr,
[data-bs-theme="dark"] .dropdown-divider        { border-color: var(--aqa-border); }

/* Tables */
[data-bs-theme="dark"] .table                   { --bs-table-bg: transparent; --bs-table-color: var(--aqa-ink); --bs-table-border-color: var(--aqa-border); --bs-table-striped-bg: rgba(255,255,255,.03); --bs-table-hover-bg: rgba(255,255,255,.05); color: var(--aqa-ink); }
[data-bs-theme="dark"] .table > :not(caption) > * > * { background-color: transparent; color: var(--aqa-ink); border-bottom-color: var(--aqa-border); }
[data-bs-theme="dark"] .table thead th          { color: var(--aqa-muted); border-bottom-color: var(--aqa-border); }

/* Dropdown / Modal / Offcanvas / Popover / Tooltip */
[data-bs-theme="dark"] .dropdown-menu           { background: var(--aqa-surface); border-color: var(--aqa-border); color: var(--aqa-ink); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .dropdown-item           { color: var(--aqa-ink); }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus     { background: rgba(167,139,250,.12); color: var(--aqa-ink); }
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item:active    { background: var(--aqa-forest); color:#fff; }
[data-bs-theme="dark"] .dropdown-item.text-danger { color:#FCA5A5 !important; }

[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .offcanvas               { background: var(--aqa-surface); color: var(--aqa-ink); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .offcanvas-header        { border-color: var(--aqa-border); }
[data-bs-theme="dark"] .btn-close               { filter: invert(1) grayscale(1) brightness(2); }

[data-bs-theme="dark"] .popover                 { background: var(--aqa-surface); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .popover-header          { background: var(--aqa-surface-2); color: var(--aqa-ink); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .popover-body            { color: var(--aqa-ink); }
[data-bs-theme="dark"] .tooltip-inner           { background: #1E293B; color: var(--aqa-ink); }

/* Pagination */
[data-bs-theme="dark"] .pagination .page-link   { background: var(--aqa-surface); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .pagination .page-link:hover { background: rgba(167,139,250,.12); color: var(--aqa-forest-glow); border-color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .pagination .page-item.active .page-link { background: var(--aqa-forest); border-color: var(--aqa-forest); color:#fff; }
[data-bs-theme="dark"] .pagination .page-item.disabled .page-link { background: var(--aqa-surface); color: var(--aqa-muted); }

/* Alerts (Bootstrap soft alerts get unreadable in dark) */
[data-bs-theme="dark"] .alert-success { background: rgba(16,185,129,.12);  color:#6EE7B7; border-color: rgba(16,185,129,.30); }
[data-bs-theme="dark"] .alert-warning { background: rgba(245,158,11,.14);  color:#FCD34D; border-color: rgba(245,158,11,.30); }
[data-bs-theme="dark"] .alert-danger  { background: rgba(244,63,94,.14);   color:#FCA5A5; border-color: rgba(244,63,94,.30); }
[data-bs-theme="dark"] .alert-info    { background: rgba(59,130,246,.14);  color:#93C5FD; border-color: rgba(59,130,246,.30); }
[data-bs-theme="dark"] .alert-primary { background: rgba(124,58,237,.14);  color:#C4B5FD; border-color: rgba(124,58,237,.30); }
[data-bs-theme="dark"] .alert-secondary { background: rgba(148,163,184,.14); color:#CBD5E1; border-color: rgba(148,163,184,.30); }

/* Badges (.badge bg-success, etc. — keep saturated, just lighten text) */
[data-bs-theme="dark"] .badge.bg-secondary { background-color: #374151 !important; color: var(--aqa-ink); }
[data-bs-theme="dark"] .badge.bg-light     { background-color: var(--aqa-surface-2) !important; color: var(--aqa-ink); }
[data-bs-theme="dark"] .badge.bg-warning   { color: #111827; }

/* Form controls (text inputs/textarea/select) — repeats Bootstrap in case page overrides */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text { background: rgba(255,255,255,.04); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .form-control::placeholder { color: var(--aqa-muted); }
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled { background: rgba(255,255,255,.02); color: var(--aqa-muted); }
[data-bs-theme="dark"] .form-check-input { background-color: rgba(255,255,255,.05); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--aqa-forest); border-color: var(--aqa-forest); }
[data-bs-theme="dark"] .form-text { color: var(--aqa-muted); }

/* Sidebar / Topbar (legacy page-head card backgrounds) */
[data-bs-theme="dark"] .aqa-page-head .card { background: var(--aqa-surface); border-color: var(--aqa-border); }

/* Buttons: ensure .btn-ghost, .btn-light are visible */
[data-bs-theme="dark"] .btn-ghost,
[data-bs-theme="dark"] .btn-light { background: rgba(255,255,255,.04); color: var(--aqa-ink); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .btn-ghost:hover,
[data-bs-theme="dark"] .btn-light:hover { background: rgba(167,139,250,.12); color: var(--aqa-ink); border-color: var(--aqa-forest-glow); }
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--aqa-muted); border-color: var(--aqa-border); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: rgba(255,255,255,.06); color: var(--aqa-ink); }

/* Stat-tile delta colors keep saturation in dark */
[data-bs-theme="dark"] .aqa-stat-tile .delta.up   { color:#34D399; }
[data-bs-theme="dark"] .aqa-stat-tile .delta.down { color:#FB7185; }

/* Timeline node bg in dark should match surface, not white */
[data-bs-theme="dark"] .aqa-tl .ev::before { background: var(--aqa-surface); border-color: var(--aqa-forest-glow); }

/* Mini week calendar — color today is fine (gradient), free/holiday tints become invisible in dark */
[data-bs-theme="dark"] .aqa-week .day.is-holiday { background: rgba(244,63,94,.16); border-color: rgba(244,63,94,.35); }
[data-bs-theme="dark"] .aqa-week .day.is-holiday .dd { color:#FCA5A5; }
[data-bs-theme="dark"] .aqa-week .day.is-free    { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.35); }
[data-bs-theme="dark"] .aqa-week .day.is-free .dd { color:#6EE7B7; }

/* Notif left-border keep, but soft bg works fine via var(--aqa-surface) */

/* Quick-action tile colored icons (dashboard v3) — slightly brighten color in dark */
[data-bs-theme="dark"] .aqa-qa-tile .qi          { background: rgba(167,139,250,.20); color:#C4B5FD; }
[data-bs-theme="dark"] .aqa-qa-tile.t-emerald .qi{ background: rgba(16,185,129,.20);  color:#6EE7B7; }
[data-bs-theme="dark"] .aqa-qa-tile.t-amber .qi  { background: rgba(245,158,11,.20);  color:#FCD34D; }
[data-bs-theme="dark"] .aqa-qa-tile.t-rose .qi   { background: rgba(244,63,94,.20);   color:#FCA5A5; }
[data-bs-theme="dark"] .aqa-qa-tile.t-sky .qi    { background: rgba(14,165,233,.20);  color:#7DD3FC; }
[data-bs-theme="dark"] .aqa-qa-tile.t-indigo .qi { background: rgba(99,102,241,.20);  color:#A5B4FC; }

[data-bs-theme="dark"] .aqa-stat-tile.t-violet .ico { color:#C4B5FD; }
[data-bs-theme="dark"] .aqa-stat-tile.t-emerald .ico{ color:#6EE7B7; }
[data-bs-theme="dark"] .aqa-stat-tile.t-amber .ico  { color:#FCD34D; }
[data-bs-theme="dark"] .aqa-stat-tile.t-rose .ico   { color:#FCA5A5; }
[data-bs-theme="dark"] .aqa-stat-tile.t-sky .ico    { color:#7DD3FC; }
[data-bs-theme="dark"] .aqa-stat-tile.t-indigo .ico { color:#A5B4FC; }

[data-bs-theme="dark"] .aqa-feed .row-item .av,
[data-bs-theme="dark"] .aqa-notif .ic           { color:#C4B5FD; background: rgba(167,139,250,.18); }

/* Schedule chips on dark */
[data-bs-theme="dark"] .aqa-sched .chip         { background: rgba(16,185,129,.18); color:#6EE7B7; }
[data-bs-theme="dark"] .aqa-sched .chip.live   { background: rgba(244,63,94,.20); color:#FCA5A5; }
[data-bs-theme="dark"] .aqa-sched .chip.soon   { background: rgba(245,158,11,.20); color:#FCD34D; }
[data-bs-theme="dark"] .aqa-sched .chip.done   { background: rgba(148,163,184,.18); color:#CBD5E1; }

/* Bottom nav / mobile chrome stays branded — no override needed */

/* Inputs inside calendar widgets and any Tom-Select / Choices clones */
[data-bs-theme="dark"] .ts-control,
[data-bs-theme="dark"] .ts-wrapper.single .ts-control,
[data-bs-theme="dark"] .ts-dropdown          { background: var(--aqa-surface) !important; color: var(--aqa-ink) !important; border-color: var(--aqa-border) !important; }

/* Bootstrap card-header / card-footer */
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer           { background: rgba(255,255,255,.02); border-color: var(--aqa-border); color: var(--aqa-ink); }

/* List-group items */
[data-bs-theme="dark"] .list-group-item       { background: var(--aqa-surface); border-color: var(--aqa-border); color: var(--aqa-ink); }
[data-bs-theme="dark"] .list-group-item:hover { background: rgba(255,255,255,.03); }

/* Code / pre */
[data-bs-theme="dark"] code, [data-bs-theme="dark"] pre { background: rgba(255,255,255,.04); color: #E2E8F0; }

/* ================================================================
   COMBINED ATTENDANCE STATUSES  (aqa-att-*)
   ================================================================ */

/* ---- Base badge / pill ---- */
.aqa-att-status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 22px; padding: 0 7px;
  border-radius: 6px; font-size: .72rem; font-weight: 700;
  letter-spacing: .02em; line-height: 1; vertical-align: middle;
}

/* Per-status badge colours */
.aqa-att-p   { background: #d1fae5; color: #065f46; }
.aqa-att-sa  { background: #fef9c3; color: #854d0e; }
.aqa-att-ta  { background: #e0f2fe; color: #0369a1; }
.aqa-att-l   { background: #f1f5f9; color: #475569; }
.aqa-att-h   { background: #ede9fe; color: #5b21b6; }
.aqa-att-compensated { outline: 2px solid #0ea5e9; outline-offset: 1px; }

/* Dark mode overrides */
[data-bs-theme="dark"] .aqa-att-p  { background: #064e3b; color: #6ee7b7; }
[data-bs-theme="dark"] .aqa-att-sa { background: #713f12; color: #fde68a; }
[data-bs-theme="dark"] .aqa-att-ta { background: #0c4a6e; color: #7dd3fc; }
[data-bs-theme="dark"] .aqa-att-l  { background: #1e293b; color: #94a3b8; }
[data-bs-theme="dark"] .aqa-att-h  { background: #2e1065; color: #c4b5fd; }

/* ---- Mobile card ---- */
.aqa-att-card {
  background: var(--aqa-surface, #fff);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ---- Status buttons (mobile) ---- */
.aqa-att-btn {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6px 10px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
  background: var(--aqa-surface-2, #f8fafc);
  user-select: none;
}
.aqa-att-btn:hover { border-color: currentColor; }
.aqa-att-btn--active { border-color: currentColor !important; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.aqa-att-btn input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* Mobile avatar */
.aqa-att-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--aqa-primary, #6c3e8e); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; letter-spacing: .03em;
}

/* ---- Desktop pill (radio-button pill group) ---- */
.aqa-att-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; cursor: pointer;
  border: 2px solid #e2e8f0; transition: all .15s;
  background: var(--aqa-surface-2, #f8fafc); font-size: .75rem; font-weight: 600;
  user-select: none;
}
.aqa-att-pill:hover { border-color: #a0aec0; }
.aqa-att-pill input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* Desktop pill active colours */
.aqa-att-pill--active.aqa-att-pill-P  { background: #d1fae5; border-color: #059669; color: #065f46; }
.aqa-att-pill--active.aqa-att-pill-SA { background: #fef9c3; border-color: #d97706; color: #854d0e; }
.aqa-att-pill--active.aqa-att-pill-TA { background: #e0f2fe; border-color: #0284c7; color: #0369a1; }
.aqa-att-pill--active.aqa-att-pill-L  { background: #f1f5f9; border-color: #64748b; color: #475569; }
.aqa-att-pill--active.aqa-att-pill-H  { background: #ede9fe; border-color: #7c3aed; color: #5b21b6; }

/* ---- Batch section header (attendance) ---- */
.aqa-att-batch-header {
  display: flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--aqa-muted);
  padding: .7rem .25rem .45rem;
}
.aqa-att-batch-header::after { content:""; flex:1; height:1px; background: var(--aqa-border); }

/* ---- Unified attendance row card ---- */
.aqa-att-row-card { transition: box-shadow .12s; }
.aqa-att-row-card:hover { box-shadow: var(--aqa-shadow); }
.aqa-att-pill input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* ---- Bulk action toolbar ---- */
.aqa-bulk-bar { position: sticky; top: 4rem; z-index: 90; }
.aqa-bulk-bar .card { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle, #eef2ff); }
.aqa-bulk-btn { border: 1px solid var(--aqa-border); background: #fff; }
.aqa-bulk-btn:hover { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle, #eef2ff); }

/* ---- Day-dot grid (monthly view) ---- */
.aqa-att-day-dot { transition: transform .1s; }
.aqa-att-day-dot:hover { transform: scale(1.2); }
.aqa-att-dot-empty  { background: var(--aqa-surface-2,#f8fafc); color: #cbd5e1; }
.aqa-att-dot-p      { background: #d1fae5; color: #065f46; }
.aqa-att-dot-sa     { background: #fef9c3; color: #854d0e; }
.aqa-att-dot-ta     { background: #e0f2fe; color: #0369a1; }
.aqa-att-dot-l      { background: #f1f5f9; color: #475569; }
.aqa-att-dot-h      { background: #ede9fe; color: #5b21b6; }
.aqa-att-dot-compensated { outline: 2px solid #0ea5e9; outline-offset: 1px; }

/* ---- Sticky first column in matrix table ---- */
.sticky-col {
  position: sticky; left: 0; z-index: 2;
  background: var(--aqa-surface, #fff);
  box-shadow: 2px 0 5px rgba(0,0,0,.06);
}
[data-bs-theme="dark"] .sticky-col { background: var(--aqa-surface, #1e293b); }

/* =========================================================
   THEME FIX v2 — Comprehensive dark-mode patch (2026-06-05)
   Covers: attendance dots, gray surface fallbacks, status
   badges from inline styles, card-footer bg, import-drop.
   ========================================================= */

/* --- Bootstrap gray-surface vars: remap in dark so var(--bs-gray-100,…) fallbacks work --- */
[data-bs-theme="dark"] {
    --bs-gray-50:  #0F172A;
    --bs-gray-100: #1E293B;
    --bs-gray-200: #1E293B;
    --bs-gray-300: #334155;
    --bs-gray-400: #475569;
    --bs-gray-500: #64748B;
    --bs-gray-600: #94A3B8;
    --bs-gray-700: #CBD5E1;
    --bs-gray-800: #E2E8F0;
    --bs-gray-900: #F8FAFC;
}

/* --- Attendance dot colors: ensure contrast in dark --- */
[data-bs-theme="dark"] .aqa-att-dot-empty  { background: rgba(255,255,255,.08); color: var(--aqa-muted); }
[data-bs-theme="dark"] .aqa-att-dot-p      { background: rgba(16,185,129,.20);  color:#6EE7B7; }
[data-bs-theme="dark"] .aqa-att-dot-sa     { background: rgba(245,158,11,.22);  color:#FCD34D; }
[data-bs-theme="dark"] .aqa-att-dot-ta     { background: rgba(14,165,233,.20);  color:#7DD3FC; }
[data-bs-theme="dark"] .aqa-att-dot-l      { background: rgba(148,163,184,.16); color:#CBD5E1; }
[data-bs-theme="dark"] .aqa-att-dot-h      { background: rgba(167,139,250,.20); color:#C4B5FD; }

/* --- Availability index: sticky thead & slot color dots --- */
[data-bs-theme="dark"] thead[style*="background:var(--bs-gray-100"],
[data-bs-theme="dark"] thead[style*="background: var(--bs-gray-100"] { background: var(--aqa-surface-2) !important; }
[data-bs-theme="dark"] th[style*="background:var(--bs-gray-100"],
[data-bs-theme="dark"] th[style*="background: var(--bs-gray-100"]    { background: var(--aqa-surface-2) !important; color: var(--aqa-muted) !important; }

/* --- Status color inline overrides: availability + batches form --- */
/* Emerald "available" text in dark */
[data-bs-theme="dark"] [style*="color:#059669"]  { color:#6EE7B7 !important; }
[data-bs-theme="dark"] [style*="color: #059669"] { color:#6EE7B7 !important; }
/* Red "conflict" text in dark */
[data-bs-theme="dark"] [style*="color:#dc2626"]  { color:#FCA5A5 !important; }
[data-bs-theme="dark"] [style*="color: #dc2626"] { color:#FCA5A5 !important; }
/* Blue "assigned" text in dark */
[data-bs-theme="dark"] [style*="color:#2563eb"]  { color:#93C5FD !important; }
[data-bs-theme="dark"] [style*="color: #2563eb"] { color:#93C5FD !important; }

/* --- Badge background tints used in availability views (safe to brighten) --- */
[data-bs-theme="dark"] [style*="background:rgba(16,185,129,.1"],
[data-bs-theme="dark"] [style*="background: rgba(16,185,129,.1"]  { background: rgba(16,185,129,.22) !important; }
[data-bs-theme="dark"] [style*="background:rgba(37,99,235,.1"],
[data-bs-theme="dark"] [style*="background: rgba(37,99,235,.1"]   { background: rgba(59,130,246,.20) !important; }
[data-bs-theme="dark"] [style*="background:rgba(239,68,68,.1"],
[data-bs-theme="dark"] [style*="background: rgba(239,68,68,.1"]   { background: rgba(244,63,94,.20) !important; }
[data-bs-theme="dark"] [style*="background:rgba(59,130,246,.1"],
[data-bs-theme="dark"] [style*="background: rgba(59,130,246,.1"]  { background: rgba(59,130,246,.20) !important; }

/* --- Surface blocks using bs-gray-100 in attendance pages --- */
[data-bs-theme="dark"] [style*="background:var(--bs-gray-100"],
[data-bs-theme="dark"] [style*="background: var(--bs-gray-100"]   { background: var(--aqa-surface-2) !important; }
[data-bs-theme="dark"] [style*="background:var(--aqa-surface,#fff"],
[data-bs-theme="dark"] [style*="background: var(--aqa-surface,#fff"] { background: var(--aqa-surface) !important; }

/* --- text-dark on badges (courses, warnings) --- */
[data-bs-theme="dark"] .badge.bg-warning.text-dark { color: var(--aqa-ink) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--aqa-ink) !important; }

/* --- import-offcanvas: fw-semibold text-dark --- */
[data-bs-theme="dark"] .fw-semibold.text-dark { color: var(--aqa-ink) !important; }

/* --- tutor-detail: "safe to assign" success text --- */
[data-bs-theme="dark"] [style*="color:#059669"] i { color:inherit; }

/* --- Revenue chart color dots stay visible (they're on canvas, no override needed) --- */

/* --- border: 1px solid var(--bs-border-color) — already adaptive via Bootstrap --- */


