/* مرصاد — نظام التصميم: أزرق شفشاون مع خلفية كلسية دافئة */
:root {
  --blue-900: #10324f;
  --blue-700: #1f5f99;
  --blue-600: #2a73b8;
  --blue-100: #e3eef9;
  --blue-50:  #f1f6fc;
  --sand:     #f7f4ee;
  --ink:      #1b2430;
  --ink-2:    #4a5566;
  --ink-3:    #7a8596;
  --line:     #e1e6ee;
  --card:     #ffffff;
  --bg:       var(--sand);
  --ok:       #1d7a4c;
  --ok-bg:    #e3f4ea;
  --warn:     #9a5b00;
  --warn-bg:  #fdf1dc;
  --danger:   #b3261e;
  --danger-bg:#fbe7e5;
  --radius:   14px;
  --shadow:   0 1px 2px rgb(16 50 79 / .06), 0 4px 16px rgb(16 50 79 / .06);
  --on-blue: #ffffff;
  --chart-1: #1f5f99;
  --chart-2: #c27a1a;
  --font: "Tajawal", system-ui, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue-900: #cfe3f7;
    --blue-700: #7ab3e8;
    --blue-600: #8fc0ee;
    --blue-100: #1c3550;
    --blue-50:  #16283b;
    --sand:     #0f1722;
    --ink:      #e8edf3;
    --ink-2:    #b4bfcc;
    --ink-3:    #8592a3;
    --line:     #263445;
    --card:     #152131;
    --ok:       #6fd19c; --ok-bg: #12321f;
    --warn:     #f2c06b; --warn-bg: #3a2a0c;
    --danger:   #ff9b93; --danger-bg: #3d1513;
    --shadow:   0 1px 2px rgb(0 0 0 / .3);
    --on-blue:  #0c1a2a;
    --chart-1:  #3f8fdc;
    --chart-2:  #c47f22;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
}
a { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; color: var(--blue-900); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.noscript { padding: 2rem; text-align: center; }

/* ---------- تحميل ---------- */
.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: .75rem; color: var(--ink-3); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--blue-700); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الأزرار والحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--blue-700); color: var(--on-blue); transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--blue-700); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { background: var(--danger); }
.btn.small { min-height: 36px; padding: .3rem .75rem; font-size: .9rem; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { min-height: 40px; min-width: 40px; padding: 0; background: transparent; color: var(--ink-2); border: 1px solid transparent; }
.icon-btn:hover { background: var(--blue-50); }

label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: .3rem; color: var(--ink-2); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; min-height: 44px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue-600) 35%, transparent); outline-offset: 1px; border-color: var(--blue-600); }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .82rem; color: var(--ink-3); margin-top: .25rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.code-input { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .15em; text-align: center; font-size: 1.25rem; direction: ltr; text-transform: uppercase; }

/* ---------- البطاقات ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.alert { border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .95rem; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.info  { background: var(--blue-50); color: var(--blue-900); border: 1px solid var(--blue-100); }
.alert.warn  { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--blue-50); color: var(--blue-700); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--danger-bg); color: var(--danger); }

/* ---------- صفحات الدخول ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.auth-box { width: min(420px, 100%); }
.brand { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.25rem; }
.brand .logo { width: 48px; height: 48px; }
.brand .name { font-size: 1.7rem; font-weight: 800; color: var(--blue-900); }
.brand .tag { font-size: .85rem; color: var(--ink-3); }
.choice { display: grid; gap: .9rem; }
.choice a {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.choice a:hover { border-color: var(--blue-600); }
.choice .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.choice .ic svg { width: 26px; height: 26px; }
.choice strong { display: block; font-size: 1.1rem; color: var(--blue-900); }
.back-link { display: inline-block; margin-top: 1rem; font-size: .92rem; }

/* ---------- هيكل مساحة الأستاذ ---------- */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; padding: .5rem max(1rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left));
}
.topbar .brand { margin: 0; gap: .45rem; }
.topbar .brand .logo { width: 34px; height: 34px; }
.topbar .brand .name { font-size: 1.25rem; }
.topnav { display: flex; gap: .25rem; margin-inline-start: auto; }
.topnav a { padding: .45rem .8rem; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 700; }
.topnav a.active, .topnav a:hover { background: var(--blue-50); color: var(--blue-700); }
.main { width: min(1040px, 100%); margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.crumbs { font-size: .9rem; margin-bottom: .35rem; }
.crumbs a { text-decoration: none; }

.bottomnav { display: none; }
@media (max-width: 720px) {
  .topnav { display: none; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .78rem; font-weight: 700; color: var(--ink-3); text-decoration: none; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--blue-700); }
  h1 { font-size: 1.35rem; }
}

/* ---------- الإحصاءات والأقسام ---------- */
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .v { font-size: 1.7rem; font-weight: 800; color: var(--blue-900); line-height: 1.2; }
.stat .l { font-size: .85rem; color: var(--ink-3); }
.class-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.class-card { display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.class-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--blue-700); }
.class-card:hover { border-color: var(--blue-600); }
.class-card .meta { font-size: .88rem; color: var(--ink-3); }
.class-card .count { margin-top: .6rem; font-weight: 700; color: var(--blue-700); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); }
.empty svg { width: 56px; height: 56px; color: var(--blue-600); opacity: .7; }

/* ---------- جدول التلاميذ ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar .search { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: .6rem .75rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--ink-3); font-weight: 700; background: var(--blue-50); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { width: 3.5rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
td.code { font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: right; letter-spacing: .06em; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: end; width: 1%; }
.student-name { font-weight: 700; }

/* ---------- نوافذ الحوار ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100% - 2rem)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
dialog::backdrop { background: rgb(16 24 40 / .45); }
.dlg-head { padding: 1rem 1.25rem .25rem; }
.dlg-body { padding: .5rem 1.25rem 1rem; }
.dlg-foot { padding: .75rem 1.25rem 1rem; display: flex; gap: .5rem; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ---------- الإشعارات العابرة ---------- */
.toasts { position: fixed; inset: auto 0 calc(76px + env(safe-area-inset-bottom)) 0; display: grid; justify-items: center; gap: .5rem; pointer-events: none; z-index: 100; padding: 0 1rem; }
.toast { background: var(--blue-900); color: var(--card); padding: .6rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; max-width: 480px; animation: up .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ---------- مساحة التلميذ ---------- */
.student-hero { background: linear-gradient(135deg, #1f5f99, #2f86c9); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.25rem; margin-bottom: 1rem; }
.student-hero h1 { color: #fff; margin-bottom: .2rem; }
.student-hero p { margin: 0; opacity: .92; }
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem; color: var(--ink-3); }
.tile strong { display: block; color: var(--ink-2); }

/* ---------- بطاقات الطباعة ---------- */
.cards-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qr-card {
  border: 1.5px dashed #9aa7b8; border-radius: 12px; padding: 12px; background: #fff; color: #111;
  display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; break-inside: avoid; page-break-inside: avoid;
}
.qr-card .qr svg, .qr-card .qr img { width: 120px; height: 120px; display: block; }
.qr-card .app { font-weight: 800; color: #1f5f99; font-size: 15px; }
.qr-card .nm { font-weight: 800; font-size: 17px; margin: 2px 0; }
.qr-card .cl { font-size: 13px; color: #444; }
.qr-card .cd { font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: right; font-size: 15px; letter-spacing: .08em; margin-top: 6px; font-weight: 700; }
.qr-card .hw { font-size: 11px; color: #555; margin-top: 4px; }
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .topbar, .bottomnav, .no-print, .toasts { display: none !important; }
  .main { padding: 0; width: 100%; }
  .print-only { display: block; }
  .cards-sheet { gap: 6mm; }
  .qr-card { height: 60mm; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* جدول التلاميذ على الهاتف: كل تلميذ بطاقة مضغوطة بدل التمرير الأفقي */
@media (max-width: 720px) {
  .table-wrap:has(.students-table) { overflow: visible; }
  .students-table { min-width: 0; }
  .students-table thead { display: none; }
  .students-table tbody tr {
    display: grid; grid-template-columns: 2.25rem 1fr auto;
    grid-template-areas: "num name status" "num code code" "acts acts acts";
    padding: .6rem .25rem; border-bottom: 1px solid var(--line);
  }
  .students-table tbody tr:last-child { border-bottom: 0; }
  .students-table tbody td { border: 0; padding: .15rem .5rem; }
  .students-table td.num { grid-area: num; width: auto; padding-top: .3rem; }
  .students-table tbody td:nth-child(2) { grid-area: name; }
  .students-table td.code { grid-area: code; font-size: .9rem; color: var(--ink-2); }
  .students-table tbody td:nth-child(4) { grid-area: status; }
  .students-table td.actions { grid-area: acts; text-align: start; padding-top: .35rem; }
}

/* ---------- تبويبات القسم ---------- */
.tabs { display: flex; gap: .25rem; overflow-x: auto; margin: 0 0 1.25rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs a { flex: none; padding: .5rem .85rem; border-radius: 9px 9px 0 0; text-decoration: none; color: var(--ink-2); font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover { background: var(--blue-50); }
.tabs a.active { color: var(--blue-700); border-bottom-color: var(--blue-700); }
.grow { flex: 1 1 auto; }
.tiny { font-size: .75rem; }
.danger-text { color: var(--danger) !important; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-700); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.back { margin-bottom: .75rem; display: inline-block; }
label.inline { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
label.inline input { width: auto; }
.stats.compact .stat { padding: .6rem .8rem; }
.stats.compact .v { font-size: 1.35rem; }

/* أزرار مجمّعة (الدورة، حاضر/غائب) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--ink-2); padding: .45rem .9rem; min-height: 40px; cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--blue-700); color: var(--on-blue); }
.pa-seg .pa.p.on { background: var(--ok); color: #fff; }
.pa-seg .pa.a.on { background: var(--danger); color: #fff; }

/* قوائم التلاميذ للإدخال السريع */
.roll { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.roll-row { display: grid; grid-template-columns: 2.25rem 1fr auto; gap: .5rem .75rem; align-items: center; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.roll-row:last-child { border-bottom: 0; }
.roll-row .num { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.roll-row .who { display: grid; min-width: 0; }
.roll-row .who strong { overflow-wrap: anywhere; }
.counter { display: inline-flex; align-items: center; gap: .4rem; }
.counter .count { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--blue-900); }
.counter .plus { min-width: 64px; font-size: 1.05rem; }
.counter .minus { font-size: 1.3rem; border: 1px solid var(--line); }
.score-cell { display: inline-flex; align-items: center; gap: .35rem; }
.score-input { width: 5.2rem; min-height: 40px; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; padding: .35rem .4rem; }
.score-input.invalid { border-color: var(--danger); background: var(--danger-bg); }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-top: 1rem; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 720px) { .save-bar { bottom: calc(58px + env(safe-area-inset-bottom)); } }

/* جداول عريضة (الأنشطة، النتائج) */
.table-wrap.wide { overflow-x: auto; }
.grid-table { min-width: 640px; }
.grid-table th[scope=row] { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; min-width: 150px; font-weight: 700; color: var(--ink); text-align: start; }
.grid-table td { text-align: center; }
.calc-cell { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.calc-cell.strong, .calc.strong { font-weight: 800; color: var(--blue-900); }
.grid-table .score-input { width: 4.4rem; }

/* بطاقات الفروض */
.cards-list { display: grid; gap: .6rem; }
.card.item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; text-align: start; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.card.item:hover { border-color: var(--blue-600); }
.item-main { display: grid; }
.item-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* سجل الأيام */
.history { margin-top: 1rem; }
.history summary { cursor: pointer; font-weight: 700; }
.day-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; }
.day-list li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* الدروس */
.lessons { display: grid; gap: 1rem; }
.lesson .page-head { margin-bottom: .5rem; }
.lesson-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; max-width: 72ch; }
.files { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; }
.files li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .4rem .6rem; background: var(--blue-50); border-radius: 9px; }
.files a { font-weight: 700; overflow-wrap: anywhere; }

/* فضاء التلميذ */
.score-list { list-style: none; padding: 0; margin: 0 0 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.score-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line); }
.score-list li:last-child { border-bottom: 0; }
.score-list li > span { display: grid; }
.score-list b { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--blue-900); }
.stat.result { background: var(--blue-50); border-color: var(--blue-100); }
details.lesson summary { cursor: pointer; list-style-position: inside; }
details.lesson[open] summary { margin-bottom: .75rem; }
main h3 { margin-top: 1.25rem; }

/* الرسم البياني */
.chart { margin: 0 0 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .75rem .5rem; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.mid { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.chart .axis { fill: var(--ink-3); font-size: 12px; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .bar { fill: var(--chart-1); }
.chart .avg { stroke: var(--chart-2); stroke-width: 3; stroke-linecap: round; }
.chart .avg-ring { stroke: var(--card); stroke-width: 7; stroke-linecap: round; }
.chart .hit { fill: transparent; }
.chart .mark:hover .hit, .chart .mark:focus .hit { fill: var(--blue-50); }
.chart .mark:focus { outline: none; }
.chart-legend { display: flex; gap: 1.25rem; font-size: .85rem; color: var(--ink-2); padding-top: .25rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px 3px 0 0; }
.bar-sw { background: var(--chart-1); }
.avg-sw { height: 3px; border-radius: 2px; background: var(--chart-2); }

/* ما الجديد */
.news { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 700; }
.news button { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; }
.new-badge { display: inline-block; margin-inline-start: .4rem; padding: 0 .45rem; border-radius: 999px; background: var(--chart-2); color: #fff; font-size: .72rem; font-weight: 800; vertical-align: middle; }
.tabs .dot { display: inline-block; min-width: 1.2em; padding: 0 .3em; margin-inline-start: .3rem; border-radius: 999px; background: var(--chart-2); color: #fff; font-size: .72rem; line-height: 1.5; text-align: center; }
.teacher-note { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1.25rem; white-space: pre-wrap; }
.teacher-note strong { display: block; color: var(--blue-900); margin-bottom: .25rem; }

/* تقرير ولي الأمر */
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; border-bottom: 2px solid var(--blue-700); padding-bottom: .75rem; margin-bottom: 1rem; }
.report-head h2 { margin: 0; }
.report-meta { font-size: .9rem; color: var(--ink-2); display: grid; }
.report h3 { margin: 1.1rem 0 .5rem; font-size: 1rem; }
.report table { min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.report td, .report th { padding: .4rem .6rem; }
.report .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.report .kpi { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; }
.report .kpi b { display: block; font-size: 1.35rem; color: var(--blue-900); font-variant-numeric: tabular-nums; }
.report .kpi span { font-size: .82rem; color: var(--ink-3); }
.report textarea { min-height: 80px; }
.report .note-print { display: none; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; min-height: 60px; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; font-size: .9rem; color: var(--ink-2); }
.signatures div { border-top: 1px dashed var(--ink-3); padding-top: .4rem; }
@media print {
  .report { border: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; color: #111; }
  .report:last-child { break-after: auto; page-break-after: auto; }
  .report textarea, .report .save-note { display: none !important; }
  .report .note-print { display: block; }
  .tabs, .crumbs, .page-head.no-print { display: none !important; }
  :root { --card: #fff; --line: #ccd3dc; --ink: #111; --ink-2: #333; --ink-3: #666; --blue-900: #10324f; --blue-700: #1f5f99; --blue-50: #f1f6fc; --chart-1: #1f5f99; --chart-2: #c27a1a; }
}
