/* ==========================================================================
   THEME PALETTES & DESIGN TOKENS
   ========================================================================== */
:root,
[data-theme="emerald"] {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #f0fdfa;
    --primary-soft: #ccfbf1;
    --primary-border: #99f6e4;
    --primary-ring: rgba(15, 118, 110, 0.25);
    --primary-rgb: 15, 118, 110;
    --sidebar-bg: #073834;
    --sidebar-dark: #032421;
    --sidebar-accent: #0f766e;
    --sidebar-grad: linear-gradient(165deg, #064e48 0%, #0f766e 45%, #042f2b 100%);
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-hover-color: #115e59;
}

[data-theme="sapphire"] {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --primary-soft: #dbeafe;
    --primary-border: #bfdbfe;
    --primary-ring: rgba(29, 78, 216, 0.25);
    --primary-rgb: 29, 78, 216;
    --sidebar-bg: #0f172a;
    --sidebar-dark: #0a0f1d;
    --sidebar-accent: #1d4ed8;
    --sidebar-grad: linear-gradient(165deg, #1e3a8a 0%, #1d4ed8 45%, #0f172a 100%);
    --bs-primary: #1d4ed8;
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: #1d4ed8;
    --bs-link-hover-color: #1e40af;
}

[data-theme="indigo"] {
    --primary: #4338ca;
    --primary-dark: #3730a3;
    --primary-light: #eef2ff;
    --primary-soft: #e0e7ff;
    --primary-border: #c7d2fe;
    --primary-ring: rgba(67, 56, 202, 0.25);
    --primary-rgb: 67, 56, 202;
    --sidebar-bg: #111827;
    --sidebar-dark: #0b0f19;
    --sidebar-accent: #4338ca;
    --sidebar-grad: linear-gradient(165deg, #312e81 0%, #4338ca 45%, #111827 100%);
    --bs-primary: #4338ca;
    --bs-primary-rgb: 67, 56, 202;
    --bs-link-color: #4338ca;
    --bs-link-hover-color: #3730a3;
}

[data-theme="maroon"] {
    --primary: #9f1239;
    --primary-dark: #881337;
    --primary-light: #fff1f2;
    --primary-soft: #ffe4e6;
    --primary-border: #fecdd3;
    --primary-ring: rgba(159, 18, 57, 0.25);
    --primary-rgb: 159, 18, 57;
    --sidebar-bg: #1c1015;
    --sidebar-dark: #12090d;
    --sidebar-accent: #9f1239;
    --sidebar-grad: linear-gradient(165deg, #700d28 0%, #9f1239 45%, #1c1015 100%);
    --bs-primary: #9f1239;
    --bs-primary-rgb: 159, 18, 57;
    --bs-link-color: #9f1239;
    --bs-link-hover-color: #881337;
}

[data-theme="purple"] {
    --primary: #7e22ce;
    --primary-dark: #6b21a8;
    --primary-light: #faf5ff;
    --primary-soft: #f3e8ff;
    --primary-border: #e9d5ff;
    --primary-ring: rgba(126, 34, 206, 0.25);
    --primary-rgb: 126, 34, 206;
    --sidebar-bg: #190e28;
    --sidebar-dark: #0f0719;
    --sidebar-accent: #7e22ce;
    --sidebar-grad: linear-gradient(165deg, #581c87 0%, #7e22ce 45%, #190e28 100%);
    --bs-primary: #7e22ce;
    --bs-primary-rgb: 126, 34, 206;
    --bs-link-color: #7e22ce;
    --bs-link-hover-color: #6b21a8;
}

[data-theme="forest"] {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #f0fdf4;
    --primary-soft: #dcfce7;
    --primary-border: #bbf7d0;
    --primary-ring: rgba(21, 128, 61, 0.25);
    --primary-rgb: 21, 128, 61;
    --sidebar-bg: #092011;
    --sidebar-dark: #05140b;
    --sidebar-accent: #15803d;
    --sidebar-grad: linear-gradient(165deg, #14532d 0%, #15803d 45%, #092011 100%);
    --bs-primary: #15803d;
    --bs-primary-rgb: 21, 128, 61;
    --bs-link-color: #15803d;
    --bs-link-hover-color: #166534;
}

[data-theme="slate"] {
    --primary: #334155;
    --primary-dark: #1e293b;
    --primary-light: #f8fafc;
    --primary-soft: #f1f5f9;
    --primary-border: #cbd5e1;
    --primary-ring: rgba(51, 65, 85, 0.25);
    --primary-rgb: 51, 65, 85;
    --sidebar-bg: #0f172a;
    --sidebar-dark: #020617;
    --sidebar-accent: #475569;
    --sidebar-grad: linear-gradient(165deg, #1e293b 0%, #334155 45%, #0f172a 100%);
    --bs-primary: #334155;
    --bs-primary-rgb: 51, 65, 85;
    --bs-link-color: #334155;
    --bs-link-hover-color: #1e293b;
}

[data-theme="amber"] {
    --primary: #c2410c;
    --primary-dark: #9a3412;
    --primary-light: #fff7ed;
    --primary-soft: #ffedd5;
    --primary-border: #fed7aa;
    --primary-ring: rgba(194, 65, 12, 0.25);
    --primary-rgb: 194, 65, 12;
    --sidebar-bg: #1f140e;
    --sidebar-dark: #130a06;
    --sidebar-accent: #c2410c;
    --sidebar-grad: linear-gradient(165deg, #7c2d12 0%, #c2410c 45%, #1f140e 100%);
    --bs-primary: #c2410c;
    --bs-primary-rgb: 194, 65, 12;
    --bs-link-color: #c2410c;
    --bs-link-hover-color: #9a3412;
}

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --accent: #eab308;
    --danger: #b42318;
    --success: #047857;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

/* Global Bootstrap & Theme Harmonization */
.btn-primary,
.btn-primary-ui,
.action-primary {
    background-color: var(--primary) !important;
    background: var(--primary) !important;
    border-color: var(--primary-dark, var(--primary)) !important;
    border: 1.5px solid var(--primary-dark, var(--primary)) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn-primary *,
.btn-primary-ui *,
.action-primary * {
    color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary-ui:hover,
.btn-primary-ui:focus,
.action-primary:hover,
.action-primary:focus {
    background-color: var(--primary-dark) !important;
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--primary-ring, rgba(0, 0, 0, 0.15)) !important;
}
.btn-outline-primary,
.btn-outline-ui,
.action-muted,
.action-secondary {
    color: var(--primary) !important;
    border: 1.5px solid var(--primary-border, #cbd5e1) !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-ui:hover,
.action-muted:hover,
.action-muted:focus,
.action-secondary:hover {
    background-color: var(--primary-light) !important;
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}
.text-primary {
    color: var(--primary) !important;
}
.bg-primary {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}
.border-primary {
    border-color: var(--primary) !important;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem var(--primary-ring) !important;
}
.page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Universal Pill Navigation Tabs */
.nav-pills,
.custom-pills,
.custom-settings-tabs {
    background: #f1f5f9 !important;
    padding: 4px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    border: 1px solid #e2e8f0 !important;
}
.nav-pills .nav-link,
.custom-pills .nav-link,
.custom-settings-tabs .nav-link {
    color: #475569 !important;
    background: transparent !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    padding: 8px 18px !important;
    border-radius: 7px !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease-in-out !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}
.nav-pills .nav-link:hover,
.custom-pills .nav-link:hover,
.custom-settings-tabs .nav-link:hover {
    color: var(--primary) !important;
    background: #ffffff !important;
    border-color: var(--primary-border, #cbd5e1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}
.nav-pills .nav-link.active,
.custom-pills .nav-link.active,
.custom-settings-tabs .nav-link.active,
.nav-pills .show > .nav-link {
    color: #ffffff !important;
    background-color: var(--primary) !important;
    background: var(--primary) !important;
    border-color: var(--primary-dark) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px var(--primary-ring, rgba(0, 0, 0, 0.15)) !important;
}

/* Period Switcher Toolbar & Button Groups */
.period-switcher-bar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
}
.period-switcher-bar .btn-group {
    background: #ffffff !important;
    padding: 3px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    display: inline-flex !important;
    gap: 3px !important;
}
.period-switcher-bar .btn-group .btn {
    border-radius: 6px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    padding: 6px 14px !important;
    border: 1px solid transparent !important;
    line-height: 1.2 !important;
    transition: all 0.15s ease-in-out !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.period-switcher-bar .btn-group .btn-outline-secondary {
    color: #334155 !important;
    background: transparent !important;
    border-color: transparent !important;
}
.period-switcher-bar .btn-group .btn-outline-secondary:hover {
    color: var(--primary) !important;
    background: var(--primary-light, #f1f5f9) !important;
    border-color: var(--primary-border, #cbd5e1) !important;
}
.period-switcher-bar .btn-group .btn-primary,
.period-switcher-bar .btn-group .btn.active {
    color: #ffffff !important;
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    border-color: var(--primary-dark) !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px var(--primary-ring, rgba(0, 0, 0, 0.15)) !important;
}

.badge.bg-info {
    background-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    border: 1px solid var(--primary-border) !important;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    color: var(--primary-dark);
}

.erp-sidebar {
    background: var(--sidebar-bg, #0b1f2e) !important;
}
.premium-page .erp-sidebar {
    background: var(--sidebar-grad, linear-gradient(165deg, #073834 0%, #0f766e 45%, #042f2b 100%)) !important;
}
.welcome-band {
    background: var(--primary) !important;
}

.accounting-dashboard {
    --danger: #ef4444;
    --success: #008060;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f6f9fb;
    display: block;
    min-height: 820px;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.accounting-main {
    min-width: 0;
    padding: 0;
}

.accounting-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    margin-bottom: 22px;
}

.accounting-header h2 {
    margin: 0 0 6px;
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 0;
}

.accounting-header p {
    margin: 0;
    color: #536176;
    font-weight: 600;
}

.trust-dot {
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 0.8rem;
    vertical-align: middle;
}

.accounting-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.session-picker,
.accounting-profile,
.accounting-btn {
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.session-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: #075985;
    font-weight: 850;
}

.session-picker select {
    border: 0;
    background: transparent;
    color: #0f172a;
    font-weight: 850;
    outline: none;
}

.accounting-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.accounting-avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #008060, var(--primary-dark));
    font-weight: 900;
}

.accounting-profile strong,
.accounting-profile small {
    display: block;
    line-height: 1.2;
}

.accounting-profile small {
    color: var(--muted);
}

.accounting-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    font-weight: 850;
}

.accounting-btn.primary {
    border-color: var(--primary);
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.accounting-btn.secondary {
    color: #075985;
}

.accounting-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.accounting-kpi-card {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 142px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.accounting-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.11);
}

.accounting-kpi-card.income,
.accounting-kpi-card.cash {
    background: linear-gradient(135deg, #ffffff 0%, #f0fff9 100%);
}

.accounting-kpi-card.expense,
.accounting-kpi-card.running-expense {
    background: linear-gradient(135deg, #ffffff 0%, #fff4f4 100%);
}

.accounting-kpi-card.admission,
.accounting-kpi-card.running-income {
    background: linear-gradient(135deg, #ffffff 0%, #f3f9ff 100%);
}

.accounting-kpi-card.outstanding,
.accounting-kpi-card.other {
    background: linear-gradient(135deg, #ffffff 0%, #fff9ef 100%);
}

.kpi-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 1.4rem;
    font-weight: 900;
}

.expense .kpi-icon,
.running-expense .kpi-icon {
    color: #e11d48;
    background: #ffe4e9;
}

.outstanding .kpi-icon {
    color: #ea580c;
    background: #ffedd5;
}

.other .kpi-icon {
    color: #0891b2;
    background: #dff7f7;
}

.admission .kpi-icon {
    color: #2563eb;
    background: #dbeafe;
}

.accounting-kpi-card small {
    color: #334155;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.accounting-kpi-card strong {
    display: block;
    margin: 3px 0 8px;
    color: #0f172a;
    font-size: 1.65rem;
    font-weight: 950;
}

.accounting-kpi-card p {
    margin: 0 0 8px;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 650;
}

.accounting-kpi-card em {
    color: var(--success);
    font-style: normal;
    font-size: 0.83rem;
    font-weight: 850;
}

.expense em,
.other em {
    color: var(--danger);
}

.outstanding em {
    color: #ea580c;
}

.accounting-ledger-card {
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.accounting-ledger-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 16px;
}

.accounting-ledger-head h3 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 950;
}

.accounting-ledger-head h3 span {
    color: #64748b;
    font-size: 0.9rem;
}

.accounting-ledger-head p {
    margin: 0;
    color: #64748b;
    font-weight: 650;
}

.ledger-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.ledger-tools label,
.ledger-search,
.ledger-tools button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.ledger-tools label {
    padding: 0 10px;
}

.ledger-tools label span {
    color: #334155;
    font-weight: 700;
}

.ledger-tools select,
.ledger-search input {
    border: 0;
    background: transparent;
    outline: none;
}

.ledger-search {
    min-width: 300px;
    padding: 0 12px;
}

.ledger-search span {
    color: #64748b;
}

.ledger-tools button {
    padding: 0 16px;
    color: #075985;
    font-weight: 850;
}

.accounting-table-wrap {
    overflow-x: auto;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
}

.accounting-ledger-table {
    width: 100%;
    min-width: 1060px;
    border-collapse: collapse;
    background: #fff;
}

.accounting-ledger-table th {
    padding: 13px 14px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #dbe5ef;
    font-size: 0.73rem;
    font-weight: 900;
    text-transform: uppercase;
}

.accounting-ledger-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2f7;
    color: #102033;
    font-weight: 650;
    vertical-align: middle;
}

.accounting-ledger-table tbody tr:hover {
    background: #f8fffd;
}

.source-chip {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 6px;
    vertical-align: middle;
}

.source-admission { background: #dbeafe; }
.source-fee { background: #dcfce7; }
.source-salary { background: #ffe4e6; }
.source-expense { background: #ffedd5; }
.source-other { background: #e0f2fe; }

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 850;
}

.mode-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-admission { color: #15803d; background: #dcfce7; }
.badge-cheque { color: #2563eb; background: #dbeafe; }
.badge-bank { color: #7c3aed; background: #ede9fe; }
.badge-cash { color: #ea580c; background: #ffedd5; }
.badge-upi { color: #0891b2; background: #cffafe; }
.badge-soft { color: #475569; background: #f1f5f9; }

.ledger-credit {
    color: var(--success) !important;
    font-weight: 950 !important;
}

.ledger-debit {
    color: var(--danger) !important;
    font-weight: 950 !important;
}

.ledger-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
    color: #64748b;
    font-weight: 650;
}

.ledger-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ledger-pages button {
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-weight: 850;
}

.ledger-pages button.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
}

.ledger-pages button:disabled {
    opacity: 0.45;
}

.accounting-history-grid {
    margin-top: 18px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 18px 0;
}

.sale-history-filter {
    width: min(260px, 100%);
}

.sale-history-filter label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 850;
}

.sale-history-filter select {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
}

.inventory-history-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
}

.inventory-history-filters label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 850;
}

.inventory-history-filters select {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
}

.inline-add-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
    align-items: end;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(15, 118, 110, 0.13), rgba(234, 179, 8, 0.12)),
        #eef3f8;
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 46px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(8, 47, 73, 0.92), rgba(15, 118, 110, 0.86)),
        url("data:image/svg+xml,%3Csvg width='920' height='720' viewBox='0 0 920 720' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12' stroke-width='2'%3E%3Cpath d='M40 610 C180 520 260 650 390 545 S620 465 860 565'/%3E%3Cpath d='M70 130 C220 220 330 80 480 180 S690 300 850 170'/%3E%3Cpath d='M130 520 L780 110'/%3E%3Cpath d='M240 650 L870 300'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.16'%3E%3Ccircle cx='170' cy='170' r='64'/%3E%3Ccircle cx='720' cy='510' r='92'/%3E%3Ccircle cx='520' cy='260' r='34'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
}

.brand-mark,
.app-logo span,
.avatar {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    font-weight: 800;
}

.brand-mark {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.brand-mark.logo-brand {
    width: 92px;
    height: 92px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
}

.brand-mark.logo-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-visual .eyebrow {
    color: #fde68a;
}

.auth-visual h1 {
    max-width: 680px;
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.auth-copy {
    max-width: 620px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.04rem;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.feature-grid div {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
}

.feature-grid span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    background:
        radial-gradient(circle at 86% 10%, rgba(20, 184, 166, 0.14), transparent 26%),
        linear-gradient(180deg, #ffffff, #f8fbfd);
}

.mobile-brand {
    display: none;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 18px;
}

.panel-heading h2,
.topbar h1,
.welcome-band h2,
.section-heading h2 {
    margin: 0;
    letter-spacing: 0;
}

.panel-heading h2 {
    font-size: 2rem;
}

.panel-heading p,
.welcome-band p,
.section-heading p,
.module-card p {
    color: var(--muted);
    line-height: 1.6;
}

.alert {
    margin: 24px 0 0;
    padding: 13px 14px;
    color: var(--danger);
    background: #fff1f1;
    border: 1px solid #ffd0d0;
    border-radius: 8px;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 26px;
}

.login-form label {
    color: #344054;
    font-size: 0.92rem;
    font-weight: 800;
}

.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 4px;
    font-size: 0.9rem;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.muted {
    color: var(--muted);
}

button {
    height: 52px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--primary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    background: #94a3b8;
    transform: none;
}

.demo-box {
    display: grid;
    gap: 8px;
    margin-top: 24px;
    padding: 16px;
    border: 1px dashed #b8c3d2;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-panel .panel-heading {
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.login-form button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 16px 34px rgba(0, 121, 107, 0.24);
}

.demo-box code {
    color: var(--ink);
    white-space: normal;
}

.app-page {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    padding: 24px;
    color: #ffffff;
    background: #102a43;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.app-logo span {
    color: #102a43;
    background: #facc15;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.74);
    font-weight: 700;
}

.side-nav a.active,
.side-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.main-area {
    min-width: 0;
    padding: 30px;
}

.topbar,
.welcome-band,
.profile-chip,
.module-card {
    display: flex;
    align-items: center;
}

.topbar {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.topbar h1 {
    font-size: 2rem;
}

.profile-chip {
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.avatar {
    color: #ffffff;
    background: var(--primary);
}

.profile-chip div {
    display: grid;
}

.profile-chip small {
    color: var(--muted);
}

.logout {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-soft, #ccfbf1);
    font-weight: 800;
}

.welcome-band {
    justify-content: space-between;
    gap: 24px;
    padding: 26px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(120deg, var(--primary), #164e63);
}

.welcome-band p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.82);
}

.status-pill,
.module-card span {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 800;
}

.stats-grid,
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.stats-grid article,
.module-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.stats-grid article {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.stats-grid span {
    color: var(--muted);
    font-weight: 700;
}

.stats-grid strong {
    font-size: 2rem;
}

.module-section {
    margin-top: 34px;
}

.module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-card {
    justify-content: space-between;
    gap: 18px;
    min-height: 150px;
    padding: 20px;
}

.module-card h3 {
    margin: 0;
}

.module-card p {
    margin-bottom: 0;
}

.module-card span {
    color: var(--success);
    background: #dcfce7;
}

.module-card.locked {
    opacity: 0.7;
}

.module-card.locked span {
    color: #92400e;
    background: #fef3c7;
}

@media (max-width: 900px) {
    .auth-page {
        padding: 0;
        place-items: stretch;
    }

    .auth-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        box-shadow: none;
    }

    .auth-visual {
        min-height: 320px;
        padding: 28px;
    }

    .auth-visual h1 {
        font-size: 2.35rem;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-panel {
        padding: 32px 24px;
    }

    .mobile-brand {
        display: inline-block;
    }

    .app-page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        padding: 16px;
    }

    .side-nav {
        grid-template-columns: repeat(5, minmax(110px, 1fr));
        overflow-x: auto;
    }

    .main-area {
        padding: 20px;
    }

    .topbar,
    .welcome-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }
}

.sibling-lookup {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #f8fbff;
}

.child-switcher form {
    display: flex;
    justify-content: flex-end;
}

.child-switcher label {
    width: min(420px, 100%);
    font-weight: 700;
    color: #0f172a;
}

.child-switcher select {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

@media (max-width: 560px) {
    .auth-visual {
        min-height: 270px;
    }

    .auth-visual h1 {
        font-size: 2rem;
        line-height: 1.05;
    }

    .auth-copy {
        display: none;
    }

    .feature-grid {
        display: none;
    }

    .form-row,
    .profile-chip,
    .module-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

.erp-page {
    display: block;
    min-height: 100vh;
    background: #eef2f6;
}

.erp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 270px;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px;
    color: #ffffff;
    background: var(--sidebar-grad, linear-gradient(165deg, #073834 0%, var(--primary) 45%, #042f2b 100%));
    scrollbar-width: thin;
    scrollbar-color: rgba(204, 251, 241, 0.5) rgba(255, 255, 255, 0.08);
}

.erp-sidebar::-webkit-scrollbar {
    width: 8px;
}

.erp-sidebar::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.erp-sidebar::-webkit-scrollbar-thumb {
    border: 2px solid rgba(0, 77, 68, 0.72);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(204, 251, 241, 0.9), rgba(94, 234, 212, 0.55));
}

.erp-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffffff, #99f6e4);
}

.erp-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding: 10px 8px;
    border-radius: 14px;
}

.erp-logo img {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    padding: 5px;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
}

.erp-logo .brand-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.erp-nav {
    display: grid;
    gap: 5px;
}

.erp-nav a,
.nav-collapse-btn {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #eafffb;
    background: transparent;
    border: 0;
    font-weight: 750;
    text-align: left;
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-collapse-btn {
    width: 100%;
    font: inherit;
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-grid;
    place-items: center;
}

.nav-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-nav a,
.nav-toggle,
.nav-collapse-btn {
    position: relative;
}

.nav-label {
    min-width: 0;
}

.nav-toggle {
    width: 100%;
    min-height: 42px;
    height: auto;
    margin: 0;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #eafffb;
    background: transparent;
    font: inherit;
    font-weight: 750;
    text-align: left;
}

.nav-toggle:hover,
.nav-toggle.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(2px);
}

.nav-caret {
    font-size: 0.74rem;
    transition: transform 160ms ease;
}

.nav-caret::before {
    content: "v";
}

.nav-group.open .nav-caret {
    transform: rotate(180deg);
}

.nav-group {
    display: grid;
    gap: 6px;
}

.sub-nav {
    display: none;
    gap: 5px;
    margin-left: 33px;
    padding: 4px 0 4px 10px;
    border-radius: 10px;
    background: rgba(0, 77, 68, 0.22);
}

.nav-group.open .sub-nav {
    display: grid;
}

.premium-page .erp-nav .sub-nav a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.86rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.premium-page .erp-nav .sub-nav .nav-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.premium-page .erp-nav .sub-nav .nav-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
}

.premium-page .erp-nav .sub-nav a:hover {
    color: #ffffff;
    border-left-color: #facc15;
}

.erp-nav a.active,
.erp-nav a:hover,
.nav-collapse-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(2px);
}

.sidebar-collapsed .erp-sidebar {
    width: 92px;
    padding: 18px 14px;
}

.sidebar-collapsed .erp-logo {
    justify-content: center;
    padding: 8px 0;
}

.sidebar-collapsed .erp-logo img {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-caret {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed .erp-nav a,
.sidebar-collapsed .nav-toggle,
.sidebar-collapsed .nav-collapse-btn {
    grid-template-columns: 22px;
    justify-content: center;
    justify-items: center;
    gap: 0;
    min-height: 40px;
    padding-inline: 0;
}

.sidebar-collapsed .nav-group {
    gap: 5px;
}

.sidebar-collapsed .nav-group.open .sub-nav {
    width: auto;
    opacity: 1;
    pointer-events: auto;
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    background: transparent;
}

.sidebar-collapsed .premium-page .erp-nav .sub-nav a,
.sidebar-collapsed .erp-nav .sub-nav a {
    grid-template-columns: 18px;
    justify-content: center;
    justify-items: center;
    min-height: 40px;
    padding: 0;
    border-left: 0;
}

.sidebar-collapsed .collapse-symbol {
    transform: rotate(180deg);
}

.erp-sidebar-foot {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
}

.erp-sidebar-foot a,
.erp-sidebar-foot button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 0;
    border-radius: 10px;
    color: #eafffb;
    background: transparent;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.erp-sidebar-foot a:hover,
.erp-sidebar-foot button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(2px);
}

.erp-main {
    position: relative;
    min-width: 0;
    margin-left: 270px;
    padding: 28px;
}

.erp-page.sidebar-collapsed .erp-main {
    margin-left: 92px;
}

.erp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.erp-topbar h1 {
    margin: 0;
    font-size: 2rem;
}

.breadcrumb-line {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.kpi-grid,
.module-kpis,
.content-grid,
.profile-grid {
    display: grid;
    gap: 16px;
}

.kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
}

.module-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.kpi-grid article,
.module-kpis article,
.panel,
.profile-header {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.kpi-grid article,
.module-kpis article {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.kpi-grid span,
.module-kpis span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.kpi-grid strong,
.module-kpis strong {
    font-size: 1.55rem;
}

.content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    margin-top: 20px;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2,
.form-section h3,
.profile-header h2,
.profile-grid h3 {
    margin: 0;
}

.form-section {
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.form-section:first-of-type {
    border-top: 0;
}

.form-grid,
.compact-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-grid label,
.compact-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.compact-form input,
.compact-form select,
.compact-form textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.form-grid textarea,
.compact-form textarea {
    min-height: 90px;
    resize: vertical;
}

.span-2 {
    grid-column: span 2;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.badge-muted {
    background: #eef2f7;
    color: #475569;
}

.badge-success {
    background: #dcfce7;
    color: #047857;
    border-color: #bbf7d0;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.btn-soft,
.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-soft, #ccfbf1);
    font-weight: 800;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 700;
}

.table-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: #075985;
    background: #e0f2fe;
    font-size: 0.82rem;
    font-weight: 800;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    margin-bottom: 18px;
}

.avatar.large {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

.profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

dl {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 16px 0 0;
}

dt {
    color: var(--muted);
    font-weight: 750;
}

dd {
    margin: 0;
}

.timeline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-list span {
    padding: 10px 12px;
    border-radius: 8px;
    color: #334155;
    background: #f1f5f9;
    font-weight: 750;
}

.empty-state {
    padding: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-align: center;
}

.alert-success {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.alert-danger {
    color: var(--danger);
    background: #fff1f1;
    border-color: #ffd0d0;
}

@media (max-width: 1020px) {
    .erp-page {
        grid-template-columns: 1fr;
    }

    .erp-sidebar {
        position: static;
        min-height: auto;
    }

    .erp-nav {
        grid-template-columns: repeat(6, minmax(120px, 1fr));
        overflow-x: auto;
    }

    .kpi-grid,
    .module-kpis,
    .content-grid,
    .profile-grid,
    .form-grid,
    .compact-form {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .erp-main {
        padding: 18px;
    }

    .erp-topbar,
    .profile-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

.premium-page {
    background:
        radial-gradient(circle at 15% 0%, rgba(15, 118, 110, 0.09), transparent 28%),
        radial-gradient(circle at 85% 8%, rgba(234, 179, 8, 0.1), transparent 24%),
        #f4f7fb;
}

.premium-page .erp-sidebar {
    background: var(--sidebar-grad, linear-gradient(165deg, #073834 0%, var(--primary) 45%, #042f2b 100%));
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.13);
}

.erp-logo strong {
    line-height: 1.1;
    color: #ffffff;
}

.erp-logo small {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
}

.premium-page .erp-nav a,
.premium-page .nav-collapse-btn {
    display: grid;
    align-items: center;
    min-height: 42px;
    color: #eafffb;
    border: 1px solid transparent;
}

.premium-page .erp-nav a.active,
.premium-page .erp-nav a:hover,
.premium-page .nav-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.1);
}

.module-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 4px 0 2px;
}

.module-hero h2 {
    max-width: 820px;
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.25;
}

.action-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-cluster > a,
.action-cluster > button,
.action-btn,
.btn-primary-ui,
.btn-ghost {
    box-sizing: border-box !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    font-family: inherit !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.15s ease-in-out !important;
    margin: 0 !important;
}

.action-btn {
    min-width: 80px;
    width: auto;
    max-width: 100%;
    gap: 6px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
}

.action-btn.wide-action {
    min-width: 130px;
    width: auto;
}

.action-primary {
    color: #ffffff !important;
    border: 1.5px solid var(--primary) !important;
    background: var(--primary) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.action-primary:hover,
.action-primary:focus {
    color: #ffffff !important;
    border-color: var(--primary-dark) !important;
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.action-muted,
.action-secondary {
    color: var(--primary) !important;
    border: 1.5px solid var(--primary-border, #cbd5e1) !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.action-muted:hover,
.action-muted:focus,
.action-secondary:hover {
    background: var(--primary-light, #f0fdfa) !important;
    border-color: var(--primary) !important;
    color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
}

.action-danger {
    color: var(--danger) !important;
    border: 1.5px solid #fecdd3 !important;
    background: #fff7f7 !important;
}

.action-danger:hover {
    background: #fee2e2 !important;
    border-color: var(--danger) !important;
    transform: translateY(-1px);
}

.btn-primary-ui {
    border: 1.5px solid var(--primary);
    color: #ffffff;
    background: var(--primary);
}

.btn-ghost {
    border: 1px solid #cbd5e1;
    color: #0f172a;
    background: #ffffff;
}

.kpi-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-tile-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fees-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.two-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fees-kpi-grid .kpi-tile {
    min-height: 112px;
    padding: 14px;
}

.fees-kpi-grid .kpi-tile strong {
    font-size: 1.45rem;
}

.kpi-tile {
    min-height: 132px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    color: #0f172a;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.95));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.kpi-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.12);
}

.kpi-tile strong {
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0;
}

.kpi-tile span {
    color: #334155;
    font-weight: 850;
}

.kpi-tile small {
    color: #64748b;
    font-weight: 700;
}

.dashboard-hero {
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.dashboard-kpi-card {
    min-height: 116px;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 14px;
    padding: 16px 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 251, 0.94)),
        radial-gradient(circle at 12% 20%, rgba(15, 118, 110, 0.1), transparent 26%);
}

.dashboard-kpi-card:nth-child(4n + 2) {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94)),
        radial-gradient(circle at 12% 20%, rgba(37, 99, 235, 0.1), transparent 26%);
}

.dashboard-kpi-card:nth-child(4n + 3) {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 245, 0.94)),
        radial-gradient(circle at 12% 20%, rgba(234, 179, 8, 0.12), transparent 26%);
}

.dashboard-kpi-card:nth-child(4n) {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 248, 0.94)),
        radial-gradient(circle at 12% 20%, rgba(239, 68, 68, 0.09), transparent 26%);
}

.dashboard-kpi-icon {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.dashboard-kpi-card:nth-child(4n + 2) .dashboard-kpi-icon {
    color: #1d4ed8;
    background: #dbeafe;
}

.dashboard-kpi-card:nth-child(4n + 3) .dashboard-kpi-icon {
    color: #a16207;
    background: #fef3c7;
}

.dashboard-kpi-card:nth-child(4n) .dashboard-kpi-icon {
    color: #b91c1c;
    background: #fee2e2;
}

.dashboard-kpi-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-kpi-icon img,
.fee-icon img,
.kpi-image-icon img,
.student-kpi-image-icon img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.dashboard-kpi-icon img {
    width: 42px;
    height: 42px;
}

.dashboard-kpi-card div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.dashboard-kpi-card strong {
    font-size: clamp(1.45rem, 2vw, 1.95rem);
}

.dashboard-kpi-card.multi-value strong {
    font-size: clamp(1.05rem, 1.35vw, 1.35rem);
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-kpi-card span,
.dashboard-kpi-card small {
    line-height: 1.15;
}

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    gap: 16px;
}

.transport-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.two-column-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.accounting-kpis {
    grid-template-columns: repeat(8, minmax(120px, 1fr));
}

.premium-student-table tbody td.money-credit,
.money-credit {
    color: var(--primary) !important;
    font-weight: 850;
}

.premium-student-table tbody td.money-debit,
.money-debit {
    color: #b91c1c !important;
    font-weight: 850;
}

.premium-student-table tbody td.money-credit:not(:empty) {
    background: rgba(15, 118, 110, 0.06);
}

.premium-student-table tbody td.money-debit:not(:empty) {
    background: rgba(185, 28, 28, 0.06);
}

.horizontal-scroll {
    overflow-x: auto;
}

.horizontal-scroll table {
    min-width: 820px;
}

.month-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 16px;
}

.month-switcher strong {
    min-width: 180px;
    text-align: center;
    color: #0f172a;
    font-size: 1.05rem;
}

.attendance-matrix {
    min-width: 1180px;
    font-size: 0.86rem;
}

.attendance-matrix th,
.attendance-matrix td {
    text-align: center;
}

.attendance-matrix th:nth-child(2),
.attendance-matrix td:nth-child(2) {
    min-width: 220px;
    text-align: left;
}

.attendance-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 24px;
    border-radius: 6px;
    color: #64748b;
    background: #f1f5f9;
    font-weight: 850;
}

.attendance-code.marked {
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.slim-progress {
    height: 8px;
    min-width: 120px;
    background: #e2e8f0;
}

.slim-progress .progress-bar {
    background: var(--primary);
}

.curriculum-accordion .accordion-button {
    font-weight: 900;
    color: #0f172a;
    background: #f8fafc;
}

.curriculum-unit {
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.curriculum-unit h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.chapter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
}

.chapter-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subject-row-builder {
    display: grid;
    gap: 10px;
}

.subject-row-list {
    display: grid;
    gap: 8px;
}

.subject-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
}

.subject-row.locked select {
    background: #f8fafc;
    font-weight: 800;
}

.subject-mini-btn,
.subject-add-btn {
    min-width: 44px;
    height: 38px;
    padding: 0;
}

.progress-slider-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
}

.progress-slider-field input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.progress-slider-field output {
    min-width: 54px;
    text-align: right;
    color: #0f172a;
    font-weight: 900;
}

.progress-slider-field small {
    grid-column: 1 / -1;
}

.analytics-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.premium-panel {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.class-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.class-card-grid.slim {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.class-tile {
    display: grid;
    gap: 8px;
    min-height: 108px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.class-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.class-tile strong {
    font-size: 1.05rem;
}

.class-tile span,
.class-tile small {
    color: #64748b;
    font-weight: 750;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.filter-pills a {
    padding: 8px 11px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
}

.filter-pills a.active,
.filter-pills a:hover {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.module-tabs a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 850;
}

.module-tabs a.active,
.module-tabs a:hover {
    color: #ffffff;
    border-color: var(--primary);
    background: var(--primary);
}

.strong-link {
    color: var(--primary);
    font-weight: 850;
}

.table-pill.is-good {
    color: #047857;
    background: #dcfce7;
}

.table-pill.is-warn {
    color: #92400e;
    background: #fef3c7;
}

.table-pill.is-muted {
    color: #475569;
    background: #f1f5f9;
}

.payroll-matrix-table th,
.payroll-matrix-table td {
    min-width: 132px;
}

.payroll-matrix-table th:first-child,
.payroll-matrix-table td:first-child {
    min-width: 220px;
}

.payroll-pending-red,
.kpi-tile .payroll-pending-red,
.premium-student-table .payroll-pending-red {
    color: #dc2626 !important;
}

.payroll-pending-green,
.kpi-tile .payroll-pending-green,
.premium-student-table .payroll-pending-green {
    color: #047857 !important;
}

.payroll-pending-red,
.payroll-pending-green {
    font-weight: 800;
}

.payroll-matrix-table small.payroll-pending-red,
.payroll-matrix-table small.payroll-pending-green {
    display: block;
    margin-top: 4px;
}

body.erp-page.sidebar-collapsed .erp-nav {
    display: grid;
    gap: 5px;
    overflow: visible;
}

body.erp-page.sidebar-collapsed .nav-group {
    position: static;
    display: grid;
    gap: 5px;
}

body.erp-page.sidebar-collapsed .erp-nav > a,
body.erp-page.sidebar-collapsed .nav-toggle,
body.erp-page.sidebar-collapsed .nav-collapse-btn,
body.erp-page.sidebar-collapsed .erp-nav .sub-nav a {
    width: 100%;
    min-width: 0;
    height: 47px;
    min-height: 47px;
    max-height: 47px;
    padding: 0;
    display: grid;
    grid-template-columns: 22px;
    place-items: center;
    gap: 0;
}

body.erp-page.sidebar-collapsed .sub-nav {
    position: static;
    display: none;
    min-width: 0;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.erp-page.sidebar-collapsed .nav-group.open .sub-nav {
    display: grid;
}

body.erp-page.sidebar-collapsed .erp-nav .sub-nav .nav-icon {
    width: 22px;
    height: 22px;
}

body.erp-page.sidebar-collapsed .erp-nav .sub-nav .nav-icon svg {
    width: 21px;
    height: 21px;
}

body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    z-index: 3000;
    min-width: max-content;
    max-width: 230px;
    padding: 8px 11px;
    border-radius: 9px;
    color: #eafffb;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
    opacity: 0;
    pointer-events: none;
    transform: translate(4px, -50%);
    transition: opacity 130ms ease, transform 130ms ease;
}

body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    z-index: 3001;
    width: 8px;
    height: 8px;
    background: rgba(15, 23, 42, 0.96);
    opacity: 0;
    pointer-events: none;
    transform: translate(4px, -50%) rotate(45deg);
    transition: opacity 130ms ease, transform 130ms ease;
}

body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]:hover::after,
body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]:focus-visible::after,
body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]:hover::before,
body.erp-page.sidebar-collapsed .erp-nav [data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translate(0, -50%);
}

.compact-table {
    font-size: 0.92rem;
}

.drill-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.premium-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

.attendance-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.attendance-toolbar label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 800;
}

.status-select,
.inline-input,
.attendance-toolbar select,
.attendance-toolbar input {
    min-height: 40px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 8px 10px;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.shortcut-grid a {
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    font-weight: 850;
}

.students-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.student-table-tools {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.student-result-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 9px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    color: #334155;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.student-result-count strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.student-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 140px 130px 145px 160px 150px 150px 118px;
    gap: 10px;
}

.staff-filter-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 170px 140px 150px 150px 118px;
    gap: 10px;
}

.student-filter-form input,
.student-filter-form select,
.staff-filter-form input,
.staff-filter-form select {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
}

.premium-table-wrap {
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    overflow: hidden;
}

.premium-table-wrap.horizontal-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.premium-table-wrap .dt-container {
    padding: 0;
}

.premium-table-wrap .dt-layout-row {
    padding: 10px 12px;
    margin: 0;
}

.premium-table-wrap .dt-scroll {
    width: 100%;
}

.premium-table-wrap .dt-scroll-body {
    border-bottom: 1px solid #dbe3ee;
}

.premium-student-table {
    margin: 0;
    background: #ffffff;
}

.premium-student-table thead th {
    padding: 14px 12px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #dbe3ee;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.premium-student-table tbody td {
    padding: 13px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.premium-student-table tbody tr:hover {
    background: #f8fafc;
}

.clickable-table tbody tr {
    cursor: pointer;
}

.clickable-table tbody tr:hover {
    background: #ecfdf5;
}

.student-name-link {
    display: block;
    color: #020617;
    font-weight: 900;
}

.premium-student-table small {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.address-check {
    align-content: center;
}

textarea[readonly] {
    background: #f8fafc;
}

.transport-months {
    display: grid;
    gap: 8px;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 800;
}

.month-check-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.month-check-grid label {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    font-weight: 750;
}

.switch-row input[type="checkbox"],
.month-check-grid input[type="checkbox"],
.check input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    flex: 0 0 13px;
    accent-color: var(--primary);
}

.inline-delete-form {
    margin: 0;
}

.fee-student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.fee-student-header h2 {
    margin: 6px 0;
}

.action-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.exam-placeholder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.exam-placeholder-list span {
    display: inline-flex;
    padding: 9px 11px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    color: #334155;
    background: #f8fafc;
    font-weight: 800;
}

.exam-status-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.exam-status-form .status-select {
    min-width: 132px;
}

.marks-max-field {
    max-width: 220px;
    display: grid;
    gap: 6px;
    color: #334155;
    font-weight: 800;
}

.marks-max-field input {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
}

.profile-header .action-cluster {
    align-items: center;
}

.profile-header .action-btn,
.profile-header .inline-delete-form .action-btn {
    min-width: 80px; width: auto;
    height: 42px;
}

@media (max-width: 1180px) {
    .kpi-tile-grid,
    .analytics-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .transport-split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .module-hero,
    .drill-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .kpi-tile-grid,
    .kpi-tile-grid.compact,
    .class-card-grid,
    .class-card-grid.slim,
    .attendance-toolbar,
    .shortcut-grid,
    .student-filter-form,
    .staff-filter-form {
        grid-template-columns: 1fr;
    }

    .month-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpi-tile {
        min-height: 116px;
    }
}

/* Exam card typography refinement */
.student-portal-page:not(.teacher-portal-page) .parent-results-panel,
.student-portal-page:not(.teacher-portal-page) .parent-result-card {
    font-family: Inter, "Segoe UI", sans-serif;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card {
    border-radius: 16px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
    grid-template-columns: 64px minmax(150px, 1fr) minmax(150px, 0.85fr) minmax(110px, 0.65fr) minmax(96px, 0.55fr) 22px;
    gap: 16px;
    min-height: 136px;
    padding: 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
    padding-left: 16px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-icon img {
    width: 42px;
    height: 42px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title h3 {
    margin-bottom: 8px;
    color: #0F172A;
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: -0.3px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title p {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748B;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title p::before {
    content: "";
    width: 16px;
    height: 16px;
    opacity: 0.8;
    background-color: #64748B;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric {
    gap: 6px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks strong {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    line-height: 1;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
    color: #0F172A;
    font-size: 34px;
    font-weight: 700;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash {
    color: #94A3B8;
    font-size: 30px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total {
    color: #64748B;
    font-size: 30px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric small {
    color: #64748B;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-percent strong {
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
    line-height: 36px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade {
    gap: 7px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
    min-width: 72px;
    padding: 12px 18px;
    border-radius: 18px;
    color: var(--primary);
    background: #DFF7EF;
    font-size: 30px;
    font-weight: 700;
    line-height: 32px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
    display: grid;
    gap: 1px;
    color: #0F172A;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span em {
    color: #64748B;
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
    line-height: 17px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span b {
    color: #0F172A;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks i {
    margin-top: 6px;
    height: 8px;
}

.student-portal-page:not(.teacher-portal-page) .result-chevron {
    color: #0F172A;
    font-size: 34px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail {
    gap: 14px;
    padding: 0 18px 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span {
    min-height: 50px;
    padding: 8px 0;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head i {
    width: 28px;
    height: 28px;
    color: #15803D;
    background: #DCFCE7;
    font-size: 13px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head em {
    color: #64748B;
    font-size: 15px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b {
    color: #0F172A;
    font-size: 15px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span:first-child b {
    padding: 5px 10px;
    border-radius: 999px;
    color: #15803D;
    background: #DCFCE7;
    font-size: 13px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-highlight-title {
    color: #0F172A;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-grid {
    gap: 8px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    min-height: 52px;
    padding: 12px;
    border-radius: 12px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span {
    color: #0F172A;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    color: #0F172A;
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small {
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
}

/* Parent exam card final cascade */
.student-portal-page:not(.teacher-portal-page),
.student-portal-page:not(.teacher-portal-page) .portal-panel { font-family: Inter, "Segoe UI", sans-serif; }
.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .parent-result-card-summary { cursor: default; }
.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .result-chevron { display: none; }
.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained { color: var(--primary); }
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card { grid-template-columns: 1fr minmax(90px, auto) minmax(54px, auto); }
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong { justify-self: center; text-align: center; }

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas: "icon title chevron" "marks percent grade";
        grid-template-columns: 44px minmax(0, 1fr) 18px;
        gap: 12px 10px;
        padding: 14px;
    }
    .student-portal-page:not(.teacher-portal-page) .parent-result-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-icon img { width: 34px; height: 34px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title { grid-area: title; min-width: 0; }
    .student-portal-page:not(.teacher-portal-page) .result-chevron { grid-area: chevron; align-self: center; font-size: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks { grid-area: marks; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent { grid-area: percent; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade { grid-area: grade; grid-column: auto; display: grid; justify-items: center; text-align: center; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * { border-left: 0; padding-left: 0; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title h3 { font-size: 18px; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title p { font-size: 12px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained { font-size: 20px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total { font-size: 17px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong { font-size: 20px; line-height: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong { min-width: 48px; padding: 7px 10px; border-radius: 13px; font-size: 19px; line-height: 22px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span em { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b { font-size: 13px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-metric small { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks i { height: 5px; margin-top: 2px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card { grid-template-columns: 1fr minmax(76px, auto) minmax(42px, auto); gap: 8px; padding: 10px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span { font-size: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong { grid-column: auto; font-size: 16px; line-height: 20px; justify-self: center; text-align: center; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small { grid-column: auto; font-size: 12px; text-align: right; }
}

/* Parent portal result page polish */
.student-portal-page:not(.teacher-portal-page),
.student-portal-page:not(.teacher-portal-page) .portal-panel,
.student-portal-page:not(.teacher-portal-page) .parent-profile-sheet {
    font-family: Inter, "Segoe UI", sans-serif;
}

.student-portal-page:not(.teacher-portal-page) h1,
.student-portal-page:not(.teacher-portal-page) h2,
.student-portal-page:not(.teacher-portal-page) h3 {
    letter-spacing: -0.02em;
}

.student-portal-page:not(.teacher-portal-page) .portal-panel h2 {
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .eyebrow,
.student-portal-page:not(.teacher-portal-page) .muted,
.student-portal-page:not(.teacher-portal-page) small {
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .parent-result-card-summary {
    cursor: default;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .result-chevron {
    display: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
    color: var(--primary);
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    grid-template-columns: 1fr minmax(90px, auto) minmax(54px, auto);
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    justify-self: center;
    text-align: center;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas:
            "icon title chevron"
            "marks percent grade";
        grid-template-columns: 44px minmax(0, 1fr) 18px;
        gap: 12px 10px;
        padding: 14px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon {
        grid-area: icon;
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon img {
        width: 34px;
        height: 34px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title {
        grid-area: title;
        min-width: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title h3 {
        margin-bottom: 4px;
        font-size: 18px;
        line-height: 23px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title p {
        font-size: 12px;
        line-height: 16px;
    }

    .student-portal-page:not(.teacher-portal-page) .result-chevron {
        grid-area: chevron;
        align-self: center;
        font-size: 24px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks {
        grid-area: marks;
        grid-column: auto;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-percent {
        grid-area: percent;
        grid-column: auto;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        grid-area: grade;
        grid-column: auto;
        display: grid;
        justify-items: center;
        text-align: center;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
        border-left: 0;
        padding-left: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
        font-size: 20px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total {
        font-size: 17px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong {
        font-size: 20px;
        line-height: 24px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
        min-width: 48px;
        padding: 7px 10px;
        border-radius: 13px;
        font-size: 19px;
        line-height: 22px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span em {
        font-size: 11px;
        line-height: 14px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b {
        font-size: 13px;
        line-height: 16px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-metric small {
        font-size: 11px;
        line-height: 14px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks i {
        height: 5px;
        margin-top: 2px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
        grid-template-columns: 1fr minmax(76px, auto) minmax(42px, auto);
        gap: 8px;
        min-height: 48px;
        padding: 10px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span {
        font-size: 13px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
        grid-column: auto;
        font-size: 16px;
        line-height: 20px;
        justify-self: center;
        text-align: center;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small {
        grid-column: auto;
        font-size: 12px;
        text-align: right;
    }
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-columns: 56px 1fr 20px;
        gap: 12px;
        padding: 18px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title h3 {
        font-size: 22px;
        line-height: 28px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent,
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        grid-column: 1 / -1;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent,
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
        justify-self: end;
        grid-row: 1 / span 2;
        grid-column: 2;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
        grid-column: 1;
        justify-self: start;
        text-align: left;
    }
}

.student-portal-page {
    min-height: 100vh;
    color: #172033;
    background:
        radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.14), transparent 26%),
        radial-gradient(circle at 90% 8%, rgba(234, 179, 8, 0.14), transparent 22%),
        linear-gradient(180deg, #f7fafc 0%, #eef3f8 100%);
}

.portal-topbar,
.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}

.portal-module-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 18px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.portal-module-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 999px;
    color: #0f2742;
    background: #f8fafc;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.portal-module-nav a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.portal-module-nav::-webkit-scrollbar {
    height: 6px;
}

.portal-module-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 121, 107, 0.36);
}

.portal-brand,
.portal-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 999px;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.portal-brand strong,
.portal-brand small {
    display: block;
}

.portal-brand strong {
    font-size: 1.02rem;
}

.portal-brand small,
.portal-user span {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 750;
}

.portal-user a,
.portal-hero-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #d9e0ea;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary);
    font-weight: 850;
}

.portal-shell {
    padding-bottom: 34px;
}

.portal-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 28px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 14px;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(13, 31, 45, 0.96), rgba(15, 118, 110, 0.9)),
        linear-gradient(90deg, rgba(234, 179, 8, 0.2), transparent);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

.portal-student-card {
    display: flex;
    align-items: center;
    gap: 18px;
}

.portal-avatar {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    color: #0d1f2d;
    background: #facc15;
    font-size: 2.1rem;
    font-weight: 950;
}

.portal-hero .eyebrow {
    color: #fde68a;
}

.portal-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
}

.portal-meta,
.portal-hero-actions,
.subject-cloud,
.attendance-rings,
.fee-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-meta span {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.86rem;
    font-weight: 800;
}

.portal-hero-actions a {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
}

.portal-kpis,
.portal-grid {
    display: grid;
    gap: 16px;
}

.portal-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.portal-kpis article,
.portal-panel,
.portal-empty {
    border: 1px solid #dce4ee;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.portal-kpis article {
    display: grid;
    gap: 8px;
    min-height: 138px;
    padding: 18px;
}

.portal-kpis span,
.fee-stack span {
    color: #667085;
    font-size: 0.84rem;
    font-weight: 850;
}

.portal-kpis strong {
    font-size: 1.65rem;
    line-height: 1.1;
}

.portal-kpis small {
    color: #667085;
    font-weight: 750;
}

.portal-kpis .is-due strong {
    color: #b42318;
}

.portal-kpis .is-clear strong {
    color: #047857;
}

.portal-meter {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5edf5;
}

.portal-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #22c55e);
}

.portal-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 16px;
}

.portal-panel {
    padding: 20px;
}

.portal-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.portal-panel-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.portal-panel-head > strong {
    color: var(--primary);
    font-size: 1.45rem;
}

.portal-profile-list {
    grid-template-columns: 120px minmax(0, 1fr);
}

.class-teacher-band {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 10px;
    background: #f1f8f7;
}

.class-teacher-band span,
.class-teacher-band small {
    color: #667085;
    font-weight: 800;
}

.class-teacher-band strong {
    font-size: 1.6rem;
}

.subject-cloud span {
    display: inline-flex;
    padding: 9px 12px;
    border-radius: 999px;
    color: #0d1f2d;
    background: #fff7cc;
    font-weight: 850;
}

.attendance-rings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.attendance-rings div {
    display: grid;
    place-items: center;
    min-height: 94px;
    border-radius: 12px;
    background: #f6f8fb;
}

.attendance-rings strong {
    font-size: 1.45rem;
}

.attendance-rings span {
    color: #667085;
    font-size: 0.82rem;
    font-weight: 850;
}

.portal-mini-table {
    display: grid;
    gap: 8px;
}

.portal-mini-table div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    background: #f8fafc;
}

.portal-mini-table b {
    min-width: 82px;
    padding: 5px 8px;
    border-radius: 999px;
    text-align: center;
    font-size: 0.78rem;
}

.portal-mini-table .ok {
    color: #047857;
    background: #dcfce7;
}

.portal-mini-table .bad {
    color: #b42318;
    background: #fee2e2;
}

.portal-mini-table .warn {
    color: #92400e;
    background: #fef3c7;
}

.portal-mini-table .soft {
    color: #075985;
    background: #e0f2fe;
}

.fee-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.fee-stack div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
}

.fee-stack strong {
    font-size: 1.15rem;
}

.fee-meter i {
    background: linear-gradient(90deg, #2563eb, var(--primary));
}

.portal-wide-panel {
    margin-bottom: 20px;
}

.portal-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 60px;
    padding: 52px 24px;
    text-align: center;
}

.portal-empty img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

@media (max-width: 980px) {
    .portal-hero,
    .portal-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-kpis,
    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .portal-topbar,
    .portal-shell {
        width: min(100% - 22px, 1180px);
    }

    .portal-student-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-kpis,
    .portal-grid,
    .attendance-rings,
    .fee-stack {
        grid-template-columns: 1fr;
    }

    .portal-profile-list {
        grid-template-columns: 1fr;
    }
}

/* Responsive consolidation layer */
img,
svg,
canvas {
    max-width: 100%;
}

/* Shared student attendance calendar */
.portal-attendance-calendar-panel {
    grid-column: 1 / -1;
}

.attendance-calendar-shell {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
    display: grid;
    gap: 16px;
}

.attendance-calendar-shell.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.attendance-calendar-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.attendance-summary-card {
    min-width: 0;
    min-height: 74px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 13px 15px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.attendance-summary-card > span {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 0.82rem;
    font-weight: 900;
}

.attendance-summary-card div {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.attendance-summary-card strong {
    color: #10233d;
    font-size: 1.24rem;
    line-height: 1.05;
}

.attendance-summary-card small {
    color: currentColor;
    font-size: 0.78rem;
    font-weight: 750;
    opacity: 0.82;
}

.attendance-summary-card.status-present { color: #15803d; border-color: #bbf7d0; background: #dcfce7; }
.attendance-summary-card.status-absent { color: #dc2626; border-color: #fecaca; background: #fee2e2; }
.attendance-summary-card.status-leave { color: #b45309; border-color: #fde68a; background: #fef3c7; }
.attendance-summary-card.status-holiday { color: #7e22ce; border-color: #e9d5ff; background: #f3e8ff; }
.attendance-summary-card.status-half-day { color: #1d4ed8; border-color: #bfdbfe; background: #dbeafe; }

.attendance-summary-card.status-present strong,
.attendance-summary-card.status-absent strong,
.attendance-summary-card.status-leave strong,
.attendance-summary-card.status-holiday strong,
.attendance-summary-card.status-half-day strong {
    color: currentColor;
}

.attendance-average-pill {
    align-items: center;
    aspect-ratio: 1;
    background: var(--primary-soft, #ccfbf1);
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 900;
    justify-content: center;
    min-width: 54px;
    padding: 8px;
    text-align: center;
}

.attendance-calendar-card {
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: #f8fafc;
    background: #14252a;
    box-shadow: 0 18px 42px rgba(10, 30, 34, 0.22);
}

.attendance-calendar-header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.attendance-calendar-header div {
    text-align: center;
}

.attendance-calendar-header p {
    margin: 0 0 2px;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.attendance-calendar-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
}

.attendance-month-nav {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    font-size: 1.8rem;
    line-height: 1;
    text-decoration: none;
    transition: 160ms ease;
}

.attendance-month-nav:hover {
    color: #fff;
    border-color: rgba(45, 212, 191, 0.55);
    background: rgba(20, 184, 166, 0.22);
}

.attendance-month-nav.is-disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.attendance-weekdays,
.attendance-date-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.attendance-weekdays {
    margin-bottom: 8px;
}

.attendance-weekdays span {
    padding: 7px 2px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 850;
    text-align: center;
}

.attendance-date-tile {
    position: relative;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.13);
    transition: transform 150ms ease, border-color 150ms ease, filter 150ms ease;
}

.attendance-date-tile:not(.is-outside):hover {
    z-index: 1;
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.attendance-date-number {
    font-size: 0.9rem;
    font-weight: 900;
}

.attendance-date-tile.status-present { color: #dcfce7; border-color: rgba(34, 197, 94, 0.34); background: #17653b; }
.attendance-date-tile.status-absent { color: #fee2e2; border-color: rgba(248, 113, 113, 0.42); background: #9f2f36; }
.attendance-date-tile.status-leave { color: #fef3c7; border-color: rgba(251, 191, 36, 0.42); background: #8a5a16; }
.attendance-date-tile.status-holiday { color: #f3e8ff; border-color: rgba(192, 132, 252, 0.42); background: #63338a; }
.attendance-date-tile.status-half-day { color: #dbeafe; border-color: rgba(96, 165, 250, 0.42); background: #285e9b; }

.attendance-date-tile.is-today {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.42), 0 0 20px rgba(255, 255, 255, 0.24);
}

.attendance-date-tile.is-outside {
    opacity: 0.2;
    box-shadow: none;
}

.attendance-date-tile.is-future:not(.status-holiday) {
    opacity: 0.55;
}

.attendance-calendar-empty {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 10px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
}

.attendance-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 14px;
}

.attendance-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.73rem;
    font-weight: 700;
}

.attendance-calendar-legend b {
    min-width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.65rem;
}

.attendance-calendar-legend .status-present b { background: #15803d; }
.attendance-calendar-legend .status-absent b { background: #dc2626; }
.attendance-calendar-legend .status-leave b { background: #d97706; }
.attendance-calendar-legend .status-holiday b { background: #7e22ce; }
.attendance-calendar-legend .status-half-day b { background: #2563eb; }

.attendance-view-toggle {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
}

.attendance-view-toggle button {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    color: #cbd5e1;
    background: transparent;
    font-weight: 800;
}

.attendance-view-toggle button.active {
    color: #12302f;
    background: var(--primary-soft, #ccfbf1);
}

.attendance-list-view {
    display: none;
    gap: 7px;
}

.attendance-list-row {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(90px, auto);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.055);
    text-align: left;
}

.attendance-list-row small { color: #cbd5e1; text-align: right; }

@media (max-width: 1023px) {
    .attendance-calendar-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .attendance-date-tile {
        padding: 8px;
        border-radius: 15px;
    }
}

@media (max-width: 767px) {
    .attendance-calendar-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .attendance-calendar-card {
        padding: 12px;
        border-radius: 14px;
    }

    .attendance-view-toggle {
        display: grid;
    }

    .attendance-calendar-view:not(.active),
    .attendance-list-view:not(.active) {
        display: none;
    }

    .attendance-list-view.active {
        display: grid;
    }

    .attendance-weekdays,
    .attendance-date-grid {
        gap: 4px;
    }

    .attendance-weekdays span {
        font-size: 0.62rem;
    }

    .attendance-date-tile {
        min-height: 0;
        padding: 6px;
        border-radius: 11px;
    }

    .attendance-date-number {
        font-size: 0.7rem;
    }

}

@media (max-width: 390px) {
    .attendance-summary-card {
        min-height: 66px;
        padding: 10px 12px;
    }

    .attendance-calendar-header {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
    }

    .attendance-month-nav {
        width: 42px;
        height: 42px;
    }
}

.login-form input[type="text"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.premium-table-wrap,
.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.premium-student-table {
    min-width: max-content;
}

.premium-table-wrap .dt-layout-row,
.premium-table-wrap .dt-layout-cell {
    gap: 10px;
}

.premium-table-wrap .dt-length,
.premium-table-wrap .dt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-dialog {
    max-width: min(920px, calc(100% - 24px));
    margin-right: auto;
    margin-left: auto;
}

.modal {
    z-index: 5000;
}

.modal-backdrop {
    z-index: 4990;
}

.modal-body {
    max-height: min(76vh, 820px);
    overflow-y: auto;
}

@media (min-width: 1360px) {
    .erp-main {
        padding: 34px;
    }

    .kpi-tile-grid:not(.fees-kpi-grid):not(.compact):not(.two-kpi-grid) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .erp-sidebar {
        width: 244px;
        padding: 18px;
    }

    .erp-main {
        margin-left: 244px;
        padding: 24px;
    }

    .erp-page.sidebar-collapsed .erp-main {
        margin-left: 92px;
    }

    .fees-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .student-filter-form,
    .staff-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .month-check-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .accounting-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .erp-page {
        display: block;
    }

    .erp-sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 14px 16px;
    }

    .erp-main,
    .erp-page.sidebar-collapsed .erp-main {
        margin-left: 0;
    }

    .erp-logo {
        margin-bottom: 12px;
    }

    .erp-logo img {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .erp-logo small {
        display: none;
    }

    .erp-nav {
        display: flex;
        gap: 8px;
        padding-bottom: 4px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .erp-nav > a,
    .nav-toggle {
        min-width: max-content;
        min-height: 40px;
        padding: 9px 12px;
        white-space: nowrap;
    }

    .nav-group {
        position: relative;
        display: block;
        flex: 0 0 auto;
    }

    .sub-nav {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 40;
        min-width: 230px;
        margin-left: 0;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        background: var(--primary-dark);
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
    }

    .premium-page .erp-nav .sub-nav a {
        border-left: 0;
    }

    .erp-main {
        padding: 22px;
    }

    .erp-topbar {
        align-items: flex-start;
    }

    .erp-topbar h1 {
        font-size: 1.65rem;
    }

    .profile-chip {
        align-self: flex-start;
    }

    .module-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-hero h2 {
        font-size: 1.45rem;
    }

    .accounting-dashboard {
        display: block;
        margin: 0;
    }

    .erp-sidebar-foot {
        display: none;
    }

    .accounting-main {
        padding: 18px;
    }

    .accounting-header,
    .accounting-ledger-head {
        grid-template-columns: 1fr;
    }

    .accounting-header-actions,
    .ledger-tools {
        justify-content: flex-start;
    }

    .ledger-search {
        min-width: min(100%, 300px);
    }

    .action-cluster {
        width: 100%;
    }

    .action-btn,
    .action-btn.wide-action,
    .btn-primary-ui,
    .btn-ghost {
        width: auto;
        min-min-width: 80px; width: auto;
    }

    .analytics-grid,
    .analytics-grid.three,
    .transport-split-grid,
    .two-column-grid,
    .content-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .class-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .compact-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-2 {
        grid-column: span 2;
    }

    .attendance-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-table-tools {
        gap: 10px;
    }
}

@media (max-width: 760px) {
    .auth-page {
        padding: 14px;
        place-items: stretch;
    }

    .auth-shell {
        min-height: auto;
        border-radius: 12px;
    }

    .auth-visual,
    .auth-panel {
        padding: 24px;
    }

    .brand-mark.logo-brand {
        width: 72px;
        height: 72px;
    }

    .auth-visual h1 {
        font-size: 2.15rem;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-main {
        padding: 18px 14px;
    }

    .erp-topbar {
        flex-direction: column;
        gap: 12px;
    }

    .breadcrumb-line {
        font-size: 0.78rem;
    }

    .profile-chip {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    .kpi-tile-grid,
    .fees-kpi-grid,
    .two-kpi-grid,
    .kpi-tile-grid.compact,
    .module-kpis,
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi-tile,
    .fees-kpi-grid .kpi-tile {
        min-height: 112px;
        padding: 14px;
    }

    .kpi-tile strong,
    .fees-kpi-grid .kpi-tile strong {
        font-size: 1.42rem;
    }

    .kpi-tile span {
        font-size: 0.9rem;
    }

    .panel,
    .premium-panel,
    .profile-header {
        padding: 16px;
    }

    .profile-header,
    .fee-student-header,
    .students-action-bar,
    .portal-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-header .action-cluster,
    .fee-student-header .action-cluster {
        width: 100%;
    }

    .profile-header .action-btn,
    .profile-header .inline-delete-form,
    .profile-header .inline-delete-form .action-btn,
    .action-cluster .action-btn,
    .action-cluster .btn-primary-ui,
    .action-cluster .btn-ghost {
        width: 100%;
    }

    .inline-delete-form {
        display: block;
    }

    .student-filter-form,
    .staff-filter-form,
    .attendance-toolbar,
    .form-grid,
    .compact-form {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .student-result-count {
        width: 100%;
        justify-content: center;
    }

    .class-card-grid,
    .class-card-grid.slim,
    .shortcut-grid {
        grid-template-columns: 1fr;
    }

    .month-switcher {
        gap: 8px;
    }

    .month-switcher strong {
        min-width: 0;
        flex: 1;
    }

    .month-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-row,
    .chapter-progress {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .progress-slider-field {
        grid-template-columns: 1fr;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 5px 0;
    }

    dd {
        margin-bottom: 8px;
    }

    .modal-dialog {
        max-width: calc(100% - 14px);
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal-footer .action-btn {
        width: 100%;
    }

    .premium-table-wrap .dt-layout-row {
        display: grid;
        gap: 8px;
    }

    .premium-table-wrap .dt-layout-cell,
    .premium-table-wrap .dt-search input,
    .premium-table-wrap .dt-length select {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .auth-visual {
        min-height: auto;
    }

    .feature-grid,
    .auth-copy {
        display: none;
    }

    .panel-heading h2 {
        font-size: 1.55rem;
    }

    .form-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .demo-box {
        font-size: 0.84rem;
    }

    .erp-sidebar {
        padding: 12px;
    }

    .erp-nav > a,
    .nav-toggle {
        font-size: 0.86rem;
    }

    .erp-main {
        padding: 16px 10px;
    }

    .module-hero h2 {
        font-size: 1.24rem;
    }

    .section-heading h2,
    .portal-panel-head h2 {
        font-size: 1.08rem;
    }

    .kpi-tile-grid,
    .fees-kpi-grid,
    .two-kpi-grid,
    .kpi-tile-grid.compact,
    .module-kpis,
    .kpi-grid,
    .portal-kpis,
    .portal-grid,
    .attendance-rings,
    .fee-stack {
        grid-template-columns: 1fr;
    }

    .kpi-tile,
    .fees-kpi-grid .kpi-tile {
        min-height: 96px;
    }

    .action-cluster {
        display: grid;
        grid-template-columns: 1fr;
    }

    .month-check-grid {
        grid-template-columns: 1fr;
    }

    .portal-topbar {
        flex-direction: column;
    }

    .portal-user {
        width: 100%;
        justify-content: space-between;
    }

    .portal-hero {
        padding: 20px;
    }

    .portal-hero h1 {
        font-size: 2rem;
    }

    .portal-hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .portal-hero-actions a {
        width: 100%;
    }

    .portal-avatar {
        width: 64px;
        height: 64px;
        border-radius: 16px;
        font-size: 1.7rem;
    }

    .portal-panel {
        padding: 16px;
    }

    .portal-meta {
        gap: 7px;
    }

    .portal-meta span {
        width: 100%;
        justify-content: center;
    }

    .sibling-lookup {
        grid-template-columns: 1fr;
    }

    .accounting-kpi-grid {
        grid-template-columns: 1fr;
    }

    .accounting-kpi-card {
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 18px;
    }

    .kpi-icon {
        width: 48px;
        height: 48px;
    }

    .ledger-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .accounting-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .accounting-btn,
    .session-picker,
    .accounting-profile {
        width: 100%;
    }
}

/* Production UI polish layer */
:root {
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fbfd;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #d9e4ef;
    --primary: var(--primary);
    --primary-dark: var(--primary-dark);
    --primary-soft: #dff8f2;
    --accent: #f59e0b;
    --accent-soft: #fff4d8;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --success: #047857;
    --success-soft: #dcfce7;
    --info: #2563eb;
    --info-soft: #dbeafe;
    --purple: #7c3aed;
    --purple-soft: #ede9fe;
    --radius: 8px;
    --radius-sm: 8px;
    --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 24px 54px rgba(15, 23, 42, 0.13);
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(15, 118, 110, 0.12), transparent 30%),
        radial-gradient(circle at 92% 2%, rgba(245, 158, 11, 0.12), transparent 28%),
        linear-gradient(180deg, #f7fbfd 0%, #eef4f8 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.erp-main {
    padding: 24px 28px 32px;
}

.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -24px -28px 24px;
    padding: 18px 28px;
    border-bottom: 1px solid rgba(217, 228, 239, 0.74);
    background: rgba(247, 251, 253, 0.82);
    backdrop-filter: blur(18px);
}

.erp-topbar h1 {
    color: #09233f;
    font-size: clamp(1.65rem, 2.3vw, 2.35rem);
    font-weight: 900;
    letter-spacing: 0;
}

.breadcrumb-line {
    margin-bottom: 4px;
    color: #52637a;
    font-weight: 800;
}

.profile-chip {
    gap: 12px;
    min-height: 56px;
    padding: 8px 10px;
    border: 1px solid rgba(217, 228, 239, 0.94);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.session-switcher {
    display: inline-grid;
    grid-template-columns: auto minmax(132px, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 56px;
    padding: 8px 10px 8px 14px;
    border: 1px solid rgba(217, 228, 239, 0.94);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.session-switcher label {
    margin: 0;
    color: #52637a;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.session-switcher select {
    min-height: 38px;
    padding: 7px 30px 7px 10px;
    border: 1px solid #d5e1ec;
    border-radius: var(--radius-sm);
    color: #0f172a;
    background: #ffffff;
    font-weight: 900;
}

.session-switcher select:focus {
    border-color: rgba(15, 118, 110, 0.52);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    outline: none;
}

.profile-chip .avatar {
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), #0d9488);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.logout {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: #075e55;
    background: linear-gradient(135deg, #dff8f2, #c9fbef);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
}

.premium-page .erp-sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.18), transparent 26%),
        linear-gradient(165deg, #075e55 0%, var(--primary) 46%, #043c36 100%);
}

.erp-logo {
    margin-bottom: 20px;
}

.premium-page .erp-nav a,
.premium-page .nav-toggle,
.premium-page .nav-collapse-btn {
    border-radius: var(--radius-sm);
    color: rgba(239, 255, 251, 0.9);
}

.premium-page .erp-nav a.active,
.premium-page .erp-nav a:hover,
.premium-page .nav-toggle:hover,
.premium-page .nav-toggle.active,
.premium-page .nav-collapse-btn:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: inset 3px 0 0 rgba(253, 230, 138, 0.92);
}

.nav-icon {
    opacity: 0.96;
}

.module-hero {
    align-items: center;
    min-height: 96px;
    margin-bottom: 22px;
    padding: 20px 22px;
    border: 1px solid rgba(217, 228, 239, 0.9);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 250, 248, 0.92)),
        radial-gradient(circle at 92% 20%, rgba(15, 118, 110, 0.09), transparent 28%);
    box-shadow: var(--shadow-card);
}

.module-hero .eyebrow,
.section-heading .eyebrow,
.modal-header .eyebrow {
    color: var(--primary);
    letter-spacing: 0.04em;
}

.module-hero h2 {
    color: #102033;
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 900;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.section-heading h2,
.panel-heading h2 {
    color: #102033;
    font-weight: 900;
}

.section-heading p,
.panel-heading p {
    color: #64748b;
    font-weight: 650;
}

.panel,
.premium-panel,
.profile-header,
.empty-state,
.portal-panel,
.accounting-ledger-card {
    border: 1px solid rgba(217, 228, 239, 0.94);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
    box-shadow: var(--shadow-card);
}

.panel:hover,
.premium-panel:hover,
.portal-panel:hover {
    border-color: rgba(15, 118, 110, 0.22);
}

.kpi-tile-grid {
    gap: 16px;
}

.kpi-tile-grid.compact {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.kpi-tile:not(.dashboard-kpi-card) {
    position: relative;
    min-height: 118px;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 6px 14px;
    padding: 17px 18px;
    overflow: hidden;
    border: 1px solid rgba(217, 228, 239, 0.98);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 252, 249, 0.93));
    box-shadow: var(--shadow-card);
}

.kpi-tile:not(.dashboard-kpi-card)::before {
    content: "✓";
    grid-row: 1 / span 3;
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 1.35rem;
    font-weight: 950;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.kpi-tile:not(.dashboard-kpi-card):nth-child(4n + 2)::before {
    content: "₹";
    color: #2563eb;
    background: var(--info-soft);
}

.kpi-tile:not(.dashboard-kpi-card):nth-child(4n + 3)::before {
    content: "↗";
    color: #a16207;
    background: var(--accent-soft);
}

.kpi-tile:not(.dashboard-kpi-card):nth-child(4n)::before {
    content: "!";
    color: #dc2626;
    background: var(--danger-soft);
}

.kpi-tile:not(.dashboard-kpi-card) > strong,
.kpi-tile:not(.dashboard-kpi-card) > span,
.kpi-tile:not(.dashboard-kpi-card) > small {
    grid-column: 2;
}

.kpi-tile:not(.dashboard-kpi-card) strong {
    color: #07182f;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 950;
}

.kpi-tile:not(.dashboard-kpi-card) span {
    color: #1f334d;
    font-size: 0.95rem;
}

.kpi-tile:not(.dashboard-kpi-card) small {
    color: #64748b;
}

.kpi-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.dashboard-kpi-card {
    border-radius: var(--radius);
}

.dashboard-kpi-icon {
    border-radius: var(--radius-sm);
}

.btn-primary-ui,
.btn-ghost,
.action-btn,
.table-action,
.btn-soft,
.accounting-btn {
    border-radius: var(--radius-sm);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn-primary-ui,
.action-primary,
.accounting-btn.primary {
    color: #ffffff !important;
    border-color: var(--primary-dark, var(--primary)) !important;
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    box-shadow: 0 4px 12px var(--primary-ring, rgba(0, 0, 0, 0.12));
}

.btn-primary-ui:hover,
.action-primary:hover,
.accounting-btn.primary:hover {
    color: #ffffff !important;
    background: var(--primary-dark) !important;
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-ring, rgba(0, 0, 0, 0.18));
}

.btn-ghost,
.action-muted,
.accounting-btn.secondary {
    color: var(--primary) !important;
    border-color: var(--primary-border, #cbd5e1);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.btn-ghost:hover,
.action-muted:hover,
.accounting-btn.secondary:hover,
.table-action:hover,
.btn-soft:hover {
    color: var(--primary-dark) !important;
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
    transform: translateY(-1px);
}

.action-danger:hover {
    color: #991b1b;
    border-color: #fecaca;
    background: #fff1f2;
}

.form-grid label,
.compact-form label,
.attendance-toolbar label,
.inventory-history-filters label,
.sale-history-filter label {
    color: #26364d;
    font-weight: 850;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.compact-form input,
.compact-form select,
.compact-form textarea,
.attendance-toolbar input,
.attendance-toolbar select,
.inline-input,
.status-select,
.student-filter-form input,
.student-filter-form select,
.staff-filter-form input,
.staff-filter-form select,
.inventory-history-filters select,
.sale-history-filter select,
.ledger-search,
.ledger-tools label {
    border-color: #d5e1ec;
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.compact-form input:focus,
.compact-form select:focus,
.compact-form textarea:focus,
.attendance-toolbar input:focus,
.attendance-toolbar select:focus,
.inline-input:focus,
.status-select:focus,
.student-filter-form input:focus,
.student-filter-form select:focus,
.staff-filter-form input:focus,
.staff-filter-form select:focus,
.inventory-history-filters select:focus,
.sale-history-filter select:focus,
.ledger-search:focus-within {
    border-color: rgba(15, 118, 110, 0.52);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    outline: none;
}

.premium-modal {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 34px 100px rgba(15, 23, 42, 0.34);
}

.modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    background: linear-gradient(135deg, #ffffff, #f2fbf8);
}

.modal-title {
    color: #102033;
    font-weight: 900;
}

.modal-body {
    background: #fbfdff;
}

.modal-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.86);
    background: #ffffff;
}

.premium-table-wrap,
.accounting-table-wrap {
    border-color: rgba(217, 228, 239, 0.98);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.premium-student-table,
.accounting-ledger-table {
    color: #172033;
}

.premium-student-table thead th,
.accounting-ledger-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: #536176;
    background: linear-gradient(180deg, #f8fafc, #f1f6fa);
    border-bottom-color: #d9e4ef;
    font-size: 0.74rem;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.premium-student-table tbody td,
.accounting-ledger-table td {
    border-bottom-color: #edf3f8;
}

.premium-student-table tbody tr,
.accounting-ledger-table tbody tr {
    transition: background 140ms ease, transform 140ms ease;
}

.premium-student-table tbody tr:nth-child(even),
.accounting-ledger-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.premium-student-table tbody tr:hover,
.accounting-ledger-table tbody tr:hover,
.clickable-table tbody tr:hover {
    background: #eefdf8;
}

.student-name-link,
.strong-link {
    color: #075e55;
}

.student-name-link:hover,
.strong-link:hover {
    color: #0d9488;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.table-pill,
.mode-badge,
.status-pill {
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.premium-table-wrap .dt-layout-row {
    align-items: center;
    background: #ffffff;
}

.premium-table-wrap .dt-search input,
.premium-table-wrap .dt-length select {
    min-height: 40px;
    border: 1px solid #d5e1ec;
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.premium-table-wrap .dt-paging-button {
    border-radius: var(--radius-sm) !important;
}

.premium-table-wrap .dt-paging-button.current {
    border-color: var(--primary) !important;
    color: #ffffff !important;
    background: var(--primary) !important;
}

canvas {
    max-width: 100%;
}

.premium-panel canvas,
.panel canvas {
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #ffffff, #f9fcff);
}

.class-tile,
.shortcut-grid a,
.timeline-list span,
.student-result-count,
.sibling-lookup,
.child-switcher select {
    border-radius: var(--radius-sm);
    border-color: #d9e4ef;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.class-tile {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 250, 248, 0.94));
}

.shortcut-grid a:hover,
.class-tile:hover {
    border-color: rgba(15, 118, 110, 0.32);
    background: #f0fdfa;
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.kpi-tile-grid.student-kpi-grid,
.kpi-tile-grid:not(.fees-kpi-grid):not(.compact):not(.two-kpi-grid).student-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) {
    min-height: 90px;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 12px;
    padding: 14px;
    cursor: pointer;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 252, 249, 0.94)),
        radial-gradient(circle at 88% 12%, rgba(15, 118, 110, 0.08), transparent 30%);
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card)::before {
    content: none;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-icon {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-icon .student-kpi-image-icon,
.class-tile-icon .student-kpi-image-icon {
    display: inline-grid;
    place-items: center;
}

.student-kpi-icon svg,
.class-tile-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    align-content: center;
    gap: 3px;
    min-width: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy strong {
    display: block;
    margin: 0;
    color: #07182f;
    font-size: clamp(1.25rem, 1.5vw, 1.65rem);
    font-weight: 950;
    line-height: 1;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy span {
    color: #1f334d;
    font-size: 0.86rem;
    font-weight: 850;
    line-height: 1.15;
}

.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy small {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 550;
    line-height: 1.15;
}

.student-kpi-card.kpi-total .student-kpi-icon {
    color: #2563eb;
    background: #dbeafe;
}

.student-kpi-card.kpi-gender .student-kpi-icon {
    color: #a16207;
    background: #fef3c7;
}

.student-kpi-card.kpi-transport .student-kpi-icon {
    color: #7c3aed;
    background: #ede9fe;
}

.student-kpi-card.kpi-udise .student-kpi-icon {
    color: #047857;
    background: #dcfce7;
}

.student-kpi-card:hover .student-kpi-icon {
    transform: scale(1.04);
}

.student-gender-kpi-icons {
    display: inline-flex !important;
    gap: 0;
    overflow: visible;
}

.student-gender-kpi-icons img {
    width: 30px;
    height: 30px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    object-fit: cover;
    background: #ffffff;
}

.student-gender-kpi-icons img + img {
    margin-left: -8px;
}

.student-gender-symbol {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.gender-icon-line {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-weight: 750 !important;
}

.gender-icon-line img {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    object-fit: cover;
    background: #fff;
}

.gender-count-male {
    color: #2563eb !important;
}

.gender-count-female {
    color: #db2777 !important;
}

.student-name-cell,
.student-mobile-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.student-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    object-fit: cover;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.student-avatar.is-male {
    outline: 2px solid rgba(37, 99, 235, 0.18);
}

.student-avatar.is-female {
    outline: 2px solid rgba(219, 39, 119, 0.18);
}

.student-search-empty {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 18px;
    border: 1px dashed rgba(15, 118, 110, 0.32);
    border-radius: var(--radius);
    color: #64748b;
    background: linear-gradient(135deg, #ffffff, #f0fdfa);
}

.student-search-empty strong {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 950;
}

.exam-hero .hero-subtext {
    margin: 8px 0 0;
    color: #64748b;
    font-weight: 800;
}

.exam-section-nav,
.exam-tab-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.exam-section-nav a,
.exam-tab-shell a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    font-weight: 900;
    text-decoration: none;
}

.exam-section-nav a.active,
.exam-tab-shell a.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary));
}

.exam-action-grid,
.exam-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.exam-card-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
}

.exam-action-card,
.exam-management-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.82));
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
    text-decoration: none;
    color: #0f172a;
}

.exam-action-card:hover,
.exam-management-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.1);
}

.exam-action-card span {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
    font-weight: 950;
}

.exam-action-card strong,
.exam-management-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 950;
}

.exam-action-card small,
.exam-management-card small,
.exam-management-card p {
    color: #64748b;
    font-weight: 750;
}

.exam-action-card b {
    color: var(--primary);
}

.exam-workflow-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 18px;
    padding-bottom: 4px;
}

.exam-workflow-strip span {
    flex: 0 0 auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 9px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #64748b;
    background: #fff;
    font-weight: 900;
}

.exam-workflow-strip span.done {
    color: #047857;
    background: #dcfce7;
}

.exam-workflow-strip span.current {
    color: #1d4ed8;
    background: #dbeafe;
}

.exam-card-top,
.exam-card-stats,
.exam-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.exam-card-top strong {
    font-size: 1.45rem;
    color: var(--primary);
}

.exam-card-stats {
    align-items: stretch;
}

.exam-card-stats span {
    flex: 1;
    padding: 9px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.9);
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 850;
}

.exam-card-stats b {
    display: block;
    color: #0f172a;
}

.exam-progress-line {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.exam-progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #22c55e);
}

.exam-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.exam-card-actions a,
.exam-card-actions button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    color: var(--primary);
    background: #fff;
    font-weight: 900;
    text-decoration: none;
}

.exam-card-actions button {
    cursor: pointer;
}

.exam-status-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 900;
}

.exam-status-inline select {
    min-height: 38px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 850;
}

.exam-activity-list {
    display: grid;
    gap: 10px;
}

.exam-activity-list div:not(.empty-state) {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.exam-activity-list span {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

@media (max-width: 767px) {
    .exam-card-top,
    .exam-card-stats,
    .exam-card-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .exam-card-stats span {
        width: 100%;
    }
}

.class-card-grid {
    gap: 14px;
}

.class-tile {
    position: relative;
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    align-items: center;
    align-content: center;
    gap: 11px;
    min-height: 86px;
    padding: 14px;
    overflow: hidden;
    cursor: pointer;
    border-color: rgba(217, 228, 239, 0.98);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(241, 252, 249, 0.94));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
}

.class-tile::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), #14b8a6);
    opacity: 0;
    transition: opacity 160ms ease;
}

.class-tile-icon {
    align-self: center;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--primary);
    background: var(--primary-soft);
}

.class-tile-copy {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
}

.class-tile-copy strong {
    display: block;
    margin: 0;
    color: #07182f;
    font-size: 1.03rem;
    font-weight: 850;
    line-height: 1.1;
}

.class-tile-copy span {
    display: block;
    color: #475569;
    font-weight: 650;
    line-height: 1.15;
}

.class-tile-copy small {
    display: block;
    color: #64748b;
    font-weight: 550;
    line-height: 1.15;
}

.class-tile em {
    grid-column: 3;
    align-self: center;
    color: var(--primary);
    font-style: normal;
    font-size: 1.15rem;
    font-weight: 900;
    opacity: 0.55;
    transition: transform 160ms ease, opacity 160ms ease;
}

.class-tile:hover {
    border-color: rgba(15, 118, 110, 0.36);
    background:
        linear-gradient(135deg, #ffffff, #ecfdf5);
}

.class-tile:hover::before {
    opacity: 1;
}

.class-tile:hover em {
    opacity: 1;
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .kpi-tile-grid.student-kpi-grid,
    .class-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .kpi-tile-grid.student-kpi-grid,
    .class-card-grid {
        grid-template-columns: 1fr;
    }
}

.alert {
    border-radius: var(--radius-sm);
    font-weight: 750;
}

@media (max-width: 1200px) {
    .kpi-tile-grid.compact,
    .fees-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .erp-topbar {
        position: static;
        margin: 0 0 18px;
        padding: 0;
        border: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .module-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .session-switcher,
    .profile-chip {
        width: 100%;
    }

    .kpi-tile-grid.compact,
    .fees-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .erp-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .erp-main {
        margin-left: 0;
        padding: 16px 10px;
    }

    .erp-page.sidebar-collapsed .erp-main {
        margin-left: 0;
    }

    .module-hero {
        padding: 16px;
    }

    .section-heading {
        display: block;
    }

    .kpi-tile-grid.compact,
    .fees-kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-tile:not(.dashboard-kpi-card) {
        min-height: 96px;
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 14px;
    }

    .kpi-tile:not(.dashboard-kpi-card)::before {
        width: 46px;
        height: 46px;
    }
}

.premium-modal .form-grid,
.premium-modal .compact-form,
.ajax-form .form-grid,
.ajax-form.compact-form {
    align-items: end;
    gap: 14px;
}

.premium-modal .form-grid label,
.premium-modal .compact-form label,
.ajax-form .form-grid label,
.ajax-form.compact-form label {
    gap: 7px;
    font-size: 0.83rem;
    font-weight: 700;
    color: #102033;
}

.premium-modal .form-grid input,
.premium-modal .form-grid select,
.premium-modal .form-grid textarea,
.premium-modal .compact-form input,
.premium-modal .compact-form select,
.premium-modal .compact-form textarea,
.ajax-form .form-grid input,
.ajax-form .form-grid select,
.ajax-form .form-grid textarea,
.ajax-form.compact-form input,
.ajax-form.compact-form select,
.ajax-form.compact-form textarea {
    min-height: 44px;
    font-weight: 500;
    line-height: 1.35;
    color: #0f172a;
}

.premium-modal .form-grid textarea,
.premium-modal .compact-form textarea,
.ajax-form .form-grid textarea,
.ajax-form.compact-form textarea {
    min-height: 76px;
}

.premium-modal .form-grid input[readonly],
.premium-modal .form-grid textarea[readonly],
.premium-modal .compact-form input[readonly],
.premium-modal .compact-form textarea[readonly],
.ajax-form .form-grid input[readonly],
.ajax-form .form-grid textarea[readonly],
.ajax-form.compact-form input[readonly],
.ajax-form.compact-form textarea[readonly] {
    background: #fff;
    font-weight: 500;
}

.premium-modal .form-grid ::placeholder,
.premium-modal .compact-form ::placeholder,
.ajax-form .form-grid ::placeholder,
.ajax-form.compact-form ::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.alumni-lookup,
.leave-lookup,
.premium-modal .sibling-lookup,
.ajax-form .sibling-lookup {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.attendance-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.attendance-dashboard-header h2 {
    margin: 2px 0 4px;
    font-size: clamp(1.65rem, 2vw, 2.25rem);
    line-height: 1.1;
}

.attendance-dashboard-header p:last-child {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.attendance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.attendance-kpi-card,
.attendance-class-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.62));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.attendance-kpi-card strong {
    display: block;
    color: var(--ink);
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: 0;
}

.attendance-kpi-card span:not(.attendance-icon),
.attendance-class-content > p {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-weight: 800;
}

.attendance-kpi-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-weight: 500;
}

.attendance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-weight: 900;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
    border: 1px solid rgba(15, 118, 110, 0.16);
}

.attendance-icon img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.attendance-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.attendance-icon.icon-present,
.attendance-icon.icon-class {
    color: #047857;
    background: #dcfce7;
}

.attendance-icon.icon-absent,
.attendance-icon.icon-pending {
    color: #b91c1c;
    background: #fee2e2;
}

.attendance-icon.icon-rate {
    color: #6d28d9;
    background: #ede9fe;
}

.attendance-icon.icon-days {
    color: #b45309;
    background: #fef3c7;
}

.attendance-icon.icon-leave {
    color: var(--primary);
    background: #d1fae5;
}

.attendance-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.attendance-status.status-excellent {
    color: #047857;
    background: #dcfce7;
}

.attendance-status.status-good {
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.attendance-status.status-needs-attention {
    color: #92400e;
    background: #fef3c7;
}

.attendance-status.status-critical {
    color: #991b1b;
    background: #fee2e2;
}

.attendance-pending-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.attendance-pending-card.has-pending {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.9));
}

.attendance-pending-card.all-clear {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.94), rgba(255, 255, 255, 0.9));
}

.attendance-pending-card strong,
.attendance-pending-card span {
    display: block;
}

.attendance-pending-card span {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 600;
}

.attendance-trend-card {
    margin-bottom: 16px;
}

.attendance-trend-card canvas {
    max-height: 260px;
}

.attendance-class-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.attendance-class-card {
    min-height: 148px;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.attendance-class-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.attendance-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attendance-card-title strong {
    color: var(--ink);
    font-size: 1rem;
}

.attendance-class-content {
    min-width: 0;
    flex: 1;
}

.attendance-class-content p {
    margin: 6px 0 8px;
}

.attendance-class-content dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.attendance-class-content dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.attendance-class-content dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-weight: 900;
}

.attendance-class-content > span {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 900;
}

.slim-empty {
    padding: 28px 18px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.approved-leave-panel .student-table-tools {
    margin-top: 14px;
}

.leave-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 14px 0 4px;
}

.leave-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.7));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.leave-summary-card strong,
.leave-summary-card span {
    display: block;
}

.leave-summary-card strong {
    color: var(--ink);
    font-size: 1.45rem;
    line-height: 1;
}

.leave-summary-card span {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 700;
}

.leave-duration-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
    font-size: 0.75rem;
    font-weight: 800;
}

.leave-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    max-width: 160px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.leave-type-medical {
    color: #0369a1;
    background: #e0f2fe;
}

.leave-type-personal {
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.leave-type-family-function {
    color: #92400e;
    background: #fef3c7;
}

.leave-type-emergency {
    color: #991b1b;
    background: #fee2e2;
}

.leave-type-sports {
    color: #166534;
    background: #dcfce7;
}

.leave-type-other {
    color: #475569;
    background: #f1f5f9;
}

.leave-reason-truncate {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.leave-view-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 10px;
    background: #ecfdf5;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.leave-view-action:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.35);
    background: #d1fae5;
}

.leave-view-action img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.fees-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.fees-dashboard-header h2 {
    margin: 2px 0 4px;
    font-size: clamp(1.65rem, 2vw, 2.25rem);
    line-height: 1.1;
}

.fees-dashboard-header p:last-child {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.fees-kpi-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.fee-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.fee-kpi-card strong,
.fee-kpi-card span,
.fee-kpi-card small {
    display: block;
}

.fee-kpi-card strong {
    color: var(--ink);
    font-size: 1.45rem;
    line-height: 1;
}

.fee-kpi-card span:not(.fee-icon) {
    margin-top: 6px;
    color: var(--ink);
    font-weight: 900;
}

.fee-kpi-card small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 600;
}

.fee-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 900;
}

.kpi-tile.kpi-with-image {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    align-content: center;
}

.kpi-tile.kpi-with-image .kpi-image-icon {
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ecfeff;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.fee-tone-success .fee-icon { color: #15803d; background: #dcfce7; }
.fee-tone-warning .fee-icon { color: #d97706; background: #fef3c7; }
.fee-tone-danger .fee-icon { color: #dc2626; background: #fee2e2; }
.fee-tone-info .fee-icon { color: #2563eb; background: #dbeafe; }
.fee-tone-sky .fee-icon { color: #0284c7; background: #e0f2fe; }
.fee-tone-purple .fee-icon { color: #7c3aed; background: #f3e8ff; }
.fee-tone-indigo .fee-icon { color: #4f46e5; background: #e0e7ff; }

.fee-dashboard-split {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr);
    gap: 16px;
    margin-bottom: 16px;
}

.fee-recovery-meter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 130px;
}

.fee-recovery-meter strong {
    color: var(--ink);
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
}

.fee-trend-card canvas,
.fee-class-chart-card canvas {
    max-height: 280px;
}

.fee-alert-panel,
.fee-class-chart-card {
    margin-bottom: 16px;
}

.fee-alert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fee-alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.fee-alert-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.35);
}

.fee-alert-chip strong {
    color: var(--ink);
}

.fee-alert-chip span {
    color: var(--muted);
    font-weight: 800;
}

.fee-class-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.fee-class-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 176px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-left: 5px solid #ef4444;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.72));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.fee-class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.fee-class-card:hover .fee-card-arrow {
    transform: translateX(4px);
}

.fee-class-card.fee-status-excellent { border-left-color: #16a34a; }
.fee-class-card.fee-status-good { border-left-color: #2563eb; }
.fee-class-card.fee-status-warning { border-left-color: #d97706; }
.fee-class-card.fee-status-critical { border-left-color: #dc2626; }

.fee-class-card h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.05rem;
}

.fee-class-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 0;
}

.fee-class-card dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.fee-class-card dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-weight: 900;
}

.fee-card-arrow {
    color: var(--primary);
    font-size: 1.7rem;
    font-weight: 900;
    transition: transform 0.18s ease;
}

.fee-status-badge,
.payment-mode-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.fee-status-excellent { color: #166534; background: #dcfce7; }
.fee-status-good { color: #1d4ed8; background: #dbeafe; }
.fee-status-warning { color: #92400e; background: #fef3c7; }
.fee-status-critical { color: #991b1b; background: #fee2e2; }

.fee-receipt-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 260px));
    gap: 12px;
    margin-bottom: 12px;
}

.fee-receipt-tools input {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    font-weight: 700;
}

.fee-structure-table th,
.fee-structure-table td {
    vertical-align: middle;
}

.fee-structure-input {
    width: 150px;
    max-width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--ink);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.92);
}

.fee-structure-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.12);
}

.fee-structure-kpis .fee-kpi-card {
    min-height: 112px;
}

.exam-bulk-schedule-panel {
    overflow: hidden;
}

.exam-bulk-schedule-wrap {
    height: auto;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-y: visible;
}

.exam-average-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.exam-mini-stat {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(224, 247, 243, 0.75), rgba(255, 255, 255, 0.95));
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.exam-mini-stat span,
.exam-student-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.exam-mini-stat strong {
    display: block;
    margin-top: 4px;
    color: #001b3a;
    font-size: 1.4rem;
}

.exam-mini-stat small,
.exam-student-summary small {
    color: var(--muted);
    font-weight: 700;
}

.exam-student-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.exam-student-summary > strong,
.exam-student-summary > small {
    grid-column: 1 / -1;
}

.exam-student-summary > strong {
    color: #001b3a;
    font-size: 1.2rem;
}

.exam-student-summary div {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.exam-student-summary b {
    display: block;
    margin-top: 4px;
    color: #001b3a;
}

.compact-list {
    margin-top: 14px;
}

.exam-review-table th,
.exam-review-table td {
    white-space: nowrap;
}

.exam-review-table th:first-child,
.exam-review-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
}

.student-journey-panel {
    overflow: hidden;
}

.journey-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.journey-tabs > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.journey-tabs > label {
    border: 1px solid #dbe6ee;
    border-radius: 12px;
    color: #12304f;
    cursor: pointer;
    font-weight: 900;
    padding: 12px 16px;
    background: #f8fbfd;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

#journey-academic:checked ~ label[for="journey-academic"],
#journey-attendance:checked ~ label[for="journey-attendance"],
#journey-fees:checked ~ label[for="journey-fees"],
#journey-transport:checked ~ label[for="journey-transport"],
#journey-promotion:checked ~ label[for="journey-promotion"],
#journey-tc:checked ~ label[for="journey-tc"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.journey-tab-panel {
    display: none;
    flex: 1 0 100%;
    margin-top: 16px;
}

#journey-academic:checked ~ .journey-panel-academic,
#journey-attendance:checked ~ .journey-panel-attendance,
#journey-fees:checked ~ .journey-panel-fees,
#journey-transport:checked ~ .journey-panel-transport,
#journey-promotion:checked ~ .journey-panel-promotion,
#journey-tc:checked ~ .journey-panel-tc {
    display: block;
}

.journey-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.journey-summary-card,
.journey-card {
    border: 1px solid #dbe6ee;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff, rgba(240, 253, 250, 0.68));
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.journey-summary-card {
    padding: 16px;
}

.journey-summary-card span {
    color: #64748b;
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.journey-summary-card strong {
    color: #071833;
    display: block;
    font-size: 1.6rem;
    margin-top: 4px;
}

.journey-summary-card small,
.journey-row small,
.journey-empty {
    color: #64748b;
    font-weight: 750;
}

.journey-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.journey-card {
    padding: 16px;
}

.journey-card h3 {
    color: #071833;
    font-size: 1.05rem;
    margin: 0 0 12px;
}

.journey-row {
    align-items: center;
    border-top: 1px solid #e6edf3;
    color: inherit;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 0;
    text-decoration: none;
}

.journey-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.journey-row strong,
.journey-row small {
    display: block;
}

.journey-score {
    text-align: right;
}

.journey-score b {
    color: var(--primary);
}

.journey-month-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.journey-month-cloud span {
    background: #e4f8f2;
    border: 1px solid #c6ece5;
    border-radius: 999px;
    color: #075f57;
    font-weight: 850;
    padding: 7px 10px;
}

.journey-empty {
    margin: 8px 0 0;
}

.journey-link-row:hover {
    color: var(--primary);
}

@media (max-width: 767px) {
    .journey-tabs > label {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .journey-two-column {
        grid-template-columns: 1fr;
    }

    .journey-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .journey-score {
        text-align: left;
    }
}

.exam-bulk-schedule-table {
    min-width: 980px;
    margin: 0;
}

.exam-bulk-schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f4faf9;
    box-shadow: 0 1px 0 var(--border);
}

.exam-bulk-schedule-table td {
    min-width: 110px;
}

.exam-bulk-schedule-table td:nth-child(4) { min-width: 170px; }
.exam-bulk-schedule-table td:nth-child(5) { min-width: 135px; }
.exam-bulk-schedule-table td:nth-child(6) { min-width: 210px; }

.exam-bulk-schedule-table .inline-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d6e3e6;
    border-radius: 10px;
    background: #fff;
}

.exam-timetable-panel {
    overflow: hidden;
}

.exam-timetable-shell {
    width: 100%;
}

.exam-timetable-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.exam-timetable-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.exam-timetable-table th,
.exam-timetable-table td {
    min-width: 138px;
    padding: 14px 12px;
    border-right: 1px solid #e3ecef;
    border-bottom: 1px solid #e3ecef;
    text-align: center;
    vertical-align: middle;
}

.exam-timetable-table thead th {
    position: sticky;
    top: var(--app-header-height, 0px);
    z-index: 3;
    color: #315166;
    background: #f0f8f7;
}

.exam-timetable-table thead th strong,
.exam-timetable-table thead th small {
    display: block;
}

.exam-timetable-table thead th strong {
    color: #0f3d3a;
    font-size: 0.92rem;
}

.exam-timetable-table thead th small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.exam-timetable-table .exam-timetable-class-column {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 156px;
    text-align: left;
    background: #f8fbfc;
    box-shadow: 1px 0 0 #e3ecef;
}

.exam-timetable-table thead .exam-timetable-class-column {
    z-index: 4;
    background: #e8f5f3;
}

.exam-timetable-class-column strong,
.exam-timetable-class-column span {
    display: block;
}

.exam-timetable-class-column span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.exam-timetable-subject {
    display: grid;
    gap: 3px;
    min-height: 58px;
    align-content: center;
    padding: 9px;
    border: 1px solid #cbe6e1;
    border-radius: 10px;
    color: #075f57;
    background: #eaf8f5;
}

.exam-timetable-subject + .exam-timetable-subject {
    margin-top: 6px;
}

.exam-timetable-subject strong {
    font-size: 0.86rem;
}

.exam-timetable-subject small {
    color: #56707f;
    font-size: 0.7rem;
}

.exam-timetable-empty {
    color: #a2b1bb;
}

.parent-exam-timetable-list {
    display: grid;
    gap: 16px;
}

.parent-exam-timetable-card {
    overflow: hidden;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfefd;
}

.parent-exam-timetable-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.parent-exam-timetable-head h3 {
    margin: 6px 0 0;
}

.parent-exam-timetable-head > small {
    color: var(--muted);
    font-weight: 700;
}

.exam-timetable-shell.is-compact .exam-timetable-table th,
.exam-timetable-shell.is-compact .exam-timetable-table td {
    min-width: 120px;
    padding: 10px 8px;
}

.exam-timetable-shell.is-compact .exam-timetable-table .exam-timetable-class-column {
    min-width: 132px;
}

.exam-timetable-shell.is-compact .exam-timetable-subject {
    min-height: 44px;
    padding: 7px;
}

@media (max-width: 767px) {
    .exam-student-summary {
        grid-template-columns: 1fr;
    }

    .exam-schedule-hero .action-cluster {
        width: 100%;
    }

    .exam-schedule-hero .action-btn {
        flex: 1 1 0;
    }

    .exam-timetable-table th,
    .exam-timetable-table td,
    .exam-timetable-shell.is-compact .exam-timetable-table th,
    .exam-timetable-shell.is-compact .exam-timetable-table td {
        min-width: 108px;
        padding: 9px 7px;
    }

    .exam-timetable-table .exam-timetable-class-column,
    .exam-timetable-shell.is-compact .exam-timetable-table .exam-timetable-class-column {
        min-min-width: 80px; width: auto;
    }

    .parent-exam-timetable-card {
        padding: 12px;
    }

    .parent-exam-timetable-head {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media print {
    .exam-timetable-hero .action-cluster,
    .exam-section-nav,
    .app-sidebar,
    .mobile-app-bar {
        display: none !important;
    }

    .exam-timetable-scroll {
        overflow: visible;
        border: 0;
    }

    .exam-timetable-table {
        min-width: 100%;
        font-size: 10px;
    }

    .exam-timetable-table th,
    .exam-timetable-table td {
        position: static !important;
        min-width: 0;
        padding: 5px;
    }
}

.payment-mode-badge.mode-cash { color: #9a3412; background: #ffedd5; }
.payment-mode-badge.mode-upi { color: #166534; background: #dcfce7; }
.payment-mode-badge.mode-bank,
.payment-mode-badge.mode-bank-transfer { color: #6d28d9; background: #ede9fe; }
.payment-mode-badge.mode-cheque { color: #1d4ed8; background: #dbeafe; }

.class-fee-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.class-fee-back {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 11px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.7);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.class-fee-back:hover {
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.28);
    background: #fff;
}

.class-fee-header h2 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: clamp(1.8rem, 2.4vw, 2.45rem);
    line-height: 1.08;
}

.class-fee-header p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.class-fee-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.class-recovery-progress-card {
    margin-bottom: 16px;
}

.class-recovery-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
}

.class-recovery-progress strong {
    color: var(--ink);
    font-size: 1.5rem;
}

.class-progress-track {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.class-progress-track span {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    transition: width 0.3s ease;
}

.class-progress-track .fee-status-excellent { background: #16a34a; }
.class-progress-track .fee-status-good { background: #2563eb; }
.class-progress-track .fee-status-warning { background: #d97706; }
.class-progress-track .fee-status-critical { background: #dc2626; }

.class-payment-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.fee-summary-chip,
.student-fee-status,
.pending-fee-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.fee-summary-chip.paid,
.student-fee-status.paid,
.pending-fee-pill.pending-zero {
    color: #166534;
    background: #dcfce7;
}

.fee-summary-chip.partial,
.student-fee-status.partial,
.pending-fee-pill.pending-low {
    color: #92400e;
    background: #fef3c7;
}

.fee-summary-chip.due,
.student-fee-status.due,
.pending-fee-pill.pending-high {
    color: #991b1b;
    background: #fee2e2;
}

.class-fee-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 14px;
}

.class-fee-filters button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    color: var(--muted);
    background: #fff;
    font-weight: 900;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.class-fee-filters button.active,
.class-fee-filters button:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.class-fee-table td {
    vertical-align: middle;
}

.class-fee-table-wrap {
    overflow-x: auto;
}

.class-fee-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.28);
}

.class-fee-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.class-fee-pagination label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.class-fee-pagination select {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
    color: var(--ink);
    font-weight: 900;
    background: #fff;
}

.class-fee-pagination div {
    display: inline-flex;
    gap: 8px;
}

.class-fee-pagination button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    font-weight: 900;
}

.class-fee-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.premium-student-table tr.student-row-tc-issued td {
    background: #fff1f2;
    color: #8f1d2c;
}

.premium-student-table tr.student-row-tc-issued:hover td {
    background: #ffe4e6;
}

.student-status-pill {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 8px;
    vertical-align: middle;
}

@media (max-width: 700px) {
    .fees-dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .fees-dashboard-header .action-cluster {
        justify-content: flex-start;
    }

    .fees-kpi-dashboard-grid,
    .fee-dashboard-split,
    .fee-class-card-grid,
    .fee-receipt-tools,
    .class-fee-kpi-grid,
    .class-recovery-progress {
        grid-template-columns: 1fr;
    }

    .class-fee-header {
        flex-direction: column;
    }

    .class-fee-table thead th {
        top: 0;
    }

    .fee-class-card dl {
        grid-template-columns: 1fr;
    }

    .attendance-dashboard-header,
    .attendance-pending-card {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-dashboard-header .action-cluster {
        justify-content: flex-start;
    }

    .attendance-kpi-grid,
    .attendance-class-grid,
    .leave-summary-grid {
        grid-template-columns: 1fr;
    }

    .alumni-lookup,
    .leave-lookup,
    .premium-modal .sibling-lookup,
    .ajax-form .sibling-lookup {
        grid-template-columns: 1fr;
    }
}

.communication-hero {
    align-items: center;
}

.communication-filter-panel {
    margin-bottom: 18px;
}

.communication-filter-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 14px;
    align-items: end;
}

.communication-filter-form label,
.communication-notice-form label {
    display: grid;
    gap: 7px;
    color: #24364f;
    font-size: 0.86rem;
    font-weight: 800;
}

.communication-filter-form input,
.communication-filter-form select,
.communication-notice-form input,
.communication-notice-form select,
.communication-notice-form textarea {
    width: 100%;
    border: 1px solid #d6e3ec;
    border-radius: 10px;
    background: #fff;
    color: #071833;
    font: inherit;
    font-weight: 650;
    padding: 11px 12px;
    outline: 0;
}

.communication-notice-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.communication-filter-form input:focus,
.communication-filter-form select:focus,
.communication-notice-form input:focus,
.communication-notice-form select:focus,
.communication-notice-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.communication-table td:first-child small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 650;
}

.communication-title-link {
    color: #071833;
    display: inline-block;
    font-weight: 900;
    text-decoration: none;
}

.communication-title-link:hover {
    color: var(--primary);
}

.portal-back-link {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe6ee;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    color: var(--primary);
    display: inline-flex;
    font-weight: 800;
    gap: 9px;
    min-height: 44px;
    padding: 9px 14px;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.portal-back-link:hover {
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
    color: var(--primary);
    transform: translateY(-1px);
}

.portal-back-link img {
    display: block;
    height: 20px;
    object-fit: contain;
    width: 20px;
}

.notice-type-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 900;
    gap: 6px;
    letter-spacing: 0.02em;
    padding: 6px 10px;
    white-space: nowrap;
}

.notice-type-badge::before {
    border-radius: 999px;
    content: "";
    height: 6px;
    width: 6px;
}

.type-announcement { background: #dbeafe; color: #1d4ed8; }
.type-announcement::before { background: #2563eb; }
.type-notice { background: var(--primary-soft, #ccfbf1); color: var(--primary); }
.type-notice::before { background: var(--primary); }
.type-holiday { background: #dcfce7; color: #15803d; }
.type-holiday::before { background: #16a34a; }
.type-exam { background: #f3e8ff; color: #7e22ce; }
.type-exam::before { background: #9333ea; }
.type-transport { background: #ffedd5; color: #c2410c; }
.type-transport::before { background: #ea580c; }
.type-event { background: #e0e7ff; color: #4338ca; }
.type-event::before { background: #4f46e5; }
.type-emergency { background: #fee2e2; color: #b91c1c; }
.type-emergency::before { background: #dc2626; }

.table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

button.table-action {
    background: transparent;
    border: 0;
}

.table-action.danger {
    color: #dc2626;
}

.communication-detail-wrap {
    max-width: 920px;
}

.back-link {
    color: #52637a;
    display: inline-flex;
    font-weight: 900;
    margin-bottom: 16px;
    text-decoration: none;
}

.communication-detail-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe6ee;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    padding: clamp(22px, 4vw, 42px);
}

.communication-detail-head {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.communication-detail-head h1 {
    color: #071833;
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin: 0;
}

.communication-detail-head p {
    color: #64748b;
    font-weight: 700;
    margin: 6px 0 0;
}

.communication-message {
    color: #17243b;
    font-size: 1.03rem;
    font-weight: 600;
    line-height: 1.75;
    margin-bottom: 26px;
}

.communication-modern-card {
    display: grid;
    gap: 18px;
    overflow: hidden;
    padding: 22px;
}

.communication-modern-main {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
}

.communication-modern-icon {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfdf5, #f8fafc);
    color: var(--primary);
}

.communication-modern-icon img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.communication-modern-icon svg,
.communication-modern-date svg,
.communication-modern-footer svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.communication-modern-icon svg {
    width: 62px;
    height: 62px;
    stroke-width: 1.9;
}

.communication-modern-copy {
    min-width: 0;
}

.communication-modern-type {
    margin-bottom: 10px;
    background: #e5f7f1;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 7px 14px;
}

.communication-modern-copy h1 {
    margin: 0;
    color: #0f172a;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: clamp(1.55rem, 2.6vw, 2.35rem);
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.communication-modern-date {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 0;
    color: #64748b;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.4;
}

.communication-modern-date svg {
    width: 19px;
    height: 19px;
    color: var(--primary);
    stroke-width: 2;
}

.communication-modern-card .communication-message {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    color: #111827;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: clamp(0.98rem, 1.7vw, 1.12rem);
    font-weight: 500;
    line-height: 1.8;
    margin: 0;
}

.communication-attachment-card {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 14px;
    width: min(100%, 520px);
    min-height: 58px;
    padding: 12px 16px;
    border: 1px solid #d8e5e5;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.9), #ffffff);
    color: #111827;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.communication-attachment-card:hover {
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.communication-attachment-card img {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.communication-modern-footer {
    margin: 10px -22px -22px;
    padding: 16px 22px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
}

.communication-modern-footer span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.communication-modern-footer svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

@media (max-width: 767px) {
    .communication-detail-wrap {
        max-width: 100%;
    }

    .communication-modern-card {
        gap: 18px;
        padding: 20px 18px 0;
        border-radius: 20px;
    }

    .communication-modern-main {
        grid-template-columns: 50px minmax(0, 1fr);
        align-items: center;
        gap: 14px;
    }

    .communication-modern-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .communication-modern-icon img {
        width: 32px;
        height: 32px;
    }

    .communication-modern-type {
        margin-bottom: 8px;
        max-width: 180px;
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .communication-modern-copy h1 {
        margin-left: 0;
        font-size: clamp(1.45rem, 6vw, 1.9rem);
        line-height: 1.12;
    }

    .communication-modern-date {
        margin: 9px 0 0;
        font-size: 0.88rem;
    }

    .communication-modern-card .communication-message {
        padding-top: 18px;
        font-size: 1rem;
        line-height: 1.65;
    }

    .communication-attachment-card {
        grid-template-columns: 24px minmax(0, 1fr) 22px;
        gap: 12px;
        min-height: 54px;
        padding: 11px 14px;
        font-size: 0.92rem;
    }

    .communication-modern-footer {
        margin: 10px -18px 0;
        padding: 14px 18px;
        font-size: 0.86rem;
    }
}

.portal-notice-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.portal-notice-card,
.staff-notice {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.7));
    border: 1px solid #dbe6ee;
    border-radius: 16px;
    color: #071833;
    display: grid;
    gap: 8px;
    padding: 14px;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.portal-notice-card:hover,
.staff-notice:hover {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09);
    transform: translateY(-2px);
}

.portal-notice-card strong,
.staff-notice strong {
    font-size: 1rem;
    font-weight: 900;
}

.portal-notice-card p,
.staff-notice span:not(.notice-type-badge) {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 650;
    margin: 0;
}

.portal-notice-card small {
    color: #52637a;
    display: flex;
    font-weight: 750;
    justify-content: space-between;
}

.parent-communication-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.parent-communication-card {
    background: linear-gradient(135deg, #ffffff, #f4fbfa);
    border: 1px solid #dbe6ee;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    color: #0f172a;
    display: grid;
    gap: 10px;
    min-height: 170px;
    padding: 18px;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.parent-communication-card:hover {
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    transform: translateY(-2px);
}

.parent-communication-card-top {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.parent-communication-date {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.parent-communication-card h3 {
    color: #0f172a;
    font-family: Inter, "Segoe UI", sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
}

.parent-communication-card p {
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.55;
    margin: 0;
}

.parent-communication-more {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-weight: 800;
    gap: 6px;
    justify-self: start;
    margin-top: auto;
}

.parent-communication-more b {
    font-size: 1.35rem;
    line-height: 1;
}

.parent-communication-empty {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    color: #64748b;
    display: grid;
    gap: 4px;
    padding: 20px;
}

.parent-communication-empty strong {
    color: #0f172a;
    font-size: 1rem;
}

.driver-route-notices {
    min-height: 100%;
}

.parent-result-cards {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.parent-result-card {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.parent-result-card-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    grid-template-columns: 88px minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(100px, 0.65fr) minmax(105px, 0.7fr) 38px;
    gap: 22px;
    list-style: none;
    padding: 28px 30px;
}

.parent-result-card-summary::-webkit-details-marker {
    display: none;
}

.parent-result-card-summary > * + * {
    border-left: 2px solid #e4e9ef;
    padding-left: 22px;
}

.parent-result-card-summary .parent-result-icon {
    border-left: 0;
    padding-left: 0;
}

.parent-result-icon {
    align-items: center;
    background: #e4f8f2;
    border-radius: 22px;
    display: flex;
    height: 72px;
    justify-content: center;
    width: 72px;
}

.parent-result-icon img {
    height: 48px;
    object-fit: contain;
    width: 48px;
}

.parent-result-title h3 {
    color: #071833;
    font-size: 1.55rem;
    font-weight: 900;
    margin: 0 0 8px;
}

.parent-result-title p {
    color: #64748b;
    font-weight: 700;
    margin: 0;
}

.parent-result-marks {
    display: grid;
    gap: 12px;
}

.parent-result-marks strong {
    color: #071833;
    font-size: 1.55rem;
    font-weight: 950;
}

.parent-result-marks strong span {
    color: #64748b;
}

.parent-result-marks i {
    background: #e6eaf0;
    border-radius: 999px;
    display: block;
    height: 10px;
    overflow: hidden;
    width: 100%;
}

.parent-result-marks b {
    background: linear-gradient(90deg, #059669, #14b8a6);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.parent-result-percent strong {
    color: var(--primary);
    font-size: 1.7rem;
    font-weight: 950;
}

.parent-result-grade {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.parent-result-grade strong {
    align-items: center;
    background: #dff7f1;
    border-radius: 18px;
    color: var(--primary);
    display: inline-flex;
    font-size: 1.55rem;
    font-weight: 950;
    min-height: 56px;
    justify-content: center;
    min-width: 70px;
}

.parent-result-grade span {
    color: var(--primary);
    font-weight: 900;
}

.result-chevron {
    border-left: 2px solid #e4e9ef;
    color: #071833;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    padding-left: 22px;
    transition: transform 0.2s ease;
}

.parent-result-card[open] .result-chevron {
    transform: rotate(90deg);
}

.parent-result-detail {
    display: grid;
    gap: 12px;
    border-top: 1px solid #e4e9ef;
    padding: 0 30px 26px;
}

.parent-result-detail-head,
.parent-subject-result-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.parent-result-detail-head span,
.parent-subject-result-card {
    border: 1px solid #dbe6ee;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    padding: 10px;
}

.parent-result-detail-head span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
}

.parent-result-detail-head b,
.parent-subject-result-card strong {
    color: #071833;
}

.parent-subject-result-card span {
    color: var(--primary);
    display: block;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.parent-subject-result-card strong {
    display: block;
    font-size: 1.05rem;
    margin-top: 5px;
}

.parent-subject-result-card small {
    color: #64748b;
    display: block;
    font-weight: 750;
    margin-top: 3px;
}

@media (max-width: 980px) {
    .parent-result-card-summary {
        grid-template-columns: 66px minmax(0, 1fr) auto;
        gap: 14px;
        padding: 20px;
    }

    .parent-result-card-summary > * + * {
        border-left: 0;
        padding-left: 0;
    }

    .parent-result-icon {
        border-radius: 18px;
        height: 58px;
        width: 58px;
    }

    .parent-result-icon img {
        height: 40px;
        width: 40px;
    }

    .parent-result-marks,
    .parent-result-percent,
    .parent-result-grade {
        grid-column: 1 / -1;
    }

    .parent-result-marks {
        margin-top: 4px;
    }

    .parent-result-percent strong {
        font-size: 1.45rem;
    }

    .parent-result-grade {
        align-items: center;
        grid-template-columns: auto 1fr;
        justify-items: start;
        text-align: left;
    }

    .result-chevron {
        border-left: 0;
        grid-column: 3;
        grid-row: 1;
        padding-left: 0;
    }

    .parent-result-detail {
        padding: 0 20px 20px;
    }
}

@media (max-width: 1100px) {
    .communication-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .communication-filter-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: auto;
    }

    .filter-actions {
        flex-direction: column;
    }
}

.homework-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(224, 247, 243, 0.78), rgba(255, 255, 255, 0.96));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.homework-hero h2,
.homework-hero p {
    margin: 0;
}

.homework-hero h2 {
    color: #06233f;
    font-size: clamp(1.7rem, 2.4vw, 2.4rem);
    font-weight: 900;
}

.homework-hero p:not(.eyebrow) {
    margin-top: 6px;
    color: #64748b;
    font-weight: 650;
}

.homework-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.homework-kpi-card,
.parent-homework-summary article {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.055);
}

.homework-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    color: var(--primary);
    background: #dff8f3;
}

.homework-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.homework-kpi-card strong,
.parent-homework-summary strong {
    display: block;
    color: #061a33;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 900;
}

.homework-kpi-card span,
.parent-homework-summary span {
    display: block;
    margin-top: 5px;
    color: #0f2742;
    font-weight: 850;
}

.homework-kpi-card small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 600;
}

.homework-filter-form {
    margin-bottom: 18px;
}

.homework-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.homework-card,
.parent-homework-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff, #f8fffd);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.045);
}

.homework-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.homework-card h3,
.parent-homework-card h3 {
    margin: 8px 0 4px;
    color: #061a33;
    font-size: 1.05rem;
    font-weight: 900;
}

.homework-card p,
.parent-homework-card p {
    margin: 0;
    color: #64748b;
    font-weight: 650;
}

.subject-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-light, #f0fdfa);
    font-size: 0.74rem;
    font-weight: 900;
}

.homework-details-preview {
    margin-top: 14px !important;
    min-height: 46px;
    color: #334155 !important;
}

.homework-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.homework-meta span {
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.homework-meta strong {
    color: #0f2742;
}

.homework-progress {
    margin-top: 14px;
}

.homework-progress div {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.homework-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #20b486);
}

.homework-progress small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-weight: 750;
}

.homework-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.homework-actions form {
    margin: 0;
}

.homework-empty {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed rgba(15, 118, 110, 0.24);
    border-radius: 16px;
    color: #64748b;
    background: #f8fffd;
    font-weight: 750;
    text-align: center;
}

.table-pill.is-soft {
    color: var(--primary);
    background: var(--primary-light, #f0fdfa);
}

.parent-homework-panel {
    margin-bottom: 18px;
}

.parent-homework-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.parent-homework-summary article {
    align-items: center;
    display: grid;
    gap: 4px;
    justify-items: center;
    min-height: 78px;
    padding: 12px 8px;
    text-align: center;
}

.parent-homework-summary article::before {
    content: none;
}

.parent-homework-summary strong {
    font-size: 1.35rem;
    line-height: 1;
}

.parent-homework-summary span {
    margin: 0;
    max-width: 100%;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.parent-homework-notices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.parent-homework-notices span {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: #ecfdf5;
    font-size: 0.82rem;
    font-weight: 750;
}

.parent-homework-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.parent-homework-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
}

.parent-homework-card .action-btn {
    grid-column: 1 / -1;
    justify-self: start;
}

.parent-homework-detail > p {
    margin: 16px 0;
    color: #334155;
    font-weight: 650;
    line-height: 1.6;
}

.parent-homework-remarks {
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: #f8fafc;
}

.parent-homework-remarks strong,
.parent-homework-remarks span {
    display: block;
}

.homework-bulk-bar {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.homework-progress-table td strong,
.homework-progress-table td small {
    display: block;
}

.homework-progress-table td small {
    margin-top: 3px;
    color: #64748b;
    font-weight: 650;
}

.homework-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 300px;
}

.homework-row-actions .table-action {
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
    background: #ffffff;
}

.homework-row-actions .table-action:hover {
    background: var(--primary-light, #f0fdfa);
}

.staff-announcement-list {
    display: grid;
    gap: 10px;
}

@media (max-width: 1180px) {
    .homework-kpi-grid,
    .parent-homework-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .homework-card-grid,
    .parent-homework-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .homework-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .homework-kpi-grid,
    .homework-card-grid,
    .parent-homework-summary,
    .parent-homework-cards,
    .homework-bulk-bar {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 701px) and (max-width: 1100px) {
    .fees-kpi-dashboard-grid,
    .fee-class-card-grid,
    .class-fee-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fee-dashboard-split {
        grid-template-columns: 1fr;
    }

    .attendance-kpi-grid,
    .attendance-class-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.staff-portal-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.94));
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.staff-portal-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.staff-portal-avatar,
.staff-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.staff-portal-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1.55rem;
    font-weight: 900;
    box-shadow: 0 16px 30px rgba(0, 121, 107, 0.24);
}

.staff-portal-identity h2 {
    margin: 0;
    color: #0f172a;
    font-weight: 900;
}

.staff-portal-identity p:not(.eyebrow) {
    margin: 4px 0 0;
    color: #64748b;
    font-weight: 700;
}

.staff-portal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.staff-portal-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.staff-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #dcfce7;
    color: #15803d;
    font-size: 1rem;
    font-weight: 900;
}

.staff-card-icon.is-blue {
    background: #dbeafe;
    color: #2563eb;
}

.staff-card-icon.is-amber {
    background: #fef3c7;
    color: #d97706;
}

.staff-card-icon.is-purple {
    background: #f3e8ff;
    color: #7c3aed;
}

.staff-portal-card strong {
    display: block;
    color: #020617;
    font-size: 1.45rem;
    line-height: 1.05;
    font-weight: 900;
}

.staff-portal-card span {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-weight: 800;
}

.staff-portal-card small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-weight: 600;
}

.staff-portal-profile {
    margin-bottom: 18px;
}

.staff-card-action {
    margin-top: 12px;
}

.staff-notice {
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.staff-notice:last-child {
    border-bottom: 0;
}

.staff-notice strong,
.staff-notice span {
    display: block;
}

.staff-notice span {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.92rem;
}

.staff-route-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.staff-route-card {
    padding: 16px;
    border: 1px solid rgba(0, 121, 107, 0.18);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.86), rgba(255, 255, 255, 0.94));
}

.staff-route-card strong,
.staff-route-card span,
.staff-route-card small {
    display: block;
}

.staff-route-card span {
    margin-top: 8px;
    color: #334155;
}

.staff-route-card small {
    margin-top: 8px;
    color: #64748b;
    font-weight: 700;
}

.payroll-lock-panel {
    max-width: 760px;
}

.secure-payroll-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.secure-payroll-form label {
    color: #0f172a;
    font-weight: 800;
}

.secure-payroll-form input {
    width: 100%;
    margin-top: 7px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-weight: 700;
}

.forgot-payroll-form {
    margin-top: 14px;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    padding: 0;
}

.staff-portal-empty {
    max-width: 720px;
}

.personal-hero .portal-hero-actions a {
    white-space: nowrap;
}

.driver-duty-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.driver-duty-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(0, 121, 107, 0.16);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.96));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.driver-duty-card span,
.driver-duty-card strong,
.driver-duty-card small {
    display: block;
}

.driver-duty-card span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.driver-duty-card strong {
    margin-top: 5px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 900;
}

.driver-duty-card small {
    margin-top: 4px;
    color: #64748b;
    font-weight: 650;
}

.driver-ops-page {
    display: grid;
    gap: 16px;
}

.driver-ops-header,
.driver-route-action-card,
.driver-card,
.driver-kpi-grid article {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.driver-ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.driver-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.driver-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-size: 1.35rem;
    font-weight: 900;
}

.driver-identity h1,
.driver-route-action-card h2,
.driver-card h2 {
    margin: 0;
    color: #0f172a;
    font-weight: 950;
    letter-spacing: 0;
}

.driver-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.driver-meta span,
.driver-badge,
.driver-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.driver-meta span,
.driver-badge {
    padding: 6px 10px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.driver-badge.is-active {
    color: #166534;
    background: #dcfce7;
}

.driver-payroll-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 15px;
    border-radius: 12px;
    color: var(--primary);
    background: #ecfdf5;
    font-weight: 900;
}

.driver-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.driver-kpi-grid article {
    min-height: 112px;
    padding: 16px;
}

.driver-kpi-grid span,
.driver-route-facts span,
.driver-student-row span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.driver-kpi-grid strong {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1.15;
    font-weight: 950;
}

.driver-kpi-grid small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 700;
}

.driver-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
}

.driver-status-dot.in-progress { background: #2563eb; }
.driver-status-dot.completed { background: #16a34a; }
.driver-status-dot.not-started { background: #f59e0b; }

.driver-route-action-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: center;
    padding: 20px;
}

.driver-route-action-card p:not(.eyebrow) {
    margin: 7px 0 0;
    color: #64748b;
    font-weight: 750;
}

.driver-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.driver-action-btn,
.driver-row-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 13px;
    color: var(--primary);
    background: #ecfdf5;
    font-weight: 950;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.driver-action-btn:hover,
.driver-row-actions button:hover {
    transform: translateY(-1px);
    color: #fff;
    background: var(--primary);
}

.driver-action-btn.primary {
    color: #fff;
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.driver-action-btn.danger {
    color: #fff;
    border-color: #dc2626;
    background: #dc2626;
}

.driver-action-btn.complete {
    color: #166534;
    background: #dcfce7;
}

.driver-action-btn.scan {
    grid-column: span 2;
}

.driver-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 16px;
}

.driver-card {
    padding: 18px;
}

.driver-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.driver-route-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.driver-route-facts div {
    min-height: 94px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: #f8fafc;
}

.driver-route-facts strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 950;
}

.driver-route-facts small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 700;
}

.driver-stop-list {
    margin-top: 14px;
}

.driver-stop-list > span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
}

.driver-stop-list p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 9px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 800;
}

.driver-stop-list b {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.driver-contact-grid {
    display: grid;
    gap: 10px;
}

.driver-contact-grid a {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 14px;
    color: #0f172a;
    background: #f8fafc;
    font-weight: 900;
}

.driver-contact-grid span {
    color: #64748b;
    font-size: 0.78rem;
}

.driver-student-list {
    display: grid;
    gap: 10px;
}

.driver-student-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr) minmax(280px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: #fff;
}

.driver-student-name strong {
    display: block;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 950;
}

.driver-student-name span {
    margin-top: 4px;
}

.driver-status {
    margin-top: 5px;
    padding: 5px 9px;
}

.driver-status.boarded,
.driver-status.dropped {
    color: #166534;
    background: #dcfce7;
}

.driver-status.not-boarded,
.driver-status.not-dropped {
    color: #92400e;
    background: #fef3c7;
}

.driver-status.absent,
.driver-status.missed-pickup {
    color: #991b1b;
    background: #fee2e2;
}

.driver-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.driver-row-actions button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.78rem;
}

.driver-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2000;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    font-weight: 900;
}

.driver-toast.is-error {
    background: #dc2626;
}

@media (max-width: 1120px) {
    .driver-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .driver-route-action-card,
    .driver-layout-grid,
    .driver-student-row {
        grid-template-columns: 1fr;
    }

    .driver-route-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .driver-ops-page {
        gap: 12px;
    }

    .driver-ops-header {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
    }

    .driver-identity {
        align-items: flex-start;
    }

    .driver-avatar {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .driver-meta {
        gap: 6px;
    }

    .driver-kpi-grid,
    .driver-action-grid,
    .driver-route-facts,
    .driver-row-actions {
        grid-template-columns: 1fr;
    }

    .driver-action-btn.scan {
        grid-column: auto;
    }

    .driver-action-btn {
        min-height: 54px;
        font-size: 0.98rem;
    }

    .driver-card,
    .driver-route-action-card {
        padding: 15px;
        border-radius: 16px;
    }

    .driver-toast {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
    }
}

.role-auth-shell {
    --auth-soft: rgba(0, 121, 107, 0.12);
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
    min-height: 0;
    height: min(760px, calc(100dvh - 56px));
    border-radius: 28px;
}

.role-auth-visual {
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 86% 76%, rgba(234, 179, 8, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(6, 78, 59, 0.96), rgba(0, 121, 107, 0.88));
}

.auth-parent.role-auth-shell {
    --auth-soft: rgba(245, 158, 11, 0.15);
}

.auth-parent .role-auth-visual {
    color: #173047;
    background:
        radial-gradient(circle at 16% 18%, rgba(245, 158, 11, 0.18), transparent 24%),
        radial-gradient(circle at 86% 24%, rgba(20, 184, 166, 0.18), transparent 30%),
        linear-gradient(135deg, #fff7ed, #ecfdf5 52%, #eef7ff);
}

.auth-parent .auth-visual .eyebrow,
.auth-parent .portal-pill {
    color: #b45309;
}

.auth-parent .auth-copy,
.auth-parent .role-auth-message p {
    color: #52637a;
}

.role-auth-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.role-auth-brand .brand-mark.logo-brand {
    width: clamp(58px, 8vh, 92px);
    height: clamp(58px, 8vh, 92px);
}

.role-auth-brand h1 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 3.1rem);
    line-height: 1.05;
}

.role-auth-message {
    max-width: 620px;
}

.role-auth-message h2 {
    margin: 0 0 10px;
    font-size: clamp(1.55rem, 3.4vw, 2.45rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.role-auth-message p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 650;
    line-height: 1.65;
}

.portal-pill {
    display: inline-flex;
    width: fit-content;
    padding: 7px 11px;
    border-radius: 999px;
    color: #fef3c7;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-feature-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.auth-feature-strip div,
.auth-trust-row span {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.13);
    font-weight: 850;
}

.auth-feature-strip div {
    min-height: 74px;
    display: grid;
    place-items: center;
    padding: 14px;
    text-align: center;
}

.auth-parent .auth-feature-strip div {
    border-color: rgba(15, 118, 110, 0.14);
    background: rgba(255, 255, 255, 0.72);
}

.role-auth-panel {
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 90% 8%, var(--auth-soft), transparent 27%),
        linear-gradient(180deg, #ffffff, #f8fbfd);
}

.role-auth-panel .panel-heading {
    padding-bottom: 10px;
}

.role-auth-panel .panel-heading h2 {
    margin-top: 4px;
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    line-height: 1.08;
}

.role-auth-panel .panel-heading p:not(.eyebrow) {
    margin: 8px 0 0;
    color: #64748b;
    font-weight: 650;
    line-height: 1.5;
}

.compact-logo {
    display: none;
    width: clamp(58px, 10vh, 74px);
    height: clamp(58px, 10vh, 74px);
    margin-bottom: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.compact-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-parent .compact-logo {
    display: block;
    width: clamp(68px, 11vh, 92px);
    height: clamp(68px, 11vh, 92px);
}

.auth-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}

.auth-trust-row span {
    padding: 7px 10px;
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.16);
    background: #ecfdf5;
    font-size: 0.78rem;
}

.role-login-form {
    gap: 8px;
    margin-top: 18px;
}

.role-login-form input[type="text"],
.role-login-form input[type="password"] {
    border-radius: 12px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px !important;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    color: var(--auth-accent);
    background: transparent;
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--auth-accent);
    background: transparent;
    transform: translateY(-50%);
}

.password-toggle svg,
.password-toggle img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    fill: currentColor;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.role-login-form button[type="submit"] {
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-accent), var(--primary-dark));
}

.auth-parent .role-login-form button[type="submit"] {
    background: linear-gradient(135deg, #f59e0b, var(--primary));
}

.role-auth-shell:not(.auth-parent) {
    grid-template-columns: 1.16fr 0.91fr;
    width: min(96vw, 1460px);
    height: min(92dvh, 810px);
    min-height: 560px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.role-auth-shell:not(.auth-parent) .role-auth-visual {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: clamp(10px, 1.7vh, 17px);
    overflow: hidden;
    padding: clamp(28px, 5vw, 64px);
    color: #fff;
    background:
        radial-gradient(circle at 94% 4%, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at 4% 96%, rgba(255, 255, 255, 0.08), transparent 23%),
        linear-gradient(145deg, #064e45 0%, #006b5f 54%, #008471 100%);
}

.role-auth-shell:not(.auth-parent) .role-auth-pattern {
    position: absolute;
    width: 90px;
    height: 90px;
    opacity: 0.36;
    background-image: radial-gradient(circle, rgba(144, 238, 219, 0.72) 2px, transparent 2.5px);
    background-size: 18px 18px;
}

.role-auth-shell:not(.auth-parent) .role-auth-pattern.is-top {
    top: 58px;
    right: 58px;
}

.role-auth-shell:not(.auth-parent) .role-auth-pattern.is-bottom {
    bottom: 58px;
    left: 58px;
}

.role-auth-shell:not(.auth-parent) .role-auth-logo {
    position: relative;
    z-index: 1;
    width: clamp(250px, 34vw, 440px);
    max-height: 43vh;
    object-fit: contain;
    filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.22));
}

.role-auth-shell:not(.auth-parent) .role-auth-short {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fde047;
    font-size: clamp(0.9rem, 1.4vw, 1.15rem);
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.role-auth-shell:not(.auth-parent) .role-auth-visual h1 {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.55rem, 4.85vw, 4.7rem);
    font-weight: 850;
    line-height: 1.16;
    text-align: center;
    text-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.role-auth-shell:not(.auth-parent) .role-auth-divider {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(360px, 58%);
    margin-top: 6px;
}

.role-auth-shell:not(.auth-parent) .role-auth-divider span {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.72);
}

.role-auth-shell:not(.auth-parent) .role-auth-divider b {
    width: 14px;
    height: 14px;
    background: #fff;
    transform: rotate(45deg);
}

.role-auth-shell.auth-teacher .role-auth-divider span,
.role-auth-shell.auth-teacher .role-auth-divider b {
    background: #fde047;
}

.role-auth-shell:not(.auth-parent) .role-auth-place {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.35rem, 2.25vw, 2rem);
    font-weight: 650;
    text-align: center;
}

.role-auth-shell:not(.auth-parent) .role-auth-panel {
    display: grid;
    place-items: center;
    padding: clamp(28px, 5vw, 74px);
    background:
        radial-gradient(circle at 86% 10%, rgba(0, 121, 107, 0.07), transparent 25%),
        linear-gradient(180deg, #ffffff, #fbfdff);
}

.role-login-card {
    width: min(100%, 500px);
}

.role-login-symbol {
    display: grid;
    grid-template-columns: 1fr 84px 1fr;
    align-items: center;
    gap: 18px;
    margin: 0 auto 20px;
}

.role-login-symbol span {
    height: 2px;
    background: #cbd5e1;
}

.role-login-symbol svg,
.role-login-symbol .login-symbol-img {
    width: 84px;
    height: 84px;
    padding: 21px;
    color: var(--primary);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    border-radius: 999px;
    background: radial-gradient(circle at 34% 20%, #fef9c3, #dff8ee 64%, #eaf7f2);
    object-fit: contain;
}

.role-auth-shell.auth-admin .role-login-symbol svg,
.role-auth-shell.auth-admin .role-login-symbol .login-symbol-img {
    background: transparent;
    border-radius: 0;
}

.role-auth-shell:not(.auth-parent) .panel-heading {
    margin-bottom: clamp(26px, 4vh, 42px);
    padding: 0;
    text-align: center;
}

.role-auth-shell:not(.auth-parent) .panel-heading .eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-weight: 950;
    letter-spacing: 0.03em;
}

.role-auth-shell:not(.auth-parent) .panel-heading h2 {
    margin: 0;
    color: #07182f;
    font-size: clamp(1.75rem, 2.7vw, 2.45rem);
    font-weight: 950;
    line-height: 1.05;
}

.role-auth-shell.auth-admin .panel-heading h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.role-auth-shell:not(.auth-parent) .panel-heading p:not(.eyebrow) {
    max-width: 340px;
    margin: 12px auto 0;
    color: #64748b;
    font-size: clamp(1rem, 1.45vw, 1.18rem);
    font-weight: 650;
    line-height: 1.45;
}

.role-auth-shell.auth-admin .panel-heading p:not(.eyebrow) {
    display: none;
}

.role-auth-shell:not(.auth-parent) .role-login-form {
    gap: 14px;
    margin-top: 0;
}

.role-auth-shell:not(.auth-parent) .role-login-form label {
    color: #17233a;
    font-size: clamp(0.95rem, 1.25vw, 1.08rem);
    font-weight: 850;
}

.role-input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.role-input-field > svg,
.role-input-field > .login-field-icon {
    position: absolute;
    left: 22px;
    width: 26px;
    height: 26px;
    color: #64748b;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    object-fit: contain;
}

.role-auth-shell:not(.auth-parent) .role-login-form input[type="text"],
.role-auth-shell:not(.auth-parent) .role-login-form input[type="password"] {
    width: 100%;
    min-height: 72px;
    padding: 0 58px 0 72px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #fff;
    color: #07182f;
    font-size: clamp(1rem, 1.45vw, 1.18rem);
    font-weight: 650;
    box-shadow: none;
}

.role-auth-shell:not(.auth-parent) .role-login-form input::placeholder {
    color: #8a97a8;
}

.role-auth-shell:not(.auth-parent) .password-toggle {
    right: 16px;
    width: 42px;
    height: 42px;
    color: #64748b;
    border-radius: 12px;
}

.role-auth-shell:not(.auth-parent) .password-toggle:hover {
    color: var(--primary);
    background: transparent;
}

.role-auth-shell:not(.auth-parent) .role-login-form .form-row {
    margin: 2px 0 12px;
}

.role-auth-shell:not(.auth-parent) .role-login-form .check {
    gap: 10px;
    color: #17233a;
    font-size: 1rem;
    font-weight: 750;
}

.role-auth-shell:not(.auth-parent) .role-login-form .check input {
    width: 18px;
    height: 18px;
}

.role-auth-shell:not(.auth-parent) .role-login-form button[type="submit"] {
    min-height: 74px;
    border-radius: 16px;
    background: linear-gradient(135deg, #07977f, #006b5f);
    font-size: clamp(1.08rem, 1.6vw, 1.35rem);
    font-weight: 950;
    box-shadow: 0 18px 34px rgba(0, 121, 107, 0.24);
}

.role-help-line {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    align-items: center;
    gap: 16px;
    margin: clamp(34px, 7vh, 66px) 0 16px;
}

.role-help-line span {
    height: 2px;
    background: #d7dee8;
}

.role-help-line svg {
    width: 30px;
    height: 30px;
    color: #94a3b8;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.role-help-text {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.parent-auth-shell {
    display: grid;
    grid-template-columns: 1.18fr 0.86fr;
    width: min(96vw, 1420px);
    height: min(92dvh, 820px);
    min-height: 580px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(236, 253, 245, 0.9)),
        repeating-linear-gradient(135deg, rgba(15, 118, 110, 0.04) 0 1px, transparent 1px 18px);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.parent-auth-brand-panel {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: clamp(10px, 1.6vh, 18px);
    overflow: hidden;
    padding: clamp(24px, 5vw, 64px);
    text-align: center;
    background:
        radial-gradient(circle at 0 2%, rgba(245, 158, 11, 0.24), transparent 30%),
        radial-gradient(circle at 95% 0, rgba(217, 249, 244, 0.95), transparent 34%),
        radial-gradient(circle at 0 100%, rgba(255, 255, 255, 0.68), transparent 20%),
        radial-gradient(circle at 100% 100%, rgba(20, 184, 166, 0.13), transparent 28%),
        linear-gradient(135deg, #fff9e9, #e7fbf7 48%, #dcfaf6);
}

.parent-auth-brand-panel::before,
.parent-auth-brand-panel::after {
    position: absolute;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.44);
    content: "";
}

.parent-auth-brand-panel::before {
    left: -42px;
    bottom: -38px;
}

.parent-auth-brand-panel::after {
    right: -44px;
    top: -42px;
}

.parent-auth-pattern {
    position: absolute;
    width: 106px;
    height: 106px;
    opacity: 0.42;
    background-image: radial-gradient(var(--primary) 2px, transparent 2px);
    background-size: 18px 18px;
}

.parent-auth-pattern.is-top {
    top: 82px;
    left: 36px;
}

.parent-auth-pattern.is-bottom {
    right: 54px;
    bottom: 54px;
}

.parent-auth-logo {
    position: relative;
    z-index: 1;
    width: clamp(220px, 30vw, 410px);
    max-height: 44vh;
    object-fit: contain;
    filter: drop-shadow(0 18px 24px rgba(8, 47, 73, 0.16));
}

.parent-auth-short {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #d97706;
    font-size: clamp(0.86rem, 1.25vw, 1.05rem);
    font-weight: 950;
    text-transform: uppercase;
}

.parent-auth-brand-panel h1 {
    position: relative;
    z-index: 1;
    max-width: 710px;
    margin: 0;
    color: #075b5d;
    font-size: clamp(2.15rem, 5.2vw, 4.2rem);
    font-weight: 950;
    line-height: 1.12;
    text-shadow: 0 8px 24px rgba(15, 118, 110, 0.14);
}

.parent-auth-divider {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(290px, 48%);
    margin-top: 2px;
}

.parent-auth-divider span {
    flex: 1;
    height: 2px;
    background: rgba(15, 118, 110, 0.18);
}

.parent-auth-divider b {
    width: 18px;
    height: 18px;
    background: #f59e0b;
    transform: rotate(45deg);
}

.parent-auth-place {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #075b5d;
    font-size: clamp(1.05rem, 2vw, 1.65rem);
    font-weight: 650;
}

.parent-auth-place span {
    display: block;
}

.parent-auth-form-panel {
    display: grid;
    place-items: center;
    padding: clamp(24px, 5vw, 58px);
    background:
        radial-gradient(circle at 100% 0, rgba(20, 184, 166, 0.09), transparent 30%),
        linear-gradient(180deg, #ffffff, #fbfdff);
}

.parent-login-card {
    width: min(100%, 458px);
    padding: 26px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.parent-login-symbol {
    display: grid;
    grid-template-columns: 1fr 82px 1fr;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}

.parent-login-symbol span,
.parent-help-line span {
    height: 2px;
    background: #d6e3ec;
}

.parent-login-symbol svg,
.parent-login-symbol .login-symbol-img {
    width: 82px;
    height: 82px;
    padding: 22px;
    border-radius: 50%;
    color: var(--primary);
    background: radial-gradient(circle at 70% 28%, rgba(245, 158, 11, 0.2), transparent 34%), #e8faf6;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    object-fit: contain;
}

.parent-login-heading {
    margin-bottom: clamp(22px, 4vh, 34px);
    text-align: center;
}

.parent-login-heading p {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 950;
}

.parent-login-heading h2 {
    margin: 0;
    color: #071833;
    font-size: clamp(1.9rem, 3vw, 2.42rem);
    font-weight: 950;
    line-height: 1;
}

.parent-login-heading span {
    display: block;
    margin-top: 12px;
    color: #667085;
    font-size: clamp(0.98rem, 1.3vw, 1.14rem);
    font-weight: 650;
}

.parent-login-form {
    display: grid;
    gap: 12px;
    margin: 0;
}

.parent-login-form label {
    color: #071833;
    font-weight: 900;
}

.parent-input-field {
    position: relative;
}

.parent-input-field > svg:first-child,
.parent-input-field > .login-field-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    width: 24px;
    height: 24px;
    color: #34495e;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    transform: translateY(-50%);
    pointer-events: none;
    object-fit: contain;
}

.parent-login-form .parent-input-field input {
    width: 100%;
    height: 58px;
    padding: 0 58px 0 64px !important;
    border: 1px solid #d4e0ea;
    border-radius: 18px !important;
    background: #fff;
    color: #071833;
    font-size: 1rem;
    font-weight: 700;
    outline: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.03);
}

.parent-input-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1), 0 10px 26px rgba(15, 23, 42, 0.06);
}

.parent-input-field .password-toggle {
    right: 16px;
    width: 42px;
    height: 42px;
    color: #34495e;
}

.role-login-form .password-toggle,
.role-login-form .password-toggle:hover,
.role-login-form .password-toggle:focus,
.role-login-form .password-toggle:active,
.role-login-form .password-toggle.is-visible,
.parent-login-form .password-toggle,
.parent-login-form .password-toggle:hover,
.parent-login-form .password-toggle:focus,
.parent-login-form .password-toggle:active,
.parent-login-form .password-toggle.is-visible,
.role-auth-shell:not(.auth-parent) .password-toggle,
.role-auth-shell:not(.auth-parent) .password-toggle:hover,
.role-auth-shell:not(.auth-parent) .password-toggle:focus,
.role-auth-shell:not(.auth-parent) .password-toggle:active,
.role-auth-shell:not(.auth-parent) .password-toggle.is-visible,
.parent-input-field .password-toggle,
.parent-input-field .password-toggle:hover,
.parent-input-field .password-toggle:focus,
.parent-input-field .password-toggle:active,
.parent-input-field .password-toggle.is-visible {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
}

.parent-login-form .form-row {
    margin: 2px 0 10px;
}

.parent-login-form .check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #26364a;
    font-weight: 850;
}

.parent-login-form .check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.parent-login-form button[type="submit"] {
    height: 58px;
    border: 0;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #b7a528 38%, #0f8f80 100%);
    box-shadow: 0 18px 30px rgba(245, 158, 11, 0.2);
    font-size: 1.05rem;
    font-weight: 950;
}

.parent-login-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(15, 118, 110, 0.2);
}

.parent-help-line {
    display: grid;
    grid-template-columns: 1fr 34px 1fr;
    align-items: center;
    gap: 18px;
    margin: clamp(36px, 6vh, 68px) 0 16px;
}

.parent-help-line svg {
    width: 34px;
    height: 34px;
    padding: 5px;
    color: #475569;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.parent-help-text {
    margin: 0;
    color: #667085;
    font-weight: 650;
    text-align: center;
}

@media (max-width: 900px) {
    .auth-page {
        padding: 0;
    }

    .role-auth-shell {
        grid-template-columns: 1fr;
        height: 100dvh;
        border-radius: 0;
    }

    .role-auth-panel,
    .auth-parent .role-auth-panel {
        order: -1;
        padding: clamp(18px, 4vh, 32px) 24px;
    }

    .role-auth-visual {
        display: none;
    }

    .parent-auth-shell {
        grid-template-columns: 1fr;
        width: min(100vw, 520px);
        height: auto;
        min-height: 100dvh;
        overflow-y: auto;
        border-radius: 0;
    }

    .parent-auth-form-panel {
        order: 2;
        place-items: start center;
        padding: 8px 24px 28px;
    }

    .parent-auth-brand-panel {
        display: grid;
        order: 1;
        min-height: auto;
        gap: 10px;
        padding: 42px 24px 12px;
        background:
            radial-gradient(circle at 50% 18%, rgba(15, 118, 110, 0.12), transparent 30%),
            radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.92), transparent 34%),
            linear-gradient(180deg, #ffffff, #f6fffc);
    }

    .parent-auth-brand-panel::before,
    .parent-auth-brand-panel::after {
        display: none;
    }

    .parent-auth-pattern {
        opacity: 0.14;
        transform: scale(0.72);
    }

    .parent-auth-pattern.is-top {
        top: 72px;
        left: auto;
        right: 42px;
    }

    .parent-auth-pattern.is-bottom {
        display: none;
    }

    .parent-auth-logo {
        width: clamp(96px, 25vw, 110px);
        max-height: clamp(96px, 25vw, 110px);
        padding: 10px;
        border-radius: 999px;
        background: #ffffff;
        box-shadow: 0 0 0 22px rgba(15, 118, 110, 0.08), 0 14px 28px rgba(15, 23, 42, 0.08);
    }

    .parent-auth-short {
        display: grid;
        gap: 0;
        margin-top: 22px;
        color: #065f46;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: clamp(2.25rem, 10.7vw, 2.625rem);
        font-weight: 800;
        letter-spacing: -1px;
        line-height: 1.14;
        text-transform: uppercase;
    }

    .parent-auth-brand-panel h1 {
        display: none;
    }

    .parent-auth-divider {
        width: min(72vw, 340px);
        margin: 12px auto 2px;
    }

    .parent-auth-divider b {
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: #94a3b8;
        transform: none;
    }

    .parent-auth-place {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: #64748b;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5;
        max-width: 360px;
    }

    .parent-auth-place::before {
        content: "⌖";
        color: var(--primary);
        font-size: 1.05rem;
    }

    .parent-login-card {
        width: min(100%, 430px);
    }

    .parent-login-symbol {
        display: none;
    }

    .parent-login-heading {
        margin-bottom: 26px;
    }

    .parent-login-heading p {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 22px;
        padding: 8px 18px;
        border-radius: 999px;
        color: var(--primary);
        background: #dcfce7;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 0.875rem;
        font-weight: 700;
        letter-spacing: 1.2px;
        text-transform: uppercase;
    }

    .parent-login-heading h2 {
        color: #0f172a;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: clamp(2.375rem, 10vw, 2.75rem);
        font-weight: 800;
        letter-spacing: -1px;
        line-height: 1.18;
    }

    .parent-login-heading span {
        margin-top: 14px;
        color: #64748b;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1.25rem;
        font-weight: 500;
        line-height: 1.5;
    }

    .parent-login-form label {
        color: #0f172a;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1.0625rem;
        font-weight: 600;
        line-height: 1.42;
    }

    .parent-input-field input {
        color: #0f172a;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1.125rem;
        font-weight: 500;
        line-height: 1.35;
    }

    .parent-input-field input::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

    .parent-login-form .check {
        color: #334155;
        font-size: 1.0625rem;
        font-weight: 500;
    }

    .parent-login-form button[type="submit"] {
        height: 64px;
        border-radius: 18px;
        background: linear-gradient(135deg, var(--primary), #22c55e);
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1.375rem;
        font-weight: 700;
        letter-spacing: -0.2px;
        line-height: 1.27;
    }

    .parent-help-line {
        margin: 36px 0 14px;
    }

    .parent-help-text {
        color: #64748b;
        font-family: Inter, "Segoe UI", sans-serif;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5;
    }
}

@media (max-height: 680px) {
    .role-auth-shell {
        height: calc(100dvh - 24px);
    }

    .role-auth-visual,
    .role-auth-panel {
        padding: 30px;
    }

    .role-auth-brand h1 {
        font-size: clamp(1.35rem, 2.7vw, 2.5rem);
    }

    .role-auth-message h2 {
        font-size: clamp(1.35rem, 3vw, 2rem);
    }

    .role-auth-message p,
    .role-auth-panel .panel-heading p:not(.eyebrow) {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .role-login-form input[type="text"],
    .role-login-form input[type="password"] {
        height: 44px;
    }

    .role-login-form button[type="submit"] {
        height: 46px;
    }

    .parent-auth-shell {
        height: calc(100dvh - 24px);
        min-height: 0;
    }

    .parent-auth-logo {
        width: clamp(160px, 22vw, 260px);
        max-height: 32vh;
    }

    .parent-auth-brand-panel {
        gap: 8px;
    }

    .parent-auth-brand-panel h1 {
        font-size: clamp(1.7rem, 4vw, 3rem);
    }

    .parent-auth-place {
        font-size: 1rem;
    }

    .parent-auth-form-panel {
        padding: 24px 42px;
    }

    .parent-login-symbol {
        grid-template-columns: 1fr 58px 1fr;
        margin-bottom: 10px;
    }

    .parent-login-symbol svg {
        width: 58px;
        height: 58px;
        padding: 16px;
    }

    .parent-login-heading {
        margin-bottom: 16px;
    }

    .parent-login-heading h2 {
        font-size: 1.65rem;
    }

    .parent-input-field input,
    .parent-login-form button[type="submit"] {
        height: 52px;
    }

    .parent-login-form {
        gap: 8px;
    }

    .parent-help-line {
        margin: 20px 0 8px;
    }
}

@media (max-width: 390px) {
    .parent-auth-short {
        font-size: 2.25rem;
        line-height: 1.17;
    }

    .parent-login-heading h2 {
        font-size: 2.375rem;
        line-height: 1.21;
    }
}

@media (max-width: 900px) {
    .parent-auth-shell {
        display: block;
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto;
    }

    .parent-auth-brand-panel {
        position: relative;
        z-index: 3;
        display: grid;
        min-height: 330px;
        padding: 58px 24px 18px;
        overflow: visible;
    }

    .parent-auth-form-panel {
        position: relative;
        z-index: 1;
        margin-top: 0;
    }

    .parent-auth-logo {
        width: clamp(96px, 24vw, 110px) !important;
        max-height: clamp(96px, 24vw, 110px) !important;
    }

    .parent-auth-short {
        position: relative;
        z-index: 4;
        display: grid;
        margin-top: 22px;
        white-space: normal;
    }

    .parent-auth-short span {
        display: block;
    }

    .parent-auth-divider,
    .parent-auth-place {
        position: relative;
        z-index: 4;
    }
}

@media (max-width: 900px) {
    .role-auth-shell:not(.auth-parent) {
        width: 100vw;
        height: 100dvh;
        min-height: 0;
        border-radius: 0;
    }

    .role-auth-shell:not(.auth-parent) .role-auth-panel {
        padding: clamp(16px, 4vh, 28px) 22px;
    }

    .role-login-card {
        width: min(100%, 430px);
    }

    .role-login-symbol {
        grid-template-columns: 1fr 66px 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }

    .role-login-symbol svg {
        width: 66px;
        height: 66px;
        padding: 17px;
    }

    .role-auth-shell:not(.auth-parent) .panel-heading {
        margin-bottom: 22px;
    }

    .role-auth-shell:not(.auth-parent) .panel-heading h2 {
        font-size: 1.75rem;
    }

    .role-auth-shell:not(.auth-parent) .panel-heading p:not(.eyebrow) {
        font-size: 1rem;
    }

    .role-auth-shell:not(.auth-parent) .role-login-form input[type="text"],
    .role-auth-shell:not(.auth-parent) .role-login-form input[type="password"],
    .role-auth-shell:not(.auth-parent) .role-login-form button[type="submit"] {
        min-height: 58px;
    }

    .role-help-line {
        margin: 26px 0 10px;
    }
}

@media (max-height: 680px) {
    .role-auth-shell:not(.auth-parent) {
        height: calc(100dvh - 24px);
    }

    .role-auth-shell:not(.auth-parent) .role-auth-visual,
    .role-auth-shell:not(.auth-parent) .role-auth-panel {
        padding: 24px;
    }

    .role-auth-shell:not(.auth-parent) .role-auth-logo {
        width: clamp(185px, 26vw, 290px);
        max-height: 34vh;
    }

    .role-auth-shell:not(.auth-parent) .role-auth-visual h1 {
        font-size: clamp(2rem, 4vw, 3.25rem);
    }

    .role-auth-shell:not(.auth-parent) .role-auth-place {
        font-size: 1.1rem;
    }

    .role-login-symbol {
        grid-template-columns: 1fr 58px 1fr;
        margin-bottom: 10px;
    }

    .role-login-symbol svg {
        width: 58px;
        height: 58px;
        padding: 15px;
    }

    .role-auth-shell:not(.auth-parent) .panel-heading {
        margin-bottom: 16px;
    }

    .role-auth-shell:not(.auth-parent) .panel-heading p:not(.eyebrow) {
        margin-top: 6px;
    }

    .role-auth-shell:not(.auth-parent) .role-login-form {
        gap: 8px;
    }

    .role-auth-shell:not(.auth-parent) .role-login-form input[type="text"],
    .role-auth-shell:not(.auth-parent) .role-login-form input[type="password"],
    .role-auth-shell:not(.auth-parent) .role-login-form button[type="submit"] {
        min-height: 52px;
        height: 52px;
    }

    .role-help-line {
        margin: 20px 0 8px;
    }
}

@media (max-width: 1280px) {
    .staff-portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-route-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .driver-duty-grid {
        grid-template-columns: 1fr;
    }

    .driver-duty-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .staff-portal-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .staff-portal-identity {
        align-items: flex-start;
    }

    .secure-payroll-form,
    .staff-portal-grid,
    .staff-route-grid,
    .driver-duty-card {
        grid-template-columns: 1fr;
    }
}

/* Responsive Android-style ERP drawer shell */
.mobile-menu-btn,
.mobile-drawer-overlay,
.drawer-close-btn,
.drawer-user-card,
.drawer-mobile-actions {
    display: none;
}

.erp-nav > a.active::before,
.nav-toggle.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: #facc15;
}

.premium-page .erp-nav .sub-nav a.active {
    color: #ffffff;
    border-left-color: #facc15;
    background: rgba(255, 255, 255, 0.12);
}

.premium-page .erp-nav .sub-nav a.active::before {
    content: none;
}

body.drawer-lock {
    overflow: hidden;
}

.student-mobile-card-list {
    display: none;
}

.student-table-desktop .premium-student-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
}

@media (min-width: 1024px) {
    .erp-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 270px !important;
        height: 100vh !important;
        min-height: 100vh !important;
    }

    .erp-main {
        margin-left: 270px !important;
    }

    .erp-page.sidebar-collapsed .erp-sidebar {
        width: 92px !important;
    }

    .erp-page.sidebar-collapsed .erp-main {
        margin-left: 92px !important;
    }
}

@media (max-width: 1023px) {
    .erp-page {
        display: block !important;
        overflow-x: hidden;
    }

    .mobile-menu-btn {
        display: inline-grid;
        width: 44px;
        height: 44px;
        align-content: center;
        justify-items: center;
        gap: 5px;
        border: 1px solid rgba(15, 118, 110, 0.18);
        border-radius: 14px;
        color: var(--primary);
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    .mobile-menu-btn span {
        display: block;
        width: 24px;
        height: 5px;
        border-radius: 999px;
        background: currentColor;
    }

    .mobile-drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 3900;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(2, 6, 23, 0.58);
        transition: opacity 180ms ease;
    }

    .erp-page.drawer-open .mobile-drawer-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .erp-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 4000 !important;
        width: min(280px, 86vw) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding: 18px 14px !important;
        transform: translateX(-105%);
        transition: transform 220ms ease;
        box-shadow: 24px 0 60px rgba(2, 6, 23, 0.32);
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .erp-page.drawer-open .erp-sidebar {
        transform: translateX(0);
    }

    .drawer-close-btn {
        position: absolute;
        top: 14px;
        right: 12px;
        display: inline-grid;
        width: 38px;
        height: 38px;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 12px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.12);
        font-size: 1.45rem;
        line-height: 1;
    }

    .erp-logo {
        margin-bottom: 12px !important;
        padding-right: 44px;
    }

    .erp-logo img {
        width: 48px !important;
        height: 48px !important;
        flex-basis: 48px !important;
    }

    .erp-logo small {
        display: block !important;
    }

    .drawer-user-card {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 58px;
        margin: 0 0 14px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.11);
    }

    .drawer-user-card .avatar {
        display: inline-grid;
        width: 38px;
        height: 38px;
        place-items: center;
        border-radius: 13px;
        color: var(--primary-dark);
        background: var(--primary-soft, #ccfbf1);
        font-weight: 950;
    }

    .drawer-user-card div {
        display: grid;
        min-width: 0;
    }

    .drawer-user-card strong,
    .drawer-user-card small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .drawer-user-card small {
        color: rgba(255, 255, 255, 0.72);
        font-weight: 700;
    }

    .erp-nav {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        padding: 0 0 16px !important;
        overflow: visible !important;
    }

    .erp-nav > a,
    .nav-toggle,
    .nav-collapse-btn {
        min-width: 0 !important;
        min-height: 48px !important;
        grid-template-columns: 24px minmax(0, 1fr) auto !important;
        gap: 12px !important;
        padding: 12px 14px !important;
        border-radius: 13px !important;
        white-space: normal !important;
        font-size: 0.96rem !important;
    }

    .nav-icon,
    .nav-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .nav-group {
        position: static !important;
        display: grid !important;
        gap: 6px !important;
    }

    .sub-nav {
        position: static !important;
        display: none !important;
        min-width: 0 !important;
        margin: 2px 0 4px 18px !important;
        padding: 6px !important;
        border: 0 !important;
        border-left: 1px solid rgba(204, 251, 241, 0.22) !important;
        border-radius: 13px !important;
        background: rgba(0, 77, 68, 0.34) !important;
        box-shadow: none !important;
    }

    .nav-group.open .sub-nav {
        display: grid !important;
    }

    .premium-page .erp-nav .sub-nav a {
        min-height: 46px !important;
        grid-template-columns: 22px minmax(0, 1fr) !important;
        padding: 11px 12px !important;
        border-left: 0 !important;
        border-radius: 11px !important;
        color: rgba(255, 255, 255, 0.82) !important;
        font-size: 0.92rem !important;
    }

    .nav-collapse-btn {
        display: none !important;
    }

    .drawer-mobile-actions {
        display: grid;
        gap: 10px;
        margin-top: 10px;
        padding-top: 12px;
        border-top: 1px solid rgba(204, 251, 241, 0.2);
    }

    .drawer-session-switcher {
        display: grid;
        gap: 7px;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.1);
    }

    .drawer-session-switcher label {
        margin: 0;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .drawer-session-switcher select {
        width: 100%;
        min-height: 46px;
        padding: 9px 12px;
        border: 1px solid rgba(204, 251, 241, 0.32);
        border-radius: 12px;
        color: #073b36;
        background: #ffffff;
        font-weight: 900;
        outline: 0;
    }

    .drawer-logout-link {
        display: grid !important;
        min-height: 48px !important;
        grid-template-columns: 24px minmax(0, 1fr) !important;
        align-items: center;
        gap: 12px;
        padding: 12px 14px !important;
        border: 1px solid rgba(254, 202, 202, 0.24);
        border-radius: 13px !important;
        color: #ffffff !important;
        background: rgba(220, 38, 38, 0.15) !important;
        text-decoration: none;
        font-weight: 850;
    }

    .drawer-logout-link:hover {
        background: rgba(220, 38, 38, 0.24) !important;
        transform: translateX(2px);
    }

    .erp-topbar .session-switcher {
        display: none !important;
    }

    .erp-page.sidebar-collapsed .brand-copy,
    .erp-page.sidebar-collapsed .nav-label,
    .erp-page.sidebar-collapsed .nav-caret {
        width: auto !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .erp-main,
    .erp-page.sidebar-collapsed .erp-main {
        margin-left: 0 !important;
        padding: 84px 18px 20px !important;
    }

    .erp-topbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 3500 !important;
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 10px !important;
        min-height: 66px;
        margin: 0 !important;
        padding: 10px 14px !important;
        border-bottom: 1px solid rgba(203, 213, 225, 0.68);
        background: rgba(247, 251, 253, 0.94) !important;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(18px);
    }

    .erp-topbar > div:first-of-type {
        min-width: 0;
    }

    .breadcrumb-line {
        display: none;
    }

    .erp-topbar h1 {
        overflow: hidden;
        margin: 0 !important;
        color: #07182f;
        font-size: 1.1rem !important;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        width: auto !important;
        align-items: center !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        gap: 8px !important;
    }

    .profile-chip {
        width: auto !important;
        min-height: 42px;
        align-items: center !important;
        flex-direction: row !important;
        padding: 6px;
    }

    .profile-chip .avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .profile-chip div,
    .profile-chip .logout {
        display: none;
    }
}

@media (max-width: 767px) {
    .erp-main,
    .erp-page.sidebar-collapsed .erp-main {
        padding: 78px 10px 18px !important;
    }

    .session-switcher {
        display: none;
    }

    .module-hero,
    .panel,
    .premium-panel {
        border-radius: 16px;
    }

    .students-action-bar {
        display: flex;
        justify-content: stretch;
        margin-bottom: 12px;
    }

    .students-action-bar > div:first-child {
        display: none;
    }

    .students-action-bar .action-cluster {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .students-action-bar .action-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .kpi-tile-grid.student-kpi-grid,
    .kpi-tile-grid:not(.fees-kpi-grid):not(.compact):not(.two-kpi-grid).student-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) {
        min-height: 84px;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-icon {
        width: 42px;
        height: 42px;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy strong {
        font-size: 1.28rem;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy span {
        font-size: 0.78rem;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy small {
        font-size: 0.72rem;
        font-weight: 520;
    }

    .class-card-grid {
        grid-template-columns: 1fr !important;
    }

    .class-tile {
        min-height: 78px;
        padding: 12px;
    }

    .student-table-tools {
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }

    .student-result-count {
        width: 100%;
    }

    .student-filter-form {
        grid-template-columns: 1fr !important;
    }

    .student-table-desktop {
        display: none !important;
    }

    .student-mobile-card-list {
        display: grid;
        gap: 12px;
    }

    .student-mobile-card {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px solid rgba(203, 213, 225, 0.86);
        border-radius: 16px;
        background: linear-gradient(135deg, #ffffff, #f4fbfa);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    }

    .student-mobile-card.is-tc-issued {
        border-color: rgba(220, 38, 38, 0.25);
        background: linear-gradient(135deg, #fff7f7, #ffffff);
    }

    .student-mobile-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .student-mobile-card-head strong {
        display: block;
        color: #07182f;
        font-size: 1rem;
        font-weight: 900;
        line-height: 1.2;
    }

    .student-mobile-card-head small {
        display: block;
        margin-top: 3px;
        color: #64748b;
        font-weight: 750;
    }

    .student-mobile-card .action-btn {
        min-width: 70px;
        min-height: 40px;
        padding: 8px 12px;
    }

    .student-mobile-card dl {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin: 0;
    }

    .student-mobile-card dl div {
        min-width: 0;
        padding: 9px;
        border-radius: 12px;
        background: rgba(241, 245, 249, 0.74);
    }

    .student-mobile-card dt {
        margin: 0 0 3px;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .student-mobile-card dd {
        margin: 0;
        color: #0f172a;
        font-size: 0.86rem;
        font-weight: 760;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .student-mobile-card dl {
        grid-template-columns: 1fr;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 10px;
    }

    .student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-icon {
        width: 38px;
        height: 38px;
    }
}

/* Teacher personal portal uses the same responsive drawer pattern as admin */
.teacher-portal-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 32%),
        linear-gradient(135deg, #eef7f8 0%, #f8fbf7 100%);
}

.teacher-portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: 270px;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px;
    color: #ffffff;
    background: var(--sidebar-grad, linear-gradient(165deg, #073834 0%, var(--primary) 45%, #042f2b 100%));
    scrollbar-width: thin;
    scrollbar-color: rgba(204, 251, 241, 0.5) rgba(255, 255, 255, 0.08);
}

.teacher-portal-sidebar::-webkit-scrollbar {
    width: 8px;
}

.teacher-portal-sidebar::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.teacher-portal-sidebar::-webkit-scrollbar-thumb {
    border: 2px solid rgba(0, 77, 68, 0.72);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(204, 251, 241, 0.9), rgba(94, 234, 212, 0.55));
}

.teacher-portal-main {
    min-width: 0;
    margin-left: 270px;
    padding: 28px;
}

.teacher-portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.teacher-portal-topbar h1 {
    margin: 0;
    color: #07182f;
    font-size: 2rem;
    font-weight: 950;
}

.portal-drawer-nav {
    display: grid;
    gap: 6px;
}

.portal-drawer-nav a {
    position: relative;
    display: grid;
    min-height: 42px;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #eafffb;
    background: transparent;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.portal-drawer-nav a:hover,
.portal-drawer-nav a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(2px);
}

.portal-drawer-nav a.active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 4px;
    border-radius: 999px;
    background: #facc15;
}

.portal-nav-icon,
.portal-nav-icon svg {
    width: 22px;
    height: 22px;
}

.portal-nav-icon {
    display: inline-grid;
    place-items: center;
}

.portal-nav-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-drawer-logout {
    margin-top: 10px;
    border: 1px solid rgba(254, 202, 202, 0.24);
    background: rgba(220, 38, 38, 0.15) !important;
}

@media (min-width: 1024px) {
    .teacher-portal-sidebar .drawer-close-btn,
    .teacher-portal-sidebar .drawer-user-card {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .teacher-portal-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 4000 !important;
        width: min(280px, 86vw) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding: 18px 14px !important;
        transform: translateX(-105%);
        transition: transform 220ms ease;
        box-shadow: 24px 0 60px rgba(2, 6, 23, 0.32);
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .teacher-portal-page.drawer-open .teacher-portal-sidebar {
        transform: translateX(0);
    }

    .teacher-portal-sidebar .drawer-close-btn,
    .teacher-portal-sidebar .drawer-user-card {
        display: flex;
    }

    .teacher-portal-sidebar .drawer-close-btn {
        display: inline-grid;
    }

    .portal-drawer-nav a {
        min-height: 48px;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 14px;
        border-radius: 13px;
        font-size: 0.96rem;
    }

    .teacher-portal-main {
        margin-left: 0;
        padding: 84px 18px 20px;
    }

    .teacher-portal-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 3500;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 66px;
        margin: 0;
        padding: 10px 14px;
        border-bottom: 1px solid rgba(203, 213, 225, 0.68);
        background: rgba(247, 251, 253, 0.94);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(18px);
    }

    .teacher-portal-topbar > div:first-of-type {
        min-width: 0;
    }

    .teacher-portal-topbar h1 {
        overflow: hidden;
        font-size: 1.1rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .teacher-portal-topbar .profile-chip {
        width: auto;
        min-height: 42px;
        align-items: center;
        flex-direction: row;
        padding: 6px;
    }

    .teacher-portal-topbar .profile-chip .avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .teacher-portal-topbar .profile-chip div,
    .teacher-portal-topbar .profile-chip .logout {
        display: none;
    }
}

@media (max-width: 767px) {
    .teacher-portal-main {
        padding: 78px 10px 18px;
    }
}

/* Teacher work dashboard */
.teacher-dashboard {
    display: grid;
    gap: 18px;
}

.teacher-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 85% 15%, rgba(250, 204, 21, 0.18), transparent 28%),
        linear-gradient(135deg, #063d3a, var(--primary));
    color: #ffffff;
    box-shadow: var(--shadow-card);
}

.teacher-dashboard-hero h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    font-weight: 950;
}

.teacher-dashboard-hero .eyebrow,
.teacher-dashboard-hero .teacher-hero-meta {
    color: rgba(255, 255, 255, 0.78);
}

.teacher-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.teacher-hero-meta span {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    font-weight: 800;
}

.teacher-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.teacher-kpi-card {
    display: grid;
    min-height: 104px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.055);
}

.teacher-dash-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft, #ccfbf1);
}

.teacher-dash-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.teacher-kpi-card strong {
    display: block;
    color: #07182f;
    font-size: 1.55rem;
    font-weight: 950;
    line-height: 1;
}

.teacher-kpi-card span {
    display: block;
    margin-top: 4px;
    color: #1f334d;
    font-weight: 900;
}

.teacher-kpi-card small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-weight: 600;
}

.teacher-kpi-card.tone-blue .teacher-dash-icon { color: #2563eb; background: #dbeafe; }
.teacher-kpi-card.tone-green .teacher-dash-icon { color: #15803d; background: #dcfce7; }
.teacher-kpi-card.tone-purple .teacher-dash-icon { color: #7c3aed; background: #f3e8ff; }
.teacher-kpi-card.tone-amber .teacher-dash-icon { color: #d97706; background: #fef3c7; }
.teacher-kpi-card.tone-teal .teacher-dash-icon { color: var(--primary); background: var(--primary-soft, #ccfbf1); }
.teacher-kpi-card.tone-red .teacher-dash-icon { color: #dc2626; background: #fee2e2; }

.teacher-quick-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.teacher-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 14px;
    color: var(--primary);
    background: #ffffff;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.teacher-action .teacher-dash-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
}

.teacher-action.primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #008060);
}

.teacher-action.primary .teacher-dash-icon {
    color: var(--primary);
    background: #ffffff;
}

.teacher-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 14px;
}

.teacher-dashboard-panel {
    margin: 0;
}

.teacher-classes-panel {
    grid-row: span 2;
}

.teacher-class-grid,
.teacher-task-list,
.teacher-notice-list,
.teacher-stat-grid {
    display: grid;
    gap: 10px;
}

.teacher-class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-class-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff, #f7fcfb);
}

.teacher-class-card strong {
    display: block;
    color: #07182f;
    font-size: 1.05rem;
    font-weight: 950;
}

.teacher-class-card small,
.teacher-class-card span {
    display: block;
    color: #64748b;
    font-weight: 650;
}

.teacher-class-card b {
    justify-self: start;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
}

.teacher-class-card b.is-done {
    color: #047857;
    background: #dcfce7;
}

.teacher-class-card b.is-pending {
    color: #b45309;
    background: #fef3c7;
}

.teacher-class-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.teacher-class-actions a {
    min-height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--primary);
    background: #ecfdf5;
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
}

.teacher-task-item,
.teacher-notice-list a {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 14px;
    color: #0f172a;
    background: #ffffff;
    text-decoration: none;
}

.teacher-task-item {
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
}

.teacher-task-item span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #f59e0b;
}

.teacher-task-item.task-urgent span { background: #dc2626; }
.teacher-task-item.task-done span { background: #16a34a; }

.teacher-notice-list a strong {
    color: #07182f;
    font-weight: 900;
}

.teacher-view-all {
    color: var(--primary) !important;
    text-align: center;
    font-weight: 900;
    background: #ecfdf5 !important;
}

.teacher-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-stat-grid article {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
}

.teacher-stat-grid strong {
    display: block;
    color: #07182f;
    font-size: 1.35rem;
    font-weight: 950;
}

.teacher-stat-grid span {
    color: #64748b;
    font-weight: 750;
}

@media (max-width: 1200px) {
    .teacher-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .teacher-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .teacher-dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .teacher-kpi-grid {
        grid-template-columns: 1fr;
    }

    .teacher-quick-actions,
    .teacher-class-grid,
    .teacher-stat-grid {
        grid-template-columns: 1fr;
    }

    .teacher-action {
        justify-content: flex-start;
        min-height: 56px;
    }
}

.module-hero h2 {
    display: none;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

html {
    scroll-behavior: smooth;
}

.student-portal-page:not(.teacher-portal-page) .portal-topbar {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 80;
    width: 100%;
    margin: 0;
    padding: 10px clamp(14px, 4vw, 28px);
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.student-portal-page:not(.teacher-portal-page) .portal-brand {
    min-width: 0;
}

.student-portal-page:not(.teacher-portal-page) .portal-user {
    flex: 0 0 auto;
    justify-content: flex-end;
    width: auto;
}

.student-portal-page:not(.teacher-portal-page) .portal-brand img {
    width: 42px;
    height: 42px;
}

.student-portal-page:not(.teacher-portal-page) .portal-brand strong {
    color: #0f3f3b;
    font-size: 0.98rem;
}

.portal-profile-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-weight: 950;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.student-portal-page:not(.teacher-portal-page) .portal-shell {
    width: min(1120px, calc(100% - 24px));
    padding-top: 14px;
}

.parent-profile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 98;
    display: none;
    background: rgba(15, 23, 42, 0.36);
}

.parent-profile-sheet {
    position: fixed;
    right: clamp(12px, 4vw, 24px);
    top: 68px;
    z-index: 99;
    display: none;
    width: min(360px, calc(100vw - 24px));
    padding: 16px;
    border: 1px solid #dce7ef;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

body.parent-profile-open .parent-profile-backdrop,
body.parent-profile-open .parent-profile-sheet {
    display: block;
}

.parent-sheet-handle {
    display: none;
    width: 46px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #cbd5e1;
}

.parent-sheet-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.parent-sheet-head strong,
.parent-sheet-head small {
    display: block;
}

.parent-sheet-head small {
    color: #64748b;
    font-weight: 750;
}

.parent-sheet-head button {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #64748b;
    background: #f1f5f9;
    font-size: 1.4rem;
    line-height: 1;
}

.parent-sheet-list,
.portal-profile-list {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px 12px;
}

.parent-sheet-list dt,
.portal-profile-list dt {
    color: #64748b;
    font-weight: 400;
}

.parent-sheet-list dd,
.portal-profile-list dd {
    margin: 0;
    color: #0f172a;
    font-weight: 400;
}

.parent-sheet-switch {
    margin-top: 14px;
}

.parent-sheet-switch label {
    display: grid;
    gap: 6px;
    color: #64748b;
    font-weight: 850;
}

.parent-sheet-switch select,
.parent-hero-switch select {
    min-height: 42px;
    border: 1px solid #d7e2ea;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 850;
}

.parent-sheet-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 14px;
    border-radius: 14px;
    color: #991b1b;
    background: #fee2e2;
    font-weight: 900;
    text-decoration: none;
}

.parent-student-hero {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 0 12px;
    padding: 16px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff, #effaf7);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.parent-language-panel {
    margin: 0 0 12px;
    padding: 12px 14px;
}

.parent-language-panel form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.parent-language-panel label {
    margin: 0;
    color: #0f3f3b;
    font-size: 0.92rem;
    font-weight: 800;
}

.parent-language-panel select {
    min-width: 128px;
    min-height: 40px;
    padding: 8px 34px 8px 12px;
    border: 1px solid #cfe1dc;
    border-radius: 12px;
    color: #0f172a;
    background-color: #fff;
    font-weight: 800;
}

.portal-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: var(--primary);
    background: #dff8f2;
    font-size: 1.35rem;
}

.portal-avatar.small {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 1rem;
}

.parent-student-hero h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.45rem, 5vw, 2rem);
    font-weight: 950;
}

.parent-student-hero p {
    margin: 4px 0 0;
    color: #64748b;
    font-weight: 800;
}

.parent-hero-switch {
    margin-left: auto;
}

.parent-section-tabs {
    position: sticky;
    top: 63px;
    z-index: 70;
    display: flex;
    gap: 8px;
    margin: 0 -12px 14px;
    padding: 8px 12px;
    overflow-x: auto;
    background: rgba(246, 249, 251, 0.92);
    backdrop-filter: blur(12px);
}

.parent-section-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #d9e6ee;
    border-radius: 999px;
    color: #0f3f3b;
    background: #fff;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.parent-section-tabs a.active,
.parent-section-tabs a:hover {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.parent-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.parent-summary-card {
    display: grid;
    gap: 7px;
    min-height: 124px;
    padding: 15px;
    border: 1px solid #dce7ef;
    border-radius: 18px;
    color: #0f172a;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.parent-summary-card span,
.parent-summary-card small {
    color: #64748b;
    font-weight: 800;
}

.parent-summary-card strong {
    font-size: 1.14rem;
    font-weight: 950;
}

.parent-summary-card i,
.parent-result-marks i {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.parent-summary-card i b,
.parent-result-marks i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #22c55e);
}

.parent-overview-updates {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.parent-overview-updates a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #0f172a;
    background: #f8fafc;
    font-weight: 850;
    text-decoration: none;
}

.parent-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.parent-section-title-row a {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 850;
    text-decoration: none;
}

.parent-result-card,
.parent-homework-card,
.parent-collapsible {
    border-radius: 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-card {
    padding: 14px;
    border: 1px solid #dce7ef;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff, #fbfefd);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.parent-homework-card summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.parent-homework-card summary::-webkit-details-marker,
.parent-collapsible summary::-webkit-details-marker {
    display: none;
}

.parent-homework-title {
    min-width: 0;
    display: grid;
    gap: 8px;
    justify-items: start;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
}

.parent-homework-instructions {
    border-top: 1px solid #e2e8f0;
    color: #1f2937 !important;
    font-size: 0.96rem;
    font-weight: 500 !important;
    line-height: 1.7;
    margin: 12px 0 0 !important;
    padding-top: 12px;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-card .table-pill {
    justify-self: start;
    margin-top: 0;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.parent-homework-card .parent-homework-detail {
    display: grid;
    margin-top: 12px;
    padding-top: 0;
    border-top: 1px solid #e2e8f0;
}

.parent-homework-info-row {
    display: grid;
    grid-template-columns: 34px minmax(88px, 0.8fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 56px;
    border-bottom: 1px solid #e2e8f0;
}

.parent-homework-info-row:last-of-type {
    border-bottom: 0;
}

.parent-homework-row-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #dff8f2;
}

.parent-homework-row-icon::before {
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 900;
}

.homework-due-row .parent-homework-row-icon::before,
.homework-assigned-row .parent-homework-row-icon::before {
    content: "□";
}

.homework-remarks-row .parent-homework-row-icon::before {
    content: "✓";
}

.parent-homework-info-row small {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 650;
}

.parent-homework-info-row strong {
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 650;
    justify-self: end;
    text-align: right;
}

.parent-collapsible {
    margin-top: 16px;
    border: 1px solid #dce7ef;
    background: #fff;
}

.parent-collapsible summary {
    padding: 13px 15px;
    color: var(--primary);
    font-weight: 950;
    cursor: pointer;
}

.parent-friendly-empty {
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
}

.parent-homework-tabs {
    align-items: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 0 12px;
    width: 100%;
    padding: 3px;
    border: 1px solid #dce7ef;
    border-radius: 999px;
    background: #f8fafc;
}

.parent-homework-tabs button {
    align-items: center;
    align-self: stretch;
    display: flex;
    justify-content: center;
    margin: 0;
    min-height: 30px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    color: #476175;
    background: transparent;
    font-weight: 850;
    line-height: 1;
    text-align: center;
}

.parent-homework-tabs button.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.parent-homework-cards[data-parent-homework-pane] {
    display: none;
}

.parent-homework-cards[data-parent-homework-pane].active,
.parent-homework-cards.active {
    display: grid;
}

.parent-pane-note {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 750;
}

.parent-history-drawer {
    margin-top: 14px;
    border: 1px solid #dce7ef;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}

.parent-history-drawer > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    color: #0f172a;
    cursor: pointer;
    font-weight: 850;
    list-style: none;
}

.parent-history-drawer > summary::-webkit-details-marker {
    display: none;
}

.parent-history-drawer > summary span {
    min-width: 30px;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: #dff8f2;
    text-align: center;
}

.parent-history-drawer > div {
    padding: 0 14px 14px;
}

.student-portal-page:not(.teacher-portal-page) .portal-panel {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
}

.parent-result-group-title {
    margin: 8px 0 2px;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 950;
}

@media (max-width: 900px) {
    .parent-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-portal-page:not(.teacher-portal-page) .portal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .student-portal-page:not(.teacher-portal-page) .portal-shell {
        width: min(100% - 18px, 520px);
    }

    .parent-profile-sheet {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 14px 16px 18px;
        border-radius: 24px 24px 0 0;
    }

    .parent-sheet-handle {
        display: block;
    }

    .parent-student-hero {
        padding: 13px;
    }

    .parent-student-hero h1 {
        font-size: 1.35rem;
    }

    .parent-hero-switch {
        display: none;
    }

    .parent-section-tabs {
        top: 63px;
    }

    .parent-overview-grid,
    .parent-homework-summary,
    .fee-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .parent-result-card-summary {
        grid-template-columns: 48px 1fr auto;
    }

    .parent-result-marks,
    .parent-result-percent,
    .parent-result-grade {
        grid-column: 2 / -1;
    }

    .portal-notice-grid {
        grid-template-columns: 1fr;
    }

    .parent-homework-card summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-homework-card h3 {
        font-size: 1rem;
    }

    .parent-homework-instructions {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .parent-homework-info-row {
        grid-template-columns: 32px minmax(74px, 0.8fr) minmax(0, 1fr);
        min-height: 54px;
    }

    .parent-homework-info-row strong {
        font-size: 0.82rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
}

/* Parent portal exam results */
.student-portal-page:not(.teacher-portal-page) .parent-results-panel {
    color: #0f172a;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-cards {
    display: grid;
    gap: 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-group-title {
    margin: 8px 0 0;
    color: #12233d;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card {
    border: 1px solid #dbe4ed;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
    position: relative;
    display: grid;
    grid-template-columns: 78px minmax(145px, 1.1fr) minmax(145px, 0.85fr) minmax(110px, 0.65fr) minmax(108px, 0.65fr) 28px;
    align-items: center;
    gap: 22px;
    min-height: 164px;
    padding: 28px 30px;
    list-style: none;
    cursor: pointer;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary::-webkit-details-marker {
    display: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: #e3f8f2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.student-portal-page:not(.teacher-portal-page) .parent-result-icon img {
    width: 52px;
    height: 52px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title h3 {
    margin: 0 0 10px;
    color: #101b31;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title p {
    margin: 0;
    color: #68758a;
    font-size: 1.05rem;
    font-weight: 650;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
    border-left: 2px solid #e1e7ee;
    padding-left: 22px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary .parent-result-icon,
.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary .result-chevron {
    border-left: 0;
    padding-left: 0;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric {
    display: grid;
    gap: 9px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric strong,
.student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
    color: #0f8f76;
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric strong span {
    color: #68758a;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric small {
    color: #68758a;
    font-size: 0.94rem;
    font-weight: 650;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks i {
    width: min(100%, 220px);
    height: 9px;
    border-radius: 999px;
    background: #e5e9ee;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
    min-width: 78px;
    padding: 11px 18px;
    border-radius: 20px;
    background: #dff7f1;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
    color: #12233d;
    font-size: 1rem;
    font-weight: 750;
}

.student-portal-page:not(.teacher-portal-page) .result-chevron {
    color: #101b31;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.2s ease;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card[open] .result-chevron {
    transform: rotate(90deg);
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail {
    display: grid;
    gap: 18px;
    padding: 0 30px 30px;
    border-top: 0;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid #e1e7ee;
    border-bottom: 1px solid #e1e7ee;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 4px;
    border: 0;
    border-bottom: 1px solid #e1e7ee;
    background: transparent;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span:last-child {
    border-bottom: 0;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #0f8f76;
    background: #dff7f1;
    font-style: normal;
    font-weight: 900;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head em {
    color: #68758a;
    font-style: normal;
    font-weight: 650;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b {
    color: #101b31;
    font-size: 1.02rem;
    font-weight: 750;
    text-align: right;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-highlight-title {
    margin: 0;
    color: #101b31;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 12px 16px;
    border: 1px solid #dbe4ed;
    border-radius: 14px;
    background: #fff;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span {
    color: #12233d;
    font-weight: 800;
    text-transform: uppercase;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    color: #0f8f76;
    font-size: 1.05rem;
    font-weight: 900;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small {
    min-width: 58px;
    color: #68758a;
    font-size: 0.94rem;
    font-weight: 650;
    text-align: right;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-columns: 62px 1fr 22px;
        gap: 14px;
        min-height: 0;
        padding: 20px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
        border-left: 0;
        padding-left: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon {
        width: 58px;
        height: 58px;
        border-radius: 18px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon img {
        width: 44px;
        height: 44px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent,
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        grid-column: 1 / -1;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks i {
        grid-column: 1 / -1;
        width: 100%;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        grid-template-columns: auto 1fr;
        justify-items: start;
        text-align: left;
    }

    .student-portal-page:not(.teacher-portal-page) .result-chevron {
        font-size: 2.4rem;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail {
        padding: 0 20px 22px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span,
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
        grid-template-columns: 34px 1fr;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b,
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong,
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small {
        grid-column: 2;
        text-align: left;
    }
}

/* Last-mile parent exam card fixes */
.student-portal-page:not(.teacher-portal-page),
.student-portal-page:not(.teacher-portal-page) .portal-panel {
    font-family: Inter, "Segoe UI", sans-serif;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .parent-result-card-summary {
    cursor: default;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .result-chevron {
    display: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
    color: var(--primary);
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    grid-template-columns: 1fr minmax(90px, auto) minmax(54px, auto);
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    justify-self: center;
    text-align: center;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas:
            "icon title chevron"
            "marks percent grade";
        grid-template-columns: 44px minmax(0, 1fr) 18px;
        gap: 12px 10px;
        padding: 14px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-icon img { width: 34px; height: 34px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title { grid-area: title; min-width: 0; }
    .student-portal-page:not(.teacher-portal-page) .result-chevron { grid-area: chevron; align-self: center; font-size: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks { grid-area: marks; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent { grid-area: percent; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade { grid-area: grade; grid-column: auto; display: grid; justify-items: center; text-align: center; }

    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
        border-left: 0;
        padding-left: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title h3 { font-size: 18px; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title p { font-size: 12px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained { font-size: 20px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total { font-size: 17px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong { font-size: 20px; line-height: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong { min-width: 48px; padding: 7px 10px; border-radius: 13px; font-size: 19px; line-height: 22px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span em { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b { font-size: 13px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-metric small { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks i { height: 5px; margin-top: 2px; }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
        grid-template-columns: 1fr minmax(76px, auto) minmax(42px, auto);
        gap: 8px;
        padding: 10px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span { font-size: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong { grid-column: auto; font-size: 16px; line-height: 20px; justify-self: center; text-align: center; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small { grid-column: auto; font-size: 12px; text-align: right; }
}

/* Final parent exam-card hierarchy overrides */
.student-portal-page:not(.teacher-portal-page) .parent-result-card,
.student-portal-page:not(.teacher-portal-page) .parent-results-panel {
    font-family: Inter, "Segoe UI", sans-serif;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card {
    border-radius: 16px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
    grid-template-columns: 64px minmax(150px, 1fr) minmax(150px, 0.85fr) minmax(110px, 0.65fr) minmax(96px, 0.55fr) 22px;
    gap: 16px;
    min-height: 136px;
    padding: 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * {
    padding-left: 16px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title h3 {
    margin-bottom: 8px;
    color: #0F172A;
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: -0.3px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-title p {
    color: #64748B;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
    color: #0F172A;
    font-size: 34px;
    font-weight: 700;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash {
    color: #94A3B8;
    font-size: 30px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total {
    color: #64748B;
    font-size: 30px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-metric small {
    color: #64748B;
    font-size: 13px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-percent strong {
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
    min-width: 72px;
    padding: 12px 18px;
    border-radius: 18px;
    color: var(--primary);
    background: #DFF7EF;
    font-size: 30px;
    font-weight: 700;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
    display: grid;
    gap: 1px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span em {
    color: #64748B;
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-grade span b {
    color: #0F172A;
    font-size: 20px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail {
    gap: 14px;
    padding: 0 18px 18px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span {
    min-height: 50px;
    padding: 8px 0;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head em {
    color: #64748B;
    font-size: 15px;
    font-weight: 500;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b {
    color: #0F172A;
    font-size: 15px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span:first-child b {
    padding: 5px 10px;
    border-radius: 999px;
    color: #15803D;
    background: #DCFCE7;
    font-size: 13px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-highlight-title {
    color: #0F172A;
    font-size: 18px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    min-height: 52px;
    padding: 12px;
    border-radius: 12px;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span {
    color: #0F172A;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    color: #0F172A;
    font-size: 22px;
    font-weight: 600;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small {
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
}
/* Parent exam card real final cascade */
.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .parent-result-card-summary { cursor: default; }
.student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .result-chevron { display: none; }
.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained { color: var(--primary); }
.student-portal-page:not(.teacher-portal-page),
.student-portal-page:not(.teacher-portal-page) .portal-panel { font-family: Inter, "Segoe UI", sans-serif; }
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card { grid-template-columns: 1fr minmax(90px, auto) minmax(54px, auto); }
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong { justify-self: center; text-align: center; }
@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas: "icon title chevron" "marks percent grade";
        grid-template-columns: 44px minmax(0, 1fr) 18px;
        gap: 12px 10px;
        padding: 14px;
    }
    .student-portal-page:not(.teacher-portal-page) .parent-result-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-icon img { width: 34px; height: 34px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title { grid-area: title; min-width: 0; }
    .student-portal-page:not(.teacher-portal-page) .result-chevron { grid-area: chevron; align-self: center; font-size: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks { grid-area: marks; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent { grid-area: percent; grid-column: auto; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade { grid-area: grade; grid-column: auto; display: grid; justify-items: center; text-align: center; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary > * + * { border-left: 0; padding-left: 0; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title h3 { font-size: 18px; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-title p { font-size: 12px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained { font-size: 20px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total { font-size: 17px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong { font-size: 20px; line-height: 24px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong { min-width: 48px; padding: 7px 10px; border-radius: 13px; font-size: 19px; line-height: 22px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span em { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b { font-size: 13px; line-height: 16px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-metric small { font-size: 11px; line-height: 14px; }
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks i { height: 5px; margin-top: 2px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card { grid-template-columns: 1fr minmax(76px, auto) minmax(42px, auto); gap: 8px; padding: 10px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card span { font-size: 13px; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong { grid-column: auto; font-size: 16px; line-height: 20px; justify-self: center; text-align: center; }
    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card small { grid-column: auto; font-size: 12px; text-align: right; }
}
/* Parent portal exam/fees final responsive polish */
.student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained,
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    color: var(--primary);
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(82px, auto) minmax(48px, auto);
    align-items: center;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
    justify-self: center;
    text-align: center;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details {
    display: grid;
    justify-items: end;
    border: 0;
    background: transparent;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #dbe4ed;
    border-radius: 14px;
    color: #0F172A;
    background: #ffffff;
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
    list-style: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary::-webkit-details-marker {
    display: none;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details[open] summary span {
    transform: rotate(90deg);
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details > div {
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas:
            "icon title chevron"
            "marks percent grade";
        grid-template-columns: 42px minmax(0, 1fr) 18px;
        gap: 10px 8px;
        padding: 12px;
        align-items: center;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-metric,
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 3px;
        overflow: hidden;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        align-items: center;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks strong {
        display: inline-flex;
        align-items: baseline;
        gap: 2px;
        max-width: 100%;
        white-space: nowrap;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained {
        font-size: 19px;
        line-height: 22px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total {
        font-size: 15px;
        line-height: 18px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong {
        font-size: 19px;
        line-height: 22px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        padding: 6px 8px;
        font-size: 17px;
        line-height: 20px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
        display: grid;
        justify-items: center;
        min-width: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span em,
    .student-portal-page:not(.teacher-portal-page) .parent-result-metric small {
        font-size: 10px;
        line-height: 12px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b {
        font-size: 12px;
        line-height: 14px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head {
        gap: 8px;
        border: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        min-height: 46px;
        padding: 8px 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b {
        grid-column: auto;
        text-align: right;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span:first-child b {
        min-width: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card {
        grid-template-columns: minmax(0, 1fr) minmax(70px, auto) minmax(42px, auto);
    }

    .student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong {
        grid-column: auto;
        justify-self: center;
        color: var(--primary);
        text-align: center;
    }
}
/* Parent mobile WebView final card fit */
@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        grid-template-areas:
            "icon title title"
            "marks percent grade";
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-icon {
        grid-area: icon;
        width: 44px;
        height: 44px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-title {
        grid-area: title;
        align-self: center;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent,
    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
        overflow: hidden;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade {
        align-items: center;
        justify-content: flex-start;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks strong {
        max-width: 100%;
        overflow: hidden;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-obtained,
    .student-portal-page:not(.teacher-portal-page) .parent-result-percent strong {
        font-size: 18px;
        line-height: 22px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-slash,
    .student-portal-page:not(.teacher-portal-page) .parent-result-marks .result-total {
        font-size: 13px;
        line-height: 16px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade strong {
        min-width: 42px;
        padding: 6px 8px;
        font-size: 17px;
        line-height: 20px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span {
        max-width: 100%;
        word-break: normal;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-grade span b {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-card.is-assessment .parent-result-grade span b {
        display: none;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head span {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-detail-head b {
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .premium-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details table,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details thead,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tbody,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tr,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td {
        display: block;
        width: 100%;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details thead {
        display: none;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tr {
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid #dbe4ed;
        border-radius: 14px;
        background: #ffffff;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border: 0;
        color: #0F172A;
        font-size: 13px;
        font-weight: 600;
        text-align: right;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td::before {
        content: attr(data-label);
        color: #64748B;
        font-weight: 500;
        text-align: left;
    }
}
/* Parent portal chevron and fee overflow fixes */
.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
    position: relative;
    padding-right: 52px;
}

.student-portal-page:not(.teacher-portal-page) .parent-result-card-summary .result-chevron {
    position: absolute;
    top: 18px;
    right: 18px;
    grid-area: unset;
}

.student-portal-page:not(.teacher-portal-page) .parent-fees-panel {
    position: relative;
    cursor: pointer;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details {
    display: block;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary span {
    display: inline-block;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details[open] summary span {
    transform: rotate(90deg);
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details .premium-table-wrap {
    cursor: default;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary {
        padding-right: 38px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-result-card-summary .result-chevron {
        top: 12px;
        right: 12px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details summary {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 26px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tr {
        max-width: 100%;
        box-sizing: border-box;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td {
        align-items: flex-start;
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td::before {
        flex: 0 0 92px;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td > *,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td {
        min-width: 0;
    }
}
/* Plain chevrons and contained fee details */
.student-portal-page:not(.teacher-portal-page) .result-chevron,
.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary,
.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary span {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details summary {
    color: #0F172A;
    cursor: pointer;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details .premium-table-wrap {
    width: 100%;
    max-width: 100%;
    margin-top: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    box-sizing: border-box;
}

.student-portal-page:not(.teacher-portal-page) .parent-fee-details table {
    max-width: 100%;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .premium-table-wrap {
        overflow: visible;
        padding: 0;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details table,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tbody {
        max-width: 100%;
        overflow: hidden;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details tr {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details td {
        width: 100%;
        box-sizing: border-box;
    }
}
/* Parent fee history must never inherit desktop table width */
.student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap,
.student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap table {
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 760px) {
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        overflow: visible !important;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap table {
        table-layout: fixed;
        width: 100% !important;
    }

    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap tr,
    .student-portal-page:not(.teacher-portal-page) .parent-fee-details .parent-fee-history-wrap td {
        max-width: 100%;
        overflow: hidden;
    }
}

/* Parent homework cards: strict three-section mobile layout */
.student-portal-page:not(.teacher-portal-page) .parent-homework-card {
    box-sizing: border-box;
    display: block !important;
    overflow: hidden;
    width: 100%;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-card summary {
    box-sizing: border-box;
    display: block !important;
    min-width: 0;
    width: 100%;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-title {
    box-sizing: border-box;
    display: grid !important;
    gap: 8px;
    justify-items: start;
    min-width: 0;
    width: 100% !important;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-title h3 {
    display: block;
    margin: 0;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    width: 100%;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-title .table-pill {
    width: fit-content;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-instructions {
    box-sizing: border-box;
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    width: 100%;
}

.student-portal-page:not(.teacher-portal-page) .parent-homework-detail {
    box-sizing: border-box;
    width: 100%;
}

/* Compact parent login for mobile/WebView */
@media (max-width: 900px) {
    .parent-auth-shell {
        display: grid !important;
        grid-template-rows: auto 1fr;
        width: 100vw;
        height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: 0;
        border-radius: 0;
        background:
            linear-gradient(180deg, rgba(240, 253, 250, 0.95) 0%, rgba(255, 251, 235, 0.88) 44%, #ffffff 100%),
            repeating-linear-gradient(135deg, rgba(15, 118, 110, 0.045) 0 1px, transparent 1px 17px);
        box-shadow: none;
    }

    .parent-auth-brand-panel {
        align-content: start;
        min-height: 0;
        gap: 6px;
        padding: 20px 22px 4px;
        overflow: visible;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 253, 245, 0.38));
    }

    .parent-auth-pattern,
    .parent-auth-brand-panel::before,
    .parent-auth-brand-panel::after {
        display: none !important;
    }

    .parent-auth-logo {
        width: clamp(118px, 32vw, 150px) !important;
        height: clamp(118px, 32vw, 150px) !important;
        max-height: none !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        filter: none !important;
        object-fit: contain;
    }

    .parent-auth-short {
        gap: 0;
        margin: 2px 0 0;
        color: #065f46;
        font-size: 1.75rem !important;
        font-weight: 800;
        letter-spacing: -0.04em;
        line-height: 1.05;
        text-transform: uppercase;
    }

    .parent-auth-divider {
        width: min(70vw, 280px);
        margin: 4px auto 0;
        gap: 10px;
    }

    .parent-auth-divider span {
        height: 1px;
    }

    .parent-auth-divider b {
        width: 6px;
        height: 6px;
    }

    .parent-auth-place {
        display: grid;
        gap: 2px;
        max-width: 330px;
        margin-bottom: 10px;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.18;
        text-align: center;
    }

    .parent-auth-place::before {
        display: none;
    }

    .parent-auth-form-panel {
        align-content: start;
        place-items: start center;
        min-height: 0;
        padding: 14px 24px 12px;
        overflow: visible;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.88) 18%, #ffffff);
    }

    .parent-login-card {
        width: min(100%, 390px);
        padding: 18px;
        border-color: rgba(15, 118, 110, 0.12);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    }

    .parent-login-heading {
        margin-bottom: 10px;
    }

    .parent-login-heading p {
        margin: 0 0 8px;
        padding: 6px 14px;
        font-size: 0.82rem;
        line-height: 1;
        letter-spacing: 0.08em;
    }

    .parent-login-heading h2 {
        margin: 0;
        color: #0f172a;
        font-size: 1.75rem !important;
        font-weight: 800;
        letter-spacing: -0.04em;
        line-height: 1.08;
    }

    .parent-login-heading span {
        margin-top: 6px;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.25;
    }

    .parent-login-form {
        gap: 7px;
    }

    .parent-login-form label,
    .parent-login-form .check,
    .parent-help-text {
        font-size: 1rem;
        line-height: 1.2;
    }

    .parent-login-form label {
        font-weight: 600;
    }

    .parent-input-field > svg:first-child,
    .parent-input-field > .login-field-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }

    .parent-login-form .parent-input-field input {
        height: 42px;
        padding: 0 48px 0 48px !important;
        border-radius: 12px !important;
        font-size: 1rem;
        font-weight: 500;
        box-shadow: none;
    }

    .parent-input-field .password-toggle {
        right: 10px;
        width: 34px;
        height: 34px;
    }

    .password-toggle img {
        width: 21px;
        height: 21px;
    }

    .parent-login-form .form-row {
        margin: 1px 0 4px;
    }

    .parent-login-form .check input {
        width: 15px;
        height: 15px;
    }

    .parent-login-form button[type="submit"] {
        height: 46px;
        margin-top: 2px;
        border-radius: 14px;
        font-size: 1rem;
        font-weight: 800;
        line-height: 1;
        box-shadow: 0 12px 24px rgba(15, 118, 110, 0.16);
    }

    .parent-help-line {
        grid-template-columns: 1fr 28px 1fr;
        gap: 12px;
        margin: 14px 0 8px;
    }

    .parent-help-line svg {
        width: 28px;
        height: 28px;
    }

    .parent-help-text {
        max-width: 290px;
        margin: 0 auto;
        font-weight: 500;
    }
}

@media (max-width: 900px) and (max-height: 720px) {
    .parent-auth-brand-panel {
        padding-top: 12px;
    }

    .parent-auth-logo {
        width: 104px !important;
        height: 104px !important;
    }

    .parent-auth-short {
        font-size: 1.45rem !important;
    }

    .parent-auth-divider {
        display: none;
    }

    .parent-auth-place {
        font-size: 0.86rem;
    }

    .parent-login-heading h2 {
        font-size: 1.55rem !important;
    }

    .parent-login-heading span,
    .parent-login-form label,
    .parent-login-form .check,
    .parent-help-text,
    .parent-input-field input {
        font-size: 0.92rem;
    }

    .parent-login-form .parent-input-field input {
        height: 40px;
    }

    .parent-login-form button[type="submit"] {
        height: 44px;
    }

    .parent-help-line {
        margin-top: 10px;
    }
}

/* Parent portal final typography and result mark colors */
.parent-summary-card span,
.parent-summary-card small {
    font-weight: 500 !important;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card strong.subject-mark-score {
    color: #0f172a !important;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card .subject-obtained {
    color: var(--primary) !important;
}

.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card .subject-slash,
.student-portal-page:not(.teacher-portal-page) .parent-subject-result-card .subject-total {
    color: #0f172a !important;
}

/* ==========================================================================
   Comprehensive Global UI / UX Master Revamp (Forms, Menus, Buttons, Dialogues, Cards & Tables)
   ========================================================================== */

/* 1. Global Typography & Core Elements */
:root {
    --erp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --erp-border: #cbd5e1;
    --erp-border-subtle: #e2e8f0;
    --erp-bg-subtle: #f8fafc;
    --erp-text-main: #0f172a;
    --erp-text-muted: #64748b;
    --erp-radius-sm: 6px;
    --erp-radius-md: 10px;
    --erp-radius-lg: 14px;
    --erp-radius-xl: 18px;
    --erp-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --erp-shadow-md: 0 4px 14px rgba(0,0,0,0.07);
    --erp-shadow-lg: 0 10px 28px rgba(0,0,0,0.10);
}

body.erp-page {
    font-family: var(--erp-font);
    background-color: #f1f5f9;
    color: var(--erp-text-main);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* 2. Revamped Sidebar & Navigation */
.erp-sidebar {
    background: #0f172a;
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
}
.erp-sidebar .erp-logo {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    text-decoration: none;
}
.erp-sidebar .erp-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    padding: 2px;
}
.erp-sidebar .erp-logo .brand-copy strong {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.2px;
}
.erp-sidebar .erp-logo .brand-copy small {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}
.erp-nav a, .erp-nav .nav-toggle {
    border-radius: 8px;
    margin: 3px 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #cbd5e1;
    transition: all 0.18s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.erp-nav a:hover, .erp-nav .nav-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    transform: translateX(2px);
}
.erp-nav a.active, .erp-nav .nav-toggle.active {
    background: var(--primary, #0f766e) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.erp-nav .sub-nav {
    padding-left: 18px;
    border-left: 2px solid rgba(255,255,255,0.1);
    margin: 4px 0 6px 24px;
}
.erp-nav .sub-nav a {
    font-size: 12.8px;
    padding: 6px 10px;
    margin: 2px 0;
}

/* 3. Revamped Topbar & Header */
.erp-topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--erp-border-subtle);
    padding: 14px 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}
.erp-topbar h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--erp-text-main);
    letter-spacing: -0.02em;
    margin: 2px 0 0;
}
.breadcrumb-line {
    font-size: 12px;
    font-weight: 600;
    color: var(--erp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.session-switcher select {
    height: 36px;
    padding: 4px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--erp-border);
    background: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--erp-text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}
.session-switcher select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light, rgba(15, 118, 110, 0.12));
}
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    background: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 30px;
    box-shadow: var(--erp-shadow-sm);
}
.profile-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary, #0f766e);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-chip strong {
    font-size: 12.5px;
    color: var(--erp-text-main);
    display: block;
    line-height: 1.2;
}
.profile-chip small {
    font-size: 10.5px;
    color: var(--erp-text-muted);
    font-weight: 600;
}
.profile-chip .logout {
    font-size: 11.5px;
    font-weight: 700;
    color: #ef4444;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 6px;
    background: #fef2f2;
    transition: all 0.15s ease;
}
.profile-chip .logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 4. Revamped Forms, Inputs & Controls */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px 18px;
}
.form-grid label, .form-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    text-align: left;
}
.form-grid label .req, .form-field label .req {
    color: #ef4444;
    font-weight: 800;
    display: inline;
    margin-left: 2px;
}
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="email"],
.form-grid input[type="date"],
.form-grid input[type="password"],
.form-grid input[type="search"],
.form-grid select,
.form-grid textarea,
.input-control,
.form-control,
.form-select {
    width: 100%;
    height: 42px;
    padding: 9px 13px;
    border-radius: var(--erp-radius-sm);
    border: 1.5px solid var(--erp-border);
    font-size: 13.5px;
    color: var(--erp-text-main);
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-grid textarea, .input-control[type="textarea"], textarea.form-control {
    min-height: 75px;
    height: auto;
    resize: vertical;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.input-control:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary, #0f766e) !important;
    box-shadow: 0 0 0 3.5px var(--primary-light, rgba(15, 118, 110, 0.14)) !important;
}
.form-grid .span-2, .form-field.col-span-2 {
    grid-column: span 2;
}
@media (max-width: 768px) {
    .form-grid .span-2, .form-field.col-span-2 { grid-column: span 1; }
}

/* Radio & Checkbox Enhancements */
.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}
.switch-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary, #0f766e);
    cursor: pointer;
}
.month-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.month-check-grid label, .month-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--erp-bg-subtle);
    border: 1.5px solid var(--erp-border);
    border-radius: var(--erp-radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}
.month-check-grid label:has(input:checked), .month-pill.active, .month-pill:has(input:checked) {
    background: var(--primary, #0f766e) !important;
    border-color: var(--primary, #0f766e) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.gender-pill-group {
    display: flex;
    gap: 8px;
    height: 42px;
}
.gender-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px solid var(--erp-border);
    border-radius: var(--erp-radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: var(--erp-bg-subtle);
    color: #475569;
    transition: all 0.15s ease;
}
.gender-pill.active, .gender-pill:has(input:checked) {
    border-color: var(--primary, #0f766e) !important;
    background: var(--primary-light, rgba(15, 118, 110, 0.12)) !important;
    color: var(--primary, #0f766e) !important;
    font-weight: 800;
}

/* 5. Revamped Buttons & Action Controls */
.action-btn, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--erp-radius-sm);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    text-decoration: none;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.action-primary, .btn-primary {
    background: var(--primary, #0f766e) !important;
    color: #ffffff !important;
    border-color: var(--primary, #0f766e) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.action-primary:hover, .btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #ffffff !important;
}
.action-muted, .btn-secondary, .btn-soft {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: var(--erp-border) !important;
}
.action-muted:hover, .btn-secondary:hover, .btn-soft:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
}
.action-danger, .btn-danger {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}
.action-danger:hover, .btn-danger:hover {
    background: #dc2626 !important;
    transform: translateY(-1px);
}
.action-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 6. Revamped Cards, Panels, KPI Tiles & Tables */
.panel, .premium-panel, .modern-card, .card {
    background: #ffffff;
    border-radius: var(--erp-radius-lg);
    border: 1px solid var(--erp-border-subtle);
    box-shadow: var(--erp-shadow-sm);
    padding: 22px;
    margin-bottom: 22px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.panel:hover, .premium-panel:hover, .modern-card:hover {
    box-shadow: var(--erp-shadow-md);
}
.panel-heading, .section-heading, .modern-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--erp-border-subtle);
}
.panel-heading h2, .section-heading h2, .modern-card-header h3 {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--erp-text-main);
    letter-spacing: -0.01em;
    margin: 0;
}
.panel-heading p, .section-heading p, .modern-card-header p {
    font-size: 12.5px;
    color: var(--erp-text-muted);
    margin: 2px 0 0;
}

/* KPI Tiles (Compact & Polished) */
.module-kpis, .kpi-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.module-kpis article, .kpi-tile {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: var(--erp-radius-md);
    border: 1px solid var(--erp-border-subtle);
    box-shadow: var(--erp-shadow-sm);
    transition: all 0.18s ease;
    min-height: unset;
}
.module-kpis article:hover, .kpi-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--erp-shadow-md);
    border-color: var(--primary-border, #cbd5e1);
}
.module-kpis article strong, .kpi-tile strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--erp-text-main);
    line-height: 1.15;
    margin: 0;
}
.module-kpis article span, .kpi-tile span {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--erp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
    margin-top: 2px;
}

/* Student Directory KPI Card Refinements */
.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    min-height: unset !important;
}
.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-icon {
    width: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}
.student-kpi-card.kpi-tile:not(.dashboard-kpi-card) > .student-kpi-copy strong,
.gender-split-line {
    display: inline-flex !important;
    align-items: baseline !important;
    white-space: nowrap !important;
    gap: 4px !important;
    font-size: clamp(1.2rem, 1.4vw, 1.45rem) !important;
    line-height: 1.1 !important;
}
.gender-split-sep {
    font-size: 0.85em;
    opacity: 0.55;
    margin: 0 1px;
    font-weight: 500;
}

/* Tables */
.table-responsive, .premium-table-wrap {
    border-radius: var(--erp-radius-md);
    overflow: hidden;
    border: 1px solid var(--erp-border-subtle);
    box-shadow: var(--erp-shadow-sm);
    background: #ffffff;
}
.table, .premium-student-table {
    margin-bottom: 0;
    width: 100%;
}
.table thead th, .premium-student-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--erp-border-subtle);
    white-space: nowrap;
}
.table tbody td, .premium-student-table tbody td {
    padding: 12px 16px;
    font-size: 13.5px;
    vertical-align: middle;
    color: var(--erp-text-main);
    border-bottom: 1px solid var(--erp-border-subtle);
}
.table tbody tr:hover, .premium-student-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Pills */
.table-pill, .status-pill, .badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}
.table-pill.is-good, .status-pill.active {
    background: #dcfce7;
    color: #15803d;
}
.table-pill.is-bad, .status-pill.inactive {
    background: #fee2e2;
    color: #b91c1c;
}
.table-pill.is-warn {
    background: #fef3c7;
    color: #b45309;
}

/* 7. Revamped Modals & Dialogues */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(15, 23, 42, 0.65);
}
.modal-content, .premium-modal {
    border-radius: var(--erp-radius-lg);
    border: none;
    box-shadow: var(--erp-shadow-lg);
    overflow: hidden;
}
.modal-header {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-header .modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}
.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}
.modal-header .btn-close:hover {
    opacity: 1;
}
.modal-body {
    padding: 22px 24px;
    background: #ffffff;
}
.modal-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--erp-border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}


/* ==========================================================================
   Comprehensive ERP Print Rules (Print only content, Hide all webpage chrome)
   ========================================================================== */
@media print {
    /* Hide all webpage UI chrome */
    .erp-sidebar,
    .erp-topbar,
    .drawer-close-btn,
    .mobile-drawer-overlay,
    .mobile-menu-btn,
    .nav-collapse-btn,
    .drawer-mobile-actions,
    .action-cluster,
    .action-btn,
    .btn,
    button,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_info,
    .dataTables_paginate,
    .data-table-pagination,
    .class-fee-filters,
    .class-fee-pagination,
    .fee-receipt-tools,
    .modal,
    .modal-backdrop,
    .theme-selector,
    .breadcrumb-line,
    .drawer-user-card,
    .no-print,
    .profile-chip {
        display: none !important;
    }

    /* Reset page layout and canvas */
    html, body, .erp-page {
        background: #ffffff !important;
        color: #0f172a !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11pt !important;
        line-height: 1.35 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .erp-main {
        margin: 0 !important;
        padding: 8mm !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Panels & Tables styling during print */
    .panel,
    .premium-panel,
    .accounting-panel,
    .fee-student-header,
    .card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        border-radius: 4px !important;
        margin-bottom: 14pt !important;
        padding: 12pt !important;
        page-break-inside: avoid;
    }

    /* Tables */
    table, .table, .premium-student-table, .report-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    th {
        background-color: #0f766e !important;
        color: #ffffff !important;
        border: 1px solid #0f766e !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        padding: 6pt 8pt !important;
        font-weight: 700 !important;
        text-transform: uppercase;
    }

    td {
        border: 1px solid #cbd5e1 !important;
        padding: 5pt 8pt !important;
        color: #0f172a !important;
    }

    tbody tr:nth-child(even) td {
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Badges & Status */
    .table-pill, .badge, .badge-status, .fee-status-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border-radius: 4px !important;
        font-size: 8pt !important;
        padding: 2pt 5pt !important;
    }

    @page {
        margin: 10mm 12mm;
        size: auto;
    }
}
