@font-face{font-family:Plex;src:url('IBMPlexSansArabic-Regular.ttf') format('truetype');font-display:swap}
:root{--bg:#fafaf9;--surface:#fff;--text:#243b35;--muted:#75837e;--border:#e5eae5;--green:#087f5b;--soft:#eef7f1;--shadow:0 3px 15px #153e2f05;color-scheme:light}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:15px Plex,Arial,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #64bc9e;outline-offset:3px}button:disabled{opacity:.4;cursor:not-allowed}small{color:var(--muted)}
aside{position:fixed;inset:0 0 0 auto;width:250px;background:#073f31;color:#f0f7f3;padding:34px 20px;display:flex;flex-direction:column;z-index:10}main{margin-right:250px;padding:0 42px;max-width:1760px}.brand{display:flex;align-items:center;gap:12px}.brand strong{font-size:23px}.brand small{display:block;color:#a0c3b5;font-size:12px;margin-top:3px}.brand-icon{background:#ffffff13;border:1px solid #ffffff20;border-radius:16px;font-size:29px;padding:7px 10px}.school{margin:30px 0 25px;padding:18px 12px;border:1px solid #ffffff19;border-radius:12px;font-size:12px;color:#c3dacf}.badge{display:table;margin-top:10px;padding:3px 10px;background:#9dd9ba1c;color:#b5dfc9;border-radius:5px;font-size:11px}.nav-caption{color:#88b29f;font-size:11px;padding:8px 14px}nav button{display:flex;align-items:center;gap:13px;width:100%;border:1px solid transparent;background:transparent;color:#cce0d6;text-align:right;padding:13px 15px;border-radius:9px;margin:5px 0;font-size:14px}nav button:hover{background:#ffffff0b}nav button.active{background:#fff;color:#074d36;border-color:#fff;box-shadow:0 4px 12px #00271630}nav button span{flex:1}.sidebar-bottom{margin-top:auto;padding:22px 12px 0;border-top:1px solid #ffffff15}.sidebar-bottom p{font-size:12px}.sidebar-bottom small{color:#8fbaaa;font-size:11px;line-height:1.9;display:block}.topbar{height:78px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);font-size:12px;color:var(--muted)}.topbar b{padding:0 9px;font-weight:normal;color:#b0bdb7}.quiet{padding:8px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--muted);font-size:12px}#menu{display:none}.demo-note{margin-top:24px;background:var(--soft);color:var(--green);border-radius:8px;padding:10px 14px;font-size:12px}.demo-note span{margin-left:7px}h1{font-size:29px;font-weight:normal;margin:0 0 8px;letter-spacing:-.6px}h2{font-size:17px;font-weight:normal;margin:0}p{line-height:1.8}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:31px 0 27px}.page-heading p{margin:0;color:var(--muted);font-size:13px}.actions{display:flex;gap:9px}.primary,.secondary{border-radius:8px;padding:10px 17px;border:1px solid var(--border);background:var(--surface);color:var(--text);white-space:nowrap}.primary{background:var(--green);color:#fff;border-color:var(--green)}.primary:hover{filter:brightness(.93)}.secondary:hover{background:var(--soft)}.section-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 16px}.muted{color:var(--muted);font-size:12px}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.stats.three{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:15px}.stat{background:var(--surface);border:1px solid var(--border);border-inline-start:3px solid var(--accent,#26976a);border-radius:12px;padding:20px;display:flex;align-items:center;gap:16px;min-height:122px;box-shadow:var(--shadow)}.stat-icon{background:var(--tint,#eef7f1);padding:10px;border-radius:11px;font-size:21px;line-height:1;flex-shrink:0}.stat-label{color:var(--muted);font-size:12px}.stat-value{font-family:Plex,Arial,sans-serif;line-height:1.4;font-size:27px;display:block;margin:5px 0;overflow-wrap:anywhere}.stat-hint{color:var(--muted);font-size:10px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:24px;margin-top:22px;box-shadow:var(--shadow)}.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.panel-title span{color:var(--muted);font-size:11px}.two-col{display:grid;grid-template-columns:1.1fr 1fr;gap:22px}.two-col .panel{margin-top:0;min-width:0}.body-space{margin-top:24px}table{width:100%;border-collapse:collapse;text-align:right;font-size:13px}th{font-size:11px;font-weight:normal;color:var(--muted);padding:12px 8px;border-bottom:1px solid var(--border)}td{padding:15px 8px;border-bottom:1px solid var(--border)}tr:last-child td{border-bottom:0}.status{display:inline-block;font-size:10px;padding:4px 9px;border-radius:6px;background:#eef7f1;color:#187b50}.status.amber{background:#fff5e1;color:#ad7426}.link-button{border:0;background:transparent;color:var(--green);font-size:12px;padding:6px}.row-person{display:flex;align-items:center;gap:11px}.avatar{display:flex;align-items:center;justify-content:center;width:35px;height:35px;border-radius:10px;background:#f0eee8;color:#8a8071;font-size:12px}.row-person small{display:block;font-size:10px;margin-top:3px}details{border:1px solid var(--border);border-radius:10px;background:var(--surface);margin-top:16px;padding:16px 20px}summary{cursor:pointer;color:var(--text);font-size:13px}details p{color:var(--muted);font-size:12px}.steps{display:flex;gap:8px;border-bottom:1px solid var(--border);padding-bottom:16px;margin-bottom:25px;color:var(--muted);font-size:12px}.steps span{background:var(--soft);color:var(--green);padding:6px 10px;border-radius:6px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}label{display:flex;flex-direction:column;gap:8px;font-size:12px}input,select,textarea{width:100%;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text);padding:11px 12px;min-width:0}input[type=checkbox]{width:auto}.field-wide{grid-column:1/-1}.form-title{font-size:14px;margin:27px 0 16px;display:flex;gap:9px;align-items:center}.form-title i{font-style:normal;font-size:10px;background:var(--soft);color:var(--green);padding:3px 8px;border-radius:5px}.choices{display:flex;gap:8px;margin:15px 0}.choice{border:1px solid var(--border);background:var(--surface);padding:9px 16px;border-radius:7px;color:var(--text)}.choice.active{background:var(--soft);color:var(--green);border-color:#a5d8bd}.check-row{display:flex;gap:10px;align-items:center;margin:14px 0;flex-direction:row}.form-end{margin-top:25px;border-top:1px solid var(--border);padding-top:20px;display:flex;justify-content:space-between;align-items:center}.profile-head{display:flex;align-items:center;gap:18px}.profile-head .avatar{width:60px;height:60px;font-size:23px}.search{max-width:380px}.filters{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.empty{padding:45px;text-align:center;color:var(--muted)}.receipt-row{display:flex;justify-content:space-between;align-items:center;padding:14px 0;border-bottom:1px solid var(--border)}.receipt-row:last-child{border:0}.payment-preview{margin-top:20px;padding:18px;background:var(--soft);border-radius:9px}.payment-preview strong{font-weight:normal;color:var(--green)}.payment-preview p{font-size:12px;margin:9px 0;color:var(--muted)}.bar{height:8px;border-radius:20px;background:var(--border);margin:12px 0}.bar span{display:block;height:100%;background:var(--green);border-radius:20px}.error{color:#b53c3c;font-size:12px;margin-top:12px}.table-wrap{overflow-x:auto}footer{margin-top:42px;padding:20px 0;border-top:1px solid var(--border);font-size:11px;color:var(--muted);display:flex;justify-content:space-between}dialog{border:1px solid var(--border);border-radius:16px;background:var(--surface);color:var(--text);max-width:480px;width:90%;padding:28px}dialog::backdrop{background:#10392bb0}dialog h2{font-size:23px;margin-bottom:20px}#toast{position:fixed;bottom:25px;left:30px;background:#064e3b;color:white;padding:12px 20px;border-radius:10px;opacity:0;transform:translateY(15px);transition:.2s;pointer-events:none;z-index:30}#toast.show{opacity:1;transform:translateY(0)}.dark{--bg:#101519;--surface:#202223;--text:#f0f4f2;--muted:#b8c3bf;--border:#303636;--green:#8dd9bc;--soft:#002d20;color-scheme:dark}.dark .primary{background:#006348;color:#fff;border-color:#006348}.dark .stat-icon{background:#002d20}.dark .status{background:#002d20;color:#8dd9bc}.dark .status.amber{background:#3d3015;color:#e8c582}.dark .avatar{background:#303636;color:#d2dcd5}
@media(min-width:769px) and (max-width:1150px){main{padding:0 25px}aside{width:210px}main{margin-right:210px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-value{font-size:23px}.page-heading{align-items:flex-start;flex-direction:column}.two-col{grid-template-columns:1fr}.stats.three .stat{padding:14px;gap:10px}.stats.three .stat-icon{font-size:17px;padding:8px}}
@media(max-width:768px){aside{transform:translateX(100%);transition:.2s;width:min(280px,85vw);box-shadow:none}aside.open{transform:translateX(0);box-shadow:-10px 0 70px #02291d66}main{margin-right:0;padding:0 18px}#menu{display:block}.topbar{height:65px}.topbar>span{display:none}.demo-note{font-size:11px;line-height:1.8;margin-top:16px}.page-heading{flex-direction:column;align-items:stretch;margin:24px 0}.actions{flex-wrap:wrap}.actions button{flex:1;font-size:12px;padding:10px}.stats,.stats.three{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:15px 12px;gap:10px;min-height:128px;align-items:flex-start;flex-direction:column}.stat-value{font-size:23px}.stat-icon{font-size:18px;padding:8px}.stats.three .stat:last-child{grid-column:1/-1;flex-direction:row;align-items:center;min-height:98px}.two-col{grid-template-columns:1fr}.panel{padding:18px}.form-grid{grid-template-columns:1fr}.field-wide{grid-column:auto}.section-top{align-items:flex-start;flex-direction:column}.filters{align-items:stretch;flex-direction:column}.form-end{gap:15px;align-items:stretch;flex-direction:column}.form-end button{width:100%}.steps{gap:5px;font-size:11px}.choices{flex-wrap:wrap}.profile-head{gap:12px}.table-wrap table{min-width:460px}h1{font-size:26px}}

[hidden]{display:none!important}

/* Compact counters: the icon shares its label row; the unit shares the amount. */
.stats,.stats.three { grid-template-columns:repeat(2,minmax(0,1fr)); }
.stat,.stats.three .stat,.stats.three .stat:last-child { padding:12px 15px; min-height:94px; display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:7px; }
.stat-heading { display:flex; align-items:center; gap:8px; min-width:0; }
.stat-icon { font-size:17px; padding:6px; border-radius:8px; }
.stat-label { font-size:12px; line-height:1.5; min-width:0; overflow-wrap:break-word; }
.stat-number { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; max-width:100%; }
.stat-hint { grid-column:1/-1; }
.stat-value { display:inline; margin:0; font-size:25px; min-width:0; line-height:1.25; }
.stat-unit { color:var(--muted); font-size:11px; }
.home-shortcut:active { background:var(--green); color:white; border-color:var(--green); }
.school-logo { position:relative; display:block; aspect-ratio:1; overflow:hidden; border-radius:50%; flex-shrink:0; background:white; }
.school-logo img { position:absolute; width:100%; max-width:none; height:auto; top:-64.06%; left:0; }
.sidebar-logo { width:58px; }
.brand { align-items:center; }
.login-screen { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.login-screen[hidden] { display:none; }
.login-card { width:min(100%,420px); padding:32px; background:var(--surface); border:1px solid var(--border); border-radius:20px; text-align:center; box-shadow:0 18px 60px #153e2f0a; }
.login-logo { width:180px; margin:0 auto 22px; }
.login-card h1 { font-size:24px; line-height:1.7; }
.login-french { font-size:12px; color:var(--muted); direction:ltr; }
.login-badge { display:inline-block; background:var(--soft); color:var(--green); border-radius:20px; padding:6px 15px; margin:16px 0 5px; font-size:12px; }
.login-card button { width:100%; margin-top:14px; }
.login-mode main,.login-mode aside { display:none; }
@media(max-width:768px) {
 .stats,.stats.three { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 .stat,.stats.three .stat,.stats.three .stat:last-child { grid-column:auto; padding:12px; min-height:92px; }
 .stat-heading { gap:6px; }
 .stat-icon { padding:5px; font-size:16px; }
 .stat-value { font-size:22px; }
 .stat-unit { font-size:10px; }
 .topbar { gap:5px; }
 .topbar .quiet { font-size:11px; padding:8px 5px; }
 .login-card { padding:26px 20px; }
 .login-card h1 { font-size:22px; }
}

.stats.three .stat:last-child { grid-column:auto; }
.student-section-title {
 display:table; background:var(--soft); color:var(--green); padding:8px 12px;
 border-radius:8px; margin:26px 0 16px; font-size:14px; line-height:1.6;
}
.student-section-title:first-child { margin-top:0; }
/* Name/count lists fit on a phone; financial tables retain their wider columns. */
.table-wrap table:has(thead tr th:nth-child(2):last-child) { min-width:0; table-layout:fixed; }
.table-wrap table:has(thead tr th:nth-child(2):last-child) th:first-child { width:70%; }
.table-wrap table:has(thead tr th:nth-child(2):last-child) td { overflow-wrap:anywhere; }
.record-actions { display:flex; gap:6px; flex-wrap:wrap; }
.grant-row { border:1px solid var(--border); border-radius:9px; margin-top:14px; padding:10px 14px; display:flex; gap:6px 18px; flex-wrap:wrap; }
.grant-row legend { padding:0 6px; font-size:12px; color:var(--text); }
.grant-row .check-row { margin:4px 0; }
.demo-scope-note { font-size:11px; line-height:1.8; color:var(--muted); }
.demo-worker-login { text-align:right; }
nav button[hidden] { display:none; }
.receipt-search { border-inline-start:4px solid var(--green); }
#receipt-rows .receipt-row { gap:14px; flex-wrap:wrap; }
#receipt-rows .receipt-row > div:first-child { flex:1; min-width:145px; }
#receipt-rows .receipt-row .status { display:block; width:fit-content; margin-top:8px; }
#receipt-content .record-actions { margin-bottom:16px; }
.small { padding:6px 9px; font-size:12px; }
.managed-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 0; border-bottom:1px solid var(--border); }
.managed-row>div:first-child { min-width:0; overflow-wrap:anywhere; }
.managed-row .muted { margin:4px 0 0; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.dialog-head h2 { font-size:20px; margin:0; }
#record-dialog { width:min(650px,calc(100% - 24px)); max-height:90vh; overflow:auto; border:1px solid var(--border); border-radius:20px; padding:24px; background:var(--surface); color:var(--text); box-sizing:border-box; }
dialog::backdrop { background:#153c3b66; backdrop-filter:blur(3px); }
.danger { background:#b42318; color:white; border:1px solid #b42318; border-radius:8px; padding:10px 17px; }
aside { overflow-y:auto; }
.history-entry { padding:14px 0; border-bottom:1px solid var(--border); }
.history-entry summary { display:flex; gap:8px; flex-wrap:wrap; }
.history-diff { display:grid; gap:8px; font-size:13px; }
.history-diff>div { display:grid; grid-template-columns:1fr 1fr 20px 1fr; gap:8px; padding:10px; background:var(--soft); border-radius:8px; overflow-wrap:anywhere; }
.table-wrap table:has([data-record-type="departments"]) { min-width:0; table-layout:fixed; }
.table-wrap table:has([data-record-type="departments"]) th:first-child { width:36%; }
.table-wrap table:has([data-record-type="departments"]) th:nth-child(2) { width:22%; }
@media(max-width:520px) { .managed-row { align-items:flex-start; flex-direction:column; } #record-dialog { padding:18px; } .table-wrap:has([data-record-type="departments"]) th,.table-wrap:has([data-record-type="departments"]) td { padding:10px 5px; } }
/* Student file: private portrait, compact identity, readable family details. */
.file-hero{display:flex;align-items:center;gap:24px}
.file-portrait{width:112px;height:112px;flex:0 0 112px;object-fit:cover;border-radius:24px;border:3px solid var(--surface);box-shadow:0 0 0 1px var(--border)}
.file-initial{display:grid;place-items:center;font-size:42px;font-weight:700;background:var(--soft);color:var(--green)}
.file-identity{min-width:0}.file-identity h2{font-size:28px;margin:4px 0 8px;overflow-wrap:anywhere}
.file-identity p{margin:0 0 12px}.file-details{display:grid;grid-template-columns:1fr 1fr;gap:20px;padding-top:20px}
.file-details small{display:block;color:var(--muted);margin-bottom:5px}.file-details p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.file-preview{width:140px;height:140px;object-fit:cover;border-radius:18px;margin:16px 0;border:1px solid var(--border)}
.file-photo-editor summary,.file-intake-photo summary{cursor:pointer;color:var(--green)}
.file-photo-editor{padding:0;border:0}
.file-intake-photo{margin:20px 0}.file-info .panel{min-width:0}.file-photo-editor form{max-width:680px}
@media(max-width:600px){.file-hero{gap:16px;padding:20px}.file-portrait{width:82px;height:82px;flex-basis:82px;border-radius:18px}.file-identity h2{font-size:22px}.file-details{gap:16px}}

/* Compact identity badges and protected edit windows. */
.file-hero{position:relative;padding-bottom:66px}.file-tags{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.status.boy{background:#e1efff;color:#154c83;border:1px solid #90bce7}.status.girl{background:#ffe8f1;color:#8b2c52;border:1px solid #e8a3bf}
.photo-corner{position:absolute;bottom:16px;left:18px;display:flex;align-items:center;gap:8px;padding:3px 10px 3px 3px;min-height:34px;font-size:13px}.camera-square{display:grid;place-items:center;width:32px;height:32px;background:var(--soft);border-radius:8px}
.profile-official-edit{width:100%;margin:0 0 24px;min-height:58px}
dialog{max-height:90dvh;overflow:auto}.discard-box{position:sticky;bottom:0;background:var(--surface);border:2px solid #d49748;padding:16px;border-radius:14px;margin-top:20px;box-shadow:0 -8px 20px #0002}
.fee-mode-buttons{display:flex;gap:12px;margin:16px 0}.fee-mode-buttons button{flex:1;min-height:54px}
