@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Noto+Nastaliq+Urdu:wght@400;600;700&display=swap');

:root{
  --bg:#f8fafc;--panel:#ffffff;--ink:#132219;--ink-light:#334155;--muted:#64748b;--line:#e2e8f0;--line-light:#f1f5f9;
  --brand:var(--brand-primary,#0A4A2A);--brand2:#135737;--brand3:#135737;--brand-soft:#E7F0E9;--brand-border:#A9C6B1;
  --accent:#BF8213;--accent-soft:#FCF6E9;--danger:#dc2626;--danger-soft:#fef2f2;--warn:#d97706;--warn-soft:#fffbeb;
  --shadow-sm:0 1px 3px rgba(0,0,0,0.05),0 1px 2px rgba(0,0,0,0.03);
  --shadow:0 4px 20px -2px rgba(19,34,25,0.06),0 2px 6px -1px rgba(19,34,25,0.03);
  --shadow-lg:0 20px 40px -15px rgba(19,34,25,0.15);
  --radius:16px;--radius-sm:12px;--radius-full:9999px;
  --font-sans:'Plus Jakarta Sans',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-display:'Outfit',var(--font-sans);
  --font-urdu:'Noto Nastaliq Urdu',serif;
}
*{box-sizing:border-box}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.5;letter-spacing:-0.011em}
[lang="ur"], [dir="rtl"], .ur-text{font-family:var(--font-urdu),var(--font-sans)}
h1,h2,h3,h4,h5,h6,.brand b,.topbar h1,.metric b,.stat-val{font-family:var(--font-display);letter-spacing:-0.025em;font-weight:800}
a{color:var(--brand);text-decoration:none;transition:color .15s ease}a:hover{color:var(--brand2)}
button,input,select,textarea{font-family:inherit;font-size:inherit}
button,.button{cursor:pointer;border:1px solid var(--line);background:#fff;color:var(--ink);padding:9px 14px;border-radius:var(--radius-sm);font-weight:700;transition:all .18s cubic-bezier(0.4,0,0.2,1);display:inline-flex;align-items:center;justify-content:center;gap:6px}
button:hover,.button:hover{border-color:#cbd5e1;background:#f8fafc;transform:translateY(-1px);box-shadow:var(--shadow-sm)}
button:active,.button:active{transform:translateY(0)}
.primary{background:var(--brand)!important;color:#fff!important;border:none!important;box-shadow:0 4px 12px rgba(10,74,42,0.25)}
.primary:hover{background:var(--brand2)!important;box-shadow:0 6px 16px rgba(10,74,42,0.35)}
.dangerbtn{background:var(--danger-soft);color:var(--danger);border-color:#fecaca}.dangerbtn:hover{background:#fee2e2;border-color:#f87171}
.full{width:100%}.muted{color:var(--muted)}small{color:var(--muted)}code{background:#f1f5f9;border-radius:6px;padding:3px 7px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;word-break:break-all}
input,select,textarea{width:100%;border:1.5px solid #cbd5e1;background:#fff;color:var(--ink);padding:10px 13px;border-radius:var(--radius-sm);outline:none;transition:all .2s ease}textarea{min-height:90px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3.5px rgba(10,74,42,0.14);background:#fff}
label{display:grid;gap:6px;font-size:13px;color:var(--ink-light)}label>span{font-weight:700}
.check{display:flex;align-items:center;gap:8px}.check input{width:auto}.stack{display:grid;gap:14px}.inline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.inline input,.inline select{width:auto;min-width:90px}.button-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.app-shell{min-height:100vh;display:grid;grid-template-columns:270px minmax(0,1fr)}
.sidebar{background:#013117;color:#f1f5f9;position:sticky;top:0;height:100vh;overflow-y:auto;padding:20px 14px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.2) transparent}
.brand{display:flex;gap:12px;align-items:center;padding:4px 8px 20px;border-bottom:1px solid rgba(255,255,255,0.08);margin-bottom:14px}
.brand img{width:46px;height:46px;object-fit:contain;background:#fff;border-radius:12px;padding:4px;box-shadow:0 4px 12px rgba(0,0,0,0.2)}
.brand b{display:block;line-height:1.2;font-size:15px;color:#fff}
.brand small{display:block;color:#94a3b8;margin-top:4px;font-size:11.5px;font-weight:600}
.sidebar nav{display:grid;gap:3px}
.sidebar nav a{color:#cbd5e1;display:flex;align-items:center;gap:11px;padding:9.5px 12px;border-radius:var(--radius-sm);font-size:13.5px;font-weight:600;transition:all .15s ease}
.sidebar nav a span{width:22px;text-align:center;font-size:15px;opacity:.9}
.sidebar nav a:hover{background:rgba(255,255,255,0.08);color:#fff;transform:translateX(2px)}
.sidebar nav a.active{background:#135737;color:#fff;box-shadow:0 4px 12px rgba(10,74,42,0.3);font-weight:800}
.nav-group{font-size:10px;color:#FAD380;font-weight:900;letter-spacing:1.3px;padding:18px 10px 6px;text-transform:uppercase}
.main-area{min-width:0}
.topbar{min-height:70px;background:rgba(255,255,255,0.9);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);position:sticky;top:0;z-index:30;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:10px 24px;gap:12px}
.top-left,.top-right{display:flex;align-items:center;gap:12px}
.topbar h1{font-size:20px;margin:0;color:var(--ink)}
.topbar small{display:block;margin-top:2px;color:var(--muted);font-weight:600;font-size:12px}
.menu-btn{display:none}
.pwa-install-btn{background:var(--brand-primary,#0A4A2A)!important;color:#fff!important;border:none!important;font-weight:800!important;font-size:12.5px!important;padding:8px 16px!important;border-radius:999px!important;box-shadow:0 4px 14px rgba(10,74,42,0.35)!important;display:inline-flex;align-items:center;gap:6px;cursor:pointer;transition:all .2s ease}
.pwa-install-btn:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(10,74,42,0.45)!important}
.ai-pill{background:#4f46e5;color:#fff;padding:8px 14px;border-radius:999px;font-size:12.5px;font-weight:800;box-shadow:0 4px 12px rgba(79,70,229,0.3);display:inline-flex;align-items:center;gap:5px;transition:all .2s}
.ai-pill:hover{transform:translateY(-1px);color:#fff;box-shadow:0 6px 16px rgba(79,70,229,0.4)}
.lang-toggle{background:#f1f5f9;color:#334155;border:1px solid var(--line);padding:7px 12px;border-radius:8px;font-size:12px;font-weight:700}
.user-chip{display:grid;background:#fff;border:1px solid var(--line);border-radius:12px;padding:6px 12px;min-width:120px;box-shadow:var(--shadow-sm)}
.user-chip b{font-size:12px;color:var(--ink)}
.user-chip span{font-size:10.5px;color:var(--muted);text-transform:capitalize;font-weight:600}
.logout{font-size:12.5px;font-weight:700;color:var(--danger);padding:6px 10px;border-radius:8px;background:var(--danger-soft)}
.logout:hover{background:#fee2e2;color:#b91c1c}
.content{padding:22px 24px 50px;max-width:1600px;margin:auto}
.flash{background:#f0fdf4;color:#15803d;border:1.5px solid #86efac;padding:12px 16px;border-radius:12px;margin-bottom:18px;font-weight:600;display:flex;align-items:center;gap:10px;box-shadow:var(--shadow-sm)}
.flash.error{background:var(--danger-soft);color:var(--danger);border-color:#fca5a5}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px;margin-bottom:20px;transition:box-shadow .2s ease}
.panel:hover{box-shadow:0 8px 30px -4px rgba(19,34,25,0.08)}
.panel h2,.panel h3{margin:0 0 14px;color:var(--ink)}
.panel p{line-height:1.6;color:var(--ink-light)}
.panel-title,.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.toolbar form{display:flex;align-items:end;gap:8px;flex-wrap:wrap}
.toolbar{padding-top:14px;padding-bottom:14px}
.toolbar h3{margin:0}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid .wide{grid-column:1/-1}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.metric-grid{display:grid;gap:14px;margin-bottom:20px}
.metric-grid.six{grid-template-columns:repeat(6,minmax(0,1fr))}
.metric-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.metric-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.metric-grid.compact .metric{min-height:95px}
.metric{display:block;background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;color:var(--ink);box-shadow:var(--shadow);min-width:0;transition:transform .18s,box-shadow .18s}
.metric:hover{transform:translateY(-2px);box-shadow:0 12px 30px -4px rgba(19,34,25,0.09)}
.metric span{display:block;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.4px}
.metric b{display:block;font-size:26px;margin:6px 0;overflow-wrap:anywhere;color:var(--ink)}
.metric small{font-size:11.5px;color:var(--muted)}
.metric.good{border-top:3.5px solid #10b981}
.metric.warn{border-top:3.5px solid #f59e0b}
.metric.danger{border-top:3.5px solid #ef4444}
.dash-greeting{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:20px}
.dash-greeting h2{margin:0 0 4px;font-size:24px;color:var(--ink)}
.dash-greeting p{margin:0;color:var(--muted);font-weight:500}
.today-chip{background:#fff;border:1px solid var(--line);padding:10px 16px;border-radius:12px;font-weight:800;color:var(--ink);box-shadow:var(--shadow-sm)}
.quick-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.quick-grid a{border:1px solid var(--line);background:#f8fafc;border-radius:12px;padding:14px;text-align:center;font-weight:800;color:var(--ink);transition:all .15s}
.quick-grid a:hover{background:#fff;border-color:var(--brand);color:var(--brand);box-shadow:var(--shadow-sm);transform:translateY(-1px)}
.activity{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:12px 0}
.activity:last-child{border-bottom:0}
.activity small{display:block;margin-top:3px;color:var(--muted)}
.chart{width:100%;height:250px;display:block}
.table-wrap{overflow-x:auto;padding:0;border-radius:var(--radius);border:1px solid var(--line);background:#fff;box-shadow:var(--shadow)}
.table-wrap>h3{padding:18px 20px 0}
.table-wrap table,table{border-collapse:collapse;width:100%}
th,td{text-align:left;padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle;font-size:13px}
th{background:#f8fafc;color:#475569;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}
tr:last-child td{border-bottom:0}
tbody tr:hover td{background:#f8fafc}
td small{display:block;margin-top:3px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:var(--radius-full);font-size:11px;font-weight:800;text-transform:capitalize;background:#f1f5f9;color:#475569;letter-spacing:0}
.badge.present,.badge.paid,.badge.active,.badge.published,.badge.approved,.badge.enrolled,.badge.in{background:#dcfce7;color:#15803d}
.badge.absent,.badge.failed,.badge.rejected,.badge.out,.badge.void,.badge.left{background:#fee2e2;color:#b91c1c}
.badge.pending,.badge.partial,.badge.late,.badge.printable,.badge.reprint,.badge.simulated{background:#fef3c7;color:#b45309}
.attendance-buttons{display:flex;gap:4px}
.attendance-buttons button{padding:6px 10px;font-size:11.5px;border-radius:6px}
.profile-hero{background:var(--brand-primary,#0A4A2A);color:#fff;border-radius:18px;padding:20px;display:flex;align-items:center;gap:16px;margin-bottom:18px;box-shadow:var(--shadow)}.profile-hero h2{margin:0 0 5px}.profile-hero p,.profile-hero small{margin:0;color:#e1f0e9}.profile-photo,.admission-photo,.result-photo{width:92px;height:92px;border-radius:15px;object-fit:cover;object-position:center 15%!important;background:#E7F0E9;border:3px solid #fff}.fallback{display:grid;place-items:center;font-size:32px;font-weight:900;color:var(--brand)}.hero-actions{margin-left:auto;display:flex;gap:7px;flex-wrap:wrap}.profile-hero .button{background:#fff}.tiny-photo,.avatar,img.tiny-photo,img.avatar{width:42px;height:42px;border-radius:10px;object-fit:cover;object-position:center 15%!important;background:#E7F0E9}.data-list{display:grid;grid-template-columns:120px 1fr;gap:9px;margin:0}.data-list dt{color:var(--muted);font-size:12px}.data-list dd{margin:0;font-weight:700}
.resource-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.resource-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:16px;box-shadow:var(--shadow)}.resource-card h3{margin:10px 0 5px}.notice-list{display:grid;gap:14px}.notice-card{margin:0}.timetable-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.timetable-day{margin:0}.period{display:flex;gap:10px;border-top:1px solid var(--line);padding:10px 0}.period-no{width:34px;height:34px;border-radius:9px;background:var(--brand-soft);color:var(--brand);font-weight:900;display:grid;place-items:center;flex:0 0 auto}.period small{display:block;margin-top:3px}.scan-video{width:100%;border-radius:12px;margin-top:12px;background:#000}.signature-pad{width:100%;height:180px;border:1px dashed #a9bbb2;border-radius:12px;background:#fff;touch-action:none}
.ai-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:16px}.ai-side{margin:0;max-height:calc(100vh - 120px);overflow:auto}.ai-conv{display:block;padding:10px;border-bottom:1px solid var(--line);font-size:13px}.ai-conv.active{background:var(--brand-soft);font-weight:800}.ai-chat{margin:0;display:flex;flex-direction:column;min-height:650px}.chat-stream{flex:1;padding:8px 0;overflow:auto;max-height:calc(100vh - 300px)}.bubble{max-width:82%;padding:12px 14px;border-radius:14px;margin:8px 0;line-height:1.55}.bubble.user{margin-left:auto;background:var(--brand);color:#fff}.bubble.assistant{background:#f0f4f2}.bubble small{display:block;font-size:9px;text-transform:uppercase;margin-bottom:4px}.bubble.user small{color:#d9ece4}.chat-form{display:grid;grid-template-columns:1fr auto;gap:8px;border-top:1px solid var(--line);padding-top:12px}.chat-form textarea{min-height:60px}.ai-empty{text-align:center;padding:80px 20px;color:var(--muted)}
.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background-image:var(--login-bg);background-size:cover;background-position:center;position:relative}.login-overlay{position:fixed;inset:0;background:linear-gradient(135deg,rgba(3,39,28,.76),rgba(8,54,41,.42),rgba(0,0,0,.58));backdrop-filter:blur(2px)}.login-card{position:relative;z-index:1;width:min(430px,100%);background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.7);border-radius:25px;padding:30px;box-shadow:0 28px 90px rgba(0,0,0,.32);text-align:center}.login-logo{width:90px;height:90px;object-fit:contain;background:#fff;border-radius:18px;padding:7px;box-shadow:0 8px 24px #0001}.login-card h1{font-size:24px;margin:12px 0 4px}.login-card>p{margin-top:0;color:var(--muted)}.login-card form{text-align:left}.forgot{display:inline-block;margin-top:15px}.login-foot{font-size:11px;color:var(--muted);margin-top:18px}hr{border:0;border-top:1px solid var(--line);margin:20px 0}
.print-page{background:#e9eeeb;padding:20px}.print-toolbar{max-width:900px;margin:0 auto 14px;display:flex;gap:8px;justify-content:flex-end}.a4,.receipt-sheet{width:210mm;min-height:297mm;margin:auto;background:#fff;padding:15mm;position:relative;box-shadow:0 10px 35px #0002}.letter-head,.receipt-head{display:flex;align-items:center;gap:14px;border-bottom:3px solid #013117;padding-bottom:10px}.letter-head img,.receipt-head img{width:74px;height:74px;object-fit:contain}.letter-head h1,.receipt-head h1{margin:0;color:#013117;font-size:25px}.letter-head p,.receipt-head p{margin:4px 0 0;color:#4b5f6d}.a4>h2,.receipt-sheet>h2{text-align:center;margin:20px 0}.admission-top{display:flex;justify-content:space-between;gap:18px;margin-bottom:18px}.admission-photo{width:35mm;height:43mm;border:1px solid #aaa;border-radius:4px}.data-box{display:grid;grid-template-columns:150px 1fr;gap:8px;flex:1}.print-table{border-collapse:collapse;width:100%}.print-table th,.print-table td{border:1px solid #aeb9b4;padding:8px;background:#fff;text-transform:none;font-size:12px;letter-spacing:0}.doc-checks{display:flex;flex-wrap:wrap;gap:15px;border:1px solid #ccd6d1;padding:10px}.signature-row{display:grid;grid-template-columns:repeat(3,1fr);gap:30px;margin-top:45px;text-align:center}.signature-row>div{border-top:1px solid #555;padding-top:8px}.a4 footer,.receipt-sheet footer{position:absolute;left:15mm;right:15mm;bottom:10mm;border-top:2px solid #013117;text-align:center;padding-top:7px;color:#365468}.receipt-sheet{overflow:hidden}.receipt-watermark{position:absolute;inset:0;background-size:cover;background-position:center;opacity:.06;filter:grayscale(1);pointer-events:none}.receipt-head,.receipt-sheet>h2,.receipt-grid,.receipt-sign,.receipt-sheet footer,.void-stamp{position:relative;z-index:1}.receipt-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:25px}.receipt-grid>div{border:1px solid #ced8d3;border-radius:8px;padding:10px}.receipt-grid small{display:block}.receipt-grid b{font-size:15px}.receipt-sign{margin-top:50px;width:200px;margin-left:auto;text-align:center;border-top:1px solid #555;padding-top:8px}.receipt-sign img{display:block;width:150px;height:60px;object-fit:contain;margin:-65px auto 5px}.void-stamp{border:4px solid #a22;color:#a22;transform:rotate(-10deg);font-size:34px;font-weight:900;padding:10px;position:absolute;left:70mm;top:125mm}
/* CR80 Standard PVC ID Card */
.id-print-wrap{display:flex;gap:15mm;align-items:flex-start;justify-content:center;flex-wrap:wrap;padding:15mm 0}
.id-card{width:85.6mm;height:54mm;background:#fff;border-radius:3.5mm;overflow:hidden;position:relative;box-shadow:0 8px 25px rgba(0,0,0,.15);border:1px solid #c0d1c8;display:flex;flex-direction:column;box-sizing:border-box}
.id-card.front header{height:14mm;background:linear-gradient(135deg,var(--brand-primary,#0b6b4d),#14805d);color:#fff;display:flex;align-items:center;gap:2.5mm;padding:2mm 3.5mm;flex-shrink:0}
.id-card.front header img{width:10mm;height:10mm;object-fit:contain;background:#fff;border-radius:2mm;padding:.8mm}
.id-card.front header b{display:block;font-size:8.5pt;line-height:1.1;font-weight:800;letter-spacing:-.2px}
.id-card.front header small{color:#d2ede2;font-size:6pt;text-transform:uppercase;letter-spacing:.8px;display:block;margin-top:1px}
.id-card.front main{padding:2.5mm 3.5mm;display:grid;grid-template-columns:22mm 1fr;gap:3.5mm;align-items:center;flex:1}
.id-photo{width:22mm;height:27mm;border-radius:2.5mm;border:1.5px solid var(--brand-primary,#0b6b4d);object-fit:cover;background:#e7f5ef}
.id-card-details{text-align:left}
.id-card-name{font-size:10.5pt;font-weight:900;color:#16231f;margin:0 0 1.5mm;line-height:1.2}
.id-card-row{font-size:7pt;color:#455750;margin:.8mm 0;line-height:1.25}
.id-card-row b{color:#16231f}
.id-card-badges{display:flex;gap:1.5mm;margin-top:2mm;flex-wrap:wrap}
.id-card-badges span{background:#e7f5ef;color:var(--brand-primary,#0b6b4d);font-size:6.5pt;font-weight:800;padding:.8mm 2.2mm;border-radius:1.2mm;border:.5px solid #c0e3d4}
.id-card.back{padding:3mm 4mm;display:flex;flex-direction:column;justify-content:space-between;text-align:center}
.id-back-header{border-bottom:1px solid #dfe8e4;padding-bottom:1.5mm}
.id-back-header h3{margin:0;font-size:8.5pt;color:var(--brand-primary,#0b6b4d)}
.id-back-header p{margin:.5mm 0 0;font-size:5.5pt;color:#687870}
.id-back-body{font-size:6pt;color:#333;line-height:1.4;margin:1mm 0}
.id-back-barcode{margin:1mm auto;text-align:center}
.id-back-barcode svg{width:54mm;height:12mm}
.id-back-footer{border-top:1px solid #dfe8e4;padding-top:1mm;display:flex;justify-content:space-between;align-items:flex-end;font-size:5.5pt;color:#687870}
.doc-preview-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;background:#E7F0E9;color:var(--brand-primary,#0A4A2A);padding:4px 8px;border-radius:6px;font-weight:bold;text-decoration:none;margin-top:4px}
.live-preview-thumb{width:56px;height:56px;border-radius:8px;object-fit:cover;border:1px solid var(--line);margin-top:6px}
.ai-help-banner{background:#E7F0E9;border:1px solid #A9C6B1;color:#0A4A2A;padding:16px;border-radius:12px;margin-bottom:16px;line-height:1.6}


/* Minhaj CMS Style Reference Login */
.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background-image:var(--login-bg);background-size:cover;background-position:center;background-repeat:no-repeat;position:relative}
.login-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.38);backdrop-filter:blur(1px)}
.login-card{position:relative;z-index:1;width:min(440px,100%);background:rgba(255,255,255,0.97);border-radius:18px;padding:32px 28px;box-shadow:0 25px 60px rgba(0,0,0,0.35);text-align:center}
.login-logo-wrap{width:76px;height:76px;margin:-10px auto 14px;background:#fff;border-radius:50%;padding:6px;box-shadow:0 6px 18px rgba(0,0,0,0.12);display:grid;place-items:center;border:1px solid #e1e8e5}
.login-logo{width:58px;height:58px;object-fit:contain}
.login-card h1{font-size:20px;margin:4px 0 2px;color:#16231f;font-weight:800}
.login-card .v4schoolname{margin:0 0 18px;color:var(--brand-primary,#0A4A2A);font-weight:700;font-size:14px}
.login-card label{text-align:left;margin-bottom:12px}
.login-card label span{font-weight:700;font-size:12px;color:#455750;display:block;margin-bottom:5px}
.login-card input{background:#fafbfc;border:1px solid #ccd7d2;padding:12px 14px;border-radius:8px;font-size:14px}
.login-card input:focus{background:#fff;border-color:var(--brand-primary,#0A4A2A);box-shadow:0 0 0 3px rgba(10,74,42,0.12)}
.login-btn-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
.btn-signin{background:#0A4A2A!important;color:#fff!important;border:none!important;padding:12px!important;border-radius:8px!important;font-weight:800!important;font-size:14px!important}
.btn-forgot{background:#f6ad55!important;color:#fff!important;border:none!important;padding:12px!important;border-radius:8px!important;font-weight:800!important;font-size:14px!important;display:grid;place-items:center;text-decoration:none}
.btn-signin:hover{background:#135737!important}
.btn-forgot:hover{background:#dd6b20!important}
.login-footer-copy{margin-top:22px;padding-top:14px;border-top:1px solid #edf2ef;font-size:11px;color:#718096}

/* Live Scanner Modal & Student Card */
.live-scan-card{background:var(--brand-primary,#0A4A2A);color:#fff;border-radius:18px;padding:20px;display:flex;align-items:center;gap:18px;margin-top:16px;box-shadow:0 12px 35px rgba(10,74,42,0.25);animation:slideUp .3s ease}
@keyframes slideUp{from{opacity:0;transform:translateY(15px)}to{opacity:1;transform:translateY(0)}}
.live-scan-photo{width:80px;height:95px;border-radius:12px;object-fit:cover;background:#fff;border:2.5px solid #fff}
.live-scan-details{flex:1}
.live-scan-details h3{margin:0 0 4px;font-size:18px}
.live-scan-details p{margin:0 0 6px;color:#d4eee3;font-size:13px}
.live-scan-badge{display:inline-block;background:#38a169;color:#fff;font-size:11px;font-weight:800;padding:4px 10px;border-radius:999px}
.branding-preview-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px}
.branding-preview-box{background:#f9fbfa;border:1px solid #dfe8e4;border-radius:12px;padding:12px;text-align:center}
.branding-preview-box img{max-width:100%;height:90px;object-fit:contain;margin-bottom:8px;border-radius:8px}


/* Standard Portrait CR80 PVC ID Card (54mm x 85.6mm) */
.id-print-wrap{display:flex;gap:15mm;align-items:flex-start;justify-content:center;flex-wrap:wrap;padding:12mm 0}
.id-card-port{width:54mm;height:85.6mm;background:#fff;border-radius:3.5mm;overflow:hidden;position:relative;box-shadow:0 8px 25px rgba(0,0,0,.15);border:1px solid #b2c9be;display:flex;flex-direction:column;box-sizing:border-box;text-align:center}
.id-card-port.front header{background:linear-gradient(135deg,var(--brand-primary,#0b6b4d),#14805d);color:#fff;padding:2.5mm 2mm 2mm;flex-shrink:0}
.id-card-port.front header img{width:10mm;height:10mm;object-fit:contain;background:#fff;border-radius:50%;padding:.6mm;margin:0 auto 1mm;display:block}
.id-card-port.front header b{display:block;font-size:7.5pt;line-height:1.1;font-weight:800;text-transform:uppercase}
.id-card-port.front header small{color:#d2ede2;font-size:5.5pt;text-transform:uppercase;letter-spacing:.8px;display:block;margin-top:.5mm}
.id-card-port.front main{padding:2.5mm 3mm;display:flex;flex-direction:column;align-items:center;justify-content:space-between;flex:1}
.id-photo-port{width:26mm;height:31mm;border-radius:2.5mm;border:1.5px solid var(--brand-primary,#0b6b4d);object-fit:cover;background:#e7f5ef;margin:1mm 0}
.id-name-port{font-size:10pt;font-weight:900;color:#16231f;margin:0;line-height:1.15}
.id-father-port{font-size:7pt;color:#4a5d54;margin:1mm 0}
.id-pills-port{display:flex;gap:1.5mm;justify-content:center;margin:1.5mm 0;flex-wrap:wrap}
.id-pills-port span{background:#e7f5ef;color:var(--brand-primary,#0b6b4d);font-size:6.5pt;font-weight:800;padding:.8mm 2.2mm;border-radius:1.2mm;border:.5px solid #bce1d0}
.id-code-badge-port{background:var(--brand-primary,#0b6b4d);color:#fff;font-size:7pt;font-weight:800;padding:1mm 3.5mm;border-radius:1.5mm;letter-spacing:.5px;margin-top:1mm}

/* Portrait Back */
.id-card-port.back{padding:3.5mm 3mm;display:flex;flex-direction:column;justify-content:space-between}
.id-card-port.back .back-head img{width:11mm;height:11mm;object-fit:contain;margin:0 auto}
.id-card-port.back .back-head h3{font-size:7.5pt;margin:1mm 0 .5mm;color:var(--brand-primary,#0b6b4d);font-weight:800}
.id-card-port.back .back-head p{font-size:5.5pt;color:#555;margin:0;line-height:1.2}
.id-card-port.back .back-rules{font-size:5.5pt;color:#333;line-height:1.35;border-top:.5px solid #ddd;border-bottom:.5px solid #ddd;padding:1.5mm 0;margin:1.5mm 0}
.id-card-port.back .back-barcode svg{width:46mm;height:11mm;margin:auto}
.id-card-port.back .back-foot{display:flex;justify-content:space-between;align-items:flex-end;font-size:5.5pt;color:#666;padding-top:1mm}

/* Fix Branding Preview Box in Settings */
.branding-preview-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:14px;margin-bottom:18px}
.branding-preview-box{background:#f9fbfa;border:1px solid #dfe8e4;border-radius:12px;padding:12px;text-align:center;overflow:hidden}
.branding-preview-box img{width:100%;height:110px;object-fit:cover;border-radius:8px;display:block;margin:0 auto 8px;border:1px solid #e2e8e5}


/* Date Sheet & Letterhead Print Styling */
.letterhead-doc{max-width:210mm;margin:0 auto;background:#fff;padding:15mm 20mm;box-shadow:0 0 20px rgba(0,0,0,0.08);box-sizing:border-box}
.letterhead-head{display:flex;align-items:center;gap:18px;border-bottom:2.5px solid var(--brand-primary,#0b6b4d);padding-bottom:12px;margin-bottom:15px}
.letterhead-logo{width:75px;height:75px;object-fit:contain}
.letterhead-title h1{font-size:22px;color:var(--brand-primary,#0b6b4d);margin:0 0 4px;font-weight:900;text-transform:uppercase}
.letterhead-title p{margin:0 0 4px;font-size:12px;color:#444}
.letterhead-title small{font-size:11px;color:#666}
.datesheet-doc-title{text-align:center;margin:18px 0 14px}
.datesheet-doc-title h2{font-size:16px;color:#16231f;margin:0 0 2px;letter-spacing:.5px;font-weight:900}
.datesheet-doc-title span{font-size:12px;color:var(--brand-primary,#0b6b4d);font-weight:700}
.datesheet-print-table{width:100%;border-collapse:collapse;margin:14px 0 20px}
.datesheet-print-table th,.datesheet-print-table td{border:1px solid #ccd7d2;padding:9px 12px;font-size:12px;text-align:left}
.datesheet-print-table th{background:#eaf4f0;color:var(--brand-primary,#0b6b4d);font-weight:800}
.datesheet-print-notes{background:#f8faf9;border:1px solid #dfe8e4;padding:10px 15px;border-radius:8px;font-size:11px;color:#444;margin:15px 0}
.datesheet-print-notes ul{margin:4px 0 0 18px;padding:0}
.datesheet-signatures{display:flex;justify-content:space-between;margin-top:35px;padding-top:10px}
.sig-box{width:200px;text-align:center}
.sig-line{border-top:1.5px solid #333;margin:8px 0 4px}
.sig-box span{font-size:12px;font-weight:700;color:#333}

@media print{
  .no-print{display:none!important}
  body.print-page{background:#fff!important;padding:0!important}
  .letterhead-doc{box-shadow:none!important;padding:0!important;max-width:100%!important}
}


/* ==========================================================================
   AL-MUSTAFA EXACT PVC ID CARD (54mm x 85.6mm)
   ========================================================================== */
.id-print-grid{display:flex;flex-wrap:wrap;gap:15mm;justify-content:center;padding:10mm 0}
.almustafa-card{width:54mm;height:85.6mm;background:#fff;border-radius:4mm;overflow:hidden;position:relative;box-shadow:0 10px 25px rgba(0,0,0,0.18);border:1px solid #ccd7d2;display:flex;flex-direction:column;box-sizing:border-box;font-family:'Segoe UI',Roboto,Helvetica,sans-serif}

/* Front Side */
.almustafa-card.front{background:#fff;position:relative}
.almustafa-card.front .id-navy-header{background:linear-gradient(135deg,#0c2340,#1a365d);color:#fff;text-align:center;padding:3mm 2mm 2.5mm;position:relative;z-index:2;border-bottom-left-radius:50% 6mm;border-bottom-right-radius:50% 6mm}
.almustafa-card.front .id-navy-header h1{font-size:10.5pt;font-weight:900;margin:0;letter-spacing:.3px;color:#fff;text-transform:uppercase;line-height:1.1}
.almustafa-card.front .id-navy-header p{font-size:6.5pt;font-weight:800;margin:0.5mm 0 0;letter-spacing:.6px;color:#cbd5e1;text-transform:uppercase}
.almustafa-card.front .id-body{padding:2.5mm 3.5mm;display:flex;flex-direction:column;align-items:center;flex:1;position:relative;z-index:2}
.almustafa-card.front .id-photo-frame{width:26mm;height:31mm;border-radius:3.5mm;border:2px solid #0c2340;object-fit:cover;background:#f1f5f9;margin:1.5mm auto 2mm;display:block}
.almustafa-card.front .id-student-name{font-size:11pt;font-weight:900;color:#0c2340;margin:0 0 1mm;text-align:center;line-height:1.15}
.almustafa-card.front .id-divider{width:32mm;height:1px;background:#cbd5e1;margin:0.5mm auto 1.5mm}
.almustafa-card.front .id-info-table{width:100%;font-size:6.5pt;color:#334155;text-align:left;line-height:1.35}
.almustafa-card.front .id-info-table td{padding:0.4mm 0}
.almustafa-card.front .id-info-table b{color:#0c2340;font-weight:800}

/* Back Side */
.almustafa-card.back{background:#fff;padding:3mm 3mm 0;display:flex;flex-direction:column;justify-content:space-between;text-align:center}
.almustafa-card.back .id-back-logo{width:16mm;height:16mm;object-fit:contain;margin:0 auto}
.almustafa-card.back .id-back-building{width:100%;height:26mm;object-fit:cover;border-radius:2.5mm;margin:1.5mm 0;border:1px solid #e2e8f0}
.almustafa-card.back .id-back-mid{display:grid;grid-template-columns:16mm 1fr;gap:2mm;align-items:center;margin:1mm 0;text-align:left}
.almustafa-card.back .id-back-qr{width:16mm;height:16mm;background:#fff;padding:0.5mm;border:1px solid #cbd5e1;border-radius:1.5mm}
.almustafa-card.back .id-back-qr img{width:100%;height:100%;object-fit:contain}
.almustafa-card.back .id-back-contact{font-size:5.5pt;color:#1e293b;line-height:1.3}
.almustafa-card.back .id-back-contact b{color:#0c2340}
.almustafa-card.back .id-back-footer{background:linear-gradient(135deg,#0c2340,#1a365d);color:#fff;font-size:6.5pt;font-weight:800;padding:1.5mm;margin:1.5mm -3mm 0;text-transform:uppercase;letter-spacing:.4px}

/* Class Attendance Card Grid */
.class-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;margin-top:16px}
.class-att-card{background:#fff;border:1px solid #dfe8e4;border-radius:14px;padding:18px;text-align:center;box-shadow:0 4px 15px rgba(0,0,0,0.04);transition:transform .2s ease,box-shadow .2s ease}
.class-att-card:hover{transform:translateY(-3px);box-shadow:0 8px 25px rgba(10,74,42,0.12);border-color:var(--brand-primary,#0A4A2A)}
.class-att-card h3{font-size:18px;color:#16231f;margin:0 0 4px}
.class-att-card p{font-size:13px;color:#687870;margin:0 0 14px}
.class-att-card .btn-take{display:block;background:var(--brand-primary,#0A4A2A);color:#fff;font-weight:800;padding:10px 14px;border-radius:8px;text-decoration:none;font-size:13px}

/* 1-Page A4 Admission Print Fix */
@page{size:A4 portrait;margin:6mm 10mm}
.a4-onepage{max-width:190mm;max-height:272mm;margin:0 auto;background:#fff;padding:8mm 12mm;box-sizing:border-box;page-break-inside:avoid}
.a4-onepage .letterhead-head{padding-bottom:8px;margin-bottom:10px}
.a4-onepage .letterhead-logo{width:60px;height:60px}
.a4-onepage .letterhead-title h1{font-size:18px;margin:0}
.a4-onepage .print-table th,.a4-onepage .print-table td{padding:5px 8px;font-size:11px}
.a4-onepage .signature-row{margin-top:22px;padding-top:8px}

/* Fix Branding Preview Box in Settings */
.settings-preview-wrap{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-top:10px}
.settings-preview-card{background:#fff;border:1px solid #ccd7d2;border-radius:10px;padding:10px;text-align:center;max-width:260px}
.settings-preview-card img{width:100%;height:100px;object-fit:cover;border-radius:6px;margin-bottom:6px;border:1px solid #e2e8e5}


/* ==========================================================================
   AL-MUSTAFA OFFICIAL GREEN PVC ID CARD (54mm x 85.6mm)
   ========================================================================== */
.id-print-grid{display:flex;flex-wrap:wrap;gap:15mm;justify-content:center;padding:10mm 0}
.green-id-card{width:54mm;height:85.6mm;background:#fff;border-radius:3.8mm;overflow:hidden;position:relative;box-shadow:0 8px 25px rgba(0,0,0,0.15);border:1px solid #9fb0d8;display:flex;flex-direction:column;box-sizing:border-box;font-family:'Segoe UI',Roboto,Helvetica,sans-serif;text-align:center}

/* Front Side — PDF design: navy header, red school name, centred photo, curved navy band */
.green-id-card.front header{background:linear-gradient(160deg,#1d3176 0%,#16265e 55%,#101d47 100%);color:#fff;padding:3mm 2mm 2.6mm;flex-shrink:0;position:relative;z-index:2;border-bottom:none}
.green-id-card.front header::after{content:'';position:absolute;inset:0;background:repeating-linear-gradient(115deg,rgba(255,255,255,0.05) 0 1.2mm,transparent 1.2mm 3.2mm);pointer-events:none}
.green-id-card.front header img{display:none}
.green-id-card.front header b{display:block;font-size:11.5pt;line-height:1.12;font-weight:900;color:#f4252c;text-shadow:-0.6px 0 0 #fff,0.6px 0 0 #fff,0 -0.6px 0 #fff,0 0.6px 0 #fff;position:relative;z-index:1}
.green-id-card.front header small{display:none}
.green-id-card.front main{padding:1.6mm 3mm 2.4mm;display:flex;flex-direction:column;align-items:center;flex:1;position:relative;z-index:1}
.green-id-card.front main::before{content:'';position:absolute;left:-12%;bottom:0;width:124%;height:29.5mm;background:linear-gradient(180deg,#1d3176,#101d47);border-radius:50% 50% 0 0/100% 100% 0 0;z-index:-1}
.green-id-card.front .green-id-photo{width:26mm;height:31mm;border-radius:2mm;border:none;object-fit:cover;background:#eef1f8;margin:0.6mm auto 0;display:block}
.green-id-card.front .green-id-name{font-size:12.5pt;font-weight:900;color:#fff;margin:auto 0 0;line-height:1.15;padding-top:5.5mm}
.green-id-card.front .green-id-father{display:inline-block;background:#fff;color:#16265e;font-size:7.5pt;font-weight:800;padding:1mm 3mm;border-radius:99px;margin:1.5mm 0 0}
.green-id-card.front .green-id-pills{display:flex;gap:1.5mm;justify-content:center;margin:1.5mm 0 0;flex-wrap:wrap}
.green-id-card.front .green-id-pills span{display:none}
.green-id-card.front .green-id-pills span:first-child{display:inline;background:transparent;color:#fff;font-size:8.5pt;font-weight:800;padding:0;border:none}
.green-id-card.front .green-id-code{background:transparent;color:#c9d6ff;font-size:6.3pt;font-weight:700;padding:0;letter-spacing:0.9px;margin-top:1.3mm}

/* Back Side — navy to match the PDF design family */
.green-id-card.back{padding:3mm 3mm 0;display:flex;flex-direction:column;justify-content:space-between}
.green-id-card.back .back-head img{width:11mm;height:11mm;object-fit:contain;margin:0 auto}
.green-id-card.back .back-head h3{font-size:7.5pt;margin:1mm 0 .5mm;color:#16265e;font-weight:900}
.green-id-card.back .back-head p{font-size:5.5pt;color:#555;margin:0;line-height:1.2}
.green-id-card.back .back-bldg{width:100%;height:25mm;object-fit:cover;border-radius:2mm;border:1px solid #e2e8f0;margin:1mm 0}
.green-id-card.back .back-mid-row{display:grid;grid-template-columns:16mm 1fr;gap:2mm;align-items:center;margin:1mm 0;text-align:left}
.green-id-card.back .back-qr-box{width:16mm;height:16mm;background:#fff;padding:.5mm;border:1px solid #cbd5e1;border-radius:1.5mm}
.green-id-card.back .back-qr-box img{width:100%;height:100%;object-fit:contain}
.green-id-card.back .back-contact-text{font-size:5.5pt;color:#1e293b;line-height:1.3}
.green-id-card.back .back-contact-text b{color:#16265e}
.green-id-card.back .back-green-footer{background:linear-gradient(135deg,#1d3176,#101d47);color:#fff;font-size:6.5pt;font-weight:800;padding:1.4mm;margin:1.5mm -3mm 0;text-transform:uppercase;letter-spacing:.4px}

/* Staff ID card — LANDSCAPE 86 x 54 mm, same navy PDF design family */
.staff-land-card{width:86mm;height:54mm;background:#fff;border-radius:3.5mm;overflow:hidden;position:relative;border:1px solid #9fb0d8;display:flex;flex-direction:column;box-sizing:border-box;font-family:'Segoe UI',Roboto,Helvetica,sans-serif;box-shadow:0 8px 25px rgba(0,0,0,0.15)}
.staff-land-card .sl-head{background:linear-gradient(135deg,#1d3176,#101d47);color:#fff;display:flex;align-items:center;gap:2mm;padding:1.8mm 3mm;flex-shrink:0}
.staff-land-card .sl-head img{width:7mm;height:7mm;object-fit:contain;background:#fff;border-radius:50%;padding:.4mm;display:block}
.staff-land-card .sl-head b{font-size:9.5pt;font-weight:900;line-height:1.05;display:block}
.staff-land-card .sl-head small{display:block;font-size:5.5pt;letter-spacing:1.2px;color:#c9d6ff;font-weight:700;margin-top:.3mm}
.staff-land-card .sl-body{flex:1;display:flex;gap:3mm;padding:2.2mm 3mm;align-items:center}
.staff-land-card .sl-photo{width:20mm;height:25mm;object-fit:cover;border-radius:2mm;border:1.2px solid #16265e;background:#eef1f8;flex-shrink:0;display:block}
.staff-land-card .sl-info{flex:1;text-align:left;min-width:0}
.staff-land-card .sl-name{font-size:13pt;font-weight:900;color:#16265e;line-height:1.1}
.staff-land-card .sl-desig{display:inline-block;background:#e3e9fb;color:#16265e;font-weight:800;font-size:7.5pt;padding:.7mm 2.4mm;border-radius:99px;margin:1.2mm 0}
.staff-land-card .sl-row{font-size:7.5pt;color:#3c465e;line-height:1.55}
.staff-land-card .sl-row b{color:#16265e}
.staff-land-card .sl-qr{width:17mm;height:17mm;border:1px solid #cbd5e1;border-radius:1.5mm;padding:.6mm;background:#fff;flex-shrink:0;box-sizing:border-box}
.staff-land-card .sl-qr img{width:100%;height:100%;object-fit:contain;display:block}
.staff-land-card .sl-foot{background:linear-gradient(135deg,#1d3176,#101d47);color:#fff;font-size:6.8pt;font-weight:800;padding:1.3mm 3mm;letter-spacing:.5px;text-transform:uppercase;flex-shrink:0}
.staff-land-card.sheet-land{box-shadow:none!important;margin:0!important}

/* Guaranteed 1-Page A4 Admission Print */
@page{size:A4 portrait;margin:8mm 10mm}
.a4-onepage{max-width:190mm;min-height:auto!important;height:auto!important;margin:0 auto;background:#fff;padding:8mm 12mm;box-sizing:border-box;page-break-inside:avoid;display:block!important}
.admission-top-flex{display:flex;justify-content:space-between;align-items:flex-start;margin:10px 0 12px}
.admission-top-meta{flex:1;font-size:12px;line-height:1.8}
.admission-top-meta div{margin-bottom:2px}
.admission-top-meta b{color:#16231f;margin-left:4px}
.admission-print-photo{width:95px;height:115px;border:1.5px solid var(--brand-primary,#0b6b4d);border-radius:6px;object-fit:cover;flex-shrink:0;box-shadow:0 2px 8px rgba(0,0,0,0.1)}
.admission-print-table{width:100%;border-collapse:collapse;margin:8px 0 20px}
.admission-print-table th,.admission-print-table td{border:1px solid #ccd7d2;padding:6px 9px;font-size:11.5px;text-align:left}
.admission-print-table th{background:#f0f5f3;color:var(--brand-primary,#0b6b4d);font-weight:700;width:24%}
.admission-print-sig{display:flex;justify-content:space-between;margin-top:35px;padding-top:10px}
.admission-sig-col{width:180px;text-align:center}
.admission-sig-col .sig-bar{border-top:1.5px solid #333;margin-bottom:6px;min-height:30px}
.admission-sig-col b{font-size:11px;color:#222;display:block}
.a4-onepage footer{position:static!important;margin-top:25px!important;border-top:1px solid #dfe8e4!important;padding-top:8px!important}

/* Sidebar mobile toggle buttons & backdrop */
.sidebar-close-btn{display:none}
.sidebar-backdrop{display:none}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Engine
   ========================================================================== */
@media (max-width: 1024px) {
  .app-shell {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
  }
  .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(2, 21, 10, 0.58) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.28s ease, visibility 0.28s ease !important;
    pointer-events: none;
  }
  .sidebar-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  body.drawer-open {
    overflow: hidden !important;
  }
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 290px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 12px 0 50px rgba(0, 0, 0, 0.5) !important;
  }
  [dir="rtl"] .sidebar {
    left: auto !important;
    right: 0 !important;
    transform: translateX(105%) !important;
  }
  [dir="rtl"] .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: -12px 0 50px rgba(0, 0, 0, 0.5) !important;
  }
  .sidebar-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    border: 0 !important;
    font-size: 16px !important;
    margin-left: auto !important;
    cursor: pointer !important;
  }
  [dir="rtl"] .sidebar-close-btn {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  .sidebar-close-btn:active {
    background: rgba(255, 255, 255, 0.25) !important;
  }
  .menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    font-size: 20px !important;
    color: var(--ink) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04) !important;
  }
  .menu-btn:active {
    background: var(--brand-soft) !important;
    border-color: var(--brand) !important;
    color: var(--brand) !important;
  }
  .main-area {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
  .metric-grid.six {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .metric-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .topbar {
    min-height: 62px !important;
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  .top-left {
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .top-left div {
    min-width: 0 !important;
  }
  .topbar h1 {
    font-size: 17px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
  }
  .topbar small {
    font-size: 10.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .top-right {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .ai-pill {
    padding: 6px 9px !important;
    font-size: 11px !important;
  }
  .lang-toggle, .logout {
    padding: 6px 9px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
  }
  .user-chip {
    padding: 4px 7px !important;
    min-width: auto !important;
    border-radius: 8px !important;
  }
  .user-chip b {
    font-size: 11px !important;
    max-width: 90px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .user-chip span {
    font-size: 9px !important;
  }
  .content {
    padding: 12px 10px 50px !important;
  }

  /* Dashboard Stats Grid on Mobile: Clean 2 columns with full readability */
  .metric-grid.six, .metric-grid.four, .metric-grid.three, .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    margin-bottom: 12px !important;
  }
  .metric {
    padding: 12px 10px !important;
    border-radius: 12px !important;
    min-width: 0 !important;
  }
  .metric span {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }
  .metric b {
    font-size: 19px !important;
    margin: 3px 0 !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
  }
  .metric small {
    font-size: 10px !important;
  }

  /* Greeting & Quick Actions */
  .dash-greeting {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .dash-greeting h2 {
    font-size: 17px !important;
    margin: 0 0 2px !important;
  }
  .dash-greeting p {
    font-size: 11.5px !important;
  }
  .today-chip {
    padding: 5px 8px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  .grid2, .grid3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .chart {
    height: 200px !important;
  }
  .quick-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .quick-grid a {
    padding: 10px 4px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Forms, Panels, Tables & Lists */
  .panel {
    padding: 14px 12px !important;
    border-radius: 13px !important;
    margin-bottom: 12px !important;
  }
  .panel h2, .panel h3 {
    font-size: 16px !important;
    margin-bottom: 10px !important;
  }
  .panel-title {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .toolbar form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .toolbar form > * {
    width: 100% !important;
    max-width: 100% !important;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-grid .wide {
    grid-column: auto !important;
  }
  .inline {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .inline input, .inline select, .inline button {
    width: 100% !important;
  }
  .button-row {
    flex-direction: column !important;
    gap: 6px !important;
  }
  .button-row button, .button-row .button, .button-row a {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-left: -12px !important;
    margin-right: -12px !important;
    padding: 0 12px !important;
    border-radius: 0 !important;
  }
  .table-wrap table {
    min-width: 520px !important;
  }
  th, td {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
  .profile-hero {
    flex-direction: column !important;
    text-align: center !important;
    padding: 16px 12px !important;
    gap: 12px !important;
  }
  .hero-actions {
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: center !important;
  }
  .resource-grid {
    grid-template-columns: 1fr !important;
  }
  .timetable-grid {
    grid-template-columns: 1fr !important;
  }
  .ai-layout {
    grid-template-columns: 1fr !important;
  }
  .branding-preview-grid, .settings-preview-wrap {
    grid-template-columns: 1fr !important;
  }
  .class-card-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 440px) {
  .user-chip {
    display: none !important;
  }
  .topbar {
    padding: 8px 10px !important;
  }
  .topbar h1 {
    font-size: 16px !important;
  }
  .metric-grid.six, .metric-grid.four, .metric-grid.three, .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
  .metric {
    padding: 10px 8px !important;
  }
  .metric b {
    font-size: 17px !important;
  }
  .quick-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
  }
  .quick-grid a {
    font-size: 10.5px !important;
    padding: 8px 2px !important;
  }
  .login-card {
    padding: 22px 16px !important;
    border-radius: 16px !important;
  }
}

/* ==========================================================================
   PERFECT A4 ADMISSION FORM & RECORD
   ========================================================================== */
.admission-sheet{width:210mm;height:297mm;max-height:297mm;margin:0 auto;background:#fff;padding:10mm 14mm 8mm;box-sizing:border-box;position:relative;display:flex;flex-direction:column;justify-content:space-between;font-family:'Segoe UI',Roboto,Arial,sans-serif;color:#1a202c;border:1px solid #d1d5db;box-shadow:0 10px 30px rgba(0,0,0,0.08)}
.adm-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2.5px solid var(--brand-primary,#0b6b4d);padding-bottom:8px;margin-bottom:6px}
.adm-header img{width:56px;height:56px;object-fit:contain}
.adm-header-text{text-align:center;flex:1}
.adm-header-text h1{margin:0;font-size:21px;color:var(--brand-primary,#0b6b4d);font-weight:900;text-transform:uppercase;letter-spacing:.3px}
.adm-header-text p{margin:2px 0 0;font-size:11.5px;color:#475569}
.adm-header-text small{color:#64748b;font-size:10.5px}
.adm-title-pill{text-align:center;margin:6px 0 10px}
.adm-title-pill span{background:var(--brand-primary,#0b6b4d);color:#fff;padding:4px 18px;border-radius:20px;font-size:12px;font-weight:800;letter-spacing:1px;text-transform:uppercase;display:inline-block}

.adm-meta-flex{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:10px}
.adm-meta-grid{flex:1;display:grid;grid-template-columns:repeat(2,1fr);gap:6px 12px;font-size:11.5px;line-height:1.4}
.adm-meta-item{display:flex;border-bottom:1px dashed #cbd5e1;padding-bottom:2px}
.adm-meta-item span{color:#64748b;width:115px;font-size:11px}
.adm-meta-item b{color:#0f172a;flex:1}
.adm-photo-frame{width:32mm;height:38mm;border:2px solid var(--brand-primary,#0b6b4d);border-radius:4px;overflow:hidden;background:#f8fafc;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 6px rgba(0,0,0,0.1)}
.adm-photo-frame img{width:100%;height:100%;object-fit:cover}
.adm-photo-placeholder{font-size:9px;color:#94a3b8;text-align:center;font-weight:700;line-height:1.2}

.adm-data-table{width:100%;border-collapse:collapse;margin:4px 0 10px;font-size:11px}
.adm-data-table th,.adm-data-table td{border:1px solid #94a3b8;padding:5px 8px;text-align:left;vertical-align:middle}
.adm-data-table th{background:#f1f5f9;color:var(--brand-primary,#0b6b4d);font-weight:700;width:22%}
.adm-data-table td b{color:#0f172a}

.adm-undertaking{background:#f8fafc;border:1px solid #e2e8f0;border-left:4px solid var(--brand-primary,#0b6b4d);padding:6px 10px;border-radius:4px;margin:6px 0 10px;font-size:10px;line-height:1.5}
.adm-undertaking-ur{font-family:'Noto Nastaliq Urdu',serif;direction:rtl;text-align:right;color:var(--brand-primary,#0b6b4d);font-weight:700;font-size:10.5px;margin-bottom:2px}

.adm-sig-section{display:flex;justify-content:space-between;margin:18px 0 6px;padding-top:4px}
.adm-sig-box{width:160px;text-align:center}
.adm-sig-line{border-top:1.5px solid #000;margin-top:35px;padding-top:3px;min-height:1px}
.adm-sig-box b{font-size:10.5px;color:#0f172a;display:block}

.adm-footer{border-top:1px solid #cbd5e1;padding-top:4px;display:flex;justify-content:space-between;align-items:center;font-size:9.5px;color:#64748b}

/* ==========================================================================
   AUTHENTIC 1-PAGE A4 MASTER DATE SHEET (PHOTO REPLICA)
   ========================================================================== */
@page dsland{size:A4 landscape;margin:5mm}
.datesheet-authentic-doc{width:297mm;min-height:200mm;margin:0 auto;background:#fff;padding:7mm 8mm;border:3px double #000;box-sizing:border-box;font-family:'Segoe UI',Roboto,Arial,sans-serif;color:#000;position:relative;page:dsland}
.datesheet-pin-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1.5px solid #000;padding-bottom:5px;margin-bottom:6px;font-size:13px;font-weight:800}
.datesheet-pin-header .student-fill{border-bottom:1.5px solid #000;width:240px;display:inline-block}
.datesheet-pin-header .roll-fill{border-bottom:1.5px solid #000;width:90px;display:inline-block}

.datesheet-main-title{text-align:center;margin:4px 0 8px}
.datesheet-main-title h2{font-size:18px;margin:0;font-weight:900;letter-spacing:1px;color:#000;text-transform:uppercase}
.datesheet-main-title h1{font-size:26px;margin:2px 0 0;font-family:'Noto Nastaliq Urdu',serif;color:#000;font-weight:900}

.matrix-wrap{overflow:visible;margin:6px 0;background:#fff}
.datesheet-matrix-table{width:100%;border-collapse:collapse;text-align:center;font-size:10px;table-layout:fixed}
.datesheet-matrix-table th,.datesheet-matrix-table td{border:1.5px solid #000;padding:4px 2px;word-wrap:break-word}
.datesheet-matrix-table th{background:#e2e8f0;color:#000;font-weight:900;text-transform:uppercase;font-size:9.5px}
.datesheet-matrix-table td.day-col{font-weight:800;background:#f8fafc;white-space:nowrap;width:72px;text-align:left;padding-left:5px}
.datesheet-matrix-table td.date-col{font-weight:800;white-space:nowrap;width:72px}
.datesheet-matrix-table tr.sunday-row{background:#fee2e2;font-weight:900;color:#991b1b}
.datesheet-matrix-table tr.sunday-row td{padding:6px 4px;letter-spacing:1px;font-size:11.5px}

.datesheet-timing-box{border:2px solid #000;padding:6px 12px;display:flex;justify-content:space-between;font-weight:900;font-size:12.5px;margin:8px 0;background:#f8fafc}
.datesheet-instructions{border:1px solid #000;padding:6px 10px;margin:8px 0;background:#fff}
.datesheet-instructions ul{margin:0;padding-left:18px;font-size:11px;line-height:1.6}
.datesheet-instructions li b{color:#000}

.datesheet-footer-banner{border-top:2px solid #000;border-bottom:2px solid #000;padding:6px 4px;margin-top:10px;text-align:center;font-size:11px;font-weight:700}
.datesheet-footer-banner div{margin:2px 0}
.datesheet-footer-banner b{font-size:12px}
.datesheet-footer-urdu{font-family:'Noto Nastaliq Urdu',serif;font-size:15px;color:#000;font-weight:900;margin-top:6px;text-align:center}

/* ==========================================================================
   1080x1350 LUXURY BIRTHDAY FLYER & SOCIAL MEDIA POSTER
   ========================================================================== */
.bday-flyer-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:15px 0}
.bday-flyer-canvas{width:480px;height:600px;background:radial-gradient(circle at 50% 20%,#0f766e 0%,#064e3b 45%,#022c22 100%);color:#fff;border-radius:16px;border:5px double #f59e0b;padding:24px 20px 18px;box-sizing:border-box;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;text-align:center;box-shadow:0 15px 40px rgba(0,0,0,0.3);overflow:hidden}
.bday-flyer-canvas::before{content:"★ ★ ★";position:absolute;top:8px;font-size:11px;color:#fcd34d;letter-spacing:6px}
.bday-flyer-header{margin-top:4px}
.bday-flyer-header img{width:46px;height:46px;object-fit:contain;background:#fff;border-radius:50%;padding:2px;box-shadow:0 2px 8px rgba(0,0,0,0.2);margin-bottom:4px}
.bday-flyer-header h2{font-size:15px;margin:0;color:#fef08a;font-weight:900;text-transform:uppercase;letter-spacing:.8px}
.bday-flyer-header p{margin:2px 0 0;font-size:10px;color:#a7f3d0}

.bday-circle-box{position:relative;margin:10px 0}
.bday-circle-box .bday-avatar{width:145px;height:145px;border-radius:50%;border:4.5px solid #fbbf24;object-fit:cover;box-shadow:0 0 30px rgba(251,191,36,0.45);background:#fff;display:block}
.bday-circle-ribbon{background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;font-size:9.5px;font-weight:900;padding:3px 14px;border-radius:12px;position:absolute;bottom:-8px;left:50%;transform:translateX(-50%);white-space:nowrap;box-shadow:0 2px 6px rgba(0,0,0,0.3);letter-spacing:.5px}

.bday-student-name{font-size:22px;font-weight:900;color:#fff;margin:8px 0 2px;text-shadow:0 2px 6px rgba(0,0,0,0.4)}
.bday-class-badge{background:rgba(255,255,255,0.15);color:#fef08a;font-size:11px;font-weight:800;padding:2px 10px;border-radius:10px;border:1px solid rgba(254,240,138,0.3);display:inline-block}

.bday-dua-box{margin:8px 0;background:rgba(0,0,0,0.22);border-radius:10px;padding:8px 12px;border:1px solid rgba(251,191,36,0.25);width:90%}
.bday-dua-ur{font-family:'Noto Nastaliq Urdu',serif;font-size:13px;line-height:2;color:#fef08a;direction:rtl;margin-bottom:2px}
.bday-dua-en{font-size:9.5px;color:#d1fae5;line-height:1.3}

.bday-flyer-footer{border-top:1px solid rgba(255,255,255,0.15);width:100%;padding-top:6px;font-size:9px;color:#a7f3d0;display:flex;justify-content:space-between;align-items:center}
.bday-flyer-footer b{color:#fff}

/* ==========================================================================
   INDIVIDUAL CLASS TEST EVALUATION REPORT & CHECKED SHEET
   ========================================================================== */
.test-report-sheet{width:210mm;min-height:297mm;margin:0 auto;background:#fff;padding:10mm 14mm;box-sizing:border-box;font-family:'Segoe UI',Roboto,Arial,sans-serif;color:#1e293b;border:1px solid #cbd5e1;position:relative}
.test-report-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2.5px solid var(--brand-primary,#0b6b4d);padding-bottom:8px;margin-bottom:10px}
.test-report-header img{width:54px;height:54px;object-fit:contain}
.test-report-header div{text-align:center;flex:1}
.test-report-header h1{margin:0;font-size:20px;color:var(--brand-primary,#0b6b4d);font-weight:900}
.test-report-header p{margin:2px 0 0;font-size:11px;color:#64748b}

.test-score-banner{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;background:#f0fdf4;border:1.5px solid #86efac;border-radius:8px;padding:10px;margin:10px 0;text-align:center}
.test-score-item span{font-size:10.5px;color:#166534;display:block;margin-bottom:2px;font-weight:700}
.test-score-item b{font-size:18px;color:var(--brand-primary,#0b6b4d)}

.test-paper-frame{border:2px solid var(--brand-primary,#0b6b4d);border-radius:8px;overflow:hidden;background:#f8fafc;margin:12px 0;text-align:center;padding:6px}
.test-paper-frame img{max-width:100%;max-height:480px;object-fit:contain;border-radius:4px;display:block;margin:0 auto}

.test-btn-wa{background:#25d366!important;color:#fff!important;border-color:#25d366!important;display:inline-flex;align-items:center;gap:5px;font-weight:700;font-size:11.5px;padding:4px 9px;border-radius:6px;text-decoration:none}
.test-btn-wa:hover{background:#1eb954!important}

@media print{
  @page{size:A4 portrait;margin:0}
  body.print-page{background:#fff!important;padding:0!important}
  .print-toolbar,.no-print{display:none!important}
  .admission-sheet{border:none!important;box-shadow:none!important;width:100%!important;height:100vh!important;max-height:100vh!important;padding:8mm 12mm 6mm!important;page-break-inside:avoid!important;page-break-after:avoid!important}
  .datesheet-authentic-doc{border:2px solid #000!important;box-shadow:none!important;width:100%!important;padding:6mm 8mm!important;page-break-inside:avoid!important}
  .test-report-sheet{border:none!important;box-shadow:none!important;width:100%!important;padding:6mm 10mm!important;page-break-inside:avoid!important}
  .bday-flyer-canvas{box-shadow:none!important;border:3px solid #d97706!important}
  .official-letterhead-container{box-shadow:none!important;width:100%!important;min-height:100vh!important;border:none!important;margin:0!important}
  .official-letterhead-header, .official-letterhead-footer, .lh-title-banner{
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* ==========================================================================
   OFFICIAL ROYAL NAVY LETTERHEAD & JAMEEL NOORI NASTALEEQ TYPOGRAPHY
   ========================================================================== */
@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: local('Jameel Noori Nastaleeq'), local('Nafees Nastaleeq'), local('Noto Nastaliq Urdu');
}
.urdu-font, [dir="rtl"], .nastaleeq {
  font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Segoe UI', Tahoma, serif !important;
  line-height: 2;
  direction: rtl;
  text-align: right;
}

.official-letterhead-container {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 20px;
  background: #fff;
  position: relative;
  box-shadow: 0 10px 35px rgba(0,0,0,0.14);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #1e293b;
}
.official-letterhead-header {
  background: #0c2b64 !important;
  color: #fff !important;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.lh-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lh-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.lh-school-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 900;
  color: #fff;
  font-family: 'Arial Black', Impact, Inter, sans-serif;
}
.official-letterhead-meta {
  display: flex;
  justify-content: space-between;
  padding: 12px 28px 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.official-letterhead-watermark-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
}
.lh-watermark {
  width: 320px;
  height: 320px;
  object-fit: contain;
}
.official-letterhead-body {
  flex: 1;
  padding: 14px 28px;
  position: relative;
  z-index: 2;
}
.lh-title-banner {
  background: #0c2b64 !important;
  color: #fff !important;
  padding: 7px 14px;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 16px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.lh-title-text {
  margin: 0;
  font-size: 16px;
  font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
  color: #fff;
  letter-spacing: 0.5px;
}
.official-letterhead-sign-row {
  padding: 0 28px;
  margin-top: 30px;
  margin-bottom: 12px;
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}
.lh-sign-box {
  text-align: center;
  width: 220px;
}
.lh-sign-line {
  font-size: 13.5px;
  font-weight: 700;
  color: #0c2b64;
  border-bottom: 1.5px solid #0c2b64;
  padding-bottom: 4px;
}
.lh-sign-caption {
  font-size: 11px;
  color: #64748b;
  display: block;
  margin-top: 3px;
}
.official-letterhead-footer {
  background: #0c2b64 !important;
  color: #fff !important;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  margin-top: auto;
}

/* ==========================================================================
   12-CLASS CARD SELECTION GRID & SIBLINGS
   ========================================================================== */
.class-grid-12 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.class-card-box {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.class-card-box:hover, .class-card-box.active {
  border-color: #0A4A2A;
  background: #E7F0E9;
  color: #013117;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(1,49,23,0.12);
}
.class-card-box .icon {
  font-size: 20px;
}

.sibling-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sibling-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E7F0E9;
  border: 1px solid #A9C6B1;
  color: #0A4A2A;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.sibling-pill:hover {
  background: #E7F0E9;
}

/* ==========================================================================
   IMAGE CROPPER MODAL
   ========================================================================== */
.cropper-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.cropper-box {
  background: #fff;
  border-radius: 16px;
  width: min(520px, 100%);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
}
.cropper-canvas-wrap {
  width: 100%;
  height: 320px;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin: 12px 0;
  display: grid;
  place-items: center;
}
.cropper-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.cropper-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}

/* ==========================================================================
   PUBLIC VERIFICATION CARD (STUDENT ID QR SCAN)
   ========================================================================== */
.verify-student-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #013117;
}
.verify-student-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  text-align: center;
}
.verify-card-header {
  background: #013117;
  color: #fff;
  padding: 20px;
}
.verify-card-header img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
}
.verify-card-header h2 {
  margin: 8px 0 2px;
  font-size: 20px;
}
.verify-badge-shield {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #86efac;
  margin: 14px auto 0;
}
.verify-body {
  padding: 20px 24px;
  text-align: left;
}
.verify-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.verify-photo {
  width: 78px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #0A4A2A;
}
.verify-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.verify-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.verify-table td:first-child {
  color: #64748b;
  width: 38%;
  font-weight: 600;
}
/* ==========================================================================
   OFFICIAL ADMISSION FORM (1-PAGE A4 PRINT)
   ========================================================================== */
.admission-sheet {
  width: 210mm;
  min-height: 290mm;
  max-height: 297mm;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 8mm 12mm;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.adm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2.5px solid #0c2b64;
  padding-bottom: 6px;
}
.adm-header img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.adm-header-text {
  text-align: center;
  flex: 1;
}
.adm-header-text h1 {
  margin: 0;
  font-size: 19px;
  color: #0c2b64;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.adm-header-text p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #334155;
  font-weight: 600;
}
.adm-header-text small {
  font-size: 10px;
  color: #64748b;
}
.adm-title-pill {
  text-align: center;
  margin: 6px 0 8px;
}
.adm-title-pill span {
  background: #0c2b64;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 3px 18px;
  border-radius: 999px;
  display: inline-block;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.adm-meta-flex {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.adm-meta-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px 12px;
  font-size: 11px;
}
.adm-meta-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 2px;
}
.adm-meta-item span {
  color: #64748b;
  font-size: 10.5px;
}
.adm-meta-item b {
  color: #0f172a;
  font-weight: 700;
}
.adm-photo-frame {
  width: 80px;
  height: 98px;
  border: 1.5px solid #0c2b64;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f8fafc;
}
.adm-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-photo-placeholder {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.2;
}
.adm-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-size: 11px;
}
.adm-data-table th, .adm-data-table td {
  border: 1px solid #cbd5e1;
  padding: 3.5px 8px;
  vertical-align: middle;
}
.adm-data-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  width: 22%;
  text-align: left;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.adm-data-table td {
  color: #0f172a;
  width: 28%;
}
.adm-undertaking {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 9.5px;
  color: #334155;
  margin-bottom: 8px;
}
.adm-undertaking-ur {
  font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
  font-size: 12px;
  line-height: 1.7;
  color: #0f172a;
  text-align: right;
  direction: rtl;
  margin-bottom: 2px;
}
.adm-sig-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
  margin-bottom: 6px;
}
.adm-sig-box {
  text-align: center;
}
.adm-sig-line {
  border-bottom: 1.5px solid #0f172a;
  margin-bottom: 4px;
  height: 24px;
}
.adm-sig-box b {
  font-size: 10px;
  color: #334155;
  display: block;
}
.adm-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #cbd5e1;
  padding-top: 4px;
  font-size: 9.5px;
  color: #64748b;
}

@media print {
  .admission-sheet {
    width: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   CLASS-WISE STUDENT DIRECTORY PILL GRID (Sample Reference Style)
   ========================================================================== */
.class-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.class-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0A4A2A;
  color: #ffffff !important;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(10, 74, 42, 0.22);
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.class-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(10, 74, 42, 0.35);
  background: #135737;
}

.class-pill-btn.active {
  background: #013117 !important;
  color: #ffffff !important;
  border-color: #D1952A !important;
  box-shadow: 0 6px 20px rgba(1, 49, 23, 0.4) !important;
  transform: translateY(-1px);
}

.class-pill-icon {
  font-size: 16px;
}

.class-pill-name {
  font-weight: 800;
  letter-spacing: -0.2px;
}

.class-pill-badge {
  background: #e11d48; /* Red pill badge like 'Trial' in user reference picture */
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.class-pill-badge.has-students {
  background: #132219;
}

.class-pill-badge.empty {
  background: rgba(0, 0, 0, 0.28);
  opacity: 0.85;
}

.class-pill-btn.active .class-pill-badge {
  background: #FAD380;
  color: #013117;
  box-shadow: 0 2px 6px rgba(209, 149, 42, 0.5);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  height: 62px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 10px;
  transition: all 0.18s ease;
  flex: 1;
}

.mobile-bottom-nav a .mb-icon {
  font-size: 19px;
  line-height: 1;
  margin-bottom: 2px;
}

.mobile-bottom-nav a.active {
  color: var(--brand-primary,#0A4A2A);
  font-weight: 900;
}

.mobile-bottom-nav a.active .mb-icon {
  transform: translateY(-1px);
}

/* ==========================================================================
   ENHANCED MOBILE RESPONSIVENESS (PHONES & TABLETS <= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  html, body {
    overflow-x: clip !important;
    max-width: 100% !important;
  }
  
  .app-shell {
    display: block !important;
    min-height: 100vh !important;
    width: 100% !important;
    overflow-x: clip !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 290px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5) !important;
    background: #013117 !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  [dir="rtl"] .sidebar,
  html[dir="rtl"] .sidebar,
  body[dir="rtl"] .sidebar {
    left: auto !important;
    right: 0 !important;
    transform: translateX(105%) !important;
  }

  .sidebar.open,
  [dir="rtl"] .sidebar.open,
  html[dir="rtl"] .sidebar.open,
  body[dir="rtl"] .sidebar.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99990 !important;
  }

  .sidebar-backdrop.active {
    display: block !important;
  }

  body.drawer-open {
    overflow: hidden !important;
  }

  .menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    font-size: 20px !important;
    color: var(--brand-primary,#0A4A2A) !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  }

  .sidebar-close-btn {
    display: inline-flex !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-left: auto !important;
  }

  [dir="rtl"] .sidebar-close-btn {
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .topbar {
    min-height: 56px !important;
    padding: 8px 12px !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
  }

  .topbar .user-chip {
    display: none !important;
  }

  .topbar h1 {
    font-size: 15.5px !important;
    font-weight: 900 !important;
  }

  .topbar small {
    font-size: 11px !important;
  }

  .top-right {
    gap: 6px !important;
  }

  .content {
    padding: 12px 10px 85px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  /* Metric Grids on Mobile */
  .metric-grid.six,
  .metric-grid.four,
  .metric-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .metric {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }

  .metric span {
    font-size: 10.5px !important;
  }

  .metric b {
    font-size: 19px !important;
    margin: 3px 0 !important;
  }

  .metric small {
    font-size: 10.5px !important;
  }

  /* General Grids on Mobile */
  .grid2, .grid3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .quick-grid a {
    padding: 11px 8px !important;
    font-size: 12.5px !important;
    border-radius: 10px !important;
  }

  .resource-grid,
  .timetable-grid,
  .branding-preview-grid {
    grid-template-columns: 1fr !important;
  }

  .dash-greeting {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .dash-greeting h2 {
    font-size: 20px !important;
  }

  .panel {
    padding: 14px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }

  .panel h2, .panel h3 {
    font-size: 16px !important;
    margin-bottom: 10px !important;
  }

  /* Profile Hero on Mobile */
  .profile-hero {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    padding: 18px 14px !important;
    gap: 12px !important;
  }

  .profile-hero .hero-actions {
    margin: 0 auto !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .profile-hero .hero-actions .button {
    flex: 1 !important;
    min-width: 110px !important;
    font-size: 12px !important;
    padding: 8px 10px !important;
  }

  /* AI Layout on Mobile */
  .ai-layout {
    grid-template-columns: 1fr !important;
  }

  .ai-side {
    max-height: 180px !important;
    margin-bottom: 12px !important;
  }

  .ai-chat {
    min-height: 480px !important;
  }

  .chat-stream {
    max-height: calc(100vh - 360px) !important;
  }

  /* Table Horizontal Scrolling on Touch */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    margin-bottom: 14px !important;
    border-radius: 12px !important;
    display: block !important;
  }

  .table-wrap table {
    min-width: 620px !important;
  }

  th, td {
    padding: 10px 10px !important;
    font-size: 12px !important;
  }

  /* Form Grids full width on mobile */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-grid label {
    grid-column: 1 / -1 !important;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 11px 12px !important;
  }

  /* Touch buttons on mobile */
  .button, button, input[type="submit"] {
    min-height: 42px !important;
    touch-action: manipulation !important;
  }

  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 16px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  /* Toolbar form responsive */
  .toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .toolbar form {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }

  .toolbar form input,
  .toolbar form select {
    flex: 1 1 140px !important;
    width: auto !important;
  }

  .toolbar form button {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 480px) {
  .metric-grid.six,
  .metric-grid.four,
  .metric-grid.three {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .metric b {
    font-size: 17px !important;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .login-card {
    padding: 24px 18px !important;
    border-radius: 16px !important;
  }
}

/* ==========================================================================
   10-ON-A4 ID CARD SHEET PRINT SYSTEM (STUDENT & STAFF CR80 STANDARDS)
   ========================================================================== */
.a4-card-sheet-body {
  background: #f1f5f9;
  padding: 20px 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.a4-id-sheet-page {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  background: #ffffff;
  margin: 0 auto 20mm;
  padding: 10mm 12mm;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  page-break-after: always;
  page-break-inside: avoid;
  overflow: hidden;
}

.a4-card-grid-10 {
  display: grid;
  grid-template-columns: repeat(2, 86mm);
  grid-template-rows: repeat(5, 54mm);
  gap: 2.5mm 6mm;
  justify-content: center;
  align-content: center;
  height: 100%;
}

body.stu-sheet .a4-card-grid-10 {
  grid-template-columns: repeat(5, 54mm);
  grid-template-rows: repeat(2, 85.6mm);
  gap: 4mm 3mm;
}

.green-id-card.sheet-card {
  width: 54mm !important;
  height: 85.6mm !important;
  min-height: 85.6mm !important;
  max-height: 85.6mm !important;
  box-sizing: border-box;
  border-radius: 4mm;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  position: relative;
  box-shadow: none !important;
  margin: 0 !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body.a4-card-sheet-body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .a4-id-sheet-page {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    padding: 10mm 12mm !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.stu-sheet .a4-id-sheet-page {
    width: 297mm !important;
    height: 210mm !important;
    min-height: 210mm !important;
    max-height: 210mm !important;
    padding: 8mm 10mm !important;
  }
  .a4-card-grid-10 {
    gap: 2.5mm 6mm !important;
  }
  body.stu-sheet .a4-card-grid-10 {
    gap: 4mm 3mm !important;
  }
  .green-id-card.sheet-card {
    border: 0.5px solid #94a3b8 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .staff-land-card {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* ==========================================================================
   Popup Notice Announcement Modal (Mobile-First)
   ========================================================================== */
.popup-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(19, 34, 25, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInModal .25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-modal-box {
  background: #ffffff;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 2px solid var(--brand-primary,#0A4A2A);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: scaleInModal .25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInModal {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.popup-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #132219;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 10;
}

.popup-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.popup-modal-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.popup-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
}

.popup-modal-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}

.popup-modal-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

/* Specialty Subject Chips Interactive */
.spec-chip-label:hover {
  border-color: var(--brand-primary,#0A4A2A) !important;
  transform: translateY(-1px);
}

/* Master School Timetable Grid */
.master-school-table th,
.master-school-table td {
  border: 1px solid #cbd5e1;
}

.master-school-table tbody tr:hover {
  background: #f0fdf4 !important;
}

/* ==========================================================================
   PASSWORD SHOW / HIDE EYE TOGGLE
   ========================================================================== */
.pwd-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.btn-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 17px;
  line-height: 1;
  color: #64748b;
  border-radius: 6px;
  transition: color .2s, transform .15s;
  user-select: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-pwd-toggle:hover {
  color: var(--brand-primary,#0A4A2A);
  transform: translateY(-50%) scale(1.1);
}

.btn-pwd-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* ==========================================================================
   PORTRAIT BULK PRINT ID CARD FIXES (STUDENT & STAFF)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  .id-print-grid {
    padding: 8mm 0 !important;
    gap: 8mm 12mm !important;
    justify-content: center !important;
  }
  .green-id-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


@media (max-width:720px){
  .att-sheet,.att-sheet thead,.att-sheet tbody,.att-sheet tr,.att-sheet td{display:block}
  .att-sheet thead{display:none}
  .att-sheet{min-width:0!important;width:100%}
  .att-sheet tr{border:1px solid #dbe3ec;border-radius:10px;margin:0 0 6px;padding:6px 8px;background:#fff;display:flex;flex-wrap:wrap;align-items:center;column-gap:8px}
  .att-sheet td{border:0;padding:0}
  .att-sheet td:nth-child(1){flex:0 0 auto}
  .att-sheet td:nth-child(1) img,.att-sheet td:nth-child(1) .tiny-photo{width:30px;height:30px}
  .att-sheet td:nth-child(3){flex:1 1 34%;font-size:13.5px;line-height:1.25;min-width:0}
  .att-sheet td:nth-child(2){flex:0 0 auto;font-size:11px;color:#64748b;text-align:right}
  .att-sheet td:nth-child(2) small{display:none}
  .att-sheet td:nth-child(4){flex:0 1 auto;font-size:11px;color:#64748b}
  .att-sheet td:nth-child(5),.att-sheet td:nth-child(6){display:none}
  .att-sheet td:nth-child(7){flex:1 1 100%;margin-top:5px}
  .att-sheet .attendance-buttons{display:flex;flex-wrap:nowrap;gap:5px;width:100%}
  .att-sheet .attendance-buttons button{flex:1 1 0;padding:7px 0;font-size:12.5px}
  .att-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:10px}
  .att-metrics .metric{min-height:0;padding:7px 4px;border-radius:10px;text-align:center}
  .att-metrics .metric span{font-size:9.5px;display:block;line-height:1.2}
  .att-metrics .metric b{font-size:16px}
  #attFilter{width:100%;padding:9px 12px;border:1.5px solid var(--brand-primary,#0A4A2A);border-radius:8px;font-size:14px;margin:0 0 10px}
}

/* Quick Fee student suggestion list (replaces native datalist) */
.qf-wrap{position:relative}
#quickFeeSuggest{position:absolute;left:0;right:0;top:100%;z-index:60;background:#fff;border:1.5px solid var(--brand-primary,#0A4A2A);border-radius:10px;box-shadow:0 12px 28px rgba(0,0,0,.18);max-height:264px;overflow:auto;display:none}
#quickFeeSuggest .qf-item{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 12px;cursor:pointer;border-bottom:1px solid #eef2f0}
#quickFeeSuggest .qf-item:last-child{border-bottom:0}
#quickFeeSuggest .qf-item:active,#quickFeeSuggest .qf-item:hover{background:#f0fdf4}
#quickFeeSuggest .qf-name{font-weight:700;font-size:13.5px;color:#013117}
#quickFeeSuggest .qf-meta{font-size:11.5px;color:#64748b}
#quickFeeSuggest .qf-fee{font-size:12px;font-weight:700;color:var(--brand-primary,#0A4A2A);white-space:nowrap}
#quickFeeSuggest .qf-none{padding:10px 12px;font-size:12.5px;color:#94a3b8}
/* ===== Wave SM-2b — login rebuild + chrome polish (IlmeNafe palette only) ===== */
.login-card{width:min(470px,100%);border-radius:24px;padding:34px 30px}
.login-card h1{font-size:25px;margin:6px 0 4px}
.login-welcome{margin:0 0 18px;color:#5b6b60;font-size:14px}
.login-card input{font-size:16px;padding:14px 16px;border-radius:12px}
.btn-signin{border-radius:12px!important;padding:14px!important;font-size:15.5px!important;background:#013117!important}
.btn-signin:hover{background:#0A4A2A!important}
.login-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:16px}
.login-card .login-tile{position:relative;display:block;cursor:pointer;margin:0}
.login-tile input{position:absolute;opacity:0;width:auto;padding:0}
.login-card .lt-box{display:flex;flex-direction:column;align-items:center;gap:3px;padding:13px 8px 11px;margin:0;background:#FFFDF6;border:1.5px solid #D1DFCC;border-radius:16px;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;text-align:center}
.login-card .lt-ic{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#E7EFE3;font-size:19px;margin-bottom:3px}
.login-card .lt-t{font-weight:800;font-size:13.5px;color:#132219}
.login-card .lt-s{font-size:11px;color:#64748b;line-height:1.35}
.login-tile:hover .lt-box{border-color:#BF8213}
.login-tile input:checked~.lt-box{border-color:#013117;background:#E7EFE3;box-shadow:0 4px 14px rgba(1,49,23,.12)}
.login-tile input:focus-visible~.lt-box{outline:2px solid #BF8213;outline-offset:2px}
.login-remember{justify-content:flex-start;font-size:13.5px;font-weight:600;color:#33473a}
.login-card .login-remember input{width:18px;height:18px;padding:0;font-size:14px;accent-color:#013117}
@media (max-width:480px){.login-card .lt-s{display:none}.login-tiles{gap:7px}}
th{background:#EDF4E9;color:#24402e}
button:focus-visible,.button:focus-visible,a:focus-visible{outline:2px solid #BF8213;outline-offset:2px}

/* ===== Wave SM-8 — gradients + curated multi-colour accent system (portal chrome only) =====
   Brand anchor stays IlmeNafe green (login identity, primary buttons, hero bands).
   Six fixed hues, each used for the SAME module everywhere; every gradient stays
   inside its own hue family (deep -> mid). Gold remains the premium accent only.
   The whole section is screen-only: @media print output is byte-for-byte untouched. */
@media screen{
:root{
  --grad-hero:linear-gradient(135deg,#013117 0%,#0A4A2A 55%,#135737 100%);
  --grad-hero-depth:radial-gradient(640px 240px at 88% -30%,rgba(209,149,42,.28),rgba(209,149,42,0) 62%),radial-gradient(520px 300px at -10% 120%,rgba(252,246,233,.10),rgba(252,246,233,0) 60%),linear-gradient(135deg,#013117 0%,#0A4A2A 55%,#135737 100%);
  --grad-primary:linear-gradient(135deg,#0A4A2A 0%,#135737 100%);
  --grad-primary-hover:linear-gradient(135deg,#013117 0%,#0A4A2A 100%);
  --grad-gold:linear-gradient(135deg,#D1952A 0%,#BF8213 100%);
  --grad-soft-green:linear-gradient(135deg,#E7EFE3 0%,#F6FAF2 100%);
  --hue-green-d:#013117;--hue-green-m:#0A4A2A;--hue-green-soft:#E7EFE3;
  --hue-blue-d:#1E40AF;--hue-blue-m:#2563EB;--hue-blue-soft:#DBEAFE;
  --hue-violet-d:#4C1D95;--hue-violet-m:#6D28D9;--hue-violet-soft:#EDE9FE;
  --hue-amber-d:#92400E;--hue-amber-m:#B45309;--hue-amber-soft:#FEF3C7;
  --hue-rose-d:#881337;--hue-rose-m:#BE123C;--hue-rose-soft:#FFE4E6;
  --hue-teal-d:#134E4A;--hue-teal-m:#0F766E;--hue-teal-soft:#CCFBF1;
  --grad-tile-green:linear-gradient(135deg,var(--hue-green-d) 0%,var(--hue-green-m) 100%);
  --grad-tile-blue:linear-gradient(135deg,var(--hue-blue-d) 0%,var(--hue-blue-m) 100%);
  --grad-tile-violet:linear-gradient(135deg,var(--hue-violet-d) 0%,var(--hue-violet-m) 100%);
  --grad-tile-amber:linear-gradient(135deg,var(--hue-amber-d) 0%,var(--hue-amber-m) 100%);
  --grad-tile-rose:linear-gradient(135deg,var(--hue-rose-d) 0%,var(--hue-rose-m) 100%);
  --grad-tile-teal:linear-gradient(135deg,var(--hue-teal-d) 0%,var(--hue-teal-m) 100%);
}
/* Primary buttons — one gradient language (deep green -> mid green; hover deepens) */
.primary{background:var(--grad-primary)!important;box-shadow:0 4px 14px rgba(10,74,42,.28)}
.primary:hover{background:var(--grad-primary-hover)!important;box-shadow:0 6px 18px rgba(10,74,42,.36)}
.btn-signin{background:var(--grad-primary)!important}
.btn-signin:hover{background:var(--grad-primary-hover)!important}
/* Login — green-led: deep-green gradient veil over the photo (or plain) backdrop,
   gradient identity disc, pastel per-destination icon chips, soft-green selected tile */
.login-page{background-color:#013117}
.login-overlay{background:linear-gradient(135deg,rgba(1,49,23,.92) 0%,rgba(10,74,42,.80) 52%,rgba(19,87,55,.88) 100%)}
.login-logo-wrap{background:var(--grad-hero);border:1px solid rgba(209,149,42,.55)}
.login-tiles .login-tile:nth-child(1) .lt-ic{background:var(--hue-green-soft)}
.login-tiles .login-tile:nth-child(2) .lt-ic{background:var(--hue-blue-soft)}
.login-tiles .login-tile:nth-child(3) .lt-ic{background:var(--hue-violet-soft)}
.login-tile input:checked~.lt-box{background:var(--grad-soft-green)}
/* Dashboard greeting hero — full brand gradient with a soft gold sheen for depth */
.dash-hero{background:var(--grad-hero-depth);box-shadow:0 14px 34px -12px rgba(1,49,23,.45)}
/* Teacher greeting band — soft green gradient panel */
.dash-greeting{background:var(--grad-soft-green);border:1px solid #D1DFCC;border-radius:16px;padding:16px 20px}
/* Dashboard snapshot tiles — fixed per-module hues (order = markup order):
   1 Students blue · 2 Staff violet · 3 Fee Collection amber · 4 Accounts teal ·
   5 Attendance green (brand) · 6 Paper Studio rose */
.snap-grid .metric{border:none;color:#FCF6E9}
.snap-grid .metric span{color:rgba(255,255,255,.92)}
.snap-grid .metric b{color:#fff}
.snap-grid .metric small{color:rgba(255,255,255,.94)}
.snap-grid .metric:nth-child(1){background:var(--grad-tile-blue)}
.snap-grid .metric:nth-child(2){background:var(--grad-tile-violet)}
.snap-grid .metric:nth-child(3){background:var(--grad-tile-amber)}
.snap-grid .metric:nth-child(4){background:var(--grad-tile-teal)}
.snap-grid .metric:nth-child(5){background:var(--grad-tile-green)}
.snap-grid .metric:nth-child(6){background:var(--grad-tile-rose)}
.snap-grid .metric:hover{box-shadow:0 14px 30px -6px rgba(19,34,25,.35)}
/* Profile / module hero bands — brand gradient */
.profile-hero{background:var(--grad-hero)}
}

/* ===== Wave SM-9 — COLOUR-THEORY SYSTEM (portal chrome only) =====
   Owner order 2026-10-23: colours follow colour theory — every colour has a
   defined role; how and when it is used is fixed here, not improvised per page.

   THE SYSTEM (60 / 30 / 10)
   · 60% NEUTRALS — page background, cards, text ink, hairlines (the :root
     slate/paper neutrals). Neutrals carry the layout; colour is information.
   · 30% MODULE HUES (Wave SM-8) — exactly one hue per module, bound forever:
       Brand Green  identity · trust · primary actions · Attendance (growth/present)
       Blue         Students — information / people-data
       Violet       Staff — people / HR
       Amber        Fees — money due / caution (never decoration)
       Teal         Accounts — finance / records
       Rose         Paper Studio — creation
   · 10% GOLD (#D1952A / #BF8213) — premium / achievement / highlight ONLY:
     focus rings, hero sheen, "best/selected" tags. Never a status, never
     small body text (3.27:1 on white — accent and large marks only).

   SEMANTIC STATES — the same four everywhere, NO exceptions. Every chip,
   pill, badge, alert, panel edge and chart in the portal draws from these:
       Success / Paid / Present ......... GREEN  (brand family)
       Warning / Pending / Due / Late ... AMBER
       Danger / Delete / Defaulter / Absent  ROSE-RED
       Info / Neutral ................... BLUE
   A status is never shown by colour alone — it always carries its label/icon.

   RULES
   · Gradients stay inside one hue family (deep -> mid), as in Wave SM-8.
   · Hover / active = the SAME hue one step deeper. Never a new colour.
   · Disabled = neutral grey (--line / --muted). Never a faded module hue —
     a greyed control must not look like a pale status.
   · Charts use this palette in a fixed order: the module hue for a module's
     own series; the semantic order Success -> Warning -> Danger -> Neutral
     for state breakdowns (donuts); money charts: in = Teal (Accounts),
     out = Rose. Chart tracks are always the neutral line colour.
   · Print is untouched: this section is @media screen only, exactly like
     SM-8 — printed papers, receipts, ID cards and letterheads (whose navy
     #0c2b64 is a school's print-document identity) do not change.
   · Deliberate exception: the WhatsApp glyph green (#25D366) is a recognised
     external brand cue on WhatsApp action buttons only — never a status.
*/
@media screen{
:root{
  --sem-success:#0A4A2A;--sem-success-solid:#135737;--sem-success-soft:#E7EFE3;--sem-success-border:#A9C6B1;
  --sem-warning:#92400E;--sem-warning-solid:#B45309;--sem-warning-soft:#FEF3C7;--sem-warning-border:#F59E0B;
  --sem-danger:#881337;--sem-danger-solid:#BE123C;--sem-danger-soft:#FFE4E6;--sem-danger-border:#FDA4AF;
  --sem-info:#1E40AF;--sem-info-solid:#2563EB;--sem-info-soft:#DBEAFE;--sem-info-border:#93C5FD;
  /* Retokenise the legacy semantic vars onto the system (screen only).
     --danger/--warn are only ever text on their *-soft backgrounds. */
  --danger:var(--sem-danger);--danger-soft:var(--sem-danger-soft);
  --warn:var(--sem-warning);--warn-soft:var(--sem-warning-soft);
}
/* Status badges — one system for every state (was ad-hoc Tailwind tints) */
.badge{background:var(--sem-info-soft);color:var(--sem-info)}
.badge.present,.badge.paid,.badge.active,.badge.published,.badge.approved,.badge.enrolled,.badge.in{background:var(--sem-success-soft);color:var(--sem-success)}
.badge.absent,.badge.failed,.badge.rejected,.badge.out,.badge.void,.badge.left{background:var(--sem-danger-soft);color:var(--sem-danger)}
.badge.pending,.badge.partial,.badge.late,.badge.printable,.badge.reprint,.badge.simulated{background:var(--sem-warning-soft);color:var(--sem-warning)}
/* Flash alerts — success base, danger variant (vars above do the rest) */
.flash{background:var(--sem-success-soft);color:var(--sem-success);border-color:var(--sem-success-border)}
.flash.error{border-color:var(--sem-danger-border)}
/* Danger actions — rose family borders, hover deepens within the family */
.dangerbtn{border-color:var(--sem-danger-border)}
.dangerbtn:hover{background:var(--sem-danger-soft);border-color:var(--sem-danger-solid)}
.logout:hover{background:var(--sem-danger-soft);color:var(--sem-danger)}
.popup-modal-close:hover{background:var(--sem-danger-soft);color:var(--sem-danger);border-color:var(--sem-danger-border)}
/* Metric state strips */
.metric.warn{border-top-color:var(--sem-warning-solid)}
.metric.danger{border-top-color:var(--sem-danger-solid)}
/* Class count pill — a count/alert marker, so danger-rose solid */
.class-pill-badge{background:var(--sem-danger-solid);box-shadow:0 2px 6px rgba(190,18,60,.4)}
/* Live device-scan badge — a "live/OK" state, so success solid brand green */
.live-scan-badge{background:var(--sem-success)}
/* AI assistant pill — the assistant is an IlmeNafe BRAND feature, so it takes
   the brand gradient (Wave SM-8), not a module hue and not ad-hoc indigo */
.ai-pill{background:var(--grad-primary);box-shadow:0 4px 12px rgba(10,74,42,.3)}
.ai-pill:hover{box-shadow:0 6px 16px rgba(10,74,42,.4)}
}

/* ===== Wave SM-9b — LOGIN GRADIENT FIXES (portal chrome only) =====
   Two corrections from the live visual check of Waves SM-8/SM-9, both kept
   inside the SM-9 colour system (in-family gradients; active state = the
   same hue deeper; gold untouched; print untouched — screen only):

   1. PRIMARY GRADIENT TOO SUBTLE. The SM-8 ramp (#0A4A2A -> #135737) spans
      only 0.021 in relative luminance, so at button size it read as flat
      solid green. --grad-primary is re-based onto the FULL brand-green ramp
      — deep #013117 -> mid #0A4A2A -> light #135737 (luminance span 0.050,
      ~2.4x wider) — so the sweep is plainly visible. Every primary surface
      consumes these same tokens (.primary portal-wide, .btn-signin,
      .ai-pill), so one token change strengthens the whole language at once;
      the .primary/.btn-signin rules are restated below only to make the
      binding explicit. Hover follows the SM-9 rule (same hue, one step
      deeper): the whole ramp shifts one stop down. White text stays
      >= AA at the LIGHTEST stop of both ramps — normal 8.58:1 on #135737,
      hover 10.37:1 on #0A4A2A (full table in SM9B_NOTES.md).
   2. SELECTED LOGIN TILE HAD NO CHIP. Unselected tiles show a soft pastel
      chip on the paper tile; the SELECTED tile's box turns soft green
      (--grad-soft-green, #E7EFE3 -> #F6FAF2) and tile 1's chip is that same
      pale green — chip and tile merged, so the icon sat bare on the tile.
      The selected tile's chip now takes the DEEP stop of its OWN hue
      (SM-8 per-tile identity, deepened per the SM-9 active rule): green
      portal, blue studio, violet super admin. Chip-to-tile contrast is
      7.4:1–13.7:1, and the signal is never colour alone — the selected
      tile keeps its deep border and label. (The icons are emoji and keep
      their own colours; the chip carries the state.) */
@media screen{
:root{
  --grad-primary:linear-gradient(135deg,#013117 0%,#0A4A2A 46%,#135737 100%);
  --grad-primary-hover:linear-gradient(135deg,#02150A 0%,#013117 52%,#0A4A2A 100%);
}
.primary{background:var(--grad-primary)!important}
.primary:hover{background:var(--grad-primary-hover)!important}
.btn-signin{background:var(--grad-primary)!important}
.btn-signin:hover{background:var(--grad-primary-hover)!important}
.login-tiles .login-tile:nth-child(1) input:checked~.lt-box .lt-ic{background:var(--hue-green-d);box-shadow:0 3px 8px rgba(1,49,23,.35)}
.login-tiles .login-tile:nth-child(2) input:checked~.lt-box .lt-ic{background:var(--hue-blue-d);box-shadow:0 3px 8px rgba(30,64,175,.35)}
.login-tiles .login-tile:nth-child(3) input:checked~.lt-box .lt-ic{background:var(--hue-violet-d);box-shadow:0 3px 8px rgba(76,29,149,.35)}
}

/* ===== Wave SM-12c — sidebar BACKGROUND colour ONLY (owner order 2026-10-23: text and icons NOT changed; only the background) =====
   One rule: the sidebar background becomes the approved lighter gradient
   (light fresh green at the top easing to the school colour, with the
   lightened bottom stop). Per-school sidebar_bg_color still drives every
   stop via color-mix. Cascade: selector (0,2,1) + !important beats the
   per-school inline rule in index.php (.sidebar at (0,1,0)). Nothing else
   in this block touches nav text, icons, hover, or active states. */
@media screen{
.app-shell aside.sidebar{
  background:var(--sidebar-bg,#013117)!important;
  background:linear-gradient(180deg,color-mix(in srgb,color-mix(in srgb,var(--sidebar-bg,#013117),#135737 62%),white 12%) 0%,color-mix(in srgb,var(--sidebar-bg,#013117),#135737 34%) 38%,var(--sidebar-bg,#013117) 68%,color-mix(in srgb,var(--sidebar-bg,#013117),#135737 30%) 100%)!important;
}
}
/* ===== End Wave SM-12c ===== */

/* ===== Wave LT-1 — LIGHT THEME (owner order 2026-10-23: adopt the light,
   mostly-white, dark-text clarity pattern; accents re-based to IlmeNafe
   GREEN, page tint to light green-grey — pattern mirrored, branding ours) =====
   Everything lives in ONE @media screen block scoped to .app-shell, so:
   · print output is byte-for-byte untouched (nothing here can match in
     @media print, and the print-document tables are explicitly restored
     at the end of the block as belt-and-braces);
   · the login page and standalone pages (Paper Studio, E-Sheet, print
     views) share no .app-shell ancestor and are untouched by design;
   · the SM-12c sidebar gradient is superseded ONLY inside this theme:
     the sidebar rule below repeats SM-12c's selector (.app-shell
     aside.sidebar = (0,2,1)) with !important and comes later in the
     file, so it wins over SM-12c AND over index.php's inline
     .sidebar{background:var(--sidebar-bg) !important} at (0,1,0).
   The one rich band stays rich: .dash-hero / .profile-hero keep their
   SM-8 green gradients with white text (the hero pattern), as do the
   solid semantic solids (.ai-pill, badges' solid markers). */
@media screen{
/* -- LT-1 tokens (ours) + re-tokenised shell neutrals: legacy components
      inside the shell that read var(--line)/var(--muted) harmonise
      automatically (panel borders, table hairlines, button borders). */
.app-shell{
  --lt-page:#F2F6F1;--lt-card:#FFFFFF;--lt-line:#DCE5D8;--lt-line-soft:#E7EEE3;
  --lt-head:#EAF1E8;--lt-ink:#132219;--lt-ink2:#3D4F42;--lt-mut:#5F7160;
  --lt-navtx:#3F5040;--lt-iconbox:#EDF3EA;--lt-iconglyph:#2E4A34;
  --lt-active:#E7EFE3;--lt-group:#7C8B7A;--lt-inputline:#C2D2BA;
  --line:#DCE5D8;--line-light:#EDF2E9;--muted:#5F7160;--ink-light:#3A4A3E;
  background:var(--lt-page);color:var(--lt-ink);
}
.app-shell .main-area{background:transparent}

/* -- Sidebar -> WHITE ------------------------------------------------ */
.app-shell aside.sidebar{
  background:#FFFFFF!important;
  color:var(--lt-ink);
  border-right:1px solid var(--lt-line);
  scrollbar-color:#C4D2BE transparent;
}
.app-shell aside.sidebar .brand{border-bottom:1px solid var(--lt-line-soft)}
.app-shell aside.sidebar .brand b{color:var(--lt-ink)}
.app-shell aside.sidebar .brand small{color:var(--lt-mut)}
.app-shell aside.sidebar .brand img{box-shadow:0 0 0 2px #D1952A,0 4px 10px rgba(19,34,25,.10)}
.app-shell aside.sidebar .nav-group{color:var(--lt-group)}
.app-shell aside.sidebar nav a{color:var(--lt-navtx)}
.app-shell aside.sidebar nav a span{
  width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;
  border-radius:9px;background:var(--lt-iconbox);color:var(--lt-iconglyph);
  font-size:15px;line-height:1;opacity:1;transition:background .15s ease;
}
.app-shell aside.sidebar nav a:hover{background:#F0F5EE;color:var(--lt-ink)}
.app-shell aside.sidebar nav a:hover span{background:#DFEBD8}
.app-shell aside.sidebar nav a.active{
  background:var(--lt-active);color:#013117;font-weight:800;
  box-shadow:inset 3px 0 0 #0A4A2A;
}
.app-shell aside.sidebar nav a.active span{background:#FFFFFF;color:#0A4A2A}

/* -- Topbar -> solid white ------------------------------------------- */
.app-shell .topbar{background:#FFFFFF;border-bottom:1px solid var(--lt-line)}

/* -- Cards / panels --------------------------------------------------- */
.app-shell .panel{
  background:var(--lt-card);border:1px solid var(--lt-line);border-radius:16px;
  box-shadow:0 1px 2px rgba(19,34,25,.04),0 10px 30px -18px rgba(19,34,25,.18);
}
.app-shell .table-wrap{
  background:#FFFFFF;border:1px solid var(--lt-line);border-radius:16px;
  box-shadow:0 1px 2px rgba(19,34,25,.04),0 10px 30px -18px rgba(19,34,25,.18);
}
.app-shell .metric{border-color:var(--lt-line)}

/* -- Dashboard snapshot tiles -> WHITE cards, hue kept as identity ----
      SM-8 painted the whole tile with the module gradient and white
      text; LT-1 keeps the hue ONLY as the top strip + label chip, per
      the light-theme stat pattern (tiny uppercase label, large bold
      dark number, muted sub-line). nth-child order = markup order =
      the SM-8 hue order (blue/violet/amber/teal/green/rose). */
.app-shell .snap-grid .metric{
  background:#FFFFFF;border:1px solid var(--lt-line);color:var(--lt-ink);
  box-shadow:0 1px 2px rgba(19,34,25,.04),0 10px 30px -18px rgba(19,34,25,.18);
}
.app-shell .snap-grid .metric b{color:var(--lt-ink)}
.app-shell .snap-grid .metric small{color:var(--lt-mut)}
.app-shell .snap-grid .metric span{
  display:inline-flex;align-items:center;gap:6px;padding:5px 10px;
  border-radius:8px;font-size:11.5px;
}
.app-shell .snap-grid .metric:nth-child(1){border-top:3.5px solid var(--hue-blue-d)}
.app-shell .snap-grid .metric:nth-child(1) span{background:var(--hue-blue-soft);color:var(--hue-blue-d)}
.app-shell .snap-grid .metric:nth-child(2){border-top:3.5px solid var(--hue-violet-d)}
.app-shell .snap-grid .metric:nth-child(2) span{background:var(--hue-violet-soft);color:var(--hue-violet-d)}
.app-shell .snap-grid .metric:nth-child(3){border-top:3.5px solid var(--hue-amber-d)}
.app-shell .snap-grid .metric:nth-child(3) span{background:var(--hue-amber-soft);color:var(--hue-amber-d)}
.app-shell .snap-grid .metric:nth-child(4){border-top:3.5px solid var(--hue-teal-d)}
.app-shell .snap-grid .metric:nth-child(4) span{background:var(--hue-teal-soft);color:var(--hue-teal-d)}
.app-shell .snap-grid .metric:nth-child(5){border-top:3.5px solid var(--hue-green-m)}
.app-shell .snap-grid .metric:nth-child(5) span{background:var(--hue-green-soft);color:var(--hue-green-m)}
.app-shell .snap-grid .metric:nth-child(6){border-top:3.5px solid var(--hue-rose-d)}
.app-shell .snap-grid .metric:nth-child(6) span{background:var(--hue-rose-soft);color:var(--hue-rose-d)}
.app-shell .snap-grid .metric:hover{box-shadow:0 14px 30px -12px rgba(19,34,25,.22)}

/* -- Hero stat chips (markup-dependent: the hero's second row holds the
      three stat blocks; they become translucent white chips on the
      green band, like the reference hero's white stats) ---------------- */
.app-shell .dash-hero>div:nth-of-type(2)>div{
  background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.35);
  border-radius:12px;padding:10px 18px;
}
/* Hero labels: the global small{color:var(--muted)} rule would paint the
   hero's stat labels grey-green on the green band (dim); on the band
   they must stay cream like the rest of the hero's white text. */
.app-shell .dash-hero small{color:rgba(252,246,233,.88)}

/* -- Tables ------------------------------------------------------------ */
.app-shell th{
  background:var(--lt-head);color:#46563F;
  border-bottom:1px solid var(--lt-line);
}
.app-shell td{border-bottom:1px solid var(--lt-line-soft)}
.app-shell tbody tr:hover td{background:#F3F7F0}

/* -- Buttons ------------------------------------------------------------ */
.app-shell .primary{border-radius:var(--radius-full)}
.app-shell .button{
  background:#FFFFFF;border:1px solid #BCD0B4;color:#0A4A2A;
}
.app-shell .button:hover{
  background:#F1F6EC;border-color:#A9C6B1;color:#013117;
  box-shadow:var(--shadow-sm);
}
/* Danger guard — AFTER the ghost rule on purpose: a dual-class
   .button.dangerbtn must stay red-family (equal specificity, later wins;
   .primary is protected separately by its base !important colour). */
.app-shell .dangerbtn{
  background:#FFFFFF;border-color:var(--sem-danger-border);color:var(--sem-danger);
}
.app-shell .dangerbtn:hover{
  background:var(--sem-danger-soft);border-color:var(--sem-danger-solid);color:var(--sem-danger);
}

/* -- Forms --------------------------------------------------------------- */
.app-shell label{color:#2C3E30}
.app-shell input,.app-shell select,.app-shell textarea{
  border-color:var(--lt-inputline);background:#FFFFFF;color:var(--lt-ink);
}
.app-shell input:focus,.app-shell select:focus,.app-shell textarea:focus{
  border-color:#0A4A2A;box-shadow:0 0 0 3.5px rgba(10,74,42,.14);
}

/* -- Print-document tables: NEVER restyled, even if one is ever rendered
      inside the shell on screen (print itself is already excluded by the
      @media screen scope; this restores their own white/ink look against
      the generic th/td rules above — (0,2,1) beats (0,1,1)) ------------- */
.app-shell .print-table th,.app-shell .print-table td,
.app-shell .adm-data-table th,.app-shell .adm-data-table td,
.app-shell .datesheet-print-table th,.app-shell .datesheet-print-table td,
.app-shell .admission-print-table th,.app-shell .admission-print-table td{
  background:#FFFFFF;border-color:#aeb9b4;color:var(--lt-ink);
}
}
/* ===== End Wave LT-1 ===== */

/* ═══ Wave DASH-GRAPH — dashboard charts (owner order 2026-10-24) ═══
   Charts for dashboard_page()'s staff branch only (Fee Analytics +
   Financial Overview in pages.php): monthly collection columns, the
   collected-vs-pending SVG donut, the Profit & Loss grouped bars, and
   the collected-by-head card. Everything lives in ONE @media screen
   block using .dg- classes found nowhere else, so @media print output
   is byte-for-byte untouched and no other page can be affected.
   Palette: LT-1 light surfaces + the SM-9 system (brand green anchor
   #013117/#0A4A2A/#135737, Fees amber #B45309, Accounts teal
   #134E4A/#0F766E with its pale in-family tone for expenses, gold
   #D1952A as accent only — the selected month's marker).
   This block also RESTORES the .sm10-bars rules verbatim from
   wave_sm10/style.css: the LT-1 file lineage never carried them, so
   sm10_bars() output (this dashboard's by-head chart and the Accounts
   head-wise report) rendered without its bar styling. */
@media screen{
/* -- Chart layout --------------------------------------------------------- */
.dg-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:14px;margin-top:16px}
@media (max-width:900px){.dg-grid{grid-template-columns:1fr}}
.dg-card{background:#FAFCF8;border:1px solid #E2EBDD;border-radius:14px;padding:14px 16px}
.dg-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:6px 14px;flex-wrap:wrap;margin-bottom:10px;font-size:13.5px;color:#132219}
.dg-card-head .muted{font-size:12px}
.dg-cols{display:flex;gap:12px}
.dg-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center}
.dg-mlab{font-size:11.5px;color:#52637D;margin-top:6px;white-space:nowrap}
.dg-cur .dg-mlab{color:#013117;font-weight:800;border-bottom:2px solid #D1952A}
/* -- Monthly collection columns ------------------------------------------- */
.dg-val{font-size:11px;font-weight:700;color:#29402F;white-space:nowrap;margin-bottom:5px}
.dg-track{height:150px;width:100%;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid #D8E2D2;background-image:linear-gradient(to top,rgba(19,34,25,.07) 1px,transparent 1px);background-size:100% 37.5px;background-position:bottom}
.dg-bar{width:58%;max-width:44px;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#135737,#0A4A2A);transform-origin:bottom;transition:filter .15s ease;animation:dgGrowY .7s ease-out both}
.dg-cur .dg-bar{box-shadow:inset 0 3px 0 #D1952A}
.dg-col:hover .dg-bar{filter:brightness(1.14)}
.dg-bar-zero{background:#DCE5D8;box-shadow:none}
/* -- Profit & Loss grouped bars -------------------------------------------- */
.dg-pair{height:150px;width:100%;display:flex;gap:16px;align-items:flex-end;justify-content:center;border-bottom:1px solid #D8E2D2;background-image:linear-gradient(to top,rgba(19,34,25,.07) 1px,transparent 1px);background-size:100% 37.5px;background-position:bottom}
.dg-mini{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}
.dg-pval{font-size:9.5px;font-weight:700;color:#33513C;white-space:nowrap;margin-bottom:4px}
.dg-pbar{width:19px;border-radius:5px 5px 0 0;transform-origin:bottom;transition:filter .15s ease;animation:dgGrowY .7s ease-out both}
.dg-pbar-in{background:linear-gradient(180deg,#0F766E,#134E4A)}
.dg-pbar-out{background:linear-gradient(180deg,#8FC1B8,#5E9C90)}
.dg-pbar.dg-bar-zero{background:#DCE5D8}
.dg-mini:hover .dg-pbar{filter:brightness(1.13)}
.dg-net{font-size:11px;font-weight:700;margin-top:2px;white-space:nowrap}
.dg-net-pos{color:#0A4A2A}
.dg-net-neg{color:#BE123C}
.dg-net-zero{color:#8A9A8C}
.dg-legend{display:inline-flex;gap:14px;align-items:center;font-size:12px;flex-wrap:wrap}
.dg-swatch{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:6px;vertical-align:-1px;flex:none}
/* -- Collected vs Pending donut -------------------------------------------- */
.dg-donut-wrap{position:relative;width:148px;height:148px;flex:none}
.dg-donut{width:148px;height:148px;display:block}
.dg-donut-centre{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.dg-donut-centre b{font-size:25px;line-height:1;color:#132219}
.dg-donut-centre small{color:#52637D;font-size:11.5px}
.dg-leg-row{display:flex;align-items:center;font-size:13.5px;margin:6px 0;color:#132219}
.dg-leg-row .dg-swatch{margin-right:8px}
.dg-arc{animation:dgArc 1s ease-out}
/* -- SM-10 head bars (restored verbatim from wave_sm10/style.css) ---------- */
.sm10-bars{display:grid;gap:7px;font-size:13px}
.sm10-bar-row{display:flex;align-items:center;gap:10px}
.sm10-bar-label{width:150px;flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sm10-bar-track{flex:1;background:#E7EFE3;border-radius:999px;height:12px;overflow:hidden}
.sm10-bar-fill{height:100%;border-radius:999px}
.sm10-bar-fill.fee{background:var(--grad-tile-amber)}
.sm10-bar-fill.in{background:var(--grad-tile-teal)}
.sm10-bar-fill.out{background:var(--grad-tile-rose)}
.sm10-bar-val{flex:none;font-weight:700;white-space:nowrap}
@media (max-width:640px){.sm10-bar-label{width:92px}.sm10-bar-val{font-size:12px}}
.dg-scope .sm10-bar-fill{transform-origin:left;animation:dgGrowX .8s ease-out both}
/* -- Small screens: tighten so 6 months of labels stay legible -------------- */
@media (max-width:640px){
.dg-card{padding:12px 10px}
.dg-cols{gap:6px}
.dg-val{font-size:9.5px}
.dg-mlab{font-size:10.5px}
.dg-pair{gap:14px}
.dg-pbar{width:15px}
.dg-pval{font-size:8px;letter-spacing:-.4px;position:relative;z-index:1;text-shadow:0 0 4px #FAFCF8,0 0 4px #FAFCF8,0 1px 0 #FAFCF8}
.dg-net{font-size:8.5px;letter-spacing:-.3px}
}
/* -- Motion ----------------------------------------------------------------- */
@keyframes dgGrowY{from{transform:scaleY(0)}}
@keyframes dgGrowX{from{transform:scaleX(0)}}
@keyframes dgArc{from{stroke-dasharray:0 var(--circ,326.73)}}
@media (prefers-reduced-motion: reduce){
.dg-bar,.dg-pbar,.dg-arc,.dg-scope .sm10-bar-fill{animation:none!important}
}
}
/* ===== End Wave DASH-GRAPH ===== */

/* ==== PERM-CSS RESTORE (SM-10 block lost in the LT lineage; appended verbatim with DASH-GRAPHS) ==== */
.perm-wrap{overflow-x:auto}
.perm-table{border-collapse:collapse;width:100%;min-width:560px}
.perm-table th,.perm-table td{padding:7px 8px;border-bottom:1px solid #E2E8F0;text-align:center;font-size:13.5px}
.perm-table th{font-size:12.5px;text-transform:uppercase;letter-spacing:.4px;color:#5B6B60}
.perm-table td:first-child,.perm-table th:first-child{white-space:nowrap}
.perm-table input[type=checkbox]{width:20px;height:20px;accent-color:#0A4A2A;cursor:pointer;vertical-align:middle}
.perm-table input[type=checkbox]:disabled{cursor:not-allowed}
.perm-group td{background:var(--sem-success-soft);color:var(--sem-success);font-weight:800;text-align:left;font-size:12.5px;text-transform:uppercase;letter-spacing:.5px}
.perm-lock{color:#94A3B8;font-size:12px;white-space:nowrap}

/* ═══ Wave DASH-GRAPHS-2 — interactive dashboard charts (owner order 2026-10-24) ═══
   The four v1 DASH-GRAPH charts rebuilt as responsive inline SVGs (viewBox
   geometry, width:100% — bars, value labels and axis labels scale together
   inside the SVG, so nothing can clip at the side on a phone) with
   scroll-triggered build-in animation and hover/tap value inspection.
   All rules use dg2- classes in ONE @media screen block; the v1 .dg- block
   above stays untouched (the chart cards keep its .dg-card shell), and
   @media print output is unaffected. Palette unchanged: LT-1 light
   surfaces + SM-9 hues (brand green, Fees amber, Accounts teal, gold
   accent only for the selected month). */
@media screen{
/* -- Layout: fluid grid, shrinkable cards, wrapping heads ----------------- */
.dg2-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:14px;margin-top:16px}
.dg2-grid>*{min-width:0}
@media (max-width:900px){.dg2-grid{grid-template-columns:minmax(0,1fr)}}
.dg2-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:4px 12px;flex-wrap:wrap;margin-bottom:10px;font-size:13.5px;color:#132219;min-width:0}
.dg2-card-head>*{min-width:0}
.dg2-card-head .muted{font-size:12px}
.dg2-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.dg2-stage{position:relative;min-width:0}
.dg2-svg{display:block;width:100%;height:auto;max-width:100%}
/* -- Donut card body + legend ---------------------------------------------- */
.dg2-donut-flex{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.dg2-donut{width:188px;max-width:56vw;flex:none}
.dg2-donut-legend{min-width:0}
.dg2-leg-row{display:flex;align-items:center;padding:4px 6px;margin:0 -6px;border-radius:8px;font-size:13.5px;color:#22384C;cursor:pointer;-webkit-tap-highlight-color:transparent}
.dg2-leg-row:hover,.dg2-leg-row:focus-visible{background:#EFF5EC;outline:none}
.dg2-leg-total{border-top:1px solid #E2EBDD;margin-top:6px;padding-top:9px;cursor:default}
.dg2-leg-total:hover{background:transparent}
.dg2-swatch{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:6px;flex:none}
.dg2-legend{display:inline-flex;gap:14px;align-items:center;font-size:12px;flex-wrap:wrap}
/* -- SVG text --------------------------------------------------------------- */
.dg2-vlab{font-size:10px;font-weight:700;fill:#29402F}
.dg2-pval{font-size:9px;font-weight:700;fill:#33513C}
.dg2-mlab{font-size:10.5px;fill:#52637D}
.dg2-cur-lab{fill:#013117;font-weight:800}
.dg2-net{font-size:9px;font-weight:700}
.dg2-net-pos{fill:#0A4A2A}
.dg2-net-neg{fill:#BE123C}
.dg2-net-zero{fill:#8A9A8C}
.dg2-hname{font-size:11px;fill:#22384C}
.dg2-hval{font-size:11px;font-weight:700;fill:#132219}
.dg2-donut-pct{font-size:31px;font-weight:800;fill:#132219}
.dg2-donut-lab{font-size:11px;fill:#64748B}
/* -- Inspection: highlight the touched item, dim its siblings ---------------- */
.dg2-item{cursor:pointer;outline:none;-webkit-tap-highlight-color:transparent;transition:opacity .18s ease}
.dg2-chart.dg2-has-hot .dg2-item{opacity:.3}
.dg2-chart.dg2-has-hot .dg2-item.dg2-hot{opacity:1}
.dg2-chart.dg2-has-hot .dg2-item.dg2-hot .dg2-vbar,
.dg2-chart.dg2-has-hot .dg2-item.dg2-hot .dg2-hbar{filter:brightness(1.13)}
.dg2-seg{pointer-events:stroke}
/* -- Tooltip bubble (HTML overlay, clamped inside the card by the script) ---- */
.dg2-tip{position:absolute;z-index:6;pointer-events:none;background:#132219;color:#FCF6E9;border-radius:10px;padding:7px 12px 8px;font-size:12px;line-height:1.4;text-align:center;box-shadow:0 10px 24px rgba(1,21,10,.3);opacity:0;transform:translate(-50%,calc(-100% - 9px)) scale(.95);transform-origin:50% 100%;transition:opacity .16s ease,transform .16s ease;max-width:min(250px,88%)}
.dg2-tip b{display:block;font-size:14.5px;font-weight:800;white-space:nowrap}
.dg2-tip span{display:block;opacity:.78;font-size:11.5px}
.dg2-tip.dg2-on{opacity:1;transform:translate(-50%,calc(-100% - 9px)) scale(1)}
.dg2-tip.dg2-below{transform:translate(-50%,10px) scale(.95);transform-origin:50% 0}
.dg2-tip.dg2-below.dg2-on{transform:translate(-50%,10px) scale(1)}
/* -- Build-in animation. Initial (pre-reveal) states apply ONLY under
      html.dg2-js, a class the inline script adds before the charts are
      parsed; without JS, without IntersectionObserver, or on reveal, the
      final state below is what renders. -------------------------------------- */
.dg2-vbar{transform-box:fill-box;transform-origin:50% 100%}
.dg2-hbar{transform-box:fill-box;transform-origin:0 50%}
html.dg2-js .dg2-chart:not(.dg2-in) .dg2-vbar{transform:scaleY(0)}
html.dg2-js .dg2-chart:not(.dg2-in) .dg2-hbar{transform:scaleX(0)}
html.dg2-js .dg2-chart:not(.dg2-in) .dg2-animlab{opacity:0}
html.dg2-js .dg2-chart:not(.dg2-in) .dg2-arc{stroke-dasharray:0 var(--circ)}
.dg2-chart.dg2-in .dg2-vbar{animation:dg2GrowY .9s cubic-bezier(.22,.8,.3,1) both;animation-delay:var(--d,0ms)}
.dg2-chart.dg2-in .dg2-hbar{animation:dg2GrowX .9s cubic-bezier(.22,.8,.3,1) both;animation-delay:var(--d,0ms)}
.dg2-chart.dg2-in .dg2-animlab{animation:dg2FadeIn .45s ease both;animation-delay:calc(var(--d,0ms) + 320ms)}
.dg2-chart.dg2-in .dg2-arc{animation:dg2Sweep 1.15s cubic-bezier(.22,.8,.3,1) both}
@keyframes dg2GrowY{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes dg2GrowX{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes dg2FadeIn{from{opacity:0}to{opacity:1}}
@keyframes dg2Sweep{from{stroke-dasharray:0 var(--circ)}to{stroke-dasharray:var(--arc) var(--circ)}}
@media (prefers-reduced-motion: reduce){
.dg2-chart *,.dg2-tip{animation:none!important;transition:none!important}
}
}
/* ===== End Wave DASH-GRAPHS-2 ===== */

/* ===== Wave POS — school-shop Point of Sale (appended; everything above untouched) ===== */
.pos-layout{display:grid;grid-template-columns:1fr 360px;gap:16px;align-items:start}
.pos-main{min-width:0}
.pos-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.pos-tools input{padding:10px 12px;border:1px solid #DCE5D8;border-radius:10px;font-size:14px}
.pos-chips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.pos-chip{padding:6px 13px;border:1px solid #DCE5D8;border-radius:999px;font-size:13px;font-weight:700;color:#0A4A2A;background:#fff;text-decoration:none}
.pos-chip.on{background:#0A4A2A;color:#fff;border-color:#0A4A2A}
.pos-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.pos-tile{text-align:left;background:#fff;border:1px solid #DCE5D8;border-radius:14px;padding:13px 14px;cursor:pointer;display:flex;flex-direction:column;gap:4px}
.pos-tile:hover{border-color:#0A4A2A;box-shadow:0 2px 10px rgba(1,49,23,.10)}
.pos-tile.out{opacity:.55;cursor:not-allowed}
.pos-tile b{font-size:14.5px;color:#132219}
.pos-price{font-weight:800;color:#0A4A2A;font-size:15px}
.pos-stock{font-size:12px;font-weight:700;color:#135737}
.pos-stock.low{color:#92400E;background:#FEF3C7;border-radius:999px;padding:2px 8px;align-self:flex-start}
.pos-stock.none{color:#BE123C}
.pos-cart{position:sticky;top:14px}
.pos-line{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid #E7EFE3}
.pos-qty{display:flex;align-items:center;gap:6px}
.pos-qty button{width:26px;height:26px;border-radius:50%;border:1px solid #DCE5D8;background:#F2F6F1;font-weight:800;cursor:pointer}
.pos-qty .pos-rm{border-color:#FECDD3;color:#BE123C;background:#FFF1F2}
.pos-totals{margin-top:12px;display:flex;flex-direction:column;gap:7px}
.pos-totals>div{display:flex;justify-content:space-between;align-items:center;gap:8px}
.pos-totals .pos-grand{border-top:2px solid #0A4A2A;padding-top:8px;font-size:16px}
.pos-disc-row input[type=number]{padding:7px 9px;border:1px solid #DCE5D8;border-radius:8px}
.pos-receipt-mini{margin-top:14px;border:1px dashed #B9C6C0;border-radius:10px;padding:12px 14px;background:#FFFDF6}
.pos-rline{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;padding:2px 0}
.pos-rtotal{border-top:1px solid #555;margin-top:6px;padding-top:6px;font-size:14px}
@media(max-width:820px){.pos-layout{grid-template-columns:1fr}.pos-cart{position:static}}

/* ==========================================================================
   FEE REPORTS + SALARY SLIP WAVE (approved theme demo)
   ========================================================================== */
.fr-sheet{background:#fff;border:1.5px solid #DCE5D8;border-radius:16px;padding:20px 22px;margin-bottom:16px}
.fr-doc-head{text-align:center;border-bottom:2.5px solid #0A4A2A;padding-bottom:10px;margin-bottom:14px}
.fr-doc-school{font-size:20px;font-weight:800;color:#013117}
.fr-doc-title{font-weight:800;letter-spacing:.08em;margin-top:4px;color:#132219}
.fr-slip-title{font-weight:800;letter-spacing:.12em;margin-top:4px;color:#132219}
.fr-tiles{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px}
.fr-tile{background:#F2F6F1;border:1px solid #DCE5D8;border-radius:12px;padding:10px 14px;min-width:150px;flex:1}
.fr-tile span{display:block;font-size:12px;color:#5B6B62;font-weight:700}
.fr-tile b{font-size:17px;color:#132219}
.fr-tile small{display:block;font-size:11.5px}
.fr-red{color:#BE123C!important}
.fr-table{width:100%;border-collapse:collapse}
.fr-table th{background:#EAF1E8;color:#132219;text-align:left;padding:8px 10px;border-bottom:1.5px solid #DCE5D8;font-size:13px}
.fr-table td{padding:8px 10px;border-bottom:1px solid #E7EFE3;font-size:13.5px}
.fr-table .num{text-align:right}
.fr-bars{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.fr-bar{display:flex;align-items:center;gap:10px}
.fr-bar-label{width:170px;font-size:13px;font-weight:700;flex-shrink:0}
.fr-bar-track{flex:1;height:14px;background:#E7EFE3;border-radius:999px;overflow:hidden}
.fr-bar-track i{display:block;height:100%;background:linear-gradient(90deg,#0A4A2A,#135737);border-radius:999px}
.fr-bar-val{font-size:13px;font-weight:700;white-space:nowrap}
.fr-prog{height:12px;background:#E7EFE3;border-radius:999px;overflow:hidden}
.fr-prog i{display:block;height:100%;background:linear-gradient(90deg,#0A4A2A,#135737);border-radius:999px}
.fr-slip{max-width:760px;margin:0 auto}
.fr-slip-cols{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:12px}
.fr-net{background:#E7EFE3;border-radius:10px;padding:12px 16px;margin-top:14px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.fr-net-label{font-size:12px;color:#0A4A2A;font-weight:800}
.fr-net-amount{font-size:22px;color:#013117;white-space:nowrap}
.fr-signatures{display:flex;justify-content:space-between;margin-top:44px;gap:16px}
.fr-sig-line{border-top:1.6px solid #444;padding-top:5px;min-width:180px;font-size:12.5px;text-align:center}
@media(max-width:820px){.fr-bar-label{width:120px}.fr-slip-cols{grid-template-columns:1fr}.fr-tile{min-width:120px}}
@media print{
  .fr-sheet{border:none;border-radius:0;padding:0;box-shadow:none}
  .fr-slip{max-width:100%}
  @page{size:A4;margin:14mm}
  .fr-table th,.fr-table td{font-size:12.5px}
  .fr-bar-track i,.fr-prog i{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .fr-tile,.fr-net{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* ===== Wave PORTAL-SHELL — dashboard 3-card row (HQ + adoption) ===== */
@media screen{
.shell-row3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}
.shell-card{background:#fff;border:1px solid #DCE5D8;border-radius:16px;box-shadow:0 4px 20px -2px rgba(19,34,25,.06),0 2px 6px -1px rgba(19,34,25,.03);padding:18px;min-width:0}
.shell-chead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.shell-chead h3{margin:0;font-size:15.5px;color:#132219}
.shell-pill-new{background:#FFE4E6;color:#881337;border:1px solid #F3B8C4;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:700}
.shell-annc{display:flex;gap:11px;padding:10px 0;border-bottom:1px solid #E7EEE3}
.shell-annc:last-of-type{border-bottom:0}
.shell-big{font-size:32px;font-weight:800;line-height:1.1;color:#013117}
.shell-prog{height:9px;border-radius:99px;background:#EDF3EA;overflow:hidden;margin-top:10px}
.shell-prog>div{height:100%;border-radius:99px;background:linear-gradient(135deg,#1E40AF,#2563EB)}
.shell-prog-green>div{background:linear-gradient(135deg,#013117,#135737)}
@media(max-width:820px){.shell-row3{grid-template-columns:1fr}}
}

/* ==========================================================================
   TIMETABLE AUTO-GENERATE WIZARD (screen only; no print surface uses these)
   ========================================================================== */
.tt-steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.tt-step{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:99px;background:#fff;border:1.5px solid #dce5d8;color:#475569;font-size:13px;font-weight:700;text-decoration:none}
.tt-step b{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#e2e8f0;color:#334155;font-size:12px}
.tt-step.done{border-color:#86efac;background:#f0fdf4;color:#135737}
.tt-step.done b{background:#0a4a2a;color:#fff}
.tt-step.cur{border-color:#0a4a2a;background:#0a4a2a;color:#fff}
.tt-step.cur b{background:#fff;color:#0a4a2a}
.tt-bar{height:10px;background:#e2e8f0;border-radius:99px;overflow:hidden}
.tt-bar>i{display:block;height:100%;background:linear-gradient(90deg,#0a4a2a,#135737)}
.tt-bar.over>i{background:#dc2626}

/* Wave RD — Result Card Depth: black-and-white print discipline for the result card.
   Screen rendering is unchanged (classes carry no screen rules). On paper the dark
   Portfolio cover and green bars become ink-safe black/white so nothing prints as
   invisible cream-on-white when background graphics are off. */
@media print {
  .rc-portfolio-cover, .rc-portfolio-cover * { background:#fff !important; color:#000 !important; opacity:1 !important; }
  .rc-bar-track { background:#fff !important; border:1px solid #999 !important; }
  .rc-bar-fill { background:#333 !important; }
}

/* Wave LP — Lesson Plans: completion bars, status pills, homework sheet. Screen only; print surfaces untouched. */
.lp-bar-track{height:14px;background:#E7EFE3;border:1px solid #DCE5D8;border-radius:8px;overflow:hidden}
.lp-bar-fill{height:100%;background:linear-gradient(90deg,#0A4A2A,#135737)}
.lp-pill{display:inline-block;padding:2px 10px;border-radius:20px;font-size:12px;font-weight:800}
.lp-pill.planned{background:#E7EFE3;color:#0A4A2A}
.lp-pill.taught{background:#dcfce7;color:#14532d}
.lp-pill.overdue{background:#fee2e2;color:#991b1b}
.lp-hw-btns button{padding:6px 10px;border-radius:8px;border:1.5px solid #DCE5D8;background:#fff;font-weight:700;cursor:pointer}

@media screen {
  /* Wave PP — tickets, leaves, homework */
  .pp-ticket { margin-bottom: 14px; }
  .pp-ticket-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .pp-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
  .pp-pill.open, .pp-pill.pending { background: #fef3c7; color: #92400e; }
  .pp-pill.in_progress { background: #dbeafe; color: #1e40af; }
  .pp-pill.resolved, .pp-pill.approved, .pp-pill.submitted { background: #dcfce7; color: #166534; }
  .pp-pill.rejected, .pp-pill.late { background: #fee2e2; color: #991b1b; }
  .pp-pill.not_submitted, .pp-pill.unmarked { background: #f1f5f9; color: #475569; }
  .pp-reply { border-left: 3px solid #0A4A2A; background: #f8fafc; border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 8px 0; }
  .pp-reply p { margin: 4px 0 0; }
}

/* Wave TP — Theme-file picks (owner morning theme files). Screen only; print output untouched. */
@media screen {
  /* 1. Active nav = approved demo treatment (green-soft, NOT gold). Replaces the theme-files gold pill per the owner's demo-exact order. */
  .app-shell aside.sidebar nav a.active{background:#E7EFE3;color:#013117;box-shadow:none;font-weight:800}
  .app-shell aside.sidebar nav a.active::before{content:"";position:absolute;left:-14px;top:8px;bottom:8px;width:3.5px;border-radius:3px;background:#0A4A2A}
  [dir="rtl"] .app-shell aside.sidebar nav a.active::before{left:auto;right:-14px}
  /* 3. Score-ring hero on the class-test report (screen only; also no-print in markup). */
  .tp-score-ring{position:relative;width:120px;margin:12px auto 2px;text-align:center}
  .tp-score-ring svg{display:block}
  .tp-score-ring-text{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}
  .tp-score-ring-text b{font-size:22px;color:#013117;line-height:1}
  .tp-score-ring-text span{font-size:12px;font-weight:800;color:#0A4A2A}
  /* 4. Demo sample-data badge (markup is gated on demo_mode, so live never renders it). */
  .tp-demo-badge{background:#FAD380;border:1px solid #D1952A;color:#013117;border-radius:10px;padding:8px 12px;text-align:center;font-weight:800;font-size:13px;margin:0 0 12px}
}
@media print {
  .tp-score-ring{display:none !important}
}

/* Wave ID-CARDS: 6-theme switcher + preview — screen only. Printed cards are
   themed by the inline ic_theme_css() override, never by this block. */
@media screen{
  .ic-theme-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}
  .ic-dot{width:30px;height:30px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1.5px #cbd5e1;cursor:pointer;padding:0}
  .ic-dot.on{box-shadow:0 0 0 2.5px #013117}
  .ic-preview-wrap{margin-top:14px}
  .ic-preview-card{width:250px;max-width:100%;border:1px solid #cbd5e1;border-radius:12px;overflow:hidden;background:#fff;box-shadow:0 4px 14px rgba(0,0,0,.08)}
  .ic-preview-head{color:#fff;padding:10px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-weight:800;font-size:13px}
  .ic-preview-kind{font-size:10px;letter-spacing:1px;background:rgba(255,255,255,.18);border-radius:99px;padding:3px 8px;white-space:nowrap}
  .ic-preview-body{display:flex;gap:10px;padding:12px;align-items:center}
  .ic-preview-photo{width:44px;height:54px;object-fit:cover;border-radius:6px;flex-shrink:0;background:#eef1f8;display:flex;align-items:center;justify-content:center;font-weight:800}
  .ic-preview-lines{display:flex;flex-direction:column;gap:2px;font-size:12.5px;min-width:0}
  .ic-preview-lines b{font-size:14px}
}

/* Wave CC — client communication (screen only). */
.cc-chat-wrap{display:grid;grid-template-columns:220px 1fr;gap:12px;align-items:start}
@media (max-width:640px){.cc-chat-wrap{grid-template-columns:1fr}}
.cc-chat-list p,.cc-chat-thread p{overflow-wrap:anywhere}
.cc-msg{max-width:85%;padding:8px 12px;border-radius:12px;margin:8px 0}
.cc-msg.mine{margin-left:auto;background:#E7EFE3;text-align:right}
.cc-msg.theirs{margin-right:auto;background:#F1F5F9}
.cc-msg small{display:block;margin-top:4px;font-size:11.5px}
.cc-unread{display:inline-block;background:#D1952A;color:#fff;font-size:11px;font-weight:800;border-radius:999px;padding:1px 8px}


/* ===== Wave DRAWER — drawer = approved theme demo, exactly =====
   Demo values: items 14px/550, padding 8px 10px, radius 11px, gap 2px,
   icon chip 31x31 radius 9 bg #EDF3EA glyph #2E4A34, row hover #F4F8F1,
   active chip white + demo shadow, group 10.5px/700/.12em/#7C8B7A.
   Later + equal/higher specificity than LT-1/TP rules, so these win. */
@media screen{
.app-shell aside.sidebar nav{gap:2px}
.app-shell aside.sidebar nav a{position:relative;font-size:14px;font-weight:550;padding:8px 10px;border-radius:11px}
.app-shell aside.sidebar nav a:hover{background:#F4F8F1}
.app-shell aside.sidebar nav a span.nic{width:31px;height:31px;flex:0 0 31px;display:grid;place-items:center;border-radius:9px;background:#EDF3EA;color:#2E4A34}
.app-shell aside.sidebar nav a span.nic svg.ic{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.app-shell aside.sidebar nav a:hover span.nic{background:#EDF3EA}
.app-shell aside.sidebar nav a.active span.nic{background:#FFFFFF;color:#0A4A2A;box-shadow:0 4px 20px -2px rgba(19,34,25,.06),0 2px 6px -1px rgba(19,34,25,.03)}
.app-shell aside.sidebar .nav-group{font-size:10.5px;font-weight:700;letter-spacing:.12em}
}
/* ===== End Wave DRAWER ===== */

/* Wave READYFIX (P-D3/C-D6/O-D9) — in-shell prints must not carry shell chrome:
   sidebar, topbar, mobile bottom nav and the shell footer stay on screen only.
   Document footers inside .a4/.receipt-sheet etc. are nested, not body>footer,
   so they are untouched. */
@media print{
  .app-shell .sidebar,.app-shell .topbar,.mobile-bottom-nav,.sidebar-backdrop,body>footer{display:none!important}
  .app-shell{display:block!important}
}

/* ===== Wave READYFIX3 — WHITE SIDEBAR + TOPBAR (owner decision 2026-10-26:
   sidebar/topbar = WHITE per the approved theme demo; the dark-green
   #013117 sidebar was a later change). Screen only; print untouched.
   This block is appended LAST and changes nothing else: every rule above
   stays byte-identical. Why a new block instead of editing the old rules?
   The served dashboard HTML carries a PHP <style> rule AFTER the
   stylesheet link (index.php head block: `.sidebar{background:
   var(--sidebar-bg,#013117)!important}` with :root --sidebar-bg:#013117),
   plus older dark rules in this file (base line 33, mobile drawer line
   1555). The selectors below are (0,2,4) + !important, so they beat the
   PHP rule's (0,1,0) !important and every earlier stylesheet rule
   regardless of document order — the white treatment no longer depends
   on the LT-1 block's specificity margin. Tokens follow the approved
   demo: white surfaces, #DCE5D8 borders, active pill #E7EFE3 + #013117
   bold text (the TP ::before #0A4A2A inset bar is untouched and stays).
   Hero gradient, page bg, cards, print documents: NOT touched here.
   Also fixed in this block: the mobile drawer ✕ button was styled
   white-on-dark (rgba(255,255,255,0.15)/#fff) by the mobile blocks, i.e.
   invisible on the white drawer — it is now dark-on-light. ===== */
@media screen{
  html body div.app-shell aside.sidebar{
    background:#FFFFFF!important;color:#132219!important;
    border-right:1px solid #DCE5D8!important;
    scrollbar-color:#C4D2BE transparent!important;
  }
  html body div.app-shell aside.sidebar .brand{border-bottom:1px solid #E7EEE3!important}
  html body div.app-shell aside.sidebar .brand b{color:#132219!important}
  html body div.app-shell aside.sidebar .brand small{color:#5F7160!important}
  html body div.app-shell aside.sidebar .nav-group{color:#7C8B7A!important}
  html body div.app-shell aside.sidebar nav a{color:#3F5040!important}
  html body div.app-shell aside.sidebar nav a span{
    background:#EDF3EA!important;color:#2E4A34!important;
  }
  html body div.app-shell aside.sidebar nav a:hover{background:#F0F5EE!important;color:#132219!important}
  html body div.app-shell aside.sidebar nav a:hover span{background:#DFEBD8!important}
  html body div.app-shell aside.sidebar nav a.active{
    background:#E7EFE3!important;color:#013117!important;font-weight:800!important;
  }
  html body div.app-shell aside.sidebar nav a.active span{background:#FFFFFF!important;color:#0A4A2A!important}
  html body div.app-shell aside.sidebar .sidebar-close-btn{
    background:#EDF3EA!important;color:#132219!important;border:1px solid #DCE5D8!important;
  }
  html body div.app-shell header.topbar{
    background:#FFFFFF!important;border-bottom:1px solid #DCE5D8!important;
  }
  html body div.app-shell header.topbar h1{color:#132219!important}
  html body div.app-shell header.topbar small{color:#5F7160!important}
}
/* ===== End Wave READYFIX3 ===== */
