/* نظام تصميم نرنو — المتغيرات تُحدَّث من استوديو الهوية */
:root {
  --petrol: #0B1F3A; --gold: #E0A956; --turquoise: #22B8CC; --royal: #3E64B0; --violet: #6E5FA8;
  --emerald: #2E9C7A; --pearl: #F4F7FB; --mist: #E4EDF5; --alert: #C0504D; --bronze: #B9853F; --slate: #55667F;
  --radius: 16px;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --bg: var(--pearl); --surface: #ffffff; --surface-2: #f1f4f8; --text: #0f1e33; --muted: #5a6880;
  --line: #dde5ef; --shadow: 0 1px 2px rgba(11,31,58,.06), 0 8px 24px rgba(11,31,58,.08);
  --side-bg: radial-gradient(120% 60% at 50% 0%, #14325c 0%, rgba(20,50,92,0) 60%), linear-gradient(180deg, #0B1F3A 0%, #071428 100%);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #08162b; --surface: #0e2240; --surface-2: #132b4f; --text: #e9f0f8; --muted: #9fb1c8;
  --line: #20385c; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --side-bg: radial-gradient(120% 60% at 50% 0%, #10294d 0%, rgba(16,41,77,0) 60%), linear-gradient(180deg, #06122a 0%, #040c1d 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; }
a { color: var(--turquoise); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ─── الهيكل ─── */
.app { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: #e9f1f2; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px 28px; border-inline-start: 1px solid rgba(224,169,86,.28); }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #e3c993); color: var(--petrol); font-weight: 800; font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand b { display: block; font-size: 20px; letter-spacing: .3px; color: #fff; }
.brand small { color: var(--gold); font-size: 11.5px; display: block; }
.nav-group { margin: 14px 6px 6px; font-size: 11.5px; color: rgba(233,241,242,.55); letter-spacing: .5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: #dfe9ea;
  text-decoration: none; margin: 2px 0; font-size: 14.5px; transition: background .15s; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.active { background: linear-gradient(90deg, rgba(34,184,204,.22), rgba(224,169,86,.10)); color: #fff;
  box-shadow: inset -3px 0 0 var(--gold); }
.nav a .dev { margin-inline-start: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 20px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.6); }
.nav svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 26px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 19px; margin: 0; flex: 1; }
.top .who { font-size: 13px; color: var(--muted); }
.iconbtn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer; position: relative; }
.iconbtn svg { width: 20px; height: 20px; }
.badge { position: absolute; top: -5px; inset-inline-end: -5px; background: var(--alert); color: #fff; font-size: 11px;
  border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.menu-toggle { display: none; }
.content { padding: 24px 26px 60px; max-width: 1500px; width: 100%; }

/* ─── عناصر ─── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; position: relative; }
.card.framed::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--gold), transparent 40%, transparent 60%, var(--turquoise));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 16.5px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { cursor: pointer; transition: transform .15s, box-shadow .15s; text-decoration: none; color: inherit; display: block; }
.kpi:hover { transform: translateY(-2px); }
.kpi .v { font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.kpi .l svg { width: 18px; height: 18px; color: var(--accent, var(--turquoise)); }
.kpi { border-top: 3px solid var(--accent, var(--turquoise)); }
.two { grid-template-columns: 1.4fr 1fr; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { border: 1px solid transparent; background: var(--petrol); color: #fff; padding: 9px 16px; border-radius: 12px;
  cursor: pointer; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-size: 14px; }
.btn svg { width: 17px; height: 17px; }
.btn.gold { background: var(--gold); color: #1c1407; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--alert); }
.btn.ok { background: var(--emerald); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); }
textarea { min-height: 90px; resize: vertical; }
label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 4px; }
.check { display: inline-flex; gap: 6px; align-items: center; margin-inline-end: 14px; font-size: 14px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.t th { text-align: start; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 9px 10px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: color-mix(in srgb, var(--mist) 45%, transparent); }
.scroll { overflow: auto; max-height: 70vh; border-radius: 12px; border: 1px solid var(--line); }
.pill { display: inline-block; padding: 1px 10px; border-radius: 20px; font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--emerald) 15%, transparent); color: var(--emerald); border-color: transparent; }
.pill.warn { background: color-mix(in srgb, var(--gold) 22%, transparent); color: #8a6a2e; border-color: transparent; }
.pill.bad { background: color-mix(in srgb, var(--alert) 15%, transparent); color: var(--alert); border-color: transparent; }
.pill.info { background: color-mix(in srgb, var(--royal) 15%, transparent); color: var(--royal); border-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { text-align: center; padding: 38px 10px; color: var(--muted); }
.notice-dev { border: 1px dashed var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); font-weight: 700; }
.bar { height: 10px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--turquoise), var(--emerald)); }

/* ─── الجدول المدرسي ─── */
.tt { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; min-width: 760px; }
.tt th { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 6px; }
.tt th.day { width: 86px; text-align: start; }
.tt td { height: 74px; vertical-align: top; border-radius: 12px; background: var(--surface-2); border: 1px dashed transparent; padding: 0; }
.tt td.drop { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.lesson { height: 100%; min-height: 72px; border-radius: 11px; padding: 6px 8px; font-size: 12.5px; cursor: grab; position: relative;
  background: color-mix(in srgb, var(--c, var(--turquoise)) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--turquoise)) 40%, transparent);
  border-inline-start: 4px solid var(--c, var(--turquoise)); }
.lesson b { display: block; font-size: 13px; }
.lesson .lk { position: absolute; top: 4px; inset-inline-end: 6px; font-size: 11px; }
.lesson.bad { box-shadow: 0 0 0 2px var(--alert); }
.lesson.sel { box-shadow: 0 0 0 2px var(--royal); }
.lesson.changed { box-shadow: 0 0 0 2px var(--gold); }
.lesson[draggable="false"] { cursor: default; }

/* ─── بطاقة الإشعار الرسمية ─── */
.ncard { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); max-width: 680px; }
.ncard .hd { background: linear-gradient(135deg, var(--k1, var(--petrol)), var(--k2, var(--gold))); color: #fff; padding: 16px 20px; display: flex; gap: 14px; align-items: center; }
.ncard .hd .brand-mark { width: 42px; height: 42px; font-size: 19px; }
.ncard .bd { padding: 18px 22px; white-space: pre-wrap; }
.ncard .ft { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ─── نوافذ ورسائل ─── */
.modal-bg { position: fixed; inset: 0; background: rgba(8,20,24,.55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(1100px, 100%); }
.modal h3 { margin-top: 0; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--petrol); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 420px; }
.toast.err { background: var(--alert); }
.toast.ok { background: var(--emerald); }
.loading { opacity: .6; pointer-events: none; }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: s 0.8s linear infinite; display: inline-block; }
@keyframes s { to { transform: rotate(360deg); } }

/* ─── شاشات الدخول ─── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 600px at 85% 0%, color-mix(in srgb, var(--turquoise) 30%, transparent), transparent),
              radial-gradient(800px 500px at 0% 100%, color-mix(in srgb, var(--gold) 25%, transparent), transparent), var(--petrol); }
.auth .card { width: min(440px, 100%); padding: 28px; }
.auth .brand { border: none; justify-content: center; flex-direction: column; text-align: center; }
.auth .brand b { color: var(--petrol); font-size: 28px; }
html[data-theme="dark"] .auth .brand b { color: #fff; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 12px; }
.codes { font-family: ui-monospace, monospace; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; direction: ltr; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: #0A1E37; color: var(--gold); z-index: 100; transition: opacity .3s; }
.splash b { font-size: 44px; }

/* ─── متجاوب ─── */
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 50; transform: translateX(100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-toggle { display: grid; }
  .content { padding: 16px 14px 60px; }
  .top { padding: 10px 14px; } .top .who { display: none; } .top h1 { font-size: 17px; }
}
@media print {
  .side, .top, .no-print, .toasts { display: none !important; }
  .print-head { display: flex !important; }
  @page { margin: 12mm; }
  .app { display: block; } .content { padding: 0; } .card { box-shadow: none; border: none; }
  .tt td { border: 1px solid #999; } body { background: #fff; color: #000; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.ncard .ft .pill { white-space: normal; }
.card h2 svg, .card h3 svg { width: 20px; height: 20px; vertical-align: -3px; }
.tt td.off { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 70%, transparent) 6px 8px); }

/* ─── الشعار ─── */
.brand-big { flex-direction: column; text-align: center; gap: 6px; text-decoration: none; padding: 4px 6px 16px; }
.brand-big .logo-full { width: 168px; max-width: 100%; height: auto; border-radius: 18px; display: block; margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(224,169,86,.25); }
.brand-big small { color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.logo-auth { width: 220px; max-width: 70%; height: auto; border-radius: 22px; display: block; margin: 0 auto 6px;
  box-shadow: 0 10px 30px rgba(11,31,58,.35); }
.splash img { width: 240px; max-width: 60vw; height: auto; border-radius: 26px; }
.brand-mark { background: #0A1E37 !important; }
.brand-mark img { background: transparent !important; object-fit: cover !important; }
.print-head { display: none; align-items: center; gap: 14px; justify-content: space-between; border-bottom: 2px solid var(--gold);
  padding-bottom: 8px; margin-bottom: 12px; }
.print-head img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.print-head .ph-text { display: flex; flex-direction: column; }
.print-head b { font-size: 18px; color: #0B1F3A; } .print-head span { font-size: 14px; } .print-head small { font-size: 11px; color: #555; }
@media print { .print-head img, .ncard, .tt td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.pill.gold { background: color-mix(in srgb, var(--gold) 30%, transparent); color: #7a5a1e; border-color: transparent; }

.brand-mini { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 2px 6px 12px; }
.brand-mini .logo-mark { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none;
  box-shadow: 0 3px 12px rgba(0,0,0,.35), inset 0 0 0 1px rgba(224,169,86,.25); }
.brand-mini small { color: var(--gold); font-size: 13px; font-weight: 600; line-height: 1.4; }

/* ─── صفحة الدخول الاحترافية ─── */
.auth-pro { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 80% 10%, #16406f 0%, #0B1F3A 45%, #050d1d 100%) !important; }
.auth-pro .aurora { position: absolute; inset: -30%; background:
  radial-gradient(35% 30% at 25% 30%, rgba(34,184,204,.28), transparent 70%),
  radial-gradient(30% 25% at 75% 25%, rgba(224,169,86,.22), transparent 70%),
  radial-gradient(40% 35% at 60% 80%, rgba(62,100,176,.25), transparent 70%);
  filter: blur(30px); animation: aurora 18s ease-in-out infinite alternate; }
@keyframes aurora { 0% { transform: translate(0,0) rotate(0deg) scale(1); } 50% { transform: translate(4%,-3%) rotate(8deg) scale(1.08); } 100% { transform: translate(-4%,3%) rotate(-6deg) scale(1.02); } }
.auth-pro .wv { position: absolute; left: 0; bottom: 0; width: 200%; height: 38vh; }
.auth-pro .wv path { fill: currentColor; }
.auth-pro .w1 { color: rgba(34,184,204,.10); animation: wave 22s linear infinite; }
.auth-pro .w2 { color: rgba(224,169,86,.10); animation: wave 16s linear infinite reverse; height: 30vh; }
.auth-pro .w3 { color: rgba(11,31,58,.65); animation: wave 28s linear infinite; height: 22vh; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.auth-pro .card.glass { position: relative; z-index: 2; width: min(430px, 100%); padding: 30px 30px 24px; border-radius: 24px;
  background: rgba(255,255,255,.92); border: 1px solid rgba(224,169,86,.35);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06) inset; backdrop-filter: blur(14px);
  animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
html[data-theme="dark"] .auth-pro .card.glass { background: rgba(14,34,64,.78); color: #e9f0f8; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.brand-anim { text-align: center; margin: -6px auto 18px; padding: 18px 10px 16px; border-radius: 20px;
  background: radial-gradient(120% 120% at 50% 0%, #17406e 0%, #0B1F3A 60%, #071428 100%); color: #fff; position: relative; overflow: hidden; }
.brand-anim .mk-wrap { position: relative; width: 92px; height: 92px; margin: 0 auto 6px; }
.brand-anim .mk { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; animation: mkIn 1s cubic-bezier(.2,.8,.2,1) both;
  filter: drop-shadow(0 0 14px rgba(224,169,86,.45)); }
@keyframes mkIn { from { opacity: 0; transform: scale(.6) rotate(-8deg); filter: blur(6px); } to { opacity: 1; transform: none; } }
.brand-anim .shine { position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 62%); background-size: 250% 100%;
  animation: shine 3.2s ease-in-out 1.1s infinite; mix-blend-mode: overlay; }
@keyframes shine { 0% { background-position: 150% 0; } 60%,100% { background-position: -100% 0; } }
.brand-anim .nm { font-size: 26px; letter-spacing: .55em; padding-left: .55em; font-weight: 600; font-family: "Segoe UI", system-ui, sans-serif; }
.brand-anim .nm span { display: inline-block; opacity: 0; transform: translateY(10px); animation: letter .5s ease-out forwards; }
@keyframes letter { to { opacity: 1; transform: none; } }
.brand-anim .tg { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); font-size: 12.5px; letter-spacing: .3em;
  font-family: "Segoe UI", system-ui, sans-serif; margin-top: 4px; opacity: 0; animation: fadeIn .8s ease-out 1.5s forwards; }
.brand-anim .tg i { display: block; height: 1px; width: 0; background: linear-gradient(90deg, transparent, var(--gold)); animation: line .9s ease-out 1.6s forwards; }
.brand-anim .tg i:last-child { background: linear-gradient(270deg, transparent, var(--gold)); }
@keyframes line { to { width: 42px; } }
@keyframes fadeIn { to { opacity: 1; } }
.brand-anim .ar { font-size: 19px; font-weight: 700; margin-top: 6px; clip-path: inset(0 0 0 100%); animation: typeAr 1.4s steps(18, end) 2s forwards; }
@keyframes typeAr { to { clip-path: inset(0 0 0 0); } }
.brand-anim .sub { margin-top: 10px; font-size: 13px; color: #cfe7ee; opacity: 0; animation: fadeIn .8s ease-out 3.2s forwards; }
.auth-pro .auth-foot { position: absolute; bottom: 14px; z-index: 2; color: rgba(255,255,255,.45); font-size: 12px; }
.auth-pro .input { background: rgba(255,255,255,.9); }
html[data-theme="dark"] .auth-pro .input { background: rgba(8,22,43,.7); }
@media (prefers-reduced-motion: reduce) {
  .auth-pro .aurora, .auth-pro .wv, .brand-anim .shine { animation: none !important; }
  .brand-anim .nm span, .brand-anim .tg, .brand-anim .sub { opacity: 1 !important; transform: none !important; }
  .brand-anim .ar { clip-path: none !important; } .brand-anim .tg i { width: 42px !important; }
}

/* جداول مضغوطة (الاحتياط) */
.t.compact { width: auto; min-width: 0; }
.t.compact th, .t.compact td { padding: 4px 8px; font-size: 13.5px; line-height: 1.35; white-space: nowrap; }
.t.compact td b { font-weight: 600; }
.t.compact select, .t.compact .input { height: 30px; padding: 2px 8px; font-size: 13px; min-height: 0; width: auto; }
.t.compact select[data-s] { width: 150px; } .t.compact select[data-p] { width: 62px; } .t.compact .input[data-r] { width: 140px; }
.draft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.draft { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.draft .t.compact { width: 100%; margin-top: 4px; }
.chips-row .pill { margin: 2px 0 2px 4px; }

/* ─── الطباعة وحفظ PDF لكل الصفحات ─── */
.iconbtn.pdfbtn { font-size: 11px; font-weight: 800; letter-spacing: .3px; width: auto; padding: 0 8px; }
@media print {
  html, body { background: #fff !important; }
  .scroll, .draft-grid, .content, .main, .app { max-height: none !important; overflow: visible !important; height: auto !important; }
  .btn, .iconbtn, button, .menu-toggle, .modal-back { display: none !important; }
  select, input, textarea { border: none !important; background: none !important; appearance: none; -webkit-appearance: none; color: #000 !important; padding: 0 !important; }
  select::-ms-expand { display: none; }
  table { border-collapse: collapse; width: 100%; page-break-inside: auto; }
  tr, .draft, .card { break-inside: avoid; }
  thead { display: table-header-group; }
  .t th, .t td { border: 1px solid #bbb !important; color: #000 !important; }
  .t th { background: #eef2f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pill { border: 1px solid #999 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000 !important; text-decoration: none !important; }
  summary { list-style: none; font-weight: 700; }
  .card { padding: 6px 0 !important; margin-bottom: 8px !important; background: #fff !important; }
}

/* ─── طباعة الجداول ─── */
.pp-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--gold); padding-bottom: 6px; margin-bottom: 10px; }
.pp-head img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-head b { font-size: 16px; color: var(--petrol, #0B1F3A); } .pp-head small { color: #666; font-size: 11px; }
.pp-page { background: var(--surface); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.pp-week td, .pp-week th { text-align: center; vertical-align: middle; min-width: 80px; }
.pp-cell b { display: block; font-size: 13px; } .pp-cell div { font-size: 12px; color: #444; }
.pp-general { font-size: 10px; border-collapse: collapse; }
.pp-general th, .pp-general td { border: 1px solid #c8ced8; padding: 2px 3px; text-align: center; white-space: nowrap; min-width: 22px; }
.pp-general .pp-name { text-align: start; white-space: nowrap; position: sticky; right: 0; background: var(--surface); }
.pp-general .pp-ds { border-inline-start: 2px solid #0B1F3A; }
.pp-general .pp-day { background: #0B1F3A; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-wrap { overflow-x: auto; }
.pp-sign { display: flex; justify-content: space-around; margin-top: 18px; font-size: 12px; text-align: center; gap: 20px; }
.pp-sign b { display: block; font-size: 13px; margin: 2px 0; } .pp-line { color: #666; margin-top: 8px; }
.pp-meta { font-size: 11px; text-align: end; line-height: 1.7; color: #333; }
.pub { max-width: 1100px; margin: 0 auto; padding: 18px; }
@media print {
  .pp-page { break-after: page; padding: 0; margin: 0; border-radius: 0; }
  .pp-page:last-child { break-after: auto; }
  .pp-wrap { overflow: visible !important; }
  .pp-week td, .pp-week th { border: 1px solid #999 !important; }
}

.pub { overflow-x: hidden; }
.pub-grid { overflow-x: auto; } .pub-list { display: none; }
@media (max-width: 760px) { .pub-grid { display: none; } .pub-list { display: block; } .pub .pp-head b { font-size: 14px; } }
@media print { .pub-grid { display: block !important; } .pub-list { display: none !important; } }
.pp-general th, .pp-general td { height: auto; }
.pp-general td { font-size: 10px; }

/* ─── الرسوم البيانية والمؤشرات والفصول ─── */
.chart { display: block; max-width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .avg { stroke: var(--ink-2, #555); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ax { font-size: 11px; fill: var(--muted, #6b7280); }
.chart .lb { font-size: 12px; fill: var(--ink, #1f2937); }
.chart .vl { font-size: 11px; fill: var(--ink, #1f2937); font-weight: 600; }
.chart .hit:hover rect[fill]:not([fill="transparent"]) { opacity: .8; }
.kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.kpis > div { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; min-width: 110px; }
.kpis b { display: block; font-size: 22px; } .kpis span { font-size: 12px; color: var(--muted, #6b7280); }
.sem-ic { font-size: 30px; color: var(--gold); margin-inline-end: 10px; }
.sem-now { border: 2px solid var(--gold); }
.sem-bar { height: 8px; border-radius: 8px; background: var(--surface-2); margin: 12px 0 4px; overflow: hidden; }
.sem-bar i { display: block; height: 100%; background: var(--gold); border-radius: 8px; }
.sem-chip { text-decoration: none; font-size: 12px; margin-inline-start: 10px; }
@media (max-width: 700px) { .sem-chip { display: none; } }
@media print { .kpis > div { border: 1px solid #ccc; } }
.chart { direction: ltr; } .chart text { unicode-bidi: plaintext; }

/* ─── أزرار الطباعة في موضع كل جدول ─── */
.card.has-ptools { position: relative; }
.ptools { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; gap: 4px; z-index: 2; }
.ptools .pt { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2, #475569); border-radius: 8px; height: 28px; min-width: 28px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 10px; font-weight: 800; padding: 0 6px; }
.ptools .pt svg { width: 15px; height: 15px; }
.ptools .pt:hover { border-color: var(--accent, var(--gold)); color: var(--accent, var(--gold)); }
.has-ptools > .ptools + * { padding-inline-end: 84px; }
#print-area { display: none; }
@media print {
  body.print-area-on > *:not(#print-area) { display: none !important; }
  body.print-area-on #print-area { display: block !important; }
  #print-area .card { box-shadow: none; border: none; padding: 0 !important; }
}

/* ─── ألوان المهام ─── */
.side .nav a svg { color: color-mix(in srgb, var(--gc, #fff) 70%, #fff); opacity: .95; }
.side .nav a.active { box-shadow: inset -3px 0 0 var(--gc, var(--gold)); }
.side .nav a.active svg { color: #fff; }
.side .nav-group::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gc); margin-inline-end: 6px; vertical-align: middle; }
.top .page-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-inline-end: 10px; }
.top .page-ic svg { width: 19px; height: 19px; }
.main #content-body > .card, .main #content-body > .grid > .card, .main #content-body > div > .card { border-top: 3px solid color-mix(in srgb, var(--accent) 75%, transparent); }
.main .card h3 svg { color: var(--accent); }
.main .btn:not(.ghost):not(.gold):not(.danger):not(.ok) { background: var(--accent); border-color: var(--accent); }
.main .pill.info { background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 85%, #000); }
@media print { .main #content-body .card { border-top: none !important; } }
.tabs a.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; }
.tabs a.tab.active { color: var(--text); border-bottom-color: var(--accent, var(--gold)); font-weight: 700; }

/* ─── الجدول العام (نمط الجداول المدرسية) ─── */
.pp-gpage { padding: 10px; }
.pp-ghead { position: relative; text-align: center; margin-bottom: 6px; }
.pp-gtitle { font-size: 22px; font-weight: 800; color: #111; }
.pp-gsub { font-size: 14px; font-weight: 600; margin-top: 2px; }
.pp-gmeta { position: absolute; inset-inline-start: 0; top: 0; display: flex; align-items: center; gap: 8px; font-size: 11px; }
.pp-gmeta img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-general { border: 2px solid #111; }
.pp-general td { vertical-align: top; padding: 1px 2px; line-height: 1.15; }
.pp-general td b { display: block; font-size: 10px; font-weight: 700; }
.pp-general td i { display: block; font-style: normal; font-size: 7px; color: #444; }
.pp-general .pp-day { background: #fff; color: #111; font-size: 15px; font-weight: 800; border-bottom: 1px solid #111; }
.pp-general .pp-p { font-weight: 700; }
.pp-general .pp-ds { border-inline-start: 2px solid #111 !important; }
.pp-general .pp-off { background: repeating-linear-gradient(45deg, transparent 0 4px, #e6e6e6 4px 5px); }
.pp-general .pp-tot { border-inline-start: 2px solid #111; min-width: 40px; }
.pp-general tr > th.pp-name { min-width: 110px; font-weight: 700; }
.pp-gfoot { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; margin-top: 6px; flex-wrap: wrap; }


/* شعار الطباعة: صغير وبلا خلفية داكنة */
.print-head img, .pp-head img, .pp-gmeta img { background: none !important; box-shadow: none !important; border-radius: 0 !important; width: 38px !important; height: 38px !important; object-fit: contain !important; }
@media print {
  .pp-wrap { overflow: visible !important; }
  .pp-page { box-shadow: none !important; background: #fff !important; }
  .pp-week td, .pp-week th { padding: 3px !important; }
  .pp-cell b { font-size: 11px; } .pp-cell div { font-size: 10px; }
}

/* ─── الترحيب ─── */
.hero-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; margin-bottom: 16px; border-radius: 18px;
  background: linear-gradient(120deg, #0B1F3A 0%, #16406f 55%, #1d6f86 100%); color: #fff; box-shadow: 0 8px 24px rgba(11,31,58,.18); }
.hero-welcome .hw-hi { font-size: 22px; font-weight: 800; }
.hero-welcome .hw-sub { font-size: 14px; opacity: .9; margin-top: 4px; color: #f3d9a8; }
.hero-welcome img { width: 56px; height: 56px; object-fit: contain; }
.top .who-hi { font-size: 13px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 5px 12px; border-radius: 999px; margin-inline-start: 10px; }
@media (max-width: 700px) { .top .who-hi { display: none; } .hero-welcome .hw-hi { font-size: 18px; } }
