/* تصميم أدمن جديد — طبقة عرض فقط، لا تلمس المنطق */
:root{
  --g:#0a3a2a; --g2:#145c50; --gold:#c9a94f; --cream:#f7f5ef; --ink:#1c2b28; --mut:#6b7c76;
  --line:#e6e1d3; --card:#ffffff; --red:#b3261e; --r:16px;
}
html,body{background:var(--cream)!important;color:var(--ink)!important;
  font-family:'Tajawal','Segoe UI',system-ui,-apple-system,sans-serif!important;}
body{padding:0 0 40px!important}

/* الهيدر */
header,.hdr,#hdr{background:var(--g)!important;color:#fff!important;border:0!important;
  padding:14px 18px!important;box-shadow:0 2px 14px rgba(10,58,42,.18)!important;
  position:sticky;top:0;z-index:50;border-radius:0 0 18px 18px}
header *, .hdr *{color:#fff!important}
header b, header strong{font-weight:700!important}
#ttl{font-size:20px!important;letter-spacing:0}

/* الحاوية */
#app{max-width:1180px!important;margin:0 auto!important;padding:18px!important;display:block!important}

/* بطاقات الأرقام */
.stats{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;
  gap:12px!important;margin:6px 0 18px!important}
.stats>*{background:var(--card)!important;border:1px solid var(--line)!important;border-radius:var(--r)!important;
  padding:14px 12px!important;text-align:center!important;box-shadow:0 3px 10px rgba(10,58,42,.06)!important}
.stats>* b,.stats>* strong{display:block!important;font-size:26px!important;color:var(--g2)!important;line-height:1.25}
.stats>* span,.stats>* small{display:block!important;font-size:12.5px!important;color:var(--mut)!important;margin-top:4px}

/* الأقسام */
.sec{background:var(--card)!important;border:1px solid var(--line)!important;border-radius:var(--r)!important;
  padding:14px 16px!important;margin:0 0 14px!important;box-shadow:0 3px 12px rgba(10,58,42,.05)!important}
.sec h2{font-size:15.5px!important;color:var(--g2)!important;margin:0 0 10px!important;font-weight:700!important;
  padding-bottom:8px!important;border-bottom:2px solid #eef1ea!important}

/* الصفوف */
.row{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
  padding:9px 2px!important;border-bottom:1px dashed #eceade!important;font-size:14.5px!important}
.row:last-child{border-bottom:0!important}
.row b,.row .num{color:var(--g2)!important;font-weight:700!important;white-space:nowrap}
.muted{color:var(--mut)!important;font-size:13.5px!important;padding:8px 2px!important}

/* الأزرار */
button,.pri,.del,.btns button{font-family:inherit!important;border-radius:12px!important;cursor:pointer!important;
  transition:transform .06s ease,filter .15s ease,box-shadow .15s ease!important}
button:active{transform:scale(.985)}
.pri{background:var(--g2)!important;color:#fff!important;border:0!important;padding:10px 16px!important;
  font-size:14.5px!important;font-weight:700!important;box-shadow:0 3px 10px rgba(20,92,80,.22)!important}
.pri:hover{filter:brightness(1.08)}
.del{background:#fff!important;color:var(--red)!important;border:1.5px solid #f0c9c5!important;
  padding:8px 14px!important;font-size:14px!important;font-weight:700!important}
.del:hover{background:#fdf3f2!important}
.btns{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
.btns button{background:#fff!important;border:1.5px solid var(--line)!important;color:var(--g2)!important;
  padding:8px 14px!important;font-size:14px!important;font-weight:600!important}
.btns button:hover{border-color:var(--gold)!important;background:#fffdf6!important}

/* شريط البحث والفلاتر */
.pf,.pfrow,.srch{display:flex!important;gap:10px!important;align-items:center!important;margin:0 0 14px!important;flex-wrap:wrap!important}
input,select,textarea{font-family:inherit!important;border:1.5px solid var(--line)!important;border-radius:12px!important;
  padding:10px 14px!important;font-size:14.5px!important;background:#fff!important;color:var(--ink)!important;width:100%!important}
input:focus,select:focus,textarea:focus{outline:0!important;border-color:var(--gold)!important;
  box-shadow:0 0 0 3px rgba(201,169,79,.18)!important}

/* كروت الحسابات */
.acc,.box{background:var(--card)!important;border:1px solid var(--line)!important;border-radius:var(--r)!important;
  padding:14px 16px!important;margin:0 0 16px!important;box-shadow:0 2px 8px rgba(10,58,42,.05)!important}
.acc:hover{box-shadow:0 4px 16px rgba(10,58,42,.1)!important;border-color:#dfd8c4!important}
.seq{display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-width:30px!important;height:26px!important;padding:0 8px!important;border-radius:999px!important;
  background:#eef4f1!important;color:var(--g2)!important;font-size:12.5px!important;font-weight:700!important}
.tag,.tg{display:inline-block!important;padding:3px 10px!important;border-radius:999px!important;
  background:#f6f1df!important;color:#7a6420!important;font-size:12.5px!important;font-weight:700!important}

/* الأقسام القابلة للفتح */
details{border:1px dashed var(--line)!important;border-radius:12px!important;padding:8px 12px!important;margin:8px 0!important}
summary{cursor:pointer!important;color:var(--g2)!important;font-weight:700!important;font-size:14px!important}

/* المودالات */
[role=dialog],.modal{border-radius:var(--r)!important}
@media(max-width:620px){
  #app{padding:12px!important}
  .stats{grid-template-columns:repeat(2,1fr)!important}
  .stats>* b{font-size:22px!important}
  #ttl{font-size:17px!important}
}
@media print{
  header{position:static!important;box-shadow:none!important}
  .sec,.acc{box-shadow:none!important;break-inside:avoid}
}

/* الوضع الليلي */
html.xdark{--cream:#0f1a17;--card:#16241f;--line:#27392f;--ink:#e6efe9;--mut:#9db3a8;--g:#08120f;--g2:#4fbfa6}
html.xdark body{background:var(--cream)!important;color:var(--ink)!important}
html.xdark .sec,html.xdark .acc,html.xdark .box,html.xdark .stats>*{background:var(--card)!important;border-color:var(--line)!important;box-shadow:none!important}
html.xdark .sec h2{color:#7fd8c4!important;border-bottom-color:#22332b!important}
html.xdark .row{border-bottom-color:#22332b!important}
html.xdark .row b,html.xdark .row .num,html.xdark .stats>* b{color:#8ee0cc!important}
html.xdark .muted,html.xdark .stats>* span{color:var(--mut)!important}
html.xdark input,html.xdark select,html.xdark textarea{background:#111d19!important;color:var(--ink)!important;border-color:var(--line)!important}
html.xdark .btns button,html.xdark .del{background:#16241f!important;color:#8ee0cc!important;border-color:var(--line)!important}
html.xdark .del{color:#ff9a92!important;border-color:#4a2b28!important}
html.xdark .pri{background:#2f8f7b!important;color:#04140f!important}
html.xdark .seq{background:#1d2f28!important;color:#8ee0cc!important}
html.xdark .tag,html.xdark .tg{background:#2a2418!important;color:#e6cf8a!important}
html.xdark details{border-color:var(--line)!important}
html.xdark summary{color:#8ee0cc!important}
#xTheme{position:fixed;inset-inline-end:14px;bottom:14px;z-index:9999;background:#0a3a2a;color:#fff;border:0;
  border-radius:999px;padding:10px 16px;font:inherit;font-size:14px;font-weight:700;box-shadow:0 6px 18px rgba(0,0,0,.28);cursor:pointer}
html.xdark #xTheme{background:#c9a94f;color:#1a1408}

/* أزرار موحّدة الشكل والحجم (موبايل أولًا) */
#app button, .modal button, .xchk {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
}
#app .btns, .modal .btns { display: flex; flex-wrap: wrap; gap: 8px; }
#app .btns > button, .modal .btns > button { flex: 1 1 calc(50% - 4px); min-width: 0; white-space: normal; }
@media (max-width: 520px) {
  #app .btns > button { flex: 1 1 calc(50% - 4px); font-size: 13px; padding: 0 10px; }
  .modal .btns > button { flex: 1 1 100%; }
  /* التبويبات سطر واحد بيتزحلق بدل ما تبقى 3 صفوف */
  #xTabs { display: flex; flex-wrap: nowrap !important; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  #xTabs > button { flex: 0 0 auto !important; min-height: 40px; height: 40px; font-size: 13px; padding: 0 12px; white-space: nowrap; }
  body { padding-bottom: 86px; }
}
.xta {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid #d9d2bd; border-radius: 12px;
  font-family: inherit; font-size: 15px; line-height: 1.6;
  min-height: 96px; background: #fff; color: #1d2b27; margin: 6px 0;
}
.xmsg { font-size: 13px; font-weight: 700; color: #145c50; min-height: 18px; margin: 4px 0; }
.xmsg.bad { color: #b3261e; }
.xnote { font-size: 12px; color: #7a6a2c; margin: 2px 0 6px; }
.xcap { font-size: 13px; font-weight: 700; color: #145c50; margin: 8px 0 4px; }
.xrow { border: 1px solid #e3ddc9; border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; background: #fff; font-size: 14px; color: #26332f; word-break: break-word; }
.xwhen { font-size: 11px; color: #8a8272; margin-top: 3px; }
.xdlg { max-width: 520px !important; width: calc(100% - 24px) !important; max-height: 86vh; overflow: auto; }
.xchk { gap: 8px; border: 2px solid #145c50; background: #fff; color: #145c50; flex: 1 1 calc(50% - 4px); cursor: pointer; }
.xchk input { width: 18px; height: 18px; margin: 0; }
.xstat { font-size: 13px; color: #7a6a2c; margin-top: 6px; }

/* شريط بحث واحد أنضف */
#app .srch { display: flex; gap: 8px; align-items: center; margin: 10px 0 8px; }
#app .srch input { flex: 1 1 auto; min-width: 0; height: 44px; min-height: 44px; border-radius: 12px; padding: 0 14px; font-size: 15px; border: 1px solid #d9d2bd; background: #fff; }
#app .srch button { flex: 0 0 auto; min-width: 92px; }
/* التبويبات: حبّات مرتبة، سطر واحد بيتزحلق */
#xTabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
#xTabs::-webkit-scrollbar, #xFilterBar::-webkit-scrollbar { height: 0; }
#xTabs > button { flex: 0 0 auto !important; height: 40px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; border: 1.5px solid #145c50 !important; background: #fff !important; color: #145c50 !important; }
#xTabs > button.pri { background: #145c50 !important; color: #fff !important; }
/* الفلاتر: سطر واحد بيتزحلق */
#xFilterBar { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
#xFilterBar > button { flex: 0 0 auto !important; height: 38px; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
html.xdark #app .srch input { background: #1b2624; color: #f2efe4; border-color: #35504a; }

/* صفحة رئيسية: أزرار الأقسام */
#xNav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
@media (max-width: 560px) { #xNav { grid-template-columns: repeat(2, 1fr); } }
#xNav > button { height: auto !important; min-height: 58px; padding: 8px 10px !important; border-radius: 14px !important; border: 1.5px solid #145c50 !important; background: #fff !important; color: #145c50 !important; font-size: 13px !important; line-height: 1.35; white-space: normal !important; }
#xBack { margin: 8px 0; align-self: flex-start; min-width: 120px; }
html.xdark #xNav > button { background: #1b2624 !important; color: #e9e4d2 !important; border-color: #35504a !important; }

/* توحيد شكل كل الأزرار: نفس الارتفاع والحواف والخط واللون */
#app button, .modal button, #xBack {
  min-height: 44px !important; height: 44px !important; padding: 0 14px !important;
  border-radius: 12px !important; border: 1.5px solid #145c50 !important;
  background: #fff !important; color: #145c50 !important;
  font-family: inherit !important; font-size: 14px !important; font-weight: 700 !important;
  line-height: 1.2 !important; box-sizing: border-box !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  text-align: center !important; white-space: nowrap; margin: 0 !important;
}
#app button.pri, .modal button.pri { background: #145c50 !important; color: #fff !important; }
#app button.del, .modal button.del { background: #fff !important; color: #b3261e !important; border-color: #b3261e !important; }
#app button.go, .modal button.go { background: #b3261e !important; color: #fff !important; border-color: #b3261e !important; }
#xNav > button { height: auto !important; min-height: 52px !important; white-space: normal !important; }
#app .btns > button { white-space: normal !important; }
#xFilterBar > button, #xTabs > button { border-radius: 12px !important; }
html.xdark #app button, html.xdark .modal button, html.xdark #xBack { background: #1b2624 !important; color: #e9e4d2 !important; border-color: #35504a !important; }
html.xdark #app button.pri, html.xdark .modal button.pri { background: #c9a94f !important; color: #1a1408 !important; border-color: #c9a94f !important; }
/* إيقاف تحديد النص والضغط الطويل على الأزرار والكروت */
#app button, #app .acc, #app .row, #app .box, #app .sec, #xNav, #xBack, #app h2, #app h3,
.modal button, .modal h3 {
  -webkit-user-select: none !important; -moz-user-select: none !important; user-select: none !important;
  -webkit-touch-callout: none !important; -webkit-user-drag: none !important;
}
#app input, #app textarea, .modal input, .modal textarea {
  -webkit-user-select: text !important; user-select: text !important; -webkit-touch-callout: default !important;
}

.xhid { display: none !important; }
#app .xhid, #app button.xhid, .modal .xhid { display: none !important; }

.modal button.xcell { padding: 0 !important; width: 44px !important; height: 44px !important; min-height: 44px !important; border-radius: 10px !important; flex: 0 0 auto !important; }
.modal button.xcell.xsw { width: 30px !important; height: 30px !important; min-height: 30px !important; border-radius: 50% !important; }
.modal button.xcell svg { width: 26px; height: 26px; }
#xNav { grid-auto-rows: 1fr; }
#xNav > button { width: 100%; }
.xti { width:100%; box-sizing:border-box; padding:0 12px; height:44px; border:1px solid #d9d2bd; border-radius:12px; font-family:inherit; font-size:15px; background:#fff; color:#1d2b27; margin:6px 0; }
.xrow.xoff { opacity:.55; background:#f6f4ee; }

#xNav { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
@media (min-width: 620px) { #xNav { grid-template-columns: repeat(3, minmax(0,1fr)) !important; } }
#xNav > button { width: 100% !important; box-sizing: border-box; }

.modal button.xcell.xsw { background: var(--sw, #8c5a2b) !important; }

[data-xhome].btns { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
[data-xhome].btns > button { width: 100% !important; }
#app .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#app .row > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
#app .row > b { flex: 0 0 auto; }
#app .row > button { flex: 0 0 auto; min-width: 110px; }
#app .sec, #xOverview { max-width: 100%; overflow-wrap: anywhere; }
#app button.pri, .modal button.pri {
  background: #eef5f2 !important; color: #145c50 !important; border-color: #145c50 !important;
}
#app button.go, .modal button.go { background: #b3261e !important; color: #fff !important; border-color: #b3261e !important; }
#app button.del, .modal button.del { background: #fff !important; color: #b3261e !important; border-color: #b3261e !important; }
html.xdark #app button.pri, html.xdark .modal button.pri { background: #23332f !important; color: #e9e4d2 !important; border-color: #6f8a83 !important; }

body:not(.xstud) #app .acc { display: none !important; }
#app button.pri, .modal button.pri { background: #fff !important; color: #145c50 !important; border-color: #145c50 !important; }
#app button.pri { box-shadow: inset 0 0 0 1.5px #145c50; }
#app button.del, .modal button.del { background: #fff !important; color: #b3261e !important; border-color: #b3261e !important; box-shadow: none !important; }

#app button.pri { box-shadow: none !important; }

/* ===== تقرير الطالب ===== */
#xReport{position:fixed;inset:0;z-index:9999;background:#fff;overflow:auto;-webkit-overflow-scrolling:touch;padding:20px 14px 44px;direction:rtl}
#xReport .xrepcard{max-width:560px;margin:0 auto;background:#fff;color:#1d2b27;font-size:15px;line-height:1.95}
#xReport .xrep-x{position:fixed;top:6px;left:8px;width:34px;height:34px;border:0!important;border-radius:0!important;background:transparent!important;color:#145c50;font-size:20px;font-weight:400;padding:0;line-height:1;z-index:10001;cursor:pointer;box-shadow:none!important}
#xReport .xrep-h{border-bottom:2px solid #145c50;padding-bottom:10px;margin-bottom:16px;padding-left:52px}
#xReport .xrep-t{font-size:21px;font-weight:800;color:#145c50}
#xReport .xrep-s{font-size:13px;color:#5b6b66;margin-top:3px}
#xReport .xrep-sec{margin:0 0 18px}
#xReport .xrep-h2{font-size:14px;font-weight:800;color:#145c50;margin-bottom:8px}
#xReport .xrep-row{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed #e3ddc9}
#xReport .xrep-row b{color:#145c50;white-space:nowrap}
#xReport .xrep-lvl{display:inline-block;background:#f2f7f5;border:1px solid #cfe3dc;color:#145c50;font-weight:800;border-radius:10px;padding:5px 14px;margin-bottom:8px}
#xReport .xrep-p{margin:0;color:#33413d;font-size:14px}
#xReport .xrep-notes{margin-bottom:10px}
#xReport .xrep-note{background:#faf8f1;border:1px solid #ece5d2;border-radius:10px;padding:9px 11px;margin-bottom:7px;font-size:14px;white-space:pre-wrap;word-break:break-word}
#xReport .xrep-empty{font-size:13px;color:#8a8577}
#xReport .xta{width:100%;box-sizing:border-box;border:1px solid #cfc9b6;border-radius:10px;padding:10px;font-size:15px;font-family:inherit;background:#fff;color:#1d2b27}
#xReport .btns{margin-top:6px}
@media print{
 body>*:not(#xReport){display:none!important}
 #xReport{position:static!important;inset:auto!important;overflow:visible!important;padding:0!important;background:#fff!important}
 #xReport .xrep-x,#xReport .noprint{display:none!important}
 #xReport .xrep-row{break-inside:avoid}
}

/* المسافات بين عناصر صفحة الطلاب */
#app .acc .r{margin:3px 0}
#app .acc .btns{margin-top:12px}
#app .acc h3{margin:0 0 8px}
/* أرقام الهاتف والإيميل: الأرقام بترتيبها من الشمال لليمين جوه نص عربي */
#app .num,.modal .num,#xReport .num{direction:ltr!important;unicode-bidi:isolate!important;display:inline-block!important;letter-spacing:.2px}
/* علامة الإغلاق: X صغيرة عادية بدون إطار */
.modal button[data-xclose]{border:0!important;border-radius:0!important;background:transparent!important;color:#145c50!important;font-size:20px!important;font-weight:400!important;box-shadow:none!important;padding:0!important;min-height:0!important;width:34px!important;height:34px!important;line-height:1!important}

/* ===== شبكة أزرار الرئيسية ===== */
#xNav{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:10px!important}
#xNav>button{width:100%!important;min-height:52px!important;margin:0!important}
@media(max-width:620px){#xNav{grid-template-columns:repeat(2,1fr)!important}}
/* ===== البحث + زرار التحديث في سطر واحد ===== */
#app .srch{display:flex!important;gap:8px!important;align-items:stretch!important;margin:0 0 12px!important}
#app .srch input[type=search]{flex:1 1 0%!important;width:auto!important;min-width:0!important;margin:0!important}
#app .srch button{flex:0 0 auto!important;min-width:104px!important;margin:0!important}
/* ===== فلاتر الطلبة ===== */
#xFilterBar{display:grid!important;grid-template-columns:repeat(5,1fr)!important;gap:8px!important;margin:0 0 16px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
#xFilterBar button{width:100%!important;padding:9px 6px!important;font-size:13.5px!important;white-space:nowrap!important;margin:0!important;min-height:40px!important}
@media(max-width:620px){#xFilterBar{grid-template-columns:repeat(2,1fr)!important}}
/* ===== إحساس الضغط ===== */
#app button:active,.modal button:active,#xNav button:active,#xFilterBar button:active,#xBack:active{transform:scale(.97)!important;filter:brightness(.88)!important}
#app button.pri:active,.modal button.pri:active,#xFilterBar button.pri:active{filter:brightness(1.3)!important}

/* كل أزرار الرئيسية بنفس المقاس بالظبط */
#xNav>button{height:56px!important;min-height:56px!important;max-height:56px!important;font-size:14px!important;line-height:1.25!important;padding:6px 8px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;overflow:hidden!important}
@media(max-width:620px){#xNav>button{height:54px!important;min-height:54px!important;max-height:54px!important;font-size:13.5px!important}}

/* الفلاتر: الكل بعرض كامل ثم 2×2 على الموبايل */
@media(max-width:620px){
 #xFilterBar{grid-template-columns:repeat(2,1fr)!important}
 #xFilterBar button:first-child{grid-column:1/-1!important}
 #app .stats>*:last-child:nth-child(odd){grid-column:1/-1!important}
}

/* شريط أعلى الصفحة: رجوع + X صغيرة */
#xTopBar{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:10px!important;margin:0 0 12px!important}
#xTopBar #xBack{flex:0 0 auto!important;width:auto!important;min-width:132px!important;margin:0!important}
#xBackX{flex:0 0 auto!important;width:36px!important;height:36px!important;min-height:36px!important;border:0!important;border-radius:0!important;background:transparent!important;color:#145c50!important;font-size:21px!important;font-weight:400!important;padding:0!important;line-height:1!important;box-shadow:none!important}

/* الإخفاء لازم يكسب على قواعد العرض اللي فوق */
#app .xhid,#app #xNav.xhid,#app .srch.xhid,#app #xFilterBar.xhid,#app #xTopBar.xhid,#app #xTop.xhid,#app .stats.xhid{display:none!important}

/* ===== مسافات موحّدة في كل حاجة ===== */
#app .btns,.modal .btns,#xNav,#xFilterBar,#app .stats,#xTopBar,#app .srch{gap:10px!important}
#app .btns{margin-top:10px!important}
#app .acc>*+*{margin-top:8px!important}
#app .acc h3{margin:0!important;line-height:1.5!important}
#app .acc .r{margin:0!important;padding:3px 0!important;line-height:1.7!important}
#app .acc .btns{margin-top:12px!important}
#app .acc .btns+.btns{margin-top:10px!important}
#app .sec{padding:14px 16px!important;margin:0 0 12px!important}
#app .sec h2{margin:0 0 10px!important}
#app .sec .row{padding:8px 0!important}
#app .sec .row+button,#app .sec button{margin-top:6px!important}
#xTopBar{margin:0 0 12px!important}
#app .srch{margin:0 0 12px!important}
#xFilterBar{margin:0 0 14px!important}

#app #xBackX{border:0!important;border-radius:0!important;background:transparent!important;color:#145c50!important;font-size:21px!important;font-weight:400!important;width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;box-shadow:none!important}
#app .acc [data-xls]{color:#44524e!important}

/* أزرار النوافذ: عمودين متساويين بمسافة */
.modal .btns{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:10px!important;margin-top:12px!important}
.modal .btns>button{width:100%!important;margin:0!important;min-width:0!important}
.modal .xdlg{padding:16px!important}
.modal .xdlg>*+*{margin-top:10px!important}

/* X صغيرة عادية في أقصى شمال الهيدر في كل نافذة */
.modal [data-xclose]{position:absolute!important;top:10px!important;left:12px!important;width:34px!important;height:34px!important;min-height:34px!important;min-width:34px!important;border:0!important;border-radius:0!important;background:transparent!important;color:#145c50!important;font-size:20px!important;font-weight:400!important;padding:0!important;line-height:1!important;box-shadow:none!important;z-index:9}
.modal .xdlg>h3,.modal .xdlg>div:first-child h3{padding-inline-end:44px}

/* كارت الطالب: نجمة في أول صف + أزرار متوسطة 3 في السطر */
#app .acc .xcardtop{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin:0 0 6px!important}
#app .acc .xstar{flex:0 0 auto!important;width:36px!important;height:36px!important;min-height:36px!important;border:0!important;background:transparent!important;color:#c9a94f!important;font-size:22px!important;padding:0!important;line-height:1!important;box-shadow:none!important}
#app .acc .xstar.on{color:#e0a800!important}
#app .acc .btns{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:8px!important;margin-top:8px!important}
#app .acc .btns>button{width:100%!important;min-height:42px!important;height:42px!important;font-size:12.5px!important;padding:4px 6px!important;line-height:1.2!important;white-space:normal!important;overflow:hidden!important}
#app .acc .xdelrow{grid-template-columns:1fr!important;margin-top:10px!important}
#app .acc .xdelrow>button{height:44px!important;font-size:14px!important}

#app .acc .btns>button:last-child:nth-child(3n+1){grid-column:1/-1!important}

#app .sec .row:last-child{border-bottom:0!important;padding-bottom:2px!important}
#app .sec .btns{margin-top:12px!important}

/* ممنوع تحديد النص أو القائمة الطويلة */
html,body,#app,header,.modal,#xReport,#xNav,#xTopBar{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;-webkit-tap-highlight-color:transparent!important}
input,textarea,select,[contenteditable="true"],[contenteditable=""],.xta{-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default!important}
img{-webkit-user-drag:none!important;user-drag:none!important}

/* منع إعادة تحميل الصفحة بالسحب من فوق */
html,body{overscroll-behavior-y:contain!important;overscroll-behavior-x:contain!important}

#app .acc .xstar{pointer-events:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:34px!important;height:34px!important;font-size:22px!important;color:#e0a800!important;background:transparent!important;border:0!important;padding:0!important}

/* زرارَي التقرير جنب بعض */
#app .btns.reprow{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;margin:12px 0 16px!important}
#app .btns.reprow>button{width:100%!important;margin:0!important;min-height:44px!important}


#app .srow{display:flex!important;gap:10px!important;margin:16px 0 28px!important;flex-wrap:nowrap!important}
#app .srow>button{flex:1 1 0!important;min-width:0!important;width:auto!important;height:46px!important;margin:0!important;font-size:15px!important}

#app .pfw{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0 0 12px!important}
#app .pfw>.pf{flex:1 1 auto!important;min-width:0!important;margin:0!important}
#app .pfw>button.xrf{flex:0 0 auto!important;min-width:104px!important;height:44px!important;margin:0!important;font-size:15px!important}
