:root {
  --chat-seen: #2b8fd6;
  --green: #1f4d3a;
  --green-2: #2c6a50;
  --green-soft: #e8f0eb;
  --gold: #b8923a;
  --gold-soft: #f6efdd;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --line: #e4e0d4;
  --text: #1c2420;
  --muted: #5e6a63;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --warn: #9a5b00;
  --warn-soft: #fdf1df;
  --blue: #1f5fa8;
  --blue-soft: #e7eff9;
  --radius: 12px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'DejaVu Sans', sans-serif;
  --font-head: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-deco: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif;
  --purple: #6a3fa5; --purple-soft: #f1eafb; --blue-2: #1d62b0;
  --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.7; font-weight: 400; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility;
}
a { color: var(--green-2); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; font-weight: 800; color: var(--green); letter-spacing: 0; }
h2 { font-size: 1.12rem; font-weight: 800; color: var(--green); }
h3 { font-size: 1rem; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--green); font-weight: 600; }

/* ===== الهيكل ===== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.topbar .spacer { flex: 1; }
.iconbtn {
  min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; color: inherit; border-radius: 10px;
  display: inline-grid; place-items: center; position: relative; cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: rgba(255,255,255,.12); }
.badge-dot {
  position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #1c1c1c; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.layout { flex: 1; display: flex; width: 100%; max-width: 1320px; margin: 0 auto; }
.sidenav { display: none; }
main { flex: 1; min-width: 0; padding: 16px; padding-bottom: 96px; }
.bottomnav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--muted); text-decoration: none; position: relative;
}
.bottomnav a.active { color: var(--green); font-weight: 700; }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.bottomnav svg, .sidenav svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .bottomnav { display: none; }
  main { padding: 24px; padding-bottom: 40px; }
  .sidenav { display: block; width: 258px; flex-shrink: 0; padding: 18px 12px 24px; position: sticky; top: 64px; align-self: flex-start; max-height: calc(100vh - 64px); overflow-y: auto; }
  .sidenav a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; margin-bottom: 2px;
    font-size: 15px; white-space: nowrap;
  }
  .sidenav a > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .sidenav a svg { width: 20px; height: 20px; color: var(--green-2); flex-shrink: 0; }
  .sidenav a.active { background: var(--green-soft); color: var(--green); font-weight: 700; }
  .sidenav a:hover { background: #efece3; }
  .sidenav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .sidenav .label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 14px 12px 4px; letter-spacing: .2px; }
}

/* ===== عناصر ===== */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; flex: 1; min-width: 160px; }
.back { font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; min-height: 32px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card.tight { padding: 10px 14px; }
.card h2 { margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.btn {
  min-height: var(--tap); padding: 8px 16px; border-radius: 10px; border: 1px solid var(--green); background: var(--green); color: #fff;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: var(--green-2); }
.btn.secondary { background: var(--surface); color: var(--green); }
.btn.secondary:hover { background: var(--green-soft); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1c1c1c; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #e2b4b0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--green-2); }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #eeece6; color: var(--muted); white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.gold { background: var(--gold-soft); color: #7a5c14; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.seq {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px;
  border: 2px solid var(--gold); color: var(--green); font-weight: 700; background: var(--gold-soft);
}

/* قوائم */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 56px; }
.item:last-child { border-bottom: 0; }
a.item:hover, button.item:hover { background: #faf9f5; }
.item .title { font-weight: 700; font-size: 1.02rem; }
.item .sub { font-size: 13.5px; color: var(--muted); }
button.item { width: 100%; border: 0; background: none; text-align: right; cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.chev { color: #b7b2a3; }

/* مهام اليوم */
.task { border-right: 4px solid var(--gold); }
.task .count { font-weight: 700; color: var(--green); }
.task-items { margin: 8px 0 0; padding: 0; list-style: none; }
.task-items li a { display: flex; gap: 8px; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--line); text-decoration: none; color: inherit; min-height: 40px; align-items: center; }

/* نماذج */
.field { margin-bottom: 14px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border-radius: 10px; border: 1px solid #cfcabb; background: #fff;
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.7; }
textarea.input.big { min-height: 150px; }
.input:focus, .chip input:focus-visible + span { outline: 3px solid rgba(184,146,58,.35); outline-offset: 1px; border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid #cfcabb; background: #fff;
  cursor: pointer; font-size: 14.5px; user-select: none;
}
.chip input:checked + span { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.chip.g-excellent input:checked + span { background: #2e7d4f; border-color: #2e7d4f; }
.chip.g-very_good input:checked + span { background: var(--blue); border-color: var(--blue); }
.chip.g-good input:checked + span { background: #d9b01e; border-color: #d9b01e; color: #1c1c1c; }
.chip.g-redo input:checked + span, .chip.g-needs_improvement input:checked + span, .chip.g-incomplete input:checked + span { background: #d9771e; border-color: #d9771e; }
.chip.g-not_recited input:checked + span, .chip.g-none input:checked + span { background: #7d7d7d; border-color: #7d7d7d; }
.chip.g-complete input:checked + span { background: #2e7d4f; border-color: #2e7d4f; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 40px; padding: 4px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); }
.error-box { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.info-box { background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14.5px; }
.ok-box { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.section-title { font-weight: 700; color: var(--green); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 18px; background: var(--gold); border-radius: 2px; }

/* مفاتيح/قيم */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat { background: #faf9f5; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat .v { font-size: 1.25rem; font-weight: 700; color: var(--green); }
.stat .k { font-size: 12.5px; color: var(--muted); }

/* جداول (للكمبيوتر فقط؛ الهاتف يستخدم القوائم) */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; background: #faf9f5; }

details.more > summary { cursor: pointer; color: var(--green-2); font-weight: 600; min-height: 40px; display: flex; align-items: center; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '＋'; margin-left: 6px; }
details.more[open] > summary::before { content: '－'; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.tabs a, .tabs button {
  white-space: nowrap; padding: 6px 14px; min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text);
  text-decoration: none; cursor: pointer; font-size: 14.5px; display: inline-flex; align-items: center;
}
.tabs .active { background: var(--green); color: #fff; border-color: var(--green); }
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { width: auto; min-width: 140px; flex: 1; }

.tz-note { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.day-head { font-weight: 700; color: var(--green); margin: 14px 0 6px; }
.time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 50px; color: var(--green); }

/* نافذة منبثقة */
.modal-back { position: fixed; inset: 0; background: rgba(20,30,25,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 16px; } }
.modal h2 { display: flex; justify-content: space-between; align-items: center; }

#toast {
  position: fixed; bottom: 80px; right: 16px; left: 16px; z-index: 60; display: flex; justify-content: center; pointer-events: none;
}
#toast div { background: #1c2420; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 520px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#toast div.err { background: var(--danger); }

/* شاشة الدخول */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 24px 20px; }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; }
.auth .logo img { width: 84px; height: 84px; object-fit: contain; }
.auth .logo b { font-size: 1.3rem; color: var(--green); }

.hide-mobile { display: none; }
@media (min-width: 700px) { .hide-mobile { display: initial; } .show-mobile { display: none; } }

/* ===== تقرير المتابعة (الشاشة وPDF) — نفس التصميم في الحالتين ===== */
.report-view { margin-bottom: 12px; overflow-x: auto; }
.report-view .sheet { box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid var(--line); border-radius: var(--radius); }
.print-wrap { min-height: 100vh; background: #e9e6dc; padding: 12px 12px 40px; }
.print-bar { max-width: 148mm; margin: 0 auto 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sheet {
  --pg: #0a5a3c; --pg2: #06402a; --pgold: #c49a3c; --pgold2: #e3c36f; --pcream: #fbf7ec; --pline: #eadfc6; --pink: #1d2622;
  font-family: var(--font);
  width: 100%; max-width: 148mm; margin: 0 auto; background: #fffdf8; padding: 8mm 8mm 7mm; color: var(--pink);
  font-size: 10pt; line-height: 1.55; box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* رأس التقرير: شريط أخضر بزخرفة هندسية ذهبية خفيفة */
.p-head {
  position: relative; display: flex; align-items: center; gap: 4mm; padding: 2mm 4.5mm; border-radius: 3.5mm; overflow: hidden;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23d9b35c' stroke-opacity='.22' stroke-width='1'%3E%3Cpath d='M22 6l4.7 11.3L38 22l-11.3 4.7L22 38l-4.7-11.3L6 22l11.3-4.7z'/%3E%3Crect x='12' y='12' width='20' height='20' transform='rotate(45 22 22)'/%3E%3Crect x='12' y='12' width='20' height='20'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 11mm 11mm, linear-gradient(120deg, var(--pg) 0%, var(--pg2) 100%);
  box-shadow: inset 0 -1.2mm 0 var(--pgold);
  margin-bottom: 3mm;
}
.p-medal {
  flex-shrink: 0; width: 14mm; height: 14mm; border-radius: 50%; background: #fffdf8; display: grid; place-items: center;
  box-shadow: 0 0 0 .8mm var(--pgold), 0 0 0 1.6mm rgba(255,255,255,.18);
}
.p-medal img { width: 11mm; height: 11mm; object-fit: contain; }
.p-head h1 { margin: 0; color: #fff; font-size: 15pt; font-weight: 800; letter-spacing: 0; line-height: 1.3; }
.p-head h1::after { content: ''; display: block; width: 16mm; height: .9mm; margin-top: 1mm; border-radius: 1mm; background: linear-gradient(90deg, var(--pgold2), var(--pgold)); }

/* بطاقة البيانات */
.p-info {
  display: grid; grid-template-columns: 1fr auto; gap: 1.2mm 6mm; align-items: center;
  background: #fff; border: 1px solid var(--pline); border-radius: 3mm; padding: 2mm 4.5mm; margin-bottom: 3mm; break-inside: avoid;
  box-shadow: inset -1.3mm 0 0 var(--pgold);
}
.p-info .k { color: #6a716c; font-weight: 600; margin-left: 1.8mm; font-size: 9pt; }
.p-info-main { min-width: 0; overflow-wrap: anywhere; font-size: 9.8pt; font-weight: 600; }
.p-info-side { display: flex; align-items: center; justify-content: flex-start; white-space: nowrap; font-size: 9.5pt; }
.p-name { color: var(--pg); font-size: 13pt; font-weight: 800; line-height: 1.4; }
.p-date { font-weight: 700; unicode-bidi: isolate; color: var(--pink); }
/* رقم الحصة داخل نجمة ثمانية ذهبية */
.p-star { position: relative; display: inline-grid; place-items: center; width: 10.5mm; height: 10.5mm; margin: .8mm 1mm; }
.p-star::before, .p-star::after { content: ''; position: absolute; inset: 1.4mm; border-radius: .8mm; background: linear-gradient(135deg, var(--pgold2), var(--pgold)); }
.p-star::after { transform: rotate(45deg); }
.p-star b { position: relative; z-index: 1; color: #fff; font-size: 11.5pt; font-weight: 800; text-shadow: 0 .2mm .4mm rgba(0,0,0,.25); }
.p-badge.trial { display: inline-block; padding: .8mm 3mm; border-radius: 999px; background: linear-gradient(135deg, var(--pgold2), var(--pgold)); color: #2a2206; font-weight: 800; font-size: 9pt; }

/* جدول القرآن */
.p-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 3mm; font-size: 9.6pt; border: 1px solid var(--pline); border-radius: 3mm; overflow: hidden; background: #fff; }
.p-table thead th { background: linear-gradient(120deg, var(--pg), var(--pg2)); color: #fff; font-weight: 700; padding: 2mm 3mm; text-align: right; font-size: 9.2pt; }
.p-table thead th + th { border-right: 1px solid rgba(255,255,255,.15); }
.p-table tbody th { background: var(--pcream); color: var(--pg); font-weight: 800; width: 28%; text-align: right; white-space: normal; }
.p-table tbody th::before { content: ''; display: inline-block; width: 1.6mm; height: 1.6mm; background: var(--pgold); transform: rotate(45deg); margin-left: 2mm; vertical-align: middle; }
.p-table td, .p-table tbody th { padding: 1.5mm 2.5mm; vertical-align: middle; border-top: 1px solid var(--pline); }
.p-table td { border-right: 1px solid var(--pline); }
.p-table tbody tr:nth-child(even) td { background: #fffcf4; }
.p-table tr { break-inside: avoid; }
.p-amount { text-align: center; width: 45%; font-weight: 600; }
.p-grade { text-align: center; }
.p-redo { font-size: 7.6pt; line-height: 1.35; color: #9a5412; margin-top: .6mm; font-weight: 600; }

/* بطاقات الأقسام */
.p-card { background: #fff; border: 1px solid var(--pline); border-radius: 3mm; margin-bottom: 2.2mm; }
.p-card > .p-card-h { border-radius: 3mm 3mm 0 0; }
.p-inline > .p-card-h { border-radius: 0 3mm 3mm 0; }
.p-card-h {
  display: flex; align-items: center; gap: 1.8mm; color: var(--pg); font-weight: 800; font-size: 9.8pt; padding: 1.2mm 3.5mm;
  background: linear-gradient(270deg, #f4eedd 0%, #fffdf8 85%); border-bottom: 1px solid var(--pline);
  break-after: avoid; page-break-after: avoid;
}
.p-sec-ico { display: inline-flex; width: 3.4mm; height: 3.4mm; color: var(--pgold); flex-shrink: 0; }
.p-sec-ico svg { width: 100%; height: 100%; }
.p-card-b { padding: 1.6mm 4mm; }
.p-inline { display: flex; align-items: center; }
.p-inline .p-card-h { flex: 1; border-bottom: 0; }
.p-inline-end { padding: 1.4mm 3.5mm; }
.p-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.p-list { margin: 0; padding: 0; list-style: none; }
.p-list li { position: relative; padding-right: 4.5mm; margin: .7mm 0; overflow-wrap: anywhere; }
.p-list li::before { content: ''; position: absolute; right: .6mm; top: .62em; width: 1.7mm; height: 1.7mm; background: var(--pgold); transform: rotate(45deg); border-radius: .2mm; }
.p-subj + .p-subj { margin-top: 2.4mm; padding-top: 2.4mm; border-top: 1px dashed var(--pline); }
.p-subj h4 { display: inline-block; margin: 0 0 1.2mm; color: var(--pg); font-size: 9.6pt; font-weight: 800; background: #eef5f0; padding: .3mm 3mm; border-radius: 999px; break-after: avoid; }

/* ٤٢٣ (النوتة ٢): أقسام مرقّمة، والواجب مميز، وختم التقدير */
.p-n { display: inline-grid; place-items: center; width: 4.6mm; height: 4.6mm; border-radius: 50%; background: var(--pg); color: #fff; font-size: 8pt; font-weight: 800; flex-shrink: 0; }
.p-hw { border-color: #e6d3a3; box-shadow: inset -1.1mm 0 0 var(--pgold); }
.p-hw .p-card-b { background: #fdf8ea; border-radius: 0 0 3mm 3mm; }
.p-prev { display: flex; align-items: center; justify-content: space-between; gap: 3mm; padding-bottom: 1.6mm; margin-bottom: 1.6mm; border-bottom: 1px dashed var(--pline); }
.p-prev b { color: var(--pg); font-size: 9.6pt; }
.p-info.has-stamp { position: relative; padding-left: 23mm; }
.p-stamp { position: absolute; left: 2mm; top: 50%; margin-top: -9mm; width: 18mm; height: 18mm; border-radius: 50%; border: .9mm double; display: grid; place-content: center; text-align: center; transform: rotate(-8deg); line-height: 1.25; }
.p-stamp b { font-size: 10.5pt; font-weight: 800; }
.p-stamp span { font-size: 6.6pt; font-weight: 600; opacity: .9; }
.p-stamp.s-gold { color: #946f1d; border-color: var(--pgold); background: #fbf3dc; }
.p-stamp.s-green { color: #1f6a47; border-color: #4f9873; background: #eaf4ee; }
.p-stamp.s-grey { color: #5a5f5c; border-color: #b9bcb8; background: #f4f4f3; }

/* التقييمات */
.p-chip { display: inline-flex; align-items: center; gap: 1.3mm; padding: .7mm 3.2mm .7mm 3.6mm; border-radius: 999px; border: 1px solid; font-weight: 800; font-size: 9pt; white-space: nowrap; line-height: 1.5; }
.p-ico { display: inline-flex; width: 3.1mm; height: 3.1mm; }
.p-ico svg { width: 100%; height: 100%; }
.p-chip.t-excellent { color: #0f6a3a; background: linear-gradient(135deg, #e6f6ec, #d3eedd); border-color: #86c9a0; }
.p-chip.t-very_good { color: #1b58a3; background: linear-gradient(135deg, #eaf2fd, #d9e7fa); border-color: #95b7e6; }
.p-chip.t-good { color: #7a5800; background: linear-gradient(135deg, #fff8dc, #fdeeb3); border-color: #e2c55a; }
.p-chip.t-warn { color: #a44a00; background: linear-gradient(135deg, #fff0e2, #fde0c6); border-color: #eeac72; }
.p-chip.t-grey { color: #5a5f5c; background: linear-gradient(135deg, #f4f4f3, #e8e8e6); border-color: #c8c8c4; }
.p-eval .p-inline-end { padding: 1.4mm 3.5mm; }
.p-eval .p-chip { font-size: 10.5pt; padding: 1mm 4.5mm 1mm 5mm; gap: 1.6mm; box-shadow: 0 .4mm 1.2mm rgba(0,0,0,.06); }
.p-eval .p-ico { width: 3.8mm; height: 3.8mm; }

.p-foot { margin-top: 2.5mm; text-align: center; break-inside: avoid; }
.p-foot span {
  display: inline-block; font-size: 7.8pt; color: var(--pg); font-weight: 600; padding: 1mm 5mm; border-radius: 999px; font-family: var(--font-deco); /* ٤٨٠ */
  background: var(--pcream); border: 1px solid var(--pline);
}

@page { size: A5 portrait; margin: 7mm 8mm 10mm; @bottom-center { content: "صفحة " counter(page, arabic-indic) " من " counter(pages, arabic-indic); font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 7.5pt; color: #8a8a8a; } }
@media print {
  html, body { background: #fff !important; }
  .print-bar, #toast { display: none !important; }
  .print-wrap { padding: 0; background: #fff; min-height: 0; }
  .sheet { max-width: none; padding: 0; box-shadow: none; background: #fff; }
}
@media screen and (max-width: 520px) {
  .sheet { padding: 5mm 4mm; }
  .p-info { grid-template-columns: 1fr; }
  .p-info-main:nth-of-type(3) { order: 2; }
  .p-info-side { order: 3; }
  .p-table thead th, .p-table td, .p-table tbody th { padding: 1.5mm 2mm; }
}
/* مربع تقييم الحصة */
.p-eval-rows { display: grid; gap: 1.6mm; padding: 2.2mm 4mm; }
.p-eval-row { display: flex; align-items: center; justify-content: space-between; gap: 3mm; }
.p-eval-row + .p-eval-row { padding-top: 1.6mm; border-top: 1px dashed var(--pline); }
.p-eval-k { font-weight: 700; color: #3b4540; font-size: 9.6pt; }
.p-eval .p-chip { font-size: 10pt; padding: .9mm 4mm .9mm 4.5mm; gap: 1.5mm; box-shadow: 0 .4mm 1.2mm rgba(0,0,0,.06); }
.p-eval .p-ico { width: 3.6mm; height: 3.6mm; }
.p-eval-sub { color: #6a716c; font-weight: 600; font-size: 8.8pt; }
.p-eval-sub::before { content: '·'; margin: 0 1.5mm; color: var(--pgold); font-weight: 800; }

.credit { text-align: center; font-size: 12px; color: var(--muted); padding: 14px 8px 4px; letter-spacing: .2px; }
.auth > .credit { padding-top: 12px; }
@media print { .credit { display: none; } }

/* ===== الخط والنصوص ===== */
.btn { font-weight: 700; }
.field > label, .field > .label { font-weight: 700; }
.bottomnav a { font-weight: 600; font-size: 12.5px; }
.sidenav a { font-weight: 600; }
.time { font-weight: 800; }
.stat .v { font-weight: 800; }
.section-title { font-weight: 800; }

/* ===== ألوان الحالات (ثابتة في كل الشاشات) ===== */
.pill { font-weight: 700; border: 1px solid transparent; padding: 2px 10px 2px 11px; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; flex-shrink: 0; }
.pill.green { background: #e2f3e8; color: #16663a; border-color: #b7dcc4; }
.pill.gold { background: #fbf0d4; color: #7a5a0e; border-color: #ecd49a; }
.pill.warn { background: #fde8d6; color: #a2470a; border-color: #f1bf94; }
.pill.red { background: #fbe3e1; color: #a8231b; border-color: #efb3ad; }
.pill.blue { background: #e3eefb; color: #1d58a0; border-color: #b3cdee; }
.pill.purple { background: var(--purple-soft); color: var(--purple); border-color: #d4c1ee; }
.pill.grey { background: #eeeeec; color: #666; border-color: #d6d6d2; }

/* شريط لوني بجانب الحصة في القوائم */
.lesson-item { border-inline-start: 5px solid transparent; }
.lesson-item.tone-green { border-inline-start-color: #2e8b57; }
.lesson-item.tone-gold { border-inline-start-color: #d4a93a; background: #fffcf3; }
.lesson-item.tone-purple { border-inline-start-color: var(--purple); background: #fbf8ff; }
.lesson-item.tone-blue { border-inline-start-color: #3b7fd0; background: #f7fafe; }
.lesson-item.tone-red { border-inline-start-color: #c9372c; background: #fff7f6; }
.lesson-item.tone-warn { border-inline-start-color: #e07b24; background: #fffaf5; }
.lesson-item.tone-grey { border-inline-start-color: #b9b9b4; opacity: .75; }

/* بطاقات مهام اليوم حسب نوعها */
.task { border-right: 5px solid var(--gold); }
.task.tone-gold { border-right-color: #d4a93a; }
.task.tone-warn { border-right-color: #e07b24; }
.task.tone-red { border-right-color: #c9372c; }
.task.tone-purple { border-right-color: var(--purple); }
.task.tone-blue { border-right-color: #3b7fd0; }
.task.tone-green { border-right-color: #2e8b57; }
.task .count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 15px; background: var(--green-soft); padding: 0 8px; }
.task.tone-red .count { background: #fbe3e1; color: #a8231b; }
.task.tone-warn .count { background: #fde8d6; color: #a2470a; }
.task.tone-purple .count { background: var(--purple-soft); color: var(--purple); }
.task.tone-blue .count { background: #e3eefb; color: #1d58a0; }
.task.tone-gold .count { background: #fbf0d4; color: #7a5a0e; }

/* شريط تنبيه أعلى صفحة الحصة */
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid; border-inline-start-width: 6px; }
.alert b { display: block; font-size: 1.05rem; font-weight: 800; margin-bottom: 2px; }
.alert.tone-red { background: #fff4f3; border-color: #efb3ad; border-inline-start-color: #c9372c; color: #8f1e17; }
.alert.tone-blue { background: #f3f8fe; border-color: #b3cdee; border-inline-start-color: #3b7fd0; color: #174d8d; }
.alert.tone-warn { background: #fff7ef; border-color: #f1bf94; border-inline-start-color: #e07b24; color: #8e3f08; }
.alert.tone-purple { background: #faf6ff; border-color: #d4c1ee; border-inline-start-color: var(--purple); color: #542f86; }
.alert.tone-grey { background: #f6f6f4; border-color: #d6d6d2; border-inline-start-color: #9a9a95; color: #555; }
.alert .small { color: inherit; opacity: .9; }

/* دليل الألوان */
.legend { margin: 4px 0 14px; }
.legend > summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; list-style: none; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.legend > summary::-webkit-details-marker { display: none; }
.legend > summary::before { content: ''; width: 34px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #2e8b57 0 20%, #d4a93a 20% 40%, #6a3fa5 40% 60%, #3b7fd0 60% 80%, #c9372c 80%); }
.legend-items { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }

/* ===== كلمة المرور: إظهار/إخفاء + مؤشر القوة ===== */
.pw-box { position: relative; }
.pw-box .input { padding-left: 48px; }
.pw-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--green); background: var(--green-soft); }
.pw-meter { margin-top: 8px; }
.pw-row { display: flex; align-items: center; gap: 10px; }
.pw-bar { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pw-bar i { height: 6px; border-radius: 3px; background: var(--line); transition: background .2s; }
.pw-meter[data-level="1"] .pw-bar i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-bar i:nth-child(-n+2) { background: var(--gold); }
.pw-meter[data-level="3"] .pw-bar i { background: var(--green-2); }
.pw-label { font-size: 13px; font-weight: 700; min-width: 3.5em; }
.pw-meter[data-level="1"] .pw-label { color: var(--danger); }
.pw-meter[data-level="2"] .pw-label { color: var(--warn); }
.pw-meter[data-level="3"] .pw-label { color: var(--green-2); }
.pw-rules { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.pw-rules li::before { content: '○ '; }
.pw-rules li.ok { color: var(--green-2); }
.pw-rules li.ok::before { content: '✓ '; }
/* ===== زر جوجل ===== */
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-google:hover { background: var(--bg); }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.choice-row { display: grid; gap: 8px; }

/* ===== واتساب ===== */
.wa-card .wa-text { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; line-height: 1.8; }
.wa-actions { gap: 8px; flex-wrap: wrap; }
.wa-btn { background: #1f8f4e; display: inline-flex; align-items: center; gap: 6px; }
.wa-btn:hover { background: #18773f; }
.wa-summary { display: block; text-decoration: none; color: inherit; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.red-text { color: var(--danger); }
.wa-card .row.between { flex-wrap: wrap; gap: 6px; }

.pay-view { margin-top: 8px; }
.pay-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pay-form { margin-top: 12px; }

/* ===== لمسات احترافية: المزيد، لوحة اليوم ===== */
.more-item { gap: 12px; }
.more-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.more-ic svg { width: 20px; height: 20px; }
.hello { font-size: 15px; color: var(--muted); margin: -8px 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--green-2); transform: translateY(-1px); }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi .v { font-size: 1.45rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi.green .ic { background: var(--green-soft); color: var(--green); }
.kpi.gold .ic { background: var(--gold-soft); color: #8a6a1f; }
.kpi.red .ic { background: var(--danger-soft); color: var(--danger); }
.kpi.blue .ic { background: var(--blue-soft); color: var(--blue); }
@media (min-width: 1100px) {
  .tasks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .tasks-grid > .card { margin-bottom: 0; }
}
@media (max-width: 699px) {
  .kpi { padding: 10px; gap: 9px; }
  .kpi .ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi .ic svg { width: 18px; height: 18px; }
  .kpi .v { font-size: 1.2rem; }
  .kpi .k { font-size: 12px; line-height: 1.4; }
}

.push-card { border-color: var(--gold); background: linear-gradient(0deg, var(--surface), var(--gold-soft)); }
.push-card b svg { width: 18px; height: 18px; vertical-align: -3px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; font: inherit; }

/* ===== البحث السريع ===== */
.topsearch { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; min-height: 40px; padding: 0 12px; cursor: pointer; font: inherit; font-size: 14px; }
.topsearch:hover { background: rgba(255,255,255,.2); }
.topsearch kbd { font-family: inherit; font-size: 11px; background: rgba(0,0,0,.18); border-radius: 5px; padding: 1px 6px; direction: ltr; }
@media (min-width: 900px) { .topsearch { min-width: 260px; } }
.search-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,25,.45); display: flex; justify-content: center; align-items: flex-start; padding: 70px 12px 12px; }
.search-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-height: calc(100vh - 100px); overflow-y: auto; }
.search-ic { color: var(--muted); display: inline-flex; }
.search-results { margin-top: 10px; }
.search-results .list { margin: 0; }
.search-hint { padding: 12px 6px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.quick .btn { display: inline-flex; align-items: center; gap: 6px; }

.section-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -4px 0 14px; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs a { white-space: nowrap; padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.section-tabs a.active { color: var(--green); border-bottom-color: var(--gold); }
.section-tabs a:hover { color: var(--green); }

.section-row { margin-top: 6px; }
.section-row .section-title { margin: 8px 0; }
.tasks-grid .wa-card { margin-bottom: 12px; }
@media (min-width: 1100px) { .tasks-grid .wa-card { margin-bottom: 0; } .tasks-grid + .section-row, .tasks-grid + .section-title { margin-top: 14px; } }

.wa-card .wa-text { overflow-wrap: anywhere; word-break: break-word; }
.wa-details summary { cursor: pointer; color: var(--green-2); font-size: 13px; margin: 8px 0 0; }
.wa-details[open] summary { margin-bottom: 0; }
main { overflow-x: hidden; }

/* ===== خطة الحفظ والمستوى ===== */
.plan-range { font-weight: 700; margin: 10px 0 8px; }
.plan-bar { position: relative; height: 12px; background: var(--line); border-radius: 8px; overflow: visible; margin: 6px 0; }
.plan-fill { height: 100%; border-radius: 8px; background: var(--green-2); transition: width .4s; }
.plan-fill.tone-red { background: var(--danger); } .plan-fill.tone-blue { background: var(--blue); } .plan-fill.tone-gold { background: var(--gold); }
.plan-mark { position: absolute; top: -4px; width: 3px; height: 20px; background: #1c2420; border-radius: 2px; transform: translateX(50%); }
.plan-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; margin: 6px 0; }
.plan-card .alert { margin-top: 8px; }
.levels { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.level { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.level-v { margin: 6px 0; } .level-v .num { font-size: 1.6rem; font-weight: 800; color: var(--green); } .level-v small { color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin: 4px 0; }
.spark i { flex: 1; background: var(--green-soft); border-top: 3px solid var(--green-2); border-radius: 3px 3px 0 0; min-height: 4px; }
.plan-list { display: grid; gap: 10px; margin-top: 10px; }
@media (min-width: 900px) { .plan-list { grid-template-columns: 1fr 1fr; } }
.plan-row { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.plan-row:hover { border-color: var(--green-2); }
.pos-picker select { width: 100%; }

/* ================= التصميم الجديد: هوية هادئة، قائمة منظمة، لوحة رئيسية ================= */
.page-head h1, .card > h2, .card .row > h2, .section-title, .hero-name, .drawer-name, .auth h1 { font-family: var(--font-head); letter-spacing: 0; }
.page-head h1 { font-size: 1.75rem; font-weight: 700; }
.card > h2, .card .row > h2 { font-size: 1.3rem; font-weight: 700; color: var(--green); }
.section-title { font-size: 1.35rem; font-weight: 700; }
.sheet, .sheet * { font-family: 'IBM Plex Sans Arabic', sans-serif; }
body { font-weight: 400; }
b, strong, .title { font-weight: 600; }

/* الشريط العلوي */
.topbar { gap: 8px; }
.topbar .brand span { font-family: var(--font-deco); font-size: 1.35rem; font-weight: 700; }
.show-mobile-inline { display: inline-grid; }
@media (min-width: 900px) { .show-mobile-inline { display: none; } }
.me-chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 4px 10px 4px 4px; border-radius: 30px; }
.me-chip:hover { background: rgba(255,255,255,.1); }
.me-chip b { display: block; font-size: 14px; line-height: 1.2; }
.me-chip small { display: block; font-size: 11.5px; opacity: .8; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; background: var(--gold-soft); color: var(--green); border: 2px solid var(--gold); flex-shrink: 0; font-size: 15px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; border-width: 1.5px; }

/* القائمة الجانبية (لاب) والمنزلقة (موبايل) */
.sidenav .label, .drawer-menu .label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 16px 14px 4px; }
.sidenav .label:first-child, .drawer-menu .label:first-child { padding-top: 4px; }
.drawer-back { position: fixed; inset: 0; z-index: 70; background: rgba(15,25,20,.45); display: flex; justify-content: flex-start; animation: fadeIn .15s; }
.drawer { width: min(320px, 86vw); height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.2); animation: slideIn .2s ease-out; border-radius: 0 0 0 22px; overflow: hidden; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { background: linear-gradient(135deg, #1f4d3a, #2c7a5a); color: #fff; padding: 22px 18px 18px; padding-top: max(22px, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: flex-start; border-radius: 0 0 0 22px; }
.drawer-head .iconbtn { background: rgba(255,255,255,.15); border-radius: 50%; min-width: 40px; min-height: 40px; font-size: 16px; }
.drawer-name { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.drawer-role { font-size: 14px; opacity: .9; }
.drawer-date { font-size: 12px; opacity: .75; margin-top: 4px; }
.drawer-menu { flex: 1; overflow-y: auto; padding: 8px 12px; }
.drawer-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 16px; }
.drawer-menu a svg { width: 21px; height: 21px; color: var(--green-2); }
.drawer-menu a.active { background: var(--green-soft); color: var(--green); font-weight: 600; }
.drawer-menu .credit { margin-top: 18px; }
.drawer-logout { display: flex; align-items: center; gap: 10px; margin: 0 12px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--danger); font: inherit; cursor: pointer; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.drawer-logout svg { width: 20px; height: 20px; }
.bottomnav button { flex: 1; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; }
@media (max-width: 899px) { .topsearch { padding: 0 10px; min-height: 40px; } }

/* لوحة البداية (hero) */
.hero { background: radial-gradient(120% 140% at 100% 0%, #2f8a64 0%, #1f5f46 45%, #18473a 100%); color: #fff; border-radius: 22px; padding: 20px; margin-bottom: 18px; position: relative; overflow: hidden; box-shadow: 0 12px 30px rgba(31,77,58,.18); }
.hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 12px, transparent 12px 24px); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-logo { width: 62px; height: 62px; border-radius: 50%; background: #f7f1e1; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.35); flex-shrink: 0; }
.hero-logo img { width: 46px; height: 46px; object-fit: contain; }
.hero-greet { font-size: 14px; opacity: .85; }
.hero-name { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.hero-date { font-size: 13px; opacity: .8; margin-top: 2px; }
.hero-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
@media (min-width: 760px) { .hero-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hero-tile { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 14px 10px; text-align: center; color: #fff; text-decoration: none; transition: background .15s; }
a.hero-tile:hover { background: rgba(255,255,255,.18); }
.hero-tile .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-tile .k { font-size: 13px; opacity: .9; margin-top: 4px; }
.hero-tile.alert-tile { background: rgba(255,214,140,.2); border-color: rgba(255,214,140,.5); }
.hero-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); text-align: center; }
.hero-mini .k { font-size: 12px; opacity: .8; }
.hero-mini .v { font-size: 1.05rem; font-weight: 700; }
.hero-mini .v.gold { color: #f3d68b; }

/* طلابي: دوائر */
.students-strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.stu { flex: 0 0 auto; width: 88px; text-align: center; text-decoration: none; color: inherit; }
.stu .ring { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--ring) calc(var(--p) * 1%), #e8e4d8 0); position: relative; }
.stu .ring .avatar { width: 62px; height: 62px; font-size: 18px; border: 0; background: var(--surface); }
.stu .badge { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #1c2420; color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; }
.stu .nm { font-size: 13px; margin-top: 10px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stu .st { font-size: 11px; }
.empty-state { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty-state svg { width: 46px; height: 46px; color: #9aa59f; display: block; margin: 0 auto 8px; }
.tz-foot { margin-top: 18px; text-align: center; }
.hero + .quick { margin-top: -4px; }

@media (max-width: 699px) {
  .me-chip { display: none; }
  .topbar .brand span { font-size: 1.15rem; white-space: nowrap; }
  .topbar .brand img { width: 32px; height: 32px; }
  .hero { padding: 16px; border-radius: 18px; }
  .hero-name { font-size: 1.55rem; }
  .hero-logo { width: 52px; height: 52px; } .hero-logo img { width: 38px; height: 38px; }
  .hero-tile { padding: 12px 8px; } .hero-tile .v { font-size: 1.6rem; }
  .hero-mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 699px) { .hero-mini:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================= لمسة احترافية نهائية: هدوء، مسافات، ظلال خفيفة، تسلسل خطوط واضح ================= */
:root { --bg: #f6f5f1; --line: #e7e3d8; --muted: #66706a; --radius: 14px; --shadow: 0 1px 2px rgba(20,40,30,.04), 0 4px 14px rgba(20,40,30,.05); }
body { font-size: 15.5px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
/* العناوين: النسخ للعناوين الكبيرة فقط، والباقي خط واضح */
.page-head h1 { font-family: var(--font-head); font-size: 1.85rem; font-weight: 700; color: #183f30; }
.card > h2, .card .row > h2 { font-family: var(--font); font-size: 1.05rem; font-weight: 700; color: #183f30; }
.section-title { font-family: var(--font); font-size: 1.05rem; font-weight: 700; color: #183f30; }
.section-title::before { height: 16px; }
.item .title { font-weight: 600; }
.item .sub, .muted { color: var(--muted); }
/* البطاقات والقوائم */
.card, .list, .kpi { border-color: var(--line); box-shadow: var(--shadow); }
.card { padding: 16px 18px; }
.item { padding: 13px 16px; }
.item:hover { background: #fbfaf6; }
.btn { border-radius: 10px; font-weight: 600; letter-spacing: 0; }
.btn.sm { min-height: 38px; }
.input { border-radius: 10px; border-color: #ddd8cb; }
.input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(44,106,80,.12); outline: none; }
.pill { font-weight: 600; }
/* الشريط العلوي: أبيض هادئ بدل الأخضر الثقيل */
.topbar { background: rgba(255,255,255,.92); color: var(--text); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.topbar .brand { color: #183f30; }
.topbar .iconbtn { color: #183f30; }
.topbar .iconbtn:hover { background: var(--green-soft); }
.topsearch { background: #f3f1ea; color: var(--muted); border: 1px solid var(--line); }
.topsearch:hover { background: #ece9df; }
.topsearch kbd { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.me-chip { color: var(--text); }
.me-chip:hover { background: #f3f1ea; }
.badge-dot { background: var(--danger); color: #fff; }
/* القائمة الجانبية: لوحة بيضاء مستقلة */
@media (min-width: 900px) {
  .sidenav { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin: 18px 0 18px 0; padding: 14px 10px 18px; box-shadow: var(--shadow); top: 80px; max-height: calc(100vh - 100px); }
  .sidenav a { font-weight: 500; font-size: 15px; }
  .sidenav a.active { background: var(--green-soft); color: #183f30; font-weight: 700; box-shadow: inset -3px 0 0 var(--gold); }
  .layout { gap: 8px; padding: 0 12px; }
}
/* اللوحة الرئيسية */
.hero { border-radius: 24px; padding: 22px 22px 18px; }
.hero-name { font-family: var(--font-head); }
.hero-tile { border-radius: 16px; backdrop-filter: blur(2px); }
.hero-tile .v { font-family: var(--font); font-weight: 700; }
.quick .btn { box-shadow: var(--shadow); }
.task { box-shadow: var(--shadow); }
@media (min-width: 900px) { .sidenav a { padding: 8px 12px; margin-bottom: 1px; } .sidenav .label { padding: 12px 14px 2px; } }

/* شريط «الدخول بحساب» */
.imp-bar { position: sticky; top: 0; z-index: 30; background: #b8923a; color: #1c1c1c; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; font-size: 14px; text-align: center; }
.imp-bar .btn { background: #1c2420; color: #fff; }
.impersonating .topbar { top: 46px; }

/* ================= الهوية النهائية: ألوان هادئة متناسقة، بدون زخارف زائدة ================= */
:root {
  --green: #1d4a3c;        /* الأخضر الأساسي: عميق وهادئ */
  --green-2: #2c6553;
  --green-soft: #eaf1ed;
  --gold: #a8843a;         /* لمسة ذهبية للعلامات المهمة فقط */
  --gold-soft: #f5efe1;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --line: #e5e5df;
  --text: #1b211e;
  --muted: #69726d;
  --danger: #b4372d; --danger-soft: #fbefed;
  --warn: #9a6512; --warn-soft: #fbf3e4;
  --blue: #2f5d8a; --blue-soft: #edf2f8;
  --purple: #5f4a8b; --purple-soft: #f2eff8;
  --shadow: 0 1px 2px rgba(16,24,20,.04);
}
body { background: var(--bg); color: var(--text); }
h1, .page-head h1 { color: var(--green); }
/* عناوين الأقسام: نص فقط بدون شرطة ملونة */
.section-title::before { display: none; }
.section-title { color: var(--text); font-size: 1rem; font-weight: 700; margin: 22px 0 10px; }
.card > h2, .card .row > h2 { color: var(--text); }
/* الشارات: هادئة بدون نقطة */
.pill::before { display: none; }
.pill { padding: 2px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: #d3e3da; }
.pill.gold { background: var(--gold-soft); color: #7a5f22; border-color: #eadfc2; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #efdcb8; }
.pill.red { background: var(--danger-soft); color: var(--danger); border-color: #f0d0cb; }
.pill.blue { background: var(--blue-soft); color: var(--blue); border-color: #d3dfec; }
.pill.purple { background: var(--purple-soft); color: var(--purple); border-color: #ddd5ec; }
.pill.grey, .pill:not([class*=" "]) { background: #f1f1ee; color: var(--muted); border-color: #e3e3dd; }
/* الأزرار */
.btn { background: var(--green); border-radius: 8px; box-shadow: none; }
.btn:hover { background: #163b30; }
.btn.secondary { background: var(--surface); color: var(--green); border: 1px solid #cfd8d3; }
.btn.secondary:hover { background: var(--green-soft); }
.quick .btn { box-shadow: none; }
/* البطاقات: حدود رفيعة وظل خفيف جدًا */
.card, .list, .kpi, .task { border-radius: 12px; box-shadow: var(--shadow); }
.task { border-inline-start-width: 3px; }
.count { background: #f1f1ee !important; color: var(--text) !important; }
/* اللوحة الرئيسية: لون واحد عميق بدون نقوش */
.hero { background: var(--green); border-radius: 16px; box-shadow: none; padding: 22px; }
.hero::after { display: none; }
.hero-logo { background: #fff; border: 0; }
.hero-greet { opacity: .75; font-size: 13px; }
.hero-name { font-size: 1.75rem; }
.hero-tile { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
a.hero-tile:hover { background: rgba(255,255,255,.12); }
.hero-tile.alert-tile { background: rgba(214,174,92,.16); border-color: rgba(214,174,92,.45); }
.hero-tile .v { font-size: 1.75rem; }
.hero-mini .v.gold { color: #e3c47e; }
/* القائمة والشريط العلوي */
.sidenav a.active { box-shadow: inset -3px 0 0 var(--green); background: var(--green-soft); color: var(--green); }
.drawer-head { background: var(--green); border-radius: 0; }
.drawer { border-radius: 0; }
.bottomnav a.active::before { background: var(--green); }
.bottomnav a.active { color: var(--green); }
.badge-dot { background: var(--danger); }
.imp-bar { background: #f5efe1; color: #5c4714; border-bottom: 1px solid #eadfc2; }
.imp-bar .btn { background: var(--green); }
/* واتساب: أخضر واتساب الرسمي فقط للزر */
.wa-btn { background: #1f8f4e; }
.wa-card .wa-text { background: #fafaf8; }
/* دليل الألوان وتلوين الصفوف: أهدأ */
.lesson-item.tone-red, .lesson-item.tone-blue, .lesson-item.tone-purple, .lesson-item.tone-warn { background: var(--surface) !important; }
.push-card { background: var(--surface); border-color: var(--line); }

/* تنزيل التطبيق + شريط واتساب */
.install-btn { display: inline-flex; align-items: center; gap: 6px; }
.install-btn svg { width: 18px; height: 18px; }
.install-card { border-color: #d3e3da; }
.install-card .row.between { gap: 10px; }
.drawer-install { padding: 0 12px 8px; }
.wa-strip { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.wa-strip:hover { border-color: #b9d2c4; }
.wa-strip-ic { width: 40px; height: 40px; border-radius: 10px; background: #e7f5ec; color: #1f8f4e; display: grid; place-items: center; flex-shrink: 0; }
.wa-strip-ic svg { width: 22px; height: 22px; }
.install-steps ol { padding-inline-start: 20px; line-height: 2; }
@media (max-width: 699px) {
  body { font-size: 15px; }
  main { padding: 12px 12px 92px; }
  .page-head h1 { font-size: 1.45rem; line-height: 1.35; }
  .card { padding: 14px; }
  .hero { padding: 16px; } .hero-name { font-size: 1.45rem; }
  .hero-tile .v { font-size: 1.45rem; } .hero-tile .k { font-size: 12px; }
  .quick { gap: 6px; } .quick .btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }
}

/* رأس اللوحة: الاسم ثم اللقب كشارة ثم التاريخ */
.hero-top .grow { min-width: 0; }
.hero-role { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; padding: 3px 12px; border-radius: 20px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.hero-date { font-size: 13px; opacity: .75; white-space: nowrap; align-self: flex-start; }
.hero > .hero-date { margin-top: 10px; }
@media (max-width: 699px) { .hero-date.hide-mobile { display: none; } }
@media (min-width: 700px) { .hero-date.show-mobile { display: none; } }
.me-chip small { color: var(--green-2); font-weight: 600; opacity: 1; }
.drawer-role { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 20px; background: rgba(255,255,255,.14); font-size: 13px; }

/* تذكيرات حصص اليوم */
.rem-card { border-color: #e9dcbc; }
.rem-card.has-urgent { border-color: #efc9c3; }
.rem-list { display: grid; gap: 8px; margin-top: 12px; }
.rem-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfa; }
.rem-row.urgent { background: var(--danger-soft); border-color: #efc9c3; }
.rem-time { min-width: 72px; font-weight: 700; color: var(--green); display: flex; flex-direction: column; line-height: 1.3; }
.rem-row.urgent .rem-time { color: var(--danger); }
.rem-time small { font-size: 11.5px; font-weight: 600; }
@media (min-width: 1100px) { .rem-list { grid-template-columns: 1fr 1fr; } }
.tpl-card summary { cursor: pointer; }
.tpl-card[open] summary { margin-bottom: 8px; }

.opening-box { border: 1px dashed #cfd8d3; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fafbf9; }
.opening-box summary { cursor: pointer; font-weight: 600; color: var(--green); }
.opening-box[open] summary { margin-bottom: 6px; }

/* ===== لوحة التميّز ===== */
.ring-score { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.ring-score svg { position: absolute; inset: 0; }
.ring-score .trk { fill: none; stroke: #ecece6; stroke-width: 7; }
.ring-score .val { fill: none; stroke: var(--green-2); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.ring-score.tone-gold .val { stroke: #b8923a; } .ring-score.tone-blue .val { stroke: var(--blue); } .ring-score.tone-warn .val { stroke: #c27a1a; } .ring-score.tone-grey .val { stroke: #c9c9c2; }
.ring-num { font-size: 1.3rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ring-num small { font-size: .7em; color: var(--muted); }
.exc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.exc-card { margin-bottom: 0; }
.exc-head { display: flex; align-items: center; gap: 14px; }
.exc-name { display: block; font-size: 1.05rem; }
.exc-head .pill { margin-top: 4px; display: inline-block; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: #fbf5e6; color: #7a5f22; border: 1px solid #ecdcb4; }
.badge-chip svg { width: 15px; height: 15px; }
.mbars { display: grid; gap: 8px; margin-top: 12px; }
.mbar { font-size: 13px; }
.mbar-trk { height: 6px; background: #efefe9; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.mbar-trk i { display: block; height: 100%; background: var(--green-2); border-radius: 4px; transition: width 1s ease; }
.exc-card.mine .mbars { margin-top: 0; }
.stars .podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: inherit; padding: 12px 10px; border-radius: 14px; min-width: 110px; border: 1px solid var(--line); background: #fcfcfa; }
.pod.rank-1 { background: linear-gradient(180deg, #fbf5e6, #fff); border-color: #ecdcb4; transform: translateY(-6px); box-shadow: 0 8px 20px rgba(168,132,58,.12); }
.pod-medal { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #a8843a; font-size: 13px; }
.pod-medal svg { width: 16px; height: 16px; }
.pod-name { font-weight: 600; font-size: 14px; text-align: center; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* ===== لوحة التميّز: ألوان المستويات ===== */
.lv-gold { --lv: #b8862b; --lv-bg: #fbf3e0; --lv-line: #ecd49a; }
.lv-green { --lv: #1f7a55; --lv-bg: #e3f3ea; --lv-line: #b7dcc4; }
.lv-blue { --lv: #2a63a8; --lv-bg: #e4edf8; --lv-line: #b3cdee; }
.lv-orange { --lv: #c4501f; --lv-bg: #fbe9df; --lv-line: #f1bf94; }
.lv-grey { --lv: #9aa09b; --lv-bg: #f1f1ee; --lv-line: #e0e0da; }
.lvl-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--lv-bg); color: var(--lv); border: 1px solid var(--lv-line); margin-top: 4px; }
.lvl-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--lv); }
.lvl-pill small { font-weight: 500; opacity: .8; }
.lvl-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.exc-card[class*="lv-"] { border-inline-start: 5px solid var(--lv); }
.mbars .mbar-trk i { background: var(--lv, var(--green-2)); }
.ring-score.tone-orange .val { stroke: #c4501f; } .ring-score.tone-silver .val { stroke: #8a9099; } .ring-score.tone-bronze .val { stroke: #a8673a; }
.ring-score.tone-green .val { stroke: #1f7a55; } .ring-score.tone-blue .val { stroke: #2a63a8; } .ring-score.tone-gold .val { stroke: #b8862b; }
.ring-score.tone-light .trk { stroke: rgba(255,255,255,.18); } .ring-score.tone-light .val { stroke: #e7c46e; } .ring-score.tone-light .ring-num, .ring-score.tone-light .ring-num small { color: #fff; }
.trend { display: inline-block; font-size: 12px; font-weight: 600; margin-inline-start: 8px; margin-top: 4px; }
.trend.up { color: #1f7a55; } .trend.down { color: #c4501f; } .trend.flat { color: var(--muted); }
.insight { font-size: 13px; color: var(--muted); background: var(--lv-bg, #f5f5f1); border-radius: 8px; padding: 6px 10px; margin-top: 10px; }
.insight.lv-orange { color: #a2400f; } .insight.lv-orange b { color: #a2400f; }
.insight.lv-gold { color: #7a5a0e; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 12px; }
.bdg { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 10px; border: 1px dashed #dcdcd4; background: #fafaf7; opacity: .78; min-width: 0; }
.bdg.on { border: 1px solid #ecd49a; background: linear-gradient(180deg, #fdf6e3, #fff); opacity: 1; }
.bdg-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ececE6; color: #9aa09b; flex-shrink: 0; }
.bdg.on .bdg-ic { background: #b8862b; color: #fff; box-shadow: 0 0 0 3px #f6e7bf; }
.bdg-ic svg { width: 16px; height: 16px; }
.bdg-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.bdg-body b { font-size: 12.5px; } .bdg-body small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.bdg-trk { height: 4px; background: #e8e8e2; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.bdg-trk i { display: block; height: 100%; background: #b8862b; border-radius: 3px; }
.spotlight { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: radial-gradient(120% 140% at 0% 0%, #2a6a55 0%, #1d4a3c 55%, #163a2f 100%); color: #fff; border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; position: relative; overflow: hidden; }
.spotlight::after { content: ""; position: absolute; inset-inline-start: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(231,196,110,.10); }
.spot-text { display: grid; gap: 6px; min-width: 0; position: relative; z-index: 1; }
.spot-kicker { display: inline-flex; align-items: center; gap: 6px; color: #e7c46e; font-weight: 700; font-size: 13px; }
.spot-kicker svg { width: 18px; height: 18px; }
.spot-name { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; line-height: 1.3; }
.spot-sub { opacity: .85; font-size: 13.5px; }
.spot-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.spot-badges span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: rgba(231,196,110,.16); color: #f3dc9f; }
.spot-badges svg { width: 13px; height: 13px; }
.spotlight .trend { margin: 0; } .spotlight .trend.up { color: #9fe0c0; } .spotlight .trend.down { color: #ffb68f; } .spotlight .trend.flat { color: rgba(255,255,255,.7); }
.pod.rank-2 { background: linear-gradient(180deg, #f1f2f4, #fff); border-color: #d5d8dd; }
.pod.rank-3 { background: linear-gradient(180deg, #f7ece3, #fff); border-color: #e3c6ad; }
.pod.rank-2 .pod-medal { color: #6f767f; } .pod.rank-3 .pod-medal { color: #a8673a; }
@media (max-width: 520px) { .spotlight { flex-direction: column-reverse; align-items: flex-start; } }

/* ===== تقرير الطالب: «ما أنجزه» و«المطلوب للحصة القادمة» ===== */
.p-band { display: flex; align-items: center; gap: 2mm; font-weight: 800; font-size: 10.5pt; margin: 1mm 0 2mm; break-after: avoid; }
.p-band-ic { display: inline-grid; place-items: center; width: 5.6mm; height: 5.6mm; border-radius: 50%; color: #fff; flex-shrink: 0; }
.p-band-ic svg { width: 3.4mm; height: 3.4mm; }
.p-done { color: #16663a; } .p-done .p-band-ic { background: #1f7a55; }
.p-todo { color: #8a5d0c; margin: 0 0 2mm; } .p-todo .p-band-ic { background: var(--pgold); }
.p-next { border: 1.4px dashed var(--pgold); background: #fdf6e3; border-radius: 3mm; padding: 2.6mm 3.5mm 2mm; margin: 3mm 0 2.4mm; break-inside: avoid; }
.p-next-b { display: grid; gap: 0; }
.p-next-row { display: grid; grid-template-columns: 26mm 1fr; gap: 2mm; padding: 1.5mm 0; border-top: 1px solid #efdcae; font-size: 9.6pt; align-items: baseline; }
.p-next-row:first-child { border-top: 0; }
.p-next-row .k { color: #7a5a0e; font-weight: 700; }
.p-next-row .v { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.p-next-row .v .p-text { white-space: pre-line; }
.p-next-row.redo .k { color: #a2470a; }
.p-journey { background: #f3f6f2; border-radius: 3mm; padding: 2.6mm 3.5mm; margin-bottom: 2.4mm; break-inside: avoid; font-size: 9pt; }
.pj-top { display: flex; flex-wrap: wrap; gap: 1mm 3mm; align-items: baseline; }
.pj-top b { color: var(--pg); font-size: 10pt; }
.pj-top .pj-pct { margin-inline-start: auto; font-weight: 800; color: #1f7a55; }
.pj-track { position: relative; height: 2.4mm; border-radius: 2mm; background: #dfe6e0; margin: 2.4mm 1.5mm 1.4mm; }
.pj-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 2mm; background: linear-gradient(90deg, #2c8a62, #1f7a55); }
.pj-track em { position: absolute; top: -1.2mm; width: 4.4mm; height: 4.4mm; border-radius: 50%; background: #fff; border: .9mm solid #1f7a55; transform: translateX(50%); }
.pj-stops { display: flex; justify-content: space-between; color: #6a716c; font-size: 8pt; }
.pj-cur { color: #1f7a55; font-weight: 700; }
.pj-fc { margin-top: 1.4mm; color: #4d5852; font-size: 8.4pt; }

/* ===== نموذج التقرير ===== */
.range-picker { display: grid; gap: 6px; }
.rp-row { display: flex; align-items: center; gap: 8px; }
.rp-row .rp-k { width: 26px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.rp-row .pos-picker { flex: 1; min-width: 0; }
.ward-due { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; background: #fbf3e0; border: 1px solid #ecd49a; color: #6d5210; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.ward-due span { font-size: 12.5px; color: #8a6a1c; }
.next-card { border: 1.5px dashed #d9b864; background: #fffcf3; }
.next-card > h2 { color: #7a5a0e; }

/* ===== رحلة الحفظ وخريطة المحفوظ (صفحة الطالب) ===== */
.jr-track { position: relative; height: 10px; border-radius: 99px; background: #e6e9e4; margin: 14px 6px 6px; }
.jr-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: #1f7a55; transition: width 1s ease; }
.jr-track em { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid #1f7a55; transform: translateX(50%); }
.jr-stops { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.jr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.jr-stat { background: #f5f6f2; border-radius: 10px; padding: 8px 10px; }
.jr-stat b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.jr-stat span { font-size: 12px; color: var(--muted); }
.pace { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: 6px; }
.pace i { flex: 1; max-width: 22px; background: #9fcfb7; border-radius: 3px 3px 0 0; min-height: 3px; }
.pace i:last-child { background: #1f7a55; }
.juz-map { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; direction: rtl; }
.juz-map button { aspect-ratio: 1; border-radius: 7px; border: 1px solid transparent; font: inherit; font-size: 12px; font-weight: 700; display: grid; place-items: center; cursor: default; background: #eeeee8; color: #9a9f9b; padding: 0; min-width: 0; }
.juz-map.editing button { cursor: pointer; }
.juz-map .st-strong { background: #1f7a55; color: #fff; }
.juz-map .st-stale { background: #ecca74; color: #4d3a08; }
.juz-map .st-weak { background: #c4501f; color: #fff; }
.juz-map .st-current { background: #fff; border: 2px solid #1f7a55; color: #1f7a55; }
.juz-map .st-pick { background: #2c6a55; color: #fff; }
.juz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.juz-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

/* ===== ملخص الباقة ===== */
.sum-sheet { --pg: #0a5a3c; max-width: 148mm; margin: 0 auto; background: #fffdf8; border-radius: 4mm; overflow: hidden; color: #1d2622; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sum-head { background: linear-gradient(135deg, #0a5a3c, #06402a); color: #fff; padding: 6mm 7mm 5mm; display: grid; gap: 1.5mm; box-shadow: inset 0 -1.2mm 0 #c49a3c; }
.sum-head .sum-top { display: flex; justify-content: space-between; align-items: center; gap: 3mm; font-size: 9pt; opacity: .9; }
.sum-head .sum-top img { width: 9mm; height: 9mm; object-fit: contain; background: #fff; border-radius: 50%; padding: .8mm; }
.sum-head h1 { margin: 0; font-family: var(--font-head); font-size: 17pt; line-height: 1.35; color: #fff; }
.sum-head .sum-meta { display: flex; flex-wrap: wrap; gap: 1mm 5mm; font-size: 9pt; opacity: .92; }
.sum-body { padding: 5mm 7mm 6mm; display: grid; gap: 4mm; }
.sum-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5mm; }
.sum-kpi { background: #f3f6f2; border-radius: 3mm; padding: 3mm 2mm; text-align: center; }
.sum-kpi b { display: block; font-family: var(--font-head); font-size: 15pt; color: #0a5a3c; font-variant-numeric: tabular-nums; line-height: 1.3; }
.sum-kpi span { font-size: 8.4pt; color: #5e6a63; }
.sum-sec h2 { font-family: var(--font-head); font-size: 10.5pt; color: #0a5a3c; margin: 0 0 2mm; display: flex; align-items: center; gap: 2mm; }
.sum-sec h2::before { content: ''; width: 1.8mm; height: 1.8mm; background: #c49a3c; transform: rotate(45deg); }
.sum-lines { display: grid; gap: 0; font-size: 9.6pt; border: 1px solid #eadfc6; border-radius: 3mm; overflow: hidden; }
.sum-lines div { display: flex; justify-content: space-between; gap: 3mm; padding: 2mm 3mm; border-top: 1px solid #f0e8d6; }
.sum-lines div:first-child { border-top: 0; }
.sum-lines span { color: #5e6a63; } .sum-lines b { text-align: left; }
.sum-hl { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.6mm; font-size: 9.8pt; }
.sum-hl li { display: flex; gap: 2mm; align-items: baseline; }
.sum-hl li::before { content: ''; flex-shrink: 0; width: 1.6mm; height: 1.6mm; border-radius: 50%; background: #1f7a55; transform: translateY(-.4mm); }
.sum-map { display: grid; grid-template-columns: repeat(10, 1fr); gap: 1.2mm; direction: rtl; }
.sum-map span { aspect-ratio: 1; border-radius: 1.4mm; display: grid; place-items: center; font-size: 7.5pt; font-weight: 700; background: #eeeee8; color: #a0a49f; }
.sum-map .st-strong { background: #1f7a55; color: #fff; } .sum-map .st-stale { background: #ecca74; color: #4d3a08; }
.sum-map .st-weak { background: #c4501f; color: #fff; } .sum-map .st-current { background: #fff; border: .5mm solid #1f7a55; color: #1f7a55; }
.sum-note { border-inline-start: 1mm solid #c49a3c; padding: 1mm 3mm; font-size: 9.6pt; background: #fdf8ea; border-radius: 0 2mm 2mm 0; }
.sum-note small { display: block; color: #7a6a3e; font-size: 8pt; }
.sum-tags { display: flex; flex-wrap: wrap; gap: 1.5mm; }
.sum-tags span { font-size: 8.8pt; padding: .8mm 2.6mm; border-radius: 99px; background: #eef4f0; color: #16663a; }
.sum-foot { text-align: center; font-size: 8pt; color: #7d847f; border-top: 1px solid #eee6d4; padding: 3mm; }
.sum-level { display: inline-block; padding: .6mm 3mm; border-radius: 99px; background: #c49a3c; color: #fff; font-weight: 700; font-size: 9pt; }
@media print { .sum-sheet { box-shadow: none; border-radius: 0; max-width: none; } }

.p-ward { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5mm 3mm; font-size: 9.6pt; }

/* زر الرجوع العام في الشريط العلوي (يحل محل روابط «رجوع» داخل الصفحات) */
.backbtn { flex-shrink: 0; }
.shell .back { display: none; }
.backbtn[hidden] { display: none !important; }

.sum-founder { font-family: var(--font-head); font-weight: 700; color: #0a5a3c; font-size: 9pt; margin-bottom: .6mm; }

.credit { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.6; }
/* ٤٨٠ (ندا ٢٦/١١: «توقيعي زي ما هو بس ادّيله لمسة بخط معيّن»): خط كوفي وخطين ذهبي رفيعين على الجنبين */
.credit-l1 { font-weight: 700; color: var(--green); font-size: 13.5px; font-family: var(--font-deco); letter-spacing: .3px; display: inline-flex; align-items: center; gap: 8px; }
.credit-l1::before, .credit-l1::after { content: ""; width: 22px; height: 1.5px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold)); }
.credit-l1::after { background: linear-gradient(90deg, var(--gold), transparent); }
.credit-l2 { font-size: .92em; opacity: .85; }

/* «المؤسِّسة»: الكسرة مع الشدة تظهر تحت الحرف في الخط الكوفي (في الخط العادي تُرسم فوقه فتلتبس بالفتحة) */
.hero-role, .drawer-role, .me-chip small, .credit-l2, .sum-founder, .credit, .kufi-ph::placeholder, .imp-bar b, .kufi { font-family: var(--font-head); }

/* ===== صفحة ولي الأمر ===== */
.portal { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 14px; }
.pt-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 860px) { .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pt-head { margin: 0; border-radius: 0 0 18px 18px; padding: 28px 28px 22px; } }
.pt-head { background: linear-gradient(135deg, #0a5a3c, #06402a); color: #fff; margin: 0 -16px; padding: 22px 20px 18px; display: grid; gap: 6px; box-shadow: inset 0 -4px 0 #c49a3c; }
.pt-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-deco); font-weight: 700; opacity: .92; }
.pt-brand img { width: 30px; height: 30px; background: #fff; border-radius: 50%; padding: 2px; }
.pt-head h1 { margin: 2px 0 0; font-family: var(--font-head); font-size: 1.6rem; color: #fff; line-height: 1.4; }
.pt-sys { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-sys span { font-size: 12.5px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.14); }
.pt-install { margin-top: 6px; }
.pt-install .btn { background: #fff; color: #0a5a3c; border-color: #fff; }
.pt-sec { margin: 0; }
.pt-sec > h2 { margin-top: 0; }
.pt-bal { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pt-bal-i { background: #f3f6f2; border-radius: 10px; padding: 10px 12px; display: grid; }
.pt-bal-i b { font-size: 1.5rem; color: #0a5a3c; font-variant-numeric: tabular-nums; }
.pt-bal-i span { font-size: 12.5px; color: var(--muted); }
.pt-link { background: #f5f5f1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere; }
.portal .sum-map { gap: 4px; }
.portal .sum-map span { font-size: 11px; border-radius: 6px; }

/* ===== نموذج تقرير القرآن الخفيف ===== */
.qf-steps-pill { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #f1f1ec; color: var(--muted); }
.qf-steps-pill.ok { background: #e3f3ea; color: #16663a; }
.qf-items { display: grid; gap: 8px; }
.qf-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.qf-item.on { border-color: #b7dcc4; background: #fbfdfb; }
.qf-item.missing, .card.missing { border-color: #e07b24 !important; box-shadow: 0 0 0 3px #fde8d6; }
.qf-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; }
.qf-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; font: inherit; font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; padding: 4px 0; }
.qf-plus { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #9fb5a9; display: grid; place-items: center; position: relative; flex-shrink: 0; }
.qf-plus::before, .qf-plus::after { content: ''; position: absolute; background: #5a7a6b; border-radius: 2px; }
.qf-plus::before { width: 10px; height: 2px; } .qf-plus::after { width: 2px; height: 10px; }
.qf-item.on .qf-plus { background: #1f7a55; border-color: #1f7a55; }
.qf-item.on .qf-plus::before, .qf-item.on .qf-plus::after { background: #fff; }
.qf-item.on .qf-plus::after { transform: rotate(45deg); width: 2px; height: 8px; top: 6px; left: 11px; }
.qf-item.on .qf-plus::before { transform: rotate(-45deg); width: 4px; height: 2px; top: 11px; left: 6px; }
.qf-item:not(.on) .chips { opacity: .55; }
.qf-item .chips { gap: 6px; }
.qf-item .chip span { padding: 5px 10px; font-size: 13px; }
.qf-body { display: none; padding: 0 12px 12px; gap: 8px; }
.qf-item.on .qf-body { display: grid; }
.qf-q { font-weight: 700; font-size: 14px; color: #1d4a3c; }
.qf-redo[hidden] { display: none; }
.qf-next-sum { display: grid; gap: 4px; font-size: 14px; background: #fff; border: 1px solid #eedcab; border-radius: 10px; padding: 8px 12px; }
.qf-next-edit { margin-top: 10px; }
.qf-next-edit[hidden], .next-card[hidden] { display: none; }
form .btn.block[type=submit] { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 5; box-shadow: 0 6px 20px rgba(20,60,40,.18); }
@media (min-width: 900px) { form .btn.block[type=submit] { bottom: 16px; } }

/* الساعة الحية والعبارة اليومية في الواجهة */
.hero-date { display: flex; flex-direction: column; gap: 2px; }
.hero-clock { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .3px; font-variant-numeric: tabular-nums; color: #e7c46e; }
.hero-word { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.hero-word-t { font-family: var(--font-head); font-size: 1rem; line-height: 1.8; color: #fff; }
.hero-word-s { font-size: 12px; color: rgba(255,255,255,.65); }

.pt-sum { grid-column: 1 / -1; }
.pt-h3 { font-family: var(--font-head); font-size: .95rem; color: #0a5a3c; margin: 14px 0 6px; }
.pt-sum .sum-kpi b { font-size: 1.25rem; }
.pt-sum .sum-hl, .pt-sum .sum-lines { font-size: 14px; }
.paste-help ol { margin: 0 0 8px; padding-inline-start: 22px; display: grid; gap: 6px; font-size: 15px; }

.av-days { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.av-ranges { display: grid; gap: 8px; }
.av-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-range input { max-width: 130px; }

/* خلاصة الحسابات */
.fin-verdict { border-inline-start: 5px solid #1f7a55; }
.fin-verdict.loss { border-inline-start-color: #c4501f; }
.fin-v-k { font-size: 13px; color: var(--muted); }
.fin-v-v { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: #1f7a55; }
.fin-verdict.loss .fin-v-v { color: #c4501f; }
.fin-v-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 12px; }
.fin-v-grid > div { background: #f5f6f2; border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.fin-v-grid span { font-size: 12px; color: var(--muted); }
.fin-tbl-wrap { overflow-x: auto; }
.fin-tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.fin-tbl th, .fin-tbl td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fin-tbl th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fin-tbl td small { color: var(--muted); font-weight: 500; }
.text-warn{color:var(--warn)}
.mode-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 14px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mode-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mode-seg button { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.mode-seg button.on { background: var(--green); color: #fff; }
.mode-seg button .badge-dot { position: static; display: inline-grid; margin-inline-start: 6px; vertical-align: middle; } /* ٤٣٥: الجديد في الوضع التاني */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.danger-zone h2 { color: var(--danger); font-size: 15px; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.rnp-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; border-bottom: 1px dashed var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.rnp-row .field { margin-bottom: 4px; min-width: 0; }
.rnp-del { margin-bottom: 10px; }
@media (max-width: 520px) { .rnp-row { grid-template-columns: 1fr 1fr; } .rnp-row .rnp-del { justify-self: end; } }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rp-chips:empty { display: none; }
.rp-chip { border: 1px solid var(--line); background: var(--surface); color: inherit; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.rp-chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.rp-list { display: grid; gap: 2px; }
.start-btn { display: inline-flex; align-items: center; gap: 6px; }
.start-btn span { width: 18px; height: 18px; }
.live-item { align-items: center; }
.live-acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.live-acts .btn { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.live-acts .btn span { width: 16px; height: 16px; }
.tone-red { border-inline-start: 4px solid var(--danger); }
.proof-timer { font-size: 18px; font-variant-numeric: tabular-nums; }
.proof-prev { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 8px 0; }
.join-card { text-align: center; max-width: 380px; margin: 40px auto; }
.join-logo { width: 64px; height: 64px; }
.visit-item .sub { white-space: normal; }
/* ٤٣١: «رأيكم في الحصة» — كارت واحد (النجوم + الموعد + الملاحظة) وزرار إرسال واحد */
.fb-card { display: grid; gap: 12px; background: var(--surface); border: 1.5px solid #c49a3c; border-radius: 14px; padding: 14px; margin: 12px auto; max-width: 148mm; font-size: 14px; box-sizing: border-box; }
.fb-title { font-size: 17px; color: var(--green); }
.fb-q { display: grid; gap: 6px; font-weight: 600; }
.fb-q .stars-row { justify-content: center; }
.fb-q .star-btn { min-width: 44px; min-height: 44px; font-size: 34px; }
.fb-q input { min-height: 44px; font-weight: 400; }
.fb-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fb-opt { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.fb-opt.on { border: 1.5px solid var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }
.fb-send { min-height: 46px; width: 100%; font-size: 15px; }
.fb-done { display: flex; align-items: center; gap: 12px; }
.fb-done b { display: block; font-size: 16px; color: var(--green); }
.fb-done span:not(.fb-ok) { font-size: 12px; color: var(--muted); }
.fb-ok { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; }
.fb-ok svg { width: 100%; height: 100%; }
/* ٤٣١: الوسام فوق التقرير، والحصة القادمة */
.p-win { display: flex; align-items: center; gap: 3mm; padding: 2.4mm 3.5mm; margin-bottom: 2.4mm; border-radius: 3mm; background: linear-gradient(135deg, #fff6dc 0%, #f6e3a8 100%); border: 1.5px solid var(--pgold); break-inside: avoid; }
.p-win.streak { background: linear-gradient(135deg, #eaf4ee 0%, #cfe6d8 100%); border-color: #4f9873; }
.p-win-ico { width: 11mm; height: 13mm; flex: 0 0 11mm; display: inline-flex; }
.p-win-ico svg { width: 100%; height: 100%; }
.p-win > div { display: grid; gap: .3mm; min-width: 0; }
.p-win-k { font-size: 8.4pt; font-weight: 700; color: #7a5a12; }
.p-win.streak .p-win-k { color: #1f6a47; }
.p-win b { font-size: 11.5pt; color: var(--pg2); line-height: 1.4; overflow-wrap: anywhere; }
.p-win-s { font-size: 8.4pt; color: #5c4a1a; }
.p-win.streak .p-win-s { color: #2f4a3c; }
.p-next { display: flex; align-items: center; gap: 3mm; padding: 2mm 3.5mm; border: 1.5px solid var(--pg); break-inside: avoid; }
.p-next-ico { width: 8mm; height: 8mm; flex: 0 0 8mm; display: inline-flex; color: var(--pg); }
.p-next-ico svg { width: 100%; height: 100%; }
.p-next > div { display: grid; min-width: 0; }
.p-next-k { font-size: 8.4pt; font-weight: 700; color: #5c645f; }
.p-next b { font-size: 11pt; color: var(--pg2); overflow-wrap: anywhere; }
.p-next-s { font-size: 8.4pt; color: #5c645f; }
@media print { .no-print { display: none !important; } }
.pk-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.cert { max-width: 900px; margin: 0 auto; background: #fffdf7; color: #1c2622; padding: 18px; }
.cert-frame { border: 3px double #b98a2e; border-radius: 6px; padding: 36px 28px; text-align: center; display: grid; gap: 10px; background: radial-gradient(circle at 50% 0, #f6eedb 0, transparent 60%); }
.cert-logo { width: 84px; height: 84px; margin: 0 auto; }
.cert-brand { font-family: var(--font-deco); color: #1f4d3a; font-weight: 700; }
.cert-title { font-family: var(--font-deco); color: #b98a2e; font-size: clamp(28px, 6vw, 44px); margin: 6px 0; }
.cert-lead { margin: 0; color: #4b5a53; }
.cert-name { font-family: var(--font-deco); font-size: clamp(26px, 5vw, 38px); color: #1f4d3a; border-bottom: 1px solid #e4d5ad; padding-bottom: 8px; margin: 4px auto; min-width: 60%; }
.cert-text { font-size: 18px; margin: 4px 0; text-wrap: balance; }
.cert-body { color: #4b5a53; font-style: italic; margin: 0; }
.cert-dua { color: #1f4d3a; margin: 6px 0 0; }
.cert-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; text-align: center; flex-wrap: wrap; }
.cert-foot > div { display: grid; gap: 2px; min-width: 160px; }
.cert-foot small { color: #6b766f; }
.cert-sign b { font-size: 18px; color: #1f4d3a; border-top: 1px solid #c9b47a; padding-top: 6px; }
@media print { .cert { padding: 0; } .cert-frame { min-height: 90vh; align-content: center; } }
.qf-extras { display: grid; gap: 8px; margin-top: 8px; }
.qf-extra { border-top: 1px dashed var(--line); padding-top: 8px; }
.qf-add { margin-top: 6px; }
.qf-example { color: var(--muted); }
.qf-sumrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qf-sum { min-width: 0; line-height: 1.7; }
.qf-edit { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); color: var(--green); border-radius: 999px; padding: 4px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qf-editor { margin-top: 8px; }
.qf-next-row { padding: 8px 0; border-top: 1px dashed var(--line); }
.qf-next-row:first-of-type { border-top: 0; }
.qf-next-k { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.qf-q { font-size: 13px; color: var(--muted); }
.comp-bar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--green); color: #fff; border-radius: 14px; padding: 10px 14px; margin-top: 12px; z-index: 5; }
.comp-bar .btn { background: #fff; color: var(--green); }
@media (min-width: 900px) { .comp-bar { bottom: 16px; } }
.cur-item .more summary { font-size: 13px; color: var(--green); }
.comp-bar[hidden] { display: none; }
.exam-row { gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== اللوائح ===== */
.public-page { max-width: 760px; margin: 0 auto; padding: 16px; }
.policy-card { line-height: 1.95; }
.policy h1 { font-family: var(--font-head); color: var(--green); font-size: 22px; margin: 4px 0 8px; text-wrap: balance; }
.policy h2 { font-family: var(--font-head); color: var(--green); font-size: 17px; margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.policy h3 { font-size: 15px; margin: 14px 0 4px; color: var(--text); }
.policy p { margin: 6px 0; }
.policy ul { margin: 4px 0 8px; padding-inline-start: 20px; }
.policy li { margin: 3px 0; }

/* تقييم ولي الأمر للحصة */
.stars-row { display: flex; gap: 2px; direction: ltr; }
.star-btn { background: none; border: 0; font-size: 30px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; min-width: 36px; min-height: 36px; }
.star-btn.on { color: var(--gold); }
.cur-bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.cur-bar i { display: block; height: 100%; background: var(--green); }
/* قايمة «المزيد» */
.more-menu { position: relative; display: inline-block; }
.mm-list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 50; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; display: grid; }
.mm-list[hidden] { display: none; }
.mm-item { display: block; text-align: start; background: none; border: 0; padding: 10px 12px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.mm-item:hover { background: var(--green-soft); }
/* دليل المنصة */
.doc-view li.sub { margin-inline-start: 18px; list-style: circle; }
.tbl-wrap { overflow-x: auto; margin: 8px 0; }
.doc-tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-tbl th, .doc-tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: start; }
.doc-tbl th { background: var(--green-soft); }
/* حقوق التصميم أسفل كل صفحة */
.app-credit { text-align: center; padding: 18px 0 6px; }
/* دليل البداية */
.start-list { display: grid; gap: 6px; margin-top: 8px; }
.start-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.start-item.ok { opacity: .7; }
.start-ic { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--warn-soft); color: var(--warn); font-weight: 700; flex: none; }
.start-item.ok .start-ic { background: var(--green-soft); color: var(--green); }
.how-steps { display: grid; gap: 12px; }
.how-step { display: flex; gap: 10px; align-items: flex-start; }
.how-n { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.help-btn { font-weight: 800; font-size: 18px; }
.auth h1 { font-family: var(--font-deco); }
/* الشاشات الضيقة جدًا: الهيدر يفضل في سطر واحد من غير ما يطلع برا الشاشة */
@media (max-width: 420px) {
  .topbar { gap: 4px; padding-inline: 10px; }
  .topbar .iconbtn { min-width: 38px; }
  .topbar .brand { gap: 6px; min-width: 0; }
  .topbar .brand span { font-size: 1.05rem; }
  .topbar .brand img { width: 28px; height: 28px; }
  .topsearch { padding: 0 9px; min-width: 0; }
  .help-btn { font-size: 16px; }
}
.install-steps-list { margin: 0; padding-inline-start: 20px; line-height: 2; }
.qf-hint { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); margin-top: 1px; }
.qf-toggle > span:last-child { text-align: start; }
.qf-next-k { font-weight: 700; color: var(--text); font-size: .95rem; }
.qf-extra-kinds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
/* نموذج القرآن v82: بطاقة لكل بند */
.qf-item { background: var(--surface); }
.qf-item[hidden] { display: none; }
.qf-name { font-weight: 700; font-size: 15px; color: var(--text); }
.qf-remove { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; text-decoration: underline; }
.qf-item .qf-body { display: grid; gap: 10px; }
.qf-prev { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; background: #f4f6f2; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.qf-prev-k { color: var(--muted); font-weight: 600; flex-shrink: 0; }
.qf-prev-v { min-width: 0; color: var(--text); }
.qf-prev-g { display: inline-block; margin-inline-start: 6px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #e3f3ea; color: #16663a; }
.qf-prev-g.g-redo { background: var(--warn-soft); color: var(--warn); }
.qf-line { display: grid; gap: 4px; }
.qf-line .qf-q { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.qf-next { border-top: 1px dashed var(--line); padding-top: 8px; }
.qf-next .qf-sum b { color: #7a5a14; }
.form-guide summary { cursor: pointer; font-weight: 700; color: var(--green); }
.form-guide ol { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.8; }
.qf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.qf-chip { border: 1px dashed #c9b27a; background: transparent; color: #7a5a14; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.qf-chip:hover { background: var(--gold-soft); }
.qf-remove[hidden] { display: none; }
/* نموذج القرآن (٩٧): جدول بأربعة بنود — البند | ورد اليوم | التقييم | الورد القادم */
.qt-head { display: none; }
.qt-body { display: grid; gap: 10px; }
.qt-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; display: grid; gap: 10px; }
.qt-row.missing { border-color: #e07b24; box-shadow: 0 0 0 3px #fde8d6; }
.qt-name { font-weight: 700; font-size: 15px; color: var(--green); }
.qt-cell { display: grid; gap: 4px; min-width: 0; }
.qt-lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.qt-today-t { line-height: 1.7; }
.qt-link { border: 0; background: none; color: var(--green); font: inherit; font-size: 12.5px; text-decoration: underline; padding: 0; cursor: pointer; justify-self: start; }
.qt-link[hidden], .qt-other[hidden], .qt-today-t[hidden] { display: none; }
.qt-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qt-range .qt-sur { flex: 1 1 140px; min-width: 0; }
.qt-range .qt-ay { width: 70px; flex: 0 0 70px; }
/* قرار ١٥٦: أكثر من سورة */
.qt-multi { display: flex; flex-direction: column; gap: 6px; }
.qt-mline { display: flex; align-items: center; gap: 6px; }
.qt-mline > .qt-range { flex: 1 1 auto; min-width: 0; }
.qt-x { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--danger); font-size: 18px; line-height: 1; cursor: pointer; }
.qt-multi-wrap > .qt-link { margin-top: 4px; }
.qt-row .chips { gap: 6px; }
.qt-row .chip span { padding: 5px 10px; font-size: 13px; }
@media (min-width: 900px) {
  .qt-head { display: grid; grid-template-columns: 120px 1fr 1.2fr 1.3fr; gap: 12px; padding: 0 12px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
  .qt-row { grid-template-columns: 120px 1fr 1.2fr 1.3fr; gap: 12px; align-items: start; }
  .qt-row .qt-lbl { display: none; }
}
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.fu-list .pill { padding: 0 6px; font-size: 9px; }
/* قرار ١٠١: اسم الطالب واضح في كارت الرسالة، وأقسام صفحة الرسائل */
.wa-name { font-size: 1.12rem; font-weight: 700; margin-bottom: 4px; }
.wa-sec { margin-bottom: 14px; }
details.wa-sec > summary { cursor: pointer; padding: 10px 0; }

/* قرار ١١٠: اختيار موعد التعويض */
.mk-days button.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.mk-days button.chip.gold { border-color: var(--gold); background: var(--gold-soft); }
.mk-days button.chip.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }

/* قرار ١٠٩: تسميع الورد */
.rec-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.rec-btn.on { background: var(--danger); border-color: var(--danger); }
.rec-time { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; display: inline-block; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .2; } }
.rec-preview { margin-top: 8px; }
/* ٤٩١: مؤشر الصوت، والمشغّل بالثواني، وعلامات التصحيح */
.rec-level { height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.rec-level > span { display: block; height: 100%; width: 0; background: var(--green); transition: width .12s; }
.rec-player { margin: 6px 0; }
.rec-player audio { display: none; }
.rp-play { min-width: 44px; min-height: 40px; font-size: 16px; }
.rp-back { min-height: 40px; }
.rp-track { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.rp-track::before { content: ''; position: absolute; inset-inline: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--line); }
.rp-fill { position: absolute; inset-inline-start: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--green); pointer-events: none; }
.rp-pins { position: absolute; inset: 0; pointer-events: none; }
.rp-pin { position: absolute; top: -2px; transform: translateX(50%); background: none; border: 0; padding: 4px; font-size: 16px; line-height: 1; cursor: pointer; pointer-events: auto; min-width: 28px; min-height: 28px; }
.rp-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rec-mark-btn { width: 100%; margin: 6px 0 2px; background: var(--danger); border-color: var(--danger); min-height: 44px; font-size: 16px; }
.rec-mark-form { border: 2px solid var(--gold); margin: 8px 0; }
.rec-marks .item.on, .rec-mark-row.on { background: var(--gold-soft); }
.rec-mk-panel:not(:empty) { margin-top: 8px; }
.rec-hist > .rec-mk-panel:not(:empty) { padding: 0 4px 10px; }
.rec-marks .item { flex-wrap: wrap; gap: 6px; }
.rec-marks .item > .grow { flex: 1 1 100%; }
.rec-mark-wrap .rec-player .row { flex-wrap: nowrap; }
.card.focus { outline: 2px solid var(--gold); }

/* ================= قرار ١٤٠: طبقة الاحتراف (نفس ألوان الهوية) — حركة هادئة، عمق خفيف، وضع داكن ================= */
:root {
  --surface-2: #fafaf7;      /* خلفية ثانوية داخل البطاقات */
  --surface-3: #f1f1ec;      /* حقول/شرائح غير نشطة */
  --line-strong: #d9d9d1;
  --ink-green: #1d4a3c;      /* الأخضر كنص (يتغير في الداكن) */
  --shadow-sm: 0 1px 2px rgba(16,24,20,.05);
  --shadow-md: 0 1px 2px rgba(16,24,20,.04), 0 6px 18px -6px rgba(16,24,20,.10);
  --shadow-lg: 0 18px 50px -12px rgba(16,24,20,.28);
  --focus: 0 0 0 3px rgba(44,101,83,.18);
  --ease: cubic-bezier(.2,.8,.2,1);
  --topbar-bg: rgba(255,255,255,.86);
  --overlay: rgba(14,22,18,.42);
  --skel: #ecece6; --skel-hi: #f6f6f2;
}
/* الحركة: دخول الصفحة، النوافذ، الرسائل */
@keyframes q-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes q-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes q-sheet { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes q-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes q-toast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes q-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.page-enter { animation: q-rise .32s var(--ease) both; }
.modal-back { background: var(--overlay); animation: q-fade .18s ease-out both; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal { animation: q-sheet .26s var(--ease) both; box-shadow: var(--shadow-lg); }
@media (min-width: 700px) { .modal { animation-name: q-pop; } }
.modal > h2 { position: sticky; top: -18px; background: var(--surface); z-index: 2; margin: -18px -16px 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
.modal > h2 .iconbtn { min-width: 36px; min-height: 36px; border-radius: 50%; }
.modal > h2 .iconbtn:hover { background: var(--surface-3); }
#toast div { display: inline-flex; align-items: center; gap: 8px; animation: q-toast .24s var(--ease) both; border-radius: 12px; padding: 11px 16px; font-weight: 500; box-shadow: var(--shadow-lg); }
#toast div::before { content: '✓'; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.18); font-size: 12px; flex-shrink: 0; }
#toast div.err::before { content: '!'; font-weight: 800; }
@media (min-width: 900px) { #toast { bottom: 28px; } }

/* هيكل التحميل بدل «جارٍ التحميل…» */
.skel-page { padding: 4px 0; animation: q-fade .2s ease-out both; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--skel) 0%, var(--skel-hi) 50%, var(--skel) 100%); background-size: 200% 100%; animation: q-shimmer 1.3s linear infinite; }
.skel.h1 { height: 30px; width: 42%; margin-bottom: 18px; }
.skel.card { height: 110px; margin-bottom: 12px; border: 0; box-shadow: none; }
.skel.row { height: 58px; margin-bottom: 8px; }
.skel.line { height: 12px; width: 70%; margin: 8px 0; }

/* البطاقات والقوائم: عمق خفيف وحركة عند المرور */
.card, .list, .kpi, .task { box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), border-color .2s, transform .2s var(--ease); }
a.card:hover, a.kpi:hover, .wa-strip:hover, .plan-row:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.item { transition: background .15s; }
a.item:hover, button.item:hover { background: var(--surface-2); }
a.item:hover .chev { transform: translateX(-3px); color: var(--green-2); }
.chev { transition: transform .2s var(--ease), color .2s; font-size: 18px; }
.item .title { line-height: 1.45; }
/* صورة رمزية بالحروف الأولى في القوائم */
.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; background: var(--green-soft); color: var(--ink-green); }
.av.t1 { background: var(--gold-soft); color: #7a5f22; } .av.t2 { background: var(--blue-soft); color: var(--blue); } .av.t3 { background: var(--purple-soft); color: var(--purple); }

/* الأزرار: ضغطة محسوسة وحلقة تركيز واضحة */
.btn { transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; }
.btn:active:not([disabled]) { transform: scale(.98); }
.btn:focus-visible, .iconbtn:focus-visible, a:focus-visible, .chip input:focus-visible + span, .tabs a:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn[disabled] { filter: saturate(.6); }

/* الحقول */
.input, select.input, textarea.input { background: var(--surface); border-color: var(--line-strong); transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #c7c7bd; }
.input:focus { border-color: var(--green-2); box-shadow: var(--focus); }
.input::placeholder { color: #9aa29d; }
.field > label, .field > .label { font-size: 14.5px; color: var(--text); }
.chip span { background: var(--surface); border-color: var(--line-strong); transition: background .15s, border-color .15s, color .15s; }
.chip span:hover { border-color: var(--green-2); }
.check input { accent-color: var(--green); }

/* التبويبات: شريط مقسّم هادئ */
.tabs a, .tabs button { background: var(--surface); border-color: var(--line); transition: background .15s, color .15s, border-color .15s; }
.tabs a:hover, .tabs button:hover { border-color: var(--green-2); }
.section-tabs a { transition: color .15s, border-color .2s; }

/* الجداول */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; }
table.t { background: transparent; }
table.t th { position: sticky; top: 0; background: var(--surface-2); font-size: 13px; font-weight: 600; z-index: 1; }
table.t tbody tr { transition: background .12s; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td { font-variant-numeric: tabular-nums; }

/* أرقام الإحصاءات */
.stat { background: var(--surface-2); border-color: var(--line); border-radius: 12px; padding: 10px 12px; }
.stat .v { font-variant-numeric: tabular-nums; }
.kpi .v, .hero-tile .v, .stat .v { letter-spacing: 0; }

/* الصناديق */
.info-box, .ok-box, .error-box { border: 1px solid transparent; line-height: 1.7; }
.info-box { border-color: #eadfc2; }
.ok-box { border-color: #d3e3da; }
.error-box { border-color: #f0d0cb; }
.empty-state svg { opacity: .7; }

/* الشريط العلوي والقائمة */
.topbar { background: var(--topbar-bg); }
.sidenav a { transition: background .15s, color .15s; }
.bottomnav { box-shadow: 0 -1px 0 var(--line), 0 -8px 24px -18px rgba(16,24,20,.25); border-top: 0; backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.bottomnav a { transition: color .15s; }
.bottomnav a svg { transition: transform .2s var(--ease); }
.bottomnav a.active svg { transform: translateY(-1px); }

/* اختيار المظهر في الإعدادات */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-pick button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 12px; padding: 10px 6px; cursor: pointer; font: inherit; font-size: 14px; display: grid; gap: 6px; justify-items: center; transition: border-color .15s, box-shadow .15s; }
.theme-pick button.on { border-color: var(--green-2); box-shadow: var(--focus); font-weight: 700; }
.theme-pick i { width: 44px; height: 28px; border-radius: 7px; border: 1px solid var(--line-strong); display: block; }
.theme-pick .tp-light i { background: linear-gradient(135deg, #f7f7f4 50%, #1d4a3c 50%); }
.theme-pick .tp-dark i { background: linear-gradient(135deg, #121815 50%, #3f8f6d 50%); }
.theme-pick .tp-auto i { background: linear-gradient(135deg, #f7f7f4 50%, #121815 50%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ================= الوضع الداكن (اختياري من الإعدادات) — التقارير والملخصات تبقى ورقًا فاتحًا ================= */
:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #2f7a5c; --green-2: #6fbf99; --green-soft: #1d3029; --ink-green: #8fd1b0;
  --gold: #c9a45a; --gold-soft: #2c2619;
  --bg: #0f1412; --surface: #161d1a; --surface-2: #1b2420; --surface-3: #222c27;
  --line: #27312c; --line-strong: #34403a;
  --text: #e4eae6; --muted: #98a59e;
  --danger: #ef8a7f; --danger-soft: #2d1b19; --warn: #e2b062; --warn-soft: #2b2316;
  --blue: #8bb4e0; --blue-soft: #1a2430; --purple: #b9a5e3; --purple-soft: #231f2e;
  --shadow: none; --shadow-sm: 0 1px 0 rgba(0,0,0,.25); --shadow-md: 0 8px 24px -10px rgba(0,0,0,.6); --shadow-lg: 0 20px 60px -10px rgba(0,0,0,.7);
  --focus: 0 0 0 3px rgba(111,191,153,.25);
  --topbar-bg: rgba(18,24,21,.86); --overlay: rgba(0,0,0,.6);
  --skel: #1c2521; --skel-hi: #26312c;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--text); }
:root[data-theme="dark"] h1, :root[data-theme="dark"] .page-head h1, :root[data-theme="dark"] .time, :root[data-theme="dark"] .day-head,
:root[data-theme="dark"] .topbar .brand, :root[data-theme="dark"] .topbar .iconbtn, :root[data-theme="dark"] .rem-time, :root[data-theme="dark"] .stat .v,
:root[data-theme="dark"] .level-v .num, :root[data-theme="dark"] .opening-box summary, :root[data-theme="dark"] .seq, :root[data-theme="dark"] .task .count,
:root[data-theme="dark"] .section-tabs a.active, :root[data-theme="dark"] .auth .logo b { color: var(--ink-green); }
:root[data-theme="dark"] a { color: var(--green-2); }
:root[data-theme="dark"] .btn { color: #fff; }
:root[data-theme="dark"] .btn:hover { background: #2a6d52; }
:root[data-theme="dark"] .btn.secondary { background: var(--surface); color: var(--ink-green); border-color: var(--line-strong); }
:root[data-theme="dark"] .btn.secondary:hover, :root[data-theme="dark"] .btn.ghost:hover { background: var(--green-soft); }
:root[data-theme="dark"] .btn.ghost { color: var(--green-2); }
:root[data-theme="dark"] .btn.danger { background: transparent; border-color: #5a2d29; }
:root[data-theme="dark"] .btn.gold { color: #1a1408; }
:root[data-theme="dark"] .sidenav a.active, :root[data-theme="dark"] .drawer-menu a.active { color: var(--ink-green); box-shadow: inset -3px 0 0 var(--green-2); }
:root[data-theme="dark"] .sidenav a:hover { background: var(--surface-2); }
:root[data-theme="dark"] .bottomnav a.active { color: var(--ink-green); }
:root[data-theme="dark"] .bottomnav a.active::before { background: var(--green-2); }
:root[data-theme="dark"] .topsearch { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
:root[data-theme="dark"] .topsearch:hover, :root[data-theme="dark"] .me-chip:hover { background: var(--surface-3); }
:root[data-theme="dark"] .topsearch kbd { background: var(--surface); }
:root[data-theme="dark"] .topbar { border-bottom-color: var(--line); }
:root[data-theme="dark"] .input:hover { border-color: #4a5751; }
:root[data-theme="dark"] .input::placeholder { color: #6f7c75; }
:root[data-theme="dark"] .chip input:checked + span, :root[data-theme="dark"] .tabs .active { background: var(--green); border-color: var(--green); color: #fff; }
:root[data-theme="dark"] .item:hover, :root[data-theme="dark"] a.item:hover { background: var(--surface-2); }
:root[data-theme="dark"] .count { background: var(--surface-3) !important; }
:root[data-theme="dark"] .pill.green { background: #1a2e26; color: #8fd1b0; border-color: #28463a; }
:root[data-theme="dark"] .pill.gold { background: #2a2416; color: #e0c27e; border-color: #4a3f22; }
:root[data-theme="dark"] .pill.warn { background: #2b2216; color: #e8b46a; border-color: #4d3a1d; }
:root[data-theme="dark"] .pill.red { background: #2d1a18; color: #f19a90; border-color: #55302b; }
:root[data-theme="dark"] .pill.blue { background: #18222e; color: #9cc1ea; border-color: #2b3e55; }
:root[data-theme="dark"] .pill.purple { background: #221d2d; color: #c4b2ea; border-color: #3b3250; }
:root[data-theme="dark"] .pill.grey, :root[data-theme="dark"] .pill:not([class*=" "]) { background: var(--surface-3); color: var(--muted); border-color: var(--line-strong); }
:root[data-theme="dark"] .av.t1 { color: #e0c27e; }
:root[data-theme="dark"] .info-box { border-color: #4a3f22; color: var(--text); }
:root[data-theme="dark"] .ok-box { border-color: #28463a; color: #8fd1b0; }
:root[data-theme="dark"] .error-box { border-color: #55302b; }
:root[data-theme="dark"] .alert.tone-red { background: #2a1917; border-color: #55302b; color: #f3b0a8; }
:root[data-theme="dark"] .alert.tone-blue { background: #17212c; border-color: #2b3e55; color: #a9c8ec; }
:root[data-theme="dark"] .alert.tone-warn { background: #2a2116; border-color: #4d3a1d; color: #ecc082; }
:root[data-theme="dark"] .alert.tone-purple { background: #211c2b; border-color: #3b3250; color: #cdbdf0; }
:root[data-theme="dark"] .alert.tone-grey { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
:root[data-theme="dark"] .lesson-item.tone-gold { background: var(--surface) !important; }
:root[data-theme="dark"] .rem-row, :root[data-theme="dark"] .wa-card .wa-text, :root[data-theme="dark"] .opening-box, :root[data-theme="dark"] .pod,
:root[data-theme="dark"] .bdg, :root[data-theme="dark"] .jr-stat, :root[data-theme="dark"] .qf-item, :root[data-theme="dark"] .next-card { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] .rem-row.urgent { background: var(--danger-soft); border-color: #55302b; }
:root[data-theme="dark"] .ward-due { background: #2a2416; border-color: #4a3f22; color: #e0c27e; }
:root[data-theme="dark"] .badge-chip { background: #2a2416; border-color: #4a3f22; color: #e0c27e; }
:root[data-theme="dark"] .mbar-trk, :root[data-theme="dark"] .bdg-trk, :root[data-theme="dark"] .jr-track, :root[data-theme="dark"] .plan-bar { background: var(--surface-3); }
:root[data-theme="dark"] .juz-map button { background: var(--surface-3); color: #6f7c75; }
:root[data-theme="dark"] .juz-map .st-current { background: var(--surface); }
:root[data-theme="dark"] .stu .ring { background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--surface-3) 0); }
:root[data-theme="dark"] .stu .badge { background: #e4eae6; color: #0f1412; }
:root[data-theme="dark"] .plan-mark { background: var(--text); }
:root[data-theme="dark"] .hero { background: linear-gradient(160deg, #1f4d3c, #16362b); border: 1px solid #27453a; }
:root[data-theme="dark"] .hero-logo { background: #f3efe4; }
:root[data-theme="dark"] .drawer-head { background: linear-gradient(160deg, #1f4d3c, #16362b); }
:root[data-theme="dark"] .imp-bar { background: #2a2416; color: #e0c27e; border-color: #4a3f22; }
:root[data-theme="dark"] .wa-strip-ic { background: #17291f; }
:root[data-theme="dark"] .more-ic { background: var(--green-soft); color: var(--ink-green); }
:root[data-theme="dark"] .kpi.gold .ic { color: #e0c27e; }
:root[data-theme="dark"] .print-wrap { background: #0f1412; }
:root[data-theme="dark"] .sheet, :root[data-theme="dark"] .sum-sheet { color-scheme: light; }
:root[data-theme="dark"] .empty-state svg { color: #5d6a63; }
:root[data-theme="dark"] .legend > summary { color: var(--muted); }
:root[data-theme="dark"] img.logo-ink { filter: none; }
:root[data-theme="dark"] .pill { background: var(--surface-3); color: var(--muted); border-color: var(--line-strong); }
:root[data-theme="dark"] .lv-gold { --lv: #e0c27e; --lv-bg: #2a2416; --lv-line: #4a3f22; }
:root[data-theme="dark"] .lv-green { --lv: #8fd1b0; --lv-bg: #1a2e26; --lv-line: #28463a; }
:root[data-theme="dark"] .lv-blue { --lv: #9cc1ea; --lv-bg: #18222e; --lv-line: #2b3e55; }
:root[data-theme="dark"] .lv-orange { --lv: #f0a37c; --lv-bg: #2c1d16; --lv-line: #55352a; }
:root[data-theme="dark"] .lv-grey { --lv: #9aa59e; --lv-bg: var(--surface-3); --lv-line: var(--line-strong); }
:root[data-theme="dark"] .insight { background: var(--lv-bg, var(--surface-2)); color: var(--muted); }
:root[data-theme="dark"] .insight.lv-orange, :root[data-theme="dark"] .insight.lv-orange b { color: #f0a37c; }
:root[data-theme="dark"] .insight.lv-gold { color: #e0c27e; }
:root[data-theme="dark"] .bdg-ic { background: var(--surface-3); color: #6f7c75; }
:root[data-theme="dark"] .pt-link, :root[data-theme="dark"] .qf-steps-pill { background: var(--surface-2); }
:root[data-theme="dark"] .qf-steps-pill.ok { background: #1a2e26; color: #8fd1b0; }
:root[data-theme="dark"] .jr-track em, :root[data-theme="dark"] .pj-track em { background: var(--surface); }
:root[data-theme="dark"] .sum-kpi:not(.sum-sheet *) { background: var(--surface-2); color: var(--text); }
:root[data-theme="dark"] .fin-v-grid > div { background: var(--surface-2); }
:root[data-theme="dark"] .jr-stat { background: var(--surface-2); }

/* ================= قرار ١٤٦: تنقل أسهل — أعداد بجانب القائمة، أدوات أخرى، بحث وأوامر، نظرة سريعة على الطالب ================= */
.nav-count { margin-inline-start: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--gold-soft); color: #7a5f22; border: 1px solid #eadfc2; font-style: normal; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.sidenav a .nav-count, .drawer-menu a .nav-count { flex-shrink: 0; }
.sidenav a > span:nth-child(2), .drawer-menu a > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bottomnav a .nav-count { position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); margin: 0; height: 17px; min-width: 17px; padding: 0 5px; font-size: 10.5px; background: var(--danger); color: #fff; border: 0; }
.nav-more { margin-top: 4px; }
.nav-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; border-radius: 10px; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary svg { width: 16px; height: 16px; }
.nav-more > summary::after { content: '‹'; margin-inline-start: auto; transition: transform .2s; font-size: 16px; }
.nav-more[open] > summary::after { transform: rotate(-90deg); }
.nav-more > summary:hover { color: var(--text); }
.sidenav svg, .drawer-menu svg { stroke-width: 1.8; }
/* البحث والأوامر */
.search-box { border-radius: 18px; padding: 14px; }
.search-box .input { border: 0; box-shadow: none; font-size: 16px; padding-inline: 4px; background: transparent; }
.search-box > .row { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.cmd-group { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 4px 6px; letter-spacing: .2px; }
.cmdk .list { margin-bottom: 4px; }
.cmd-row { border-bottom: 1px solid var(--line); }
.cmd-row:last-child { border-bottom: 0; }
.cmd-row .item { border-bottom: 0; min-height: 50px; padding: 9px 12px; }
.cmd-row .item.sel { background: var(--green-soft); }
.cmd-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-green); flex-shrink: 0; }
.cmd-ic svg { width: 18px; height: 18px; }
.cmd-row .av { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.cmd-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; padding-inline-start: 58px; }
.cmd-act { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; background: var(--surface); transition: border-color .15s, background .15s; }
.cmd-act:hover { border-color: var(--green-2); background: var(--green-soft); }
.cmd-act svg { width: 14px; height: 14px; color: var(--green-2); }
/* نظرة سريعة على الطالب */
.glance { display: grid; gap: 10px; margin: -4px 0 14px; }
.glance-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.glance-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; }
.glance-chip b { font-weight: 700; color: var(--ink-green); }
.glance-chip.green { border-color: #d3e3da; } .glance-chip.warn { border-color: #efdcb8; background: var(--warn-soft); } .glance-chip.red { border-color: #f0d0cb; background: var(--danger-soft); } .glance-chip.gold { border-color: #eadfc2; background: var(--gold-soft); }
.glance-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.glance-acts .btn svg { width: 16px; height: 16px; }
@media (max-width: 699px) { .glance-acts .btn { flex: 1 1 calc(50% - 6px); } }
:root[data-theme="dark"] .nav-count { background: #2a2416; color: #e0c27e; border-color: #4a3f22; }
:root[data-theme="dark"] .bottomnav a .nav-count { background: var(--danger); color: #1a0f0e; }
:root[data-theme="dark"] .glance-chip.green { border-color: #28463a; } :root[data-theme="dark"] .glance-chip.warn { border-color: #4d3a1d; } :root[data-theme="dark"] .glance-chip.red { border-color: #55302b; } :root[data-theme="dark"] .glance-chip.gold { border-color: #4a3f22; }
.nav-count[hidden] { display: none !important; }


/* ================= قرار ١٤٨: ألوان من اللوجو — زمردي عميق + ذهبي عتيق + كريمي، ووضع داكن «ليلة زمردية» ملفت ================= */
:root {
  --brand-emerald: #013418; --brand-emerald-2: #0b4a2c; --brand-gold: #d0a048; --brand-gold-2: #e3bc62; --brand-cream: #fbf8ef;
  --pattern: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgdmlld0JveD0iMCAwIDU2IDU2Ij48ZyBmaWxsPSJub25lIiBzdHJva2U9IiNkMGEwNDgiIHN0cm9rZS13aWR0aD0iMSI+PHBhdGggZD0iTTI4IDZsNi4yIDE1LjhMNTAgMjhsLTE1LjggNi4yTDI4IDUwbC02LjItMTUuOEw2IDI4bDE1LjgtNi4yeiIvPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB0cmFuc2Zvcm09InJvdGF0ZSg0NSAyOCAyOCkiLz48cmVjdCB4PSIxNiIgeT0iMTYiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIvPjwvZz48L3N2Zz4=");
}
/* اللوحة الرئيسية: زمردي اللوجو مع نقش هندسي ذهبي خفيف وإطار ذهبي */
.hero { background: linear-gradient(150deg, #0d5232 0%, #0a3f26 55%, #062a19 100%); border: 1px solid rgba(208,160,72,.45); box-shadow: 0 14px 34px -14px rgba(1,52,24,.55); position: relative; overflow: hidden; }
.hero::after { content: ''; display: block !important; position: absolute; inset: 0; background-image: var(--pattern); background-size: 56px 56px; opacity: .07; pointer-events: none; }
.hero::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--brand-gold), transparent); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero-tile .v, .hero-mini .v.gold { color: #f3d68b; }
.hero-tile { background: rgba(255,255,255,.06); border-color: rgba(208,160,72,.22); }
a.hero-tile:hover { background: rgba(208,160,72,.12); border-color: rgba(208,160,72,.5); }
.hero-tile.alert-tile { background: rgba(208,160,72,.18); border-color: rgba(227,188,98,.7); }
.hero-logo { box-shadow: 0 0 0 3px rgba(208,160,72,.55); }
.drawer-head { background: linear-gradient(150deg, #0d5232, #062a19); position: relative; }
.drawer-head::after { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 56px; opacity: .07; pointer-events: none; }
.drawer-head > * { position: relative; z-index: 1; }
.page-head h1 { position: relative; }

:root[data-theme="dark"] {
  --green: #127a4b; --green-2: #e0b65a; --green-soft: #12301f; --ink-green: #f0d48f;
  --gold: #e0b65a; --gold-soft: #2a2312;
  --bg: #04110a; --surface: #0a1c12; --surface-2: #0e2418; --surface-3: #13301f;
  --line: #1b3828; --line-strong: #29503b;
  --text: #f4efe0; --muted: #a8b6ab;
  --topbar-bg: rgba(6,20,12,.86);
  --skel: #10261a; --skel-hi: #183626;
  --focus: 0 0 0 3px rgba(224,182,90,.32);
}
:root[data-theme="dark"] body { background: radial-gradient(1200px 600px at 100% -10%, rgba(18,122,75,.16), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(208,160,72,.07), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="dark"] h1, :root[data-theme="dark"] .page-head h1 { color: var(--brand-gold-2); }
:root[data-theme="dark"] .card > h2, :root[data-theme="dark"] .card .row > h2, :root[data-theme="dark"] .section-title { color: var(--text); }
:root[data-theme="dark"] .btn { background: linear-gradient(180deg, #158a55, #0f6b42); border-color: #1a8f5a; color: #fbf8ef; }
:root[data-theme="dark"] .btn:hover { background: linear-gradient(180deg, #19995f, #127a4b); }
:root[data-theme="dark"] .btn.secondary { background: transparent; color: var(--brand-gold-2); border-color: rgba(224,182,90,.45); }
:root[data-theme="dark"] .btn.secondary:hover { background: rgba(224,182,90,.1); }
:root[data-theme="dark"] .btn.ghost { color: var(--brand-gold-2); }
:root[data-theme="dark"] a { color: var(--brand-gold-2); }
:root[data-theme="dark"] .sidenav { background: linear-gradient(180deg, #0b1f14, #08180f); border-color: var(--line); }
:root[data-theme="dark"] .sidenav a, :root[data-theme="dark"] .drawer-menu a { color: #e6e0cf; }
:root[data-theme="dark"] .sidenav a svg, :root[data-theme="dark"] .drawer-menu a svg { color: #c9a24a; }
:root[data-theme="dark"] .sidenav a.active, :root[data-theme="dark"] .drawer-menu a.active { background: linear-gradient(90deg, rgba(208,160,72,.06), rgba(208,160,72,.16)); color: var(--brand-gold-2); box-shadow: inset -3px 0 0 var(--brand-gold); }
:root[data-theme="dark"] .sidenav .label, :root[data-theme="dark"] .drawer-menu .label { color: #8fa395; }
:root[data-theme="dark"] .bottomnav a.active { color: var(--brand-gold-2); }
:root[data-theme="dark"] .bottomnav a.active::before { background: var(--brand-gold); }
:root[data-theme="dark"] .topbar .brand, :root[data-theme="dark"] .topbar .iconbtn { color: var(--brand-gold-2); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .list, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .task { background: linear-gradient(180deg, #0c2015, #0a1c12); border-color: var(--line); }
:root[data-theme="dark"] .task { border-inline-start-color: var(--brand-gold); }
:root[data-theme="dark"] .chip input:checked + span, :root[data-theme="dark"] .tabs .active { background: var(--brand-gold); border-color: var(--brand-gold); color: #10200f; font-weight: 700; }
:root[data-theme="dark"] .section-tabs a.active { color: var(--brand-gold-2); border-bottom-color: var(--brand-gold); }
:root[data-theme="dark"] .stat .v, :root[data-theme="dark"] .kpi .v, :root[data-theme="dark"] .time, :root[data-theme="dark"] .rem-time { color: var(--brand-gold-2); }
:root[data-theme="dark"] .pill.green, :root[data-theme="dark"] .glance-chip.green { background: #0f2e1d; color: #7fdcaa; border-color: #1f5136; }
:root[data-theme="dark"] .glance-chip b { color: var(--brand-gold-2); }
:root[data-theme="dark"] .nav-count { background: var(--brand-gold); color: #10200f; border-color: var(--brand-gold); }
:root[data-theme="dark"] .av { background: #12301f; color: var(--brand-gold-2); }
:root[data-theme="dark"] .cmd-ic { background: #12301f; color: var(--brand-gold-2); }
:root[data-theme="dark"] .hero { background: linear-gradient(150deg, #0e5a37 0%, #0a3f26 55%, #05261a 100%); border-color: rgba(224,182,90,.5); }
:root[data-theme="dark"] .hero::after { opacity: .1; }
:root[data-theme="dark"] .ok-box { color: #7fdcaa; }
:root[data-theme="dark"] .input:focus { border-color: var(--brand-gold); }
:root[data-theme="dark"] .theme-pick button.on { border-color: var(--brand-gold); }
:root[data-theme="dark"] .modal > h2 { color: var(--brand-gold-2); }
.theme-pick .tp-dark i { background: linear-gradient(135deg, #04110a 50%, #d0a048 50%); }
.theme-pick .tp-auto i { background: linear-gradient(135deg, #f7f7f4 50%, #04110a 50%); }

/* قرار ١٥٠: شريط تحميل رفيع أعلى الشاشة وقت تحديث الصفحة (بدل ما الصفحة تفضى) */
@keyframes q-bar { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
main[aria-busy="true"]::before { content: ''; position: fixed; top: env(safe-area-inset-top, 0px); inset-inline: 0; height: 3px; z-index: 40; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: q-bar 1s ease-in-out infinite; pointer-events: none; }
main.is-stale > div:first-child { transition: opacity .2s; }
/* قرار ١٥٧: مرفقات التقرير */
.att-card .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.att-ico { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--text); }
.att-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.att-linkbox { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-linkbox .input { flex: 1 1 200px; min-width: 0; }
.p-att { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.p-att a { color: var(--green); overflow-wrap: anywhere; }
.p-att-url { font-size: 11px; color: var(--muted); }
.att-linkbox[hidden], .att-card [hidden] { display: none !important; }
/* قرار ١٥٩: حصر الحفظ */
.census-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.census-juz { display: flex; flex-direction: column; gap: 8px; }
.census-pct { padding-inline-start: 12px; margin-top: -4px; }
/* قرار ١٦٠: الإخوة في صفحة المتابعة */
.pt-kids { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.pt-kid { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; }
.pt-kid.active { background: #d0a048; border-color: #d0a048; color: #1c2420; font-weight: 700; }
/* قرار ١٦١: أول تقرير قرآن + سطر الآيات */
.qt-range { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.qt-range .qt-sur { flex: 0 0 auto; width: 100%; }
.qt-ayrow { display: flex; align-items: center; gap: 6px; }
.qt-ayrow .qt-ay { flex: 1 1 0; width: auto; min-width: 0; }
.qt-pickbox { display: grid; gap: 6px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--line); }
.qt-pick { gap: 6px; }
.qt-pick.missing { outline: 2px solid #e07b24; outline-offset: 4px; border-radius: 10px; }
.qt-row[hidden] { display: none !important; }
.qt-body, .qt-row:not(.x) { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.qt-other, .qt-rot, .qt-multi-wrap { min-width: 0; }
@media (min-width: 900px) { .qt-row:not(.x) { grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.3fr); } }
/* قرار ١٦٢: أول تقرير قرآن = الورد القادم بس */
.qt-row.qt-start > .qt-cell:nth-child(2), .qt-row.qt-start > .qt-cell:nth-child(3) { display: none; }
.qt-startbox { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--line); line-height: 1.7; }
.qt-startbox b { color: var(--green); font-size: 15px; }
@media (min-width: 900px) { .qt-row.qt-start { grid-template-columns: 150px minmax(0, 1fr); } }
.p-start { text-align: center; background: linear-gradient(135deg, #013418, #0b4a2a); color: #fbf8ef; border-color: #d0a048 !important; }
.p-start-t { font-weight: 800; font-size: 12pt; color: #d0a048; }
.p-start-s { font-size: 10pt; margin-top: 1mm; line-height: 1.7; }
/* قرار ١٦٣: التقرير على الموبايل — كل حاجة (الخط والأيقونات والتقديرات) أكبر وواضحة، والتقييم بعد التقرير */
@media screen and (max-width: 600px) {
  .print-wrap { padding: 8px 8px 32px; }
  .print-wrap .sheet, .report-view .sheet { zoom: 1.18; width: auto; max-width: none; }
  .p-table .p-grade { white-space: nowrap; width: 1%; }
  .p-table tbody th { width: 24%; }
  .print-wrap .fb-card { margin-top: 12px; }
}
/* قرار ١٦٣: لينكات النموذج أكبر للمس على الموبايل والتابلت */
.qt-link { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 2px; }
@media screen and (max-width: 600px) {
  .p-inline { flex-wrap: wrap; }
  .p-inline-end { min-width: 0; max-width: 100%; }
  .p-inline-end .p-chip { white-space: normal; }
}
@media screen and (max-width: 380px) { .print-wrap .sheet, .report-view .sheet { zoom: 1.06; } }
/* قرار ١٦٤: بنود القرآن في تقرير ولي الأمر */
.p-q-list { display: grid; gap: 2.2mm; padding: 2.5mm 3mm; }
.p-q-item { border: 1px solid var(--pline); border-radius: 2.6mm; background: #fff; overflow: hidden; break-inside: avoid; }
.p-q-h { display: flex; align-items: baseline; gap: 2mm; flex-wrap: wrap; padding: 1.6mm 3mm; background: var(--pcream); border-bottom: 1px solid var(--pline); }
.p-q-h b { color: var(--pg); font-size: 10.5pt; }
.p-q-h span { color: #7a6f55; font-size: 8.6pt; }
.p-q-line { display: flex; align-items: center; gap: 2.5mm; flex-wrap: wrap; padding: 1.6mm 3mm; }
.p-q-line + .p-q-line { border-top: 1px dashed var(--pline); }
.p-q-k { color: #6a716c; font-size: 8.8pt; font-weight: 700; min-width: 22mm; }
.p-q-v { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 10pt; }
.p-q-next { background: #f7fbf8; }
.p-q-next .p-q-k { color: var(--pg); }
/* قرار ١٦٤: هدف الباقة */
.goal-preview { display: grid; gap: 4px; padding: 12px 14px; margin: 6px 0 12px; border-radius: 12px; background: var(--green-soft); border: 1px solid var(--line); }
.goal-k { font-size: 12px; color: var(--muted); font-weight: 700; }
.goal-v { font-size: 17px; font-weight: 800; color: var(--green); }
.goal-s { font-size: 13px; color: var(--muted); }
.goal-err { color: var(--danger); font-size: 14px; }
.goal-line { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 6px 0; }
.goal-line b { color: var(--text); }
/* قرار ١٦٧: حجم الباقة في نافذة الهدف */
.goal-pkg { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--line); }
.goal-pkg-n { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
/* قرار ١٧٠: «− سطر / + سطر» للورد القادم */
.qs-wrap { display: grid; gap: 6px; margin-top: 6px; }
.qs-step { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #e6cf98; }
.qs-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 1px solid #d8b058; background: #fff; color: #8a6a1f; font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; }
.qs-lbl { flex: 1; text-align: center; font-weight: 700; color: #013418; font-size: 14px; }
.qs-part { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 34px; }
.qs-part input { width: 20px; height: 20px; }
/* قرار ١٧٠: ألوان اللوجو للتقديرات (زمردي #013418، ذهبي #D0A048، عاجي #F8F8F0) */
.chip.g-excellent input:checked + span, .chip.g-complete input:checked + span { background: #013418; border-color: #013418; color: #fff; }
.chip.g-very_good input:checked + span { background: #8a6a1f; border-color: #8a6a1f; color: #fff; }
.chip.g-good input:checked + span { background: #d0a048; border-color: #d0a048; color: #013418; }
.chip.g-redo input:checked + span, .chip.g-needs_improvement input:checked + span, .chip.g-incomplete input:checked + span { background: #f2ebd7; border: 2px dashed #b08830; color: #6b5216; }
.chip.g-not_recited input:checked + span, .chip.g-none input:checked + span { background: #4f5a52; border-color: #4f5a52; color: #fff; }
.p-chip.t-excellent { color: #013418; background: #e4e8df; border-color: #bac7ba; }
.p-chip.t-very_good { color: #6b5216; background: #f2ebd7; border-color: #e6cf98; }
.p-chip.t-good { color: #6b5216; background: #f8f1df; border-color: #e6cf98; }
.p-chip.t-warn { color: #6b5216; background: #fbf6ea; border: 1px dashed #b08830; }
.p-chip.t-grey { color: #4f5a52; background: #ece9dc; border-color: #d8d3c2; }
/* قرار ١٧٠: شريط الأرقام ورحلة الباقة في تقرير ولي الأمر */
.p-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2mm; margin-bottom: 3mm; }
.p-kpi { border-radius: 3mm; padding: 2.4mm 1.5mm; text-align: center; color: #f8f8f0; background-color: #013418; background-image: repeating-linear-gradient(45deg, rgba(208,160,72,.12) 0 1px, transparent 1px 4mm); border-bottom: .8mm solid #d0a048; }
.p-kpi b { display: block; font-size: 11.5pt; color: #e6cf98; font-weight: 800; line-height: 1.4; }
.p-kpi span { font-size: 8pt; color: #d3dbd2; }
.p-journey { padding: 2.5mm 3.5mm !important; display: grid; gap: 1.6mm; }
.p-j-top { display: flex; justify-content: space-between; align-items: baseline; gap: 2mm; }
.p-j-top b { color: #013418; font-size: 10.5pt; }
.p-j-st { color: #8a6a1f; font-weight: 700; font-size: 9pt; }
.p-j-bar { height: 2.4mm; border-radius: 2mm; background: #ece9dc; overflow: hidden; }
.p-j-bar i { display: block; height: 100%; border-radius: 2mm; background: linear-gradient(90deg, #013418, #0d4426); }
.p-j-lbl { display: flex; justify-content: space-between; font-size: 8.4pt; color: #4f5a52; gap: 2mm; }

/* قرار ١٧٣: توقّع آخر الشهر */
.mo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mo-head h2 { margin: 0; }
.mo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.mo-box { border-radius: 14px; padding: 12px 14px; background: #e4e8df; display: grid; gap: 8px; }
.mo-box.gold { background: #f2ebd7; }
.mo-t { font-weight: 800; color: #013418; }
.mo-row { display: grid; gap: 2px; }
.mo-k { font-size: 13px; color: var(--muted); }
.mo-v { font-size: 20px; color: #013418; }
.mo-s { font-size: 12px; color: var(--muted); }
.mo-net { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: #013418; color: #f8f8f0; }
.mo-net b { font-size: 20px; color: #e6cf98; }
/* ١٨٠: معلم الشهر */
.tom-banner{display:flex;gap:14px;align-items:center;background:linear-gradient(135deg,#013418,#0d4426);color:#f8f8f0;border:2px solid #d0a048}
.tom-banner .tom-ic{width:52px;height:52px;flex:0 0 52px;border-radius:14px;background:#d0a048;color:#013418;display:flex;align-items:center;justify-content:center}
.tom-banner .tom-ic svg{width:28px;height:28px}
.tom-banner .tom-k{font-size:13px;color:#e6cf98;font-weight:700}
.tom-banner .tom-name{font-size:20px;font-weight:700}
.tom-banner .tom-sub{font-size:13px;color:#bac7ba}
.tom-check{margin-top:8px;font-size:13px}
.tom-check summary{cursor:pointer;font-weight:600;color:#8a6a1f}
.tom-check ul{margin:6px 0 0;padding-inline-start:18px}
.tom-check li.ok b{color:#4b6f59}.tom-check li.no b{color:#b3412e}

/* ١٨١: شهادة معلم الشهر وعلامته */
.tom-cert-btn{background:#d0a048;color:#013418;border:0;margin-inline-start:8px;vertical-align:middle}
.tom-pill{display:inline-flex;align-items:center;gap:6px;background:#f2ebd7;color:#8a6a1f;border:1px solid #e6cf98;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:700;margin-bottom:8px}
.tom-pill svg{width:14px;height:14px}
.tom-cert{max-width:720px;margin:0 auto;background:#f8f8f0;color:#013418;border:3px solid #d0a048;outline:8px solid #013418;outline-offset:-14px;border-radius:18px;padding:48px 32px;text-align:center;display:flex;flex-direction:column;gap:12px;align-items:center}
.tom-cert-logo{width:88px;height:88px;border-radius:50%;border:3px solid #d0a048;background:#fff}
.tom-cert-k{font-size:30px;font-weight:700;color:#8a6a1f}
.tom-cert-t{font-size:17px;color:#4b6f59}
.tom-cert-name{font-size:34px;font-weight:700;color:#013418;border-bottom:2px solid #d0a048;padding:4px 24px}
.tom-cert-p{max-width:520px;line-height:1.9;font-size:15px;color:#102018;margin:4px 0}
.tom-cert-sign{margin-top:14px;font-size:14px;font-weight:700;color:#8a6a1f}
@media print{.no-print{display:none!important}.tom-cert{outline-offset:-14px;margin-top:0}}

.hero-tile.clickable{cursor:pointer}
.credit-copy{display:block;font-size:11px;color:var(--muted,#6b7280);margin-top:2px;font-weight:400}
/* ١٨٤: المحادثات */
.chat-card{display:flex;flex-direction:column;gap:10px;padding:10px}
.chat-box{display:flex;flex-direction:column;gap:8px;max-height:60vh;min-height:240px;overflow-y:auto;padding:6px}
.chat-msg{max-width:80%;padding:8px 12px;border-radius:14px;line-height:1.7;white-space:pre-wrap;word-break:break-word}
.chat-msg.mine{align-self:flex-start;background:#013418;color:#f8f8f0;border-end-start-radius:4px}
.chat-msg.theirs{align-self:flex-end;background:var(--surface-2,#f2ebd7);color:var(--fg,#102018);border:1px solid var(--line,#e3ddc8);border-end-end-radius:4px}
.chat-at{font-size:11px;opacity:.7;margin-top:2px}
.chat-input{display:flex;gap:8px;align-items:flex-end}
.chat-input textarea{flex:1;min-width:0}
/* قرار ١٨٩: اقتراحات السورة — نفس الشكل على كل الأجهزة */
.surah-search { position: relative; }
.sur-sug { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 260px; overflow-y: auto; padding: 4px; display: grid; }
.sur-sug[hidden] { display: none; }
.sur-opt { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: start; cursor: pointer; }
.sur-opt.on, .sur-opt:hover { background: var(--gold-soft); }
.sur-n { min-width: 28px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* قرار ١٩٠: تنبيه الباقات */
.pk-alerts { display: grid; gap: 12px; margin-bottom: 14px; }
.pk-alerts > .card { margin-bottom: 0; }
.pk-ended { background: linear-gradient(0deg, var(--surface), #fdecea); border-color: #e9b7b2; }
:root[data-theme="dark"] .pk-ended { background: var(--surface); border-color: #7a2c26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pk-ended { background: var(--surface); border-color: #7a2c26; } }
@media (min-width: 1100px) { .pk-alerts { grid-template-columns: 1fr 1fr; align-items: start; } }
/* قرار ١٩٢ (١): أول شاشة على الموبايل — شريط صغير بدل الكارت الكبير، فالحصص والمطلوب يبانوا على طول */
@media (max-width: 699px) {
  .hero { padding: 12px 14px; border-radius: 16px; margin-bottom: 12px; }
  .hero-top { gap: 10px; align-items: center; }
  .hero-logo { display: none; }
  .hero-greet { font-size: 12px; margin-bottom: 1px; } /* ٢١٦: يظهر على الموبايل زي اللاب */
  .hero-name { font-size: 1.15rem !important; line-height: 1.3; }
  .hero-role { margin-top: 2px; font-size: 11px; padding: 1px 8px; }
  .hero > .hero-date { margin-top: 4px; flex-direction: row; gap: 8px; font-size: 12px; }
  .hero-tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 10px; }
  .hero-tile { padding: 7px 4px; border-radius: 10px; }
  .hero-tile .v { font-size: 1.2rem !important; }
  .hero-tile .k { font-size: 11px !important; margin-top: 2px; line-height: 1.3; }
  .hero-mini, .hero-mini:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 8px; padding-top: 8px; }
  .hero-mini .k { font-size: 10.5px; line-height: 1.3; } .hero-mini .v { font-size: .85rem; }
  .hero-word { margin-top: 8px; padding-top: 8px; gap: 2px 8px; } /* ٢١٦: العبارة اليومية تظهر على الموبايل كمان (ندا) */
  .hero-word-t { font-size: .88rem; line-height: 1.7; }
  .hero-word-s { font-size: 11px; }
}
/* قرار ١٩٢ (٣): «أدائي هذا الشهر» مطوي */
.exc-fold > summary { list-style: none; cursor: pointer; align-items: center; min-height: 32px; }
.exc-fold > summary::-webkit-details-marker { display: none; }
.exc-fold > summary::after { content: '▾'; color: var(--muted); margin-inline-start: 6px; transition: transform .15s; }
.exc-fold[open] > summary::after { transform: rotate(180deg); }
/* قرار ١٩٢ (٤): زرار «إجراء» على كارت الحصة */
.list:has(.lesson-quick) { overflow: visible; }
.lesson-quick .btn { min-height: 34px; }
/* قرار ١٩٢ (٨): شريط أقسام التقرير الثابت */
.qf-progress { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 6; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.qf-pstep { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border: 0; border-radius: 8px; background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qf-pn { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 11px; }
.qf-pstep.ok { background: var(--green-soft); color: var(--green); }
.qf-pstep.ok .qf-pn { background: var(--green); color: #fff; font-size: 0; }
.qf-pstep.ok .qf-pn::before { content: '✓'; font-size: 12px; }
@media (min-width: 900px) { .qf-progress { top: 72px; } }
.push-devs .task-items li { list-style: none; }
/* قرار ١٩٣: صفحة التنبيهات */
.notif-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.tab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #1c1c1c; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.tab-n.red { background: #c9372c; color: #fff; }
.notif-row { gap: 10px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: transparent; }
.notif-row.unread .notif-dot { background: var(--gold); }
.notif-row.todo .notif-dot { background: #c9372c; }
.notif-row.read { opacity: .78; }
.notif-row.read .title { font-weight: 500; }
/* قرار ١٩٩: ملخص اليوم + أيقونات أقسام التنبيهات */
.ds-card { padding: 12px 14px; }
.ds-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ds-cell { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .12s, border-color .12s; }
.ds-cell:hover { border-color: var(--green-2); transform: translateY(-1px); }
.ds-cell b { font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ds-cell span { font-size: 12px; color: var(--muted); }
.ds-cell.green b { color: var(--green); } .ds-cell.gold b { color: #a5780f; } .ds-cell.red { border-color: #efb3ad; } .ds-cell.red b { color: #c9372c; }
.notif-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.notif-ic svg { width: 18px; height: 18px; }
.g-rep { --gc: #1d58a0; --gs: #e3eefb; } .g-mk { --gc: #a2470a; --gs: #fde8d6; } .g-pk { --gc: #a8231b; --gs: #fbe3e1; } .g-sch { --gc: #6b3fa0; --gs: #efe6fa; } .g-oth { --gc: #5e6a63; --gs: #eef0ee; }
.notif-ic { background: var(--gs); color: var(--gc); }
.notif-row.read .notif-ic { opacity: .6; }
.notif-row.unread .title::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-inline-start: 6px; vertical-align: middle; }
.notif-row.todo .title::after { background: #c9372c; }
.notif-ghead { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; color: var(--gc); }
.notif-ghead svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .ds-cell { background: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ds-cell { background: var(--surface); } }
/* قرار ٢٠٠: المحادثات — اسم اللي بعت، والمرفقات، والتسجيل الصوتي */
.chat-from { font-size: 12px; font-weight: 700; color: var(--green); margin-bottom: 2px; }
.chat-file { margin: 2px 0 4px; }
.chat-img { display: block; max-width: min(260px, 100%); max-height: 260px; border-radius: 10px; cursor: zoom-in; background: rgba(0,0,0,.05); min-height: 60px; }
.chat-audio { width: min(260px, 100%); height: 36px; }
.chat-doc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; max-width: 100%; }
.chat-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-doc small { color: var(--muted); }
.chat-msg.mine .chat-doc { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.chat-input .iconbtn { flex-shrink: 0; color: var(--green); min-width: 40px; min-height: 40px; }
.chat-mic.rec { color: #fff; background: #c9372c; border-radius: 50%; animation: q-pulse 1s ease-in-out infinite; }
@keyframes q-pulse { 50% { box-shadow: 0 0 0 6px rgba(201,55,44,.18); } }
.chat-ta { resize: none; max-height: 140px; }
.chat-status:empty { display: none; }
/* ٢٠٠: أي أيقونة من غير مقاس جوه زرار (كانت بتختفي — الميكروفون والمحادثات) */
.iconbtn svg:not([width]), .btn svg:not([width]), .glance-acts svg:not([width]) { width: 20px; height: 20px; }
/* ٢٠٢: تنبيه التجديد جوه التقرير */
.p-renew { margin: 3mm 0; padding: 2.4mm 4mm; border-radius: 3mm; background: #fdf3df; border: 1px solid #ecd49a; color: #6b4e0c; font-size: 10.5pt; line-height: 1.7; }
/* ٢٠٣: شرح أعمدة المعلمين */
.fin-explain { margin-top: 10px; font-size: 13px; line-height: 1.8; }
.fin-explain p { margin: 0 0 4px; }
.fin-total { padding: 8px 10px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
/* ٢٠٤: حذف رسالة ومراجعة الرسالة الصوتية */
.chat-delbtn { border: 0; background: none; color: inherit; opacity: .6; font: inherit; font-size: 11px; cursor: pointer; padding: 0 6px; text-decoration: underline; }
.chat-delbtn:hover { opacity: 1; }
.chat-msg.deleted .chat-del { font-style: italic; opacity: .7; }
.chat-recbar, .chat-preview { display: flex; gap: 8px; align-items: center; padding: 8px 0; flex-wrap: wrap; }
.chat-recbar[hidden], .chat-preview[hidden] { display: none; }
.chat-preview audio { flex: 1; min-width: 180px; }
/* ===== قرار ٢٠٥: المحادثة بشكل تطبيقات المحادثة، وواضحة في الوضع الداكن ===== */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 12px; }
.chat-head .avatar { width: 40px; height: 40px; }
.chat-head .iconbtn { font-size: 20px; }
.chat-card { padding: 0; overflow: hidden; gap: 0; }
.chat-box { padding: 12px 10px; gap: 6px; min-height: 52vh; max-height: calc(100vh - 290px); background: var(--chat-bg); }
.chat-msg { position: relative; max-width: 82%; padding: 6px 10px 4px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chat-msg.mine { background: var(--chat-mine); color: var(--chat-mine-fg); border: 0; border-end-start-radius: 3px; }
.chat-msg.theirs { background: var(--chat-theirs); color: var(--chat-theirs-fg); border: 1px solid var(--line); border-end-end-radius: 3px; }
.chat-msg .chat-at { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 10.5px; opacity: .75; margin-top: 2px; }
.chat-msg.theirs .chat-from { color: var(--green); }
.chat-day { align-self: center; margin: 8px 0 4px; }
.chat-day span { display: inline-block; padding: 3px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.chat-input { padding: 8px; gap: 6px; align-items: flex-end; border-top: 1px solid var(--line); background: var(--surface); }
.chat-input[hidden] { display: none; }
.chat-input .chat-ta { border-radius: 20px; padding: 9px 14px; min-height: 42px; background: var(--bg); }
.chat-round { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; font-size: 20px; font-weight: 700; background: var(--green); color: #fff; }
.chat-round[hidden] { display: none; }
.chat-round.mic { background: var(--green); color: #fff; }
.chat-round.mic svg { width: 22px; height: 22px; }
.chat-round.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.chat-rec-live { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 22px; background: var(--bg); }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9372c; animation: q-pulse 1s ease-in-out infinite; }
.chat-rec-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.chat-preview .chat-audio { flex: 1; min-width: 0; }
:root { --chat-bg: #f4f1e8; --chat-mine: #0f4a32; --chat-mine-fg: #f8f8f0; --chat-theirs: #ffffff; --chat-theirs-fg: #17251e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chat-bg: #0f1713; --chat-mine: #1f6b4a; --chat-mine-fg: #f3f6f4; --chat-theirs: #1d2a24; --chat-theirs-fg: #e8ece9; } }
:root[data-theme="dark"] { --chat-bg: #0f1713; --chat-mine: #1f6b4a; --chat-mine-fg: #f3f6f4; --chat-theirs: #1d2a24; --chat-theirs-fg: #e8ece9; }
.chat-msg.mine .chat-delbtn { color: var(--chat-mine-fg); }
@media (max-width: 699px) { .chat-box { max-height: calc(100vh - 270px); min-height: 50vh; } }
:root[data-theme="dark"] .chat-msg.theirs .chat-from { color: var(--brand-gold-2, #d0a048); }
.earn-sum { display: grid; gap: 4px; }

/* قرار ٢٠٩–٢١١: الشات — الدور، تبويب الخاص، نص الفويس */
.chat-role{display:inline-block;margin-inline-start:6px;padding:0 7px;border-radius:999px;font-size:11px;font-weight:600;background:var(--green-soft);color:var(--green)}
.chat-role.r-supervisor{background:var(--gold-soft);color:var(--warn)}
.chat-tabs{display:flex;gap:6px;margin:0 0 8px}
.chat-tab{flex:1;text-align:center;padding:7px 10px;border-radius:10px;border:1px solid var(--line);background:var(--surface);font-size:13px;text-decoration:none;color:var(--text)}
.chat-tab.on{background:var(--green);border-color:var(--green);color:#fff;font-weight:600}
.chat-stt{margin-top:4px;font-size:13px;line-height:1.6;white-space:pre-wrap;opacity:.9;border-inline-start:3px solid currentColor;padding-inline-start:8px}
.chat-sttbtn{margin-top:4px;background:none;border:0;padding:2px 0;font-size:12px;color:inherit;opacity:.75;text-decoration:underline;cursor:pointer}
.chat-totext{font-size:13px;font-weight:700}
.chat-who{overflow-wrap:anywhere}
.sup-perf{display:grid;gap:6px;margin:8px 0}
.sup-perf-row{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;font-size:13px;padding:8px 10px;border-radius:10px;background:var(--bg)}

/* قرار ٢١٤: علامات الرسالة */
.chat-tick{display:inline-flex;vertical-align:middle;margin-inline-start:4px;opacity:.75}
.chat-tick.t-seen{color:var(--chat-seen);opacity:1}
.chat-msg.mine .chat-tick.t-seen{color:#8fd3ff}
/* ٢٣٧: «حصتك الجاية» */
.next-card { border: 2px solid var(--gold, #c9a227); }
.next-card.urgent { border-color: #d9534f; background: var(--danger-soft, #fdf1ef); }
.next-who { display: flex; align-items: center; gap: 12px; margin-top: 8px; text-decoration: none; color: inherit; }
.next-time { font-size: 1.3rem; font-weight: 700; min-width: 64px; }
.pk-more > summary { cursor: pointer; font-size: .9rem; color: var(--muted, #667); margin-top: 6px; }
/* ٢٣٧: التفاعل على رسايل الشات */
.chat-msg { position: relative; }
.chat-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chat-rx-chip { border: 1px solid var(--line, #ddd); background: #fff; border-radius: 999px; padding: 1px 7px; font-size: .95rem; line-height: 1.5; cursor: pointer; }
.chat-rx-chip.mine { border-color: var(--gold, #c9a227); background: #fbf5e3; }
.chat-rx-chip small { margin-inline-start: 3px; font-size: .75rem; color: var(--muted, #667); }
.chat-rxbtn { background: none; border: 0; cursor: pointer; font-size: 1rem; opacity: .55; padding: 0 4px; }
.chat-rxbtn:hover { opacity: 1; }
.chat-rx-pick { position: absolute; bottom: 100%; inset-inline-end: 0; z-index: 5; display: flex; gap: 2px; background: #fff; border: 1px solid var(--line, #ddd); border-radius: 999px; padding: 4px 6px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.chat-rx-pick button { background: none; border: 0; font-size: 1.35rem; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.chat-rx-pick button:hover { background: #f3efe3; }
/* ٢٤٣: عدّاد استهلاك القراءة */
.meter { height: 10px; border-radius: 999px; background: var(--line, #e5e5da); overflow: hidden; margin: 6px 0 10px; }
.meter > i { display: block; height: 100%; border-radius: 999px; }
/* ٢٤٨: دليل القرارات أقسام مقفولة */
.guide-sec { border-top: 1px solid var(--line, #e5e5da); padding: 8px 0; }
.guide-sec:first-child { border-top: 0; }
.guide-sec > summary { cursor: pointer; font-weight: 600; line-height: 1.6; }

/* قرار ٢٤٩: متصل الآن + لوحة الإيموجي في الشات */
.chat-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2fb36d; box-shadow: 0 0 0 2px #fff; margin-inline-start: 6px; vertical-align: middle; }
.chat-pres { font-weight: 400; color: var(--muted, #667); margin-inline-start: 6px; }
.chat-at { position: relative; }
.chat-emoji-pick { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 6px; z-index: 6; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--surface, #fff); border: 1px solid var(--line, #ddd); border-radius: 12px; padding: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.14); max-width: min(330px, calc(100vw - 40px)); }
.chat-emoji-pick button { background: none; border: 0; font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 5px 2px; border-radius: 8px; }
.chat-emoji-pick button:hover { background: var(--line, #f3efe3); }
.chat-input { position: relative; }
.chat-emo { font-size: 1.25rem; }

/* قرار ٢٥٠: الرد على رسالة، والسحب والإفلات */
.chat-quote { display: block; width: 100%; text-align: start; border: 0; border-inline-start: 3px solid var(--gold, #c9a227); background: rgba(0,0,0,.05); border-radius: 8px; padding: 4px 8px; margin-bottom: 4px; cursor: pointer; font: inherit; color: inherit; }
.chat-quote b { display: block; font-size: .78rem; color: var(--gold-ink, #8a6a1f); }
.chat-quote span { display: block; font-size: .85rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-replybar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--line); border-inline-start: 3px solid var(--gold, #c9a227); background: var(--surface); }
.chat-replybar[hidden] { display: none; }
.chat-flash { animation: chatFlash 1.4s ease; }
@keyframes chatFlash { 0%, 60% { box-shadow: 0 0 0 3px var(--gold, #c9a227); } 100% { box-shadow: none; } }
.chat-card.chat-drop { outline: 2px dashed var(--gold, #c9a227); outline-offset: -6px; }

/* قرار ٢٥٢: ردود سريعة + التوجيه */
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 8px 0; border-top: 1px solid var(--line); background: var(--surface); scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--fg, inherit); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chat-quick button:hover { border-color: var(--gold, #c9a227); }
.chat-assigned { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--gold-ink, #8a6a1f); background: rgba(201,162,39,.14); border-radius: 999px; padding: 1px 8px; margin-bottom: 4px; }
/* قرار ٢٥٤: تقييم اليوم والمطلوب للحصة القادمة في كارتين */
.p-q-eval { justify-content: space-between; }
.p-q-eval .p-q-k { flex: 1 1 auto; display: flex; flex-direction: column; gap: .3mm; }
.p-q-eval .p-q-k b { color: var(--pg); font-size: 10pt; }
.p-q-eval .p-q-k small { color: #7a6f55; font-size: 8.2pt; font-weight: 400; }
.p-q-eval .p-redo { flex-basis: 100%; }
.p-q-next .p-q-k { min-width: 26mm; }
.p-q-v.muted { color: #7a7f7b; font-weight: 400; flex: 0 0 auto; }
/* قرار ٢٥٥: بند واحد = اسمه وتقييمه، وتحته ورد المرة القادمة */
.p-qi-list { display: grid; }
.p-qi { padding: 2.2mm 3mm; display: grid; gap: 1.2mm; }
.p-qi + .p-qi { border-top: 1px solid var(--pline); }
.p-qi-top { display: flex; align-items: center; justify-content: space-between; gap: 2mm; flex-wrap: wrap; }
.p-qi-top b { color: var(--pg); font-size: 10.5pt; }
.p-qi-none { color: #7a7f7b; font-size: 9pt; }
.p-qi-redo { color: #8a5a12; font-size: 9pt; }
.p-qi-next { display: flex; align-items: baseline; gap: 2mm; flex-wrap: wrap; background: #f5faf6; border-radius: 1.6mm; padding: 1.4mm 2.4mm; }
.p-qi-next span { color: #6a716c; font-size: 8.6pt; font-weight: 700; }
.p-qi-next b { font-size: 10pt; min-width: 0; }

/* ٢٥٩: شريط النسخة الجديدة */
.newver-bar { position: fixed; inset: auto 12px calc(76px + env(safe-area-inset-bottom, 0px)) 12px; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 460px; margin: 0 auto; padding: 10px 14px; border-radius: 14px; background: var(--brand-emerald, #013418); color: #fff; box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); font-weight: 600; }
.newver-bar .btn { background: #fff; color: var(--brand-emerald, #013418); }
/* ٢٥٩: تقرير الاختبار */
.exam-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0; border-top: 1px solid var(--line, #e3e6df); }
.exam-row:first-of-type { border-top: 0; }
.exam-row > b { font-size: 14px; }
.stack > .exam-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
@media (max-width: 560px) { .stack > .exam-row { grid-template-columns: minmax(0, 1fr) auto; } .stack > .exam-row > .chips { grid-column: 1 / -1; order: 3; } }
.rep-mode { margin-bottom: 10px; }
.p-exam-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-exam-t td { padding: 6px 4px; border-top: 1px solid #e8e4d8; vertical-align: top; }
.p-exam-t td:first-child { font-weight: 700; white-space: nowrap; }
/* ٢٦٠: التجويد واختبار القرآن */
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips.multi .chip input { position: absolute; opacity: 0; pointer-events: none; }
.exam-sec { border-top: 1px solid var(--line, #e3e6df); padding: 12px 0 4px; display: grid; gap: 6px; }
.exam-total { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface, #f6f6ef); font-size: 15px; }
/* ٢٦١: المقابلة */
.iv-q { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line, #e3e6df); }
.iv-sec .iv-q:first-of-type { border-top: 0; }
.iv-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iv-score { text-align: center; } .iv-score b { display: block; font-size: 26px; color: var(--green); }
/* ٢٦٤: اختر موعدك */
.bk-card h1 { font-size: 1.35rem; margin: 0 0 4px; }
.bk-day { margin-top: 14px; }
.bk-times { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bk-time { border: 1.5px solid var(--line, #dfe3da); background: var(--surface, #fff); color: inherit; border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; min-width: 110px; }
.bk-time.on { background: var(--green); border-color: var(--green); color: #fff; }
.bk-done { text-align: center; padding: 10px 0; } .bk-ok { font-size: 44px; color: var(--green); }
/* ٢٦٦: الإقرار بالصوت */
.ack-pledge { background: var(--surface, #f6f6ef); border: 1px solid var(--line, #dfe3da); border-radius: 12px; padding: 12px 14px; line-height: 2; font-size: 16px; margin-bottom: 10px; }
/* ٢٦٩: لوحة الإدارة */
.db-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.db-head h1 { margin: 0; font-size: 1.5rem; }
.db-sec { margin-top: 18px; }
.db-sec > h2 { font-size: 1rem; margin: 0 0 8px; color: var(--muted, #5d6b63); font-weight: 700; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.db-tile { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--line, #e3e6df); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.db-tile:hover { border-color: var(--green); transform: translateY(-1px); }
.db-tile b { font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.db-tile span { font-size: 13.5px; color: var(--muted, #5d6b63); }
.db-tile small { font-size: 12px; color: var(--muted, #5d6b63); }
.db-tile.t-good b { color: var(--green); } .db-tile.t-warn b { color: #a86b00; } .db-tile.t-bad b { color: #b3261e; }
.db-tile.t-warn { border-inline-start: 3px solid #d39b2a; } .db-tile.t-bad { border-inline-start: 3px solid #c0392b; }
.db-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 760px) { .db-two { grid-template-columns: 1fr; } }
.db-chart-wrap { position: relative; background: var(--card, #fff); border: 1px solid var(--line, #e3e6df); border-radius: 14px; padding: 12px; }
.db-chart svg { width: 100%; height: auto; display: block; }
.db-fill { fill: var(--green); opacity: .85; } .db-bar.on .db-fill { opacity: 1; }
.db-axis { stroke: var(--line, #dfe3da); stroke-width: 1; }
.db-xl, .db-yl { font-size: 10px; fill: var(--muted, #5d6b63); text-anchor: middle; font-family: inherit; } .db-yl { text-anchor: end; }
.db-tip { position: absolute; top: 6px; background: var(--ink, #14241c); color: var(--bg, #fff); font-size: 12.5px; padding: 4px 8px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
.db-tbl summary { font-size: 12.5px; color: var(--muted, #5d6b63); cursor: pointer; margin-top: 6px; }
.db-tbl table { width: 100%; font-size: 13px; border-collapse: collapse; } .db-tbl td { padding: 3px 4px; border-top: 1px solid var(--line, #e3e6df); }
.db-table-wrap { overflow-x: auto; background: var(--card, #fff); border: 1px solid var(--line, #e3e6df); border-radius: 14px; }
.db-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.db-table th, .db-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line, #e3e6df); font-variant-numeric: tabular-nums; }
.db-table th { font-size: 12.5px; color: var(--muted, #5d6b63); font-weight: 600; }
.db-table td.t-warn { color: #a86b00; font-weight: 700; }
/* ٢٧٠: موعد تعويض قريب من حصة الطالب */
.chip.near { border-style: dashed; border-color: var(--warn); }
/* ٢٧١: الإشعار اللي إجراءه اتعمل يبهت */
.notif-row.done { opacity: .5; }
.notif-row.done .title { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
/* ٢٧٤: التسميع أول حاجة في صفحة المتابعة */
.pt-recite { border: 2px solid var(--gold, #c9a227); }
.green-text { color: var(--ok, #1f7a3a); }
/* ٣٠٤: شاشة المواعيد الجديدة — الوقت المختار كان مش باين */
.sched-grid button.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.sched-grid button.chip.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }

/* ٣٦٧: شريط تكريم معلم الشهر — جملة قصيرة رايحة جاية فوق المنصة كلها */
.tom-ribbon{display:flex;align-items:center;gap:10px;background:linear-gradient(90deg,#013418,#0d4426 50%,#013418);color:#f3e7c6;border-bottom:1px solid #d0a048;padding:0 10px;height:36px;overflow:hidden;font-size:14px}
.tom-ribbon[hidden]{display:none}
.tom-rb-view{position:relative;flex:1 1 auto;min-width:0;height:100%;overflow:hidden}
.tom-rb-item{position:absolute;top:50%;left:0;display:inline-flex;align-items:center;gap:8px;white-space:nowrap;font-weight:700;animation:tomswing 9s ease-in-out infinite alternate}
.tom-ribbon:hover .tom-rb-item{animation-play-state:paused}
.tom-rb-star{color:#e6c477;font-style:normal;font-size:12px}
.tom-rb-cert{flex:0 0 auto;color:#013418;background:#f3e7c6;border-radius:8px;padding:3px 10px;font-weight:800;font-size:12px;text-decoration:none;white-space:nowrap}
.tom-rb-cert:hover{background:#fff}
@keyframes tomswing{from{left:0;transform:translate(0,-50%)}to{left:100%;transform:translate(-100%,-50%)}}
@media (prefers-reduced-motion: reduce){.tom-rb-item{animation:none;left:50%;transform:translate(-50%,-50%)}}
@media (max-width:600px){.tom-ribbon{height:32px;font-size:13px;padding:0 6px}}
@media print{.tom-ribbon{display:none}}

/* ٣٦٩: نافذة الصرف */
.pay-row{display:flex;align-items:center;gap:10px}
.pay-amount{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-bottom:12px}
.pay-amount .small{flex-basis:100%}
.pay-big{font-size:28px;font-weight:800;color:var(--ink-green)}
.pay-dest{display:flex;flex-direction:column;gap:6px;border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin-bottom:12px}
.pay-acc{font-size:20px;letter-spacing:.5px}

/* ٣٧٢: احتفال معلم الشهر */
.tom-party{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:2000}
.tom-rb-mute{flex:0 0 auto;background:transparent;border:0;color:#f3e7c6;font-size:14px;cursor:pointer;padding:2px 4px;line-height:1}
.tom-honor-back{position:fixed;inset:0;background:rgba(1,52,24,.55);display:flex;align-items:center;justify-content:center;z-index:1999;padding:16px}
.tom-honor{background:linear-gradient(160deg,#013418,#0d4426);color:#f3e7c6;border:2px solid #d0a048;border-radius:18px;max-width:380px;width:100%;padding:26px 22px;text-align:center;animation:tomrise .5s ease-out}
.tom-honor-star{font-size:54px;color:#e6c477;line-height:1;margin-bottom:6px;animation:tomspin 2.4s ease-in-out infinite alternate}
.tom-honor-k{font-size:14px;font-weight:700;color:#e6c477}
.tom-honor-name{font-size:28px;font-weight:800;margin:4px 0 8px}
.tom-honor-p{font-size:14px;color:#dfe8df;margin:0 0 16px;line-height:1.8}
.tom-honor-actions{display:flex;gap:8px;justify-content:center}
.tom-honor-actions .btn{background:#d0a048;color:#013418;border:0}
.tom-honor-actions .btn.secondary{background:transparent;color:#f3e7c6;border:1px solid #d0a048}
@keyframes tomrise{from{transform:translateY(24px) scale(.96);opacity:0}to{transform:none;opacity:1}}
@keyframes tomspin{from{transform:rotate(-8deg) scale(1)}to{transform:rotate(8deg) scale(1.08)}}
@media print{.tom-party,.tom-honor-back{display:none}}

/* ٣٧٣: اختيار طريقة الصرف والوصل */
.pay-dest{cursor:pointer;position:relative}
.pay-dest input[type=radio]{position:absolute;inset-inline-end:12px;top:12px;width:18px;height:18px}
.pay-dest.on{border-color:var(--ink-green);box-shadow:0 0 0 1px var(--ink-green)}
.pay-alts{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.receipt-prev img{max-width:100%;max-height:220px;border-radius:10px;margin-top:8px;border:1px solid var(--line)}
.receipt-view{display:flex;flex-direction:column;gap:10px;align-items:center}
.receipt-view img{max-width:100%;max-height:70vh;border-radius:10px;border:1px solid var(--line)}
.pay-acc{overflow-wrap:anywhere;word-break:break-all;min-width:0}
.pay-dest > .row{min-width:0}
.modal input[type=file]{max-width:100%;font-size:13px}
.pay-dest .pill{align-self:flex-start}

/* ٤٠٩: جدول أوقات التفرغ بالنص ساعات */
.av-tabs { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 4px; margin: 8px 0; }
.av-tabs::-webkit-scrollbar { display: none; }
.av-tab { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; min-height: 44px; }
.av-tab.active { border-color: var(--green); background: var(--green); color: #fff; }
.av-tab.dirty::after { content: '•'; color: var(--gold); font-size: 18px; line-height: 0; margin-top: 2px; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.av-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; text-align: center; }
.av-cell b { color: var(--text); font-size: 13px; }
.av-cell .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.av-cell.on { border-style: solid; border-color: #9fd3b8; background: #e8f6ee; color: #1f7a55; }
.av-cell.booked { border-style: solid; border-color: #9cbbe0; background: #e8f0fa; color: #2b5a91; cursor: not-allowed; }
.av-cell.prayer:not(.on):not(.booked) { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, rgba(128,128,128,.08) 6px, rgba(128,128,128,.08) 12px); }
.av-cell.once:not(.booked) { border-style: solid; border-color: #e0c98f; background: #fbf4e2; color: #8a6a1c; } /* ٤١٤: حصة هذا الأسبوع (تعويض/تجريبية) */
:root[data-theme="dark"] .av-cell.once:not(.booked) { background: #3a3018; color: #e8d39a; border-color: #6b5a2c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av-cell.once:not(.booked) { background: #3a3018; color: #e8d39a; border-color: #6b5a2c; } }
.av-cell.added { box-shadow: inset 0 0 0 2px #1f7a55; }
.av-cell.removed { box-shadow: inset 0 0 0 2px var(--danger); }
.av-cell:disabled { cursor: default; }
.av-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.av-legend .av-cell { min-height: 0; padding: 2px 8px; flex-direction: row; cursor: default; }
.av-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: var(--bg); z-index: 2; }
@media (max-width: 899px) { .av-bar { bottom: 64px; } }
@media (max-width: 699px) { .av-grid { grid-template-columns: repeat(3, 1fr); } }
:root[data-theme="dark"] .av-cell.on { background: #143a2a; color: #9fe0bf; border-color: #2c6b4d; }
:root[data-theme="dark"] .av-cell.booked { background: #172a42; color: #a9c8ee; border-color: #2d4d75; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av-cell.on { background: #143a2a; color: #9fe0bf; border-color: #2c6b4d; } :root:not([data-theme="light"]) .av-cell.booked { background: #172a42; color: #a9c8ee; border-color: #2d4d75; } }

.av-night { margin: 0 0 8px; }
.av-night summary { cursor: pointer; padding: 6px 0; color: var(--muted); }
.av-night .av-grid { margin-top: 6px; }
.av-cell.prayer:not(.on):not(.booked) { cursor: not-allowed; }
/* ٤٢٠: الواجب */
.hw-box { margin-top: 14px; }
.hw-parts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.hw-part { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.hw-img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--line); display: block; margin: 6px 0; }
/* ٤٣٦: علوم القرآن في تقرير الطالب — بطاقة السورة وكلمة اليوم والتدبّر و«اختبر فهمك» */
.p-sci { padding: 8px 0; border-top: 1px dashed #e4e0d4; }
.p-sci:first-of-type { border-top: 0; padding-top: 0; }
.p-sci > b { display: block; color: #0a5a3c; margin-bottom: 4px; }
.p-sci-surah .p-tags { margin: 4px 0 6px; }
.p-quiz { border: 1px solid #c49a3c; background: #fffaf0; }
.p-quiz-a { margin-top: 8px; }
.p-quiz-a summary { cursor: pointer; font-weight: 700; color: #0a5a3c; padding: 8px 12px; border-radius: 10px; background: #e8f0eb; display: inline-block; list-style: none; }
.p-quiz-a summary::-webkit-details-marker { display: none; }
.p-quiz-a[open] summary { margin-bottom: 6px; }
@media print { .p-quiz-a { display: block; } }
/* ٤٣٦: «سمّع الورد المطلوب؟» وعلوم القرآن في نموذج التقرير */
.ward-check { margin-top: 8px; display: grid; gap: 6px; }
.ward-check .qt-ayrow { margin-top: 0; flex-wrap: wrap; }
.ward-check .qt-ayrow .qt-ay { flex: 0 0 110px; width: 110px; }
.sci-pair[hidden], .sci-surah[hidden], .sci-wq[hidden], .qt-ayrow[hidden], .ward-check[hidden], .ward-why[hidden] { display: none; } /* ٤٥٩ */
.ward-why { margin-top: 6px; }
.sci-pair { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.sci-pair.book { grid-template-columns: 2fr 1fr; } /* ٤٣٨ */
@media (max-width: 600px) { .sci-pair, .sci-pair.book { grid-template-columns: 1fr; } }
/* ٤٣٨: شريط تقدّم كتاب القرائية */
.p-bar { height: 9px; border-radius: 6px; background: #e8f0eb; overflow: hidden; margin-top: 4px; }
.p-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #4f9873, #0a5a3c); border-radius: 6px; }
.p-book { display: grid; gap: 2px; }
.sci-surah { border: 1px dashed var(--line, #ddd); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.sci-wq.missing, .sci-surah.missing { outline: 2px solid var(--danger, #c0392b); outline-offset: 4px; border-radius: 10px; }
.p-ref { font-size: 9pt; color: #6b6b6b; margin-top: 4px; }

/* ٤٣٩ج: الإرسال بالتتابع — الرسالة الحالية فوق */
.wa-queue { border: 2px solid var(--green); border-radius: 14px; padding: 10px 12px 2px; margin-bottom: 14px; background: var(--green-soft); }
.wa-queue .wa-card { margin-top: 8px; }

/* ٤٤٢: اقتراح للاسترشاد تحت «معلومة اليوم» — باهت */
.sci-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted, #8a8f8c); opacity: .85; line-height: 1.6; }

/* ===== ٤٤٦ (ندا ١٩/١١: «أيقونات أقل… شكل احترافي يليق بمنصة قرآن»): قائمة خضرا بزخرفة خفيفة + تبويبات «أقراص» ===== */
.nav-main, .nav-bottom { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 900px) {
  .sidenav { display: flex; flex-direction: column; background: linear-gradient(180deg, #1d4a3c 0%, #163b30 100%); border: 0; color: #e9f1ec; position: sticky; overflow: hidden auto; }
  .sidenav::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1'%3E%3Cpath d='M30 4 37 23 56 30 37 37 30 56 23 37 4 30 23 23z'/%3E%3Ccircle cx='30' cy='30' r='9'/%3E%3C/g%3E%3C/svg%3E"); }
  .sidenav > * { position: relative; }
  .sidenav a { color: #e9f1ec; padding: 11px 14px; font-size: 15.5px; border-radius: 12px; margin: 1px 0; }
  .sidenav a svg { color: #cfe3d8; width: 21px; height: 21px; }
  .sidenav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sidenav a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 700; box-shadow: inset -3px 0 0 var(--gold); }
  .sidenav a.active svg { color: #fff; }
  .sidenav .nav-bottom { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.14); }
  .sidenav .nav-count { background: var(--gold); color: #fff; border-color: transparent; }
  .sidenav .credit { color: rgba(233,241,236,.6); }
}
.drawer-menu .nav-bottom { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.drawer-menu a { font-weight: 500; }
.drawer-menu a.active { box-shadow: inset -3px 0 0 var(--gold); }
/* التبويبات فوق الصفحة */
.section-tabs.hub-tabs { border-bottom: 0; gap: 8px; margin: 0 0 16px; padding: 2px 0 4px; }
.hub-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 500; font-size: 14px; margin: 0; }
.hub-tabs a:hover { border-color: var(--green-2); color: var(--green); }
.hub-tabs a.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.hub-tabs a .nav-count { margin: 0; height: 18px; min-width: 18px; padding: 0 6px; font-size: 11px; background: var(--danger); color: #fff; border: 0; }
.hub-tabs a.active .nav-count { background: var(--gold); }
:root[data-theme="dark"] .sidenav { background: linear-gradient(180deg, #112a22 0%, #0d211b 100%); }
:root[data-theme="dark"] .sidenav a.active { color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
:root[data-theme="dark"] .hub-tabs a { background: var(--surface); color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .hub-tabs a.active { background: var(--green-2); border-color: var(--green-2); color: #fff; }
/* ٤٦٦: الشهادات حسب السن */
.cx { max-width: 960px; margin: 0 auto; text-align: center; position: relative; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cx img { width: 76px; height: 76px; margin: 0 auto; display: block; }
.cx h1, .cx p, .cx .cx-name { position: relative; text-wrap: balance; }
.cx .cx-name { overflow-wrap: anywhere; }
.cx-foot { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; margin-top: 16px; position: relative; }
.cx-foot > div { flex: 1 1 150px; } .cx-foot b, .cx-foot small { display: block; white-space: nowrap; }
.cx-kid { background: #fff6e2; border: 10px solid #f2b63c; border-radius: 30px; box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 9px #2f9e7a; padding: 34px 26px; font-family: 'Baloo Bhaijaan 2', var(--font-deco); color: #3b5a4d; }
.cx-kid h1 { font: 800 clamp(28px, 6vw, 48px)/1.3 'Baloo Bhaijaan 2', var(--font-deco); color: #d9691c; margin: 4px 0; }
.cx-kid .cx-lead { font-size: 20px; margin: 0; } .cx-kid .cx-name { display: inline-block; font: 800 clamp(24px, 5.4vw, 42px)/1.35 'Baloo Bhaijaan 2', var(--font-deco); color: #fff; background: #21805f; border-radius: 40px; padding: 4px clamp(20px, 5vw, 46px); margin: 12px 0; max-width: 100%; }
.cx-kid .cx-text { font-size: clamp(18px, 3.4vw, 25px); font-weight: 700; color: #1f4d3a; margin: 4px 0; } .cx-kid .cx-body { font-size: 19px; color: #5b4a2a; margin: 4px 0; }
.cx-star { position: absolute; font-style: normal; color: #f2b63c; opacity: .6; font-size: clamp(26px, 6vw, 54px); line-height: 1; } .cx-star.a { top: 8%; right: 6%; } .cx-star.b { top: 8%; left: 6%; } .cx-star.c { top: 46%; right: 5%; } .cx-star.d { top: 46%; left: 5%; }
.cx-teen { background: linear-gradient(160deg, #143d2e, #1f5a43); color: #f7efd9; border-radius: 14px; padding: 14px; }
.cx-teen .cx-in { border: 2px solid #d8ae55; border-radius: 8px; padding: 32px 24px; }
.cx-teen h1 { font: 700 clamp(28px, 6vw, 46px)/1.4 'Reem Kufi', var(--font-deco); color: #e9c675; margin: 6px 0; } .cx-teen .cx-lead, .cx-teen .cx-body { color: #dfe9e2; font-size: 18px; margin: 4px 0; }
.cx-teen .cx-name { font: 700 clamp(26px, 5.6vw, 44px)/1.4 'Reem Kufi', var(--font-deco); color: #fff; margin: 8px 0 4px; } .cx-rule { width: 220px; max-width: 60%; height: 2px; margin: 0 auto 10px; background: linear-gradient(90deg, transparent, #d8ae55, transparent); }
.cx-teen .cx-text { font-size: clamp(17px, 3.2vw, 23px); font-weight: 600; margin: 4px 0; } .cx-medal { display: inline-grid; place-items: center; width: 98px; height: 98px; border-radius: 50%; margin-top: 8px; background: radial-gradient(circle at 35% 30%, #ffe9ad, #d8ae55 60%, #a77c24); color: #143d2e; font: 700 19px/1.3 'Reem Kufi', var(--font-deco); }
.cx-adult { background: #fffdf7; color: #1c2622; padding: 18px; font-family: Amiri, var(--font-deco); } .cx-adult .cx-in { border: 3px double #b98a2e; outline: 1px solid #e4d5ad; outline-offset: -12px; padding: 38px 28px; }
.cx-adult h1 { font: 700 clamp(30px, 6vw, 48px)/1.4 Amiri, var(--font-deco); color: #b98a2e; margin: 6px 0; } .cx-adult .cx-lead { font-size: 22px; color: #4b5a53; margin: 0; } .cx-adult .cx-name { display: inline-block; max-width: 100%; font: 700 clamp(28px, 6vw, 48px)/1.4 Amiri, var(--font-deco); color: #1f4d3a; border-bottom: 1px solid #e4d5ad; padding: 0 clamp(16px, 5vw, 50px) 6px; margin: 6px 0; }
.cx-adult .cx-text { font-size: clamp(20px, 3.6vw, 27px); margin: 6px 0; } .cx-adult .cx-body { font-size: 21px; color: #1f4d3a; margin: 4px 0; } .cx-adult .cx-foot { font-size: 18px; color: #4b5a53; }
@page cert { size: A4 landscape; margin: 10mm; }
@media print { .cx { page: cert; max-width: none; width: 100%; min-height: 176mm; display: grid; align-content: center; } .cx-teen .cx-in, .cx-adult .cx-in { min-height: 164mm; display: grid; align-content: center; } .cx-kid .cx-name, .cx-adult .cx-name, .cx-medal { justify-self: center; } .cx-star { opacity: .5; } }
/* ٤٧٣أ: «+ قراءة» جنب المرفقات */
.til-box{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)} .til-box.missing{outline:2px solid #c0392b;outline-offset:6px;border-radius:10px} .til-box[hidden],.til-btn[hidden]{display:none}
.sci-variety{margin:6px 0}
/* ٤٧٣ب: الأزهر وحصر المستويات */
.azhar-ctl{display:grid;gap:8px} .azhar-ctl select[hidden],.intake[hidden]{display:none}
.ml-row{margin-bottom:10px} .ml-row.ok{border-inline-start:4px solid var(--green)} .ml-foot{display:grid;gap:8px}
.az-row{display:block;margin-bottom:10px;text-decoration:none;color:inherit}
/* ٤٧٣ب٢: اختيار المستوى إجباري، ومقرر الأزهر في نفس المكان */
.az-cur{display:grid;gap:8px;padding:12px;border:1px solid var(--line);border-radius:12px;margin-top:4px} .az-cur[hidden],.ml-body[hidden]{display:none} .az-cur .field{margin:0} .az-prev{margin:0;font-weight:700}
.ml-head{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer} .ml-body{display:grid;gap:10px;margin-top:10px} .ml-row{scroll-margin-top:70px} .ml-miss{outline:2px solid #c0392b;outline-offset:6px;border-radius:10px}
.level-need{border-inline-start:6px solid #e07b24} .lv-th{font-size:1rem;margin:14px 0 8px}
/* ٤٧٦: حصص الباقة بالتفصيل */
.sum-ses .ss-abs b{color:#a8400c} .sum-ses .ss-off{background:#faf8f2} .sum-ses .ss-off b{font-weight:400;color:#5e6a63}
