@charset "UTF-8";
/* ── <style> ── */

/* ضبط الأس في وحدات القياس: صغير، مرتفع، وقريب من الوحدة */
.exam-power {
  display: inline-block !important;
  font-size: .58em !important;
  line-height: 1 !important;
  vertical-align: baseline !important;
  position: relative !important;
  top: -.62em !important;
  margin: 0 -.06em 0 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.msg-exam-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:.35rem 0}
.msg-exam-grid label{margin:0;display:grid;gap:.2rem}
@media screen and (max-width:560px){.msg-exam-grid{grid-template-columns:1fr}}

/* 🕘 سجل تعديل درجات الاختبارات */
.ct-sc[data-log]{background-image:radial-gradient(circle at 5px 5px,#D97706 2.5px,transparent 3px)}
.exh-list{display:grid;gap:.4rem;max-height:46vh;overflow:auto}
.exh-row{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;padding:.5rem .6rem;border:1px solid var(--ui-border,#DCE5F0);border-radius:10px;background:var(--ui-surface,#fff)}
.exh-main{flex:1 1 140px;min-width:0;display:grid}.exh-main small{color:var(--ink-soft);font-size:.74rem}
.exh-ch{display:flex;align-items:center;gap:.35rem;font-weight:900}.exh-ch i{font-style:normal;color:var(--ink-soft)}
.exh-old{background:#EEF1F5;border-radius:7px;padding:.1rem .5rem;color:#5A6B84}.exh-new{background:#E6F4EC;border-radius:7px;padding:.1rem .5rem;color:#14724A}
.exh-bk{margin-top:.9rem;padding-top:.7rem;border-top:1px dashed var(--ui-border,#DCE5F0)}
.exh-g{margin-top:.6rem;display:grid;gap:.35rem}.exh-gh{font-weight:800;font-size:.86rem}.exh-gh small{color:var(--ink-soft);font-weight:600}

/* 🔴 عدّاد المشاريع بانتظار المراجعة */
.tab[data-tab="projects"],#nav-more-btn{position:relative}
.proj-badge{position:absolute;top:2px;inset-inline-end:2px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#D6455B;color:#fff;font-size:.68rem;font-weight:900;line-height:18px;text-align:center;box-shadow:0 0 0 2px #fff;pointer-events:none}
.proj-badge-in{margin-inline-start:.5rem;display:inline-block;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#D6455B;color:#fff;font-size:.75rem;font-weight:900;line-height:22px;text-align:center}
.proj-badge-in.hide{display:none}

.lv-min{border-radius:10px;padding:.5rem .7rem;font-size:.84rem;font-weight:700;margin:0 0 .6rem;line-height:1.6}
.lv-min.warn{background:#FFF6E3;color:#8A5A00}.lv-min.ok{background:#E8F6F0;color:#137A53}.lv-min.bad{background:#FDF0F2;color:#B23346}

/* ── <style> ── */

:root{
  --paper:#E9EEF5; --paper-2:#F7FAFD; --ink:#16233A; --ink-soft:#5A6B84;
  --rule:#C9D6E5; --tick:#1B9C6B; --pen:#D6455B; --amber:#C88A2E;
  --shadow:0 1px 2px rgba(22,35,58,.06),0 8px 24px rgba(22,35,58,.08);
  --r:14px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:var(--paper); color:var(--ink); min-height:100vh;
  font-family:'Readex Pro','Tajawal','Segoe UI',system-ui,'Noto Naskh Arabic',sans-serif;
  font-size:16px; line-height:1.7; -webkit-font-smoothing:antialiased;
}
h1,h2,h3{margin:0;line-height:1.35;font-weight:700}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,select,textarea{font-family:inherit;font-size:1rem}

/* ── الرأس: شريحة ورق بهامش القلم الأحمر ── */
.masthead{
  background:var(--ink); color:var(--paper);
  padding:1.1rem 1.1rem .9rem; position:sticky; top:0; z-index:50;
  box-shadow:0 6px 20px rgba(22,35,58,.18);
}
.masthead-in{max-width:1000px;margin:0 auto;display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.brand-refresh{cursor:pointer;-webkit-tap-highlight-color:transparent;user-select:none}
.brand-refresh:active{opacity:.7}
.brand-refresh .mark.spin{animation:brandSpin .6s ease-in-out infinite}
@keyframes brandSpin{50%{transform:rotate(-12deg) scale(.92)}}
.brand{display:flex;align-items:center;gap:.6rem;font-size:1.22rem;font-weight:700;letter-spacing:-.01em}
.brand .mark{
  width:34px;height:40px;border-radius:5px;background:var(--paper);position:relative;flex:none;
  box-shadow:inset -6px 0 0 var(--pen);
}
.brand .mark::after{
  content:"";position:absolute;inset:9px 14px 9px 6px;
  background:repeating-linear-gradient(to bottom,var(--rule) 0 2px,transparent 2px 8px);
}
.masthead .meta{margin-inline-start:auto;font-size:.82rem;color:#9FB2CC}

/* ── التبويبات ── */
.tabs{display:flex;gap:.25rem;max-width:1000px;margin:.85rem auto 0;overflow-x:auto;padding-bottom:2px}
.tab{
  padding:.5rem .95rem;border-radius:999px;font-size:.9rem;font-weight:600;
  color:#9FB2CC;white-space:nowrap;transition:.18s;
}
.tab:hover{color:var(--paper)}
.tab.on{background:var(--paper);color:var(--ink)}

.wrap{max-width:1000px;margin:0 auto;padding:1.2rem 1rem 4rem}
.panel{display:none;animation:rise .28s ease}
.panel.on{display:block}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ── بطاقة ورقية ── */
.sheet{
  background:var(--paper-2);border-radius:var(--r);box-shadow:var(--shadow);
  padding:1.1rem;margin-bottom:1rem;
}
.sheet-head{display:flex;align-items:center;gap:.6rem;margin-bottom:.9rem;flex-wrap:wrap}
.sheet-head h2{font-size:1.05rem}
.sheet-head .sub{font-size:.84rem;color:var(--ink-soft)}
.spacer{margin-inline-start:auto}

/* ── التوقيع البصري: صف ورقة مسطّرة بهامش أحمر ── */
.ruled{
  position:relative;background:var(--paper-2);border-radius:10px;
  padding:.7rem 1rem .7rem 2.6rem;margin-bottom:.5rem;
  box-shadow:var(--shadow);
  background-image:linear-gradient(to bottom,transparent calc(100% - 1px),var(--rule) 100%);
  background-size:100% 2.05rem;
}
.ruled::before{
  content:"";position:absolute;inset-block:0;inset-inline-end:1.55rem;
  width:2px;background:var(--pen);opacity:.5;border-radius:2px;
}
.row{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.row .name{font-weight:700;flex:1;min-width:130px}

/* ── أزرار ── */
.btn{
  padding:.5rem 1rem;border-radius:10px;font-weight:600;font-size:.9rem;
  background:var(--ink);color:var(--paper);transition:.18s;
}
.btn:hover{filter:brightness(1.15)}
.btn:active{transform:translateY(1px)}
.btn.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--rule)}
.btn.ghost:hover{background:#F4F7FB}
.btn.tick{background:var(--tick);color:#fff}
.btn.pen{background:var(--pen);color:#fff}
.btn.sm{padding:.28rem .62rem;font-size:.8rem;border-radius:8px}
.btn:disabled{opacity:.42;cursor:not-allowed;filter:none}

/* ── حقول ── */
.field{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.75rem}
.field label{font-size:.82rem;font-weight:600;color:var(--ink-soft)}
.inp{
  padding:.55rem .75rem;border-radius:10px;background:#F7F9FC;
  border:1.5px solid var(--rule);color:var(--ink);width:100%;
}
.inp:focus{outline:none;border-color:var(--ink);background:#fff}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
@media screen and (max-width:560px){.grid2{grid-template-columns:1fr}}

/* ── وسوم ── */
.pill{
  display:inline-flex;align-items:center;gap:.3rem;padding:.16rem .6rem;
  border-radius:999px;font-size:.78rem;font-weight:700;
}
.pill.pts{background:rgba(27,156,107,.12);color:var(--tick)}
.pill.due{background:rgba(214,69,91,.1);color:var(--pen)}
.pill.quiet{background:#EFF3F8;color:var(--ink-soft)}

/* ── بطاقات المتجر ── */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:.8rem}
.card{
  background:var(--paper-2);border-radius:var(--r);padding:1rem;box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:.45rem;position:relative;overflow:hidden;
  border-top:3px solid var(--c,var(--ink));transition:.2s;
}
.card:hover{transform:translateY(-2px);box-shadow:0 10px 30px rgba(22,35,58,.13)}
.card .ic{font-size:1.7rem;line-height:1}
.card h3{font-size:.98rem}
.card p{margin:0;font-size:.82rem;color:var(--ink-soft);flex:1}
.card .price{font-weight:700;color:var(--c,var(--ink))}
.store-purchases-panel{margin-top:1rem}
.store-purchases-head{display:flex;align-items:center;gap:.65rem;justify-content:space-between;margin-bottom:.65rem}
.store-purchases-title{display:flex;align-items:center;gap:.5rem}
.store-purchases-title h3{margin:0;font-size:.95rem}
.store-purchases-meta{display:flex;gap:.4rem;flex-wrap:wrap}
.store-purchase-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;margin-bottom:.65rem}
.store-purchase-stat{border:1px solid var(--rule);border-radius:10px;padding:.55rem .65rem;background:var(--paper-2);text-align:center}
.store-purchase-stat b{display:block;font-size:1.05rem}
.store-purchase-stat small{color:var(--ink-soft);font-size:.72rem}
.store-purchase-list{display:flex;flex-direction:column;gap:.4rem;max-height:390px;overflow:auto}
.store-purchase-row{display:flex;align-items:center;gap:.65rem;border:1px solid var(--rule);border-radius:10px;padding:.58rem .65rem;background:var(--paper-2)}
.store-purchase-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#EFF3F8;font-weight:800;font-size:.72rem;flex:none}
.store-purchase-main{min-width:0;flex:1}
.store-purchase-main b{display:block;font-size:.83rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.store-purchase-main small{display:block;color:var(--ink-soft);font-size:.72rem;margin-top:.12rem}
.store-purchase-badge{font-weight:800;font-size:.75rem;white-space:nowrap}
.store-purchase-new{font-size:.68rem;padding:.14rem .45rem;border-radius:999px;background:#E4F4EC;color:#167852;font-weight:800}
.store-purchase-exam{color:#0E5B4E}
.store-purchase-more{margin-top:.45rem;font-size:.74rem;color:var(--ink-soft);text-align:center}
.store-purchase-row.is-new{border-color:#9ED8BD;background:#F3FBF7}
.store-purchase-empty{padding:.9rem;text-align:center;color:var(--ink-soft);font-size:.82rem;border:1px dashed var(--rule);border-radius:10px}
@media screen and (max-width:560px){.store-purchase-stats{grid-template-columns:1fr 1fr}.store-purchase-row{align-items:flex-start}.store-purchase-badge{margin-inline-start:auto}}


/* 🖨️ الخطة العلاجية: مستند رسمي بنفس ترويسة التقارير */
#plan-print{display:none}
.plan-doc .plan-txt{line-height:1.9;font-size:.9rem}
.plan-doc .rt td small{display:block;font-size:.72rem;color:#556;margin-top:2px}
.plan-doc .plan-note{font-size:.76rem;color:#556;margin-top:.45rem}
.plan-doc .plan-warn{margin-top:.6rem;padding:.5rem .7rem;border:1px solid #E6C784;background:#FBF1E0;color:#7A5212;border-radius:8px;font-size:.84rem;font-weight:700}
.plan-doc .plan-sign{display:grid;grid-template-columns:repeat(3,1fr);gap:.8rem;margin-top:1.2rem;text-align:center;font-size:.84rem}
.plan-doc .plan-sign div{border-top:1.5px solid #0E5B4E;padding-top:.5rem;display:flex;flex-direction:column;gap:.35rem}
.plan-doc .plan-sign b{min-height:1.2em}
@media print{
  /* إخفاء بقية الصفحة إخفاءً كاملًا (display) لا بصريًا فقط — وإلا بقي طولها وطُبعت أوراق بيضاء */
  html:has(body.printing-plans),body.printing-plans{height:auto!important;min-height:0!important;overflow:visible!important;background:#fff!important}
  body.printing-plans>*:not(#plan-print){display:none!important}
  body.printing-plans #plan-print{display:block!important;position:static!important;width:100%;margin:0;padding:0}
  body.printing-plans .plan-doc{box-shadow:none!important;border-radius:0!important;margin:0!important;zoom:1!important}
  body.printing-plans .plan-doc:not(:last-child){break-after:page;page-break-after:always}
  body.printing-plans .rep-head,body.printing-plans .rep-sec,body.printing-plans .rt th,body.printing-plans .plan-warn{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-plans .rep-box,body.printing-plans .rt tr,body.printing-plans .plan-sign{break-inside:avoid;page-break-inside:avoid}
  body.printing-plans .rep-info{grid-template-columns:repeat(4,1fr)!important;gap:.3rem!important;margin-bottom:.55rem!important}
  body.printing-plans .rep-info div{padding:.3rem .4rem!important;font-size:8.5pt!important;gap:.1rem!important}
  body.printing-plans .rep-head{padding:.6rem 1rem!important}
  body.printing-plans .rep-head .logo{width:70px!important;height:70px!important}
  body.printing-plans .rep-in{padding:.6rem .8rem!important}
  body.printing-plans .rep-sec{padding:.3rem!important;font-size:9.5pt!important}
  body.printing-plans .rep-box{padding:.5rem .6rem!important;margin-bottom:.5rem!important}
  body.printing-plans .rt{font-size:8.5pt!important}
  body.printing-plans .rt th,body.printing-plans .rt td{padding:.28rem!important}
  body.printing-plans .plan-note{margin-top:.25rem!important;font-size:7.5pt!important}
  body.printing-plans .plan-sign{margin-top:.8rem!important}
}
/* 🤖 العلاج التلقائي — لوحة مرتبة */
.ar{padding:1rem 1.1rem}
.card.ar,#auto-rem.ar{min-height:0!important}
.ar-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}
.ar-title h3{margin:0;font-size:1.05rem}
.ar-title p{margin:.2rem 0 0;font-size:.82rem;color:var(--ui-muted,#5A6B84);line-height:1.7;max-width:62ch}
.ar-master{display:flex;align-items:center;gap:.55rem;flex:none;cursor:pointer;padding:.35rem .4rem .35rem .8rem;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-bg)}
.ar-master b{font-size:.9rem;min-width:3.2em;text-align:center}
.ar-switch{position:relative;display:inline-block;width:40px;height:22px;flex:none;cursor:pointer}
.ar-switch.big{width:48px;height:26px}
.ar-switch input{position:absolute;opacity:0;width:0;height:0}
.ar-switch i{position:absolute;inset:0;border-radius:999px;background:#C9D3DE;transition:background .2s}
.ar-switch i::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
.ar-switch.big i::after{width:20px;height:20px}
.ar-switch input:checked+i{background:#1B9C6B}
.ar-switch input:checked+i::after{transform:translateX(-18px)}
.ar-switch.big input:checked+i::after{transform:translateX(-22px)}
[dir="ltr"] .ar-switch input:checked+i::after{transform:translateX(18px)}
.ar-switch input:focus-visible+i{outline:3px solid rgba(27,156,107,.35);outline-offset:2px}
.ar-off{margin-top:.75rem;padding:.6rem .8rem;border-radius:10px;background:#FBF1E0;color:#7A5212;font-size:.84rem}
.ar-is-off .ar-kpis,.ar-is-off .ar-dim,.ar-is-off #auto-rem-recent-sec{display:none}
.ar-is-off .ar-body{margin-top:.6rem}
.ar-is-off .ar-body:not(:has(.ar-escal)){margin-top:0}
.ar-is-off .ar-title p{display:none}
.ar-off-strip{display:flex;flex-wrap:wrap;gap:.4rem .8rem;align-items:center;margin-top:.6rem;padding:.5rem .75rem;border-radius:10px;background:var(--ui-bg);border:1px solid var(--ui-border);font-size:.84rem}
.ar-title .ar-off-sub{display:none;margin:.15rem 0 0;font-size:.8rem;color:var(--ui-muted,#5A6B84)}
.ar-is-off .ar-title .ar-off-sub{display:block}
.ar-body{margin-top:.9rem;display:grid;gap:.7rem}
.ar-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem}
.ar-kpi{border:1px solid var(--ui-border);border-radius:12px;padding:.55rem .7rem;background:var(--ui-bg);display:flex;flex-direction:column;gap:.1rem}
.ar-kpi span{font-size:.76rem;color:var(--ui-muted,#5A6B84)}
.ar-kpi b{font-size:1.35rem;line-height:1.2}
.ar-kpi.escalated b{color:#B03348}.ar-kpi.mastered b{color:#167852}
.ar-escal{border:1.5px solid #F0B8C2;background:#FDF2F4;border-radius:12px;padding:.6rem .7rem;display:grid;gap:.45rem}
.ar-escal-h{font-size:.84rem;font-weight:700;color:#932A3C}
.ar-sec{border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface,#fff)}
.ar-sec>summary{cursor:pointer;padding:.65rem .85rem;font-weight:800;font-size:.9rem;list-style:none;display:flex;align-items:center;gap:.4rem}
.ar-sec>summary::-webkit-details-marker{display:none}
.ar-sec>summary::after{content:"‹";margin-inline-start:auto;transition:transform .2s;color:var(--ui-muted,#5A6B84);font-size:1.1rem}
.ar-sec[open]>summary::after{transform:rotate(-90deg)}
.ar-sec-b{padding:0 .85rem .85rem;display:grid;gap:.6rem}
.ar-twin-top{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.8rem}
.ar-twin-num{display:flex;align-items:baseline;gap:.35rem}
.ar-twin-num b{font-size:1.4rem}.ar-twin-num span{font-size:.8rem;color:var(--ui-muted,#5A6B84)}
.ar-bar{height:8px;border-radius:999px;background:#E5EBF1;overflow:hidden}
.ar-bar i{display:block;height:100%;background:#1B9C6B;border-radius:999px;transition:width .4s}
.ar-run{border:1px solid #CFE3F7;background:#F2F8FE;border-radius:10px;padding:.55rem .7rem;font-size:.84rem;display:grid;gap:.35rem}
.ar-run-m{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .8rem;color:var(--ui-muted,#5A6B84);font-size:.78rem}
.ar-run-m .warn{color:#96651B;font-weight:700}.ar-run-m .btn{margin-inline-start:auto}
.ar-note{font-size:.78rem;color:var(--ui-muted,#5A6B84)}
.ar-alert{padding:.5rem .7rem;border-radius:10px;background:#FBF1E0;color:#7A5212;font-size:.82rem;font-weight:600}
.ar-switch-row{display:flex;align-items:flex-start;gap:.65rem;cursor:pointer;padding-top:.55rem;border-top:1px dashed var(--ui-border)}
.ar-switch-row b{display:block;font-size:.86rem}.ar-switch-row small{display:block;font-size:.76rem;color:var(--ui-muted,#5A6B84);font-weight:400}
.ar-sub{font-size:.8rem;color:var(--ui-muted,#5A6B84)}
.ar-list{display:grid;gap:.35rem}
.ar-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.7rem;padding:.5rem .6rem;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-bg)}
.ar-item.off .ar-item-t{opacity:.55}
.ar-item-t b{display:block;font-size:.86rem}.ar-item-t small{font-size:.74rem;color:var(--ui-muted,#5A6B84)}
.ar-pill{display:inline-flex;align-items:center;gap:.25rem;padding:.22rem .6rem;border-radius:999px;font-size:.76rem;font-weight:700;background:var(--ui-surface-2,#EEF2F7);color:var(--ui-muted,#5A6B84);white-space:nowrap}
.ar-pill.ok{background:#E4F4EC;color:#167852}.ar-pill.bad{background:#FCEBEE;color:#B03348}.ar-pill.warn{background:#FBF1E0;color:#96651B}
.ar-rec{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:.7rem;padding:.55rem .65rem;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-bg)}
.ar-rec-t b{font-size:.88rem}.ar-rec-t small{font-size:.74rem;color:var(--ui-muted,#5A6B84);margin-inline-start:.35rem}
.ar-rec-t span{display:block;font-size:.76rem;color:var(--ui-muted,#5A6B84);margin-top:.1rem}
.ar-rec-m{display:flex;flex-direction:column;align-items:flex-end;font-size:.76rem;color:var(--ui-muted,#5A6B84);white-space:nowrap}
.ar-empty{font-size:.84rem;color:var(--ui-muted,#5A6B84);padding:.2rem 0}
@media screen and (max-width:640px){
  .ar-head{flex-direction:column}
  .ar-master{align-self:stretch;justify-content:space-between}
  .ar-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ar-twin-top{grid-template-columns:auto 1fr}.ar-twin-act{grid-column:1/-1}
  .ar-rec{grid-template-columns:1fr auto}.ar-rec-m{grid-column:1/-1;flex-direction:row;gap:.6rem;align-items:center}
  .ar-item{grid-template-columns:auto 1fr}.ar-item-a{grid-column:2}
}

/* ══ تقرير تحليل النتائج — بنمط وزارة التعليم ══ */
.rep{background:#fff;color:#111;font-family:'Readex Pro','Tajawal',sans-serif}
/* الخطط العلاجية */
.pf-gap .sk-wrap{overflow-x:auto;margin-top:.5rem}
.sk-t{width:100%;border-collapse:collapse;font-size:.84rem}
.sk-t th{font-weight:600;color:var(--ink-soft);text-align:start;padding:.3rem .35rem;border-bottom:1px solid var(--ui-border);white-space:nowrap}
.sk-t td{padding:.32rem .35rem;border-bottom:1px solid var(--ui-border);vertical-align:middle}
.sk-t tr.on td{background:rgba(30,138,92,.09)}
.sk-t .sk-n{font-weight:600}.sk-t .sk-src{font-size:.74rem;white-space:nowrap}
.sk-more{margin-top:.4rem}.sk-more summary{cursor:pointer;font-size:.8rem;color:var(--ink-soft)}
.sk-none{margin-top:.5rem;padding:.6rem .75rem;border-radius:10px;background:rgba(217,142,31,.12);font-size:.84rem;line-height:1.75}
.sk-none ul{margin:.3rem 0;padding-inline-start:1.2rem}
.pf-goals{margin-top:.6rem;padding:.55rem .7rem;border-radius:10px;background:rgba(30,138,92,.08)}
.pf-goals ol{margin:.35rem 0;padding-inline-start:1.3rem;font-size:.86rem;line-height:1.8}
.dx-nosk{margin-top:.45rem;font-size:.82rem;color:#B26A00}
.pc-goals{margin:.35rem 0 0;font-size:.78rem;display:flex;flex-wrap:wrap;gap:.3rem}
.pc-goal{padding:.12rem .5rem;border-radius:999px;border:1px solid var(--ui-border)}
.pc-goal.ok{border-color:#1E8A5C;color:#1E8A5C}.pc-goal.no{border-color:#C88A2E}
.plan-exam{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .7rem;margin-top:.55rem;padding:.55rem .7rem;border:1px dashed var(--ui-border);border-radius:12px;font-size:.88rem}
.plan-card{border:1px solid var(--ui-border);border-radius:14px}
.ann-cls{display:flex;flex-wrap:wrap;gap:.4rem}
.ann-chip{display:inline-flex;align-items:center;gap:.35rem;border:1px solid var(--ui-border);border-radius:999px;padding:.3rem .7rem;font-size:.86rem;cursor:pointer;background:var(--ui-bg)}
.ann-drop{display:flex;flex-direction:column;gap:.2rem;align-items:center;justify-content:center;border:2px dashed var(--ui-border);border-radius:14px;padding:1rem;cursor:pointer;font-weight:700;text-align:center}
.ann-drop small{font-weight:400;color:var(--ui-muted,#5A6B84);font-size:.78rem}
.ann-picked{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}
.ann-file{display:inline-flex;align-items:center;gap:.35rem;border:1px solid var(--ui-border);border-radius:10px;padding:.3rem .5rem;font-size:.84rem;background:var(--ui-bg)}
.ann-file button{border:0;background:none;cursor:pointer;color:var(--ui-muted,#5A6B84);font-size:.9rem}
.ann-progress{height:26px;border-radius:999px;background:#E5EBF1;overflow:hidden;position:relative;margin:.5rem 0}
.ann-progress i{position:absolute;inset:0 auto 0 0;width:0;background:#1B9C6B;transition:width .2s}
.ann-progress span{position:relative;display:block;text-align:center;font-size:.8rem;line-height:26px;font-weight:700}
.ann-list{display:grid;gap:.45rem;margin-top:.5rem}
.ann-row{display:flex;justify-content:space-between;gap:.7rem;align-items:flex-start;border:1px solid var(--ui-border);border-radius:12px;padding:.6rem .7rem;background:var(--ui-bg)}
.ann-row small{display:block;font-size:.76rem}
.ann-fl{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.35rem}.ann-fl a{font-size:.8rem;border:1px solid var(--ui-border);border-radius:8px;padding:.15rem .45rem;text-decoration:none}
.mem-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:.45rem;margin-bottom:.45rem}
.mem-tools .inp{min-width:0;width:100%;max-width:none}
.mem-btns{display:flex;flex-wrap:wrap;gap:.35rem}
@media screen and (max-width:600px){.mem-tools{grid-template-columns:1fr}}
/* iOS يكبّر الصفحة عند لمس خانة خطها أصغر من 16px، فيظهر الشريط السفلي في منتصف الشاشة */
@media (hover:none) and (pointer:coarse){input,select,textarea,.inp{font-size:16px!important}}
.plan-time{margin-top:.5rem;font-size:.84rem;color:var(--ui-muted,#5A6B84)}
.plan-time.done{color:#167852;font-weight:700}
.plan-due{margin-top:.6rem;border:1.5px solid #E9B949;background:#FFF8E6;border-radius:12px;padding:.6rem .75rem;display:grid;gap:.35rem}
.plan-due-h{font-weight:800;color:#7A5212;font-size:.9rem}.plan-due-why{font-size:.82rem;color:#5B4300}
.plan-due-a{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center}
.plan-basis{margin-top:.45rem;font-size:.82rem;font-weight:700;color:#1565C0}
.pf-modal{position:fixed;inset:0;z-index:1150;margin:0!important;background:rgba(15,23,42,.55);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:4vh 16px;overscroll-behavior:contain}
.pf-modal[style*="display: none"],.pf-modal[style*="display:none"]{display:none}
.pf-modal>.pf-dialog{width:100%;max-width:780px;margin:0 auto 4vh;box-shadow:0 18px 50px rgba(0,0,0,.3)}
.pf-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.pf-head h3{margin:0}
body.pf-open{overflow:hidden}
@media screen and (max-width:640px){.pf-modal{padding:8px}}
.ct-name{color:inherit;text-decoration:none;border-bottom:1px dashed var(--ui-border)}.ct-name:hover{color:#1565C0;border-color:#1565C0}
.ct-trend{font-weight:800;font-size:.8rem}.ct-trend.up{color:#2E7D32}.ct-trend.down{color:#C62828}.ct-trend.flat{color:var(--ink-soft)}
.ct-today{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.1rem 0 .7rem;font-size:.85rem}
.ct-per{border:1px solid var(--ui-border);background:var(--ui-surface-2);border-radius:999px;padding:.3rem .7rem;cursor:pointer;font:inherit;font-size:.8rem}.ct-per.done{border-color:#2E9E6B;background:rgba(46,158,107,.08)}
.ct-heat td{text-align:center;font-weight:700;font-size:.8rem;min-width:3.4rem}.ct-heat .ct-avg td{font-size:.78rem}
.ct-sk-h{max-width:8rem;white-space:normal;line-height:1.3;font-size:.74rem}
.ct-stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:.5rem;margin-bottom:.6rem}
.ct-stat{border:1px solid var(--ui-border);border-radius:12px;padding:.55rem .7rem;background:var(--ui-surface-2);font-size:.8rem}
.ct-stat-r{display:flex;flex-wrap:wrap;gap:.2rem .7rem;margin:.25rem 0}
.ct-bins{display:flex;align-items:flex-end;gap:3px;height:36px;margin-top:.2rem}.ct-bins i{flex:1;background:#2E9E6B;border-radius:3px 3px 0 0;opacity:.8}
.ct-miss{color:#8A5A00;font-size:.76rem;margin-top:.2rem}
.ct-miss-on .ct-sc.empty{background:rgba(214,69,91,.1);border-color:#D6455B}
.ct-seg{display:inline-flex;border:1px solid var(--ui-border);border-radius:10px;overflow:hidden}.ct-seg button{border:0;background:none;padding:.35rem .8rem;cursor:pointer;font:inherit;font-size:.82rem}.ct-seg button.on{background:#1F2D45;color:#fff}
.ct-alerts{border:1px solid #E9B949;background:rgba(233,185,73,.08);border-radius:12px;padding:.45rem .7rem;margin-bottom:.6rem}.ct-alerts summary{cursor:pointer;font-weight:800;font-size:.84rem}
.ct-al{font-size:.82rem;padding:.2rem 0;border-top:1px dashed var(--ui-border)}.ct-al.bad{color:#B4232F}
.ct-month td.ct-m{text-align:center;cursor:pointer;font-weight:800;font-size:.76rem;min-width:1.7rem;position:relative;padding:.3rem .15rem}
.ct-month th{font-size:.72rem;padding:.3rem .2rem;text-align:center}
.ct-m.p{background:rgba(46,158,107,.14);color:#1B6B47}.ct-m.n{background:rgba(233,185,73,.2);color:#8A5A00}.ct-m.a{background:rgba(214,69,91,.18);color:#B4232F}.ct-m.e{background:rgba(120,130,150,.15);color:#555}
.ct-m i{position:absolute;top:2px;inset-inline-start:2px;width:5px;height:5px;border-radius:50%;background:#D6455B}
.ct-month b.bad,.ct-table b.bad{color:#B4232F}
.ct-cand{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.35rem 0;border-top:1px dashed var(--ui-border);font-size:.85rem}
.ct-cmp{display:grid;gap:.3rem;margin-bottom:.6rem}.ct-cmp-r{display:grid;grid-template-columns:5rem 1fr 3rem;gap:.5rem;align-items:center;font-size:.82rem}
.ct-cmp-bar{display:flex;height:12px;border-radius:6px;overflow:hidden;background:var(--ui-border)}.ct-cmp-bar i.t{background:#2E9E6B}.ct-cmp-bar i.w{background:#E9B949}.ct-cmp-bar i.b{background:#D6455B}
.ct-pf-head{display:flex;justify-content:space-between;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.6rem}
.ct-kpis.ct-kpis6{grid-template-columns:repeat(6,1fr)}.ct-kpi small{display:block;font-size:.68rem;color:var(--ink-soft);margin-top:.15rem}
.ct-pf-grid{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:.6rem}
.ct-bar{display:grid;grid-template-columns:minmax(90px,1.2fr) 2fr 3.6rem;gap:.45rem;align-items:center;font-size:.8rem;margin-top:.3rem}
.ct-bar i{height:9px;border-radius:5px;background:var(--ui-border);overflow:hidden;display:block}.ct-bar u{display:block;height:100%;text-decoration:none}
.ct-li{display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;padding:.25rem 0;border-top:1px dashed var(--ui-border)}
.ct-li .chip{white-space:nowrap;flex:none;align-self:center}.ct-li>span:first-child{min-width:0}
@media screen and (max-width:900px){.ct-kpis.ct-kpis6{grid-template-columns:repeat(3,1fr)}.ct-pf-grid{grid-template-columns:1fr}}
.ct-pf-print .ct-kpis.ct-kpis6{grid-template-columns:repeat(3,1fr)!important}.ct-pf-print .ct-card{break-inside:avoid}
.ct-pf-print .ct-pf-grid{grid-template-columns:1fr 1fr!important;gap:.45rem!important}
.ct-pf-print .ct-kpi{padding:.4rem!important}.ct-pf-print .ct-kpi b{font-size:1.05rem!important}
.ct-pf-print .ct-card{padding:.5rem .6rem!important}
@media print{.ct-pf-print .ct-kpi,.ct-pf-print .ct-card,.ct-pf-print .chip,.ct-pf-print .ct-bar u{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}}
.ct-cert.t-gold{border:3mm double #B8892B}.ct-cert.t-gold .ct-cert-t{color:#9A6A00}.ct-cert.t-gold .ct-cert-n{border-color:#B8892B}
.ct-cert.t-modern .ct-cert-in{background:linear-gradient(135deg,rgba(21,101,192,.06),rgba(46,158,107,.08));border-radius:6mm}.ct-cert.t-modern .ct-cert-t{color:#1565C0;letter-spacing:.5px}.ct-cert.t-modern .ct-cert-n{border:0;background:#1565C0;color:#fff;border-radius:3mm;padding:1mm 10mm}
.ct-cert.t-classic{border:1.2mm solid #0E5E4E}
.ct-moe{position:relative;width:297mm;height:210mm;background-size:100% 100%;background-repeat:no-repeat;overflow:hidden;font-family:'Tajawal','Readex Pro','Noto Naskh Arabic',Arial,sans-serif;color:#575757;direction:rtl;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.ct-moe>div{position:absolute;left:0;right:0;text-align:center;z-index:1}
.ct-moe>img.ct-moe-bg{position:absolute;inset:0;width:100%;height:100%;z-index:0;display:block!important;max-width:none!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.ct-moe-pre{top:36.4%;font-size:17pt;font-weight:800;margin:0 16%;white-space:nowrap;overflow:hidden}
.ct-moe [data-fit]{white-space:nowrap;overflow:hidden;display:block}
.ct-moe-name span{max-width:94%}
.ct-moe-name{top:44.2%;left:25%!important;right:25%!important;height:5.4%;display:flex;align-items:center;justify-content:center;font-size:20pt;font-weight:800;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.18)}
.ct-moe-body{top:53.3%;font-size:16.5pt;font-weight:800;line-height:2.05;margin:0 17%}
.ct-moe-date{font-size:11.5pt;font-weight:700;color:#777;line-height:1.6;margin-top:.6mm}
.ct-moe-sig{top:79.4%;width:26%;display:flex;flex-direction:column;gap:1.6mm;font-size:15pt;font-weight:800}
.ct-moe-sig span{font-weight:700;min-height:1.2em}.ct-moe-sig b,.ct-moe-sig span{max-width:100%}
.ct-moe-sig.r{right:13%!important;left:auto!important}.ct-moe-sig.l{left:13%!important;right:auto!important}
@media screen{#plan-print .ct-moe{margin:0 auto 6mm;box-shadow:0 4px 18px rgba(0,0,0,.15)}}
@media print{
  html:has(body.printing-cert),body.printing-cert{height:auto!important;min-height:0!important;overflow:visible!important;background:#fff!important;margin:0!important;padding:0!important}
  body.printing-cert>*:not(#plan-print){display:none!important}
  body.printing-cert #plan-print{display:block!important;position:static!important;width:297mm;margin:0;padding:0}
  body.printing-cert .ct-moe{margin:0!important;box-shadow:none!important;break-after:page;page-break-after:always}
  body.printing-cert .ct-moe:last-child{break-after:auto;page-break-after:auto}
}
.ct-tools{gap:.5rem;align-items:center;flex-wrap:wrap;margin-bottom:.6rem}
.ct-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem;margin-bottom:.4rem}
.ct-kpi{border:1px solid var(--ui-border);border-radius:12px;padding:.55rem;text-align:center;background:var(--ui-surface-2)}.ct-kpi b{display:block;font-size:1.25rem}.ct-kpi span{font-size:.78rem;color:var(--ink-soft)}
.ct-kpi.tick{border-color:#2E9E6B}.ct-kpi.warn{border-color:#E9B949}.ct-kpi.bad{border-color:#D6455B}
.ct-table{overflow:auto;border:1px solid var(--ui-border);border-radius:12px}
.ct-table table{width:100%;border-collapse:collapse;font-size:.86rem}
.ct-table th,.ct-table td{padding:.4rem .55rem;border-bottom:1px solid var(--ui-border);text-align:start;vertical-align:middle}
.ct-table thead th{background:var(--ui-surface-2);font-size:.78rem;color:var(--ink-soft);position:sticky;top:0}
.ct-table .inp{padding:.3rem .4rem;min-height:0;margin:0}
.ct-sc{width:4.6rem}.ct-sc.saving{opacity:.5}.ct-sc.saved{border-color:#2E9E6B;background:rgba(46,158,107,.08)}.ct-sc.err{border-color:#D6455B}
.ct-st{min-width:8rem}.ct-st.on,.ct-sch select.on{border-color:#2E9E6B;font-weight:700}
.ct-sch select{min-width:6.5rem}
.ct-card{border:1px solid var(--ui-border);border-radius:12px;padding:.7rem .8rem;background:var(--ui-surface-2)}
.ct-test{display:flex;gap:.45rem;align-items:end;flex-wrap:wrap;padding:.4rem 0;border-top:1px dashed var(--ui-border)}
.ct-test>.inp{flex:1;min-width:160px}.ct-test label{display:grid;gap:.15rem;font-size:.72rem;color:var(--ink-soft);font-weight:600}.ct-test label .inp{width:auto}
.ct-beh{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.3rem 0;border-top:1px dashed var(--ui-border);font-size:.86rem}
.ct-warn{padding:1rem;border-radius:12px;background:rgba(233,185,73,.14);color:#8A5A00}
.ct-cert .ct-cert-in{text-align:center;padding:10mm 8mm;font-size:13pt;line-height:2}
.ct-cert-t{font-size:24pt;font-weight:800;color:#0E5E4E;margin-bottom:6mm}.ct-cert-n{font-size:22pt;font-weight:800;margin:3mm 0;border-bottom:2px solid #0E5E4E;display:inline-block;padding:0 10mm}
@media screen and (max-width:700px){.ct-kpis{grid-template-columns:repeat(2,1fr)}}
.pc{margin-bottom:.6rem;padding:.8rem .9rem;overflow:visible;position:relative}
.pc-need{border-inline-start:4px solid #E9B949}
.pc-top{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start}
.pc-who b{font-size:1rem}.pc-why{font-size:.8rem;color:var(--ink-soft);margin-top:.15rem;line-height:1.5}
.pc-badges{display:flex;gap:.3rem;flex-wrap:wrap;justify-content:flex-end}
.pc-mid{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1.2rem;margin-top:.55rem}
.pc-score{display:flex;align-items:baseline;gap:.4rem;font-size:1.25rem;font-weight:800}.pc-score i{font-style:normal;color:var(--ink-soft);font-size:.9rem}
.pc-gain{font-size:.95rem;padding:.1rem .45rem;border-radius:8px;background:var(--ui-surface-2)}.pc-gain.up{color:#2E7D32}.pc-gain.down{color:#C62828}
.pc-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .8rem;font-size:.8rem}
.pc-prog{display:inline-block;width:70px;height:6px;border-radius:9px;background:var(--ui-border);overflow:hidden;vertical-align:middle}.pc-prog i{display:block;height:100%;background:#2E9E6B}
.plan-need{color:#9A6A00}
.pc-warn{margin-top:.5rem;font-size:.78rem;color:#8A5A00;background:rgba(233,185,73,.12);border-radius:8px;padding:.3rem .55rem}
.pc-det{margin-top:.5rem}.pc-det>summary{cursor:pointer;font-size:.8rem;color:var(--ink-soft);font-weight:700;list-style:none}
.pc-det>summary::before{content:'▸ '}.pc-det[open]>summary::before{content:'▾ '}
.pc-body{padding:.4rem .1rem 0;border-top:1px dashed var(--ui-border);margin-top:.35rem}
.pc-sub{font-weight:700;font-size:.82rem;margin-top:.55rem}
.pc-acts{margin:.3rem 0 .4rem;padding-inline-start:1.1rem;font-size:.86rem}.pc-acts li{margin:.15rem 0}.pc-acts label{cursor:pointer}
.pc-btns{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;margin-top:.55rem}
.pc-ic{min-width:2.3rem;justify-content:center;font-size:1rem;padding-inline:.5rem}
.plan-sum{display:flex;flex-wrap:wrap;gap:.4rem}.plan-sum span{background:var(--ui-surface-2);border:1px solid var(--ui-border);border-radius:10px;padding:.35rem .65rem;font-size:.82rem}.plan-sum b{font-size:1rem;margin-inline-end:.2rem}
.plan-sum .need{border-color:#E9B949;background:rgba(233,185,73,.14)}
.card.plan-fold{min-height:0;display:block}
.plan-fold>summary{cursor:pointer;list-style:none;font-weight:700}.plan-fold>summary::-webkit-details-marker{display:none}
.plan-fold>summary::before{content:'▸ ';color:var(--ink-soft)}.plan-fold[open]>summary::before{content:'▾ '}
.plan-evid{display:flex;flex-wrap:wrap;gap:.35rem .7rem;align-items:center;margin-top:.55rem;font-size:.8rem}
.plan-skt{margin-top:.55rem;font-size:.82rem}.plan-skt table{width:100%;border-collapse:collapse;margin-top:.3rem}
.plan-skt th,.plan-skt td{border-bottom:1px solid var(--ui-border);padding:.3rem .4rem;text-align:start}
.plan-skt tr.main td{background:rgba(46,158,107,.08)}
.pc-by{font-size:.74rem;color:var(--ink-soft);font-weight:700;margin-inline-end:.3rem}
.plan-skt th{font-weight:700;color:var(--ink-soft);font-size:.76rem}.plan-skt .up{color:#2E7D32}.plan-skt .down{color:#C62828}
.pf-skills{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.35rem}
#plan-form .pf-skills label.ann-chip,.pf-skills .ann-chip{display:inline-flex;flex-direction:row;align-items:center;margin:0;font-weight:600}
.pf-skills .ann-chip input{width:auto;margin:0}
.plan-rem{margin-top:.5rem;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;font-size:.84rem}
.kpi-box{flex:1;min-width:140px;border:1px solid var(--ui-border);border-radius:12px;padding:.6rem .7rem;background:var(--ui-bg);display:flex;flex-direction:column;gap:.1rem}
.kpi-box b{font-size:1.25rem}
.kpi-box small{font-size:.72rem}
.chip{display:inline-block;padding:.22rem .6rem;border-radius:999px;font-size:.78rem;font-weight:700;border:1px solid var(--ui-border);background:var(--ui-bg);color:var(--ink)}
.chip.tick{background:#E4F4EC;border-color:transparent;color:#167852}
.chip.bad{background:#FCEBEE;border-color:transparent;color:#B03348}
.chip.warn{background:#FBF1E0;border-color:transparent;color:#96651B}
.chip.ghost{background:var(--ui-surface-2);color:var(--ui-muted,#5A6B84)}
.dx-box{border:1px solid var(--ui-border);border-radius:12px;padding:.7rem .8rem;background:var(--ui-bg)}
.dx-box .chip{margin:.12rem .1rem}
.plan-caution{margin-top:.5rem;padding:.5rem .7rem;border-radius:10px;background:#FBF1E0;color:#96651B;font-size:.83rem;font-weight:600;border:1px solid transparent}
.cand-row{display:flex;justify-content:space-between;align-items:center;gap:.7rem;padding:.55rem 0;border-top:1px solid var(--ui-border)}
.cand-row:first-child{border-top:0}
.mem-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.3rem;max-height:190px;overflow:auto}
.mem-item{display:flex;align-items:center;gap:.4rem;padding:.3rem .45rem;border-radius:8px;font-weight:400;font-size:.85rem;cursor:pointer}
.mem-item.on{background:var(--ui-surface);font-weight:700}
.mem-table{margin-top:.5rem;border:1px solid var(--ui-border);border-radius:10px;overflow:hidden}
.mem-row{display:grid;grid-template-columns:1fr auto auto;gap:.6rem;align-items:center;padding:.4rem .6rem;font-size:.85rem;border-top:1px solid var(--ui-border)}
.mem-row:first-child{border-top:0}
.grp-row{display:flex;justify-content:space-between;align-items:flex-start;gap:.7rem;padding:.6rem 0;border-top:1px solid var(--ui-border)}
.grp-row:first-child{border-top:0}
.grp-wide{background:#FBF1E0;border-radius:10px;padding:.55rem .7rem;color:#96651B;font-size:.83rem;font-weight:600;margin-top:.35rem}
#p-plans label{display:block;font-weight:600;font-size:.85rem}
#p-plans .inp{margin-top:.25rem}
#plan-form label{display:block;font-weight:600;font-size:.85rem}#plan-form .inp{margin-top:.25rem}
.rep-page{background:#fff;margin-bottom:1.2rem;box-shadow:var(--shadow);border-radius:10px;overflow:hidden}
.rep-head{position:relative;background:#0E5B4E;color:#fff;padding:1.1rem 1.3rem;
  display:flex;align-items:center;gap:1rem}
.rep-head .t{flex:1;text-align:start;line-height:1.7;padding-inline-end:3rem}
.rep-head .t b{display:block;font-size:1.05rem}
.rep-head .t span{font-size:.8rem;opacity:.92;display:block}
.rep-head .mid{flex:none;text-align:end;font-size:1.15rem;font-weight:700;padding-inline-start:3rem}
/* الشعار في المنتصف تماماً */
.rep-head .logo{flex:none;width:92px;height:92px;
  display:flex;align-items:center;justify-content:center}
.rep-head .logo svg{width:100%;height:100%;display:block}
.rep-head .logo svg [class^="moe-st"]{fill:#fff !important}
.rep-in{padding:1rem 1.2rem}
.rep-info{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem;margin-bottom:1rem}
.rep-info div{border:1px solid #D8E3E0;border-radius:8px;padding:.5rem .7rem;font-size:.82rem;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.28rem;line-height:1.45}
.rep-info b{font-weight:700;display:block;line-height:1.5}
.rep-band{background:#EAF4F1;border-radius:8px;padding:.5rem;text-align:center;font-weight:700;color:#0E5B4E;margin-bottom:.8rem}
.rep-sec{background:#0E5B4E;color:#fff;border-radius:8px 8px 0 0;padding:.5rem;text-align:center;font-weight:700;font-size:.92rem}
.rep-box{border:1px solid #D8E3E0;border-top:none;border-radius:0 0 8px 8px;padding:.8rem;margin-bottom:1rem}
.rep-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:.9rem}
.rt{width:100%;border-collapse:collapse;font-size:.83rem}
.rt th{background:#0E5B4E;color:#fff;padding:.5rem;font-weight:700}
.rt td{border:1px solid #E3EBE9;padding:.45rem;text-align:center}

/* ═══ الكشف النهائي لأعمال السنة ═══ */
#comp-table{overflow-x:auto}
.comp-report .rep-page{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.comprehensive-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.86rem}
.comprehensive-table thead{display:table-header-group}
.comprehensive-table th{background:#0E5B4E;color:#fff;padding:.62rem .45rem;font-weight:700;text-align:center;vertical-align:middle;line-height:1.35}
.comprehensive-table td{border:1px solid #DCE7E4;padding:.48rem .4rem;text-align:center;vertical-align:middle;background:#fff}
.comprehensive-table tbody tr:nth-child(even) td{background:#FBFCFC}
.comprehensive-table td>b{display:block;font-size:.95rem}
.comprehensive-table td small{display:block;font-size:.68rem;color:#667;margin-top:1px}
.comprehensive-table td em{display:block;font-style:normal;font-size:.66rem;color:#667;margin-top:2px;white-space:nowrap}
.comprehensive-table .cnm{text-align:start;min-width:230px}
.comprehensive-table .cnum{width:42px}
.comprehensive-table .score{font-variant-numeric:tabular-nums;white-space:nowrap}
.comprehensive-table .ctotal{background:#EAF4F1!important;color:#0E5B4E;font-weight:800}
.comprehensive-table .clevel{font-weight:700;white-space:nowrap}
.comprehensive-table .cexam{background:#F5F0FA!important;color:#6F5AA8;font-weight:800}
.comprehensive-table .cgrand{background:#EAF4F1!important;color:#0E5B4E;font-weight:900}

.comprehensive-table tfoot td{background:#F2F7F5!important;font-weight:800}
.comp-summary-note{font-size:.78rem;color:var(--ink-soft);text-align:center;margin-top:.55rem}
.comp-toolbar{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.comp-toolbar .inp{min-width:180px}
@media screen and (max-width:900px){
  .comprehensive-table{font-size:.78rem;min-width:900px}
  .comprehensive-table th,.comprehensive-table td{padding:.4rem .3rem}
}
@media print{
  @page{size:A4 landscape;margin:10mm}
  .wk-beh span{font-size:1.02rem;margin:0 1px;line-height:1.5}
  .wk-beh small{font-size:.66rem;color:#667;margin-inline-start:2px}
  .wk-legend{display:flex;flex-wrap:wrap;gap:.35rem .9rem;margin:.5rem 0 .2rem;font-size:.74rem;color:#556}
  .wk-legend span b{font-size:.95rem;margin-inline-end:.2rem}
  /* حزام أمان: أي تصغير عالق يُلغى على الورق */
  #comp-table .rep-page,#wk-table .rep-page,#ca-body .rep-page,#an-body .rep-page,
  #p-grades .grades-table-wrap{zoom:1!important}
  body.printing-analysis *{visibility:hidden!important}
  body.printing-analysis #an-body,body.printing-analysis #an-body *{visibility:visible!important}
  body.printing-analysis #an-body{position:absolute;inset:0 auto auto 0;
    width:100%!important;max-width:100%!important;padding:0;margin:0;overflow:visible}
  body.printing-analysis .no-print{display:none!important}
  body.printing-analysis .rep-page{box-shadow:none!important;border:0!important;margin:0!important;border-radius:0!important}
  body.printing-analysis .rep-head,body.printing-analysis .rep-band,body.printing-analysis .rt th{
    background:#0E5B4E!important;color:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-analysis .donut,body.printing-analysis .bars .b i,body.printing-analysis .leg i,
  body.printing-analysis .rt .lv{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-analysis .rep-grid{grid-template-columns:1.35fr 1fr!important;gap:.5rem}
  body.printing-analysis .rep-grid>*,body.printing-analysis .rep-charts>*{min-width:0!important}
  body.printing-analysis .rst div>span:first-child{min-width:0}
  body.printing-analysis .rep-page{break-after:auto!important;page-break-after:auto!important}
  body.printing-analysis .rep-page:not(:last-child){break-after:page;page-break-after:always}
  #p-analysis, #p-analysis *{max-width:100%!important;box-sizing:border-box}
  #p-analysis #an-body,#p-analysis .rep,#p-analysis .rep-page,
  #p-analysis .rep-in,#p-analysis .rep-box{width:100%!important;max-width:100%!important;min-width:0!important}
  #p-analysis table{width:100%!important;min-width:0!important;table-layout:fixed;font-size:8.2pt}
  #p-analysis table th,#p-analysis table td{padding:.28rem .2rem;word-break:break-word}
  #p-analysis .rep-charts{grid-template-columns:1fr 1fr!important;gap:.5rem}
  #p-analysis .rep-charts>div,#p-analysis .rep-box,#p-analysis .rt tr{
    break-inside:avoid;page-break-inside:avoid}
  #p-analysis .bars{height:96px}
  #p-analysis .donut{width:96px;height:96px;flex:0 0 96px}
  #p-analysis .blab span{font-size:7.6pt;word-break:break-word}
  body.printing-compan *{visibility:hidden!important}
  body.printing-compan #ca-body,body.printing-compan #ca-body *{visibility:visible!important}
  /* 📐 المقاس: العرض من الورقة لا من الشاشة. inset:0 وحده كان يمدّ المحتوى
     بعرض نافذة المتصفح فيخرج عن حدود A4 — ومن هنا جاء عدم الانضباط. */
  body.printing-compan #ca-body{position:absolute;inset:0 auto auto 0;
    width:100%!important;max-width:100%!important;padding:0;margin:0;overflow:visible}
  body.printing-compan #ca-body *{max-width:100%!important;box-sizing:border-box}
  body.printing-compan .rep,body.printing-compan .rep-page,body.printing-compan .rep-in,
  body.printing-compan .rep-box{width:100%!important;max-width:100%!important;min-width:0!important}
  body.printing-compan .comprehensive-table{font-size:8.5pt;min-width:0!important;
    width:100%!important;table-layout:fixed}
  body.printing-compan .comprehensive-table th,
  body.printing-compan .comprehensive-table td{padding:.3rem .25rem;word-break:break-word}
  body.printing-compan .no-print{display:none!important}
  body.printing-compan .rep-page{box-shadow:none!important;border:0!important;margin:0!important;border-radius:0!important}
  body.printing-compan .rep-in{padding:.6rem 0}
  body.printing-compan .rep-charts{grid-template-columns:1fr 1fr!important;gap:.5rem}
  body.printing-compan .bars{height:96px}
  body.printing-compan .bars .b em{font-size:9pt}
  body.printing-compan .blab span{font-size:7.6pt;word-break:break-word}
  body.printing-compan .donut{width:96px;height:96px;flex:0 0 96px}
  body.printing-compan .rep-charts>div,body.printing-compan .rep-box,
  body.printing-compan .rt tr{break-inside:avoid;page-break-inside:avoid}
  body.printing-compan .rep-head,body.printing-compan .rep-band,body.printing-compan .comprehensive-table th{background:#0E5B4E!important;color:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-compan .comprehensive-table .ctotal{background:#EAF4F1!important;color:#0E5B4E!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-compan .donut,body.printing-compan .bars .b i,body.printing-compan .leg i{
    -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-weekly *{visibility:hidden!important}
  body.printing-weekly #wk-table,body.printing-weekly #wk-table *{visibility:visible!important}
  body.printing-weekly #wk-table{position:absolute;inset:0;width:100%;padding:0;margin:0}
  body.printing-weekly .no-print{display:none!important}
  body.printing-weekly .rep-page{box-shadow:none!important;border:0!important;margin:0!important;border-radius:0!important}
  body.printing-weekly .rep-head,body.printing-weekly .rep-band,body.printing-weekly .comprehensive-table th{background:#0E5B4E!important;color:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-weekly #wk-table{position:absolute;inset:0 auto auto 0;width:100%!important;max-width:100%!important}
  body.printing-weekly #wk-table *{max-width:100%!important;box-sizing:border-box}
  body.printing-weekly .rep,body.printing-weekly .rep-page,body.printing-weekly .rep-in,
  body.printing-weekly .rep-box{width:100%!important;max-width:100%!important;min-width:0!important}
  body.printing-weekly .comprehensive-table{font-size:7.8pt;min-width:0!important;width:100%!important;table-layout:fixed}
  body.printing-weekly .comprehensive-table th,
  body.printing-weekly .comprehensive-table td{padding:.26rem .18rem;word-break:break-word}
  body.printing-weekly .comprehensive-table .cnm{min-width:0}
  body.printing-weekly .rt tr{break-inside:avoid;page-break-inside:avoid}
  body.printing-comprehensive *{visibility:hidden!important}
  body.printing-comprehensive #comp-table,body.printing-comprehensive #comp-table *{visibility:visible!important}
  body.printing-comprehensive #comp-table{position:absolute;inset:0;width:100%;padding:0;margin:0}
  body.printing-comprehensive .no-print{display:none!important}
  body.printing-comprehensive .comp-report .rep-page{box-shadow:none!important;border:0!important;margin:0!important;border-radius:0!important}
  body.printing-comprehensive .rep-head{background:#0E5B4E!important;color:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-comprehensive .rep-band,.printing-comprehensive .comprehensive-table th{background:#0E5B4E!important;color:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-comprehensive .comprehensive-table .ctotal{background:#EAF4F1!important;color:#0E5B4E!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.printing-comprehensive .rep-in{padding:.7rem 0}
  body.printing-comprehensive .comprehensive-table{font-size:8.5pt;min-width:0}
  body.printing-comprehensive .comprehensive-table th,body.printing-comprehensive .comprehensive-table td{padding:.32rem .28rem}
}
.rt .lv{color:#fff;font-weight:700;border:none}
.rst div{display:flex;gap:.4rem;margin-bottom:.4rem}
.rst div>span:first-child{flex:1;background:#EAF4F1;border-radius:7px;padding:.42rem .6rem;font-size:.82rem;font-weight:700;color:#0E5B4E}
.rst div>span:last-child{width:88px;border:1px solid #D8E3E0;border-radius:7px;padding:.42rem;text-align:center;font-size:.84rem;font-weight:700}
.rep-charts{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}
.bars{display:flex;align-items:flex-end;gap:.5rem;height:150px;padding:0 .3rem;border-bottom:1px solid #E3EBE9}
.bars .b{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%}
.bars .b i{width:100%;max-width:46px;border-radius:5px 5px 0 0;min-height:2px}
.bars .b em{font-style:normal;font-size:.78rem;font-weight:700;margin-bottom:.2rem}
.blab{display:flex;gap:.5rem;padding:.35rem .3rem 0}
.blab span{flex:1;text-align:center;font-size:.72rem}
.donut{width:150px;height:150px;border-radius:50%;margin:0 auto;display:flex;align-items:center;
  justify-content:center;font-weight:700;font-size:1.25rem;color:#fff}
.donut b{background:rgba(0,0,0,.12);border-radius:50%;width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.leg{display:flex;flex-direction:column;gap:.28rem;font-size:.78rem}
.leg div{display:flex;align-items:center;gap:.4rem;border:1px solid #E3EBE9;border-radius:7px;padding:.3rem .5rem}
.leg i{width:13px;height:13px;border-radius:3px;display:inline-block}
.an-mode{padding:.3rem .85rem;border-radius:999px;font-family:inherit;font-weight:700;
  font-size:.82rem;background:transparent;color:var(--ink-soft);border:none;cursor:pointer}
.an-mode.on{background:var(--ink);color:var(--paper)}
.heat{border-collapse:collapse;font-size:.72rem;width:100%}
.heat th{background:#0E5B4E;color:#fff;padding:.3rem .2rem;font-weight:700;font-size:.68rem}
.heat th.nm{text-align:start;min-width:110px}
.heat td{border:1px solid #EAEFED;padding:.28rem .2rem;text-align:center;font-weight:700}
.heat td.nm{text-align:start;font-weight:700;background:#F7F9FC;font-size:.76rem;white-space:nowrap}
.hb{display:flex;align-items:center;gap:.5rem;margin-bottom:.42rem;font-size:.8rem}
.hb .nm{width:170px;text-align:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hb .tr{flex:1;background:#EEF2F0;border-radius:99px;height:16px;overflow:hidden;position:relative}
.hb .tr i{display:block;height:100%;border-radius:99px}
.hb .vv{width:52px;text-align:center;font-weight:700}
@media screen and (max-width:640px){ .hb .nm{width:110px} }
.rep-foot{display:grid;grid-template-columns:1fr 1fr;gap:.6rem;margin-top:1rem}
.rep-foot div{border:1px solid #D8E3E0;border-radius:8px;padding:.55rem;text-align:center;font-size:.83rem}
@media screen and (max-width:700px){
  .rep-grid,.rep-charts,.rep-info{grid-template-columns:1fr}
  .rep-head{flex-direction:column;text-align:center}
  .rep-head .t{text-align:center}
}
#print-report{ display:none; }
#class-activity-print-report{display:none;}
.class-print-page{
  background:#fff;color:#16233A;font-family:'Readex Pro','Tajawal',sans-serif;
  direction:rtl;width:100%;min-height:257mm;box-sizing:border-box;
}
.class-print-page + .class-print-page{page-break-before:always;}
.class-print-wrap{padding:0 1mm;}
.class-print-top{
  display:grid;grid-template-columns:1fr 170px 1fr;align-items:start;
  gap:12px;margin-bottom:8px;
  padding-top:2px;
}
.class-print-school{font-size:11px;line-height:1.65;font-weight:800;text-align:right;padding-top:3px;}
.class-print-school span{display:block;}
.class-print-school .soft{font-weight:600;color:#5A6B84;}
.class-print-logo{width:128px;height:76px;display:flex;align-items:center;justify-content:center;margin:auto;}
.class-print-logo svg{width:100%;height:100%;display:block;}
.class-print-badge{
  justify-self:start;border:1px solid #CBD7E3;border-radius:8px;padding:8px 24px;
  font-weight:900;color:#4F6175;font-size:12px;background:#FBFCFD;
}
.class-print-titleband{
  border-top:3px solid #5FA5D7;border-bottom:1px solid #DDE7EE;
  padding:7px 12px 8px;text-align:center;margin:6px 0 10px;
}
.class-print-title{font-size:19px;font-weight:900;line-height:1.45;}
.class-print-sub{font-size:10px;color:#5A6B84;font-weight:700;margin-top:2px;}
.class-print-kicker{font-size:11.5px;font-weight:900;color:#238F6B;margin:2px 0 6px;}
.class-print-statrow{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:10px 0 12px;}
.class-print-stat{
  border:1px solid #C9D6E0;border-radius:10px;padding:10px 10px;text-align:center;background:#fff;
}
.class-print-stat.green{box-shadow:inset 0 3px 0 #17B889;}
.class-print-stat.red{box-shadow:inset 0 3px 0 #EF4B55;}
.class-print-stat.blue{box-shadow:inset 0 3px 0 #4285DC;}
.class-print-stat b{display:block;font-size:20px;line-height:1.05;margin-bottom:4px;}
.class-print-stat span{font-size:10px;color:#5A6B84;font-weight:700;}
.class-print-stat.green b{color:#2F9E75;}
.class-print-stat.red b{color:#E94B54;}
.class-print-stat.blue b{color:#3E73B9;}
.class-print-bodygrid{display:grid;grid-template-columns:1.05fr 1.5fr;gap:12px;align-items:stretch;}
.class-print-card{
  border:1.3px solid #AFCFBF;border-radius:10px;overflow:hidden;background:#fff;
  box-shadow:0 1px 0 rgba(175,207,191,.18);
}
.class-print-card h3{
  margin:0;padding:6px 9px;text-align:center;font-size:11px;color:#238F6B;
  border-bottom:1px solid #CFE1D8;background:#FBFDFC;font-weight:900;
}
.class-print-table{width:100%;border-collapse:collapse;font-size:10px;}
.class-print-table td{border-bottom:1px solid #E8EEF2;padding:6px 7px;text-align:center;}
.class-print-table tr:last-child td{border-bottom:0;}
.class-print-table td.label{text-align:right;font-weight:700;color:#40546B;}
.class-print-table td.val{font-weight:900;}
.class-print-barwrap{padding:12px 12px 10px;}
.class-print-barrow{display:grid;grid-template-columns:82px 1fr 34px;gap:8px;align-items:center;margin:9px 0;}
.class-print-barlabel{font-size:9px;font-weight:800;}
.class-print-bar{height:17px;background:#EEF2F5;border-radius:6px;overflow:hidden;}
.class-print-bar i{display:block;height:100%;border-radius:5px;}
.class-print-bar.green i{background:#17B889;}
.class-print-bar.red i{background:#EF4B55;}
.class-print-bar.blue i{background:#4285DC;}
.class-print-bar-num{font-size:9px;font-weight:900;text-align:center;}
.class-print-donutrow{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;padding:15px 12px;min-height:126px;align-items:center;}
.class-print-donut{
  width:112px;height:112px;border-radius:50%;margin:auto;position:relative;
  display:flex;align-items:center;justify-content:center;
  background:conic-gradient(#17B889 var(--p), #ECEDEF 0);
}
.class-print-donut.red{background:conic-gradient(#EF4B55 var(--p), #ECEDEF 0);}
.class-print-donut > div{
  width:76px;height:76px;background:#fff;border-radius:50%;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;font-weight:900;line-height:1.1;
}
.class-print-donut strong{font-size:15px;}
.class-print-donut span{font-size:8.5px;color:#46586B;margin-top:3px;font-weight:700;}
.class-print-foot{
  display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:22px;padding-top:6px;
  font-size:10px;font-weight:800;
}
.class-print-foot div{padding-top:7px;}
.class-print-note{
  margin-top:8px;border-top:1px solid #E3E9ED;padding-top:5px;text-align:center;
  color:#7A8796;font-size:8.5px;
}

/* الصفحة الثانية: الكشف التفصيلي */
.class-print-detail-head{margin-bottom:9px;}
.class-print-detail-title{
  border-top:3px solid #5FA5D7;border-bottom:1px solid #DDE7EE;
  text-align:center;padding:5px 10px;font-size:17px;font-weight:900;
}
.class-print-detail-meta{
  display:grid;grid-template-columns:1.35fr 1fr 1fr 1fr;gap:7px;margin:8px 0;
}
.class-print-detail-meta div{
  border:1px solid #CBD8E2;border-radius:7px;padding:5px 6px;text-align:center;font-size:9px;
}
.class-print-detail-meta b{display:block;font-size:9.5px;margin-top:1px;}
.class-print-listtable{width:100%;border-collapse:collapse;font-size:9.2px;}
.class-print-listtable th{
  background:#F4F6F8;border:1px solid #C7D1DA;padding:5px 4px;font-weight:900;color:#33475C;
}
.class-print-listtable td{
  border:1px solid #D7DEE5;padding:4px 5px;text-align:center;height:22px;
}
.class-print-listtable td.name{text-align:right;font-weight:700;}
.class-print-status{
  display:inline-block;border-radius:999px;padding:2px 11px;font-size:8.5px;font-weight:900;
  min-width:60px;
}
.class-print-status.done{background:#11B784;color:#fff;}
.class-print-status.missing{background:#EF464F;color:#fff;}
.class-print-grade{font-weight:900;color:#2E73C8;font-size:9.6px;}
.class-print-footer-note{
  display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:15px;font-size:9px;font-weight:800;
}
.class-print-footer-note div{padding-top:8px;}

@media print{
  body.printing-class-activity > *{display:none !important;}
  body.printing-class-activity #class-activity-print-report{display:block !important;}
  body.printing-class-activity #class-activity-print-report .class-print-page{display:block !important;box-shadow:none;}
  body.printing-class-activity{background:#fff !important;}
  .class-print-page{font-size:10pt;}
  .class-print-page,.class-print-page *{-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  .class-print-listtable thead{display:table-header-group;}
  .class-print-listtable tr{break-inside:avoid;page-break-inside:avoid;}
  @page{size:A4 portrait;margin:8mm;}
  .class-print-page{min-height:0;}
  .class-print-page + .class-print-page{page-break-before:always;}
}



@media print{
  /* 🖨️ طباعة تقرير طالب واحد */
  body.printing-student > *{ display:none !important; }
  body.printing-student #print-report{ display:block !important; }
  body.printing-student #print-report .rep-page{ box-shadow:none; margin:0 }

  @page{ size:A4 portrait; margin:10mm 9mm; }
  .no-print,.masthead,.tabs,#toast,.veil{display:none !important}
  .panel:not(.on){display:none}
  html,body{background:#fff !important;margin:0;padding:0}
  body{font-size:10.5pt;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .wrap{max-width:100%;padding:0;margin:0}

  .rep-page{box-shadow:none;border-radius:0;margin:0;break-after:page;page-break-after:always}
  .rep-page:last-child{break-after:auto;page-break-after:auto}

  /* الترويسة تُطبع بلونها */
  .rep-head{padding:.7rem 1rem;background:#0E5B4E !important;color:#fff !important}
  /* 📄 صفحة A4 — بلا ارتفاع مفروض حتى لا تنقسم */
  @page{ size:A4 portrait; margin:8mm; }
  html,body{ height:auto !important }
  .rep-page{ page-break-inside:auto; display:block !important; height:auto !important }
  .rep-head{position:relative !important;padding:.6rem 1rem !important}
  .rep-head .t b{font-size:12pt !important}
  .rep-head .t span{font-size:8.8pt !important;line-height:1.45 !important}
  .rep-head .mid{font-size:14pt !important;padding-inline-start:2.2rem !important}
  .rep-head .logo{width:88px !important;height:88px !important}
  .rep-in{padding:.65rem .85rem !important}

  .rep-info{gap:.3rem !important;margin-bottom:.4rem !important}
  .rep-info div{padding:.32rem .45rem !important;font-size:9.4pt !important}
  .rep-band{padding:.32rem !important;margin-bottom:.4rem !important;font-size:10.5pt !important}
  .rep-sec{padding:.36rem !important;font-size:10.5pt !important}
  .rep-box{padding:.5rem !important;margin-bottom:.4rem !important}

  .rt{font-size:9.8pt !important}
  .rt th{padding:.32rem !important;font-size:9.8pt !important}
  .rt td{padding:.3rem !important}
  .rst div{margin-bottom:.24rem !important}
  .rst div>span{padding:.3rem .5rem !important;font-size:9.8pt !important}
  .rst div>span:last-child{width:88px !important}

  .rep-charts{gap:.55rem !important}
  .bars{height:112px !important}
  .bars .b em{font-size:9.6pt !important}
  .blab span{font-size:8.8pt !important}
  .donut{width:112px !important;height:112px !important;font-size:1.05rem !important}
  .leg{font-size:9.2pt !important;gap:.22rem !important}
  .leg div{padding:.26rem .45rem !important}
  .leg i{width:13px !important;height:13px !important}

  .hb{font-size:9.4pt !important;margin-bottom:.3rem !important}
  .hb .nm{width:185px !important}
  .hb .tr{height:12px !important}
  .hb .vv{width:48px !important}

  .rep-foot{margin-top:.4rem !important;padding-top:.15rem !important;
            break-inside:avoid !important;page-break-inside:avoid !important}
  .rep-foot div{padding:.42rem !important;font-size:9.8pt !important}
  .rep-head{display:flex !important;align-items:center !important;gap:.7rem !important}
  .rep-head .t{flex:1 !important;min-width:0 !important}
  .rep-head .mid{flex:1 !important;min-width:0 !important;text-align:end !important}
  .rep-head .logo{position:static !important;transform:none !important;
                  flex:none !important;width:80px !important;height:80px !important}
  .rep-head .logo svg{width:100% !important;height:100% !important}
  .rep-head .logo svg [class^="moe-st"]{fill:#fff !important}
  .rep-head .t b{font-size:11pt}
  .rep-head .t span{font-size:8pt}
  .rep-head .mid{font-size:14pt}
  .rep-in{padding:.7rem .9rem}

  /* الكتل الصغيرة لا تُشطر — أما الصناديق الطويلة فتُشطر بدل ترك صفحة فارغة */
  .rep-sec,.rep-info,.rep-foot,.rep-charts>div,.hb,.rt tr{
    break-inside:avoid;page-break-inside:avoid}
  .rep-sec{break-after:avoid;page-break-after:avoid}
  .rep-box{break-inside:auto;page-break-inside:auto}
  /* الصناديق القصيرة (الرسوم والإحصائيات) تبقى كاملة */
  .rep-charts .rep-box,.rep-grid .rep-box{break-inside:avoid;page-break-inside:avoid}
  /* 📄 الوضع المختصر: الصناديق تبقى كاملة — بلا فرضها على كل عنصر */
  .rep-page.one-page .rep-box{break-inside:avoid !important;page-break-inside:avoid !important}
  .rep-page.one-page .rep-sec{break-after:avoid !important;page-break-after:avoid !important}
  /* رأس الجدول يتكرر عند الانقسام */
  .rt thead{display:table-header-group}
  .rt tbody tr{break-inside:avoid;page-break-inside:avoid}

  /* حافظ على التخطيط الأفقي في الورق */
  .rep-info{grid-template-columns:repeat(4,1fr);gap:.35rem;margin-bottom:.6rem}
  .rep-info div{padding:.35rem .5rem;font-size:8.5pt}
  .rep-grid{grid-template-columns:1.35fr 1fr;gap:.6rem}
  .rep-charts{grid-template-columns:1fr 1fr;gap:.6rem}
  .rep-band{padding:.35rem;margin-bottom:.55rem;font-size:10pt}
  .rt{font-size:8.8pt}
  .rt th{padding:.35rem;font-size:8.8pt}
  .rt td{padding:.3rem}
  .rst div{margin-bottom:.28rem}
  .rst div>span{padding:.32rem .5rem;font-size:8.8pt}
  .bars{height:118px}
  .donut{width:118px;height:118px;font-size:1rem}
  .leg{font-size:8pt}
  .leg div{padding:.22rem .4rem}
  .hb{font-size:8.6pt;margin-bottom:.3rem}
  .hb .nm{width:150px}
  .hb .tr{height:13px}
  .rep-foot{margin-top:.7rem}
  .rep-foot div{padding:.4rem;font-size:9pt}

  /* رأس الجدول يتكرر في كل ورقة */
  .rt thead{display:table-header-group}
  .rt tfoot{display:table-footer-group}
}
.gt{width:100%;border-collapse:collapse;font-size:.85rem;background:var(--paper-2);
  border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
.gt th,.gt td{padding:.5rem .6rem;text-align:center;border-bottom:1px solid var(--rule);white-space:nowrap}
.gt th{background:var(--ink);color:var(--paper);font-weight:700;font-size:.8rem;position:sticky;top:0}
.gt td.nm{text-align:start;font-weight:700;position:sticky;inset-inline-end:0;background:var(--paper-2);
  z-index:2;box-shadow:-2px 0 4px rgba(22,35,58,.05)}
.gt thead th:nth-child(2){position:sticky;inset-inline-end:0;z-index:3}
.gt tr:hover td{background:#F7F9FC}
.gt .ok{color:var(--tick);font-weight:700}
.gt .no{color:var(--pen)}
.gt .late{color:#C88A2E;font-weight:700}
.gt .tot{background:#EFF3F8;font-weight:700}
.gt .dt{display:block;font-size:.68rem;color:var(--ink-soft);font-weight:400}
.hide{display:none !important}
.empty{text-align:center;color:var(--ink-soft);padding:2rem 1rem}
.empty .big{font-size:2.4rem;display:block;margin-bottom:.4rem;opacity:.5}

/* ── إشعار ── */
#toast{
  position:fixed;inset-block-end:1.2rem;inset-inline:0;margin:auto;width:max-content;max-width:88vw;
  background:var(--ink);color:var(--paper);padding:.6rem 1.1rem;border-radius:999px;
  font-size:.88rem;font-weight:600;box-shadow:0 8px 28px rgba(22,35,58,.3);
  opacity:0;transform:translateY(14px);transition:.25s;pointer-events:none;z-index:900;
}
#toast.on{opacity:1;transform:none}
#toast.bad{background:var(--pen)}
#toast.good{background:var(--tick)}

/* ── نافذة ── */
.veil{
  position:fixed;inset:0;background:rgba(22,35,58,.55);backdrop-filter:blur(3px);
  display:none;align-items:center;justify-content:center;padding:1rem;z-index:800;
}
.veil.on{display:flex}
.modal{
  background:var(--paper);border-radius:18px;padding:1.3rem;width:min(560px,100%);
  max-height:86vh;overflow:auto;box-shadow:0 24px 60px rgba(22,35,58,.35);
}
.modal h2{font-size:1.1rem;margin-bottom:.9rem}
.modal-foot{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem;flex-wrap:wrap}

/* ══════════════════════════════════════════════
   UI Refresh — واجهة محسّنة فقط
   لا يغيّر منطق التطبيق أو الـ Worker.
   ══════════════════════════════════════════════ */
:root{
  --ui-bg:#E9EEF5;
  --ui-surface:#F7FAFD;
  --ui-surface-2:#F1F5FA;
  --ui-border:#D5E0EC;
  --ui-border-strong:#C9D6E5;
  --ui-radius:16px;
  --ui-radius-sm:11px;
  --ui-shadow:0 2px 5px rgba(22,35,58,.04),0 12px 32px rgba(22,35,58,.07);
  --ui-shadow-hover:0 5px 14px rgba(22,35,58,.07),0 18px 40px rgba(22,35,58,.10);
}

body{
  background:
    radial-gradient(circle at 100% 0,rgba(201,214,229,.20),transparent 28rem),
    var(--ui-bg);
}

.masthead{
  padding:.85rem 1rem .7rem;
  background:rgba(22,35,58,.98);
  box-shadow:0 8px 28px rgba(22,35,58,.18);
  backdrop-filter:blur(14px);
}
.masthead-in{max-width:1120px}
.brand{font-size:1.15rem}
.brand .mark{
  width:36px;height:42px;border-radius:7px;
  box-shadow:inset -5px 0 0 var(--pen),0 2px 8px rgba(0,0,0,.12);
}
.masthead .meta{
  padding:.28rem .65rem;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
}
.tabs{
  max-width:1120px;
  gap:.35rem;
  margin-top:.7rem;
}
.tab{
  padding:.52rem 1rem;
  border:1px solid transparent;
}
.tab:hover{background:rgba(255,255,255,.06)}
.tab.on{
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}

.wrap{
  max-width:1120px;
  padding:1.4rem 1rem 4.5rem;
}
.panel{animation:ui-rise .22s ease}
@keyframes ui-rise{
  from{opacity:0;transform:translateY(4px)}
  to{opacity:1;transform:none}
}

.sheet{
  border:1px solid rgba(201,214,229,.65);
  border-radius:var(--ui-radius);
  box-shadow:var(--ui-shadow);
  padding:1.15rem;
}
.sheet:hover{box-shadow:var(--ui-shadow-hover)}
.sheet-head{
  min-height:38px;
  gap:.65rem;
}
.sheet-head h2{font-size:1.08rem;letter-spacing:-.015em}
.sheet-head .sub{font-size:.8rem}

.btn{
  min-height:40px;
  padding:.5rem .9rem;
  border-radius:var(--ui-radius-sm);
  box-shadow:0 1px 2px rgba(22,35,58,.08);
}
.btn:hover{
  filter:none;
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(22,35,58,.12);
}
.btn:active{transform:translateY(0)}
.btn.ghost{
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  box-shadow:0 1px 2px rgba(22,35,58,.04);
}
.btn.ghost:hover{background:#F7F9FC;border-color:var(--ui-border-strong)}
.btn.sm{
  min-height:36px;
  padding:.3rem .65rem;
}

.inp{
  min-height:42px;
  padding:.58rem .8rem;
  background:var(--ui-surface-2);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius-sm);
  transition:border-color .16s,box-shadow .16s,background .16s;
}
.inp:hover{border-color:var(--ui-border-strong)}
.inp:focus{
  border-color:#7C96B5;
  box-shadow:0 0 0 3px rgba(46,107,184,.10);
}

.pill{
  min-height:27px;
  padding:.2rem .62rem;
  border:1px solid transparent;
}
.pill.quiet{
  border-color:var(--ui-border);
  background:#F4F7FB;
}

.cards{
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:1rem;
}
.card{
  min-height:170px;
  padding:1.05rem;
  border:1px solid var(--ui-border);
  border-top:3px solid var(--c,var(--ink));
  box-shadow:var(--ui-shadow);
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:var(--ui-shadow-hover);
}
.card .ic{
  width:44px;height:44px;
  display:flex;align-items:center;justify-content:center;
  border-radius:13px;
  background:#F3F6FA;
}

.ruled{
  border:1px solid var(--ui-border);
  box-shadow:0 2px 8px rgba(22,35,58,.04);
}

.gt{
  border:1px solid var(--ui-border);
  border-radius:14px;
  box-shadow:var(--ui-shadow);
}
.gt th{
  padding:.65rem .7rem;
  font-size:.78rem;
}
.gt td{padding:.62rem .7rem}
.gt tbody tr{transition:background .12s}
.gt tr:hover td{background:#F7F9FC}
.gt td.nm{
  font-size:.9rem;
}

.empty{
  background:var(--ui-surface);
  border:1px dashed var(--ui-border-strong);
  border-radius:var(--ui-radius);
  box-shadow:0 2px 8px rgba(22,35,58,.03);
}

#toast{
  bottom:calc(1.25rem + env(safe-area-inset-bottom,0px));
  padding:.68rem 1.05rem;
  box-shadow:0 10px 34px rgba(22,35,58,.24);
  border:1px solid rgba(255,255,255,.08);
}

.veil{
  background:rgba(13,24,42,.60);
  backdrop-filter:blur(6px);
}
.modal{
  width:min(600px,100%);
  border:1px solid rgba(201,214,229,.85);
  box-shadow:0 28px 80px rgba(22,35,58,.32);
}
.modal h2{font-size:1.12rem}

.rep-page{
  border:1px solid #D8E3E0;
  box-shadow:var(--ui-shadow);
}

#pub-warn>div,#backup-warn>div,#req-box>div,#dev-warn>div{
  border-radius:var(--ui-radius);
}

@media screen and (max-width:700px){
  .masthead{padding:.75rem .75rem .6rem}
  .wrap{padding:.85rem .65rem 3rem}
  .sheet{padding:.9rem;border-radius:14px}
  .sheet-head{align-items:flex-start}
  .sheet-head .spacer{display:none}
  .sheet-head .btn{margin-inline-start:auto}
  .row>.inp{min-width:0}
  .cards{grid-template-columns:1fr 1fr;gap:.65rem}
  .card{min-height:155px;padding:.85rem}
  .card h3{font-size:.9rem}
  .card p{font-size:.78rem}
  .gt{font-size:.78rem}
  .gt th,.gt td{padding:.55rem .5rem}
  .modal-foot{position:sticky;bottom:-1rem;padding-top:.75rem;background:var(--paper)}
}
@media screen and (max-width:460px){
  .brand{font-size:1rem}
  .brand .mark{width:31px;height:36px}
  .masthead .meta{font-size:.68rem}
  .cards{grid-template-columns:1fr}
  .card{min-height:135px}
  .sheet-head h2{font-size:1rem}
  .btn{font-size:.84rem}
}
@media(prefers-reduced-motion:reduce){
  .panel{animation:none}
  .btn:hover,.card:hover{transform:none}
}


@media screen and (max-width:700px){
  .tabs{
    display:flex;
    margin-top:.55rem;
    padding-bottom:0;
  }
  .tabs .tab{
    flex:1;
    text-align:center;
    font-size:.76rem;
    padding:.48rem .35rem;
  }
  .wrap{padding-bottom:2rem}
}
@media screen and (max-width:460px){
  .tabs{
    overflow-x:auto;
    justify-content:flex-start;
  }
  .tabs .tab{
    flex:0 0 auto;
    padding-inline:.7rem;
  }
}


/* ══════════════════════════════════════════════
   ميزات إضافية — Dashboard / ملف الطالب / تنبيهات
   محلية بالكامل ولا تغيّر Worker أو API.
   ══════════════════════════════════════════════ */
.feature-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin-bottom:1rem;
}
.stat-card{
  background:var(--ui-surface,#fff);border:1px solid var(--ui-border,#dce5f0);
  border-radius:16px;padding:1rem;box-shadow:var(--ui-shadow,0 4px 18px rgba(22,35,58,.06));
  min-height:108px;display:flex;flex-direction:column;justify-content:space-between;
}
.stat-card .stat-top{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.stat-card .stat-icon{
  width:38px;height:38px;border-radius:11px;background:#F2F5F9;
  display:flex;align-items:center;justify-content:center;font-size:1.15rem;
}
.stat-card .stat-label{font-size:.76rem;color:var(--ink-soft)}
.stat-card .stat-value{font-size:1.45rem;font-weight:800;letter-spacing:-.02em}
.stat-card .stat-note{font-size:.7rem;color:var(--ink-soft)}
.feature-cols{display:grid;grid-template-columns:1.25fr 1fr;gap:1rem}
.feature-list{display:flex;flex-direction:column;gap:.5rem}
.feature-item{
  display:flex;align-items:center;gap:.65rem;padding:.65rem .7rem;
  border:1px solid var(--ui-border,#dce5f0);border-radius:12px;background:#fff;
}
.feature-item .fi-main{flex:1;min-width:0}
.feature-item .fi-title{font-weight:700;font-size:.86rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feature-item .fi-sub{font-size:.72rem;color:var(--ink-soft)}
.feature-item .fi-icon{width:34px;height:34px;border-radius:10px;background:#F4F7FB;display:flex;align-items:center;justify-content:center}
.progress-track{height:9px;background:#EDF2F7;border-radius:999px;overflow:hidden}
.progress-track i{display:block;height:100%;border-radius:999px;background:var(--tick)}
.profile-head{
  display:flex;align-items:center;gap:.8rem;padding:.8rem;
  background:#F7F9FC;border:1px solid var(--ui-border);border-radius:14px;margin-bottom:.8rem;
}
.avatar{
  width:52px;height:52px;border-radius:50%;background:var(--ink);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.15rem;flex:none;
}
.profile-head .ph-main{flex:1;min-width:0}
.profile-head h3{font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;margin:.8rem 0}
.mini-stat{
  border:1px solid var(--ui-border);border-radius:11px;padding:.55rem;text-align:center;background:#fff;
}
.mini-stat b{display:block;font-size:1rem}
.mini-stat span{font-size:.68rem;color:var(--ink-soft)}
.alert-list{display:flex;flex-direction:column;gap:.5rem}
.alert{
  display:flex;align-items:flex-start;gap:.6rem;padding:.7rem;
  border-radius:12px;border:1px solid var(--ui-border);background:#fff;
}
.alert.warn{background:rgba(200,138,46,.07);border-color:rgba(200,138,46,.28)}
.alert.danger{background:rgba(214,69,91,.06);border-color:rgba(214,69,91,.25)}
.alert.good{background:rgba(27,156,107,.06);border-color:rgba(27,156,107,.25)}
.alert .a-icon{font-size:1.05rem}
.alert .a-body{flex:1;font-size:.8rem}
.alert .a-body b{display:block;margin-bottom:.08rem}
.goal-card{
  border:1px solid var(--ui-border);border-radius:14px;padding:.85rem;background:#fff;
}
.goal-row{display:flex;align-items:center;gap:.6rem}
.goal-row .goal-info{flex:1}
.goal-row .goal-info b{display:block;font-size:.88rem}
.goal-row .goal-info span{font-size:.72rem;color:var(--ink-soft)}
.badge-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem}
.badge{
  border:1px solid var(--ui-border);border-radius:13px;padding:.75rem;text-align:center;
  background:#fff;opacity:.42;filter:grayscale(1);
}
.badge.unlocked{opacity:1;filter:none;background:#FFFCF4;border-color:#E7D9B7}
.badge .bi{font-size:1.55rem;display:block;margin-bottom:.2rem}
.badge b{display:block;font-size:.78rem}
.badge span{display:block;font-size:.65rem;color:var(--ink-soft);margin-top:.1rem}
.dashboard-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.section-title{display:flex;align-items:center;gap:.5rem;margin-bottom:.65rem}
.section-title h3{font-size:.95rem}
.section-title span{font-size:.72rem;color:var(--ink-soft)}
.kpi-good{color:var(--tick)}
.kpi-warn{color:var(--amber)}
.kpi-bad{color:var(--pen)}
.student-row-click{cursor:pointer}
.student-row-click:hover td{background:#F2F6FA!important}
.search-big{
  display:flex;gap:.5rem;align-items:center;margin-bottom:.8rem;
}
.search-big .inp{flex:1}
.feature-empty{
  text-align:center;padding:1.2rem;color:var(--ink-soft);
  border:1px dashed var(--ui-border-strong);border-radius:13px;background:#FBFCFE;
}
@media screen and (max-width:850px){
  .feature-grid{grid-template-columns:repeat(2,1fr)}
  .feature-cols{grid-template-columns:1fr}
}
@media screen and (max-width:520px){
  .feature-grid{grid-template-columns:1fr 1fr;gap:.55rem}
  .stat-card{min-height:100px;padding:.75rem}
  .stat-card .stat-value{font-size:1.25rem}
  .badge-grid{grid-template-columns:1fr 1fr}
  .mini-grid{grid-template-columns:1fr 1fr 1fr}
}


/* ═══ تنظيم التبويبات ═══ */
.report-topbar{display:flex;justify-content:flex-start;margin-bottom:.65rem}
.report-switch{
  display:inline-flex;gap:.2rem;padding:.22rem;
  background:#EFF3F8;border:1px solid var(--ui-border,#DCE5F0);border-radius:999px;
}
.report-switch-btn{
  min-height:36px;padding:.38rem .85rem;border:0;border-radius:999px;
  background:transparent;color:var(--ink-soft);font:inherit;font-size:.8rem;font-weight:700;
  cursor:pointer;transition:.16s;
}
.report-switch-btn:hover{background:rgba(255,255,255,.7);color:var(--ink)}
.report-switch-btn.on{background:var(--ink);color:var(--paper);box-shadow:0 2px 7px rgba(22,35,58,.12)}
.report-view-hidden{display:none!important}
@media screen and (max-width:560px){
  .report-topbar{justify-content:stretch}
  .report-switch{width:100%}
  .report-switch-btn{flex:1;padding-inline:.45rem}
}





#toast{z-index:9999 !important;position:fixed !important;}

.report-mode-toggle{
  display:inline-flex;
  align-items:center;
  gap:.2rem;
  padding:.2rem;
  background:#EFF3F8;
  border:1px solid var(--ui-border,#DCE5F0);
  border-radius:999px;
}
.report-mode-toggle .an-mode{
  min-height:34px;
  padding:.32rem .72rem;
  border-radius:999px;
  font-size:.78rem;
}
@media screen and (max-width:560px){
  .report-mode-toggle .an-mode{
    min-height:32px;
    padding-inline:.6rem;
  }
}


/* ══ رسائل الطلاب: مصمَّمة للإبهام على شاشة الجوال ══
   الاختيارات القليلة الثابتة شرائح لا قوائم منسدلة — لمسة واحدة بدل ثلاث،
   والشريحة تحمل الأيقونة نفسها التي سيراها الطالب. عناصر <select> الأصلية
   باقية مخفية، فكل معالجات الصفحة تعمل كما هي. */
.msg-hidden-control{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;clip:rect(0 0 0 0)}
/* التفاف لا تمرير أفقي: كل الخيارات مرئية دفعة واحدة، فلا يختفي خيار خلف الحافة */
.msg-chips{display:flex;flex-wrap:wrap;gap:.4rem}
.msg-chip{
  min-height:44px;display:inline-flex;align-items:center;gap:.35rem;
  padding:.5rem .8rem;border-radius:999px;border:1.5px solid var(--rule);
  background:var(--paper-2);color:var(--ink-soft);font-size:.87rem;font-weight:600;
  white-space:nowrap;transition:background .12s,border-color .12s,color .12s;
}
.msg-chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper-2)}
.msg-chip:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.msg-chip[data-pri="important"][aria-pressed="true"]{background:#C88A2E;border-color:#C88A2E;color:#241800}
.msg-chip[data-pri="urgent"][aria-pressed="true"]{background:var(--pen);border-color:var(--pen);color:#fff}

.msg-count{font-size:.74rem;color:var(--ink-soft);font-variant-numeric:tabular-nums}
.msg-adv{border:1.5px solid var(--rule);border-radius:var(--r);background:var(--paper-2);margin-top:.7rem}
.msg-adv>summary{padding:.7rem .85rem;font-size:.86rem;font-weight:600;cursor:pointer;list-style:none;min-height:44px;display:flex;align-items:center}
.msg-adv>summary::-webkit-details-marker{display:none}
.msg-adv>summary::after{content:'⌄';margin-inline-start:auto;font-size:1.1rem;color:var(--ink-soft)}
.msg-adv[open]>summary::after{content:'⌃'}
.msg-adv-body{padding:0 .85rem .85rem}

/* المعاينة: نسخة طبق الأصل مما سيراه الطالب في مساحته */
.msg-preview{margin-top:.9rem;border:1.5px dashed var(--rule);border-radius:var(--r);padding:.75rem .8rem;background:var(--paper-2)}
.msg-preview>h3{font-size:.78rem;color:var(--ink-soft);font-weight:600;margin-bottom:.5rem}
.msg-preview .space-notice{display:flex;gap:.55rem;padding:.58rem 0;border-bottom:0}
.msg-preview .space-notice .ni{width:30px;height:30px;border-radius:9px;background:#EFF3F8;display:grid;place-items:center;flex:none}
.msg-preview .space-notice b{display:block;font-size:.84rem;line-height:1.45}
.msg-preview .space-notice p{margin:.1rem 0 0;color:var(--ink-soft);font-size:.76rem;line-height:1.55;white-space:pre-wrap}
.msg-preview .space-notice.important{padding:.72rem .7rem;border:1.5px solid #D6A11A;border-radius:12px;background:#FFF9E8}
.msg-preview .space-notice.important .ni{background:#FFE9A8}
.msg-preview .space-notice.urgent{padding:.75rem .7rem;border:1.5px solid #C43D4D;border-radius:12px;background:#FFF1F3}
.msg-preview .space-notice.urgent .ni{background:#FFD9DF}
.msg-preview .priority-badge{display:inline-block;margin-inline-start:.35rem;padding:.12rem .38rem;border-radius:999px;font-size:.64rem;font-weight:900;vertical-align:middle}
.msg-preview .important .priority-badge{background:#F3D46C;color:#634900}
.msg-preview .urgent .priority-badge{background:#F3A5AF;color:#7E1625}
.msg-preview .exam-date-line{color:var(--ink);font-size:.75rem}

/* شريط الإرسال: يلتصق بأسفل الشاشة فلا يضيع الزر في نهاية نموذج طويل */
.msg-sendbar{
  position:sticky;bottom:0;z-index:5;margin:.9rem -.9rem -.9rem;
  padding:.7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
  background:linear-gradient(to top,var(--paper-2) 72%,rgba(247,250,253,0));
  display:flex;align-items:center;gap:.7rem;
}
.msg-sendbar .who{font-size:.78rem;color:var(--ink-soft);line-height:1.4;min-width:0}
.msg-sendbar .btn{width:auto;min-width:132px;margin-inline-start:auto;flex:none;min-height:48px}
@media screen and (max-width:700px){
  .msg-sendbar{flex-direction:column;align-items:stretch;gap:.5rem}
  .msg-sendbar .btn{width:100%;margin:0}
  .msg-sendbar .who{text-align:center}
}


.exam-print-actions{display:flex;align-items:center;gap:.5rem;margin-inline-start:auto;flex-wrap:wrap}
.exam-print-actions .btn{white-space:nowrap}
@media screen and (max-width:700px){
  .exam-print-actions{width:100%;margin-inline-start:0}
  .exam-print-actions .btn{flex:1;min-width:0}
}

/* ── <style id=organized-nav-fix> ── */

.tabs{max-width:1120px;display:flex;gap:.35rem}
.tabs .tab{flex:1;text-align:center}
.mobile-nav{display:none}
/* 📱 الشريط السفلي كان display:none بلا استثناء — أي أنه لم يظهر قط.
   نُظهره في الجوال بتصميم بوابة المعلم نفسه: أيقونات خطّية ونصّ تحتها. */
@media screen and (max-width:700px){
  .tabs{display:none}
  .mobile-nav{
    display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;
    position:fixed;inset-inline:0;bottom:0;z-index:90;
    height:calc(58px + env(safe-area-inset-bottom,0px));
    padding:0 6px env(safe-area-inset-bottom,0px);
    background:#16233A;border-top:1px solid rgba(255,255,255,.10);
  }
  .mobile-nav button{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    height:58px;min-width:0;border:0;border-radius:12px;padding:0;
  }
  .mobile-nav button svg{width:22px;height:22px;flex:0 0 22px}
  .mobile-nav button b{font-size:.6rem;font-weight:700;white-space:nowrap}
  .mobile-nav button.on,.mobile-nav button.on:active{
    background:transparent !important;color:#7FD8C4 !important;
    -webkit-text-fill-color:#7FD8C4 !important;
  }
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
  #undo-bar{bottom:calc(70px + env(safe-area-inset-bottom,0px))}
}
@media print{ .mobile-nav{display:none!important} }

/* ── <style id=grades-pro-style> ── */

.grades-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:.65rem;margin-bottom:.8rem}
.grades-kpi{background:#fff;border:1px solid var(--ui-border,#DCE5F0);border-radius:13px;padding:.7rem .75rem;box-shadow:0 2px 8px rgba(22,35,58,.04)}
.grades-kpi span{display:block;font-size:.7rem;color:var(--ink-soft)}
.grades-kpi b{display:block;font-size:1.2rem;margin-top:.12rem}
.grades-kpi small{font-size:.65rem;color:var(--ink-soft)}
.grades-tools{display:flex;align-items:center;gap:.5rem;justify-content:space-between;flex-wrap:wrap;margin-bottom:.7rem}
.grades-tools select{width:auto;min-width:145px}
.grades-selection{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}
.grades-selection span{font-size:.75rem;color:var(--ink-soft);font-weight:700}
.grades-table-wrap{overflow:auto;-webkit-overflow-scrolling:touch;border-radius:14px}
.grades-pro{min-width:max-content}
.grades-pro .g-check{width:36px;min-width:36px;position:sticky;inset-inline-start:0;z-index:5;background:var(--ink)!important}
.grades-pro tbody .g-check{background:#fff!important}
.g-student-head{position:sticky!important;inset-inline-start:36px;z-index:4!important;min-width:190px}
.g-student{position:sticky;inset-inline-start:36px;z-index:3;background:#fff!important;text-align:start!important;cursor:pointer;box-shadow:-3px 0 6px rgba(22,35,58,.05)}
.g-student b,.g-student small{display:block}
.g-student small{font-size:.67rem;color:var(--ink-soft);font-weight:400}
.g-rank{color:var(--ink-soft);font-size:.72rem}
.gcell{position:relative;cursor:pointer;min-width:72px}
.gcell b{font-size:.9rem}
.gcell small{font-size:.65rem;color:var(--ink-soft)}
.gcell em{position:absolute;top:3px;inset-inline-start:4px;font-style:normal;font-size:.65rem}
.gcell.g-good{background:rgba(27,156,107,.055)}
.gcell.g-warn{background:rgba(200,138,46,.065)}
.gcell.g-bad{background:rgba(214,69,91,.055)}
.gcell.missing{background:rgba(214,69,91,.035);color:#999}
.gcell.manual{box-shadow:inset 0 0 0 2px rgba(200,138,46,.22)}
.g-total,.g-pct,.g-done{background:#F7F9FC}
.g-total small,.g-pct small,.g-done small{display:block;font-size:.62rem;color:var(--ink-soft)}
.g-pct.good{color:var(--tick)}.g-pct.warn{color:var(--amber)}.g-pct.danger{color:var(--pen)}

.g-hw-head{max-width:130px;overflow:hidden;text-overflow:ellipsis}
.g-hw-head small{display:block;font-size:.6rem;color:#9FB2CC;font-weight:400}
.grades-pro tfoot td{background:#EFF3F8;font-weight:700}
.g-foot-label{text-align:start!important}
.g-foot-cell small{display:block;font-size:.62rem;color:var(--ink-soft);font-weight:400}
.grades-legend{display:flex;justify-content:center;gap:.9rem;flex-wrap:wrap;padding:.55rem;font-size:.72rem;color:var(--ink-soft)}
.grades-legend i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-inline-end:.2rem}
.lg-good{background:rgba(27,156,107,.55)}.lg-warn{background:rgba(200,138,46,.6)}.lg-bad{background:rgba(214,69,91,.55)}
@media screen and (max-width:800px){
  .grades-kpis{grid-template-columns:repeat(2,1fr)}
  .grades-kpi:last-child{grid-column:span 2}
  .grades-selection{width:100%}
  .grades-selection .btn{flex:1}
}

/* ── <style id=student-report-restore-style> ── */

.g-student{cursor:pointer!important}
.g-student:hover b{text-decoration:underline;text-underline-offset:3px}
.grades-report-hint{display:block;margin:-.25rem 0 .65rem;color:var(--ink-soft);font-size:.73rem;font-weight:600}

/* ── <style id=teacher-clean-ui> ── */

.student-help{font-size:.7rem;color:var(--ink-soft)}
.quick-actions{display:grid;gap:.55rem}
.quick-actions .btn{text-align:start;justify-content:flex-start}
.grades-tools{justify-content:flex-start}
.grades-tools>.inp{max-width:190px}
@media screen and (max-width:700px){
  .sheet-head{gap:.45rem}
  .sheet-head .spacer{display:none}
  .student-help{display:none}
  .grades-tools>.inp{max-width:none;width:100%}
}

/* ── <style id=students-center-style> ── */

:root{
  --ui-accent:#3B5F86;
  --ui-accent-soft:#EEF3F8;
  --ui-green:#2F8A68;
  --ui-amber:#B37A2B;
  --ui-red:#B94A5A;
}
.students-center{
  display:grid;grid-template-columns:300px minmax(0,1fr);gap:1rem;min-height:560px;
}
.students-list-pane{
  border:1px solid var(--ui-border,#DCE5F0);border-radius:16px;background:#F8FAFC;
  padding:.7rem;min-width:0;
}
.students-search{margin-bottom:.55rem}
.students-filters{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.students-filters .inp{width:100%;min-width:0}
.students-list-meta{font-size:.7rem;color:var(--ink-soft);padding:.65rem .2rem .35rem}
.students-list{display:flex;flex-direction:column;gap:.3rem;max-height:600px;overflow:auto}
.student-list-item{
  width:100%;border:1px solid transparent;background:transparent;border-radius:12px;
  padding:.55rem;display:flex;align-items:center;gap:.55rem;text-align:start;cursor:pointer;
  color:inherit;font:inherit;min-width:0;
}
.student-list-item:hover{background:#EEF3F8}
.student-list-item.selected{background:#E8EEF5;border-color:#D4DFEB}
.student-list-avatar,.student-hero-avatar{
  width:38px;height:38px;border-radius:50%;background:#E5EBF2;color:#334C66;
  display:flex;align-items:center;justify-content:center;font-weight:800;flex:none;
}
.student-list-main{flex:1;min-width:0}
.student-list-main small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.student-list-main b{display:block;font-size:.82rem;line-height:1.35;
  white-space:normal;overflow:hidden;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.student-list-main small{font-size:.65rem;color:var(--ink-soft);margin-top:.1rem}
.student-list-score{font-size:.72rem;font-weight:800}
.student-list-score.good{color:var(--ui-green)}
.student-list-score.ok{color:var(--ui-accent)}
.student-list-score.warn{color:var(--ui-amber)}
.student-list-score.bad{color:var(--ui-red)}
.student-detail-pane{
  min-width:0;border:1px solid var(--ui-border,#DCE5F0);border-radius:16px;background:#fff;padding:1rem;
}
.student-center-empty{min-height:500px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--ink-soft)}
.student-center-empty-icon{font-size:2.2rem;margin-bottom:.5rem}
.student-center-empty h3{color:var(--ink);margin-bottom:.25rem}
.student-center-empty p{max-width:380px;font-size:.8rem;line-height:1.7}
.student-profile-hero{display:flex;align-items:center;gap:.8rem;padding:.2rem 0 .9rem;border-bottom:1px solid var(--ui-border)}
.student-hero-avatar{width:58px;height:58px;font-size:1.1rem;background:#334C66;color:#fff}
.student-hero-main{flex:1;min-width:0}
.student-hero-main h2{font-size:1.15rem;margin:0 0 .15rem;line-height:1.35;word-break:break-word}
.student-hero-main span{font-size:.72rem;color:var(--ink-soft)}
.student-hero-actions{display:flex;gap:.35rem;flex-wrap:wrap}
.student-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;margin:.5rem 0}
.student-kpis>div{padding:.65rem .7rem;background:#F7F9FB;border-radius:12px}
.student-kpis span{display:block;font-size:.67rem;color:var(--ink-soft)}
.student-kpis b{display:block;font-size:1rem;margin-top:.12rem}
.student-center-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(180px,.5fr);gap:1rem}
.student-section{min-width:0}
/* قسم مستقل بفاصل واضح — لا تداخل */
.student-block{min-width:0;padding:.7rem 0 0;margin-top:.7rem;border-top:1px solid var(--ui-border,#E2E8F0)}
.student-block:first-of-type{border-top:none;margin-top:.2rem;padding-top:.2rem}
.student-section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:.35rem}
.student-section-title h3{font-size:.9rem}
.student-section-title span{font-size:.68rem;color:var(--ink-soft)}
.student-activity-list{display:flex;flex-direction:column;gap:.3rem;max-height:none;overflow:visible}
.student-activity{
  position:relative;padding:.4rem .55rem;border:1px solid #E2E8F0;border-radius:10px;
  display:grid;grid-template-columns:minmax(0,1fr) 76px auto auto;
  align-items:center;gap:.5rem;background:#fff;
}
.student-activity .sa-main{min-width:0}
.sa-main b,.sa-main small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sa-main b{font-size:.82rem}
.sa-main small{font-size:.66rem;color:var(--ink-soft);margin-top:.05rem}
.sa-status{font-size:.8rem;font-weight:800;white-space:nowrap;min-width:56px;text-align:end}
.sa-retry{border:1px solid #E2E8F0;background:#fff;cursor:pointer;font-size:.72rem;
  padding:.24rem .5rem;border-radius:8px;line-height:1.4;white-space:nowrap;color:var(--ink-soft)}
.sa-retry:hover{background:#EEF3F8;border-color:#C9D6E4;color:var(--ink)}
.sa-retry.sent{border-color:#BFDACE;background:#F2FAF6;color:#18724F;cursor:default;font-weight:900}
.sa-retry.sent:hover{background:#F2FAF6;border-color:#BFDACE;color:#18724F}
.student-activity.good .sa-status{color:var(--ui-green)}
.student-activity.warn .sa-status{color:var(--ui-amber)}
.student-activity.bad .sa-status{color:var(--ui-red)}
.student-activity.missing .sa-status{color:#8A96A5}
.student-activity.late .sa-status{color:var(--ui-amber)}
.sa-bar{height:7px;background:#EDF1F5;border-radius:999px;overflow:hidden}
.sa-bar i{display:block;height:100%;border-radius:999px}
.student-side{display:flex;flex-direction:column;gap:.8rem}
.attention-box{padding:.7rem;background:#FBF5E9;border:1px solid #E9D9B8;border-radius:11px;font-size:.75rem;line-height:1.8;color:#725523}
.attention-box.good{background:#F0F7F4;border-color:#CFE5DB;color:#2D7058}
.student-badges{display:flex;flex-wrap:wrap;gap:.3rem}
.student-badges>div{display:flex;align-items:center;gap:.25rem;
  padding:.22rem .5rem !important;border-radius:99px !important;
  background:#F5F8FB;border:1px solid #E2E8F0;font-size:.74rem;white-space:nowrap}
.student-badges>div span{font-size:.95rem !important;line-height:1}
.student-badges>div b{font-weight:700;font-size:.72rem}
.student-badges>div{background:#FAF8F2;border-color:#E9E1CE}
.muted{font-size:.7rem;color:var(--ink-soft)}
@supports not (height: 100dvh){
  .reading-ai-card{max-height:calc(100vh - 24px);}
}
@media screen and (max-width:650px){
  .reading-ai-backdrop{
    align-items:flex-start;
    overflow-y:auto;
  }
  .reading-ai-card{
    margin:auto 0;
  }
}
@media screen and (max-width:900px){
  .students-center{grid-template-columns:1fr}
  .students-list{max-height:300px}
  .student-center-grid{grid-template-columns:1fr}
}
@media screen and (max-width:560px){
  .students-center{gap:.6rem}
  .student-detail-pane{padding:.7rem}
  .student-kpis{grid-template-columns:repeat(2,1fr)}
  .student-profile-hero{align-items:flex-start;flex-wrap:wrap}
  .student-hero-actions{width:100%}
  .student-hero-actions .btn{flex:1}
  .students-filters{grid-template-columns:1fr}
}

/* منتقي الطلاب للرسائل */
.msg-student-picker{border:1px solid var(--ui-border,#D9E2EA);border-radius:12px;padding:.55rem;background:var(--surface,#fff)}
.msg-student-search-row{display:flex;gap:.4rem;align-items:center}
.msg-student-search-row .inp{flex:1;min-width:0}
.msg-student-selection-bar{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .2rem .4rem;font-size:.74rem;color:var(--ink-soft)}
.msg-student-selection-bar span{font-weight:800;color:var(--ink)}
.msg-student-list{display:flex;flex-direction:column;gap:.28rem;max-height:280px;overflow:auto;padding:.1rem}
.msg-student-item{display:flex;align-items:center;gap:.55rem;width:100%;padding:.55rem .65rem;border:1px solid transparent;border-radius:10px;background:var(--surface-2,#F7F9FB);cursor:pointer;text-align:start;transition:.15s}
.msg-student-item:hover{background:#EEF3F8;border-color:#D8E2EC}
.msg-student-item.selected{background:#E8F3EF;border-color:#B8DCCF}
.msg-student-check{width:22px;height:22px;flex:0 0 22px;border:1.5px solid #B7C4D0;border-radius:6px;background:#fff;display:grid;place-items:center;font-size:.78rem;font-weight:900;color:#fff}
.msg-student-item.selected .msg-student-check{background:var(--ui-green,#1B9C6B);border-color:var(--ui-green,#1B9C6B)}
.msg-student-info{min-width:0;flex:1}
.msg-student-info b{display:block;font-size:.8rem;line-height:1.35;word-break:break-word}
.msg-student-info small{display:block;color:var(--ink-soft);font-size:.66rem;margin-top:.08rem}
.msg-student-empty{padding:1rem;text-align:center;color:var(--ink-soft);font-size:.78rem}
@media screen and (max-width:560px){.msg-student-search-row{flex-direction:column;align-items:stretch}.msg-student-search-row .btn{width:100%}.msg-student-list{max-height:340px}}

/* ── <style id=clean-student-actions> ── */

.student-hero-actions{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.student-hero-actions .btn{min-height:36px}
.student-hero-actions .danger{border-color:#E1AAB2;color:#A33E4D;background:#FFF8F9}
@media screen and (max-width:560px){
  .student-hero-actions{width:100%}
  .student-hero-actions .btn{flex:1}
}

/* ── <style id=nav-color-fix> ── */

/* ── ألوان التبويبات النهائية ── */
.tabs .tab{
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
  background:transparent !important;
  color:#C9D6E5 !important;
  border:1px solid transparent;
  text-shadow:none;
}

.tabs .tab:hover{
  background:rgba(255,255,255,.08) !important;
  color:#FFFFFF !important;
}

.tabs .tab.on,
.tabs .tab.on:hover{
  background:#EEF2F7 !important;
  color:#16233A !important;
}

.tabs .tab:active,
.tabs .tab.on:active{
  background:#DCE4EE !important;
  color:#16233A !important;
  -webkit-text-fill-color:#16233A !important;
  opacity:1 !important;
}

.tabs .tab:focus,
.tabs .tab:focus-visible{
  outline:none;
}

.mobile-nav button{
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
  background:transparent !important;
  color:#C9D6E5 !important;
  text-shadow:none;
}

.mobile-nav button:active{
  background:rgba(255,255,255,.08) !important;
  color:#FFFFFF !important;
}

.mobile-nav button.on,
.mobile-nav button.on:active{
  background:#EEF2F7 !important;
  color:#16233A !important;
  -webkit-text-fill-color:#16233A !important;
  opacity:1 !important;
}

/* ── <style id=hw-icon-actions> ── */

.hw-icon-btn{
  width:34px;
  min-width:34px;
  height:34px;
  padding:0 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
  line-height:1;
  border-radius:9px;
  flex:0 0 auto;
}
.hw-icon-btn:hover{background:#F4F7FB}
.hw-icon-btn:active{transform:translateY(1px)}
.hw-icon-btn.danger-icon{color:var(--pen)}
@media screen and (max-width:700px){
  .hw-icon-btn{
    width:38px;
    min-width:38px;
    height:38px;
    font-size:1.05rem;
  }
}

/* ═══════════ تحسين تنسيق صفحة الطلاب فقط ═══════════ */
#studentsPage .students-layout{
  gap:18px !important;
  align-items:start !important;
}
#studentsPage .students-list,
#studentsPage .student-profile{
  border-radius:18px !important;
}
#studentsPage .students-list{
  padding:14px !important;
}
#studentsPage .students-list .student-item{
  min-height:64px !important;
  padding:10px 12px !important;
  border-radius:13px !important;
  margin-bottom:7px !important;
}
#studentsPage .students-list .student-item .name{
  font-weight:800 !important;
  font-size:.91rem !important;
  line-height:1.45 !important;
}
#studentsPage .students-list .student-item .meta{
  font-size:.74rem !important;
  margin-top:3px !important;
}
#studentsPage .student-profile{
  padding:18px !important;
}
#studentsPage .student-profile .profile-head{
  gap:14px !important;
  padding-bottom:14px !important;
  margin-bottom:14px !important;
}
#studentsPage .student-profile .profile-name{
  font-size:1.15rem !important;
  line-height:1.5 !important;
  font-weight:900 !important;
}
#studentsPage .student-profile .profile-actions{
  gap:7px !important;
}
#studentsPage .student-profile .stats-grid{
  gap:9px !important;
}
#studentsPage .student-profile .stat{
  min-height:74px !important;
  padding:10px !important;
  border-radius:13px !important;
}
#studentsPage .student-profile .stat .value{
  font-size:1.12rem !important;
  font-weight:900 !important;
}
#studentsPage .student-profile .section-title{
  margin:16px 0 8px !important;
}
#studentsPage .student-profile .activity-card{
  border-radius:13px !important;
  padding:12px 14px !important;
}
#studentsPage .student-profile .achievement{
  min-height:72px !important;
  border-radius:13px !important;
}
@media screen and (max-width: 900px){
  #studentsPage .students-layout{gap:12px !important;}
  #studentsPage .student-profile{padding:14px !important;}
}

/* تحسين عام آمن داخل صفحة الطلاب */
#studentsPage .card,
#studentsPage .panel{
  border-radius:16px !important;
}
#studentsPage .toolbar{
  gap:10px !important;
}
#studentsPage .search{
  border-radius:12px !important;
}


/* ═══════════ تنسيق صفحة الطلاب - النسخة الفعلية ═══════════ */
.students-center{
  grid-template-columns:minmax(360px,.62fr) minmax(0,1fr) !important;
  gap:.9rem !important;
  min-height:600px !important;
}

.students-list-pane{
  padding:.8rem !important;
  border-radius:18px !important;
  background:#F9FBFD !important;
}

.students-search{
  margin-bottom:.65rem !important;
}

.students-filters{
  gap:.5rem !important;
}

.students-list-meta{
  padding:.7rem .25rem .45rem !important;
  font-size:.72rem !important;
  font-weight:700 !important;
}

.students-list{
  gap:.4rem !important;
  max-height:610px !important;
  padding-right:1px !important;
}

.student-list-item{
  min-height:62px !important;
  padding:.65rem .7rem !important;
  gap:.65rem !important;
  border-radius:14px !important;
  border:1px solid transparent !important;
}

.student-list-item:hover{
  background:#F0F4F8 !important;
}

.student-list-item.selected{
  background:#E8EEF5 !important;
  border-color:#CCD9E6 !important;
  box-shadow:0 1px 0 rgba(30,50,70,.04) !important;
}

.student-list-avatar{
  width:42px !important;
  height:42px !important;
  font-size:.78rem !important;
}

.student-list-main b{
  font-size:.86rem !important;
  line-height:1.45 !important;
}

.student-list-main small{
  font-size:.68rem !important;
  margin-top:.18rem !important;
}

.student-list-score{
  min-width:38px !important;
  text-align:center !important;
  font-size:.78rem !important;
  font-weight:900 !important;
}

.student-detail-pane{
  padding:1.2rem !important;
  border-radius:18px !important;
  min-height:600px !important;
}

.student-profile-hero{
  gap:.8rem !important;
  padding:.1rem 0 .6rem !important;
  margin-bottom:0 !important;
}

.student-hero-avatar{
  width:62px !important;
  height:62px !important;
  font-size:1.15rem !important;
}

.student-hero-main h2{
  font-size:1.25rem !important;
  line-height:1.55 !important;
  margin-bottom:.18rem !important;
}

.student-hero-main span{
  font-size:.74rem !important;
}

.student-hero-actions{
  gap:.45rem !important;
}

.student-hero-actions .btn{
  min-height:36px !important;
  padding:.45rem .7rem !important;
}

.student-kpis{
  gap:.45rem !important;
  margin:.55rem 0 .6rem !important;
}

.student-kpis>div{
  min-height:60px !important;
  padding:.72rem .75rem !important;
  border-radius:14px !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
}

.student-kpis span{
  font-size:.69rem !important;
}

.student-kpis b{
  font-size:1.12rem !important;
  margin-top:.2rem !important;
}

.student-center-grid{
  gap:1.1rem !important;
}

.student-section-title{
  margin-bottom:.7rem !important;
}

.student-section-title h3{
  font-size:.94rem !important;
  font-weight:900 !important;
}

.student-section-title span{
  font-size:.7rem !important;
}

.student-activity-list{
  gap:.32rem !important;
  max-height:none !important;
}

.student-activity{
  padding:.4rem .6rem !important;
  border-radius:10px !important;
  gap:.5rem !important;
}

.sa-main b{
  font-size:.82rem !important;
}

.sa-main small{
  font-size:.65rem !important;
}

.sa-status{
  font-size:.75rem !important;
}

.sa-bar{
  height:6px !important;
}

.student-side{
  gap:.9rem !important;
}

.attention-box{
  padding:.78rem !important;
  border-radius:13px !important;
}

.student-badges{
  gap:.3rem !important;
}

.student-badges b{
  font-size:.68rem !important;
}

@media screen and (max-width:1100px){
  .students-center{
    grid-template-columns:300px minmax(0,1fr) !important;
  }
}

@media screen and (max-width:900px){
  .students-center{
    grid-template-columns:1fr !important;
    min-height:0 !important;
  }
  .students-list{
    max-height:360px !important;
  }
  .student-detail-pane{
    min-height:0 !important;
  }
}


/* 💌 طلبات رسائل الشكر */
.tp-sent{ background:#DCFCE7 !important; color:#166534 !important; border-color:#86EFAC !important; }
#req-badge{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  gap:.25rem;
  min-width:44px;
  min-height:32px;
  padding:.3rem .55rem !important;
  cursor:default;
}
#req-badge.hide{display:none !important;}


.nav-req-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:19px;
  height:19px;
  padding:0 5px;
  margin-inline-start:6px;
  border-radius:999px;
  background:#C88A2E;
  color:#fff;
  font-size:.68rem;
  font-weight:900;
  line-height:1;
  box-shadow:0 1px 5px rgba(0,0,0,.12);
}
.nav-req-badge.hide{display:none !important;}


.tabs .students-tab{
  position:relative !important;
}
.tabs .students-tab .nav-req-badge{
  margin-inline-start:7px;
  vertical-align:middle;
  background:#D6455B !important;
  color:#fff !important;
  box-shadow:0 1px 6px rgba(0,0,0,.22);
}


.tabs .students-tab .nav-req-badge{
  position:relative;
  display:inline-flex !important;
  flex:0 0 auto !important;
  align-items:center;
  justify-content:center;
  min-width:21px !important;
  height:21px !important;
  margin-inline-start:7px !important;
  border-radius:50% !important;
  background:#E24B5A !important;
  color:#fff !important;
  font-size:11px !important;
  font-weight:900 !important;
  line-height:21px !important;
  box-shadow:0 0 0 2px #16233A, 0 2px 7px rgba(0,0,0,.25) !important;
}


/* 💌 رسالة الشكر الجاهزة للنسخ */
.thanks-message{
  width:100%;
  min-height:118px;
  margin:.65rem 0;
  padding:.75rem .85rem;
  border:1px solid #D9E2EC;
  border-radius:12px;
  background:#F8FAFC;
  color:#243447;
  font:inherit;
  font-size:.82rem;
  line-height:1.8;
  direction:rtl;
  resize:vertical;
  box-sizing:border-box;
}
.req-row{
  padding:.75rem;
  border:1px solid #E2E8F0;
  border-radius:14px;
  background:#fff;
  margin-top:.55rem;
}
.req-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
}
.req-actions{
  display:flex;
  gap:.5rem;
  justify-content:flex-start;
}


/* 💌 رسالة شكر مكتملة باسم الطالب */
.thanks-preview{
  width:100%;
  box-sizing:border-box;
  margin:.65rem 0;
  padding:.8rem .9rem;
  border:1px solid #D9E2EC;
  border-radius:12px;
  background:#F8FAFC;
  color:#243447;
  font-size:.84rem;
  line-height:1.9;
  direction:rtl;
}
.thanks-message{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}


/* 💌 طلبات رسائل الشكر - عرض مختصر مناسب لعدة طلاب */
.thanks-requests-panel{
  margin-bottom:1rem !important;
}
.thanks-requests-note{
  margin:.35rem 0 .75rem !important;
}
.thanks-request-list{
  display:flex;
  flex-direction:column;
  gap:.45rem;
}
.thanks-request-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  padding:.62rem .7rem;
  border:1px solid #E1E7EE;
  border-radius:13px;
  background:#fff;
}
.thanks-request-person{
  display:flex;
  align-items:center;
  gap:.65rem;
  min-width:0;
}
.thanks-request-person b{
  display:block;
  font-size:.86rem;
  line-height:1.4;
}
.thanks-request-person small{
  display:block;
  margin-top:2px;
  font-size:.67rem;
  color:#718096;
}
.thanks-request-actions{
  display:flex;
  align-items:center;
  gap:.4rem;
  flex-shrink:0;
}
.thanks-request-actions .btn{
  white-space:nowrap;
}
.thanks-message-preview{
  margin-top:.65rem;
}
.thanks-preview-inner{
  padding:.8rem .9rem;
  border:1px solid #D9E2EC;
  border-radius:12px;
  background:#F8FAFC;
  color:#243447;
  font-size:.82rem;
  line-height:1.85;
  direction:rtl;
}
@media screen and (max-width:700px){
  .thanks-request-item{
    align-items:flex-start;
    flex-direction:column;
  }
  .thanks-request-actions{
    width:100%;
  }
  .thanks-request-actions .btn{
    flex:1;
  }
}


/* 💌 طلبات الشكر داخل «يحتاج انتباهك» */
#attention-requests{margin:.45rem 0 .7rem;}
.attention-req-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:19px;height:19px;padding:0 5px;margin-inline-start:5px;
  border-radius:999px;background:#D6455B;color:#fff;font-size:.66rem;
  font-weight:900;vertical-align:middle;
}
.attention-requests{
  border:1px solid rgba(200,138,46,.35);
  border-radius:13px;padding:.65rem;background:rgba(200,138,46,.045);
}
.attention-requests-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;}
.attention-requests-head b{font-size:.82rem;color:#8A641F;}
.attention-requests-list{display:flex;flex-direction:column;gap:.35rem;}
.attention-request{
  display:flex;align-items:center;justify-content:space-between;gap:.6rem;
  padding:.5rem .55rem;border-radius:10px;background:#fff;border:1px solid #E6EBEF;
}
.attention-request-person{display:flex;align-items:center;gap:.5rem;min-width:0;}
.attention-request-avatar{
  width:32px;height:32px;border-radius:50%;display:inline-flex;
  align-items:center;justify-content:center;background:#EEF3F7;
  font-size:.65rem;font-weight:900;flex:0 0 auto;
}
.attention-request-person b{
  display:block;font-size:.76rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.attention-request-person small{display:block;font-size:.61rem;color:#7A8793;margin-top:1px;}
.attention-request-actions{display:flex;gap:.3rem;flex:0 0 auto;}
.attention-request-actions .btn{min-width:34px;padding:.32rem .45rem !important;}
.thanks-message-preview{margin-top:.5rem;}
.thanks-preview-inner{
  padding:.65rem .75rem;border:1px solid #D9E2EC;border-radius:10px;
  background:#F8FAFC;color:#243447;font-size:.76rem;line-height:1.8;direction:rtl;
}
@media screen and (max-width:700px){
  .attention-request{align-items:flex-start;flex-direction:column;}
  .attention-request-actions{width:100%;}
  .attention-request-actions .btn{flex:1;}
}


/* آخر تسليم في كشف الدرجات */
.grades-pro .g-last{
  min-width:120px;
  white-space:nowrap;
}
.grades-pro .g-last b{
  display:block;
  font-size:.78rem;
}
.grades-pro .g-last small{
  display:block;
  font-size:.62rem;
  color:var(--ink-soft);
  margin-top:.08rem;
}


/* 🕐 آخر تسليم في كشف الدرجات */
.grades-pro .g-last,
.g-last{
  min-width:110px;
  white-space:nowrap;
}
.g-last b{
  display:block;
  font-size:.76rem;
}
.g-last small{
  display:block;
  margin-top:2px;
  font-size:.62rem;
  color:var(--ink-soft);
}


/* 🎯 فلتر النشاط في كشف الدرجات */
#g-hw{
  min-width:180px;
}
@media screen and (max-width:800px){
  #g-hw{min-width:150px;max-width:100%;}
}


/* 🎯 إضافة نقاط من ملف الطالب للمعلم */
.points-quick{
  display:flex;gap:.4rem;flex-wrap:wrap;margin:-.1rem 0 .75rem;
}
.points-quick .btn{min-width:58px;text-align:center}
.points-preview{
  padding:.65rem .75rem;border:1px solid #DCE5F0;border-radius:11px;
  background:#F7F9FC;font-size:.78rem;color:var(--ink-soft);
}
.points-preview b{color:var(--tick);font-size:.95rem;margin-inline-start:.25rem}


/* 🎁 فرصة إضافية للطالب */
.sa-retry{
  margin-inline-start:auto;
  flex:0 0 auto;
  font-size:.66rem !important;
  padding:.3rem .45rem !important;
}
.extra-attempt-info{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.5rem;
}
.extra-attempt-info>div{
  padding:.65rem .7rem;
  border:1px solid #DCE5F0;
  border-radius:10px;
  background:#F7F9FC;
}
.extra-attempt-info span{
  display:block;
  font-size:.65rem;
  color:var(--ink-soft);
}
.extra-attempt-info b{
  display:block;
  margin-top:2px;
  font-size:.85rem;
}
@media screen and (max-width:700px){
  .sa-retry{margin-inline-start:0;margin-top:.35rem;}
}


/* ── <style id=thanks-modal-fix> ── */

.thanks-modal-preview{
  width:100%;
  box-sizing:border-box;
  margin:.5rem 0;
  padding:1rem;
  border:1px solid #D9E2EC;
  border-radius:12px;
  background:#F8FAFC;
  color:#243447;
  font-size:.88rem;
  line-height:2;
  direction:rtl;
  white-space:pre-wrap;
  word-break:break-word;
}

/* ── <style id=dark-mode-complete-fix> ── */

:root[data-ui-theme="dark"]{
  --paper:#0D1522 !important;
  --paper-2:#182337 !important;
  --ink:#EEF2F7 !important;
  --ink-soft:#A9B8CC !important;
  --rule:#304158 !important;
  --ui-bg:#0D1522 !important;
  --ui-surface:#182337 !important;
  --ui-surface-2:#111A2A !important;
  --ui-border:#304158 !important;
  --ui-border-strong:#40536D !important;
  --ui-shadow:0 4px 18px rgba(0,0,0,.28) !important;
  --ui-shadow-hover:0 8px 26px rgba(0,0,0,.36) !important;
}

:root[data-ui-theme="dark"] body{
  background:var(--ui-bg) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .panel,
:root[data-ui-theme="dark"] .sheet,
:root[data-ui-theme="dark"] .card,
:root[data-ui-theme="dark"] .stat-card,
:root[data-ui-theme="dark"] .feature-item,
:root[data-ui-theme="dark"] .goal-card,
:root[data-ui-theme="dark"] .badge,
:root[data-ui-theme="dark"] .alert,
:root[data-ui-theme="dark"] .mini-stat,
:root[data-ui-theme="dark"] .profile-head,
:root[data-ui-theme="dark"] .student-detail-pane,
:root[data-ui-theme="dark"] .students-list-pane{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .students-list-pane{
  background:var(--ui-surface-2) !important;
}

:root[data-ui-theme="dark"] .student-list-item{
  background:transparent !important;
  color:var(--ink) !important;
  border-color:transparent !important;
}

:root[data-ui-theme="dark"] .student-list-item:hover{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .student-list-item.selected{
  background:#263750 !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .student-list-avatar{
  background:#263750 !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .student-hero-avatar{
  background:#334C66 !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] .student-kpis>div{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border:1px solid var(--rule) !important;
}

:root[data-ui-theme="dark"] .student-activity{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .student-badges>div{
  background:#202E43 !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .student-center-empty{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .student-center-empty h3,
:root[data-ui-theme="dark"] .student-hero-main h2,
:root[data-ui-theme="dark"] .student-list-main b,
:root[data-ui-theme="dark"] .student-section-title h3,
:root[data-ui-theme="dark"] .sheet-head h2,
:root[data-ui-theme="dark"] .card h3,
:root[data-ui-theme="dark"] .stat-card .stat-value,
:root[data-ui-theme="dark"] .stat-card .stat-label{
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .student-list-main small,
:root[data-ui-theme="dark"] .student-hero-main span,
:root[data-ui-theme="dark"] .student-section-title span,
:root[data-ui-theme="dark"] .student-help,
:root[data-ui-theme="dark"] .sheet-head .sub,
:root[data-ui-theme="dark"] .card p,
:root[data-ui-theme="dark"] .stat-card .stat-note{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .inp,
:root[data-ui-theme="dark"] select,
:root[data-ui-theme="dark"] textarea,
:root[data-ui-theme="dark"] input{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] input::placeholder,
:root[data-ui-theme="dark"] textarea::placeholder{
  color:#7F91A9 !important;
  opacity:1 !important;
}

:root[data-ui-theme="dark"] option{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .report-switch{
  background:var(--ui-surface-2) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .report-switch-btn{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .report-switch-btn:hover{
  background:#202E43 !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .report-switch-btn.on{
  background:var(--ink) !important;
  color:var(--ui-surface-2) !important;
}

:root[data-ui-theme="dark"] .pill.quiet{
  background:#202E43 !important;
  color:var(--ink-soft) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .pill.pts{
  background:rgba(27,156,107,.18) !important;
  color:#62D0A2 !important;
}

:root[data-ui-theme="dark"] .pill.due{
  background:rgba(214,69,91,.18) !important;
  color:#FF8798 !important;
}

:root[data-ui-theme="dark"] .gt{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .gt th{
  background:#0F1A2A !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .gt td{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .gt td.nm{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .gt tr:hover td{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .gt .dt{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .gt .tot{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .empty,
:root[data-ui-theme="dark"] .feature-empty{
  background:var(--ui-surface-2) !important;
  color:var(--ink-soft) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .feature-item .fi-icon,
:root[data-ui-theme="dark"] .stat-card .stat-icon,
:root[data-ui-theme="dark"] .card .ic{
  background:#202E43 !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .btn.ghost{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .btn.ghost:hover{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .btn.danger{
  background:#2A1820 !important;
  color:#FF9AA8 !important;
  border-color:#713746 !important;
}

:root[data-ui-theme="dark"] .modal{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .modal-foot{
  background:var(--ui-surface) !important;
}

:root[data-ui-theme="dark"] .thanks-preview-inner,
:root[data-ui-theme="dark"] .thanks-modal-preview{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .student-row-click:hover td{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] table:not(.gt){
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] table:not(.gt) th{
  background:#0F1A2A !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] table:not(.gt) td{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .sheet [style*="background:#fff"],
:root[data-ui-theme="dark"] .sheet [style*="background: #fff"],
:root[data-ui-theme="dark"] [style*="background:#fff"],
:root[data-ui-theme="dark"] [style*="background: #fff"],
:root[data-ui-theme="dark"] [style*="background:#FFFFFF"],
:root[data-ui-theme="dark"] [style*="background: #FFFFFF"]{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] [style*="color:#16233A"],
:root[data-ui-theme="dark"] [style*="color:#1B2A41"],
:root[data-ui-theme="dark"] [style*="color:#243447"]{
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .muted{
  color:var(--ink-soft) !important;
}

/* ── <style id=dark-mode-all-pages-fix> ── */

:root[data-ui-theme="dark"]{
  color-scheme:dark !important;
}

:root[data-ui-theme="dark"] .panel.on,
:root[data-ui-theme="dark"] #p-dashboard,
:root[data-ui-theme="dark"] #p-students,
:root[data-ui-theme="dark"] #p-hw,
:root[data-ui-theme="dark"] #p-grades,
:root[data-ui-theme="dark"] #p-analysis,
:root[data-ui-theme="dark"] #p-data{
  background:var(--ui-bg) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .sheet,
:root[data-ui-theme="dark"] .card,
:root[data-ui-theme="dark"] .stat-card,
:root[data-ui-theme="dark"] .feature-item,
:root[data-ui-theme="dark"] .goal-card,
:root[data-ui-theme="dark"] .mini-stat,
:root[data-ui-theme="dark"] .alert,
:root[data-ui-theme="dark"] .badge,
:root[data-ui-theme="dark"] .profile-head,
:root[data-ui-theme="dark"] .grades-kpi,
:root[data-ui-theme="dark"] .students-list-pane,
:root[data-ui-theme="dark"] .student-detail-pane,
:root[data-ui-theme="dark"] .student-activity,
:root[data-ui-theme="dark"] .student-badges>div,
:root[data-ui-theme="dark"] .attention-request,
:root[data-ui-theme="dark"] .req-row,
:root[data-ui-theme="dark"] .thanks-request-item{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .students-list-pane,
:root[data-ui-theme="dark"] .students-list{
  background:var(--ui-surface-2) !important;
}

:root[data-ui-theme="dark"] .student-list-item{
  background:transparent !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .student-list-item:hover,
:root[data-ui-theme="dark"] .student-row-click:hover td,
:root[data-ui-theme="dark"] .feature-item:hover{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .student-list-item.selected{
  background:#263750 !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .student-list-avatar,
:root[data-ui-theme="dark"] .student-hero-avatar{
  background:#334C66 !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] .student-kpis>div{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .student-activity{
  background:var(--ui-surface-2) !important;
}

:root[data-ui-theme="dark"] .student-activity .sa-bar{
  background:#263750 !important;
}

:root[data-ui-theme="dark"] .student-badges>div{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .attention-box{
  background:#302819 !important;
  border-color:#66502A !important;
  color:#E5C98E !important;
}

:root[data-ui-theme="dark"] .attention-box.good{
  background:#173027 !important;
  border-color:#285D4D !important;
  color:#8BD0B4 !important;
}

:root[data-ui-theme="dark"] .inp,
:root[data-ui-theme="dark"] select,
:root[data-ui-theme="dark"] textarea,
:root[data-ui-theme="dark"] input{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
  -webkit-text-fill-color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .inp:focus,
:root[data-ui-theme="dark"] select:focus,
:root[data-ui-theme="dark"] textarea:focus,
:root[data-ui-theme="dark"] input:focus{
  background:var(--ui-surface-2) !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] input::placeholder,
:root[data-ui-theme="dark"] textarea::placeholder{
  color:#7F91A9 !important;
  -webkit-text-fill-color:#7F91A9 !important;
}

:root[data-ui-theme="dark"] option{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .report-switch{
  background:var(--ui-surface-2) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .report-switch-btn{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .report-switch-btn:hover{
  background:#202E43 !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] .report-switch-btn.on{
  background:var(--ink) !important;
  color:var(--ui-surface-2) !important;
}

:root[data-ui-theme="dark"] .grades-pro,
:root[data-ui-theme="dark"] .grades-pro table,
:root[data-ui-theme="dark"] .grades-pro tbody,
:root[data-ui-theme="dark"] .grades-pro tfoot{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .grades-pro th,
:root[data-ui-theme="dark"] .grades-pro td,
:root[data-ui-theme="dark"] .g-student,
:root[data-ui-theme="dark"] .g-total,
:root[data-ui-theme="dark"] .g-pct,
:root[data-ui-theme="dark"] .g-done,
:root[data-ui-theme="dark"] .g-points{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .grades-pro th{
  background:#0F1A2A !important;
}

:root[data-ui-theme="dark"] .grades-pro tfoot td{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .gcell.g-good{
  background:rgba(27,156,107,.18) !important;
}

:root[data-ui-theme="dark"] .gcell.g-warn{
  background:rgba(200,138,46,.18) !important;
}

:root[data-ui-theme="dark"] .gcell.g-bad,
:root[data-ui-theme="dark"] .gcell.missing{
  background:rgba(214,69,91,.16) !important;
  color:#FFB0BB !important;
}

:root[data-ui-theme="dark"] .gt,
:root[data-ui-theme="dark"] .gt table{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .gt th{
  background:#0F1A2A !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .gt td,
:root[data-ui-theme="dark"] .gt td.nm{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .gt tr:hover td{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .gt .tot{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .rep,
:root[data-ui-theme="dark"] .rep-page{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .rep-band{
  background:#173B35 !important;
  color:#A9E0CF !important;
}

:root[data-ui-theme="dark"] .rep-sec,
:root[data-ui-theme="dark"] .rep-head{
  background:#0E5B4E !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] .rt th,
:root[data-ui-theme="dark"] .heat th{
  background:#0E5B4E !important;
  color:#FFFFFF !important;
}

:root[data-ui-theme="dark"] .rt td,
:root[data-ui-theme="dark"] .heat td{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .heat td.nm{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .rst div>span:first-child{
  background:#173B35 !important;
  color:#A9E0CF !important;
}

:root[data-ui-theme="dark"] .hb .tr{
  background:#263750 !important;
}

:root[data-ui-theme="dark"] .feature-empty,
:root[data-ui-theme="dark"] .empty{
  background:var(--ui-surface-2) !important;
  color:var(--ink-soft) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .stat-card .stat-icon,
:root[data-ui-theme="dark"] .card .ic,
:root[data-ui-theme="dark"] .feature-item .fi-icon{
  background:#202E43 !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .progress-track{
  background:#263750 !important;
}

:root[data-ui-theme="dark"] .btn.ghost{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .btn.ghost:hover{
  background:#202E43 !important;
}

:root[data-ui-theme="dark"] .modal{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .modal-foot{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .thanks-message,
:root[data-ui-theme="dark"] .thanks-preview,
:root[data-ui-theme="dark"] .thanks-preview-inner,
:root[data-ui-theme="dark"] .thanks-modal-preview,
:root[data-ui-theme="dark"] .points-preview,
:root[data-ui-theme="dark"] .extra-attempt-info>div{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .attention-requests{
  background:rgba(200,138,46,.10) !important;
  border-color:rgba(200,138,46,.40) !important;
}

:root[data-ui-theme="dark"] .attention-requests-head b{
  color:#E5C98E !important;
}

:root[data-ui-theme="dark"] .attention-request{
  background:var(--ui-surface) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] .attention-request-avatar{
  background:#263750 !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] .thanks-request-person small,
:root[data-ui-theme="dark"] .muted,
:root[data-ui-theme="dark"] .student-help{
  color:var(--ink-soft) !important;
}

:root[data-ui-theme="dark"] .veil{
  background:rgba(5,12,22,.78) !important;
}

:root[data-ui-theme="dark"] .pill.quiet{
  background:#202E43 !important;
  color:var(--ink-soft) !important;
  border-color:var(--ui-border-strong) !important;
}

:root[data-ui-theme="dark"] .pill.pts{
  background:rgba(27,156,107,.18) !important;
  color:#62D0A2 !important;
}

:root[data-ui-theme="dark"] .pill.due{
  background:rgba(214,69,91,.18) !important;
  color:#FF8798 !important;
}

:root[data-ui-theme="dark"] [style*="background:#fff"],
:root[data-ui-theme="dark"] [style*="background: #fff"],
:root[data-ui-theme="dark"] [style*="background:#FFFFFF"],
:root[data-ui-theme="dark"] [style*="background: #FFFFFF"],
:root[data-ui-theme="dark"] [style*="background:white"],
:root[data-ui-theme="dark"] [style*="background: white"]{
  background:var(--ui-surface) !important;
  color:var(--ink) !important;
  border-color:var(--rule) !important;
}

:root[data-ui-theme="dark"] [style*="background:#F7F9FC"],
:root[data-ui-theme="dark"] [style*="background:#F8FAFC"],
:root[data-ui-theme="dark"] [style*="background:#F9FBFD"],
:root[data-ui-theme="dark"] [style*="background:#EFF3F8"],
:root[data-ui-theme="dark"] [style*="background:#F4F7FB"]{
  background:var(--ui-surface-2) !important;
  color:var(--ink) !important;
}

:root[data-ui-theme="dark"] [style*="color:#111"],
:root[data-ui-theme="dark"] [style*="color:#16233A"],
:root[data-ui-theme="dark"] [style*="color:#1B2A41"],
:root[data-ui-theme="dark"] [style*="color:#243447"]{
  color:var(--ink) !important;
}

/* ── <style id=dashboard-alerts-redesign> ── */

.alerts-sheet{overflow:hidden}
.alert-section-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:.75rem;margin-bottom:.8rem;min-height:34px
}
.alert-section-title{
  display:flex;align-items:center;gap:.48rem;min-width:0
}
.alert-section-title h3{font-size:.96rem;font-weight:900;white-space:nowrap}
.alert-section-icon{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;background:#F3F6FA;font-size:1rem;flex:none
}
.alert-count{
  min-width:25px;height:24px;padding:0 .42rem;display:inline-flex;
  align-items:center;justify-content:center;border-radius:999px;
  background:#EEF2F7;color:var(--ink-soft);font-size:.68rem;font-weight:900;line-height:1
}
.alert-summary{color:var(--ink-soft);font-size:.7rem;font-weight:700;white-space:nowrap}
.alert-list{display:flex;flex-direction:column;gap:.55rem}
.alert{
  position:relative;display:grid;grid-template-columns:40px minmax(0,1fr);
  align-items:center;gap:.7rem;padding:.72rem .78rem;
  border:1px solid var(--ui-border);border-radius:14px;background:#fff;
  box-shadow:0 2px 8px rgba(22,35,58,.035);overflow:hidden;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease
}
.alert:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(22,35,58,.075)}
.alert::before{
  content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;
  border-radius:4px 0 0 4px;background:#C9D6E5
}
.alert.warn{background:#FFFCF6;border-color:#EBDDBF}
.alert.warn::before{background:#C88A2E}
.alert.danger{background:#FFF8F9;border-color:#EBCBD1}
.alert.danger::before{background:#D6455B}
.alert.good{background:#F5FBF8;border-color:#CFE5DB}
.alert.good::before{background:#1B9C6B}
.alert .a-icon{
  width:40px;height:40px;display:flex;align-items:center;justify-content:center;
  border-radius:11px;background:#F3F6FA;font-size:1.05rem
}
.alert.danger .a-icon{background:rgba(214,69,91,.10)}
.alert.warn .a-icon{background:rgba(200,138,46,.11)}
.alert.good .a-icon{background:rgba(27,156,107,.10)}
.alert .a-body{min-width:0;font-size:.75rem;line-height:1.65}
.alert .a-body b{
  display:block;margin-bottom:.08rem;font-size:.82rem;font-weight:900;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.alert .a-body span{
  display:block;color:var(--ink-soft);overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.alert .a-meta{
  display:flex;align-items:center;gap:.35rem;margin-top:.22rem;
  color:#8290A2;font-size:.64rem;font-weight:700
}
.alert .a-level{
  display:inline-flex;align-items:center;min-height:20px;padding:0 .45rem;
  border-radius:999px;font-size:.61rem;font-weight:900
}
.alert.danger .a-level{background:rgba(214,69,91,.10);color:#B33C4E}
.alert.warn .a-level{background:rgba(200,138,46,.11);color:#9A681F}
.alert.good .a-level{background:rgba(27,156,107,.10);color:#177B55}
.alert-empty{
  display:flex;align-items:center;justify-content:center;gap:.55rem;min-height:82px;
  padding:1rem;border:1px dashed var(--ui-border-strong);border-radius:14px;
  background:#FBFCFE;color:var(--ink-soft);font-size:.76rem;font-weight:700
}
@media screen and (max-width:560px){
  .alert-section-head{align-items:flex-start}
  .alert-section-title h3{font-size:.9rem}
  .alert-summary{font-size:.65rem}
  .alert{grid-template-columns:38px minmax(0,1fr);gap:.58rem;padding:.65rem .7rem}
  .alert .a-icon{width:38px;height:38px}
  .alert .a-body b{font-size:.77rem}
  .alert .a-body{font-size:.69rem}
}

/* ── <style id=actionable-dashboard-alerts> ── */

.alert-section-head{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.8rem
}
.alert-section-title{
  display:flex;align-items:center;gap:.48rem;min-width:0
}
.alert-section-title h3{font-size:.96rem;font-weight:900;white-space:nowrap}
.alert-section-icon{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;background:#F3F6FA;font-size:1rem;flex:none
}
.alert-count{
  min-width:25px;height:24px;padding:0 .42rem;display:inline-flex;align-items:center;
  justify-content:center;border-radius:999px;background:#EEF2F7;color:var(--ink-soft);
  font-size:.68rem;font-weight:900;line-height:1
}
.alert-summary{color:var(--ink-soft);font-size:.7rem;font-weight:700;white-space:nowrap}
.alert-list{display:flex;flex-direction:column;gap:.6rem}
.alert{
  position:relative;display:grid;grid-template-columns:40px minmax(0,1fr);align-items:start;
  gap:.7rem;padding:.78rem;border:1px solid var(--ui-border);border-radius:14px;background:#fff;
  box-shadow:0 2px 8px rgba(22,35,58,.035);overflow:hidden;
  transition:transform .16s ease,box-shadow .16s ease
}
.alert:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(22,35,58,.075)}
.alert::before{
  content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;
  border-radius:4px 0 0 4px;background:#C9D6E5
}
.alert.warn{background:#FFFCF6;border-color:#EBDDBF}
.alert.warn::before{background:#C88A2E}
.alert.danger{background:#FFF8F9;border-color:#EBCBD1}
.alert.danger::before{background:#D6455B}
.alert.good{background:#F5FBF8;border-color:#CFE5DB}
.alert.good::before{background:#1B9C6B}
.alert .a-icon{
  width:40px;height:40px;display:flex;align-items:center;justify-content:center;
  border-radius:11px;background:#F3F6FA;font-size:1.05rem
}
.alert.danger .a-icon{background:rgba(214,69,91,.10)}
.alert.warn .a-icon{background:rgba(200,138,46,.11)}
.alert.good .a-icon{background:rgba(27,156,107,.10)}
.alert .a-body{min-width:0;font-size:.75rem;line-height:1.65}
.alert-title-row{
  display:flex;align-items:flex-start;justify-content:space-between;gap:.65rem
}
.alert-title-wrap{
  display:flex;align-items:center;gap:.45rem;min-width:0;flex-wrap:wrap
}
.alert .a-body b{
  display:block;font-size:.82rem;font-weight:900;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.alert-text{
  display:block;margin-top:.12rem;color:var(--ink-soft)
}
.alert .a-level{
  flex:none;display:inline-flex;align-items:center;min-height:20px;padding:0 .45rem;
  border-radius:999px;font-size:.61rem;font-weight:900
}
.alert.danger .a-level{background:rgba(214,69,91,.10);color:#B33C4E}
.alert.warn .a-level{background:rgba(200,138,46,.11);color:#9A681F}
.alert.good .a-level{background:rgba(27,156,107,.10);color:#177B55}
.alert-students{
  display:flex;flex-direction:column;gap:.35rem;margin-top:.6rem;padding:.4rem;
  border:1px solid rgba(201,214,229,.75);border-radius:11px;background:#F8FAFC
}
.alert-student{
  display:flex;align-items:center;justify-content:space-between;gap:.55rem;min-width:0;
  padding:.44rem .5rem;border:1px solid #E2E8F0;border-radius:9px;background:#fff
}
.alert-student-info{
  display:flex;align-items:center;gap:.5rem;min-width:0
}
.alert-student-info>div{min-width:0}
.alert-student-info b,.alert-student-info small{display:block}
.alert-student-info b{
  font-size:.76rem;font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.alert-student-info small{color:var(--ink-soft);font-size:.61rem;line-height:1.5}
.alert-student-avatar{
  width:30px;height:30px;border-radius:9px;display:flex;align-items:center;justify-content:center;
  flex:none;background:#EAF0F6;color:#334C66;font-size:.64rem;font-weight:900
}
.alert-student-open,.alert-main-action,.alert-dismiss,.alert-dismiss-mobile{
  flex:none;padding:.34rem .55rem;border:1px solid var(--ui-border);border-radius:8px;
  background:#fff;color:var(--ink);font:inherit;font-size:.62rem;font-weight:900;
  white-space:nowrap;cursor:pointer
}
.alert-student-open:hover,.alert-main-action:hover{background:#F1F5F9;border-color:var(--ui-border-strong)}
.alert-dismiss{
  border-color:#CFE5DB;background:#F3FBF7;color:#177B55
}
.alert-dismiss:hover,.alert-dismiss-mobile:hover{background:#E6F6EF}
.alert-footer{
  display:flex;align-items:center;justify-content:space-between;gap:.45rem;margin-top:.5rem
}
.alert-dismiss-mobile{display:none;border-color:#CFE5DB;background:#F3FBF7;color:#177B55}
.alert-empty{
  display:flex;align-items:center;justify-content:center;gap:.55rem;min-height:82px;padding:1rem;
  border:1px dashed var(--ui-border-strong);border-radius:14px;background:#FBFCFE;
  color:var(--ink-soft);font-size:.76rem;font-weight:700
}
.alert-modal-head{display:flex;align-items:center;gap:.5rem;margin-bottom:.9rem}
.alert-modal-head h2{margin:0}
@media screen and (max-width:560px){
  .alert-title-row{align-items:flex-start}
  .alert .a-body b{white-space:normal}
  .alert-dismiss{display:none}
  .alert-footer{flex-direction:column;align-items:stretch}
  .alert-main-action,.alert-dismiss-mobile{width:100%;min-height:34px;text-align:center}
  .alert-dismiss-mobile{display:block}
  .alert-student-open{padding:.32rem .45rem}
}

/* ── <style id=smart-alert-summary-style> ── */

.alert-summary-card .alert-text{margin-top:.15rem}
.alert-kpis{
  display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem;margin-top:.7rem
}
.alert-kpis>div{
  padding:.55rem .6rem;border:1px solid #E2E8F0;border-radius:10px;background:#fff;text-align:center
}
.alert-kpis b{
  display:block!important;font-size:1.05rem!important;line-height:1.2!important;
  white-space:normal!important;overflow:visible!important
}
.alert-kpis span{display:block;color:var(--ink-soft);font-size:.62rem;margin-top:.16rem}
.alert-progress{margin-top:.6rem}
.alert-progress small{display:block;margin-top:.28rem;color:var(--ink-soft);font-size:.61rem}
.alert-student-list-row .missing-student-data{cursor:default;}
.alert-more{
  padding:.38rem .5rem;text-align:center;border:1px dashed #D6E0EA;border-radius:8px;
  background:#F8FAFC;color:var(--ink-soft);font-size:.66rem;font-weight:800
}
.alert-students.compact{padding:.35rem}
.missing-summary-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:.7rem;margin-bottom:.8rem
}
.missing-summary-head h2{margin:0 0 .12rem}
.missing-summary-head p{margin:0;color:var(--ink-soft);font-size:.75rem}
.missing-kpis{
  display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;margin-bottom:.8rem
}
.missing-kpis>div{
  padding:.72rem .65rem;border:1px solid var(--ui-border);border-radius:12px;
  background:#F8FAFC;text-align:center
}
.missing-kpis b{display:block;font-size:1.2rem}
.missing-kpis span{display:block;margin-top:.15rem;color:var(--ink-soft);font-size:.67rem}
.missing-progress{
  margin-bottom:.9rem;padding:.7rem;border:1px solid var(--ui-border);border-radius:12px;background:#fff
}
.missing-progress-head{
  display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  margin-bottom:.45rem;font-size:.72rem
}
.missing-class-list{display:flex;flex-direction:column;gap:.5rem}
.missing-class-row{
  display:grid;grid-template-columns:minmax(120px,1fr) minmax(100px,1.1fr) 54px auto;
  align-items:center;gap:.55rem;padding:.62rem;border:1px solid #E2E8F0;border-radius:11px;background:#fff
}
.missing-class-main b,.missing-class-main span{display:block}
.missing-class-main b{font-size:.78rem}
.missing-class-main span{font-size:.63rem;color:var(--ink-soft);margin-top:.08rem}
.missing-class-meter{
  height:8px;background:#EDF2F7;border-radius:999px;overflow:hidden
}
.missing-class-meter i{display:block;height:100%;background:var(--amber);border-radius:999px}
.missing-class-row>strong{text-align:center;font-size:.72rem}
.missing-class-names{
  grid-column:1/-1;display:none;gap:.35rem;flex-wrap:wrap;padding-top:.15rem
}
.missing-class-names.on{display:flex}
.missing-student-chip{
  padding:.3rem .5rem;border:1px solid #DCE5F0;border-radius:999px;background:#F8FAFC;
  color:var(--ink);font:inherit;font-size:.64rem;font-weight:700;cursor:pointer
}
.missing-student-chip:hover{background:#EEF3F8}
@media screen and (max-width:560px){
  .alert-kpis,.missing-kpis{grid-template-columns:1fr 1fr}
  .alert-kpis>div:last-child,.missing-kpis>div:last-child{grid-column:1/-1}
  .missing-class-row{
    grid-template-columns:1fr auto;
  }
  .missing-class-meter{grid-column:1/-1}
  .missing-class-row>strong{grid-column:1}
  .missing-class-row>.btn{grid-column:2}
}

/* ── <style id=missing-student-list-fix> ── */

.missing-student-list{
  display:flex;
  flex-direction:column;
  gap:.4rem;
  max-height:58vh;
  overflow:auto;
  padding:.15rem;
}
.missing-student-row{
  display:grid;
  grid-template-columns:32px minmax(0,1fr) auto;
  align-items:center;
  gap:.55rem;
  padding:.5rem .55rem;
  border:1px solid #E2E8F0;
  border-radius:11px;
  background:#fff;
}
.missing-student-number{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:#F1F5F9;
  color:var(--ink-soft);
  font-size:.65rem;
  font-weight:900;
}
.missing-student-data{
  min-width:0;
}
.missing-student-data b,
.missing-student-data small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.missing-student-data b{font-size:.78rem}
.missing-student-data small{font-size:.62rem;color:var(--ink-soft);margin-top:.08rem}
@media screen and (max-width:560px){
  .missing-student-row{
    grid-template-columns:30px minmax(0,1fr);
  }
  .missing-student-row .btn{
    grid-column:2;
    justify-self:start;
  }
}

/* ── <style id=report-navigation-consistency> ── */

.report-topbar{
  display:flex;
  justify-content:flex-start;
  margin-bottom:.65rem;
}
.report-switch{
  display:inline-flex;
  gap:.2rem;
  padding:.22rem;
  background:#EFF3F8;
  border:1px solid var(--ui-border,#DCE5F0);
  border-radius:999px;
}
.report-switch-btn{
  min-height:36px;
  padding:.38rem .85rem;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--ink-soft);
  font:inherit;
  font-size:.8rem;
  font-weight:700;
  cursor:pointer;
  transition:.16s;
}
.report-switch-btn:hover{
  background:rgba(255,255,255,.7);
  color:var(--ink);
}
.report-switch-btn.on{
  background:var(--ink);
  color:var(--paper);
  box-shadow:0 2px 7px rgba(22,35,58,.12);
}
@media screen and (max-width:560px){
  .report-topbar{justify-content:stretch}
  .report-switch{width:100%}
  .report-switch-btn{
    flex:1;
    padding-inline:.45rem;
  }
}

/* ── <style id=report-mode-fix> ── */

#dg-body.report-mode-brief .rep-page:not(:first-child),
#sty-body.report-mode-brief .rep-page:not(:first-child){
  display:none !important;
}
#dg-body.report-mode-full .rep-page,
#sty-body.report-mode-full .rep-page{
  display:block;
}

/* ── <style id=report-mode-final-fix> ── */

/* The selected mode is controlled by the report body class. */
#dg-body.report-mode-brief .rep-page:not(:first-child),
#sty-body.report-mode-brief .rep-page:not(:first-child){
  display:none !important;
}
#dg-body.report-mode-full .rep-page,
#sty-body.report-mode-full .rep-page{
  display:block !important;
}

/* ── <style id=report-mode-scoped-final> ── */

.report-mode-toggle .diag-mode,
.report-mode-toggle .styles-mode{
  min-height:34px;
  padding:.32rem .72rem;
  border-radius:999px;
  font-family:inherit;
  font-weight:700;
  font-size:.78rem;
  background:transparent;
  color:var(--ink-soft);
  border:0;
  cursor:pointer;
}
.report-mode-toggle .diag-mode.on,
.report-mode-toggle .styles-mode.on{
  background:var(--ink);
  color:var(--paper);
  box-shadow:0 2px 7px rgba(22,35,58,.12);
}

/* ── <style id=diag-student-list-style> ── */

.diag-student-list{display:flex;flex-direction:column;gap:.35rem}
.diag-student-item{
  display:grid;grid-template-columns:30px minmax(0,1fr) 54px auto;
  align-items:center;gap:.55rem;min-height:44px;padding:.4rem .5rem;
  border:1px solid #E2E8F0;border-radius:10px;background:#fff;
}
.diag-student-num{
  width:27px;height:27px;display:flex;align-items:center;justify-content:center;
  border-radius:8px;background:#F1F5F9;color:var(--ink-soft);
  font-size:.68rem;font-weight:800;
}
.diag-student-main{min-width:0}
.diag-student-main b,.diag-student-main small{
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.diag-student-main b{font-size:.8rem}
.diag-student-main small{margin-top:.05rem;color:var(--ink-soft);font-size:.63rem}
.diag-student-pct{text-align:center;font-size:.78rem;font-weight:900}
@media screen and (max-width:560px){
  .diag-student-item{grid-template-columns:28px minmax(0,1fr) 48px}
  .diag-student-item .btn{grid-column:2 / -1;justify-self:start}
}

/* ── <style id=class-print-matching-report-style> ── */

/* نفس روح تقرير "تحليل النتائج": أخضر بترولي + خلفية خضراء فاتحة + بطاقات هادئة */
.class-print-page{
  background:
    linear-gradient(180deg,#F5F9F7 0%,#F8FBFA 100%) !important;
  color:#1D2B3A;
}

.class-print-wrap{
  background:#FFFFFF;
  border:1px solid #D7E5E0;
  border-radius:8px;
  padding:0 3mm 3mm !important;
  box-shadow:0 3px 12px rgba(14,91,78,.06);
}

/* الترويسة الخضراء المستوحاة من التقرير المرجعي */
.class-print-top{
  margin:0 -3mm 8px !important;
  padding:10px 10mm 8px !important;
  background:#0E5B4E !important;
  color:#fff !important;
  border-radius:8px 8px 0 0;
}
.class-print-school{
  color:#fff !important;
}
.class-print-school .soft{
  color:#D9ECE7 !important;
}
.class-print-badge{
  background:#fff !important;
  border-color:#CFE1DC !important;
  color:#0E5B4E !important;
}

/* العنوان */
.class-print-titleband,
.class-print-detail-title{
  border-top:3px solid #6DB2D9 !important;
  border-bottom:1px solid #D6E3E8 !important;
  background:#fff !important;
}

/* عناوين الأقسام */
.class-print-kicker{
  color:#2F8A68 !important;
}

.class-print-card{
  border-color:#BFDACE !important;
  background:#fff !important;
}

.class-print-card h3{
  background:#EAF4F1 !important;
  color:#0E5B4E !important;
  border-bottom-color:#D2E5DF !important;
}

/* بطاقات الملخص */
.class-print-stat{
  background:#F8FBFA !important;
  border-color:#CBDDD8 !important;
}
.class-print-stat.green{
  box-shadow:inset 0 3px 0 #16B889 !important;
}
.class-print-stat.red{
  box-shadow:inset 0 3px 0 #E85B66 !important;
}
.class-print-stat.blue{
  box-shadow:inset 0 3px 0 #438BC8 !important;
}

/* المؤشرات */
.class-print-detail-meta div{
  background:#F2F8F6 !important;
  border-color:#CFE1DC !important;
}
.class-print-detail-meta div b{
  color:#0E5B4E;
}

/* جدول الصفحة الثانية */
.class-print-listtable th{
  background:#0E5B4E !important;
  color:#fff !important;
  border-color:#0E5B4E !important;
}
.class-print-listtable td{
  border-color:#D7E3E0 !important;
}
.class-print-listtable tbody tr:nth-child(even){
  background:#F8FBFA !important;
}

.class-print-status.done{
  background:#16B889 !important;
}
.class-print-status.missing{
  background:#E85B66 !important;
}

/* أشرطة المؤشر */
.class-print-bar{
  background:#E8EFED !important;
}
.class-print-bar.green i{
  background:#16B889 !important;
}
.class-print-bar.red i{
  background:#E85B66 !important;
}

/* نسخة الطباعة */
@media print{
  .class-print-page{
    background:#F5F9F7 !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
  .class-print-wrap{
    background:#fff !important;
    box-shadow:none !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
  .class-print-top{
    background:#0E5B4E !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
  .class-print-card h3,
  .class-print-detail-meta div,
  .class-print-stat{
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }
  .class-print-listtable th{
    background:#0E5B4E !important;
    color:#fff !important;
  }
}

/* ── <style id=weekly-32-students-print-fix> ── */

/* ضغط الصفحة الثانية فقط لتستوعب 31–32 طالبًا في A4 */
@media print{
  #class-activity-print-report .class-print-page + .class-print-page{
    padding-top:0 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-top{
    margin-bottom:4px !important;
    padding-top:0 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-top{
    grid-template-columns:1fr 125px 1fr !important;
    gap:8px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-logo{
    width:100px !important;
    height:58px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-school{
    font-size:9px !important;
    line-height:1.4 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-badge{
    padding:5px 14px !important;
    font-size:10px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-head{
    margin-bottom:5px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-title{
    padding:3px 8px !important;
    font-size:14px !important;
    border-top-width:2px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-sub{
    font-size:8.5px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta{
    grid-template-columns:repeat(4,1fr) !important;
    gap:5px !important;
    margin:5px 0 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta div{
    padding:3px 4px !important;
    font-size:8px !important;
    border-radius:5px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta b{
    font-size:8.5px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable{
    font-size:8.1px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th{
    padding:3px 3px !important;
    font-size:8px !important;
    line-height:1.1 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td{
    padding:1.7px 4px !important;
    height:18px !important;
    line-height:1.12 !important;
    font-size:8.1px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-status{
    padding:1px 7px !important;
    min-width:55px !important;
    font-size:7.6px !important;
    line-height:1.15 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-grade{
    font-size:8.4px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-footer-note{
    margin-top:7px !important;
    font-size:8px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-footer-note div{
    padding-top:3px !important;
  }
}

/* ── <style id=weekly-print-readability-final> ── */

@media print{
  /* الصفحة الثانية: زيادة الوضوح مع الحفاظ على 31–32 طالبًا */
  #class-activity-print-report .class-print-page + .class-print-page{
    padding-top:0 !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-top{
    margin-bottom:4px !important;
    padding-top:0 !important;
    gap:7px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-logo{
    width:104px !important;
    height:58px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-school{
    font-size:9.2px !important;
    line-height:1.35 !important;
    padding-top:1px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-badge{
    padding:4px 13px !important;
    font-size:10.5px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-head{
    margin-bottom:5px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-title{
    padding:3px 8px !important;
    font-size:15px !important;
    border-top-width:2px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-sub{
    font-size:9px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta{
    gap:5px !important;
    margin:5px 0 6px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta div{
    padding:3px 4px !important;
    font-size:8.8px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta b{
    font-size:9.4px !important;
  }

  /* الجدول: الخط أوضح، والخلايا أهدأ، دون التضحية بعدد الصفوف */
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable{
    table-layout:fixed !important;
    width:100% !important;
    font-size:10px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th{
    padding:3px 4px !important;
    font-size:9.4px !important;
    line-height:1.15 !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td{
    height:20px !important;
    padding:1.5px 4px !important;
    font-size:10px !important;
    line-height:1.05 !important;
    vertical-align:middle !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td.name{
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:clip !important;
    font-weight:800 !important;
    font-size:10.2px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-status{
    padding:1.5px 7px !important;
    min-width:0 !important;
    font-size:8.6px !important;
    line-height:1.1 !important;
    white-space:nowrap !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-grade{
    font-size:10.2px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-footer-note{
    margin-top:8px !important;
    font-size:8.8px !important;
  }
  #class-activity-print-report .class-print-page + .class-print-page .class-print-footer-note div{
    padding-top:4px !important;
  }

  /* توزيع ثابت للأعمدة حتى يبقى اسم الطالب عريضًا */
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th:nth-child(1),
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td:nth-child(1){width:32px !important;}
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th:nth-child(3),
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td:nth-child(3){width:105px !important;}
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th:nth-child(4),
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td:nth-child(4){width:62px !important;}
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th:nth-child(5),
  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td:nth-child(5){width:52px !important;}
}

/* ── <style id=alphabetical-class-roster-print-fix> ── */

@media print{
  .class-print-listtable td.name{
    text-align:right !important;
    direction:rtl !important;
    unicode-bidi:plaintext;
    font-weight:700 !important;
  }
}

/* ── <style id=class-print-choice-style> ── */

.print-choice-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
}
.print-choice{
  text-align:center;
  padding:1rem .8rem;
  border:1px solid var(--ui-border,#DCE5F0);
  background:#fff;
  border-radius:14px;
  min-height:150px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  cursor:pointer;
  font:inherit;
  transition:.16s;
}
.print-choice:hover{
  background:#F7FAFC;
  border-color:#BFD0DE;
  transform:translateY(-1px);
}
.print-choice.featured{
  border-color:#B8D9D0;
  background:#F3F9F7;
}
.print-choice-icon{font-size:2rem;line-height:1}
.print-choice b{font-size:.95rem}
.print-choice small{
  color:var(--ink-soft);
  font-size:.72rem;
  line-height:1.7;
  max-width:220px;
}
@media screen and (max-width:520px){
  .print-choice-grid{grid-template-columns:1fr}
}

/* ── <style id=weekly-roster-32-one-page-and-filename> ── */

@media print{
  /* كشف الأسماء فقط: نستخدم كامل مساحة A4 ونضغط المساحات غير الضرورية،
     مع إبقاء حجم الخط مقروءًا. */
  @page{
    size:A4 portrait;
    margin:5mm 6mm;
  }

  #class-activity-print-report .class-print-page{
    min-height:0 !important;
    height:auto !important;
  }

  /* الصفحة الثانية سواء كانت الطباعة مختصرة أو كاملة */
  #class-activity-print-report .class-print-page .class-print-wrap{
    padding:0 2mm 2mm !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page{
    page-break-before:always !important;
    break-before:page !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-top{
    margin:0 -2mm 3px !important;
    padding:4px 7mm 3px !important;
    min-height:31px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-school{
    font-size:8px !important;
    line-height:1.25 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-logo{
    width:84px !important;
    height:37px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-badge{
    padding:3px 10px !important;
    font-size:9px !important;
    border-radius:6px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-head{
    margin:2px 0 3px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-title{
    padding:2px 6px !important;
    font-size:12.5px !important;
    line-height:1.25 !important;
    border-top-width:2px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-sub{
    font-size:8px !important;
    line-height:1.2 !important;
    margin-top:1px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta{
    grid-template-columns:repeat(4,1fr) !important;
    gap:3px !important;
    margin:3px 0 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta div{
    padding:2px 3px !important;
    font-size:7.7px !important;
    line-height:1.15 !important;
    border-radius:4px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-detail-meta b{
    font-size:8.2px !important;
    margin-top:1px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable{
    width:100% !important;
    border-collapse:collapse !important;
    font-size:8.8px !important;
    line-height:1.05 !important;
    table-layout:fixed !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable th{
    padding:2.2px 3px !important;
    height:17px !important;
    font-size:8.6px !important;
    line-height:1.05 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td{
    padding:1px 3px !important;
    height:15.8px !important;
    max-height:15.8px !important;
    font-size:8.8px !important;
    line-height:1.05 !important;
    vertical-align:middle !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable td.name{
    font-size:9px !important;
    font-weight:700 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-status{
    display:inline-block !important;
    min-width:61px !important;
    padding:1px 6px !important;
    font-size:7.9px !important;
    line-height:1.05 !important;
    border-radius:999px !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-grade{
    font-size:9px !important;
    font-weight:700 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-footer-note{
    margin-top:4px !important;
    padding-top:2px !important;
    font-size:7.7px !important;
    line-height:1.15 !important;
  }

  #class-activity-print-report .class-print-page + .class-print-page .class-print-listtable tr{
    height:15.8px !important;
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }
}

/* ── <style id=next-action-primary-style> ── */

.next-action-primary{
  border-color:#BFDACE !important;
  background:#F5FAF8 !important;
  align-items:center !important;
}
.next-action-primary .fi-icon{
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  border-radius:12px;
  background:#EAF4F1;
}
.next-action-primary .fi-title{
  font-weight:900 !important;
  color:#0E5B4E !important;
}
.next-action-primary .fi-sub{
  margin-top:3px;
}
.next-action-primary .btn{
  flex:0 0 auto;
  white-space:nowrap;
}

<style id="student-profile-actions-style">
.student-actions{
  margin-top:.85rem;
  padding:.85rem;
  border:1px solid var(--rule);
  border-radius:14px;
  background:#F7FBF9;
}
.student-actions-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  margin-bottom:.65rem;
}
.student-actions-title h4{
  margin:0;
  font-size:.95rem;
  color:var(--ink);
}
.student-actions-title span{
  color:var(--ink-soft);
  font-size:.76rem;
}
.student-actions-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.55rem;
}
.student-action-btn{
  min-height:46px;
  text-align:right;
}
.student-action-btn small{
  display:block;
  margin-top:2px;
  color:var(--ink-soft);
  font-weight:500;
  font-size:.72rem;
}
@media screen and (max-width:620px){
  .student-actions-grid{grid-template-columns:1fr}
}

/* ── <style id=followup-students-style> ── */

.followup-students-sheet .section-title{
  align-items:center;
}
.followup-students-sheet .feature-item{
  cursor:pointer;
}
.followup-students-sheet .feature-item:hover{
  border-color:#BFDACE;
  background:#F8FCFA;
}
.followup-students-sheet .followup-count{
  min-width:34px;
  height:34px;
  padding:0 8px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#FCEFEF;
  color:#9B3A3A;
  font-weight:900;
  font-size:.82rem;
}
.followup-students-sheet .followup-arrow{
  color:var(--ink-soft);
  font-size:.9rem;
}

/* ── <style id=mobile-missing-modal-fix> ── */

@media screen and (max-width: 560px){
  .veil{
    align-items:center;
    padding:.65rem;
  }
  .modal{
    width:100%;
    max-width:none;
    max-height:88vh;
    padding:.9rem;
    border-radius:16px;
    overflow:auto;
    box-sizing:border-box;
  }
  .missing-summary-head{
    gap:.5rem;
    margin-bottom:.65rem;
  }
  .missing-summary-head h2{font-size:1rem;}
  .missing-summary-head p{font-size:.68rem;}
  .missing-summary-head .pill{
    flex:0 0 auto;
    font-size:.68rem;
    padding:.18rem .5rem;
  }
  .missing-student-list{
    max-height:57vh;
    padding:0;
    gap:.35rem;
  }
  .missing-student-row{
    grid-template-columns:28px minmax(0,1fr) !important;
    gap:.45rem;
    padding:.45rem .5rem;
    min-width:0;
    box-sizing:border-box;
  }
  .missing-student-number{
    width:26px;
    height:26px;
    font-size:.62rem;
  }
  .missing-student-data{
    min-width:0;
    align-self:center;
  }
  .missing-student-data b{font-size:.76rem;}
  .missing-student-data small{font-size:.6rem;}
  .missing-student-row > div:last-child{
    grid-column:2 !important;
    min-width:0;
    width:100%;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:.35rem !important;
    flex-wrap:wrap !important;
    box-sizing:border-box;
  }
  .missing-student-row > div:last-child .btn,
  .missing-student-row > div:last-child .sa-retry{
    flex:0 0 auto;
    max-width:100%;
    white-space:nowrap;
  }
  .missing-student-row .btn.sm{
    min-height:34px;
    padding:.28rem .58rem;
    font-size:.78rem;
  }
  .missing-student-row .sa-retry{
    min-height:34px;
    padding:.28rem .58rem;
    font-size:.72rem;
  }
  .missing-kpis{gap:.4rem;margin-bottom:.65rem;}
  .missing-kpis>div{padding:.58rem .45rem;}
  .missing-kpis b{font-size:1.05rem;}
  .missing-progress{padding:.58rem;margin-bottom:.7rem;}
  .modal-foot{
    position:sticky;
    bottom:-.9rem;
    margin-top:.75rem;
    padding:.7rem 0 .1rem;
    background:var(--paper);
    z-index:2;
  }
}

/* ── <style id=activity-report-responsive-polish> ── */

/* تحسين بصري لتقرير النشاط: لا يغيّر أي وظيفة أو آلية تسليم */
.activity-report-modal{
  width:min(760px,100%);
  padding:1.15rem 1.2rem 1rem;
  border-radius:20px;
}
.activity-report-modal .activity-report-head{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.05rem .1rem .65rem;border-bottom:1px solid var(--ui-border);
}
.activity-report-modal .activity-report-heading{min-width:0}
.activity-report-modal .activity-report-kicker{
  display:inline-flex;align-items:center;gap:.3rem;margin-bottom:.22rem;
  color:var(--tick);font-size:.72rem;font-weight:800;
}
.activity-report-modal .activity-report-heading h2{
  margin:0;font-size:1.35rem;line-height:1.25;letter-spacing:-.02em;
}
.activity-report-modal .activity-report-heading p{
  margin:.25rem 0 0!important;color:var(--ink-soft);font-size:.78rem!important;
}
.activity-report-modal .activity-report-close-hint{
  flex:0 0 auto;padding:.35rem .65rem;border-radius:999px;
  background:#F3F6FA;color:var(--ink-soft);font-size:.68rem;font-weight:700;
}
.activity-report-modal .astat{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:.55rem!important;
  margin:.7rem 0!important;
}
.activity-report-modal .astat>div{
  border:1px solid var(--ui-border);background:var(--ui-surface-2);
  border-radius:13px;padding:.52rem .5rem;
  min-width:0;
  text-align:center;
  display:flex;flex-direction:column;justify-content:center;
  min-height:54px;
}
.activity-report-modal .astat b{font-size:1.08rem!important}
.activity-report-modal .astat span{font-size:.67rem!important;color:var(--ink-soft)}
.activity-report-modal .rep-sec{
  border-radius:12px 12px 0 0!important;margin-top:.55rem!important;
  min-height:36px;padding:.45rem .65rem!important;
  font-size:.76rem!important;font-weight:800;
}
.activity-report-modal .rep-box{
  border:1px solid var(--ui-border);border-top:0!important;
  border-radius:0 0 12px 12px!important;box-shadow:none!important;
}
.activity-report-modal .activity-q-row{
  display:grid!important;grid-template-columns:1.35rem minmax(0,1fr) auto 56px 2.8rem;
  align-items:center;gap:.45rem!important;min-height:38px;
}
.activity-report-modal .activity-q-row>span:nth-child(2){
  min-width:0;line-height:1.35;
}
.activity-report-modal .activity-q-row>span:nth-child(2)>span{vertical-align:middle}
.activity-report-modal .activity-q-row .pill{white-space:nowrap}
.activity-report-modal .modal-foot{
  margin-top:.9rem;padding-top:.85rem;border-top:1px solid var(--ui-border);
}
@media screen and (max-width:700px){
  .activity-report-modal{
    width:100%;max-width:none;max-height:91vh;
    padding:.85rem .8rem .7rem;border-radius:18px;
  }
  .activity-report-modal .activity-report-head{gap:.5rem;padding-bottom:.65rem}
  .activity-report-modal .activity-report-heading h2{font-size:1.08rem}
  .activity-report-modal .activity-report-kicker{font-size:.64rem}
  .activity-report-modal .activity-report-heading p{font-size:.67rem!important}
  .activity-report-modal .activity-report-close-hint{font-size:.6rem;padding:.3rem .5rem}
  .activity-report-modal .astat{grid-template-columns:repeat(2,1fr)!important;margin:.65rem 0!important}
  .activity-report-modal .astat>div{padding:.48rem .35rem;min-height:50px}
  .activity-report-modal .astat b{font-size:.95rem!important}
  .activity-report-modal .astat span{font-size:.61rem!important}
  .activity-report-modal .activity-q-row{
    grid-template-columns:1.2rem minmax(0,1fr) auto 2.6rem!important;
    gap:.35rem!important;padding:.5rem .25rem!important;
  }
  .activity-report-modal .activity-q-row>span:nth-child(4){display:none}
  .activity-report-modal .activity-q-row>span:nth-child(2){font-size:.72rem!important;font-weight:700}
  .activity-report-modal .activity-q-row>span:nth-child(3){font-size:.62rem!important;padding:.18rem .4rem!important}
  .activity-report-modal .activity-q-row>b{font-size:.7rem!important;min-width:2.6rem!important}
  .activity-report-modal .activity-q-row + div{font-size:.68rem!important}
  .activity-report-modal .rep-box{padding:.35rem!important}
  .activity-report-modal .rep-sec{font-size:.7rem!important;min-height:34px;padding:.45rem .55rem!important}
  .activity-report-modal .modal-foot{
    position:sticky;bottom:-.7rem;background:var(--paper);
    margin-inline:-.8rem;padding:.65rem .8rem .15rem;
    justify-content:stretch;z-index:5;
  }
  .activity-report-modal .modal-foot .btn{flex:1;min-height:38px;font-size:.76rem}
}
@media screen and (max-width:390px){
  .activity-report-modal .activity-report-close-hint{display:none}
  .activity-report-modal .activity-q-row{grid-template-columns:1.1rem minmax(0,1fr) auto 2.4rem!important}
  .activity-report-modal .activity-q-row>span:nth-child(3){max-width:58px;overflow:hidden;text-overflow:ellipsis}
}

/* ── <style id=activity-report-space-fix> ── */

/* ضبط المساحة في تقرير النشاط فقط، دون تغيير أي منطق */
.activity-report-modal .astat{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
.activity-report-modal .astat>div{min-width:0;text-align:center}
@media screen and (max-width:700px){
  .activity-report-modal .astat{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ── <style id=projects-review-demo> ── */

.project-review-actions{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.project-review-actions .project-file-count{margin-inline-start:auto}
.project-accept-demo,.project-reject-demo{border-radius:9px}
.project-accept-demo{border:1px solid rgba(27,156,107,.35);background:rgba(27,156,107,.08);color:var(--tick)}
.project-reject-demo{border:1px solid rgba(190,65,65,.3);background:rgba(190,65,65,.06);color:#a33}
@media screen and (max-width:600px){
  .project-review-actions{display:grid;grid-template-columns:1fr 1fr;gap:.45rem}
  .project-review-actions .project-file-count{grid-column:1/-1;margin-inline-start:0;text-align:center}
  .project-review-actions .btn{width:100%;justify-content:center}
}

/* ── <style id=projects-students-ui> ── */

.projects-filter-grid{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr;gap:.55rem;align-items:center}
.projects-summary{margin-top:.65rem;color:var(--ink-soft);font-size:.84rem}
.projects-grade-box{margin-top:.7rem;padding:.65rem .8rem;border:1px solid var(--rule);border-radius:12px;background:var(--paper);display:flex;align-items:center;justify-content:space-between;gap:.7rem;flex-wrap:wrap}.projects-grade-box b{color:var(--ink)}.project-grade{font-weight:800;color:var(--tick)}.project-count{font-size:.78rem;color:var(--ink-soft)}
.projects-state{padding:1.4rem;text-align:center;color:var(--ink-soft)}
.projects-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.project-head-pills{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;justify-content:flex-end}
.project-view-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.75rem 0;border-bottom:1px solid var(--line);margin-bottom:.8rem}.recent-project-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;min-width:34px;padding:0;border:1px solid var(--rule);border-radius:9px;background:var(--paper);font-size:1.05rem;line-height:1;cursor:pointer;text-decoration:none}.recent-project-icon-btn.recent-project-review-link{color:inherit;text-decoration:none}.recent-project-icon-btn.recent-project-approved{border-color:rgba(45,130,80,.3);background:rgba(45,130,80,.07)}.recent-project-icon-btn.recent-project-rejected{border-color:rgba(190,65,65,.3);background:rgba(190,65,65,.07)}.recent-project-icon-btn:hover{transform:translateY(-1px)}.recent-project-icon-btn:focus-visible{outline:2px solid var(--pen);outline-offset:2px}.recent-project-review-link{cursor:pointer;text-decoration:underline;text-underline-offset:3px;color:var(--pen);white-space:nowrap}.recent-project-review-link:hover{opacity:.8}.recent-project-review-link:focus-visible{outline:2px solid var(--pen);outline-offset:3px;border-radius:5px}
.project-review-status.pending{border-color:rgba(190,145,45,.35);color:#8a6a13;background:rgba(190,145,45,.08)}
.project-review-status.accepted{border-color:rgba(45,130,80,.3);color:#287448;background:rgba(45,130,80,.07)}
.project-review-status.rejected{border-color:rgba(190,65,65,.3);color:#a33;background:rgba(190,65,65,.07)}
.project-review-note{margin:.65rem 0 0;padding:.65rem .8rem;border-radius:12px;border:1px solid rgba(190,65,65,.22);background:rgba(190,65,65,.05);line-height:1.65}
.project-card{border:1px solid var(--rule);border-radius:14px;background:var(--paper);padding:.8rem;box-shadow:0 2px 10px rgba(22,35,58,.04)}
.project-card-head{display:flex;gap:.7rem;align-items:flex-start;justify-content:space-between}
.project-card h3{margin:0;font-size:1rem;color:var(--ink)}
.project-card .project-meta{color:var(--ink-soft);font-size:.78rem;margin-top:.22rem}
.project-files{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.45rem;margin-top:.7rem}
.project-thumb{position:relative;border:1px solid var(--rule);border-radius:10px;overflow:hidden;background:#F5F7FA;min-height:92px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.project-thumb img{width:100%;height:100px;object-fit:cover;display:block}
.project-thumb.pdf{padding:.55rem;flex-direction:column;gap:.2rem;color:var(--ink-soft);font-size:.75rem;text-align:center}
.project-thumb .project-file-name{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 .25rem}
.project-card-foot{display:flex;align-items:center;gap:.4rem;margin-top:.7rem}
.projects-empty{border:1px dashed var(--rule);border-radius:14px;padding:2rem;text-align:center;color:var(--ink-soft)}
.projects-modal{max-width:980px!important;width:min(96vw,980px)!important}
.project-view-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:.7rem}
.project-view-head h2{margin:0}
.project-view-meta{font-size:.82rem;color:var(--ink-soft);margin-top:.25rem}
.project-view-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.project-view-item{border:1px solid var(--rule);border-radius:12px;overflow:hidden;background:#F7F9FC}
.project-view-item img{display:block;width:100%;max-height:520px;object-fit:contain;background:#fff;cursor:zoom-in}
.project-view-item iframe{display:block;width:100%;height:560px;border:0;background:#fff}
.project-view-label{padding:.5rem .65rem;font-size:.78rem;color:var(--ink-soft);display:flex;justify-content:space-between;gap:.5rem}
@media screen and (max-width:850px){.projects-filter-grid{grid-template-columns:1fr 1fr}.projects-grid{grid-template-columns:1fr}.project-view-grid{grid-template-columns:1fr}}
@media screen and (max-width:600px){.projects-filter-grid{grid-template-columns:1fr}.project-files{grid-template-columns:repeat(2,minmax(0,1fr))}.project-view-item iframe{height:460px}}

/* ── <style id=platform-specific-ui> ── */

/* ==========================================================
   Platform Specific UI
   PC = مساحة عمل واسعة
   Mobile = واجهة تشغيل لمس مخصصة
   لا يغيّر منطق التطبيق أو Worker/API
   ========================================================== */

/* ---------- PC ---------- */
@media (min-width:701px){
  .app-sidebar{right:0!important;left:auto!important;top:0!important;bottom:0!important}

  body{min-width:1024px}

  .masthead-in,.tabs,.wrap{
    max-width:1180px;
  }

  .wrap{
    padding:1.5rem 1.25rem 5rem;
  }

  .sheet{
    padding:1.2rem;
  }

  .sheet-head{
    align-items:center;
  }

  .sheet-head > div:first-child{
    min-width:0;
  }

  .row{
    flex-wrap:nowrap;
  }

  .row > .inp,
  .row > select{
    flex:1 1 auto;
  }

  .dashboard-actions{
    justify-content:flex-start;
  }

  .cards{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .feature-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .feature-cols{
    grid-template-columns:1.25fr 1fr;
  }

  .students-layout{
    grid-template-columns:minmax(300px,.85fr) minmax(0,1.5fr);
  }

  .projects-filter-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .projects-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .project-view-grid{
    grid-template-columns:1.1fr .9fr;
  }

  .grades-tools{
    flex-direction:row;
  }

  .grades-table-wrap,
  #comp-table{
    overflow-x:auto;
  }

  .rep-grid{
    grid-template-columns:1.35fr 1fr;
  }

  .rep-charts{
    grid-template-columns:1fr 1fr;
  }

  .rep-info{
    grid-template-columns:repeat(4,1fr);
  }
}

/* ---------- MOBILE ---------- */
@media screen and (max-width:700px){

  html,body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  .masthead{
    padding:.7rem .65rem .55rem;
  }

  .masthead-in{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:.45rem;
  }

  .brand{
    font-size:1rem;
    min-width:0;
  }

  .masthead .meta{
    max-width:48%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  /* الشريط العلوي مخفي في الجوال — التنقّل من الشريط السفلي.
     كانت هذه القاعدة تفرض إظهاره بـ!important وهي متأخرة في الملف،
     فتغلب قاعدة الإخفاء مهما كتبناها قبلها. */
  .tabs{
    width:100%;
    max-width:none!important;
    display:none!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    overflow-y:hidden;
    gap:.35rem;
    padding:0 0 3px;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .tabs::-webkit-scrollbar{display:none}

  .tabs .tab{
    flex:0 0 auto!important;
    min-width:max-content;
    min-height:43px;
    padding:.48rem .78rem;
    border-radius:999px;
    font-size:.74rem;
  }

  .wrap{
    width:100%;
    max-width:none;
    padding:.75rem .55rem calc(2.4rem + env(safe-area-inset-bottom,0px));
  }

  /* كل تبويب يعمل كصفحة جوال مستقلة */
  .panel{
    width:100%;
    max-width:100%;
  }

  .sheet{
    width:100%;
    padding:.8rem;
    margin-bottom:.7rem;
    border-radius:15px;
    box-shadow:0 2px 10px rgba(22,35,58,.06);
  }

  .sheet-head{
    display:flex;
    flex-wrap:wrap;
    align-items:flex-start;
    gap:.45rem;
    margin-bottom:.65rem;
  }

  .sheet-head > div:first-child{
    flex:1 1 100%;
    min-width:0;
  }

  .sheet-head h2{
    font-size:.98rem;
  }

  .sheet-head .sub{
    display:block;
    font-size:.72rem;
    line-height:1.45;
  }

  .sheet-head .spacer{
    display:none!important;
  }

  .sheet-head .btn{
    min-height:42px;
  }

  .field{
    margin-bottom:.65rem;
  }

  .field > label,
  .field > span{
    font-size:.76rem;
  }

  .inp{
    width:100%;
    min-height:44px;
    border-radius:11px;
    font-size:.92rem;
  }

  textarea.inp{
    min-height:110px;
  }

  .row{
    display:flex;
    flex-wrap:wrap;
    gap:.45rem;
  }

  .row > .inp,
  .row > select{
    flex:1 1 100%;
    width:100%;
    min-width:0!important;
  }

  .btn{
    min-height:44px;
    border-radius:11px;
    font-size:.84rem;
    touch-action:manipulation;
  }

  .btn.sm{
    min-height:40px;
  }

  /* الرئيسية */
  .feature-grid{
    grid-template-columns:1fr 1fr!important;
    gap:.5rem;
  }

  .stat-card{
    min-width:0;
    min-height:94px;
    padding:.68rem;
    border-radius:14px;
  }

  .stat-card .stat-value{
    font-size:1.18rem;
  }

  .stat-card .stat-label{
    font-size:.68rem;
  }

  .feature-cols{
    grid-template-columns:1fr!important;
    gap:.65rem;
  }

  .dashboard-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:.45rem;
  }

  /* الأنشطة / المشاريع */
  .cards{
    grid-template-columns:1fr 1fr!important;
    gap:.55rem;
  }

  .card{
    min-width:0;
    min-height:140px;
    padding:.78rem;
    border-radius:14px;
  }

  .card h3{font-size:.84rem}
  .card p{font-size:.73rem;line-height:1.5}

  .projects-filter-grid,
  .projects-grid,
  .project-view-grid{
    grid-template-columns:1fr!important;
    gap:.55rem;
  }

  /* الطلاب */
  .students-layout{
    grid-template-columns:1fr!important;
    gap:.65rem!important;
  }

  #studentsPage .students-list,
  #studentsPage .student-profile{
    width:100%;
    border-radius:15px!important;
  }

  .student-hero-actions{
    width:100%;
  }

  .student-hero-actions .btn{
    flex:1;
  }

  .mini-grid{
    grid-template-columns:repeat(3,1fr)!important;
    gap:.4rem;
  }

  /* التقارير */
  .report-topbar{
    width:100%;
  }

  .report-switch{
    width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(2,1fr);
    gap:.3rem;
    padding:.25rem;
    border-radius:14px;
  }

  .report-switch-btn{
    min-height:43px;
    padding:.4rem .3rem;
    border-radius:11px;
    font-size:.72rem;
  }

  .report-mode-toggle{
    width:100%;
  }

  .report-mode-toggle .an-mode{
    flex:1;
    min-height:40px;
  }

  .grades-tools{
    display:flex;
    flex-direction:column;
    align-items:stretch!important;
    gap:.45rem;
  }

  .grades-tools > *{
    width:100%;
  }

  .grades-selection{
    width:100%;
    flex-wrap:wrap;
  }

  .rep-grid,
  .rep-charts{
    grid-template-columns:1fr!important;
  }

  .rep-info{
    grid-template-columns:1fr 1fr!important;
  }

  .rep-head{
    padding:.75rem;
    gap:.45rem;
  }

  .rep-head .logo{
    width:58px;
    height:58px;
  }

  .rep-head .t b{font-size:.88rem}
  .rep-head .t span{font-size:.66rem}
  .rep-head .mid{font-size:.84rem}

  /* الجداول داخل صفحاتها فقط */
  .grades-table-wrap,
  #comp-table,
  .table-wrap,
  .table-scroll,
  .rt-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
  }

  .gt{
    width:max-content;
    min-width:680px;
  }

  .grades-pro{
    min-width:720px;
  }

  .comprehensive-table{
    min-width:900px;
  }

  .rt{
    min-width:620px;
  }

  /* الخطط العلاجية */
  .kpi-box{
    min-width:0;
  }

  .mem-grid{
    grid-template-columns:1fr!important;
    max-height:42vh;
  }

  /* رسائل الطلاب: الحفاظ على التصميم المرجعي */
  .msg-chips{
    gap:.35rem;
  }

  .msg-chip{
    min-height:44px;
    padding:.5rem .72rem;
    font-size:.82rem;
  }

  .msg-sendbar{
    flex-direction:column;
    align-items:stretch;
    gap:.45rem;
  }

  .msg-sendbar .btn{
    width:100%;
    margin:0;
    min-height:48px;
  }

  .msg-sendbar .who{
    text-align:center;
  }

  /* النوافذ */
  .veil{
    padding:.5rem;
    align-items:flex-end;
  }

  .modal{
    width:100%!important;
    max-width:none!important;
    max-height:91vh;
    padding:.85rem;
    border-radius:18px 18px 12px 12px;
  }

  .modal-foot{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:.4rem;
  }

  .modal-foot .btn{
    width:100%;
  }

  /* الإعدادات */
  #p-data .row{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  #p-data .row .btn{
    width:100%;
  }

  img,svg,video,canvas,iframe{
    max-width:100%;
  }
}

/* هواتف صغيرة */
@media screen and (max-width:460px){

  .wrap{padding-inline:.5rem}

  .feature-grid{
    gap:.42rem;
  }

  .stat-card{
    min-height:88px;
    padding:.6rem;
  }

  .cards{
    grid-template-columns:1fr!important;
  }

  .rep-info{
    grid-template-columns:1fr!important;
  }

  .modal-foot{
    grid-template-columns:1fr;
  }

  #p-data .row{
    grid-template-columns:1fr;
  }
}

/* لمس */
@media(hover:none) and (pointer:coarse){
  button,.btn,.tab,select,
  input[type="checkbox"],input[type="radio"]{
    touch-action:manipulation;
  }
}

/* ── <style id=mobile-comprehensive-reports-final> ── */

/* ===== ضبط نهائي للكشف الشامل والتقارير: سطح المكتب ===== */
@media (min-width:701px){
  #p-comprehensive .sheet-head,
  #p-grades .sheet-head,
  #p-analysis .sheet-head,
  #p-diag .sheet-head,
  #p-styles .sheet-head{gap:.65rem}
  #p-comprehensive .comp-toolbar{display:grid;grid-template-columns:minmax(180px,240px) minmax(220px,320px) 1fr;align-items:center}
  #p-comprehensive #comp-table{overflow:visible}
  #p-comprehensive .comprehensive-table{min-width:980px}
  #p-grades .grades-table-wrap{max-width:100%;overflow:auto}
  #p-analysis .rep-charts{grid-template-columns:1fr 1fr}
  #p-analysis #an-body,
  #p-diag #dg-body,
  #p-styles #sty-body{min-width:0}
}

/* ===== الهاتف: الكشف الشامل ===== */
@media screen and (max-width:700px){
  #p-comprehensive .sheet-head,
  #p-grades .sheet-head,
  #p-analysis .sheet-head,
  #p-diag .sheet-head,
  #p-styles .sheet-head{
    display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;
  }
  #p-comprehensive .sheet-head h2,
  #p-grades .sheet-head h2,
  #p-analysis .sheet-head h2,
  #p-diag .sheet-head h2,
  #p-styles .sheet-head h2{font-size:1rem;flex:1 1 100%;}
  #p-comprehensive .sheet-head .btn,
  #p-grades .sheet-head .btn,
  #p-analysis .sheet-head .btn,
  #p-diag .sheet-head .btn,
  #p-styles .sheet-head .btn{flex:1;min-width:0;min-height:42px}

  #p-comprehensive .comp-toolbar{display:grid;grid-template-columns:1fr;gap:.55rem;margin:.7rem 0!important}
  #p-comprehensive .comp-toolbar .inp{max-width:none!important;width:100%;min-width:0;min-height:44px}
  #p-comprehensive #comp-state{font-size:.72rem;line-height:1.7}
  #p-comprehensive #comp-table{margin-inline:-.15rem;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;border-radius:14px;padding-bottom:.25rem}
  #p-comprehensive .comp-report{min-width:0}
  #p-comprehensive .comp-report .rep-page{min-width:760px;border-radius:12px;box-shadow:none}
  #p-comprehensive .rep-in{padding:.55rem}
  #p-comprehensive .rep-info{grid-template-columns:repeat(2,1fr)!important;gap:.45rem!important}
  #p-comprehensive .rep-info>div{font-size:.68rem;padding:.5rem!important}
  #p-comprehensive .rep-info b{font-size:.78rem!important}
  #p-comprehensive .rep-band{font-size:.68rem!important;line-height:1.7;padding:.45rem .6rem!important}
  #p-comprehensive .rep-sec{font-size:.78rem!important;margin:.6rem 0 .35rem!important}
  #p-comprehensive .rep-box{padding:.25rem!important}
  #p-comprehensive .comprehensive-table{min-width:760px;font-size:.72rem;table-layout:fixed}
  #p-comprehensive .comprehensive-table th{padding:.48rem .25rem;font-size:.68rem;line-height:1.35}
  #p-comprehensive .comprehensive-table td{padding:.42rem .25rem}
  #p-comprehensive .comprehensive-table .cnm{min-width:190px;width:190px}
  #p-comprehensive .comprehensive-table .cnum{width:36px;min-width:36px}
  #p-comprehensive .comprehensive-table td>b{font-size:.78rem}
  #p-comprehensive .comprehensive-table td small{font-size:.61rem}
  #p-comprehensive .comprehensive-table td em{font-size:.58rem;white-space:normal;line-height:1.35}
  #p-comprehensive .comp-summary-note{font-size:.66rem;line-height:1.7;text-align:start}

  /* ===== الهاتف: شريط التقارير ===== */
  #p-grades .report-switch,
  #p-analysis .report-switch,
  #p-diag .report-switch,
  #p-styles .report-switch{
    width:100%;display:grid;grid-template-columns:1fr 1fr;border-radius:14px;gap:.25rem;padding:.25rem;
  }
  #p-grades .report-switch-btn,
  #p-analysis .report-switch-btn,
  #p-diag .report-switch-btn,
  #p-styles .report-switch-btn{
    min-height:44px;font-size:.7rem;padding:.35rem .25rem;border-radius:10px;line-height:1.25;
  }

  /* ===== كشف الدرجات ===== */
  #p-grades .sheet{padding:.65rem!important}
  #p-grades .sheet .row{display:grid;grid-template-columns:1fr 1fr;gap:.5rem!important}
  #p-grades .sheet .row>label{font-size:.7rem!important;align-self:end}
  #p-grades .sheet .row>.inp{width:100%!important;min-width:0!important;max-width:none!important;grid-column:span 1}
  #p-grades #g-search{grid-column:1 / -1!important}
  #p-grades #g-summary{grid-column:1 / -1;text-align:center;min-height:38px;display:flex;align-items:center;justify-content:center}
  #p-grades #g-table{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:12px}
  #p-grades .grades-table-wrap{overflow:visible;min-width:900px}
  #p-grades .grades-pro{font-size:.7rem}
  #p-grades .grades-pro th,#p-grades .grades-pro td{padding:.42rem .32rem}
  #p-grades .g-student-head,#p-grades .g-student{min-width:165px}
  #p-grades .g-hw-head{max-width:95px}
  #p-grades .grades-legend{justify-content:flex-start;font-size:.65rem;gap:.55rem}

  /* ===== تحليل النتائج ===== */
  #p-analysis .sheet-head .btn{flex:1 1 calc(50% - .25rem)}
  #p-analysis .sheet#rep-cfg{padding:.65rem!important}
  #p-analysis #rep-cfg .grid2{grid-template-columns:1fr!important}
  #p-analysis #rep-cfg .field{min-width:0}
  #p-analysis .row.no-print{display:grid;grid-template-columns:1fr 1fr;gap:.45rem!important}
  #p-analysis .row.no-print>label{font-size:.7rem!important;align-self:end}
  #p-analysis .row.no-print>.inp{width:100%!important;min-width:0!important}
  #p-analysis .row.no-print>.spacer{display:none}
  #p-analysis .row.no-print>div[style*="border-radius:999px"]{grid-column:1 / -1;justify-content:center;width:100%}
  #p-analysis .rep-charts{grid-template-columns:1fr!important;gap:.65rem}
  #p-analysis .bars{height:125px;gap:.3rem}
  #p-analysis .bars .b i{max-width:34px}
  #p-analysis .hb{font-size:.7rem;gap:.35rem}
  #p-analysis .hb .nm{width:105px}

  /* ===== التشخيصي ===== */
  #p-diag .sheet.no-print{padding:.65rem!important}
  #p-diag .sheet.no-print .row{display:grid;grid-template-columns:1fr 1fr;gap:.45rem!important}
  #p-diag .sheet.no-print .row label{font-size:.7rem!important;align-self:end}
  #p-diag .sheet.no-print .inp{width:100%!important;min-width:0!important}
  #p-diag .report-mode-toggle{width:100%;display:grid;grid-template-columns:1fr 1fr}
  #p-diag .report-mode-toggle .diag-mode{min-height:42px}
  #p-diag #dg-body{min-width:0}
  #p-diag .diag-student-item{grid-template-columns:28px minmax(0,1fr) 48px;gap:.4rem;padding:.45rem;min-height:48px}
  #p-diag .diag-student-item .btn{grid-column:2 / -1;justify-self:stretch;min-height:38px}
  #p-diag .diag-student-main b{font-size:.74rem}
  #p-diag .diag-student-main small{font-size:.6rem}

  /* ===== أنماط التعلم ===== */
  #p-styles .sheet.no-print{padding:.65rem!important}
  #p-styles .sheet.no-print .row{display:grid;grid-template-columns:1fr 1fr;gap:.45rem!important}
  #p-styles .sheet.no-print .row label{font-size:.7rem!important;align-self:end}
  #p-styles .sheet.no-print .inp{width:100%!important;min-width:0!important}
  #p-styles .report-mode-toggle{width:100%;display:grid;grid-template-columns:1fr 1fr}
  #p-styles .report-mode-toggle .styles-mode{min-height:42px}
  #p-styles #sty-body{min-width:0}
}

@media screen and (max-width:460px){
  #p-comprehensive .sheet-head .btn,
  #p-grades .sheet-head .btn,
  #p-analysis .sheet-head .btn,
  #p-diag .sheet-head .btn,
  #p-styles .sheet-head .btn{font-size:.74rem;padding-inline:.45rem}
  #p-comprehensive .comp-report .rep-page{min-width:720px}
  #p-comprehensive .comprehensive-table{min-width:720px}
  #p-comprehensive .comprehensive-table .cnm{min-width:175px;width:175px}
  #p-grades .grades-table-wrap{min-width:820px}
  #p-analysis .hb .nm{width:92px}
}

/* اللمس على الهاتف: لا نسمح بتصغير الأزرار حتى تصبح لعبة دقة بدلاً من واجهة */
@media (hover:none) and (pointer:coarse){
  #p-comprehensive button,#p-grades button,#p-analysis button,#p-diag button,#p-styles button,
  #p-comprehensive select,#p-comprehensive input,#p-grades select,#p-grades input,
  #p-analysis select,#p-analysis input,#p-diag select,#p-diag input,#p-styles select,#p-styles input{
    min-height:42px;
  }
}

/* ── <style id=dashboard-mobile-final> ── */

/* ===== لوحة التحكم: تحسين مخصص دون تغيير منطق البيانات ===== */

/* PC: إبراز الإجراءات الأساسية وترتيب منطقة الملخص */
@media (min-width:701px){
  #p-dashboard > .sheet-head{
    padding-bottom:.25rem;
    border-bottom:1px solid var(--rule);
  }
  #p-dashboard .dashboard-actions{
    display:flex;
    gap:.55rem;
    margin:-.25rem 0 .9rem;
  }
  #p-dashboard .dashboard-actions .btn{
    min-width:120px;
  }
  #p-dashboard .feature-cols{
    align-items:stretch;
  }
  #p-dashboard .alerts-sheet{
    min-width:0;
  }
}

/* Mobile: لوحة تشغيل سريعة بدل تصغير نسخة PC */
@media screen and (max-width:700px){
  #p-dashboard{
    --dash-gap:.65rem;
  }

  #p-dashboard > .sheet-head{
    position:sticky;
    top:0;
    z-index:4;
    margin:0 -.2rem .75rem;
    padding:.65rem .2rem .7rem;
    background:var(--paper);
    border-bottom:1px solid var(--rule);
  }

  #p-dashboard > .sheet-head h2{
    font-size:1.08rem;
  }

  #p-dashboard > .sheet-head .sub{
    font-size:.75rem;
  }

  #p-dashboard > .sheet-head .spacer{
    display:none;
  }

  #p-dashboard > .sheet-head .btn{
    min-height:42px;
  }

  /* أزرار الإجراءات في صفين متوازنين */
  #p-dashboard .dashboard-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:var(--dash-gap);
    margin:.1rem 0 .75rem;
  }

  #p-dashboard .dashboard-actions .btn{
    min-height:44px;
    width:100%;
    padding:.55rem .65rem;
  }

  /* الإحصائيات */
  #p-dashboard .feature-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:var(--dash-gap);
    margin-bottom:.75rem;
  }

  #p-dashboard .feature-grid > *{
    min-width:0;
  }

  /* البطاقات الرئيسية */
  #p-dashboard .sheet{
    border-radius:12px;
    padding:.8rem;
  }

  #p-dashboard .feature-cols{
    display:flex;
    flex-direction:column;
    gap:var(--dash-gap);
  }

  #p-dashboard .feature-cols > .sheet{
    margin:0 !important;
  }

  /* قسم يحتاج انتباهك */
  #p-dashboard .alert-section-head{
    align-items:flex-start;
    gap:.45rem;
    flex-wrap:wrap;
  }

  #p-dashboard .alert-section-title{
    min-width:0;
    flex:1;
  }

  #p-dashboard .alert-summary{
    width:100%;
    font-size:.76rem;
  }

  #p-dashboard .alert{
    padding:.72rem;
  }

  #p-dashboard .alert-title-row{
    gap:.45rem;
    align-items:flex-start;
  }

  #p-dashboard .alert-title-wrap{
    min-width:0;
    flex:1;
  }

  #p-dashboard .alert-title-wrap b{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  /* لا نغرق المستخدم بالتفاصيل من البداية */
  #p-dashboard .alert-summary-card .alert-students{
    display:none;
  }

  #p-dashboard .alert-kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:.35rem;
  }

  #p-dashboard .alert-kpis > div{
    min-width:0;
    padding:.42rem .2rem;
  }

  #p-dashboard .alert-kpis b{
    font-size:1rem;
  }

  #p-dashboard .alert-kpis span{
    font-size:.66rem;
    line-height:1.3;
  }

  #p-dashboard .alert-progress{
    margin-top:.55rem;
  }

  #p-dashboard .alert-footer{
    display:grid;
    grid-template-columns:1fr;
    gap:.4rem;
    margin-top:.55rem;
  }

  #p-dashboard .alert-main-action,
  #p-dashboard .alert-dismiss-mobile{
    width:100%;
    min-height:42px;
  }

  #p-dashboard .alert-dismiss{
    display:none;
  }

  #p-dashboard .alert-dismiss-mobile{
    display:block;
  }

  /* آخر التسليمات: صفوف مضغوطة */
  #p-dashboard #dash-recent .feature-item,
  #p-dashboard #dash-followup-students .feature-item{
    min-width:0;
  }

  /* الاقتراحات وحالة الأنشطة */
  #p-dashboard .section-title{
    align-items:flex-start;
    gap:.4rem;
  }

  #p-dashboard .section-title span{
    font-size:.72rem;
  }

  #p-dashboard .feature-list{
    min-width:0;
  }

  /* تقليل الفراغات الرأسية المتراكمة */
  #p-dashboard > .sheet[style*="margin-top"]{
    margin-top:.65rem !important;
  }
}

/* شاشات الآيفون الصغيرة */
@media screen and (max-width:460px){
  #p-dashboard .feature-grid{
    gap:.5rem;
  }

  #p-dashboard .dashboard-actions{
    gap:.5rem;
  }

  #p-dashboard .sheet{
    padding:.7rem;
  }

  #p-dashboard .alert{
    padding:.65rem;
  }

  #p-dashboard .alert-kpis b{
    font-size:.95rem;
  }

  #p-dashboard .alert-kpis span{
    font-size:.62rem;
  }
}

/* أجهزة اللمس */
@media (hover:none) and (pointer:coarse){
  #p-dashboard button{
    touch-action:manipulation;
  }
}

/* ── <style id=dashboard-actions-cleanup> ── */

/* لوحة التحكم: ترتيب أزرار الرأس */
#p-dashboard > .sheet-head{
  display:flex;
  align-items:center;
  gap:.6rem;
}
#p-dashboard > .sheet-head > .spacer{
  flex:1 1 auto;
}
#p-dashboard > .sheet-head > .btn{
  flex:0 0 auto;
  white-space:nowrap;
  min-width:110px;
}
@media screen and (max-width:700px){
  #p-dashboard > .sheet-head{
    gap:.5rem;
  }
  #p-dashboard > .sheet-head > .btn{
    min-width:0;
    min-height:44px;
    padding:.55rem .8rem;
  }
}
@media screen and (max-width:460px){
  #p-dashboard > .sheet-head{
    gap:.4rem;
  }
  #p-dashboard > .sheet-head > .btn{
    padding:.5rem .65rem;
    font-size:.88rem;
  }
}

/* ── <style id=student-search-enhancement> ── */

/* بحث الطالب: تحويله من قائمة أسماء إلى مركز بحث سريع */
.student-search-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) 190px;
  gap:10px;
  align-items:start;
  margin-bottom:10px;
}
.student-class-picker{position:relative;z-index:30}
.student-class-trigger{
  width:100%;
  min-height:46px;
  cursor:pointer;
  font-weight:800;
  text-align:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  white-space:nowrap;
  overflow:hidden;
}
.student-class-chevron{font-size:20px;line-height:1}
.student-class-menu{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  left:0;
  max-height:280px;
  overflow:auto;
  padding:6px;
  border:1px solid var(--line,#cbd5e1);
  border-radius:16px;
  background:var(--panel,#fff);
  box-shadow:0 14px 35px rgba(15,23,42,.18);
}
.student-class-option{
  display:block;
  width:100%;
  min-height:44px;
  padding:9px 12px;
  margin:2px 0;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--ink,#17243a);
  font:inherit;
  font-weight:700;
  text-align:right;
  cursor:pointer;
}
.student-class-option.active{background:var(--navy,#17243a);color:#fff}
@media screen and (max-width:640px){
  .student-search-controls{
    grid-template-columns:1fr;
    gap:8px;
  }
  .student-class-menu{max-height:240px}
}
.student-search-filters{
  display:flex;
  gap:.45rem;
  flex-wrap:wrap;
  margin:-.15rem 0 .75rem;
}
.search-filter{
  border:1px solid var(--rule);
  background:var(--paper-2);
  color:var(--ink);
  border-radius:999px;
  padding:.42rem .72rem;
  cursor:pointer;
  font:inherit;
  font-size:.78rem;
}
.search-filter.on{
  background:var(--ink);
  color:var(--paper);
  border-color:var(--ink);
}
.student-search-card{
  border:1px solid var(--rule);
  border-radius:14px;
  padding:.65rem;
  margin-bottom:.5rem;
  background:var(--paper);
}
.student-search-main{
  display:flex;
  align-items:flex-start;
  gap:.65rem;
  cursor:pointer;
}
.student-search-main .avatar{
  flex:0 0 auto;
  width:40px;
  height:40px;
  font-size:.78rem;
}
.student-search-kpis{
  display:flex;
  gap:.45rem;
  flex-wrap:wrap;
  margin-top:.3rem;
  font-size:.72rem;
  color:var(--ink-soft);
}
.student-search-actions{
  display:flex;
  gap:.45rem;
  margin-top:.55rem;
  padding-top:.5rem;
  border-top:1px solid var(--rule);
}
.student-search-actions .btn{
  flex:1 1 0;
  min-height:38px;
}
.student-search-hint{
  font-size:.72rem;
  color:var(--ink-soft);
  margin-top:.35rem;
}
@media screen and (max-width:700px){
  .student-search-filters{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .search-filter{
    min-height:42px;
    padding:.4rem .35rem;
    line-height:1.2;
  }
  .student-search-card{
    padding:.6rem;
  }
  .student-search-kpis{
    gap:.35rem .55rem;
  }
  .student-search-actions .btn{
    min-height:44px;
  }
}
@media screen and (max-width:460px){
  .student-search-filters{
    grid-template-columns:1fr 1fr;
  }
  .search-filter:first-child{
    grid-column:1 / -1;
  }
  .student-search-actions{
    flex-direction:column;
  }
  .student-search-actions .btn{
    width:100%;
  }
}

/* ── <style id=mobile-pass-v1> ── */

/* 📱 مرور شامل على الجوال — موضوع في نهاية أنماط الرأس عمدًا:
   الملف مليء بقواعد !important متأخرة، وأي قاعدة تُكتب قبلها تُهزم.
   و«screen» شرط لازم: بدونها تنطبق هذه القواعد أثناء الطباعة من الجوال
   فتخرج الورقة مختلفة عن ورقة الكمبيوتر — وهو ما لا نريده. */
@media screen and (max-width:700px){

  /* أشرطة الأدوات: عمود واحد وعناصر بعرض كامل بدل انضغاطها */
  .comp-toolbar,.projects-filter-grid,.students-filters,
  .msg-student-search-row,.msg-sendbar{
    display:grid!important;grid-template-columns:1fr!important;gap:.5rem!important
  }
  .comp-toolbar>*,.projects-filter-grid>*,.students-filters>*,
  .msg-student-search-row>*{max-width:100%!important;width:100%!important}

  /* عناوين اللوحات: العنوان سطر والأزرار سطر */
  .sheet-head{display:flex!important;flex-wrap:wrap!important;gap:.5rem!important;align-items:center}
  .sheet-head h2{font-size:1rem!important;flex:1 1 100%}
  .sheet-head .spacer{display:none!important}
  .sheet-head .btn{flex:1 1 auto;min-height:42px}

  /* شريط أقسام التقارير: شرائح تُمرَّر أفقيًا بدل تكدّسها */
  .report-switch{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;
    gap:.35rem!important;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .report-switch::-webkit-scrollbar{display:none}
  .report-switch-btn{flex:0 0 auto!important;white-space:nowrap;padding:.42rem .7rem!important;font-size:.78rem!important}

  /* الجداول: تمرير أفقي مع تثبيت عمود الاسم فلا تضيع هوية الصف */
  #comp-table,#wk-table,#ca-body,.grades-table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .comprehensive-table{min-width:640px!important;font-size:.72rem!important}
  .comprehensive-table th,.comprehensive-table td{padding:.34rem .28rem!important}
  .comprehensive-table .cnm{min-width:150px!important;position:sticky;inset-inline-start:0;z-index:2;
    background:#fff;box-shadow:1px 0 0 rgba(0,0,0,.08)}
  .comprehensive-table thead .cnm{z-index:3;background:#16233A;color:#fff}
  .comprehensive-table .cnum{min-width:28px!important}
  .grades-table-wrap{min-width:0!important}

  /* الكشوف على الجوال: نفس تخطيط الكمبيوتر مصغَّرًا — لا إعادة ترتيب.
     المقياس يُحسب بالجافاسكربت حسب عرض الشاشة (fitReportsToWidth). */
  .comprehensive-table .cnm{position:static!important;box-shadow:none!important}
  #comp-table,#wk-table,#ca-body,#an-body,.grades-table-wrap{overflow-x:hidden!important}
  /* الرسوم والشبكات: عمود واحد */
  .rep-charts,.rep-grid,.rep-info{grid-template-columns:1fr!important}
  .donut{width:110px;height:110px;flex:0 0 110px}
  .projects-grid{grid-template-columns:1fr!important}
}

/* 📏 الكشف الأسبوعي على الشاشة: الاسم سطر واحد، وبقية الأعمدة بعرض محتواها.
   «screen» شرط لازم — قواعد الطباعة تكسر الأسماء على أسطر عمدًا لتتّسع A4،
   ولا نريد لمسها. */
@media screen{
  #wk-table .comprehensive-table{table-layout:auto!important}
  #wk-table .comprehensive-table th,
  #wk-table .comprehensive-table td{white-space:nowrap!important}
  #wk-table .comprehensive-table .cnm{
    width:auto!important;min-width:0!important;max-width:none!important;
    white-space:nowrap!important;overflow:visible!important}
  #wk-table .comprehensive-table th:not(.cnm),
  #wk-table .comprehensive-table td:not(.cnm){
    width:1%!important;padding-inline:.32rem!important}
  #wk-table .comprehensive-table .cnum{width:1%!important;padding-inline:.25rem!important}
  #wk-table .wk-beh span{margin:0 .5px}
}

/* ── <style id=weekly-report-readability-clean> ── */

/* تنظيف الكشف الأسبوعي: بيانات مختصرة بدون ملاحظات تفسيرية، ومسافات عربية مريحة. */
#wk-table .rep-page{direction:rtl;}
#wk-table .rep-head h1,#wk-table .rep-head h2,#wk-table .rep-info,#wk-table .rep-band,#wk-table .rep-sec,#wk-table .comprehensive-table{
  line-height:1.65;
  word-spacing:.12em;
}
#wk-table .rep-info{gap:.65rem;}
#wk-table .rep-info > div{display:flex;flex-direction:column;gap:.25rem;align-items:center;justify-content:center;min-height:56px;line-height:1.55;white-space:normal;}
#wk-table .rep-info b{display:block;line-height:1.55;word-spacing:.08em;}
#wk-table .rep-band{padding:.55rem .75rem;line-height:1.8;white-space:normal;}
#wk-table .comprehensive-table th,#wk-table .comprehensive-table td{line-height:1.55;word-spacing:.08em;}
#wk-table .wk-legend{line-height:1.8;word-spacing:.08em;margin-top:.65rem;}

/* ── <style id=three-reports-a4-print-unified> ── */

/* 🖨️ طباعة موحدة للكشوف الثلاثة فقط:
   1) الكشف الأسبوعي  2) الكشف الشامل  3) كشف الدرجات
   لا تعتمد على تخطيط الشاشة أو zoom أو overflow الخاص بالجوال. */
@media print{
  body.printing-weekly,
  body.printing-comprehensive,
  body.printing-grades{
    background:#fff !important;
    margin:0 !important;
    padding:0 !important;
    width:auto !important;
    min-width:0 !important;
    overflow:visible !important;
    -webkit-print-color-adjust:exact !important;
    print-color-adjust:exact !important;
  }

  /* إظهار تقرير واحد فقط بدل ترك قشرة التطبيق في تدفق الصفحة. */
  body.printing-weekly > header,
  body.printing-comprehensive > header,
  body.printing-grades > header,
  body.printing-weekly > #toast,
  body.printing-comprehensive > #toast,
  body.printing-grades > #toast,
  body.printing-weekly > .veil,
  body.printing-comprehensive > .veil,
  body.printing-grades > .veil{display:none !important;}

  body.printing-weekly .panel:not(#p-weekly),
  body.printing-comprehensive .panel:not(#p-comprehensive),
  body.printing-grades .panel:not(#p-grades){display:none !important;}

  body.printing-weekly #p-weekly,
  body.printing-comprehensive #p-comprehensive,
  body.printing-grades #p-grades{
    display:block !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
  }

  body.printing-weekly #p-weekly > :not(#wk-table),
  body.printing-comprehensive #p-comprehensive > :not(#comp-table),
  body.printing-grades #p-grades > :not(#g-table){
    display:none !important;
  }

  body.printing-weekly #wk-table,
  body.printing-comprehensive #comp-table,
  body.printing-grades #g-table{
    display:block !important;
    position:static !important;
    inset:auto !important;
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }

  body.printing-weekly #wk-table *,
  body.printing-comprehensive #comp-table *,
  body.printing-grades #g-table *{
    box-sizing:border-box !important;
  }

  /* الصفحة نفسها لا تجبر المتصفح على إنشاء صفحة بيضاء قبل الجدول. */
  body.printing-weekly .rep-page,
  body.printing-comprehensive .rep-page{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    box-shadow:none !important;
    border:0 !important;
    border-radius:0 !important;
  }

  /* ===================== الكشف الأسبوعي ===================== */
  body.printing-weekly .comprehensive-table{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    font-size:8pt !important;
  }
  body.printing-weekly .comprehensive-table th,
  body.printing-weekly .comprehensive-table td{
    padding:3.2px 2.5px !important;
    line-height:1.25 !important;
    word-break:break-word !important;
    white-space:normal !important;
    vertical-align:middle !important;
  }
  body.printing-weekly .comprehensive-table th:nth-child(1),
  body.printing-weekly .comprehensive-table td:nth-child(1){width:4% !important;}
  body.printing-weekly .comprehensive-table th:nth-child(2),
  body.printing-weekly .comprehensive-table td:nth-child(2){width:25% !important;text-align:right !important;}
  body.printing-weekly .comprehensive-table th:nth-child(3),
  body.printing-weekly .comprehensive-table td:nth-child(3),
  body.printing-weekly .comprehensive-table th:nth-child(4),
  body.printing-weekly .comprehensive-table td:nth-child(4),
  body.printing-weekly .comprehensive-table th:nth-child(5),
  body.printing-weekly .comprehensive-table td:nth-child(5),
  body.printing-weekly .comprehensive-table th:nth-child(6),
  body.printing-weekly .comprehensive-table td:nth-child(6),
  body.printing-weekly .comprehensive-table th:nth-child(7),
  body.printing-weekly .comprehensive-table td:nth-child(7),
  body.printing-weekly .comprehensive-table th:nth-child(8),
  body.printing-weekly .comprehensive-table td:nth-child(8){width:7% !important;}
  body.printing-weekly .comprehensive-table th:nth-child(9),
  body.printing-weekly .comprehensive-table td:nth-child(9){width:18% !important;}
  body.printing-weekly .comprehensive-table th:nth-child(10),
  body.printing-weekly .comprehensive-table td:nth-child(10){width:10% !important;}

  body.printing-weekly .rep-head{position:relative !important;break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-weekly .rep-info{grid-template-columns:repeat(4,1fr) !important;break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-weekly .rep-band{break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-weekly .rep-sec{break-after:avoid !important;page-break-after:avoid !important;}
  body.printing-weekly .rep-box{break-inside:auto !important;page-break-inside:auto !important;overflow:visible !important;}
  body.printing-weekly .comprehensive-table thead{display:table-header-group !important;}
  body.printing-weekly .comprehensive-table tbody{display:table-row-group !important;}
  body.printing-weekly .comprehensive-table tfoot{display:table-footer-group !important;}
  body.printing-weekly .comprehensive-table tbody tr{break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-weekly .wk-legend,
  body.printing-weekly .comp-summary-note,
  body.printing-weekly .rep-foot{
    font-size:7pt !important;
  }

  /* ===================== الكشف الشامل ===================== */
  body.printing-comprehensive .comprehensive-table{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    font-size:8.2pt !important;
  }
  body.printing-comprehensive .comprehensive-table th,
  body.printing-comprehensive .comprehensive-table td{
    padding:3.5px 3px !important;
    line-height:1.22 !important;
    word-break:break-word !important;
    white-space:normal !important;
    vertical-align:middle !important;
  }
  body.printing-comprehensive .comprehensive-table th:nth-child(1),
  body.printing-comprehensive .comprehensive-table td:nth-child(1){width:4% !important;}
  body.printing-comprehensive .comprehensive-table th:nth-child(2),
  body.printing-comprehensive .comprehensive-table td:nth-child(2){width:28% !important;text-align:right !important;}
  body.printing-comprehensive .comprehensive-table th:nth-child(n+3),
  body.printing-comprehensive .comprehensive-table td:nth-child(n+3){width:17% !important;}
  body.printing-comprehensive .comprehensive-table thead{display:table-header-group !important;}
  body.printing-comprehensive .comprehensive-table tbody{display:table-row-group !important;}
  body.printing-comprehensive .comprehensive-table tfoot{display:table-footer-group !important;}
  body.printing-comprehensive .comprehensive-table tbody tr{break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-comprehensive .rep-head,
  body.printing-comprehensive .rep-band,
  body.printing-comprehensive .rep-sec,
  body.printing-comprehensive .rep-info{
    break-inside:avoid !important;page-break-inside:avoid !important;
  }
  body.printing-comprehensive .rep-box{break-inside:auto !important;page-break-inside:auto !important;overflow:visible !important;}

  /* ===================== كشف الدرجات ===================== */
  body.printing-grades .grades-kpis{
    grid-template-columns:repeat(5,1fr) !important;
    gap:5px !important;
    margin:0 0 6px !important;
  }
  body.printing-grades .grades-kpi{
    padding:5px 6px !important;
    border-radius:8px !important;
    box-shadow:none !important;
    min-height:0 !important;
  }
  body.printing-grades .grades-kpi span{font-size:7pt !important;}
  body.printing-grades .grades-kpi b{font-size:11pt !important;}
  body.printing-grades .grades-kpi small{font-size:6.5pt !important;}
  body.printing-grades .grades-tools,
  body.printing-grades .grades-legend{display:none !important;}
  body.printing-grades .grades-table-wrap{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    overflow:visible !important;
    border-radius:0 !important;
  }
  body.printing-grades .grades-pro{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    table-layout:fixed !important;
    border-collapse:collapse !important;
    font-size:7.7pt !important;
  }
  body.printing-grades .grades-pro th,
  body.printing-grades .grades-pro td{
    padding:3px 3px !important;
    line-height:1.2 !important;
    white-space:normal !important;
    word-break:break-word !important;
    vertical-align:middle !important;
  }
  body.printing-grades .grades-pro .g-student-head,
  body.printing-grades .grades-pro .g-student{
    position:static !important;
    inset:auto !important;
    min-width:0 !important;
    width:24% !important;
    box-shadow:none !important;
  }
  body.printing-grades .grades-pro .gcell{position:static !important;min-width:0 !important;}
  body.printing-grades .grades-pro th:first-child,
  body.printing-grades .grades-pro td:first-child{width:4% !important;}
  body.printing-grades .grades-pro thead{display:table-header-group !important;}
  body.printing-grades .grades-pro tbody{display:table-row-group !important;}
  body.printing-grades .grades-pro tfoot{display:table-footer-group !important;}
  body.printing-grades .grades-pro tbody tr{break-inside:avoid !important;page-break-inside:avoid !important;}
  body.printing-grades .g-student b{font-size:8.2pt !important;}
  body.printing-grades .g-student small,
  body.printing-grades .gcell small,
  body.printing-grades .g-total small,
  body.printing-grades .g-pct small,
  body.printing-grades .g-done small,
  body.printing-grades .g-last small{font-size:6.3pt !important;}
  body.printing-grades .gcell em{position:static !important;font-size:6pt !important;}
}

/* ── <style id=comprehensive-screen-readability-fix> ── */

/* تحسين قراءة الكشف الشامل على الشاشة: فصل عنوان الحقل عن قيمته ومنع تلاصق الكلمات. */
#comp-table .rep-info{
  align-items:stretch;
  gap:.65rem;
}
#comp-table .rep-info > div{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.28rem;
  min-height:56px;
  line-height:1.55;
  white-space:normal;
}
#comp-table .rep-info > div::first-line{line-height:1.4}
#comp-table .rep-info b{
  display:block;
  margin-top:.05rem;
  line-height:1.5;
  letter-spacing:0;
  word-spacing:.08em;
}
#comp-table .rep-band{
  line-height:1.7;
  word-spacing:.08em;
}
#comp-table .rep-sec{
  line-height:1.6;
  letter-spacing:0;
  word-spacing:.06em;
}
#comp-table .comprehensive-table th,
#comp-table .comprehensive-table td{
  line-height:1.5;
  word-spacing:.04em;
}
#comp-table .comprehensive-table th small{
  display:block;
  margin-top:.18rem;
  line-height:1.4;
}
#comp-table .comprehensive-table td small,
#comp-table .comprehensive-table td em{
  line-height:1.45;
}
/* لا نعرض الملاحظات التفسيرية داخل الكشف النهائي. */
#comp-table .comp-summary-note{display:none!important}
@media screen and (max-width:700px){
  #comp-table .rep-info{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.5rem}
  #comp-table .rep-info > div{min-height:62px;padding:.55rem .45rem!important}
  #comp-table .rep-info b{font-size:.9rem;line-height:1.5}
}

/* ── <style id=comprehensive-print-final-fix> ── */

/* الإصدار النهائي للكشف الشامل: A4 أفقي لأن جدول أعمال السنة أعرض من A4 عمودي */
@media print{
  @page{size:A4 landscape;margin:7mm 8mm}

  body.printing-comprehensive,
  body.printing-comprehensive #comp-table{
    background:#fff !important;
  }

  body.printing-comprehensive #comp-table{
    position:absolute !important;
    inset:0 auto auto 0 !important;
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    overflow:visible !important;
  }

  body.printing-comprehensive #comp-table .rep,
  body.printing-comprehensive #comp-table .rep-page,
  body.printing-comprehensive #comp-table .rep-in{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }

  body.printing-comprehensive #comp-table .rep-page{
    box-shadow:none !important;
    border:0 !important;
    border-radius:0 !important;
    margin:0 !important;
    break-after:auto !important;
    page-break-after:auto !important;
    break-inside:auto !important;
    page-break-inside:auto !important;
  }

  /* ترويسة مختصرة حتى لا تستهلك من مساحة الطلاب */
  body.printing-comprehensive #comp-table .rep-head{
    padding:.45rem .75rem !important;
    min-height:0 !important;
    gap:.55rem !important;
  }
  body.printing-comprehensive #comp-table .rep-head .logo{
    width:58px !important;
    height:58px !important;
  }
  body.printing-comprehensive #comp-table .rep-head .t b{font-size:9.8pt !important}
  body.printing-comprehensive #comp-table .rep-head .t span{font-size:7.2pt !important}
  body.printing-comprehensive #comp-table .rep-head .mid{font-size:11pt !important}

  body.printing-comprehensive #comp-table .rep-in{
    padding:.35rem 0 !important;
  }
  body.printing-comprehensive #comp-table .rep-info{
    grid-template-columns:repeat(4,1fr) !important;
    gap:.25rem !important;
    margin-bottom:.3rem !important;
  }
  body.printing-comprehensive #comp-table .rep-info div{
    padding:.22rem .35rem !important;
    font-size:7.4pt !important;
  }
  body.printing-comprehensive #comp-table .rep-band{
    padding:.24rem .35rem !important;
    margin-bottom:.35rem !important;
    font-size:7.8pt !important;
  }
  body.printing-comprehensive #comp-table .comp-summary-note{display:none !important;}
  body.printing-comprehensive #comp-table .rep-info > div{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:1.5pt !important;
    line-height:1.45 !important;
  }
  body.printing-comprehensive #comp-table .rep-info b{
    display:block !important;
    line-height:1.45 !important;
    margin-top:1pt !important;
  }

  body.printing-comprehensive #comp-table .rep-sec{
    padding:.25rem !important;
    font-size:8.2pt !important;
    break-after:avoid !important;
    page-break-after:avoid !important;
  }
  body.printing-comprehensive #comp-table .rep-box{
    padding:.2rem !important;
    margin-bottom:.3rem !important;
    break-inside:auto !important;
    page-break-inside:auto !important;
  }

  /* الجدول: مساحة أفقية أكبر + صفوف مضغوطة وواضحة */
  body.printing-comprehensive #comp-table .comprehensive-table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
    font-size:7.2pt !important;
    border-collapse:collapse !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table th{
    padding:.22rem .18rem !important;
    font-size:7.3pt !important;
    line-height:1.15 !important;
    white-space:normal !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table td{
    padding:.18rem .16rem !important;
    font-size:7.1pt !important;
    line-height:1.12 !important;
    vertical-align:middle !important;
    word-break:normal !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table td>b{
    font-size:7.4pt !important;
    line-height:1.05 !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table td small{
    font-size:5.8pt !important;
    line-height:1.05 !important;
    margin-top:0 !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table td em{
    font-size:5.7pt !important;
    line-height:1.05 !important;
    white-space:normal !important;
    margin-top:0 !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table .cnm{
    min-width:0 !important;
    width:28% !important;
    text-align:right !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table .cnum{
    width:4% !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table tr{
    break-inside:avoid !important;
    page-break-inside:avoid !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table thead{
    display:table-header-group !important;
  }
  body.printing-comprehensive #comp-table .comprehensive-table tfoot{
    display:table-footer-group !important;
  }

  body.printing-comprehensive #comp-table .comp-summary-note{
    font-size:6.4pt !important;
    margin-top:.2rem !important;
  }
  body.printing-comprehensive #comp-table .rep-foot{
    margin-top:.3rem !important;
    gap:.35rem !important;
  }
  body.printing-comprehensive #comp-table .rep-foot div{
    padding:.2rem !important;
    font-size:6.8pt !important;
  }
}
/* ⏰ وقت ظهور الإعلان */
.ann-when{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:.5rem}
.ann-when label,.ann-edit label{display:flex;flex-direction:column;gap:.2rem;font-size:.8rem;color:var(--ink-soft)}
.ann-when small{font-size:.72rem;color:var(--ink-soft)}
.ann-quick{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;margin-top:.45rem;font-size:.8rem;color:var(--ink-soft)}
.ann-quick button{border:1px solid var(--ui-border,#e5e7eb);background:var(--ui-surface,#fff);border-radius:999px;padding:.25rem .7rem;font:inherit;font-size:.78rem;cursor:pointer;color:var(--ink)}
.ann-quick button.on{background:#1F2D45;color:#fff;border-color:#1F2D45}
.ann-st{display:inline-block;font-size:.76rem;font-weight:700;border-radius:8px;padding:.15rem .5rem;margin:.25rem 0 .15rem}
.ann-st.on{background:#E3F5EC;color:#167852}.ann-st.soon{background:#FEF3C7;color:#92400E}.ann-st.off{background:#EEF2F7;color:#5A6B84}
.ann-row.off{opacity:.75}
.ann-acts{display:flex;flex-direction:column;gap:.3rem;flex:none}
.ann-edit{display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end;margin-top:.5rem}.ann-edit.hide{display:none}
@media (max-width:640px){.ann-row{flex-wrap:wrap}.ann-acts{flex-direction:row;flex-wrap:wrap}}


/* 📊 يدخل في درجة الأنشطة / 🎯 تدريب */
.pill.hw-gr{background:#EFF3F8;color:var(--ink-soft);border:1px dashed rgba(91,107,127,.35);font:inherit;font-size:.78rem;cursor:default}
button.pill.hw-gr{cursor:pointer}
.pill.hw-gr.on{background:rgba(46,107,184,.12);color:#2E6BB8;border:1px solid rgba(46,107,184,.3);font-weight:700}
:root[data-ui-theme="dark"] .pill.hw-gr{background:rgba(255,255,255,.06);color:#A9B6C6}
:root[data-ui-theme="dark"] .pill.hw-gr.on{background:rgba(110,160,230,.18);color:#9CC2F5}
.pf-gr{margin:.2rem 0 .8rem;padding:.65rem .8rem;border:1px solid var(--rule);border-radius:12px;background:rgba(46,107,184,.05)}
.pf-gr b.pf-gr-n{color:#2E6BB8}
.pf-gr .pf-gr-miss{margin-top:.35rem;font-size:.82rem;color:var(--pen)}

/* ⏰ موعد المهمة العلاجية + فتحها للطالب */
.ar-rec{grid-template-columns:1fr auto auto auto}
.rem-due-box{display:inline-flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.rem-due{font-size:.78rem;color:var(--ink-soft);white-space:nowrap}
.rem-due.late{color:var(--pen);font-weight:700}
.rem-ext{padding:.2rem .6rem!important;font-size:.76rem!important;min-height:0!important}
@media (max-width:640px){ .ar-rec{grid-template-columns:1fr auto} .ar-rec .rem-due-box{grid-column:1/-1} }

/* 📈 «بعد الخطة» في جدول الفجوات */
.sk-after{display:inline-block;padding:.05rem .45rem;border-radius:999px;font-size:.76rem;font-weight:700;white-space:nowrap;background:rgba(200,138,46,.13);color:#A66F0A}
.sk-after.ok{background:rgba(27,156,107,.14);color:var(--tick)}
.sk-after.bad{background:rgba(214,69,91,.12);color:var(--pen)}
.sk-af{white-space:nowrap}
.sk-af-note{margin-top:.45rem;padding:.5rem .65rem;border-radius:10px;background:rgba(46,107,184,.07);font-size:.78rem;line-height:1.8;color:var(--ink-soft)}
.pc-goal.rem{border-style:dashed;border-color:#1E8A5C;color:#1E8A5C}.pc-goal.rem.no{border-color:#C88A2E;color:inherit}

/* 📈 مسار الخطة */
.pl-tl{margin:.2rem 0 .7rem}
.pl-cmp{overflow-x:auto;margin:.35rem 0 .5rem}
.pl-cmp table{width:100%;border-collapse:collapse;font-size:.8rem}
.pl-cmp th{font-weight:600;color:var(--ink-soft);text-align:start;padding:.3rem .35rem;border-bottom:1px solid var(--ui-border);white-space:nowrap}
.pl-cmp td{padding:.3rem .35rem;border-bottom:1px solid var(--ui-border);vertical-align:middle}
.pl-cmp b.up{color:var(--tick)}.pl-cmp b.down{color:var(--pen)}
.pl-ev{list-style:none;margin:.3rem 0;padding:0;border-inline-start:2px solid var(--ui-border)}
.pl-ev li{display:grid;grid-template-columns:78px 22px 1fr;gap:.35rem;align-items:start;padding:.28rem .5rem;font-size:.8rem;position:relative}
.pl-ev li small{display:block;color:var(--ink-soft);font-size:.74rem;margin-top:.1rem}
.pl-ev .pl-d{color:var(--ink-soft);font-size:.74rem;white-space:nowrap;padding-top:.1rem}
.pl-ev li.ok{background:rgba(27,156,107,.06)}.pl-ev li.meas{background:rgba(46,107,184,.06)}.pl-ev li.end{background:rgba(27,156,107,.1);font-weight:600}
.pl-next{margin-top:.35rem;padding:.45rem .6rem;border-radius:10px;background:rgba(200,138,46,.1);font-size:.8rem}
.pc-basis{margin:.35rem 0 0;padding:.4rem .6rem;border-radius:10px;background:rgba(46,107,184,.07);font-size:.76rem;color:var(--ink-soft);line-height:1.7}
@media (max-width:640px){ .pl-ev li{grid-template-columns:64px 20px 1fr} }
.pl-cmp td.pl-src{font-size:.74rem;color:var(--ink-soft);line-height:1.6}

/* 📝 اختبارات الخطة: أسماؤها وتواريخها، وما لم يُحتسب لغياب تاريخه */
.plan-exam-l{flex-basis:100%;display:grid;gap:.15rem;font-size:.76rem;color:var(--ink-soft)}
.plan-exam-un{flex-basis:100%;font-size:.76rem;padding:.35rem .55rem;border-radius:8px;background:rgba(200,138,46,.1);color:#8A5A00}
