/* Panel shell — colours from designs/brand/admin.md and tokens.md.
   The UniQAIDAR fonts are not in the repo yet; system fonts stand in. */
:root {
  --bar: #3A2F23;
  --surface: #FFFCF5;
  --page: #F3EEE4;
  --line: #E6DFD0;
  --text: #382D21;
  --muted: #775F46;
  --accent: #E0A526;
  --primary: #7A9A4F;
  --danger: #B51A12;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.6 "Noto Sans Arabic", Tahoma, "Segoe UI", sans-serif;
}
.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  min-height: 54px; padding: 0 30px; background: var(--bar); color: #fff;
}
.brand { font-weight: 700; }
.brand small { font-weight: 400; opacity: .75; margin-inline-start: 6px; }
.sections { display: flex; gap: 18px; flex-wrap: wrap; }
.section { color: #fff; opacity: .55; text-decoration: none; }
.section::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--dot, transparent); margin-inline-end: 6px;
}
.section.active { opacity: 1; font-weight: 700; }
.who { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; opacity: .9; }
.who form { margin: 0; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
/* The language switcher (M10): the page's own language unmarked. */
.languages { display: flex; gap: 6px; margin: 0; }
.languages .active { text-decoration: none; font-weight: 700; cursor: default; }
.login-languages { display: flex; justify-content: center; margin-block-start: 12px; }
.subbar { min-height: 44px; padding: 0 30px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.tab.active { font-weight: 700; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }
.page { padding: 30px; }
h1 { font-size: 28px; margin: 0 0 4px; }
.lead { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { border-top: 3px solid var(--accent); display: flex; flex-direction: column; }
.stat strong { font-size: 32px; }
.login { max-width: 380px; margin: 8vh auto; display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.login input { padding: 10px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; }
/* The public page that asks for an account's deletion (M11): the sign-in card, wider. */
.deletion { max-width: 520px; }
.deletion form { display: flex; flex-direction: column; gap: 12px; }
/* The privacy policy (M11): a long text to read. */
.privacy { max-width: 760px; margin: 16px auto 8vh; line-height: 1.7; }
.privacy h2 { margin-block-start: 28px; }
.privacy .notice { background: #FBEFD5; border-radius: 10px; padding: 10px 14px; }
.primary { background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 11px; font: inherit; font-weight: 700; cursor: pointer; }
.error { color: var(--danger); margin: 0; }
@media (max-width: 640px) {
  .topbar, .subbar, .page { padding-inline: 16px; }
}
/* M7 — «الإعلانات» and «إعلان جديد». */
.tab a { color: inherit; text-decoration: none; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 0 0 4px; }
.button { display: inline-block; background: var(--surface); color: var(--text); border: 1px solid #D8CDB8; border-radius: 10px; padding: 10px 14px; font: inherit; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.notice { background: #E6EEDA; border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.sub { font-size: 12.5px; color: var(--muted); }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: #F6F1E6; text-align: start; font-size: 13px; padding: 10px 14px; }
.table td { border-top: 1px solid #EFE9DD; padding: 12px 14px; vertical-align: top; }
.table .empty { text-align: center; color: var(--muted); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
.pill.green { background: #E6EEDA; } .pill.amber { background: #FBEFD3; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: 14px; border: 0; padding: 0; }
.field input[type=text], .field textarea { padding: 9px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; }
.choice { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.req { color: var(--danger); }
/* M8 — the door section: «بطاقات QR» and its print sheet (AdminQRCards, PrintQRCard). */
.tab { margin-inline-end: 22px; }
.tab.muted { color: var(--muted); opacity: .6; }
.notice.bad { background: #FBE3E1; color: var(--danger); }
.pill.red { background: #FBE3E1; } .pill.blue { background: #E2ECEF; } .pill.grey { background: #EFEAE0; }
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .with-side { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px; }
.filters .search input { padding: 7px 12px; border: 1px solid #D8CDB8; border-radius: 999px; font: inherit; min-width: 220px; }
.chip { border: 1px solid #D8CDB8; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text); text-decoration: none; background: #fff; }
.chip.on { background: var(--bar); color: #fff; border-color: var(--bar); }
.code { font-family: Menlo, Consolas, monospace; font-size: 13.5px; letter-spacing: .5px; }
.side .big { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.side .sub { margin: 0; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.field.narrow { max-width: 260px; }
.field input[type=date] { padding: 8px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; }
.danger { background: var(--danger); color: #fff; border: 0; border-radius: 10px; padding: 11px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.actions.flush { padding-inline: 0; }
.print-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.print-bar .primary { padding-inline: 18px; }
.sheet { width: 210mm; min-height: 297mm; margin: 0 auto 20px; background: #fff; padding: 12mm 11mm; display: flex; flex-direction: column; gap: 6mm; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid #C9BCA6; padding-bottom: 4mm; }
.cards { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 7mm 10mm; justify-content: center; }
.door-card { width: 85.6mm; height: 54mm; border: 1px dashed #9B8C77; border-radius: 3mm; padding: 3.5mm 4mm; display: flex; gap: 3mm; overflow: hidden; }
.door-card-text { flex: 1; display: flex; flex-direction: column; gap: 1.5mm; min-width: 0; }
.door-card .mark { font-weight: 700; font-size: 13px; }
.door-card .mark span { color: #A4BC7A; }
.door-card .family { font-size: 15px; font-weight: 700; line-height: 1.3; }
.door-card .kids { font-size: 12px; color: #4D4236; line-height: 1.5; }
.door-card .meta { margin-top: auto; display: flex; flex-direction: column; font-size: 11.5px; }
.door-card-code { width: 30mm; display: flex; flex-direction: column; align-items: center; gap: 1.5mm; }
.door-card .qr { width: 30mm; height: 30mm; }
.door-card .qr svg { width: 100%; height: 100%; display: block; }
.door-card.back { flex-direction: column; justify-content: center; font-size: 11.5px; line-height: 1.6; }
.door-card.back p { margin: 0 0 1.5mm; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .page { padding: 0; }
  .no-print { display: none; }
  .sheet { margin: 0; page-break-after: always; }
}
/* M8 — «أعلام الاستلام» (AdminPickupFlag). */
.tab .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #D9433A; color: #fff; font-size: 11.5px; text-align: center; }
.banner { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.banner.done { border-color: #B9D19A; background: #F1F6EA; }
.banner.wait { border-color: #E9CF8F; background: #FDF6E4; }
.banner .sub { margin: 0; }
.filters h2 { margin: 0; }
.spaced { margin-top: 16px; }
.field select, .field textarea, .field input[type=datetime-local] { padding: 8px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; }
/* M8 — «سجل الباب» (AdminDoorLog). */
.stat.green-top { border-top-color: #7A9A4F; } .stat.blue-top { border-top-color: #5E8C92; } .stat.red-top { border-top-color: #D9433A; }
.filters label { display: flex; gap: 6px; align-items: center; }
.filters select { padding: 6px 10px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; }
.bad-text { color: var(--danger); }
/* M8 — «الأجهزة» (AdminDevices). */
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.device header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.device h2 { margin: 0; }
.device dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 14px; }
.device dt { color: var(--muted); }
.device dd { margin: 0; }
.device form { margin: 0; }
.danger-outline { color: var(--danger); border-color: #E7B7B2; }
.big-code { font-size: 22px; letter-spacing: 2px; }
.empty-card { color: var(--muted); }
/* M8 — «المستلمون والصور». */
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0 4px 0 0; }
.photo-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.photo-cell input[type=file] { max-width: 210px; font-size: 12.5px; }
.field input[type=text]:not([dir]), .field select { min-width: 0; }
/* M9 — «المالية»: the installments, «تسجيل دفعة», the A4 receipt in two copies. */
.spaced-bottom { margin-bottom: 16px; }
.choice-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.choice-row.on { border-color: var(--accent); background: #FDF6E4; font-weight: 700; }
.muted-text { color: var(--muted); }
.ledger-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.field input[type=number] { padding: 9px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; max-width: 220px; }
.table tfoot td { border-top: 2px solid var(--line); background: #F6F1E6; }
.receipt-sheet { gap: 0; }
.receipt { flex: 1; display: flex; flex-direction: column; gap: 3mm; padding: 4mm 2mm; }
.receipt + .receipt { border-top: 1px dashed #9B8C77; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #C9BCA6; padding-bottom: 3mm; }
.receipt-no { display: flex; flex-direction: column; align-items: flex-end; }
.receipt-no strong { font-size: 20px; }
.receipt-body { display: grid; grid-template-columns: 34mm 1fr; gap: 2mm 6mm; margin: 0; font-size: 14px; }
.receipt-body dt { color: var(--muted); }
.receipt-body dd { margin: 0; }
.receipt .amount { font-size: 18px; }
.receipt-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 6mm; }
.signature { min-width: 50mm; border-top: 1px solid #9B8C77; text-align: center; padding-top: 1mm; }
.receipt-note { margin: 0; }
@media print {
  .topbar, .subbar { display: none; }
}
/* M9 — «الخطط». */
.plan-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.plan-head h2 { margin: 0; margin-inline-end: auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select, .filters input[type=text], .filters input[type=number], .table input { padding: 6px 10px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; max-width: 180px; }
/* M9.5 — «التمريض». */
.heart { color: #D9433A; }
.note { border-top: 1px solid #EFEAE0; padding-top: 8px; margin-top: 8px; }
.note p { margin: 4px 0 0; }
.struck td { text-decoration: line-through; color: var(--muted); }
.struck td:last-child { text-decoration: none; }
/* M9.5 — «الباحثة الاجتماعية»: never printed (§6.2). */
.print-only { display: none; }
@media print { .confidential { display: none !important; } .print-only { display: block; } }
/* M9.5 — threads (AdminMessages, AdminNurseThread). */
.split { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.thread-row { display: flex; gap: 8px; align-items: baseline; padding: 10px 14px; border-top: 1px solid #EFEAE0; color: var(--text); text-decoration: none; }
.thread-row .sub { margin-inline-start: auto; }
.thread-row.on { background: #F6EFE2; }
.dot-red { color: #D9433A; font-size: 11px; }
.thread-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bubbles { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: #F2EEE6; align-self: flex-start; }
.bubble.ours { background: #E6EEDA; align-self: flex-end; }
.bubble.hidden { opacity: .6; }
.bubble p { margin: 0 0 4px; }
/* An element with the hidden attribute stays hidden whatever its class sets (push.js). */
[hidden] { display: none !important; }
/* Birthday greetings (M9.6): a card per draft, on «تهاني الميلاد» and «الرئيسية». */
.greetings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.greeting { padding: 16px; }
.greeting-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.greeting-text { background: #FBF7EC; border-radius: 10px; padding: 10px 12px; margin: 10px 0 6px; line-height: 1.7; }
.greeting form { display: inline; }
/* Surveys (M9.6): «نتائج الاستبيان». */
.bar-cell { width: 40%; }
.bar { display: block; height: 8px; border-radius: 999px; background: #8FB06F; min-width: 2px; }
.texts { margin: 6px 0; padding-inline-start: 18px; line-height: 1.8; }
.survey-question h2 { margin-top: 2px; }
.alert-card { border-color: #E4A49F; background: #FDF3F2; }
/* «الموارد البشرية» (M9.6). */
.unlinked form { margin: 8px 0; }
.banner.warn { border-color: #E6C77A; background: #FDF6E3; }
/* «الرئيسية» (M9.7). */
.stat.alarm { border-color: #E4A49F; background: #FDF3F2; }
.stat .pill { margin-inline-start: 4px; }
.waiting p { margin: 6px 0; }
.slip .big-code { font-size: 34px; letter-spacing: 6px; font-weight: 700; margin: 10px 0; }
.guardian-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 14px; margin: 10px 0; }
@media screen { .slip { margin-bottom: 12px; } }
.attendance-grid td.mark { text-align: center; font-weight: 700; }
.mark-P { color: #3E7A3A; } .mark-N { color: #3E6A75; background: #E2ECEF; } .mark-q { color: #B3362E; background: #FDF3F2; }
/* «الإعدادات» (M9.7 slice 6): the hours and the week's days on one line each. */
.field input[type=time] { padding: 8px 12px; border: 1px solid #D8CDB8; border-radius: 10px; font: inherit; background: #fff; }
.choice-line { display: flex; flex-wrap: wrap; gap: 2px 16px; }
/* «سجل التدقيق» (M9.7 slice 7): the sensitive rows tinted, the details on one line each. */
.table tr.sensitive td { background: #FDF3F2; }
details code { font-family: Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
