/* =====================================================================
   School ERP - Design System  (v2 - "Premium" re-skin)
   ---------------------------------------------------------------------
   A Bootstrap-5-based, mobile-first SaaS dashboard skin: sidebar +
   topbar shell, cards, form sections, tables, modals.

   v2 notes: this is a pure *visual* re-skin. Every class name from v1
   is preserved (many views set `style="--icon:#.."` inline and rely on
   `var(--brand-*)`), so nothing in the 55 view modules had to change -
   only the values, the spacing rhythm, the shadows/radii, the form-
   section treatment and the component polish were lifted toward a
   cleaner, calmer look. New optional components (.page-header,
   .form-section, .chip, .section-label, .detail-list, .toolbar,
   .lang-switch) are additive - old markup keeps working untouched.

   Palette direction borrowed from a reference offline school app:
   deep institutional navy, a brighter azure for anything interactive,
   a warm saffron accent used sparingly, calm blue-grey surfaces.
   ===================================================================== */

:root {
    /* ---- Brand (v1 names kept - do not rename, used inline in views) ---- */
    --brand-primary: #0b3b8c;          /* was #1e3a8a - a touch brighter, more azure */
    --brand-primary-light: #1f5fc4;
    --brand-primary-dark: #072a66;
    --brand-accent: #12923f;           /* success green */
    --brand-saffron: #ff7a18;          /* warm highlight - CTAs, "new", focus moments */
    --brand-cyan: #1fb6d8;

    --brand-bg: #eef3f9;               /* app canvas */
    --brand-surface: #ffffff;          /* raised card / input surface */
    --brand-surface-2: #f7fafd;        /* subtle inset surface */
    --brand-card-bg: #ffffff;          /* v1 tinted cards blue; v2 goes clean white
                                          + a hairline border for a lighter feel */
    --brand-card-head: #f4f8fd;        /* form-section header strip */
    --brand-border: #e2e8f2;
    --brand-border-strong: #cdd8e8;
    --brand-text: #16233b;
    --brand-heading: #0c1b33;
    --brand-muted: #64748b;

    /* ---- Scale ---- */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --sidebar-width: 264px;
    --topbar-height: 64px;

    --shadow-xs: 0 1px 2px rgba(12, 27, 51, .06);
    --shadow-sm: 0 2px 6px rgba(12, 27, 51, .06);
    --shadow-md: 0 10px 28px rgba(12, 27, 51, .10);
    --shadow-lg: 0 22px 55px rgba(12, 27, 51, .18);
    --ring: 0 0 0 .22rem rgba(31, 95, 196, .22);

    /* ---- Type ----
       Inter is the workhorse. Sora for the odd display moment. Noto
       Sans Devanagari / Bengali are in the stack so the bilingual UI
       (हिन्दी / বাংলা) renders cleanly without a per-string font swap. */
    --font-body: 'Inter', 'Noto Sans Devanagari', 'Noto Sans Bengali', 'Segoe UI', 'Nirmala UI', system-ui, -apple-system, sans-serif;
    --font-display: 'Sora', 'Inter', 'Noto Sans Devanagari', 'Noto Sans Bengali', 'Segoe UI', system-ui, sans-serif;

    /* ---- Bootstrap overrides ---- */
    --bs-body-font-family: var(--font-body);
    --bs-body-color: var(--brand-text);
    --bs-border-color: var(--brand-border);
    --bs-primary: var(--brand-primary);
    --bs-link-color: var(--brand-primary-light);
    --bs-link-hover-color: var(--brand-primary);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    background: var(--brand-bg);
    color: var(--brand-text);
    font-family: var(--font-body);
    font-feature-settings: "cv05", "ss03";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Headings get the darker heading ink. NOT .fw-bold - that utility is
   used on dark surfaces too (navbar brand, hero copy), where forcing a
   dark colour makes it navy-on-navy. */
h1, h2, h3, h4, h5, h6 { color: var(--brand-heading); letter-spacing: -.011em; }
a { text-decoration: none; }
hr { border-color: var(--brand-border); opacity: 1; }

::selection { background: rgba(31, 95, 196, .18); }

/* Thin, calm scrollbars app-wide (webkit/blink) */
* {
    scrollbar-width: thin;
    scrollbar-color: #c3cede transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c9d3e2; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #aebccf; background-clip: content-box; }

/* =====================================================================
   Auth pages
   ===================================================================== */
.auth-body {
    background:
        radial-gradient(1100px 500px at 12% -10%, rgba(31, 182, 216, .28), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(255, 122, 24, .18), transparent 55%),
        linear-gradient(160deg, var(--brand-primary-dark) 0%, #0a1f47 55%, #0c1b33 100%);
    padding: 1rem;
}
.auth-card {
    width: 100%; max-width: 430px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: var(--brand-surface);
}
.auth-back-home {
    position: absolute; top: 1.5rem; left: 1.5rem;
    display: inline-flex; align-items: center; gap: .45rem;
    color: #e5edfb; font-size: .875rem; font-weight: 500;
    padding: .4rem .75rem; border-radius: var(--radius-sm);
    transition: background-color .15s ease, color .15s ease;
}
.auth-back-home:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.auth-back-home i { font-size: 1rem; }
@media (max-width: 575.98px) {
    .auth-back-home { position: static; display: flex; margin: 0 auto 1rem; width: fit-content; }
}
.auth-logo {
    width: 60px; height: 60px; margin: 0 auto;
    background: linear-gradient(140deg, var(--brand-primary-light), var(--brand-primary-dark));
    color: #fff; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 10px 24px rgba(11, 59, 140, .35);
}
footer.text-muted a { color: #cbd5e1; }

/* =====================================================================
   Marketing homepage
   ===================================================================== */
.marketing-body { background: var(--brand-bg); }
.marketing-nav { background: var(--brand-primary-dark); }
.marketing-hero {
    background:
        radial-gradient(900px 450px at 100% -20%, rgba(31, 182, 216, .30), transparent 60%),
        linear-gradient(150deg, var(--brand-primary-dark) 0%, #0a1f47 60%, #0c1b33 100%);
    color: #fff;
}
.marketing-feature-card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    height: 100%;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .15s ease, transform .15s ease;
}
.marketing-feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.marketing-feature-icon {
    width: 50px; height: 50px;
    background: linear-gradient(140deg, var(--brand-primary-light), var(--brand-primary-dark));
    color: #fff;
    border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.marketing-cta { background: var(--brand-primary-dark); }
/* Both marketing surfaces are always dark - keep their headings light so
   the global h1-h6 ink rule can't render them navy-on-navy. */
.marketing-hero :is(h1, h2, h3, h4, h5, h6),
.marketing-cta :is(h1, h2, h3, h4, h5, h6) { color: #fff; }
.marketing-nav .navbar-brand { color: #fff; }
.marketing-footer { background: #0b1730; color: #cfd8f0; }
.marketing-footer a { color: #cfd8f0; }
.auth-modal-content { background: var(--brand-surface); border-radius: var(--radius-lg); }

/* Hero product preview carousel (browser-frame mockup) */
.hero-preview-frame {
    background: var(--brand-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .38);
    overflow: hidden;
}
.hero-preview-chrome { background: #eef1f8; padding: .55rem .75rem; display: flex; align-items: center; gap: .55rem; }
.hero-preview-chrome-dots { display: flex; gap: .35rem; flex-shrink: 0; }
.hero-preview-chrome-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.hero-preview-url {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: .35rem;
    background: #fff; border: 1px solid var(--brand-border); border-radius: var(--radius-pill);
    padding: .3rem .7rem; font-size: .72rem; color: var(--brand-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-preview-url i { font-size: .62rem; color: var(--brand-accent); flex-shrink: 0; }
.hero-preview-body { padding: 1.25rem; min-height: 320px; color: var(--brand-text); }
.hero-preview-dots { display: flex; justify-content: center; gap: .4rem; padding: .9rem 0 0; }
.hero-preview-dot { width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; background: rgba(255, 255, 255, .35); cursor: pointer; }
.hero-preview-dot.active { background: #fff; }
.hero-preview-frame .carousel-control-prev,
.hero-preview-frame .carousel-control-next {
    top: 50%; bottom: auto; transform: translateY(-50%);
    width: 2.1rem; height: 2.1rem; background: rgba(12, 27, 51, .55);
    border-radius: 50%; opacity: 0; transition: opacity .15s ease;
}
.hero-preview-frame .carousel-control-prev { left: .5rem; }
.hero-preview-frame .carousel-control-next { right: .5rem; }
.hero-preview-frame .carousel-control-prev-icon,
.hero-preview-frame .carousel-control-next-icon { width: .9rem; height: .9rem; }
.hero-preview-frame:hover .carousel-control-prev,
.hero-preview-frame:hover .carousel-control-next { opacity: .85; }

/* "How a new school gets started" step-by-step slideshow on the Help
   page - a light-background carousel, so it needs its own nav/dot
   styling rather than Bootstrap's default (those assume a dark image
   behind them). */
.help-journey-heading { font-family: var(--font-display); color: var(--brand-heading); }
.help-journey { position: relative; padding: 0 3.2rem; }
.help-slide {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    min-height: 380px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.help-slide-icon {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #fff;
    background: var(--icon, var(--brand-primary));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--icon, var(--brand-primary)) 40%, transparent);
    margin-bottom: 1rem;
}
.help-slide-step {
    font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--brand-primary); margin-bottom: .4rem;
}
.help-slide-title { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--brand-heading); margin-bottom: .75rem; }
.help-slide-body { color: var(--brand-muted); max-width: 520px; margin: 0 auto; }
.help-slide-list {
    text-align: left; color: var(--brand-muted); max-width: 560px;
    margin: 0 auto; padding-left: 1.2rem;
}
.help-slide-list li { margin-bottom: .55rem; line-height: 1.55; }
.help-slide-list li:last-child { margin-bottom: 0; }
.help-slide-list strong { color: var(--brand-text); }
.help-journey-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--brand-border);
    background: var(--brand-surface); color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    box-shadow: var(--shadow-sm); z-index: 2; opacity: 1;
}
.help-journey-nav:hover { box-shadow: var(--shadow-md); }
.help-journey-prev { left: 0; }
.help-journey-next { right: 0; }
.help-journey-dots {
    position: static; margin: 1.25rem 0 0; gap: .4rem;
}
.help-journey-dots button {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--brand-border); border: none; padding: 0; opacity: 1;
    text-indent: -9999px;
}
.help-journey-dots button.active { background: var(--brand-primary); width: 20px; border-radius: 4px; transition: width .2s ease; }
@media (max-width: 640px) {
    .help-journey { padding: 0 2.6rem; }
    .help-slide { padding: 2rem 1.25rem; min-height: 420px; }
    .help-journey-nav { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
}
.help-menu-map {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    display: block;
    max-width: 1000px;
    margin: 0 auto;
}
.help-menu-map img { display: block; width: 100%; height: auto; border-radius: 8px; }

/* =====================================================================
   App shell
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(196deg, #0a1f47 0%, #0d2a63 46%, #0a1c40 100%);
    color: #cfd8f0;
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 1030;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04), var(--shadow-lg);
}
.sidebar-brand {
    height: var(--topbar-height);
    display: flex; align-items: center; gap: .7rem;
    padding: 0 1.25rem;
    font-weight: 700; color: #fff; font-size: 1.02rem;
    font-family: var(--font-display);
    letter-spacing: .005em;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
}
.sidebar-brand i {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(135deg, #2f6fe0, #6fa0ff);
    color: #fff; font-size: 1.08rem; flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(47, 111, 224, .4);
}
/* Which school this account belongs to - now that real, separate
   schools share this one platform, this needs to be visible on every
   page, not just guessable from the logged-in person's own name. */
.sidebar-school {
    padding: .5rem 1.25rem .6rem;
    font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    color: #93a5d6;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex-shrink: 0;
}
.sidebar-scroll { overflow-y: auto; padding: .85rem .6rem 1.5rem; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border: none; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); }
.sidebar-group-label {
    font-size: .64rem; text-transform: uppercase; letter-spacing: .10em;
    color: #6f80b3; padding: 1.15rem .7rem .35rem; font-weight: 700;
}
.sidebar-nav > .sidebar-group-label:first-child { padding-top: .4rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .72rem;
    padding: .56rem .7rem; margin: .06rem 0;
    color: #b9c4e6; font-size: .862rem; font-weight: 500;
    border-radius: 9px;
    position: relative;
    transition: background-color .14s ease, color .14s ease;
}
.sidebar-link i { width: 18px; text-align: center; opacity: .82; font-size: .98rem; }
.sidebar-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-link:hover i { opacity: 1; }
.sidebar-link.active {
    background: linear-gradient(135deg, rgba(111, 160, 255, .26), rgba(111, 160, 255, .08));
    color: #fff; font-weight: 600;
}
.sidebar-link.active::before {
    content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
    width: 3px; height: 1.35rem; border-radius: 999px;
    background: linear-gradient(180deg, #6fa0ff, #2f6fe0);
}
.sidebar-link.active i { opacity: 1; color: #a8c0ff; }
.sidebar-footer {
    padding: .85rem 1rem; color: #5f6f99;
    border-top: 1px solid rgba(255, 255, 255, .08); flex-shrink: 0;
}

/* Mobile offcanvas reuses sidebar_nav.php verbatim - match the navy */
#mobileSidebar.offcanvas {
    background: linear-gradient(196deg, #0a1f47 0%, #0d2a63 46%, #0a1c40 100%);
    color: #cfd8f0; width: 280px;
}
#mobileSidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .08); }
#mobileSidebar .offcanvas-title { color: #fff; font-family: var(--font-display); }

.app-main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 991.98px) { .app-main { margin-left: 0; } }

.app-topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--brand-border);
    box-shadow: var(--shadow-xs);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.25rem;
    position: sticky; top: 0; z-index: 1020;
}
.btn-icon {
    border: none; background: transparent; border-radius: var(--radius-sm);
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-muted);
    transition: background-color .15s ease, color .15s ease;
}
.btn-icon:hover { background: var(--brand-surface-2); color: var(--brand-primary); }
.topbar-search {
    align-items: center; gap: .5rem;
    background: var(--brand-surface-2);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: .45rem .85rem; width: 320px; color: var(--brand-muted);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.topbar-search:focus-within { border-color: var(--brand-primary-light); background: #fff; box-shadow: var(--ring); }
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; font-size: .875rem; color: var(--brand-text); }
.btn-user {
    display: flex; align-items: center; gap: .5rem;
    border: 1px solid var(--brand-border); background: #fff;
    border-radius: var(--radius-pill); padding: .3rem .8rem .3rem .3rem;
    color: var(--brand-text);
    transition: box-shadow .15s ease, border-color .15s ease;
}
.btn-user:hover { box-shadow: var(--shadow-sm); border-color: var(--brand-border-strong); }
.avatar-circle {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; flex-shrink: 0;
}

.app-content { padding: 1.25rem; flex: 1; }
@media (min-width: 992px) { .app-content { padding: 1.6rem 2rem 2.5rem; } }

/* Breadcrumb tidy-up (rendered by layouts/app.php title block) */
.breadcrumb { --bs-breadcrumb-divider: '›'; margin-bottom: 0; }
.breadcrumb-item, .breadcrumb-item a { color: var(--brand-muted); font-weight: 500; }
.breadcrumb-item.active { color: var(--brand-text); }

/* =====================================================================
   Page header  (new optional component - drop-in for the title block)
   ===================================================================== */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.25rem;
}
.page-header .ph-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; line-height: 1.2; margin: 0; }
.page-header .ph-sub { color: var(--brand-muted); font-size: .88rem; margin: .15rem 0 0; }
.page-header .ph-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Toolbar strip above tables/lists */
.toolbar {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .75rem .9rem; margin-bottom: 1rem;
    background: var(--brand-surface); border: 1px solid var(--brand-border);
    border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.toolbar .toolbar-grow { flex: 1 1 200px; }

/* =====================================================================
   Cards / stat cards
   ===================================================================== */
.stat-card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    display: flex; align-items: center; gap: .95rem;
    box-shadow: var(--shadow-xs);
    position: relative; overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.stat-card::after {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--icon, var(--brand-primary));
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--brand-border-strong); }
@supports (background: color-mix(in srgb, red 10%, white)) {
    .stat-card {
        background: linear-gradient(150deg,
            color-mix(in srgb, var(--icon, var(--brand-primary)) 8%, var(--brand-surface)) 0%,
            var(--brand-surface) 60%);
    }
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fff; flex-shrink: 0;
    background: linear-gradient(140deg,
        color-mix(in srgb, var(--icon, var(--brand-primary)) 82%, white),
        var(--icon, var(--brand-primary)));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--icon, var(--brand-primary)) 35%, transparent);
}
@supports not (background: color-mix(in srgb, red 10%, white)) {
    .stat-card .stat-icon { background: var(--icon, var(--brand-primary)); }
}
.stat-card .stat-value { font-size: 1.45rem; font-weight: 750; line-height: 1.05; color: var(--brand-heading); word-break: break-word; font-family: var(--font-display); }
.stat-card .stat-label { font-size: .78rem; color: var(--brand-muted); font-weight: 500; }
@media (max-width: 420px) {
    .stat-card { padding: .9rem 1rem; gap: .65rem; border-radius: var(--radius); }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card .stat-icon { width: 42px; height: 42px; font-size: 1.15rem; border-radius: 12px; }
}

/* Dashboard greeting */
.dash-greeting { font-family: var(--font-display); font-weight: 700; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.015em; color: var(--brand-heading); }
.dash-greeting .accent { color: var(--brand-primary-light); }
.dash-subline { color: var(--brand-muted); font-size: .92rem; }
.dash-school {
    display: inline-flex; align-items: center; gap: .4rem;
    margin: .35rem 0 .25rem;
    padding: .2rem .7rem;
    font-size: .82rem; font-weight: 700;
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 8%, white);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, white);
    border-radius: 20px;
}
.dash-school i { font-size: .8rem; }

/* Generic card */
.card {
    background: var(--brand-card-bg);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 1rem; }
.card-header {
    background: var(--brand-card-head);
    border-bottom: 1px solid var(--brand-border);
    font-weight: 650; color: var(--brand-heading);
    padding: .8rem 1.1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    display: flex; align-items: center; gap: .5rem;
}
.card-header::before {
    content: ""; width: 4px; height: 1.05rem; border-radius: 999px;
    background: linear-gradient(180deg, var(--brand-primary-light), var(--brand-primary));
    flex-shrink: 0;
}
/* let callers opt a header out of the accent bar */
.card-header.no-accent::before { display: none; }
.card-body { padding: 1.1rem; }
.card-footer { background: var(--brand-surface-2); border-top: 1px solid var(--brand-border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* =====================================================================
   Form sections  (the "premium forms" centrepiece)
   Works with the existing .card + .card-header pattern used across the
   student / staff / admission / fee forms, and adds a richer optional
   .form-section variant with an icon + helper text.
   ===================================================================== */
.form-section {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: 1.1rem; overflow: hidden;
}
.form-section-head {
    display: flex; align-items: center; gap: .8rem;
    padding: .9rem 1.1rem;
    background: var(--brand-card-head);
    border-bottom: 1px solid var(--brand-border);
}
.form-section-head .fs-ico {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: #fff;
    background: linear-gradient(140deg, var(--brand-primary-light), var(--brand-primary-dark));
}
.form-section-head .fs-title { font-weight: 650; color: var(--brand-heading); line-height: 1.2; }
.form-section-head .fs-hint { font-size: .78rem; color: var(--brand-muted); }
.form-section-body { padding: 1.15rem 1.1rem; }

/* Small section label (uppercase eyebrow) */
.section-label {
    font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--brand-muted); margin-bottom: .5rem;
}

/* =====================================================================
   Form controls
   ===================================================================== */
.form-label {
    font-size: .8rem; font-weight: 600; color: var(--brand-heading);
    margin-bottom: .3rem;
}
.form-label .text-muted, .form-label .optional { font-weight: 500; }
.form-text { font-size: .76rem; color: var(--brand-muted); }

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--brand-border-strong);
    padding: .5rem .75rem;
    font-size: .9rem;
    color: var(--brand-text);
    background-color: var(--brand-surface);
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.form-control::placeholder { color: #9aa7bd; }
.form-control:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus) { border-color: #b3c0d6; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary-light);
    box-shadow: var(--ring);
    background-color: #fff;
}
.form-control:disabled, .form-select:disabled { background-color: #eef2f7; color: #8a96a8; }
.form-control.form-control-lg, .form-select-lg { font-size: .98rem; padding: .65rem .9rem; }
textarea.form-control { min-height: 92px; }

/* keep inputs clearly "fillable" if a card is tinted by a caller */
.card .form-control, .card .form-select,
.form-section .form-control, .form-section .form-select { background-color: var(--brand-surface); }

.input-group-text {
    background: var(--brand-surface-2);
    border-color: var(--brand-border-strong);
    color: var(--brand-muted); font-size: .85rem;
}
.form-check-input { border-color: var(--brand-border-strong); }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand-primary-light); }
.form-switch .form-check-input:checked { background-color: var(--brand-accent); border-color: var(--brand-accent); }

.was-validated .form-control:invalid, .form-control.is-invalid { border-color: #dc3545; }
.invalid-feedback { font-size: .76rem; }

/* Required-field asterisk styling when a label ends with " *" is common
   here - callers can also wrap it: <span class="req">*</span> */
.req { color: #dc3545; font-weight: 700; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: .875rem;
    padding: .5rem .95rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .1s ease, color .14s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; border-radius: 7px; }
.btn-lg { padding: .65rem 1.2rem; font-size: .95rem; }

.btn-primary {
    background: linear-gradient(140deg, var(--brand-primary-light), var(--brand-primary));
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px rgba(11, 59, 140, .28);
}
.btn-primary:hover, .btn-primary:focus-visible {
    background: linear-gradient(140deg, var(--brand-primary), var(--brand-primary-dark));
    border-color: var(--brand-primary-dark);
    box-shadow: 0 7px 18px rgba(11, 59, 140, .34);
    transform: translateY(-1px);
}
.btn-primary:active { background: var(--brand-primary-dark); }

.btn-success { background: var(--brand-accent); border-color: var(--brand-accent); box-shadow: 0 4px 12px rgba(18, 146, 63, .25); }
.btn-success:hover { background: #0d7a33; border-color: #0d7a33; }

/* Saffron accent button - "Generate", "New", primary marketing CTAs */
.btn-saffron, .btn-accent {
    background: linear-gradient(140deg, #ff8f3d, var(--brand-saffron));
    border: 1px solid var(--brand-saffron);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 122, 24, .30);
}
.btn-saffron:hover, .btn-accent:hover { background: linear-gradient(140deg, var(--brand-saffron), #e56a0c); color: #fff; transform: translateY(-1px); }

.btn-outline-primary { color: var(--brand-primary); border-color: var(--brand-border-strong); }
.btn-outline-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-secondary { color: var(--brand-muted); border-color: var(--brand-border-strong); background: var(--brand-surface); }
.btn-outline-secondary:hover { background: var(--brand-surface-2); color: var(--brand-heading); border-color: var(--brand-border-strong); }
.btn-light { background: var(--brand-surface-2); border-color: var(--brand-border); color: var(--brand-heading); }
.btn-light:hover { background: #eef2f7; border-color: var(--brand-border-strong); }
.btn:focus-visible { box-shadow: var(--ring); }

/* =====================================================================
   Tables
   ===================================================================== */
.table { --bs-table-bg: transparent; color: var(--brand-text); margin-bottom: 0; }
.table thead th {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    font-weight: 700; color: var(--brand-muted);
    background: var(--brand-surface-2);
    border-bottom: 1px solid var(--brand-border) !important;
    white-space: nowrap; padding: .7rem .85rem;
}
.table tbody td { padding: .7rem .85rem; vertical-align: middle; border-color: var(--brand-border); }
.table > tbody > tr { transition: background-color .1s ease; }
.card .table > tbody > tr:hover, .table-hover > tbody > tr:hover { background-color: rgba(11, 59, 140, .04); }
.table > :not(:first-child) { border-top: 0; }
.table-responsive-card { overflow-x: auto; border-radius: var(--radius); }

/* a bare table sitting straight inside a .card (no .card-body) gets
   rounded bottom corners for free */
.card > .table-responsive:last-child, .card > .table:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }

/* Definition-style detail list for "show" pages */
.detail-list { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0; }
.detail-list > dt {
    padding: .6rem .25rem; font-size: .8rem; font-weight: 600; color: var(--brand-muted);
    border-bottom: 1px solid var(--brand-border);
}
.detail-list > dd {
    padding: .6rem .25rem; margin: 0; font-size: .9rem; color: var(--brand-text);
    border-bottom: 1px solid var(--brand-border);
}
.detail-list > dd:last-of-type, .detail-list > dt:last-of-type { border-bottom: 0; }
@media (max-width: 480px) {
    .detail-list { grid-template-columns: 1fr; }
    .detail-list > dt { border-bottom: 0; padding-bottom: 0; }
    .detail-list > dd { padding-top: .15rem; }
}

/* =====================================================================
   Mobile card table  (v1 - unchanged behaviour, refreshed values)
   ===================================================================== */
@media (max-width: 575.98px) {
    .table-responsive-card.mobile-cards table,
    .table-responsive-card.mobile-cards tbody,
    .table-responsive-card.mobile-cards tr,
    .table-responsive-card.mobile-cards td { display: block; width: 100%; }
    .table-responsive-card.mobile-cards thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    }
    .table-responsive-card.mobile-cards tbody tr {
        margin-bottom: .75rem; border: 1px solid var(--brand-border); border-radius: var(--radius);
        padding: .8rem; background: var(--brand-surface); box-shadow: var(--shadow-xs);
    }
    .table-responsive-card.mobile-cards tbody tr:last-child { margin-bottom: 0; }
    .table-responsive-card.mobile-cards tbody td { border: none; padding: .3rem 0; text-align: left; }
    .table-responsive-card.mobile-cards tbody td[data-label]::before {
        content: attr(data-label); display: block; font-weight: 600; color: var(--brand-muted);
        font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .15rem;
    }
    .table-responsive-card.mobile-cards tbody td.text-end { text-align: left; }
}

/* Attendance toggle (btn-check + label) */
.attendance-toggle { flex-wrap: wrap; gap: .3rem; }
.attendance-toggle .btn { min-width: 2.5rem; padding: .32rem .35rem; font-size: .8rem; border-radius: 7px; }

/* =====================================================================
   Mobile hub cards / launcher grid / bottom nav
   ===================================================================== */
.mobile-action-card {
    display: flex; align-items: center; gap: .9rem;
    background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius-lg);
    padding: 1rem; margin-bottom: .75rem; color: inherit; text-decoration: none;
    box-shadow: var(--shadow-xs); transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.mobile-action-card:hover { border-color: var(--brand-primary-light); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.mobile-action-icon {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.mobile-menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 420px) { .mobile-menu-grid { grid-template-columns: repeat(2, 1fr); } }
.mobile-menu-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem;
    background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--radius-lg);
    padding: 1.1rem .5rem; color: inherit; text-decoration: none;
    box-shadow: var(--shadow-xs); transition: box-shadow .15s ease, transform .15s ease;
}
.mobile-menu-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.mobile-menu-card .mobile-menu-icon {
    width: 50px; height: 50px; border-radius: 15px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
    background: linear-gradient(140deg,
        color-mix(in srgb, var(--icon, var(--brand-primary)) 80%, white),
        var(--icon, var(--brand-primary)));
    color: #fff;
}
@supports not (background: color-mix(in srgb, red 10%, white)) {
    .mobile-menu-card .mobile-menu-icon { background: var(--icon, var(--brand-primary)); }
}
.mobile-menu-card .mobile-menu-label { font-size: .78rem; font-weight: 600; line-height: 1.2; color: var(--brand-heading); }

.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
    display: flex; background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(160%) blur(8px); -webkit-backdrop-filter: saturate(160%) blur(8px);
    border-top: 1px solid var(--brand-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .5rem 0 .4rem; color: var(--brand-muted); text-decoration: none; font-size: .68rem; font-weight: 500;
}
.mobile-nav-item i { font-size: 1.28rem; }
.mobile-nav-item.active { color: var(--brand-primary); font-weight: 700; }
.mobile-nav-item.active i { filter: drop-shadow(0 3px 6px rgba(11, 59, 140, .28)); }
@media (max-width: 991.98px) { .app-content { padding-bottom: 4.75rem; } }

/* =====================================================================
   Badges / chips / pills
   ===================================================================== */
.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .72rem; font-weight: 600; line-height: 1;
    padding: .32rem .58rem; border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--pill-color, var(--brand-muted)) 13%, white);
    color: color-mix(in srgb, var(--pill-color, var(--brand-muted)) 78%, black);
    white-space: nowrap;
}
.pill i { font-size: .85em; }
@supports not (background: color-mix(in srgb, red 10%, white)) {
    .pill { background: #eef2f7; color: var(--brand-muted); }
}

/* Generic chip (filters, tags, multi-select echoes) */
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .6rem; border-radius: var(--radius-pill);
    font-size: .78rem; font-weight: 600;
    background: var(--brand-surface-2); border: 1px solid var(--brand-border);
    color: var(--brand-heading);
}
.chip.chip-active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

.badge { font-weight: 600; letter-spacing: .01em; padding: .38em .6em; border-radius: 7px; }
.badge-role { text-transform: capitalize; }
.text-bg-light { background: var(--brand-surface-2) !important; color: var(--brand-heading) !important; }

/* Alerts */
.alert { border: 1px solid transparent; border-radius: var(--radius); font-size: .88rem; padding: .8rem 1rem; }
.alert-success { background: #e7f6ec; border-color: #bfe6cc; color: #0d5c2b; }
.alert-danger { background: #fdecec; border-color: #f5c6c6; color: #8f2020; }
.alert-warning { background: #fff5e6; border-color: #ffddb0; color: #8a5109; }
.alert-info { background: #e8f2fc; border-color: #c2ddf6; color: #114a86; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--brand-muted); }
.empty-state i { font-size: 2.6rem; opacity: .45; display: block; margin-bottom: .5rem; }

/* Dropdown menu */
.dropdown-menu {
    border: 1px solid var(--brand-border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: .35rem;
    font-size: .875rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: .5rem .7rem; }
.dropdown-item:hover { background: var(--brand-surface-2); }
.dropdown-item.text-danger:hover { background: #fdecec; }
.dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-muted); }

/* Modals */
.modal-content { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--brand-border); padding: 1rem 1.25rem; }
.modal-title { font-family: var(--font-display); font-weight: 650; }
.modal-body { padding: 1.25rem; }
.modal-footer { border-top: 1px solid var(--brand-border); padding: .9rem 1.25rem; }

/* Nav tabs / pills */
.nav-tabs { border-bottom: 1px solid var(--brand-border); gap: .15rem; }
.nav-tabs .nav-link {
    border: none; border-bottom: 2px solid transparent;
    color: var(--brand-muted); font-weight: 600; font-size: .875rem;
    padding: .6rem .9rem;
}
.nav-tabs .nav-link:hover { color: var(--brand-primary); border-bottom-color: var(--brand-border-strong); }
.nav-tabs .nav-link.active { color: var(--brand-primary); background: transparent; border-bottom-color: var(--brand-primary); }
.nav-pills .nav-link { color: var(--brand-muted); font-weight: 600; font-size: .85rem; border-radius: var(--radius-sm); }
.nav-pills .nav-link.active { background: var(--brand-primary); }

/* Progress */
.progress { background: var(--brand-surface-2); border-radius: var(--radius-pill); height: .55rem; }
.progress-bar { background: linear-gradient(90deg, var(--brand-primary-light), var(--brand-primary)); }

/* Pagination */
.pagination { --bs-pagination-color: var(--brand-muted); --bs-pagination-active-bg: var(--brand-primary); --bs-pagination-active-border-color: var(--brand-primary); --bs-pagination-border-color: var(--brand-border); --bs-pagination-border-radius: var(--radius-sm); gap: .2rem; }
.page-link { border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; }

/* Permission matrix table */
.permission-matrix th, .permission-matrix td { text-align: center; vertical-align: middle; }
.permission-matrix td:first-child, .permission-matrix th:first-child { text-align: left; }

/* =====================================================================
   Language switcher  (workstream 2 - topbar EN / हिन्दी / বাংলা)
   ===================================================================== */
.lang-switch { display: inline-flex; align-items: center; }
.lang-switch .btn-user i.bi-translate { font-size: 1rem; }
.lang-switch .dropdown-menu { min-width: 9.5rem; }
.lang-switch .dropdown-item.active,
.lang-switch .dropdown-item:active { background: var(--brand-primary); color: #fff; }
.lang-switch .dropdown-item .lang-native { font-weight: 600; }
.lang-switch .dropdown-item .lang-en { font-size: .74rem; color: var(--brand-muted); margin-left: .3rem; }
.lang-switch .dropdown-item.active .lang-en { color: rgba(255, 255, 255, .8); }

:lang(hi), :lang(bn) { line-height: 1.7; }

/* =====================================================================
   Print  (receipts, report cards, admit cards, ID cards)
   ===================================================================== */
@media print {
    .app-sidebar, .app-topbar, .mobile-bottom-nav, .ph-actions, .toolbar,
    .no-print, .breadcrumb, #mobileSidebar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .app-content { padding: 0 !important; }
    .card, .form-section { box-shadow: none !important; border-color: #ccc !important; }
    body { background: #fff !important; }
}

/* Small utilities used here and there */
.text-muted { color: var(--brand-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.cursor-pointer { cursor: pointer; }
.hover-lift { transition: transform .15s ease, box-shadow .15s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.divider-y { height: 1px; background: var(--brand-border); margin: 1rem 0; }
