:root{--primary:#4f46e5;--primary2:#7c3aed;--bg:#f6f7fb;--text:#172033;--muted:#73809a;--line:#e8ebf2;--card:#fff;--sidebar:#111827}*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}.app-shell{display:flex;min-height:100vh}.sidebar{width:270px;background:var(--sidebar);color:#cbd5e1;padding:22px 14px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{display:flex;gap:12px;align-items:center;padding:10px 12px 26px;color:#fff}.brand-mark,.hero-icon,.mobile-brand{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-size:21px}.brand span{display:block;font-size:12px;color:#94a3b8;margin-top:4px}.side-nav{display:flex;flex-direction:column;gap:5px;overflow:auto}.side-nav a,.logout{padding:12px 13px;border-radius:10px;font-size:14px;transition:.2s}.side-nav a:hover{background:#1f2937;color:#fff}.side-nav i,.logout i{width:24px}.logout{margin-top:auto;background:#1f2937;color:#fff}.main{margin-left:270px;width:calc(100% - 270px);padding:26px 34px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.topbar h2{margin:0;font-size:25px}.topbar p{margin:5px 0 0;color:var(--muted);font-size:14px}.user-chip{background:#fff;border:1px solid var(--line);padding:9px 14px;border-radius:12px;display:flex;gap:8px;align-items:center;box-shadow:0 4px 14px #00000008}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px;margin:14px 0;box-shadow:0 8px 24px #11182708}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.field{margin:14px 0}.field label{display:block;font-size:13px;font-weight:650;margin-bottom:7px}.field input,.field select,.field textarea{width:100%;padding:12px;border:1px solid #dce1eb;border-radius:10px;background:#fff;outline:none;font:inherit}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px #4f46e518}.btn,button{border:0;border-radius:10px;padding:11px 17px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-weight:650;cursor:pointer}.flash{padding:13px 16px;margin:12px 0;border-radius:10px}.error{background:#fee2e2;color:#991b1b}.success{background:#dcfce7;color:#166534}table{width:100%;border-collapse:collapse;background:#fff;border-radius:14px;overflow:hidden}th,td{padding:13px;border-bottom:1px solid var(--line);text-align:left}th{background:#f8fafc;color:#475569}.login-page{min-height:100vh;display:grid;grid-template-columns:1.15fr .85fr}.login-visual{background:linear-gradient(135deg,#312e81,#4f46e5 55%,#7c3aed);padding:8%;display:flex;align-items:center;color:#fff}.login-hero{max-width:600px}.login-hero h1{font-size:clamp(34px,4vw,56px);line-height:1.08;margin:26px 0 16px}.login-hero p{font-size:18px;line-height:1.7;color:#e0e7ff}.hero-points{display:flex;flex-wrap:wrap;gap:16px;margin-top:30px}.hero-points span{background:#ffffff18;border:1px solid #ffffff25;padding:10px 13px;border-radius:10px;font-size:14px}.login-panel{display:flex;align-items:center;justify-content:center;padding:32px;background:#fff}.login-card{width:min(100%,430px)}.login-card h2{font-size:30px;margin:18px 0 7px}.login-card>p{color:var(--muted);margin:0 0 28px}.input-wrap{position:relative}.input-wrap i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#94a3b8}.input-wrap input{padding-left:42px}.login-btn{width:100%;display:flex;justify-content:center;gap:10px;padding:14px;margin-top:8px}.login-footer{text-align:center;color:#94a3b8;font-size:12px;margin-top:25px}.mobile-brand{display:none}@media(max-width:850px){.login-page{grid-template-columns:1fr}.login-visual{display:none}.login-panel{min-height:100vh;background:linear-gradient(180deg,#f8faff,#fff)}.mobile-brand{display:grid;margin-bottom:18px}.sidebar{width:76px;padding:16px 8px}.brand strong,.brand span,.side-nav a{font-size:0}.brand{justify-content:center;padding-bottom:18px}.side-nav i,.logout i{font-size:18px;width:auto}.side-nav a,.logout{text-align:center}.logout{font-size:0}.main{margin-left:76px;width:calc(100% - 76px);padding:20px}.topbar{align-items:flex-start}.user-chip span{display:none}}@media(max-width:520px){.main{padding:16px}.topbar h2{font-size:20px}.login-panel{padding:24px}.login-card h2{font-size:26px}}
:root{--primary:#4f46e5;--primary2:#7c3aed;--bg:#f6f7fb;--text:#172033;--muted:#73809a;--line:#e8ebf2;--card:#fff;--sidebar:#111827;--heading:#243b55}*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--text)}h2{color:var(--heading)}a{text-decoration:none;color:inherit}.app-shell{display:flex;min-height:100vh}.sidebar{width:270px;background:var(--sidebar);color:#cbd5e1;padding:22px 14px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0}.brand{display:flex;gap:12px;align-items:center;padding:10px 12px 26px;color:#fff}.brand-mark,.hero-icon,.mobile-brand{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-size:21px}.brand span{display:block;font-size:12px;color:#94a3b8;margin-top:4px}.side-nav{display:flex;flex-direction:column;gap:5px;overflow:auto}.side-nav a,.logout{padding:12px 13px;border-radius:10px;font-size:14px;transition:.2s}.side-nav a:hover{background:#1f2937;color:#fff}.side-nav i,.logout i{width:24px}.logout{margin-top:auto;background:#1f2937;color:#fff}.main{margin-left:270px;width:calc(100% - 270px);padding:26px 34px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.topbar h2{margin:0;font-size:25px}.topbar p{margin:5px 0 0;color:var(--muted);font-size:14px}.user-chip{background:#fff;border:1px solid var(--line);padding:9px 14px;border-radius:12px;display:flex;gap:8px;align-items:center;box-shadow:0 4px 14px #00000008}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px;margin:14px 0;box-shadow:0 8px 24px #11182708}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.field{margin:14px 0}.field label{display:block;font-size:13px;font-weight:650;margin-bottom:7px}.field input,.field select,.field textarea{width:100%;padding:12px;border:1px solid #dce1eb;border-radius:10px;background:#fff;outline:none;font:inherit}.field input:focus,.field select,.field textarea{border-color:var(--primary);box-shadow:0 0 0 3px #4f46e518}.btn,button{border:0;border-radius:10px;padding:11px 17px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;font-weight:650;cursor:pointer}.flash{padding:13px 16px;margin:12px 0;border-radius:10px}.error{background:#fee2e2;color:#991b1b}.success{background:#dcfce7;color:#166534}table{width:100%;border-collapse:collapse;background:#fff;border-radius:14px;overflow:hidden}th,td{padding:13px;border-bottom:1px solid var(--line);text-align:left}th{background:#f8fafc;color:#475569}.login-page{min-height:100vh;display:grid;grid-template-columns:1.15fr .85fr}.login-visual{background:linear-gradient(135deg,#312e81,#4f46e5 55%,#7c3aed);padding:8%;display:flex;align-items:center;color:#fff}.login-hero{max-width:600px}.login-hero h1{font-size:clamp(34px,4vw,56px);line-height:1.08;margin:26px 0 16px}.login-hero p{font-size:18px;line-height:1.7;color:#e0e7ff}.hero-points{display:flex;flex-wrap:wrap;gap:16px;margin-top:30px}.login-panel{display:flex;align-items:center;justify-content:center;padding:32px;background:#fff}.login-card{width:min(100%,430px)}.login-card h2{font-size:30px;margin:18px 0 7px}.login-card>p{color:var(--muted);margin:0 0 28px}.input-wrap{position:relative}.input-wrap i{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#94a3b8}.input-wrap input{padding-left:42px}.login-btn{width:100%;display:flex;justify-content:center;gap:10px;padding:14px;margin-top:8px}.login-footer{text-align:center;color:#94a3b8;font-size:12px;margin-top:25px}.mobile-brand{display:none}@media(max-width:850px){.login-page{grid-template-columns:1fr}.login-visual{display:none}.login-panel{min-height:100vh;background:linear-gradient(180deg,#f8faff,#fff)}.mobile-brand{display:grid;margin-bottom:18px}.sidebar{width:76px;padding:16px 8px}.brand strong,.brand span,.side-nav a{font-size:0}.brand{justify-content:center;padding-bottom:18px}.side-nav i,.logout i{font-size:18px;width:auto}.side-nav a,.logout{text-align:center}.logout{font-size:0}.main{margin-left:76px;width:calc(100% - 76px);padding:20px}.topbar{align-items:flex-start}.user-chip span{display:none}}@media(max-width:520px){.main{padding:16px}.topbar h2{font-size:20px}.login-panel{padding:24px}.login-card h2{font-size:26px}}

/* Collapsible sidebar */
.sidebar-toggle{width:42px;height:42px;padding:0;display:grid;place-items:center;background:#fff;color:var(--text);border:1px solid var(--line);box-shadow:0 4px 14px #00000008;margin-right:14px}.sidebar-toggle:hover{color:var(--primary);background:#fff}.topbar>div:first-of-type{flex:1}.app-shell.sidebar-collapsed .sidebar{width:82px;padding-left:10px;padding-right:10px}.app-shell.sidebar-collapsed .brand{justify-content:center;padding-left:0;padding-right:0}.app-shell.sidebar-collapsed .brand>div:last-child{display:none}.app-shell.sidebar-collapsed .side-nav a,.app-shell.sidebar-collapsed .logout{font-size:0;text-align:center;padding:13px 8px}.app-shell.sidebar-collapsed .side-nav i,.app-shell.sidebar-collapsed .logout i{font-size:18px;width:auto;margin:0}.app-shell.sidebar-collapsed .main{margin-left:82px;width:calc(100% - 82px)}@media(max-width:850px){.sidebar-toggle{margin-right:10px}.app-shell.sidebar-collapsed .sidebar{width:0;padding:0;overflow:hidden}.app-shell.sidebar-collapsed .main{margin-left:0;width:100%}.sidebar{transition:width .25s ease,padding .25s ease}.main{transition:margin-left .25s ease,width .25s ease}}@media(min-width:851px){.sidebar{transition:width .25s ease,padding .25s ease}.main{transition:margin-left .25s ease,width .25s ease}}
/* Accessibility and Help Centre */
.skip-link{position:fixed;left:12px;top:-60px;z-index:9999;background:#111;color:#fff;padding:10px 14px;border-radius:6px}.skip-link:focus{top:12px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.access-tools{display:flex;gap:6px;align-items:center;margin-left:auto}.access-tools button,.access-tools a{min-width:36px;min-height:36px;border:1px solid #ccd3df;background:#fff;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;color:inherit}.high-contrast{background:#000!important;color:#fff!important}.high-contrast *{background-color:#000!important;color:#fff!important;border-color:#fff!important}.high-contrast a:focus,.high-contrast button:focus,.high-contrast input:focus{outline:3px solid #ff0!important;outline-offset:2px}.help-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin:18px 0}.help-card{display:flex;flex-direction:column;gap:10px}.help-card .btn{margin-top:auto;align-self:flex-start}.badge{display:inline-block;padding:4px 9px;border-radius:999px;background:#e9f2ff;color:#124a88;font-size:.8rem}.training-steps li{padding:10px 4px;line-height:1.55}.notice{margin-top:18px;padding:14px;border-left:4px solid #1f6feb;background:#f4f8ff}.toolbar{display:flex;gap:8px;flex-wrap:wrap}.toolbar input{min-width:220px;flex:1}@media (max-width:700px){.access-tools{margin-left:0}.topbar{flex-wrap:wrap}.access-tools button,.access-tools a{min-width:42px;min-height:42px}}

/* Premium ERP sidebar navigation */
.sidebar{padding:16px 12px 12px;background:linear-gradient(180deg,#0b1220 0%,#111827 55%,#0b1220 100%);border-right:1px solid #243047;box-shadow:10px 0 30px #0b12201a;z-index:1000}
.brand{padding:8px 10px 18px;margin-bottom:4px}.brand strong{font-size:14px;line-height:1.25}.brand-mark{box-shadow:0 8px 22px #4f46e53d}
.side-nav{gap:7px;padding:0 2px 10px;scrollbar-width:thin;scrollbar-color:#334155 transparent}.side-nav::-webkit-scrollbar{width:5px}.side-nav::-webkit-scrollbar-thumb{background:#334155;border-radius:10px}
.nav-search{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:9px;margin:0 2px 8px;padding:9px 11px;border:1px solid #26334a;background:#111c2e;border-radius:11px;color:#64748b}.nav-search i{font-size:12px}.nav-search input{width:100%;border:0;outline:0;background:transparent;color:#e2e8f0;font:inherit;font-size:12px}.nav-search input::placeholder{color:#718096}
.nav-section{margin:0}.nav-section-head{width:100%;display:flex;align-items:center;justify-content:space-between;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:#94a3b8;font-size:11px;font-weight:750;letter-spacing:.035em;text-transform:uppercase;text-align:left}.nav-section-head>span{display:flex;align-items:center;gap:9px}.nav-section-head>span>i{width:17px;text-align:center;color:#64748b}.nav-section-head:hover{background:#182337;color:#e2e8f0}.nav-chevron{font-size:9px;transition:transform .2s}.nav-section.open .nav-chevron{transform:rotate(180deg)}
.nav-section.active-section>.nav-section-head{background:linear-gradient(90deg,#b8cdf2 0%,#c9d9f5 100%)!important;border:1px solid #7899cf!important;color:#123b8f!important;box-shadow:0 5px 14px #315da633!important;font-weight:800!important}
.nav-section.active-section>.nav-section-head>span>i{color:#174ea6!important}
.nav-section.active-section>.nav-section-head .nav-chevron{color:#174ea6!important}
.nav-section-items{display:none;padding:2px 0 4px}.nav-section.open .nav-section-items{display:block}.nav-item{position:relative;display:flex!important;align-items:center;gap:10px;margin:2px 2px!important;padding:9px 10px!important;border:1px solid transparent;border-radius:10px!important;color:#aebbd0;font-size:13px!important}.nav-item .nav-icon{width:26px;height:26px;display:grid;place-items:center;flex:0 0 26px;border-radius:8px;background:#172236;color:#7f8ea7;font-size:12px}.nav-item .nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-item:hover{background:#182337!important;border-color:#26344b;color:#fff!important;transform:translateX(2px)}.nav-item:hover .nav-icon{background:#263552;color:#c7d2fe}.nav-item.active{background:linear-gradient(90deg,#312e81,#3730a3)!important;border-color:#4f46e58c;color:#fff!important;box-shadow:0 6px 16px #312e8133}.nav-item.active:before{content:"";position:absolute;left:-2px;top:7px;bottom:7px;width:3px;border-radius:4px;background:#a5b4fc}.nav-item.active .nav-icon{background:#ffffff1c;color:#fff}.menu-hidden,.menu-no-match{display:none!important}
.logout{margin:8px 2px 0!important;padding:11px 12px!important;border:1px solid #26334a;background:#111c2e!important;color:#cbd5e1}.logout:hover{background:#1f2937!important;color:#fff}
.app-shell.sidebar-collapsed .nav-search,.app-shell.sidebar-collapsed .nav-section-head span span,.app-shell.sidebar-collapsed .nav-section-head .nav-chevron{display:none}.app-shell.sidebar-collapsed .nav-section-head{justify-content:center;padding:6px}.app-shell.sidebar-collapsed .nav-section-items{display:block}.app-shell.sidebar-collapsed .nav-item{justify-content:center}.app-shell.sidebar-collapsed .nav-label{display:none}.app-shell.sidebar-collapsed .nav-item .nav-icon{width:34px;height:34px}.app-shell.sidebar-collapsed .nav-section-head>span{display:block}.app-shell.sidebar-collapsed .nav-section-head>span>i{font-size:13px;color:#64748b}
@media(max-width:850px){.nav-search{display:none}.sidebar{padding-top:14px}.nav-section-head{padding:7px 6px}.app-shell.sidebar-collapsed .nav-section-head{display:none}}

/* ERP form/report polish and responsive layout */
.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 18px}.page-header h1,.page-header h2{margin:0}.page-header .actions{display:flex;gap:8px;flex-wrap:wrap}.card>h2:first-child,.card>h3:first-child{margin-top:0}.card form{margin:0}.card label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:650;color:#334155}.card input,.card select,.card textarea,.card button{font:inherit}.card input,.card select,.card textarea{width:100%;min-height:42px;padding:10px 12px;border:1px solid #d7deea;border-radius:10px;background:#fff;color:var(--text)}.card textarea{min-height:92px;resize:vertical}.card input:focus,.card select:focus,.card textarea:focus{border-color:var(--primary);outline:0;box-shadow:0 0 0 3px #4f46e51a}.card button,.card .btn{white-space:nowrap}.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.form-grid>label,.form-grid>.field{min-width:0}.form-grid .full-width,.form-grid textarea,.form-grid .span-all{grid-column:1/-1}.table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:#fff}.table-wrap table{min-width:760px}.table-wrap th{position:sticky;top:0;z-index:1}.report-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-bottom:14px}.report-title{text-align:center;margin:4px 0 18px}.report-summary,.stats,.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin:16px 0}.report-summary>div,.stats>div,.cards>div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px}.report-summary b,.stats b,.cards b{display:block;font-size:22px;margin-bottom:5px}.report-summary span,.stats span,.cards span{color:var(--muted);font-size:12px}.report-print-head{background:#fff;border-radius:14px;padding:14px 18px}.report-print-head .report-logo{border:1px solid #e2e8f0;border-radius:10px;padding:4px;background:#fff}.print-toolbar{background:#fff;border:1px solid var(--line);padding:8px;border-radius:10px}.admission-print,.certificate-print,.print-area{page-break-inside:avoid}@media(max-width:700px){.main{padding:16px}.page-header{flex-direction:column}.form-grid{grid-template-columns:1fr}.report-print-head{gap:9px}.report-print-head .report-logo{width:52px;height:52px;flex-basis:52px}.report-print-head .report-school h2{font-size:16px}.report-print-head .report-school p{font-size:10px}.table-wrap table{min-width:680px}}@media print{body{background:#fff}.main{margin:0!important;width:100%!important;padding:0!important}.sidebar,.topbar,.print-toolbar,.report-actions,.no-print,.no-print-logo{display:none!important}.card{box-shadow:none;border:0;padding:8px;margin:0}.report-print-head{border-bottom:2px solid #111;border-radius:0;margin-bottom:10px}.table-wrap{overflow:visible;border:0}.table-wrap table{min-width:0;width:100%;font-size:9pt}table{page-break-inside:auto}tr{page-break-inside:avoid;page-break-after:auto}thead{display:table-header-group}th,td{padding:6px 7px}}

/* Final module polish */
.page-header h1{font-size:28px;letter-spacing:-.02em}.text-muted{color:var(--muted)}
.student-search{align-items:end}.search-actions{display:flex;gap:8px;align-items:end;height:100%}.table-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:2px 0 14px}.table-toolbar h3{margin:0}.table-toolbar span{font-size:12px;color:var(--muted)}.table-sub{display:block;font-size:11px;color:var(--muted);margin-top:2px}.status-pill,.role-pill{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:750;background:#eef2f7;color:#475569}.status-pill.active{background:#e9f8ef;color:#16703b}.status-pill.inactive{background:#f1f3f5;color:#687386}.status-pill.left{background:#fff3e8;color:#9a4f00}.status-pill.left-without-lc{background:#ffe9e9;color:#a32b2b}.status-pill.approved{background:#e9f8ef;color:#16703b}.status-pill.pending{background:#fff7df;color:#8a5a00}.status-pill.rejected{background:#ffe9e9;color:#a32b2b}.role-pill{background:#eef4ff;color:#2457c5}.action-group{display:flex;gap:6px;flex-wrap:wrap}.btn-sm{padding:7px 10px;font-size:12px}.empty-state{text-align:center!important;padding:34px!important;color:var(--muted)}.empty-state i{display:block;font-size:25px;margin-bottom:8px}.empty-state strong,.empty-state span{display:block}.promotion-form{margin-bottom:18px}.selection-head{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);margin-top:18px;padding-top:16px}.selection-head h3{margin:0}.selection-head span{font-size:12px;color:var(--muted)}.check-all,.check-label{display:flex!important;flex-direction:row!important;align-items:center;gap:7px!important}.student-select-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:8px;margin-top:12px;max-height:430px;overflow:auto}.student-check{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:10px!important;padding:11px;border:1px solid var(--line);border-radius:10px;background:#fafcff}.student-check:hover{border-color:#b8c7e8;background:#f6f9ff}.student-check input{width:auto!important;min-height:auto!important;margin-top:3px}.student-check strong,.student-check small{display:block}.student-check small{font-size:11px;color:var(--muted);margin-top:3px}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.grid-2{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(320px,1fr);gap:16px}.grid-2>.card,.grid-2>div{min-width:0}@media(max-width:900px){.grid-2{grid-template-columns:1fr}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.kpi-grid{grid-template-columns:1fr}.search-actions{align-items:stretch}.search-actions .btn{flex:1}.page-header h1{font-size:23px}}

/* Center school logo inside sidebar logo area */
.brand .brand-mark.logo-mark{display:flex!important;align-items:center!important;justify-content:center!important;padding:5px!important;text-align:center!important;line-height:0!important}.brand .brand-mark.logo-mark img{display:block!important;width:100%!important;height:100%!important;max-width:42px!important;max-height:42px!important;object-fit:contain!important;object-position:center center!important;margin:auto!important;flex:0 0 auto!important}

/* Light sidebar menu with clear active-page highlighting */
.sidebar{background:linear-gradient(180deg,#ffffff 0%,#f7f9ff 48%,#f1f5ff 100%)!important;color:#334155!important;border-right:1px solid #dbe4f0!important;box-shadow:8px 0 28px #64748b18!important}
.brand{color:#172033!important}.brand span{color:#64748b!important}
.nav-section-head{color:#53647a!important}.nav-section-head>span>i{color:#94a3b8!important}.nav-section-head:hover{background:#eef2f7!important;color:#172033!important}
.nav-item{color:#43546a!important}.nav-item .nav-icon{background:#eef3fb!important;color:#718198!important}.nav-item:hover{background:linear-gradient(90deg,#f0f5ff,#e9efff)!important;border-color:#d5e1f2!important;color:#1e3a8a!important;transform:translateX(2px)}.nav-item:hover .nav-icon{background:#dbe7ff!important;color:#315db5!important}
.nav-item.active{background:linear-gradient(90deg,#c7d7f7 0%,#d9e4f8 100%)!important;border-color:#8ea9d6!important;color:#123b8f!important;box-shadow:0 6px 18px #315da633!important;font-weight:800!important}.nav-item.active .nav-label{color:#123b8f!important;font-weight:800!important}.nav-item.active:before{background:#3b82f6!important}.nav-item.active .nav-icon{background:#d7e5ff!important;color:#2563eb!important}.nav-main-admission{background:linear-gradient(90deg,#f0f5ff,#f8faff)!important;border-color:#d8e5fa!important;font-weight:750!important}.nav-main-admission .nav-icon{background:#e1ebff!important;color:#2563eb!important}
.nav-item-featured{background:#f1f5ff!important}.nav-item-featured:hover{background:#e8eefc!important}.logout{background:#eef2f7!important;color:#334155!important;border:1px solid #e2e8f0}

/* API Integration dashboard */
.api-status-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}.api-status-card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px}.api-card-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}.api-channel-icon{width:40px;height:40px;border-radius:11px;background:#eef4ff;color:#2563eb;display:grid;place-items:center;font-size:17px}.api-card-head strong{display:block;font-size:15px}.api-card-head span{display:block;color:var(--muted);font-size:12px;margin-top:2px}.api-status-line{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-top:1px solid var(--line)}.api-badge{padding:5px 9px;border-radius:999px;font-size:11px}.api-badge.ready{background:#e8f8ef;color:#16703b}.api-badge.missing{background:#fff3e8;color:#9a4f00}.api-vars{display:flex;flex-direction:column;gap:5px}.api-vars small{color:var(--muted)}.api-vars code,.api-config-list code{font-size:11px;word-break:break-word}.api-config-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.api-config-list>div{border:1px solid var(--line);border-radius:10px;padding:11px;background:#fafcff}.api-config-list b,.api-config-list span{display:block;font-size:12px;margin-bottom:4px}.api-config-list span{color:var(--muted)}.api-flow{display:grid;grid-template-columns:1fr auto 1fr auto 1fr auto 1fr;gap:12px;align-items:center}.api-flow>div{padding:14px;border:1px solid var(--line);border-radius:12px;background:#fafcff}.api-flow b,.api-flow span{display:block}.api-flow b{font-size:12px}.api-flow span{font-size:11px;color:var(--muted);margin-top:5px;line-height:1.45}.api-flow>i{color:#94a3b8;text-align:center}@media(max-width:900px){.api-flow{grid-template-columns:1fr}.api-flow>i{transform:rotate(90deg)}.api-config-list{grid-template-columns:1fr}}
.api-provider-card{scroll-margin-top:80px}.api-provider-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.api-connection-pill{display:inline-flex;align-items:center;gap:6px;padding:7px 11px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}.api-connection-pill.connected{background:#e8f8ef;color:#16703b}.api-connection-pill.disconnected{background:#fff3e8;color:#9a4f00}.api-stepbar{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fafcff}.api-stepbar span{font-size:12px;color:var(--muted)}.api-stepbar b{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#eaf1ff;color:#2563eb;margin-right:5px}.api-config-form .input,.api-test-form .input{width:100%;box-sizing:border-box}.api-action-row{display:flex;justify-content:flex-end;margin-top:14px}.api-test-panel{margin-top:18px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.api-test-panel>div{display:flex;flex-direction:column;gap:4px}.api-test-form{display:flex;gap:8px;min-width:320px;flex:1;justify-content:flex-end}.api-test-form .input{max-width:320px}.api-provider-card:not(.api-open){border-color:var(--line)}@media(max-width:700px){.api-provider-header{flex-direction:column}.api-test-form{min-width:100%;justify-content:stretch}.api-test-form .input{max-width:none}.api-test-form .btn{white-space:nowrap}}

/* Compact & attractive sidebar menu */
.sidebar{width:248px!important;padding:12px 10px 10px!important}
.brand{gap:9px!important;padding:6px 8px 14px!important;margin-bottom:2px!important}
.brand strong{font-size:12.5px!important}
.brand span{font-size:10.5px!important;margin-top:2px!important}
.brand-mark.logo-mark{width:38px!important;height:38px!important;border-radius:10px!important}
.side-nav{gap:3px!important;padding:0 1px 8px!important}
.nav-search{margin:0 1px 6px!important;padding:7px 9px!important;border-radius:9px!important}
.nav-search input{font-size:11px!important}
.nav-section{margin:1px 0!important}
.nav-section-head{padding:7px 8px!important;border-radius:8px!important;font-size:11px!important;line-height:1.35!important;letter-spacing:.045em!important}
.nav-section-head>span{gap:7px!important}
.nav-section-head>span>i{width:15px!important;font-size:10px!important}
.nav-chevron{font-size:8px!important}
.nav-section-items{padding:1px 0 3px!important}
.nav-item{gap:7px!important;margin:1px 1px!important;padding:6px 8px!important;border-radius:8px!important;font-size:11.5px!important;min-height:34px!important}
.nav-item .nav-icon{width:23px!important;height:23px!important;flex:0 0 23px!important;border-radius:7px!important;font-size:10.5px!important}
.nav-item .nav-label{line-height:1.2!important}
.nav-item:hover{transform:translateX(1px)!important}
.nav-item.active{box-shadow:0 3px 10px #4774c51a!important}
.nav-item.active:before{top:6px!important;bottom:6px!important;width:2px!important}
.nav-badge{font-size:7.5px!important;padding:2px 5px!important;letter-spacing:.035em!important}
.logout{padding:7px 9px!important;border-radius:8px!important;font-size:11.5px!important}
.logout i{width:20px!important;font-size:11px!important}
.main{margin-left:248px!important;width:calc(100% - 248px)!important}
.app-shell.sidebar-collapsed .sidebar{width:68px!important}
.app-shell.sidebar-collapsed .main{margin-left:68px!important;width:calc(100% - 68px)!important}
@media(max-width:850px){
  .sidebar{width:68px!important;padding:12px 7px!important}
  .brand{justify-content:center!important;padding-bottom:14px!important}
  .brand strong,.brand span,.side-nav a{font-size:0!important}
  .side-nav i,.logout i{font-size:16px!important;width:auto!important}
  .side-nav a,.logout{text-align:center!important}
  .nav-item{justify-content:center!important;padding:7px!important}
  .nav-item .nav-icon{width:30px!important;height:30px!important;flex-basis:30px!important}
  .main{margin-left:68px!important;width:calc(100% - 68px)!important}
  .app-shell.sidebar-collapsed .sidebar{width:0!important}
  .app-shell.sidebar-collapsed .main{margin-left:0!important;width:100%!important}
}
/* Employee attendance punch-time status colours */
.status-pill.present{background:#e9f8ef;color:#16703b}.status-pill.late{background:#fff7df;color:#8a5a00}.status-pill.early-leaving{background:#fff0e6;color:#9a4f00}.status-pill.late-and-early{background:#ffe9e9;color:#a32b2b}.status-pill.half-day{background:#eef4ff;color:#2457c5}.status-pill.incomplete{background:#f1f3f5;color:#687386}.status-pill.short-hours{background:#fff0e6;color:#9a4f00}.status-pill.absent{background:#ffe9e9;color:#a32b2b}.status-pill.week-off{background:#f1f5f9;color:#475569}.status-pill.holiday{background:#f1f5f9;color:#475569}.status-pill.school-closed{background:#f1f5f9;color:#475569}.status-pill.early-closure{background:#fff0e6;color:#9a4f00}

/* Fixed global topbar: remains visible while every page scrolls. */
.topbar{
 position:fixed;
 top:0;
 right:0;
 left:270px;
 z-index:1100;
 min-height:78px;
 margin:0;
 padding:14px 34px;
 background:rgba(255,255,255,.97);
 border-bottom:1px solid var(--line);
 box-shadow:0 4px 18px rgba(15,23,42,.08);
 backdrop-filter:blur(10px);
 -webkit-backdrop-filter:blur(10px);
}
.main{padding-top:104px}
.app-shell.sidebar-collapsed .topbar{left:82px}
.app-shell.sidebar-collapsed .main{padding-top:104px}
@media(max-width:850px){
 .topbar{left:76px;padding:12px 20px;min-height:70px}
 .main{padding-top:92px}
 .app-shell.sidebar-collapsed .topbar{left:0}
 .app-shell.sidebar-collapsed .main{padding-top:92px}
}
@media(max-width:520px){
 .topbar{padding:10px 16px;min-height:66px}
 .main{padding-top:86px}
 .app-shell.sidebar-collapsed .main{padding-top:86px}
}

@font-face{font-family:'Sutro W01';src:url('../assets/fonts/Sutro%20W01%20Bold.ttf') format('truetype');font-weight:700;font-style:normal;font-display:swap}.brand strong,.report-school h2,.login-hero h1,.admission-print header h1,.library-card h2,.receipt>div:first-child h2,.receipt-card>div:first-child h2,.payslip-head h2,#payslip>div:first-child h2,.school-name{font-family:'Sutro W01',Arial,sans-serif;font-weight:700}@media print{.report-school h2,.admission-print header h1,.library-card h2,.receipt>div:first-child h2,.receipt-card>div:first-child h2,.payslip-head h2,#payslip>div:first-child h2{font-size:30px!important;font-weight:700!important}}
/* Hikvision Day-wise multi-device selector */
.hik-device-dropdown{position:relative;width:100%}
.hik-device-dropdown-toggle{
 width:100%;
 min-height:42px;
 padding:10px 40px 10px 12px;
 text-align:left;
 background:#fff;
 color:var(--text);
 border:1px solid #d7deea;
 border-radius:10px;
 position:relative;
}
.hik-device-dropdown-toggle:after{
 content:"\\f078";
 font-family:"Font Awesome 6 Free";
 font-weight:900;
 position:absolute;
 right:14px;
 top:50%;
 transform:translateY(-50%);
 color:#64748b;
}
.hik-device-dropdown.open .hik-device-dropdown-toggle{border-color:var(--primary);box-shadow:0 0 0 3px #4f46e518}
.hik-device-dropdown-menu{
 display:none;
 position:absolute;
 z-index:1200;
 left:0;
 right:0;
 top:calc(100% + 5px);
 max-height:310px;
 overflow:auto;
 padding:8px;
 background:#fff;
 border:1px solid #d7deea;
 border-radius:12px;
 box-shadow:0 12px 32px rgba(15,23,42,.16);
}
.hik-device-dropdown.open .hik-device-dropdown-menu{display:block}
.hik-device-dropdown-actions{display:flex;gap:8px;padding:2px 2px 8px;border-bottom:1px solid var(--line);margin-bottom:5px}
.hik-device-dropdown-actions .btn{padding:7px 10px}
.hik-device-option{
 display:flex!important;
 flex-direction:row!important;
 align-items:flex-start;
 gap:10px;
 padding:10px 8px;
 margin:0;
 border-radius:8px;
 cursor:pointer;
 font-weight:500!important;
}
.hik-device-option:hover{background:#f4f7fb}
.hik-device-option input[type="checkbox"]{width:18px!important;min-width:18px!important;height:18px;min-height:18px;margin:2px 0 0;accent-color:var(--primary)}
.hik-device-option span{display:flex;flex-direction:column;gap:2px;line-height:1.25}
.hik-device-option small{font-size:11px;color:var(--muted);font-weight:400}



/* Compact ERP-wide density and refined Hikvision range actions. */
html{font-size:14px}
body{font-size:13px;line-height:1.4}
.main{padding-left:28px;padding-right:28px}
.topbar{left:248px;min-height:68px;padding:10px 24px;margin-bottom:0}
.topbar h2{font-size:20px}
.topbar p{font-size:12px;margin-top:3px}
.card{border-radius:12px;padding:16px;margin:10px 0;box-shadow:0 5px 18px #11182706}
.page-header{gap:12px;margin-bottom:12px}
.page-header h1,.page-header h2{font-size:22px}
.page-header p{font-size:12px}
.grid,.form-grid{gap:12px}
.field{margin:10px 0}
.field label,.card label{font-size:12px;gap:5px}
.card input,.card select,.card textarea,.field input,.field select,.field textarea{min-height:38px;padding:8px 10px;border-radius:8px;font-size:12.5px}
.card textarea,.field textarea{min-height:78px}
.btn,button{padding:8px 12px;border-radius:8px;font-size:12px;line-height:1.25}
.btn-sm{padding:6px 9px;font-size:11px}
.form-actions{gap:6px;margin-top:12px}
.table-toolbar{gap:9px;padding-bottom:10px}
.table-toolbar h3{font-size:15px}
.table-toolbar span{font-size:11px}
th,td{padding:9px 10px;font-size:12px}
th{font-size:11.5px}
.notice{margin-top:10px;padding:10px;font-size:12px}
.flash{padding:10px 12px;margin:9px 0}

/* Day-wise sync: clean two-column alignment with the device selector and action row full-width. */
#rangeSyncForm .form-grid{grid-template-columns:minmax(150px,0.8fr) minmax(150px,0.8fr) minmax(240px,1.2fr);align-items:end;column-gap:12px;row-gap:8px}
#rangeSyncForm .form-grid>label{font-size:11.5px;gap:4px;margin:0}
#rangeSyncForm .form-grid>label>input[type=date]{min-height:34px;height:34px;padding:6px 9px;font-size:12px;border-radius:7px}
#rangeSyncForm .hik-range-devices{grid-column:3;grid-row:1}
#rangeSyncForm .hik-range-devices .hik-device-dropdown-toggle{min-height:34px;height:34px;padding:6px 30px 6px 9px;font-size:11.5px;border-radius:7px}
#rangeSyncForm .hik-range-actions{grid-column:1/-1;display:flex;justify-content:flex-end;align-items:center;margin-top:0;padding-top:8px}
#rangeSyncForm .hik-range-sync{min-width:180px;min-height:30px!important;padding:6px 10px!important;font-size:11px!important;border-radius:7px!important}
#rangeSyncForm .hik-range-devices>span.text-muted{font-size:10px;line-height:1.25;margin-top:3px}
#hikForm .hik-terminal-enabled{display:flex;align-items:center;gap:7px;margin-top:28px;white-space:nowrap}
#hikForm .hik-terminal-enabled input[type="checkbox"]{width:14px!important;min-width:14px!important;height:14px!important;min-height:14px!important;padding:0!important;margin:0!important;accent-color:currentColor}
#hikForm .form-actions{display:flex;justify-content:flex-end;align-items:center;gap:6px}
#hikForm .form-actions .btn{min-height:30px;padding:6px 10px;font-size:11px;line-height:1.1}
#hikForm .form-actions .btn i{font-size:10px}
@media(max-width:850px){
 #rangeSyncForm .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #rangeSyncForm .hik-range-devices{grid-column:1/-1;grid-row:auto}
}

/* Day-wise sync: compact, consistent action buttons rather than oversized default buttons. */
.hik-range-actions{justify-content:flex-start;align-items:center;flex-wrap:wrap;margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.hik-range-btn{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:7px 11px!important;border:1px solid #d8deea!important;box-shadow:none!important;font-size:11.5px!important;font-weight:700!important;white-space:nowrap}
.hik-range-btn i{font-size:10.5px}
.hik-range-select{background:#f8fafc!important;color:#334155!important}
.hik-range-select:hover{background:#eef2f7!important;border-color:#cbd5e1!important}
.hik-range-clear{background:#fff!important;color:#64748b!important}
.hik-range-clear:hover{background:#f8fafc!important;color:#334155!important}
.hik-range-sync{border-color:#4f46e5!important;background:linear-gradient(135deg,#4f46e5,#6d5ce7)!important;color:#fff!important;box-shadow:0 3px 8px #4f46e522!important}
.hik-range-sync:hover{filter:brightness(.97);transform:translateY(-1px)}
.hik-device-dropdown-toggle{min-height:38px;padding:8px 36px 8px 10px;font-size:12.5px}
.hik-device-dropdown-actions{gap:6px;padding-bottom:6px}
.hik-device-dropdown-actions .btn{padding:6px 9px;font-size:11px}
.hik-device-option{gap:8px;padding:8px 7px;font-size:12px!important}
.hik-device-option input[type="checkbox"]{width:16px!important;min-width:16px!important;height:16px;min-height:16px}
.hik-device-option small{font-size:10px}

@media(max-width:850px){
 .main{padding-left:18px;padding-right:18px}
 .topbar{left:68px;padding:9px 16px;min-height:62px}
 .main{padding-top:82px}
 .app-shell.sidebar-collapsed .topbar{left:0}
}
@media(max-width:520px){
 .main{padding-left:12px;padding-right:12px;padding-top:78px}
 .topbar{padding:8px 12px;min-height:58px}
 .page-header h1,.page-header h2{font-size:19px}
 .card{padding:12px}
 .hik-range-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
 .hik-range-sync{grid-column:1/-1}
 .hik-range-btn{width:100%}
}

@media(max-width:700px){
 #rangeSyncForm .form-grid{grid-template-columns:1fr;gap:12px}
 #rangeSyncForm .hik-range-devices,#rangeSyncForm .hik-range-actions{grid-column:1}
 #rangeSyncForm .hik-range-actions{justify-content:stretch}
 #rangeSyncForm .hik-range-sync{width:100%;min-width:0}
}

/* School identity on the sign-in screen, sourced from School Settings. */
.login-school-brand{display:flex;align-items:center;gap:18px}
.login-school-brand img{width:76px;height:76px;object-fit:contain;background:#fff;border-radius:14px;padding:6px}
.login-school-brand h1{margin:0!important}
.login-school-subtitle,.login-school-city{color:#e0e7ff;font-size:15px;font-weight:600;margin-top:5px}
.login-school-city{font-size:14px;font-weight:500;margin-top:2px}
.login-mobile-school{display:none}
.login-card .field{margin:14px 0}
.login-card .field label{display:block;margin:0 0 6px}
.login-card .input-wrap{position:relative;display:flex;align-items:center;width:100%}
.login-card .input-wrap i{position:absolute;z-index:1;left:14px;top:50%;width:16px;transform:translateY(-50%);text-align:center;pointer-events:none}
.login-card .input-wrap input{display:block;width:100%;min-height:44px;padding:8px 10px 8px 44px!important}

/* Use the Admissions hero navy as the single shared ERP theme. */
:root{--adm-hero-start:#243b55;--adm-hero-end:#141e30;--adm-hero-gradient:linear-gradient(135deg,var(--adm-hero-start),var(--adm-hero-end));--theme-on-hero:#fff;--theme-on-hero-muted:#dbeafe}
h1,h2,h3,h4,h5,h6{color:var(--adm-hero-start)!important}
.page-header p,.topbar p{color:#49637e!important}
.adm-hero h1,.adm-hero h2,.adm-hero h3,.adm-hero h4,.adm-hero h5,.adm-hero h6,
.hero h1,.hero h2,.hero h3,.hero h4,.hero h5,.hero h6,
.gs-hero h1,.gs-hero h2,.gs-hero h3,.gs-hero h4,.gs-hero h5,.gs-hero h6{color:var(--theme-on-hero)!important}
.login-hero h1{color:#fff!important}
.login-hero p{color:#e0e7ff!important}
.field select,.field textarea{border-color:#dce1eb;box-shadow:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px #4f46e518}
@media(max-width:850px){
 .login-mobile-school{display:flex;align-items:center;gap:12px;margin-bottom:20px}
 .login-mobile-school img{width:52px;height:52px;object-fit:contain;border:1px solid var(--line);border-radius:12px;padding:4px}
 .login-mobile-school strong,.login-mobile-school span{display:block}
 .login-mobile-school strong{font-size:17px}
 .login-mobile-school span{color:var(--muted);font-size:12px;margin-top:2px}
}

/* Shared page-header theme: matches the Admissions hero without changing card or print content. */
.topbar,.page-header{
 background:var(--adm-hero-gradient)!important;
 color:var(--theme-on-hero);
 border-color:rgba(255,255,255,.2)!important;
 box-shadow:0 5px 18px rgba(20,30,48,.22)!important;
}
.page-header{padding:16px 20px;border-radius:14px}
.topbar h1,.topbar h2,.topbar h3,.topbar h4,.topbar h5,.topbar h6,
.page-header h1,.page-header h2,.page-header h3,.page-header h4,.page-header h5,.page-header h6{color:var(--theme-on-hero)!important}
.topbar p,.page-header p{color:var(--theme-on-hero-muted)!important}
.topbar .sidebar-toggle,.topbar .access-tools button,.topbar .access-tools a,.topbar .user-chip{
 background:rgba(255,255,255,.12)!important;
 color:#fff!important;
 border-color:rgba(255,255,255,.34)!important;
 box-shadow:none!important;
}
.topbar .sidebar-toggle:hover,.topbar .access-tools button:hover,.topbar .access-tools a:hover,.topbar .user-chip:hover{background:rgba(255,255,255,.22)!important}

/* Card h1/h2 title bands use the same theme while keeping the card body neutral. */
.card:not(.print-area)>:is(h1,h2),.card-header{
 margin:-16px -16px 14px;
 padding:12px 16px;
 background:var(--adm-hero-gradient);
 border-radius:11px 11px 0 0;
 color:var(--theme-on-hero);
}
.card:not(.print-area)>:is(h1,h2){font-size:18px}
.card:not(.print-area)>:is(h1,h2),.card-header h1,.card-header h2,.card-header h3,.card-header h4,.card-header h5,.card-header h6{color:var(--theme-on-hero)!important}
.card-header span,.card-header small,.card-header p{color:var(--theme-on-hero-muted)!important}
@media(max-width:520px){.card:not(.print-area)>:is(h1,h2),.card-header{margin:-12px -12px 12px;padding:11px 12px}}
@media print{.card:not(.print-area)>:is(h1,h2),.card-header{margin:0 0 8px;padding:0;background:#fff!important;border-radius:0;color:#111}.card:not(.print-area)>:is(h1,h2),.card-header h1,.card-header h2,.card-header h3,.card-header h4,.card-header h5,.card-header h6{color:#111!important}}

/* Dashboard and search heroes must retain white text against the shared navy theme. */
.adm-hero,.hero,.gs-hero{background:var(--adm-hero-gradient)!important;color:var(--theme-on-hero)!important}
.adm-hero p,.hero p,.gs-hero p{color:var(--theme-on-hero-muted)!important}

/* Module-specific headers use the same Admissions hero treatment on every module page. */
.mod-head,.sc-head,.policy-head,.aw-head,.hrms-head,.page-head{
 background:var(--adm-hero-gradient)!important;
 color:var(--theme-on-hero)!important;
 border:1px solid rgba(255,255,255,.2)!important;
 border-radius:14px;
 padding:16px 20px;
 box-shadow:0 5px 18px rgba(20,30,48,.22)!important;
}
.mod-head h1,.mod-head h2,.mod-head h3,.sc-head h1,.sc-head h2,.sc-head h3,
.policy-head h1,.policy-head h2,.policy-head h3,.aw-head h1,.aw-head h2,.aw-head h3,
.hrms-head h1,.hrms-head h2,.hrms-head h3,.page-head h1,.page-head h2,.page-head h3{color:var(--theme-on-hero)!important}
.mod-head p,.sc-head p,.policy-head p,.aw-head p,.hrms-head p,.page-head p{color:var(--theme-on-hero-muted)!important}
.help-back-button{display:inline-flex;align-items:center;gap:6px;margin-bottom:14px;padding:8px 12px;border:1px solid rgba(255,255,255,.28);border-radius:8px;background:var(--adm-hero-gradient);color:var(--theme-on-hero)!important;font-weight:700;box-shadow:0 3px 10px rgba(20,30,48,.16)}
.help-back-button:hover,.help-back-button:focus-visible{background:var(--adm-hero-end)!important;color:var(--theme-on-hero)!important}
@media(max-width:560px){.mod-head,.sc-head,.policy-head,.aw-head,.hrms-head,.page-head{padding:14px 16px}}

/* Shared MSB school-brand colour. Login keeps its own visual treatment. */
:root{--msb-brand-blue:#0018A3}
.sidebar .brand strong,.sidebar .brand span{color:var(--msb-brand-blue)!important}
.report-school h2,.report-school p,.library-card h2,.library-card h2+div,.receipt>div:first-child h2,.receipt>div:first-child h2+div{color:var(--msb-brand-blue)!important}
.admission-print header h1,.admission-print header h1+div{color:var(--msb-brand-blue)!important}

/* Refined sidebar navigation: theme-aware selected section/item states. */
.sidebar{background:linear-gradient(180deg,#fff 0%,#f8faff 100%)!important;border-right-color:#dfe6f4!important}
.nav-section-head{color:#53647a!important;font-weight:800!important;transition:background .16s ease,color .16s ease,border-color .16s ease!important}
.nav-section-head:hover{background:#f1f4fb!important;color:var(--msb-brand-blue)!important}
.nav-section.active-section>.nav-section-head{
  background:var(--adm-hero-gradient)!important;
  border:1px solid rgba(255,255,255,.24)!important;
  color:var(--theme-on-hero)!important;
  box-shadow:0 5px 14px rgba(20,30,48,.18)!important;
}
.nav-section.active-section>.nav-section-head>span>i,
.nav-section.active-section>.nav-section-head .nav-chevron{
  color:var(--theme-on-hero)!important;
}
.nav-item{color:#43546a!important;transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease,color .16s ease!important}
.nav-item .nav-icon{background:#eef2ff!important;color:var(--msb-brand-blue)!important}
.nav-item:hover{background:#f3f6ff!important;border-color:#dfe7f7!important;color:var(--msb-brand-blue)!important;transform:translateX(1px)!important}
.nav-item:hover .nav-icon{background:#dfe6ff!important;color:var(--msb-brand-blue)!important}
.nav-item.active{
  background:var(--adm-hero-gradient)!important;
  border-color:rgba(255,255,255,.22)!important;
  color:var(--theme-on-hero)!important;
  box-shadow:0 4px 12px rgba(20,30,48,.18)!important;
}
.nav-item.active:before{left:-2px!important;background:var(--theme-on-hero)!important}
.nav-item.active .nav-label,.nav-item.active .nav-icon,.nav-item.active .nav-icon i,.nav-item.active .nav-badge{
  color:var(--theme-on-hero)!important;
}
.nav-item.active .nav-icon{background:rgba(255,255,255,.16)!important}
.nav-item-featured,.nav-main-admission{background:#f6f8ff!important;border-color:#e0e7fa!important}
.nav-badge{background:#e4eaff!important;color:var(--msb-brand-blue)!important;font-weight:800!important}
.nav-item .nav-icon{display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;line-height:1!important}
.nav-item .nav-icon i{display:block!important;width:100%!important;text-align:center!important;line-height:1!important}

/* Clearly show the control, form area and menu item currently being used. */
:root{--working-highlight:#2563eb;--working-highlight-soft:#dbeafe}
button:focus-visible,.btn:focus-visible,a:focus-visible,.nav-section-head:focus-visible{
 outline:3px solid var(--working-highlight);
 outline-offset:2px;
 box-shadow:0 0 0 5px #2563eb26!important;
}
button:active,.btn:active{filter:brightness(.94);transform:translateY(1px)}
.field:focus-within,.form-grid>label:focus-within,.card label:focus-within{
 color:#1d4ed8!important;
}
.field:focus-within input,.field:focus-within select,.field:focus-within textarea,
.form-grid>label:focus-within input,.form-grid>label:focus-within select,.form-grid>label:focus-within textarea,
.card label:focus-within input,.card label:focus-within select,.card label:focus-within textarea{
 border-color:var(--working-highlight)!important;
 background:#f8fbff!important;
 box-shadow:0 0 0 3px #2563eb24!important;
}
.card:focus-within,section:focus-within,.form-section:focus-within{
 border-color:#93c5fd!important;
 box-shadow:0 0 0 2px #dbeafe,0 8px 24px #2563eb12!important;
}
.nav-section:focus-within>.nav-section-head:not(:has(+ .nav-section-items .nav-item.active)){
 background:var(--working-highlight-soft)!important;
 color:#1d4ed8!important;
}

/* HRMS navigation: keep both HRMS groups truly collapsible and theme-aware. */
.nav-section[data-section="hrms"] .nav-item{color:#43546a!important;}
.nav-section[data-section="hrms"] .nav-item .nav-label{color:inherit!important;}
.nav-section[data-section="hrms"] .nav-item:hover{color:var(--msb-brand-blue)!important;}
.nav-section[data-section="hrms"] .nav-item.active,
.nav-section[data-section="hrms"] .nav-item.active:hover,
.nav-section[data-section="hrms"] .nav-item.active .nav-label,
.nav-section[data-section="hrms"] .nav-item.active .nav-icon,
.nav-section[data-section="hrms"] .nav-item.active .nav-icon i,
.nav-section[data-section="hrms"] .nav-item.active .nav-badge{
  color:var(--theme-on-hero)!important;
}
.nav-section[data-section="attendance_hrms"] .nav-item.active,
.nav-section[data-section="attendance_hrms"] .nav-item.active:hover,
.nav-section[data-section="attendance_hrms"] .nav-item.active .nav-label,
.nav-section[data-section="attendance_hrms"] .nav-item.active .nav-icon,
.nav-section[data-section="attendance_hrms"] .nav-item.active .nav-icon i,
.nav-section[data-section="attendance_hrms"] .nav-item.active .nav-badge{
  color:var(--theme-on-hero)!important;
}
@media (prefers-color-scheme: dark){
  .sidebar{background:linear-gradient(180deg,#0f172a 0%,#111827 100%)!important;border-right-color:#26344b!important;color:#e5e7eb!important;}
  .nav-section-head{color:#cbd5e1!important;}
  .nav-section-head>span>i{color:#94a3b8!important;}
  .nav-section-head:hover{background:#1e293b!important;color:#fff!important;}
  .nav-section.active-section>.nav-section-head{background:var(--adm-hero-gradient)!important;border-color:rgba(255,255,255,.24)!important;color:var(--theme-on-hero)!important;}
  .nav-section.active-section>.nav-section-head>span>i,.nav-section.active-section>.nav-section-head .nav-chevron{color:var(--theme-on-hero)!important;}
  .nav-item,.nav-section[data-section="hrms"] .nav-item{color:#dbe4f0!important;}
  .nav-item .nav-label,.nav-section[data-section="hrms"] .nav-item .nav-label{color:inherit!important;}
  .nav-item .nav-icon{background:#1e293b!important;color:#a5b4fc!important;}
  .nav-item:hover{background:#1e293b!important;border-color:#334155!important;color:#fff!important;}
  .nav-item.active{background:var(--adm-hero-gradient)!important;border-color:rgba(255,255,255,.22)!important;color:var(--theme-on-hero)!important;}
  .nav-item.active .nav-label,.nav-item.active .nav-icon,.nav-item.active .nav-icon i,.nav-item.active .nav-badge{color:var(--theme-on-hero)!important;}
  .nav-item-featured{background:#17213a!important;border-color:#2b3b59!important;}
  .nav-item-featured:hover{background:#1e2b49!important;}
  .nav-badge{background:#243b63!important;color:#bfdbfe!important;}
  .nav-search input{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important;}
  .nav-search input::placeholder{color:#94a3b8!important;}
}

/* Global appearance themes */
body.theme-blue{--primary:#2563eb;--primary2:#3b82f6;--bg:#f4f7fb;--text:#172033;--muted:#64748b;--line:#e2e8f0;--card:#fff;--sidebar:#142d4e;--heading:#142d4e}
body.theme-green{--primary:#16835d;--primary2:#22a06b;--bg:#f3f8f5;--text:#183329;--muted:#64786e;--line:#dce9e0;--card:#fff;--sidebar:#174b3a;--heading:#174b3a}
body.theme-lavender{--primary:#805ad5;--primary2:#9f7aea;--bg:#f7f4fc;--text:#29223b;--muted:#776d8c;--line:#e8e0f2;--card:#fff;--sidebar:#514078;--heading:#514078}
body.theme-dark{--primary:#60a5fa;--primary2:#818cf8;--bg:#111827;--text:#e5e7eb;--muted:#a1a1aa;--line:#374151;--card:#1f2937;--sidebar:#0b1220;--heading:#f3f4f6;color-scheme:dark}
body.theme-dark .card,body.theme-dark .user-chip,body.theme-dark table,body.theme-dark .table-wrap,body.theme-dark .report-summary>div,body.theme-dark .stats>div,body.theme-dark .cards>div{background:var(--card);color:var(--text);border-color:var(--line)}
body.theme-dark th{background:#273449;color:#e5e7eb}body.theme-dark td{border-color:var(--line)}
body.theme-dark .field input,body.theme-dark .field select,body.theme-dark .field textarea,body.theme-dark input,body.theme-dark select,body.theme-dark textarea{background:#111827;color:#e5e7eb;border-color:#4b5563}
body.theme-dark .sidebar{background:var(--sidebar)!important;color:#e5e7eb!important;border-color:var(--line)!important}body.theme-dark .nav-item{color:#d1d5db!important}body.theme-dark .nav-item.active{background:#263b5a!important;color:#fff!important}
body.theme-blue .sidebar,body.theme-green .sidebar,body.theme-lavender .sidebar{background:var(--sidebar)!important;color:#f8fafc!important}body.theme-blue .nav-item,body.theme-green .nav-item,body.theme-lavender .nav-item{color:#f1f5f9!important}body.theme-blue .nav-item.active,body.theme-green .nav-item.active,body.theme-lavender .nav-item.active{background:#ffffff25!important;color:#fff!important;border-color:#ffffff30!important}body.theme-blue .nav-item.active .nav-label,body.theme-green .nav-item.active .nav-label,body.theme-lavender .nav-item.active .nav-label{color:#fff!important}
body.density-compact .card{padding:15px;margin:10px 0}body.density-compact th,body.density-compact td{padding:8px 10px}body.density-compact .field{margin:9px 0}body.density-compact .field input,body.density-compact .field select,body.density-compact .field textarea{padding:9px}
body.density-comfortable .card{padding:22px}body.density-comfortable th,body.density-comfortable td{padding:13px}body.density-comfortable .field{margin:14px 0}
body.density-spacious .card{padding:28px;margin:20px 0}body.density-spacious th,body.density-spacious td{padding:17px}body.density-spacious .field{margin:20px 0}body.density-spacious .field input,body.density-spacious .field select,body.density-spacious .field textarea{padding:15px}
.appearance-form h3{margin:20px 0 5px}.theme-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.theme-option{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:14px;cursor:pointer;background:var(--card)}.theme-option:has(input:checked){border:2px solid var(--primary);padding:13px}.theme-option input{accent-color:var(--primary)}.theme-option small{display:block;color:var(--muted);margin-top:4px}.theme-swatch{width:38px;height:38px;border-radius:10px;flex:0 0 auto;background:#2563eb}.theme-swatch.green{background:#16835d}.theme-swatch.lavender{background:#805ad5}.theme-swatch.dark{background:#1f2937;border:2px solid #64748b}.density-options{display:flex;gap:18px;flex-wrap:wrap}.density-options input{accent-color:var(--primary)}

/* Complete application-wide theme coverage: headers, menus, fields, actions and data views */
body[class*="theme-"]{background:var(--bg)!important;color:var(--text)!important}
body[class*="theme-"] main,body[class*="theme-"] .main-content,body[class*="theme-"] .content,body[class*="theme-"] .page-content,body[class*="theme-"] .container-fluid{color:var(--text)}
body[class*="theme-"] h1,body[class*="theme-"] h2,body[class*="theme-"] h3,body[class*="theme-"] h4,body[class*="theme-"] .page-title{color:var(--heading)}
body[class*="theme-"] .topbar,body[class*="theme-"] .top-nav,body[class*="theme-"] header:not(.sidebar),body[class*="theme-"] .page-header{background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
body[class*="theme-"] .card,body[class*="theme-"] .panel,body[class*="theme-"] .section-card,body[class*="theme-"] .modal-content,body[class*="theme-"] .dropdown-menu,body[class*="theme-"] .filter-panel,body[class*="theme-"] .form-container{background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
body[class*="theme-"] input:not([type=checkbox]):not([type=radio]):not([type=submit]),body[class*="theme-"] select,body[class*="theme-"] textarea,body[class*="theme-"] .form-control,body[class*="theme-"] .field input,body[class*="theme-"] .field select,body[class*="theme-"] .field textarea{background:var(--card)!important;color:var(--text)!important;border:1px solid var(--line)!important;border-radius:8px;}
body[class*="theme-"] input::placeholder,body[class*="theme-"] textarea::placeholder{color:var(--muted)!important;opacity:1}
body[class*="theme-"] input:focus,body[class*="theme-"] select:focus,body[class*="theme-"] textarea:focus,body[class*="theme-"] .form-control:focus{border-color:var(--primary)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent)!important;outline:0}
body[class*="theme-"] button:not(.nav-section-head),body[class*="theme-"] .btn-primary,body[class*="theme-"] button.primary{background:var(--primary);border-color:var(--primary);color:#fff}
body[class*="theme-"] .btn,body[class*="theme-"] button{border-radius:8px}
body[class*="theme-"] .btn-secondary,body[class*="theme-"] button.secondary{background:var(--bg)!important;color:var(--text)!important;border-color:var(--line)!important}
body[class*="theme-"] .btn-danger,body[class*="theme-"] button.danger{background:#dc2626!important;border-color:#dc2626!important;color:#fff!important}
body[class*="theme-"] .btn-success,body[class*="theme-"] button.success{background:#16a34a!important;border-color:#16a34a!important;color:#fff!important}
body[class*="theme-"] table,body[class*="theme-"] .table,body[class*="theme-"] .table-wrap{background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}
body[class*="theme-"] th,body[class*="theme-"] .table thead th{background:var(--bg)!important;color:var(--heading)!important;border-color:var(--line)!important}
body[class*="theme-"] td,body[class*="theme-"] tr{color:var(--text);border-color:var(--line)!important}
body[class*="theme-"] .nav-section-head,body[class*="theme-"] .nav-item{border-color:transparent}
body[class*="theme-"] .breadcrumb,body[class*="theme-"] .text-muted,body[class*="theme-"] small{color:var(--muted)}
body.theme-dark .topbar,body.theme-dark .top-nav,body.theme-dark header:not(.sidebar),body.theme-dark .page-header{background:#1f2937!important;color:#e5e7eb!important}
body.theme-dark .card,body.theme-dark .panel,body.theme-dark .section-card,body.theme-dark .modal-content,body.theme-dark .dropdown-menu,body.theme-dark .filter-panel,body.theme-dark .form-container{background:#1f2937!important;color:#e5e7eb!important}
body.theme-dark input:not([type=checkbox]):not([type=radio]),body.theme-dark select,body.theme-dark textarea,body.theme-dark .form-control{background:#111827!important;color:#e5e7eb!important}
body.theme-dark th,body.theme-dark .table thead th{background:#273449!important;color:#f1f5f9!important}


/* Theme-aware typography and control text colours */
body.theme-blue{--link:#1d4ed8;--link-hover:#1e40af;--label:#243b55;--table-text:#172033;--placeholder:#64748b;--control-text:#172033;--nav-muted:#cbd5e1;--icon:#2563eb}
body.theme-green{--link:#087f5b;--link-hover:#065f46;--label:#214d3b;--table-text:#183329;--placeholder:#64786e;--control-text:#183329;--nav-muted:#d1fae5;--icon:#16835d}
body.theme-lavender{--link:#6d4bc1;--link-hover:#5b3aa8;--label:#493b66;--table-text:#29223b;--placeholder:#776d8c;--control-text:#29223b;--nav-muted:#ede9fe;--icon:#805ad5}
body.theme-dark{--link:#93c5fd;--link-hover:#bfdbfe;--label:#f3f4f6;--table-text:#e5e7eb;--placeholder:#a1a1aa;--control-text:#e5e7eb;--nav-muted:#cbd5e1;--icon:#93c5fd}

body[class*="theme-"]{color:var(--text)!important}
body[class*="theme-"] p,
body[class*="theme-"] li,
body[class*="theme-"] td,
body[class*="theme-"] dd,
body[class*="theme-"] .data-text,
body[class*="theme-"] .table-text,
body[class*="theme-"] .form-text{color:var(--table-text)}
body[class*="theme-"] label,
body[class*="theme-"] .field label,
body[class*="theme-"] .form-label,
body[class*="theme-"] legend,
body[class*="theme-"] .filter-label{color:var(--label)!important}
body[class*="theme-"] a:not(.btn):not(.nav-item):not(.logout){color:var(--link)}
body[class*="theme-"] a:not(.btn):not(.nav-item):not(.logout):hover{color:var(--link-hover)}
body[class*="theme-"] input:not([type=checkbox]):not([type=radio]):not([type=submit]),
body[class*="theme-"] select,
body[class*="theme-"] textarea,
body[class*="theme-"] .form-control,
body[class*="theme-"] .field input,
body[class*="theme-"] .field select,
body[class*="theme-"] .field textarea{color:var(--control-text)!important}
body[class*="theme-"] select option{background:var(--card);color:var(--control-text)}
body[class*="theme-"] input::placeholder,
body[class*="theme-"] textarea::placeholder,
body[class*="theme-"] .form-control::placeholder{color:var(--placeholder)!important}
body[class*="theme-"] .text-muted,
body[class*="theme-"] .muted,
body[class*="theme-"] .help-text,
body[class*="theme-"] .description,
body[class*="theme-"] .hint{color:var(--muted)!important}
body[class*="theme-"] .icon,
body[class*="theme-"] .field-icon,
body[class*="theme-"] .input-wrap i{color:var(--icon)}
body[class*="theme-"] .topbar h1,
body[class*="theme-"] .topbar h2,
body[class*="theme-"] .topbar h3,
body[class*="theme-"] .page-header h1,
body[class*="theme-"] .page-header h2,
body[class*="theme-"] .page-header h3,
body[class*="theme-"] .card h1,
body[class*="theme-"] .card h2,
body[class*="theme-"] .card h3,
body[class*="theme-"] .card h4{color:var(--heading)!important}
body[class*="theme-"] .nav-group-title{color:var(--nav-muted)!important}
body[class*="theme-"] .nav-item,
body[class*="theme-"] .nav-section-head{color:var(--nav-muted)!important}
body[class*="theme-"] .nav-item .nav-icon{color:var(--icon)!important}
body[class*="theme-"] .nav-item.active,
body[class*="theme-"] .nav-item.active .nav-label,
body[class*="theme-"] .nav-item.active .nav-icon,
body[class*="theme-"] .nav-section.active-section>.nav-section-head{color:#fff!important}
body[class*="theme-"] th{color:var(--heading)!important}
body[class*="theme-"] td{color:var(--table-text)!important}
body[class*="theme-"] .badge,
body[class*="theme-"] .status-badge{color:var(--heading)}
body.theme-dark .badge,
body.theme-dark .status-badge{color:#f3f4f6}
body[class*="theme-"] .dropdown-menu a,
body[class*="theme-"] .dropdown-menu button,
body[class*="theme-"] .menu-item{color:var(--text)!important}
body[class*="theme-"] .dropdown-menu a:hover,
body[class*="theme-"] .dropdown-menu button:hover,
body[class*="theme-"] .menu-item:hover{color:var(--heading)!important;background:var(--bg)!important}
body[class*="theme-"] .disabled,
body[class*="theme-"] :disabled{color:var(--muted)!important}
body.theme-dark .report-print-head,
body.theme-dark .report-print-head .report-school h2,
body.theme-dark .report-print-head .report-school p{color:#e5e7eb}

/* Theme-aware topbar controls: sidebar toggle, quick theme selector, accessibility tools and user chip. */
body.theme-blue{--topbar-control-bg:#eff6ff;--topbar-control-bg-hover:#dbeafe;--topbar-control-text:#1e3a8a;--topbar-control-border:#bfdbfe;--topbar-control-icon:#2563eb}
body.theme-green{--topbar-control-bg:#ecfdf5;--topbar-control-bg-hover:#d1fae5;--topbar-control-text:#065f46;--topbar-control-border:#a7f3d0;--topbar-control-icon:#16835d}
body.theme-lavender{--topbar-control-bg:#f5f3ff;--topbar-control-bg-hover:#ede9fe;--topbar-control-text:#5b3aa8;--topbar-control-border:#ddd6fe;--topbar-control-icon:#805ad5}
body.theme-dark{--topbar-control-bg:#273449;--topbar-control-bg-hover:#334155;--topbar-control-text:#f8fafc;--topbar-control-border:#4b5563;--topbar-control-icon:#93c5fd}
body[class*="theme-"] .sidebar-toggle,
body[class*="theme-"] .access-tools button,
body[class*="theme-"] .access-tools a,
body[class*="theme-"] .user-chip,
body[class*="theme-"] .topbar-quick-theme form{
  background:var(--topbar-control-bg)!important;
  color:var(--topbar-control-text)!important;
  border-color:var(--topbar-control-border)!important;
}
body[class*="theme-"] .sidebar-toggle:hover,
body[class*="theme-"] .access-tools button:hover,
body[class*="theme-"] .access-tools a:hover,
body[class*="theme-"] .user-chip:hover,
body[class*="theme-"] .topbar-quick-theme form:focus-within{
  background:var(--topbar-control-bg-hover)!important;
  color:var(--topbar-control-text)!important;
  border-color:var(--primary)!important;
}
body[class*="theme-"] .sidebar-toggle i,
body[class*="theme-"] .access-tools i,
body[class*="theme-"] .user-chip i,
body[class*="theme-"] .topbar-quick-theme label i{color:var(--topbar-control-icon)!important}
.topbar-quick-theme{display:flex;align-items:center;margin-left:8px}
.topbar-quick-theme form{display:flex;align-items:center;gap:7px;min-height:36px;padding:0 8px;border:1px solid var(--line);border-radius:8px}
.topbar-quick-theme label{display:inline-flex;align-items:center;justify-content:center;font-size:14px}
.topbar-quick-theme select{border:0;background:transparent;color:inherit;font:inherit;font-size:12px;font-weight:700;min-height:32px;outline:0;cursor:pointer;padding:0 24px 0 2px}
.topbar-quick-theme select option{background:var(--card);color:var(--text)}
body.theme-dark .topbar-quick-theme select option{background:#1f2937;color:#e5e7eb}
body[class*="theme-"] .access-tools button,
body[class*="theme-"] .access-tools a{color:var(--topbar-control-text)!important}
body[class*="theme-"] .access-tools{gap:6px}
body[class*="theme-"] .topbar-page-actions .btn{border-color:var(--topbar-control-border)}
@media(max-width:900px){.topbar-quick-theme select{max-width:130px}.topbar-quick-theme{margin-left:0}}
@media(max-width:700px){.topbar-quick-theme form{min-height:40px}.topbar-quick-theme select{max-width:118px}.topbar-quick-theme label{display:none}}

/* Final theme visibility pass: sidebar feature links, HRMS links, school identity and page heroes. */
body.theme-blue{--theme-hero-start:#142d4e;--theme-hero-end:#2563eb;--theme-sidebar-text:#eef6ff;--theme-sidebar-muted:#c7dcf5;--theme-nav-soft:rgba(255,255,255,.08);--theme-nav-hover:rgba(255,255,255,.15);--theme-nav-border:rgba(255,255,255,.16)}
body.theme-green{--theme-hero-start:#174b3a;--theme-hero-end:#16835d;--theme-sidebar-text:#effff7;--theme-sidebar-muted:#c8eadb;--theme-nav-soft:rgba(255,255,255,.08);--theme-nav-hover:rgba(255,255,255,.15);--theme-nav-border:rgba(255,255,255,.16)}
body.theme-lavender{--theme-hero-start:#514078;--theme-hero-end:#805ad5;--theme-sidebar-text:#fbf9ff;--theme-sidebar-muted:#e6dcff;--theme-nav-soft:rgba(255,255,255,.09);--theme-nav-hover:rgba(255,255,255,.16);--theme-nav-border:rgba(255,255,255,.17)}
body.theme-dark{--theme-hero-start:#0b1220;--theme-hero-end:#334155;--theme-sidebar-text:#f8fafc;--theme-sidebar-muted:#cbd5e1;--theme-nav-soft:#17213a;--theme-nav-hover:#24324d;--theme-nav-border:#334155}

/* Theme-aware hero gradient used by Dashboard, Admission Inquiry and shared module headers. */
body[class*="theme-"]{--adm-hero-gradient:linear-gradient(135deg,var(--theme-hero-start),var(--theme-hero-end));--theme-on-hero:#fff;--theme-on-hero-muted:rgba(255,255,255,.84)}
body.theme-blue .adm-hero,body.theme-blue .hero,body.theme-blue .gs-hero,
body.theme-green .adm-hero,body.theme-green .hero,body.theme-green .gs-hero,
body.theme-lavender .adm-hero,body.theme-lavender .hero,body.theme-lavender .gs-hero,
body.theme-dark .adm-hero,body.theme-dark .hero,body.theme-dark .gs-hero{background:var(--adm-hero-gradient)!important;color:#fff!important}

/* Dashboard hero action buttons remain high-contrast in every theme. */
body[class*="theme-"] .adm-hero .btn,
body[class*="theme-"] .hero .btn,
body[class*="theme-"] .gs-hero .btn{background:rgba(255,255,255,.96)!important;color:var(--theme-hero-start)!important;border:1px solid rgba(255,255,255,.72)!important}
body[class*="theme-"] .adm-hero .btn.outline,
body[class*="theme-"] .hero .btn.outline,
body[class*="theme-"] .gs-hero .btn.outline{background:transparent!important;color:#fff!important;border-color:rgba(255,255,255,.7)!important}

/* Sidebar: featured dashboard/report links should look like the other menu buttons. */
body[class*="theme-"] .sidebar .nav-item,
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"] .nav-item,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"] .nav-item{color:var(--theme-sidebar-text)!important;background:var(--theme-nav-soft)!important;border:1px solid transparent!important}
body[class*="theme-"] .sidebar .nav-item .nav-label,
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"] .nav-item .nav-label,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"] .nav-item .nav-label{color:inherit!important}
body[class*="theme-"] .sidebar .nav-item .nav-icon{background:rgba(255,255,255,.10)!important;color:var(--theme-sidebar-text)!important}
body[class*="theme-"] .sidebar .nav-item:hover,
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"] .nav-item:hover,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"] .nav-item:hover{background:var(--theme-nav-hover)!important;border-color:var(--theme-nav-border)!important;color:#fff!important}
body[class*="theme-"] .sidebar .nav-item-featured,
body[class*="theme-"] .sidebar .nav-main-admission{background:var(--theme-nav-soft)!important;border-color:var(--theme-nav-border)!important}
body[class*="theme-"] .sidebar .nav-item-featured:hover,
body[class*="theme-"] .sidebar .nav-main-admission:hover{background:var(--theme-nav-hover)!important}
body[class*="theme-"] .sidebar .nav-item .nav-badge{background:rgba(255,255,255,.14)!important;color:#fff!important;border:1px solid rgba(255,255,255,.16)!important}
body[class*="theme-"] .sidebar .nav-item.active{background:var(--adm-hero-gradient)!important;color:#fff!important;border-color:rgba(255,255,255,.28)!important}
body[class*="theme-"] .sidebar .nav-item.active .nav-label,
body[class*="theme-"] .sidebar .nav-item.active .nav-icon,
body[class*="theme-"] .sidebar .nav-item.active .nav-icon i,
body[class*="theme-"] .sidebar .nav-item.active .nav-badge{color:#fff!important}

/* HRMS section headings and all HRMS menu links stay readable in every theme. */
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"]>.nav-section-head,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"]>.nav-section-head{color:var(--theme-sidebar-text)!important}
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"]>.nav-section-head:hover,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"]>.nav-section-head:hover{background:var(--theme-nav-hover)!important;color:#fff!important}
body[class*="theme-"] .sidebar .nav-section[data-section="hrms"]>.nav-section-head i,
body[class*="theme-"] .sidebar .nav-section[data-section="attendance_hrms"]>.nav-section-head i{color:inherit!important}

/* School identity in sidebar: MSB + EDUCATIONAL INSTITUTE follows the active theme. */
body.theme-blue .sidebar .brand strong,body.theme-blue .sidebar .brand span{color:#fff!important}
body.theme-blue .sidebar .brand span{color:#c7dcf5!important}
body.theme-green .sidebar .brand strong,body.theme-green .sidebar .brand span{color:#f3fff9!important}
body.theme-green .sidebar .brand span{color:#c8eadb!important}
body.theme-lavender .sidebar .brand strong,body.theme-lavender .sidebar .brand span{color:#fff!important}
body.theme-lavender .sidebar .brand span{color:#e6dcff!important}
body.theme-dark .sidebar .brand strong{color:#f8fafc!important}
body.theme-dark .sidebar .brand span{color:#cbd5e1!important}

/* Admission Inquiry page title/header: theme-specific and high contrast. */
body[class*="theme-"] .main .card>h2:first-child,
body[class*="theme-"] .main .card>h1:first-child{background:var(--adm-hero-gradient)!important;color:#fff!important;border-color:rgba(255,255,255,.18)!important}
body[class*="theme-"] .main .card>h2:first-child + p,
body[class*="theme-"] .main .card>h1:first-child + p{color:var(--text)!important}

/* Keep text/icons visible on the themed sidebar even when browser prefers dark mode. */
body[class*="theme-"] .sidebar .brand strong,
body[class*="theme-"] .sidebar .brand span,
body[class*="theme-"] .sidebar .nav-label,
body[class*="theme-"] .sidebar .nav-section-head{opacity:1!important}


/* Theme-aware sidebar section hover: match the HRMS section treatment across every menu section. */
body[class*="theme-"] .sidebar .nav-section>.nav-section-head{
  color:var(--theme-sidebar-text)!important;
  background:transparent!important;
  border:1px solid transparent!important;
  transition:background .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease;
}
body[class*="theme-"] .sidebar .nav-section>.nav-section-head:hover{
  background:var(--theme-nav-hover)!important;
  border-color:var(--theme-nav-border)!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(0,0,0,.12)!important;
}
body[class*="theme-"] .sidebar .nav-section>.nav-section-head:hover>span>i,
body[class*="theme-"] .sidebar .nav-section>.nav-section-head:hover .nav-chevron{
  color:#fff!important;
}

/* Keep the selected section distinct while using the active theme colours. */
body[class*="theme-"] .sidebar .nav-section.active-section>.nav-section-head{
  background:var(--theme-nav-hover)!important;
  border-color:var(--theme-nav-border)!important;
  color:#fff!important;
  box-shadow:0 5px 14px rgba(0,0,0,.16)!important;
}
body[class*="theme-"] .sidebar .nav-section.active-section>.nav-section-head>span>i,
body[class*="theme-"] .sidebar .nav-section.active-section>.nav-section-head .nav-chevron{
  color:#fff!important;
}


/* Employee Register back button: always return to the ERP Employee Register root. */
.hrms-employee-register-back{}

/* Logout hover follows the same transparent, theme-aware treatment as HRMS menu items. */
body[class*="theme-"] .sidebar .logout{
  background:var(--theme-nav-soft)!important;
  color:var(--theme-sidebar-text)!important;
  border:1px solid transparent!important;
  transition:background .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease;
}
body[class*="theme-"] .sidebar .logout:hover{
  background:var(--theme-nav-hover)!important;
  border-color:var(--theme-nav-border)!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(0,0,0,.12)!important;
}
body[class*="theme-"] .sidebar .logout:hover i{color:#fff!important}

/* Topbar user chip menu. */
.user-menu{position:relative;display:inline-block}
.user-menu .user-chip{position:relative}
.user-chip{border:1px solid var(--line);cursor:pointer}
.user-chip-chevron{font-size:10px;opacity:.72;margin-left:2px}
.user-menu-dropdown{position:absolute;right:0;top:calc(100% + 8px);min-width:150px;padding:6px;background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 28px rgba(15,23,42,.16);z-index:1000;display:none}
.user-menu.open .user-menu-dropdown{display:block}
.user-menu-dropdown a{display:flex;align-items:center;gap:9px;padding:10px 11px;border-radius:7px;color:var(--text);font-size:13px;font-weight:650;transition:background .18s ease,color .18s ease}
.user-menu-dropdown a:hover{background:var(--theme-nav-hover,var(--bg));color:var(--primary)}
body.theme-dark .user-menu-dropdown{box-shadow:0 14px 30px rgba(0,0,0,.42)}
@media(max-width:850px){.user-menu-dropdown{right:0}.user-chip-chevron{display:none}}

/* ==========================================================
   Staff Management — complete workspace redesign
   Theme-aware: uses global ERP variables, no fixed theme colours.
   ========================================================== */
.staff-page{max-width:1600px;margin:0 auto;padding-bottom:28px}
.staff-hero{align-items:flex-end;margin-bottom:20px}
.staff-hero h1{margin:3px 0 5px;font-size:30px;letter-spacing:-.02em}
.staff-hero p{max-width:760px;margin:0}
.eyebrow,.section-kicker{font-size:11px;text-transform:uppercase;letter-spacing:.09em;font-weight:800;color:var(--primary);display:flex;align-items:center;gap:7px}
.staff-add-btn{white-space:nowrap}
.staff-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.staff-stat-card{display:flex;align-items:center;gap:13px;padding:17px 18px;background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 5px 16px rgba(15,23,42,.045);color:var(--text);text-decoration:none;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.staff-stat-card:hover{transform:translateY(-1px);border-color:var(--primary);box-shadow:0 9px 22px rgba(15,23,42,.08)}
.staff-stat-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--theme-nav-soft,var(--surface-2,#f8fafc));color:var(--primary);font-size:17px;flex:0 0 42px}
.staff-stat-card small{display:block;color:var(--muted);font-size:11px;font-weight:700;margin-bottom:3px}.staff-stat-card strong{font-size:23px;line-height:1}
.staff-workspace-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start}
.staff-register-card,.staff-side-card{border-radius:15px;overflow:visible}
.staff-section-head{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:20px 20px 14px;border-bottom:1px solid var(--line)}
.staff-section-head.compact{padding:0 0 14px;border-bottom:0}.staff-section-head h2{margin:2px 0 2px;font-size:18px}.staff-section-head p{margin:0;color:var(--muted);font-size:12px}.staff-head-actions{display:flex;gap:7px;flex-wrap:wrap}
.staff-filter-panel{margin:14px 16px 16px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2,#f8fafc)}
.staff-search-row{display:grid;grid-template-columns:minmax(220px,1.7fr) repeat(3,minmax(130px,1fr));gap:10px;align-items:end}.staff-filter-panel label>span,.staff-more-filters label>span{display:block;font-size:11px;font-weight:750;color:var(--muted);margin-bottom:5px}.staff-filter-panel input,.staff-filter-panel select{width:100%}
.staff-search-wrap{position:relative}.staff-search-wrap i{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:12px}.staff-search-wrap input{padding-left:33px}
.staff-more-filters{margin-top:11px;border-top:1px solid var(--line);padding-top:10px}.staff-more-filters summary{cursor:pointer;list-style:none;font-size:12px;font-weight:750;color:var(--text);display:flex;align-items:center;gap:7px}.staff-more-filters summary::-webkit-details-marker{display:none}.staff-more-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:11px}.staff-filter-actions{display:flex;gap:7px;margin-top:12px}
.staff-table-wrap{overflow-x:auto}.staff-table{width:100%;min-width:900px;border-collapse:separate;border-spacing:0}.staff-table th{background:var(--surface-2,#f8fafc);color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.055em;font-weight:800;padding:11px 12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap}.staff-table td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle;font-size:12px}.staff-table tbody tr{transition:background .15s ease}.staff-table tbody tr:hover{background:var(--theme-nav-soft,rgba(148,163,184,.07))}.staff-table td small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.staff-actions-col{text-align:right}.staff-actions-cell{text-align:right;width:58px}
.staff-person{display:flex;align-items:center;gap:10px;min-width:185px}.staff-person strong{display:block;font-size:12px}.staff-person span{display:block;color:var(--muted);font-size:10px;margin-top:3px}.staff-avatar{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;overflow:hidden;background:var(--theme-nav-soft,var(--surface-2,#f8fafc));color:var(--primary);font-weight:800;flex:0 0 38px}.staff-avatar img{width:100%;height:100%;object-fit:cover}.staff-contact{display:flex;flex-direction:column;gap:4px}.staff-contact span{display:flex;align-items:center;gap:6px;font-size:10px}.staff-contact i{width:11px;color:var(--muted)}
.status-pill{display:inline-flex!important;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:800}.status-pill i{font-size:6px}.status-pill.active{background:rgba(16,185,129,.11);color:#059669}.status-pill.inactive{background:rgba(148,163,184,.16);color:var(--muted)}
.staff-action-menu{position:relative;display:inline-block}.staff-kebab{width:34px;height:32px;padding:0!important;display:grid!important;place-items:center;border-radius:9px}.staff-action-popover{position:absolute;right:0;top:calc(100% + 5px);width:190px;padding:5px;background:var(--card);border:1px solid var(--line);border-radius:11px;box-shadow:0 15px 32px rgba(15,23,42,.16);z-index:30;display:none}.staff-action-menu.open .staff-action-popover{display:block}.staff-action-popover a,.staff-inline-form button{width:100%;display:flex;align-items:center;gap:9px;padding:8px 9px;border:0;background:transparent;color:var(--text);border-radius:7px;font:inherit;font-size:11px;font-weight:650;text-decoration:none;text-align:left;cursor:pointer}.staff-action-popover a:hover,.staff-inline-form button:hover{background:var(--theme-nav-soft,var(--surface-2,#f8fafc));color:var(--primary)}.staff-menu-divider{height:1px;background:var(--line);margin:5px 3px}.staff-inline-form{margin:0}.staff-inline-form button{color:#dc2626}.staff-inline-form button:hover{background:rgba(220,38,38,.08);color:#b91c1c}
.staff-empty{text-align:center;padding:58px 20px;color:var(--muted)}.staff-empty-icon{width:50px;height:50px;margin:0 auto 12px;display:grid;place-items:center;border-radius:14px;background:var(--surface-2,#f8fafc);color:var(--muted);font-size:19px}.staff-empty h3{margin:0 0 5px;color:var(--text);font-size:15px}.staff-empty p{margin:0 auto 15px;max-width:430px;font-size:12px}
.staff-pagination{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 16px;color:var(--muted);font-size:11px}.staff-pagination>div{display:flex;align-items:center;gap:8px}.staff-pagination strong{color:var(--text);font-size:11px}
.staff-side-column{display:grid;gap:18px}.staff-side-card{padding:18px}.staff-dept-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);color:var(--text);text-decoration:none;font-size:11px}.staff-dept-row:last-child{border-bottom:0}.staff-dept-row:hover{color:var(--primary)}.staff-dept-row strong{font-size:11px;color:var(--primary)}.staff-quick-links{display:grid;gap:3px}.staff-quick-links a{display:flex;align-items:center;gap:10px;padding:10px 8px;border-radius:9px;text-decoration:none;color:var(--text)}.staff-quick-links a:hover{background:var(--theme-nav-soft,var(--surface-2,#f8fafc));color:var(--primary)}.staff-quick-links>a>i{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;background:var(--surface-2,#f8fafc);color:var(--primary);font-size:11px}.staff-quick-links strong,.staff-quick-links small{display:block}.staff-quick-links strong{font-size:11px}.staff-quick-links small{font-size:9px;color:var(--muted);margin-top:2px}
.staff-modal{position:fixed;inset:0;display:none;z-index:2000}.staff-modal.open{display:block}.staff-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.52);backdrop-filter:blur(2px)}.staff-modal-dialog{position:relative;width:min(900px,calc(100% - 28px));max-height:calc(100vh - 28px);margin:14px auto;background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.28);overflow:auto}.staff-modal-form{min-height:100%;display:flex;flex-direction:column}.staff-modal-head{display:flex;justify-content:space-between;gap:18px;padding:22px 24px 17px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--card);z-index:2}.staff-modal-head h2{margin:3px 0 5px;font-size:21px}.staff-modal-head p{margin:0;color:var(--muted);font-size:11px;max-width:650px}.staff-modal-close{width:34px;height:34px;border:1px solid var(--line);background:var(--surface-2,#f8fafc);color:var(--text);border-radius:9px;cursor:pointer}.staff-form-section{padding:18px 24px;border-bottom:1px solid var(--line)}.staff-form-section-title{display:flex;align-items:center;gap:10px;margin-bottom:13px}.staff-form-section-title>span{width:27px;height:27px;border-radius:8px;display:grid;place-items:center;background:var(--theme-nav-soft,var(--surface-2,#f8fafc));color:var(--primary);font-size:9px;font-weight:900}.staff-form-section-title strong,.staff-form-section-title small{display:block}.staff-form-section-title strong{font-size:12px}.staff-form-section-title small{font-size:9px;color:var(--muted);margin-top:2px}.staff-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.staff-form-grid label{font-size:11px;font-weight:700;color:var(--text)}.staff-form-grid input,.staff-form-grid select{display:block;width:100%;margin-top:5px}.staff-modal-foot{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:15px 24px;position:sticky;bottom:0;background:var(--card);border-top:1px solid var(--line);z-index:2}.staff-modal-foot>span{font-size:10px;color:var(--muted)}.staff-modal-foot>span i{margin-right:4px}.staff-modal-foot>div{display:flex;gap:7px}.modal-open{overflow:hidden}
body.theme-dark .staff-stat-card,body.theme-dark .staff-action-popover,body.theme-dark .staff-modal-dialog{box-shadow:0 16px 40px rgba(0,0,0,.3)}
@media(max-width:1150px){.staff-workspace-grid{grid-template-columns:1fr}.staff-side-column{grid-template-columns:1fr 1fr}.staff-search-row{grid-template-columns:1.5fr repeat(3,1fr)}}
@media(max-width:850px){.staff-stat-grid{grid-template-columns:repeat(2,1fr)}.staff-search-row{grid-template-columns:1fr 1fr}.staff-search-field{grid-column:1/-1}.staff-more-grid{grid-template-columns:1fr 1fr}.staff-section-head{align-items:flex-start;flex-direction:column}.staff-head-actions{width:100%}.staff-side-column{grid-template-columns:1fr}.staff-modal-head,.staff-form-section,.staff-modal-foot{padding-left:16px;padding-right:16px}}
@media(max-width:560px){.staff-page{padding-bottom:15px}.staff-hero h1{font-size:25px}.staff-stat-grid{grid-template-columns:1fr 1fr;gap:8px}.staff-stat-card{padding:12px}.staff-stat-icon{width:36px;height:36px;flex-basis:36px}.staff-stat-card strong{font-size:19px}.staff-stat-card small{font-size:9px}.staff-search-row,.staff-more-grid,.staff-form-grid{grid-template-columns:1fr}.staff-filter-panel{margin:10px 10px 12px}.staff-pagination{align-items:flex-start;flex-direction:column}.staff-modal-dialog{width:calc(100% - 14px);max-height:calc(100vh - 14px);margin:7px auto}.staff-modal-foot{align-items:flex-start;flex-direction:column}.staff-modal-foot>div{width:100%}.staff-modal-foot>div .btn{flex:1}.staff-head-actions .btn{flex:1;text-align:center}.staff-action-popover{right:-4px}}


/* Final collapsible navigation rule: section switching is immediate; only the chevron animates. */
.nav-section-items{
  display:none!important;
  max-height:none!important;
  overflow:visible!important;
  opacity:1!important;
  padding:0!important;
  visibility:visible!important;
}
.nav-section.open>.nav-section-items{
  display:block!important;
  max-height:none!important;
  padding:3px 0 6px 4px!important;
  visibility:visible!important;
}
.nav-section-head,.nav-chevron{
  transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease!important;
}
@media (prefers-reduced-motion: reduce){
  .nav-section-head,.nav-chevron,.sidebar,.main{transition:none!important;}
}
.nav-section-head>span>span,.nav-item .nav-label,.nav-badge{
  text-transform:capitalize!important;
}
