/* نظام حضور QR — الواجهة
   التخطيط: شريط جانبي ثابت على الكمبيوتر، شريط علوي على الموبايل، والمحتوى في عمود واحد واسع */
/* الخطوط مدمجة مع البرنامج (بتشتغل من غير إنترنت) */
@font-face { font-family: "Hader Sans"; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Hader Sans"; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Hader Sans"; src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Hader Sans"; src: url(/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Hader Display"; src: url(/fonts/readex-pro-arabic-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Hader Display"; src: url(/fonts/readex-pro-arabic-700-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Hader Display"; src: url(/fonts/readex-pro-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Hader Display"; src: url(/fonts/readex-pro-latin-700-normal.woff2) format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0000-00FF; }

/* هوية «حاضر»: حبر أزرق مخضر غامق، وأخضر النعناع بتاع علامة الصح في اللوجو، وورق رمادي بارد */
:root {
  --ink: #0e2f37;
  --ink-2: #1d4c56;
  --paper: #edf2f2;
  --card: #ffffff;
  --line: #d2dfe0;
  --muted: #587077;
  --accent: #15707b;
  --accent-soft: #dcefee;
  --mint: #38c98a;
  --mint-ink: #0c5a3b;
  --ok: #1a7a4c; --ok-soft: #e1f4ea;
  --warn: #946400; --warn-soft: #fff3d4;
  --bad: #b3261e; --bad-soft: #fde7e5;
  --info: #2c5ea6; --info-soft: #e5edf9;
  --late: #b4561a; --late-soft: #fdebdc;
  --font: "Hader Sans", "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --display: "Hader Display", "Hader Sans", "Segoe UI", Tahoma, sans-serif;
  --mono: "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --r: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); letter-spacing: .02em; }
[hidden] { display: none !important; }

/* هيكل التطبيق */
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100%; }
.side { background: var(--ink); color: #dfeceb; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid #ffffff1f; margin-bottom: 8px; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 4px; background: #fff; border-radius: 6px; flex: none; }
.brand-mark i { background: var(--ink); border-radius: 1px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4), .brand-mark i:nth-child(8) { background: transparent; }
.brand b { display: block; font-size: .98rem; color: #fff; }
.brand small { color: #9fbcbc; font-size: .78rem; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: #cfe0df; text-decoration: none; }
.nav a:hover { background: #ffffff14; color: #fff; }
.nav a.on { background: #ffffff22; color: #fff; font-weight: 600; }
.nav .sep { margin: 12px 10px 4px; font-size: .74rem; color: #8fb0b0; letter-spacing: .04em; }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #ffffff1f; font-size: .86rem; }
.side .who b { color: #fff; display: block; }
.side .who button { margin-top: 8px; background: none; border: 1px solid #ffffff40; color: #dfeceb; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.side .who button:hover { background: #ffffff14; }
.topbar { display: none; }

.main { min-width: 0; padding-block: 24px 48px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; z-index: 50; transform: translateX(100%); transition: transform .2s; height: 100%; }
  .app.menu-open .side { transform: none; box-shadow: -8px 0 30px #0004; }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 0 4px; }
  .main { padding-block: 16px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* عناصر */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: #e8b8b4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: .86rem; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); min-width: 0; }
label.f > span { font-weight: 600; color: var(--ink); }
input[type=text], input[type=password], input[type=date], input[type=month], input[type=email], input[type=tel], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 10px; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-form .wide { grid-column: 1 / -1; }
.hint { font-size: .82rem; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; }
.check input { margin-top: 5px; }

/* اختيار من القائمة أو كتابة يدوية */
.pick { display: flex; flex-direction: column; gap: 4px; }
.pick .pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pick .pick-head span { font-weight: 600; font-size: .88rem; }
.pick .mode { border: 0; background: none; color: var(--accent); font-size: .8rem; cursor: pointer; padding: 0; text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; background: #fff; cursor: pointer; font-size: .86rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* جداول */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #eef3f2; font-size: .82rem; color: var(--ink-2); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbfa; }
td.actions { white-space: nowrap; text-align: left; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* شارات الحالة */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.late { background: var(--late-soft); color: var(--late); }
.pill.muted { background: #edf1f0; color: var(--muted); }

/* أرقام الملخص */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; border-top: 3px solid var(--line); }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat small { color: var(--muted); }
.stat.ok { border-top-color: var(--ok); } .stat.warn { border-top-color: var(--warn); }
.stat.bad { border-top-color: var(--bad); } .stat.late { border-top-color: var(--late); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); white-space: nowrap; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }

/* بطاقة محاضرة */
.lec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.lec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.lec:hover { border-color: var(--accent); }
.lec .t { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lec h3 { font-size: 1.02rem; }
.lec .meta { color: var(--muted); font-size: .86rem; display: grid; gap: 2px; }
.lec .time { font-family: var(--mono); font-weight: 700; color: var(--accent); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; }
.info-grid div small { display: block; color: var(--muted); font-size: .78rem; }
.info-grid div b { font-weight: 600; }

/* نوافذ منبثقة */
.modal-back { position: fixed; inset: 0; background: #0f262b80; display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 10px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; box-shadow: 0 20px 60px #0005; }
.modal h2 { margin-bottom: 14px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 200; box-shadow: 0 8px 24px #0004; max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); }
.del-undo { display: flex; gap: 10px; align-items: center; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 120; box-shadow: 0 8px 24px #0004; } /* 2.8.3: فوق رسالة «تم الحذف» علشان ماتتغطاش */
.del-undo .btn { background: #fff; color: var(--ink); border: 0; font-weight: 700; }
.del-undo .undo-t { font-style: normal; opacity: .7; min-width: 1.2em; text-align: center; }
.alert { padding: 10px 14px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); border: 1px solid #f0d78a; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: #efb5b0; }
.alert.info { background: var(--info-soft); color: var(--info); border-color: #bcd0ef; }

/* الدخول */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  linear-gradient(var(--paper), var(--paper)) padding-box,
  repeating-linear-gradient(90deg, #17363d08 0 2px, transparent 2px 22px); }
.login .card { width: min(400px, 100%); padding: 28px; }
.login .brand { border: 0; padding: 0 0 18px; }
.login .brand b { color: var(--ink); font-size: 1.15rem; }
.login .brand small { color: var(--muted); }
.login .brand-mark { background: var(--ink); }
.login .brand-mark i { background: #fff; }

/* شاشة المسح */
.scan-screen { min-height: 100vh; display: flex; flex-direction: column; background: #0f2a30; color: #e8f2f1; }
.scan-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-block: 14px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); background: #0b2125; border-bottom: 1px solid #ffffff14; }
.scan-top h1 { font-size: 1.2rem; color: #fff; }
.scan-top .sub { color: #9fbcbc; font-size: .9rem; }
.scan-top .btn { background: transparent; color: #e8f2f1; border-color: #ffffff30; }
.scan-body { flex: 1; display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding-block: 18px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); min-height: 0; }
@media (max-width: 900px) { .scan-body { grid-template-columns: 1fr; } }
.result { border-radius: 14px; padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 300px; background: #ffffff0d; border: 2px dashed #ffffff26; transition: background .15s; }
.result .state { font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; }
.result .name { font-size: clamp(1.8rem, 4.5vw, 3.2rem); font-weight: 800; line-height: 1.2; color: #fff; }
.result .det { font-size: 1.1rem; color: #d7e7e6; }
.result.ok { background: #1e7b4f; border: 2px solid #3fbf83; }
.result.outside { background: #8a5f00; border: 2px solid #f0b429; }
.result.duplicate { background: #2f5fa8; border: 2px solid #7ea6e6; }
.result.unknown, .result.inactive, .result.closed { background: #9c231c; border: 2px solid #f07a72; }
.scan-input { display: flex; gap: 8px; margin-top: 14px; }
.scan-input input { background: #ffffff10; border: 1px solid #ffffff30; color: #fff; font-family: var(--mono); font-size: 1.1rem; }
.scan-input input:focus { outline-color: #f0b429; }
.counter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.counter div { background: #ffffff0d; border-radius: 8px; padding: 10px; text-align: center; }
.counter b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; color: #fff; }
.counter small { color: #9fbcbc; }
.feed { background: #ffffff08; border-radius: 10px; padding: 10px; overflow-y: auto; max-height: calc(100vh - 260px); }
.feed h3 { color: #9fbcbc; font-size: .85rem; margin: 2px 4px 8px; }
.feed .it { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 6px; border-right: 4px solid #3fbf83; background: #ffffff08; margin-bottom: 5px; font-size: .92rem; }
.feed .it.outside { border-right-color: #f0b429; }
.feed .it.unknown { border-right-color: #f07a72; }
.feed .it small { color: #9fbcbc; white-space: nowrap; font-family: var(--mono); }
.station-tag { background: #ffffff1a; border-radius: 999px; padding: 2px 10px; font-size: .85rem; cursor: pointer; border: 0; color: inherit; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3fbf83; margin-left: 6px; }
.live-dot.off { background: #f07a72; }

/* كروت الطلاب */
.cards-sheet { display: grid; grid-template-columns: repeat(auto-fill, 85.6mm); gap: 6mm; justify-content: start; }
.id-card { width: 85.6mm; height: 54mm; border: 1px solid #9fb3b0; border-radius: 3mm; overflow: hidden; break-inside: avoid; background: #fff; color: #17363d; display: flex; flex-direction: column; }
.id-head { background: #17363d; color: #fff; padding: 1.6mm 3mm; display: flex; justify-content: space-between; align-items: baseline; gap: 2mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.id-head b { font-size: 8.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-head span { font-size: 7pt; color: #cfe0df; white-space: nowrap; }
.id-body { flex: 1; display: grid; grid-template-columns: 1fr 27mm; gap: 2mm; padding: 2mm 3mm; align-items: center; min-height: 0; }
.id-card .col { display: flex; flex-direction: column; gap: .6mm; min-width: 0; font-size: 7.5pt; }
.id-card .col .nm { font-size: 10pt; line-height: 1.25; margin-bottom: .8mm; }
.id-card .col i { font-style: normal; color: #5d7177; margin-left: 1.5mm; }
.id-card .qr { text-align: center; }
.id-card img { width: 26mm; height: 26mm; display: block; margin: 0 auto; }
.id-card .code { font-family: var(--mono); font-size: 6.5pt; text-align: center; color: #5d7177; }

/* الطباعة */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .side, .topbar, .no-print, .toast { display: none !important; }
  .app { display: block; }
  .main { padding: 0 !important; }
  .print-only { display: block; }
  .table-wrap { border: 0; overflow: visible; }
  th { background: #e8eeed !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: static; }
  th, td { padding: 4px 6px; border: 1px solid #b9c6c4; }
  tr { break-inside: avoid; }
  .card { border: 0; padding: 0; }
  .print-sec { break-before: page; }
  .cards-sheet { grid-template-columns: repeat(2, 85.6mm); justify-content: center; gap: 5mm; }
  .id-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.sheet-print h2 { font-size: 13pt; }
.sheet-print h1 { font-size: 15pt; text-align: center; margin-bottom: 4mm; }
.sheet-print .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1mm 8mm; margin-bottom: 4mm; font-size: 10.5pt; }
.sheet-print .sig { display: flex; justify-content: space-between; margin-top: 12mm; font-size: 10.5pt; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== الإصدار 2: إضافات الواجهة ===== */
.brand-logo { width: 38px; height: 38px; border-radius: 9px; background: #fff; object-fit: contain; flex: none; }
.login .brand-logo { background: none; }
.student-link { text-align: center; font-weight: 600; text-decoration: none; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.cswitch { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 10px; font-size: .78rem; color: #9fbcbc; }
.cswitch select { background: #ffffff14; color: #fff; border-color: #ffffff30; min-height: 34px; padding: 4px 8px; }
.cswitch select option { color: var(--ink); }
.nav a i { font-style: normal; width: 20px; text-align: center; opacity: .9; }
.nav .sep.sp { margin: 6px 0; border-top: 1px solid #ffffff1f; }
.topbar .tb-c { font-size: .85rem; opacity: .75; margin-inline-start: auto; }
.help { margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--info-soft); color: #234a7c; font-size: .88rem; border-inline-start: 3px solid var(--info); }
.mhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.mhead h2 { margin: 0; }
.mhead .x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.mbody { display: flex; flex-direction: column; gap: 12px; }
.chip.all { font-weight: 700; }
.pill.live { background: #e3f4ea; color: #12663f; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.term-line { font-weight: 600; color: var(--ink-2); }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.step b { display: inline-block; margin-bottom: 6px; }
.sched-list { display: grid; gap: 8px; }
.sched { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.reg-active { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; background: var(--ok-soft); border: 1px solid #b7e0c8; padding: 12px; border-radius: 8px; }
.late-btn { border-color: #f3c6a4; color: var(--late); }
.backup { padding-top: 8px; border-top: 1px dashed var(--line); }
.notify { padding-top: 8px; border-top: 1px dashed var(--line); }
tr.late td { background: #fdf1e7; }
tr.warn td { background: #fffaea; }
tr.bad td { background: #fdeeed; }
tr.muted td { color: var(--muted); }
.attempts { display: flex; flex-direction: column; gap: 6px; }
.att { background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--bad); border-radius: 6px; padding: 8px 12px; font-size: .92rem; }
.att.rep { border-inline-start-color: var(--warn); background: #fffaea; }
.pick-list { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.cam-box { width: 100%; }
.cam { position: relative; width: 100%; aspect-ratio: 4/3; background: #000; border-radius: 10px; overflow: hidden; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: 15%; border: 3px solid #ffffffcc; border-radius: 14px; box-shadow: 0 0 0 999px #0005; }
.cam-hint { position: absolute; bottom: 8px; inset-inline: 0; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 3px #000; }
.cam-res { min-height: 40px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.cam-res.ok { background: var(--ok-soft); color: var(--ok); }
.cam-res.dup { background: var(--info-soft); color: var(--info); }
.cam-res.bad { background: var(--bad-soft); color: var(--bad); }
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; background: #e6ecea; }
.av.ph { background: repeating-linear-gradient(45deg, #e6ecea 0 4px, #f2f5f4 4px 8px); }
.av.big { width: 72px; height: 72px; }
.acc-head { display: flex; gap: 12px; align-items: center; }
.big-code { font-size: 1.6rem; letter-spacing: .15em; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; text-align: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.export { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.export select { width: auto; min-height: 36px; padding: 4px 8px; }
.perms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 14px; }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.day h3 { color: var(--accent); }
.slot { border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.slot:hover { background: #f8fbfa; }
.slot .tm { font-size: .82rem; color: var(--accent); font-weight: 700; }
.colleges { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.col-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.col-card.off { opacity: .6; }
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.logo-sm { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #f2f5f4; display: inline-block; }
.logo-md { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: #f2f5f4; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
.copy code { font-family: var(--mono); background: #eef3f2; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: block; word-break: break-all; font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.my-card { display: flex; gap: 14px; align-items: center; }
.qr-md svg { width: 160px; height: 160px; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 3px var(--ink); }
.colors input[type=color] { width: 36px; height: 30px; border: 0; padding: 0; background: none; }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .design-grid { grid-template-columns: 1fr; } }
.card-preview { padding: 10px; background: #eef2f1; border-radius: 8px; display: flex; justify-content: center; }
.cards-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.cwrap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* شاشة العرض */
.proj { min-height: 100vh; background: #0b2125; color: #e8f2f1; display: flex; flex-direction: column; }
.proj-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #ffffff14; }
.proj-top b { font-size: 1.3rem; color: #fff; }
.proj-top .sub { color: #9fbcbc; }
.proj-top .btn { background: transparent; color: #e8f2f1; border-color: #ffffff30; }
.proj-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 24px; padding: 20px; align-items: center; }
@media (max-width: 860px) { .proj-body { grid-template-columns: 1fr; } }
.proj-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qrbox { background: #fff; padding: 14px; border-radius: 16px; width: min(72vh, 92vw, 640px); aspect-ratio: 1; display: grid; place-items: center; }
.qrbox svg { width: 100%; height: 100%; }
.qrbox .closed { color: #17363d; font-size: 2rem; font-weight: 800; }
.code-line { font-size: 1.4rem; } .code-line b { font-size: 2.4rem; letter-spacing: .12em; word-spacing: .45em; color: #fff; direction: ltr; unicode-bidi: isolate; }
/* 2.7.1: تكبير الكود والـQR بملء الشاشة للبعيد وللزحمة */
.proj.zoom .proj-side, .proj.zoom .proj-top .sub { display: none; }
/* 2.8.6: الرقم تحت الـQR في ملء الشاشة (من غير التكبير) كبير بحيث يتقري من آخر القاعة */
html:fullscreen .proj:not(.zoom) .code-line { font-size: 1.8rem; display: flex; flex-direction: column; align-items: center; gap: 4px; }
html:fullscreen .proj:not(.zoom) .code-line b { font-size: clamp(3.4rem, 7vw, 8rem); line-height: 1.1; }
.proj .proj-top .ibtn, .scan-top .ibtn { flex: none; }
.proj.zoom .proj-body { grid-template-columns: 1fr; padding: 8px; }
.proj.zoom .proj-qr { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; column-gap: 4vw; row-gap: 10px; }
.proj.zoom .qrbox { width: min(80vh, 54vw); }
.proj.zoom .code-line { display: flex; flex-direction: column; align-items: center; font-size: 1.6rem; }
.proj.zoom .code-line b { font-size: clamp(4rem, 11vw, 12rem); line-height: 1.1; }
.proj.zoom .code-line .cpairs { flex-direction: column; gap: 0; }
.proj.zoom .bar { grid-column: 1 / -1; width: 100%; height: 14px; }
@media (max-aspect-ratio: 1/1) { .proj.zoom .proj-qr { grid-template-columns: 1fr; } .proj.zoom .qrbox { width: min(62vh, 94vw); } .proj.zoom .code-line .cpairs { flex-direction: row; gap: .5em; } }
.bar { width: min(72vh, 92vw, 640px); height: 8px; background: #ffffff1a; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #3fbf83; transition: width 1s linear; }
.proj-side { display: flex; flex-direction: column; gap: 18px; }
.round-tag { font-size: 1.3rem; font-weight: 700; } .round-tag .late { color: #f5a65b; }
.big-count b { font-size: 5rem; color: #fff; line-height: 1; } .big-count span { font-size: 2rem; color: #9fbcbc; } .big-count small { display: block; color: #9fbcbc; font-size: 1.1rem; }
.steps { display: flex; flex-direction: column; gap: 8px; font-size: 1.2rem; background: #ffffff0d; padding: 14px; border-radius: 12px; }
.proj .btn { background: #ffffff14; color: #fff; border-color: #ffffff30; }
.proj .btn.primary { background: var(--accent); }
.footer-owner { text-align: center; font-size: .78rem; color: var(--muted); padding: 10px; }
.exc { border-inline-start: 4px solid var(--warn); }
.exc.approved { border-inline-start-color: var(--ok); } .exc.rejected { border-inline-start-color: var(--bad); }
.exc .msg { margin: 6px 0; white-space: pre-line; }
.exc-img { max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); }
.dx { margin-top: 8px; }
.screen-code { font-size: 3rem; font-weight: 800; letter-spacing: .3em; text-align: center; color: var(--accent); }
.screen-enter { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px; }
.screen-enter input { font-size: 2rem; text-align: center; letter-spacing: .3em; max-width: 240px; background: #fff; color: var(--ink); }
.matrix th { white-space: normal; min-width: 90px; text-align: center; }
.matrix td.num { text-align: center; }
td.c-bad { background: #fde3d3; color: var(--late); font-weight: 700; }
td.c-warn { background: #fff6dc; }
.lect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
table.mini td { padding: 4px 6px; font-size: .88rem; }
.logo-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.logo-row b { flex: 1; }
.logo-md.ph { display: inline-block; background: repeating-linear-gradient(45deg, #eef2f1 0 6px, #f7f9f8 6px 12px); }
.nav a { font-size: 1rem; padding: 10px 12px; }
.side .who #inst { background: #3fbf83; border-color: #3fbf83; color: #0b2125; font-weight: 700; }
.sched.now { border-color: #3fbf83; background: #f0faf4; }
details.done summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
table.imp select { min-height: 32px; padding: 2px 4px; font-size: .85rem; }
.ok-mark { color: var(--ok); font-weight: 700; }
table.imp select { width: auto; min-width: 130px; }
table.imp td .pill { white-space: normal; }
.pw { position: relative; display: block; }
.pw input { padding-left: 44px; }
.pw .eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 1.1rem; padding: 6px; }
.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist a { text-decoration: none; color: var(--muted); padding: 6px 8px; border-radius: 6px; }
.checklist a.ok { color: var(--ok); }
.checklist a:not(.ok) { color: var(--warn); background: var(--warn-soft); }
a.stat { text-decoration: none; color: inherit; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.bar-col i { display: block; width: 70%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; }
.bar-col b { font-size: .8rem; } .bar-col small { color: var(--muted); font-size: .72rem; }
.photo-box { width: 110px; height: 135px; border-radius: 10px; background: #eef2f1; overflow: hidden; display: grid; place-items: center; font-size: 2.6rem; flex: none; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
pre.log { background: #0f2a30; color: #d7e7e6; padding: 10px; border-radius: 8px; max-height: 320px; overflow: auto; font-size: .78rem; white-space: pre-wrap; }
.grow-row { margin-bottom: 6px; }
table.imp td:last-child { min-width: 190px; }
table.imp td, table.imp th { white-space: normal; }


/* ===== الإصدار 2.2: الهوية الجديدة ===== */
h1, h2, h3, .d, .stat b, .page-head h1, .brand b { font-family: var(--display); font-weight: 600; letter-spacing: 0; }
h1 { font-size: 1.6rem; }
.page-head h1 { font-size: 1.7rem; }
.btn { border-radius: 8px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.mint { background: var(--mint); border-color: var(--mint); color: #062a1c; }
.btn.mint:hover { background: #4fdc9d; }
.btn.ghost { background: transparent; border-color: #ffffff4d; color: #eaf6f4; }
.btn.ghost:hover { background: #ffffff14; border-color: #ffffff80; }
.card { border-radius: var(--r); }
.table-wrap { border-radius: var(--r); }
th { background: #e9f1f1; }

/* القائمة الجانبية: زاوية «مسح» نعناعي بتعلّم الصفحة المفتوحة، واللوجو علامة مائية تحت */
.side { background: var(--ink); overflow-x: hidden; }
.side > * { position: relative; z-index: 1; }
.side .side-wm { display: none; position: absolute; z-index: 0; width: 230px; height: 230px; bottom: 70px; inset-inline-start: -70px; opacity: .06; pointer-events: none; filter: grayscale(1) brightness(3); }
.nav a { position: relative; border-radius: 8px; }
.nav a.on { background: #ffffff17; color: #fff; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; bottom: 7px; width: 9px; border: 3px solid var(--mint); border-inline-end: 0; border-radius: 3px 0 0 3px; }
.nav .sep { color: #7fa6a7; }
.brand b { font-size: 1.12rem; }

/* رأس اللوحات: إطار بزوايا زي إطار الكاميرا وقت مسح الكود */
.hero { position: relative; overflow: hidden; background: var(--ink); color: #e6f2f1; border-radius: 14px; padding: 26px 30px; margin-bottom: 18px; isolation: isolate; }
.hero .cn { position: absolute; width: 26px; height: 26px; border: 3px solid var(--mint); z-index: 2; }
.hero .cn.tl { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.hero .cn.tr { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.hero .cn.bl { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.hero .cn.br { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.hero .hero-wm { position: absolute; z-index: -1; width: 300px; height: 300px; left: 34%; top: 50%; transform: translateY(-50%) rotate(-8deg); opacity: .07; pointer-events: none; object-fit: contain; }
.hero-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 22px; }
.hero-t { min-width: 0; max-width: 62ch; }
.hero-t small { color: #9cc4c2; font-size: .88rem; }
.hero h1 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 4px 0 6px; line-height: 1.25; }
.hero p { margin: 0; color: #b9d4d3; }
.hero-a { margin-top: 16px; }
.hero-figs { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .fig { display: flex; flex-direction: column; min-width: 104px; padding: 10px 14px 8px; border-radius: 10px; background: #ffffff0f; border: 1px solid #ffffff1c; color: inherit; text-decoration: none; }
a.fig:hover { background: #ffffff1c; }
.hero .fig b { font-size: 2.1rem; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; }
.hero .fig span { font-size: .82rem; color: #a9c9c8; }
.hero .fig.ok b { color: var(--mint); }
@media (max-width: 640px) { .hero { padding: 22px 18px; } .hero .fig { min-width: 0; flex: 1 1 28%; } .hero .fig b { font-size: 1.6rem; } }

/* أرقام الملخص */
.stat { border-top: 1px solid var(--line); border-right: 4px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat b { font-size: 1.75rem; }
.stat.ok { border-right-color: var(--mint); } .stat.warn { border-right-color: #e2a72c; } .stat.bad { border-right-color: var(--bad); } .stat.late { border-right-color: var(--late); }
a.stat:hover { border-color: var(--accent); }

.dash.compact .card { padding: 12px; } .dash.compact { gap: 10px; } .dash.compact .grid2 { gap: 10px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.quick a:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick a i { font-style: normal; font-size: 1.4rem; }
.w-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.bar-col i { background: linear-gradient(var(--mint), var(--accent)); }

/* الدخول */
.login { background: var(--ink); position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; }
.login::before { content: ""; position: absolute; inset: 0; background: url(/icon.svg) no-repeat left -120px center / 520px; opacity: .06; filter: grayscale(1) brightness(3); }
.login .card { position: relative; box-shadow: 0 30px 70px #0007; border: 0; }
.login .card::before, .login .card::after { content: ""; position: absolute; width: 30px; height: 30px; border: 3px solid var(--mint); }
.login .card::before { top: -12px; right: -12px; border-left: 0; border-bottom: 0; border-top-right-radius: 9px; }
.login .card::after { bottom: -12px; left: -12px; border-right: 0; border-top: 0; border-bottom-left-radius: 9px; }

/* بدون اتصال */
.off-badge { position: fixed; bottom: 14px; left: 14px; z-index: 90; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: 0 8px 24px #0003; }
.off-badge.down { background: var(--bad); color: #fff; } .off-badge.down a { color: #fff; }
.off-badge.wait { background: #fff3d4; color: var(--warn); border: 1px solid #f0d78a; }
.lec-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: right; cursor: pointer; width: 100%; font: inherit; color: inherit; }
.lec-row:hover { border-color: var(--accent); }
tr.ok-row td { background: #eefaf3; }

/* ورقة التقارير والإعدادات الموروثة */
.inh { display: inline-block; font-size: .72rem; font-weight: 600; padding: 0 8px; border-radius: 999px; background: #eef3f3; color: var(--muted); border: 1px solid var(--line); vertical-align: middle; margin-inline-start: 6px; }
button.inh.own { background: var(--accent-soft); color: var(--accent); border-color: #b9dcda; cursor: pointer; }
.sep-line { border-top: 1px dashed var(--line); margin: 4px 0; }
.logo-row input.xlab { flex: 1; min-width: 120px; }
.logo-row select.xside { width: auto; }
.logo-xs { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; border-radius: 4px; }
.uni-cols { margin-bottom: 14px; }
.lhm { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 6px; border: 1px solid var(--line); border-bottom: 3px solid var(--accent); border-radius: 8px; padding: 10px; background: #fff; }
.lhm .r, .lhm .l { display: flex; gap: 4px; flex-wrap: wrap; } .lhm .l { justify-content: flex-end; }
.lhm img { width: 34px; height: 34px; object-fit: contain; }
.lhm .c { display: flex; flex-direction: column; align-items: center; text-align: center; } .lhm .c b { font-size: .9rem; } .lhm .c small { font-size: .7rem; color: var(--muted); }
.sig-layouts { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-l { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .86rem; min-width: 120px; }
.sig-l input { display: none; }
.sig-l .ic { font-size: .9rem; line-height: 1.1; color: var(--accent); text-align: center; letter-spacing: .1em; }
.sig-l.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.sig-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sig-row input { flex: 1 1 160px; }
.sig-row .num { width: 22px; text-align: center; color: var(--muted); }

/* إدخال الجدول في قالب */
.modal.xwide { width: min(1180px, 100%); }
table.sgrid { table-layout: fixed; min-width: 760px; }
table.sgrid th { text-align: center; }
table.sgrid td { padding: 4px; }
.gcell { width: 100%; min-height: 66px; border: 1px dashed var(--line); border-radius: 8px; background: #fafcfc; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); font: inherit; padding: 4px; }
.gcell:hover { border-color: var(--accent); color: var(--accent); }
.gcell.full { border-style: solid; border-inline-start: 4px solid var(--accent); background: #fff; color: var(--ink); align-items: flex-start; text-align: right; }
.gcell b { font-size: .86rem; line-height: 1.3; } .gcell span { font-size: .74rem; color: var(--accent); } .gcell small { font-size: .72rem; color: var(--muted); }
.per input[type=time] { width: auto; }

/* أماكن التسجيل */
.geo-wrap { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 700px) { .geo-wrap { grid-template-columns: 1fr; } }
.geo-plot { width: 100%; background: #f4f8f8; border-radius: 12px; border: 1px solid var(--line); }
.geo-plot .ring { fill: none; stroke: #c3d4d5; stroke-dasharray: 3 4; }
.geo-plot .zone { fill: #38c98a1f; stroke: var(--mint); }
.geo-plot .rl { font-size: 9px; fill: var(--muted); }
.geo-plot .ctr { fill: var(--ink); }
.geo-plot .pk { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.geo-plot .pf { fill: var(--bad); stroke: #fff; stroke-width: 1.5; }
.legend-row { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } .dot.pk { background: var(--accent); } .dot.pf { background: var(--bad); }

/* ===== 2.3.1: القائمة الجانبية بلون الشعار (أزرق مخضر غامق شوية)، والمؤسس يقدر يغيّره من «المظهر» ===== */
:root { --mint: #2fae78; --check: #7ee2a8; --side: #1f6670; --side-2: #18434b; --side-text: #e6f3f2; --side-line: #ffffff22; --hero: #e4f1f0; --hero-2: #d3e8e6; --hero-text: var(--ink); }
.side { background: linear-gradient(180deg, var(--side), var(--side-2)); color: var(--side-text); border-inline-end: 0; }
.side .brand { border-bottom-color: var(--side-line); }
.side .brand b { color: #fff; } .side .brand small { color: color-mix(in srgb, var(--side-text) 75%, transparent); }
.side .brand-logo { background: none; box-shadow: 0 0 0 1px #ffffff30; }
.nav a { color: color-mix(in srgb, var(--side-text) 92%, transparent); }
.nav a:hover { background: #ffffff17; color: #fff; }
.nav a.on { background: #ffffff24; color: #fff; }
.nav a.on::before { border-color: var(--check); }
.nav .sep { color: color-mix(in srgb, var(--side-text) 65%, transparent); }
.nav .sep.sp { border-top-color: var(--side-line); }
.side .who { border-top-color: var(--side-line); color: color-mix(in srgb, var(--side-text) 80%, transparent); }
.side .who b { color: #fff; }
.side .who button { border-color: #ffffff4d; color: var(--side-text); }
.side .who button:hover { background: #ffffff17; }
.side .who #inst { background: var(--check); border-color: var(--check); color: #0b3a2a; }
.cswitch { color: color-mix(in srgb, var(--side-text) 75%, transparent); }
.cswitch select { background: #ffffff1a; color: #fff; border-color: #ffffff40; }
.cswitch select option { color: var(--ink); }
@media (max-width: 860px) {
  .topbar { background: var(--side); color: #fff; border-bottom: 0; }
  .topbar button { color: #fff; }
}
.hero { background: linear-gradient(135deg, var(--hero), var(--hero-2)); color: var(--hero-text); border: 1px solid #c8dfdd; }
.hero h1 { color: var(--hero-text); }
.hero p, .hero-t small { color: #4d6a70; }
.hero .hero-wm { opacity: .07; }
.hero .fig { background: #ffffffb8; border-color: #c4dbd9; }
a.fig:hover { background: #fff; }
.hero .fig b { color: var(--ink); }
.hero .fig span { color: var(--muted); }
.hero .fig.ok b { color: #1d8a5c; }
.btn.mint { color: #fff; } .btn.mint:hover { background: #28a06d; }
.hero .btn.ghost { border-color: #9fc1bf; color: var(--ink); } .hero .btn.ghost:hover { background: #ffffff99; }
.login { background: var(--paper); }
.login::before { opacity: .045; filter: none; }
.login .card { box-shadow: 0 18px 50px #0e2f3722; border: 1px solid var(--line); }
.design-grid > div:last-child { position: sticky; top: 0; align-self: start; }
table.imp td:nth-child(2) { min-width: 170px; }
table.imp input[type=time] { width: auto; min-height: 32px; padding: 2px 4px; }
.hero .hero-wm { opacity: .05; }
.theme-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tcol { display: flex; align-items: center; gap: 8px; font-size: .86rem; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.tcol input[type=color] { width: 34px; height: 28px; border: 0; padding: 0; background: none; flex: none; }
.sw-mini { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.nav-ed { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.nav-ed-h { justify-content: space-between; }
.nav-ed-l { gap: 6px; flex-wrap: nowrap; } .nav-ed-l input[type=text] { flex: 1; min-width: 120px; min-height: 34px; }
.nav-ed-l.off { opacity: .5; } .nav-ed-l .ic { width: 22px; text-align: center; }
@media (max-width: 640px) { .nav-ed-l { flex-wrap: wrap; } }
.sugg { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sg-i { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; text-align: right; background: var(--card); border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; }
.sg-i:hover { background: var(--accent-soft); }
.sg-i.add { color: var(--accent); font-weight: 700; justify-content: flex-start; border-bottom: 0; }
.stu-group h3 { color: var(--accent); }
.dup-g { padding: 10px 12px; }

/* 2.4: محاضرات الجدول بالحالة (أخضر عليك، برتقالي متأجلة، أحمر ملغية، أزرق التسجيل شغال) */
.sched { border-inline-start-width: 5px; }
.sched.st-ok { border-inline-start-color: var(--ok); }
.sched.st-late { border-inline-start-color: var(--late); background: #fff9f3; }
.sched.st-bad { border-inline-start-color: var(--bad); background: #fff7f6; }
.sched.st-live { border-inline-start-color: #2f5fa8; background: #f3f7ff; }
.sched.st-muted { border-inline-start-color: #c4cfcd; opacity: .85; }
.sched .strike { text-decoration: line-through; color: var(--muted); }
.sched .row.wrap { flex-wrap: wrap; justify-content: flex-end; }
.chg-note { margin-top: 6px; font-size: .86rem; padding: 6px 10px; border-radius: 6px; background: var(--late-soft); color: var(--late); display: inline-block; }
.chg-note.bad { background: var(--bad-soft); color: var(--bad); }
.chg-note small { color: inherit; opacity: .8; }
.pill.live.st { animation: none; }
.sch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .8rem; color: var(--muted); }
.sch-legend .d { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-end: -10px; }
.sch-legend .d.ok { background: var(--ok); } .sch-legend .d.late { background: var(--late); } .sch-legend .d.bad { background: var(--bad); } .sch-legend .d.live { background: #2f5fa8; }
#cgA .chip { font-size: .95rem; }

/* 2.5: تحديد مواعيد الجدول للمسح */
.selecting .slot { position: relative; }
.selecting .slot::after { content: ''; position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 4px; background: #fff; }
.selecting .slot.picked { background: #fdecea; border-color: #c0392b; }
.selecting .slot.picked::after { content: '✓'; background: #c0392b; border-color: #c0392b; color: #fff; font-size: 13px; line-height: 15px; text-align: center; }
.stat span { color: var(--muted); font-size: .85rem; }
.conf { border: 1px solid #f1c0ba; background: #fdf3f2; border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }

/* 2.5: شريط «داخل كلية» (مشاهدة / تعديل) */
.viewbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 10px 14px; margin: -4px 0 14px;
  border-radius: 8px; background: #eef4ff; border: 1px solid #c9d8f2; color: #1d3e6e; font-size: .92rem; }
.viewbar.edit { background: var(--warn-soft); border-color: #f0d78a; color: var(--warn); }
/* الإعدادات العامة: كروت الموديولات */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mod-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r, 10px); background: var(--card); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.mod-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mod-card i { font-style: normal; font-size: 1.7rem; }
.mod-card span { color: var(--muted); font-size: .85rem; }
/* كروت الكليات في لوحة الجامعة */
.col-card.has-alert { border-color: #f0d78a; }
.col-card .bars { display: grid; gap: 6px; }
.col-card .bars > div { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; font-size: .8rem; }
.col-card .bars i { height: 7px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; }
.col-card .bars i::after { content: ''; position: absolute; inset: 0; width: var(--w); background: var(--mint, #2fae78); border-radius: 4px; }
.col-card .alerts { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-stats .ok { color: var(--ok); font-weight: 600; }
td.ok { color: var(--ok); font-weight: 700; }
/* طلبات تعديل الحضور */
.card.req ul { margin: 6px 0; padding-inline-start: 20px; }
.late-btn[disabled] { opacity: .55; cursor: not-allowed; }
.late-btn small { font-weight: 400; font-size: .78rem; }
.sim-g { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.back-row { margin: -4px 0 8px; display: flex; gap: 8px; align-items: center; }
/* 2.8.2: زرار الرجوع والمساعدة: مربعين بنفس المقاس، بلون مميز وسط الأخضر (يتغير من «المظهر») */
:root { --ib1: #ff8a4c; --ib2: #ec6a2c; --ib3: #d9531a; --ib-glow: rgba(236, 106, 44, .5); }
.ibtn { width: 46px; height: 46px; min-width: 46px; box-sizing: border-box; border: 0; padding: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; cursor: pointer; line-height: 1; font-weight: 900;
  background: linear-gradient(160deg, var(--ib1) 0%, var(--ib2) 55%, var(--ib3) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 12px var(--ib-glow); transition: transform .12s, filter .12s; }
.ibtn:hover { filter: brightness(1.06); color: #fff; } .ibtn:active { transform: scale(.95); }
.ibtn:focus-visible { outline: 3px solid var(--ib1); outline-offset: 2px; }
.ib-back span { display: inline-block; transform: scaleX(-1); font-size: 34px; }
.help-q span { font-size: 38px; }
.ib-flat .ibtn, .ibtn.flat { background: var(--ib2); box-shadow: none; }
@media (max-width: 640px) { .ibtn { width: 42px; height: 42px; min-width: 42px; } .ib-back span { font-size: 30px; } .help-q span { font-size: 33px; } }

/* 2.6 */
.nav a em.nb { margin-inline-start: auto; background: var(--bad, #c0392b); color: #fff; font-style: normal; border-radius: 99px; font-size: .7rem; padding: 0 7px; line-height: 1.6; }
.card.note.new { border-inline-start: 4px solid var(--accent); }
a.card { text-decoration: none; color: inherit; display: block; }
.quick .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; }
.dist { display: flex; gap: 2px; align-items: flex-end; height: 22px; justify-content: center; margin-top: 2px; }
.dist i { width: 6px; background: var(--accent); border-radius: 2px; opacity: .7; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--accent-soft); }
.msg.me { background: var(--accent-soft); border-radius: 10px; padding: 6px 10px; }
.msg small { color: var(--muted); display: block; font-size: .78rem; }

/* 2.6.1: جامعة العرض */
.viewbar.demo-bar { background: #fdecea; border-color: #f5b7b1; color: #922b21; }
@media print {
  body.demo-ent::after { content: 'نسخة عرض — بيانات وهمية'; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 9999;
    font: 700 64px/1.2 sans-serif; color: rgba(200, 30, 30, .13); transform: rotate(-30deg); white-space: nowrap; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 2.7.1: أزرار التكبير والكشاف فوق الكاميرا */
.cam video { transform-origin: center; transition: transform .1s; }
.cam-ctl { position: absolute; top: 8px; inset-inline: 8px; display: flex; gap: 6px; align-items: center; direction: ltr; z-index: 3; }
.cam-ctl button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.cam-ctl input[type=range] { flex: 1; accent-color: #fff; }
/* 2.7.1: شريط التراجع والإعادة */
.undo-bar { display: none; position: sticky; top: 0; z-index: 5; gap: 8px; align-items: center; padding: 6px 8px; margin-bottom: 8px; background: var(--card, #fff); border: 1px solid var(--line, #ddd); border-radius: 10px; box-shadow: 0 2px 8px #0001; }
.undo-bar.show { display: flex; }
.undo-bar [data-st] { color: #b45309; font-weight: 600; }
.cpairs { display: inline-flex; direction: ltr; gap: .55em; unicode-bidi: isolate; } .cpairs i { font-style: normal; }
.date-words { display: block; color: var(--muted, #667); font-size: .8rem; margin-top: 2px; }
/* 2.7.2: «جدولي» بشكل «إدخال في قالب»، وكل نوع بلون */
.kc-k0 { --kc: #1F6F78; --kf: #E6F3F1; } .kc-k1 { --kc: #2F7EC7; --kf: #E3F0FB; } .kc-k2 { --kc: #D9822B; --kf: #FDEBD8; }
.kc-k3 { --kc: #7A5BC4; --kf: #EEE7F8; } .kc-k4 { --kc: #C2457A; --kf: #FBE5EE; } .kc-k5 { --kc: #6B7785; --kf: #EEF0F2; }
.my-sgrid tbody th { background: var(--soft, #f4f9f9); }
.my-sgrid .gcell { cursor: default; margin-bottom: 4px; }
.my-sgrid .gcell:hover { border-color: var(--line); color: var(--muted); }
.my-sgrid .gcell.full { border-inline-start: 4px solid var(--kc); background: linear-gradient(to left, var(--kf), #fff 70%); }
.my-sgrid .gcell.full:hover { border-color: var(--line); border-inline-start-color: var(--kc); color: var(--ink); }
.my-sgrid .gcell.full span { color: var(--kc); font-weight: 600; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; font-size: .9rem; }
.kkey i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; margin-inline-end: 5px; background: var(--kf); border: 2px solid var(--kc); }
.pill.kc-k0, .pill.kc-k1, .pill.kc-k2, .pill.kc-k3, .pill.kc-k4, .pill.kc-k5 { background: var(--kf); color: var(--kc); }
/* 2.7.2: واجهة الموظف */
section.card a.note { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; border: 1px solid var(--line); }
section.card a.note.new { border-inline-start: 4px solid var(--accent); }
.mod-card i { font-style: normal; font-size: 1.5rem; }
/* 2.7.2: القفل التلقائي */
.lock-screen { position: fixed; inset: 0; z-index: 9999; background: rgba(12, 40, 45, .55); backdrop-filter: blur(9px); display: grid; place-items: center; padding: 16px; }
.lock-box { width: min(380px, 100%); text-align: center; align-items: stretch; }
.lock-warn { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 9998; display: flex; gap: 12px; align-items: center; background: var(--card, #fff); border: 1px solid #f0c36d; border-inline-start: 5px solid #d9822b; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 20px #0002; }
/* 2.7.2: اسم الكلية والجامعة تحت الترحيب */
.hero-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; font-size: 1.05rem; }
.hero-brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.hero-brand span { color: var(--muted, #557); }
/* 2.7.2: المستخدم المشترك بين كليات */
.shared-bar { border-inline-start: 6px solid var(--cc, var(--accent)); }
.shared-bar img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; border-radius: 6px; background: #fff; }
.shared-bar select { padding: 4px 8px; border-radius: 8px; }
.uni-card { border-top: 5px solid var(--cc); }
.uni-card img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--accent)); margin-inline-end: 5px; vertical-align: middle; font-style: normal; }
.col-filter .chip.on { border-color: var(--cc, var(--accent)); }
.ctag { font-weight: 600; color: var(--cc) !important; }
.task-row { align-items: center; gap: 12px; color: inherit; text-decoration: none; border-inline-start: 5px solid var(--cc); }
.my-sgrid .gcell.clash { outline: 2px solid #c0392b; outline-offset: -2px; }
.shared-bar { flex-wrap: wrap; }
.shared-bar .row { flex-wrap: nowrap; gap: 8px; }
.shared-bar select { width: auto; max-width: 230px; }
.btn.link { background: none; border: 0; color: var(--accent); padding: 4px; text-decoration: underline; box-shadow: none; }
.diag-row { border-inline-start: 5px solid var(--line); padding: 10px 14px; }
.diag-row.ok { border-color: #3c8d4f; } .diag-row.warn { border-color: #d9822b; } .diag-row.bad { border-color: #c0392b; } .diag-row.info { border-color: #2f7ec7; }
.diag-bad { border-top: 5px solid #c0392b; } .diag-ok { border-top: 5px solid #3c8d4f; }
.bulk-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 14px; background: var(--ink, #12343a); color: #fff; border-radius: 14px; box-shadow: 0 8px 24px #0003; }
.bulk-bar .btn { background: #fff2; color: #fff; border-color: #fff4; }
/* 2.7.2: الاختيار الموحّد */
.mp { position: relative; }
.mp-btn { width: 100%; text-align: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); font: inherit; cursor: pointer; }
.mp-btn::after { content: '▾'; float: left; color: var(--muted); }
.mp-btn.on { border-color: var(--accent); font-weight: 600; }
.mp-pop { position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline: 0; min-width: 240px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px #0002; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mp-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.mp-g { font-size: .78rem; color: var(--muted); margin-top: 6px; font-weight: 700; }
.my-sgrid .gcell.act { cursor: pointer; }
.my-sgrid .gcell.act:hover { box-shadow: 0 3px 10px #0002; }
.my-sgrid .gcell.free { cursor: pointer; min-height: 66px; color: #9aa; }
.my-sgrid .gcell.free:hover { border-color: var(--accent); color: var(--accent); background: #f2fbf9; }
.my-sgrid .gcell.free small::before { content: '＋ '; }
/* 2.8.2: أزرار شكل الرابط (القوالب المحفوظة في «المظهر») */
.linkish { background: none; border: 0; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
/* 2.8.2: اختيار الصلاحيات في مجموعات */
.pp-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.pp-g { border: 1px solid var(--line, #dfe7e7); border-radius: 10px; padding: 6px 10px 8px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pp-g legend { padding: 0 4px; }
.pp-i { font-size: .92rem; }
.pp-i .pp-d { font-style: normal; font-size: .78rem; font-weight: 700; }
.pp-i.plus .pp-d { color: #1c8a55; } .pp-i.minus .pp-d { color: #c0392b; }
.pp-tools { gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pp-tools select, .pp-tools input { max-width: 240px; width: auto; }
.pp-sum { margin-top: 8px; background: var(--accent-soft, #e6f2f1); border-radius: 8px; padding: 8px 10px; line-height: 1.8; }
/* 2.8.2: «🧩 ورشة الجدول» */
.wk-bar { margin-bottom: 12px; }
.wk-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .82rem; color: var(--muted, #5b6b6c); }
.wk-lg { display: inline-flex; align-items: center; gap: 5px; }
.wk-lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--wk); }
.wk-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .wk-wrap { grid-template-columns: 1fr; } }
.wk-gridbox { padding: 8px; overflow: auto; }
.wk-grid { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; }
.wk-grid th { font-size: .85rem; color: var(--ink-2, #24474d); font-weight: 700; padding: 4px; white-space: nowrap; }
.wk-grid tbody th { width: 70px; }
.wk-cell { vertical-align: top; background: #f6faf9; border: 1px dashed #cfdedc; border-radius: 8px; min-width: 120px; height: 74px; padding: 4px; transition: background .12s, border-color .12s; }
.wk-cell.over { border-style: solid; border-color: var(--accent); }
.wk-cell.fit-ok { background: #e3f7ec; border-color: #38c98a; }
.wk-cell.fit-no { background: #fdeaea; border-color: #e07a7a; }
.wk-card { --wk: #2fae78; background: #fff; border: 1px solid #dfe7e7; border-inline-start: 5px solid var(--wk); border-radius: 7px; padding: 4px 6px; margin-bottom: 4px; font-size: .78rem; line-height: 1.45; cursor: pointer; display: flex; flex-direction: column; }
.wk-card b { font-size: .84rem; } .wk-card small { color: #6b7b7c; } .wk-card span { color: #3c4f52; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-card[draggable="true"] { cursor: grab; } .wk-card.dragging { opacity: .4; }
.wk-card.focus { outline: 3px solid var(--ib2, #ec6a2c); outline-offset: 1px; }
.s-ok { --wk: #2fae78; } .s-lecturer { --wk: #d93a3a; } .s-place { --wk: #ee8a1a; } .s-group { --wk: #8b4fc9; } .s-capacity { --wk: #c97a00; } .s-missing { --wk: #e3c11b; } .s-duplicate { --wk: #9aa3a5; }
.wk-card.s-lecturer { background: #fff4f4; } .wk-card.s-place { background: #fff8ef; } .wk-card.s-group { background: #f8f2fe; }
.wk-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 10px; }
.wk-side h3 { margin: 0; font-size: 1rem; }
.wk-uns { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow: auto; }
.wk-chip { background: #fff; border: 1px solid #dfe7e7; border-inline-start: 5px solid var(--accent); border-radius: 7px; padding: 5px 8px; display: flex; flex-direction: column; font-size: .82rem; cursor: grab; }
.wk-pr { display: flex; flex-direction: column; gap: 5px; max-height: 40vh; overflow: auto; }
.wk-p { text-align: start; background: #fff; border: 1px solid #e6eaea; border-inline-start: 4px solid var(--wk); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: .8rem; cursor: pointer; }
.wk-p:hover { background: #f4f8f8; }
/* 2.8.3: شاشات بتفتح صفحة كاملة (إدخال في قالب، توزيع المحاضرين، استيراد الجدول) وفيها زرار الرجوع */
.modal-back.full { padding: 0; place-items: stretch; }
.modal-back.full .modal { width: 100% !important; max-width: none; height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
.modal-back.full .mhead { gap: 12px; justify-content: flex-start; position: sticky; top: 0; z-index: 2; }
.modal-back.full .mbody { flex: 1; overflow: auto; }
.modal-back.full .foot { position: sticky; bottom: 0; background: var(--card, #fff); }
/* 2.8.3: الورشة: عمود الأيام وصف الفترات ثابتين وإنت بتحرّك الشبكة */
.wk-gridbox { max-height: calc(100vh - 150px); }
.wk-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--card, #fff); box-shadow: 0 2px 0 #e3ecec; }
.wk-grid tbody th { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--card, #fff); box-shadow: 8px 0 0 var(--card, #fff), -2px 0 0 #e3ecec; } /* 2.8.3: بيغطي الفراغ اللي على يمينه علشان المواعيد ماتبانش من وراه */
.wk-gridbox { padding-inline-start: 0; }
.wk-grid thead th:first-child { inset-inline-start: 0; z-index: 4; box-shadow: 8px 0 0 var(--card, #fff), 0 2px 0 #e3ecec; }

/* 2.8.4: سجل العمليات بالشجرة */
.aud-wrap { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; margin-top: 12px; }
.aud-tree { position: sticky; top: 8px; max-height: calc(100vh - 40px); overflow: auto; padding: 10px 12px; font-size: .92rem; }
.aud-tree h3 { margin: 0 0 8px; font-size: 1rem; }
.aud-tree details { margin-inline-start: 6px; } .aud-tree details details { margin-inline-start: 14px; }
.aud-tree summary { cursor: pointer; padding: 3px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aud-tree a { cursor: pointer; color: inherit; text-decoration: none; } .aud-tree a.on, .aud-all.on { font-weight: 800; color: var(--primary, #1f6f78); }
.aud-day { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 3px 8px; margin-inline-start: 18px; border-radius: 8px; }
.aud-day:hover, .aud-day.on { background: #e6f6f1; }
.aud-all { border: 0; background: none; font: inherit; cursor: pointer; padding: 2px 0; }
.aud-n { font-size: .78rem; background: #eef3f4; border-radius: 999px; padding: 0 7px; color: #47606a; }
.aud-b { font-size: .72rem; border-radius: 999px; padding: 0 6px; } .aud-b.del { background: #fde2dd; } .aud-b.att { background: #fff1c9; } .aud-b.set { background: #e3ecfb; }
tr.aud-delete td { background: #fff4f2; } tr.aud-attendance td { background: #fffbea; } tr.aud-settings td { background: #f3f7fe; }
.aud-filters .row.wrap { flex-wrap: wrap; gap: 8px; align-items: end; }
.pager { justify-content: center; gap: 12px; margin-top: 10px; align-items: center; }
@media (max-width: 900px) { .aud-wrap { grid-template-columns: 1fr; } .aud-tree { position: static; max-height: 320px; } }

/* 2.8.4: أمان الحساب */
.codes-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; background: #f4f8f8; padding: 12px; border-radius: 10px; direction: ltr; }
.codes-box code { font-size: 1.15rem; letter-spacing: 1px; text-align: center; background: #fff; border-radius: 6px; padding: 4px; }
.tfa-qr svg { width: 190px; height: 190px; display: block; margin: 8px auto; background: #fff; padding: 6px; border-radius: 8px; }

.viewbar.pv-bar { background: #fff3e6; border-color: #f2b27c; } /* 2.8.4 */
.aud-filters select { width: auto; min-width: 200px; flex: 0 1 260px; } .aud-filters #aQ { flex: 1 1 320px; } /* 2.8.4 */

/* 2.8.5: الأصوات */
.snd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 10px; }
.snd-card h3 { margin: 0; font-size: 1rem; }
.snd-opts { display: grid; gap: 6px; }
.snd-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line, #dde5e5); border-radius: 8px; cursor: pointer; }
.snd-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.snd-opt > span { flex: 1; }
.snd-opt small { display: block; color: var(--muted, #6b7c80); font-size: .8rem; }
.why-res { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; background: color-mix(in srgb, var(--mint) 12%, transparent); }
.why-res.warn { background: #fff4d6; } .why-res.bad { background: #fde3e0; }
.why-list { margin: 4px 0; padding-inline-start: 22px; line-height: 1.9; }
.btn.tiny { padding: 1px 6px; font-size: .8rem; min-height: 0; line-height: 1.6; }
.setup-steps { list-style: none; padding: 0; display: grid; gap: 8px; margin: 12px 0; }
.setup-steps li.done { opacity: .78; }
.health-row .pill { margin-inline-end: 4px; }
.meter { height: 8px; background: #e7eeee; border-radius: 6px; overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--mint); }
.opq-chip { position: fixed; inset-inline-start: 14px; bottom: 14px; z-index: 110; border: 0; border-radius: 99px; padding: 8px 14px; background: #fff4d6; color: #6b4b00; box-shadow: 0 4px 14px rgba(0,0,0,.15); font: inherit; cursor: pointer; }
.opq-chip.bad { background: #fde3e0; color: #7a1c12; }
.tour-back { position: fixed; inset: 0; z-index: 300; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 30, 35, .55); outline: 3px solid var(--mint); transition: all .25s ease; pointer-events: none; }
.tour-tip { position: fixed; background: var(--card, #fff); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: top .25s, left .25s; }
.tour-tip p { margin: 6px 0 10px; line-height: 1.8; }

/* 2.8.6: زرار تنبيه الغائبين مميز بالأخضر، ومقفول لحد ما يجي وقته */
.btn.absent-btn { background: linear-gradient(160deg, #22b573, #149a5c); color: #fff; border-color: #128a52; font-weight: 700; }
.btn.absent-btn[disabled] { background: var(--bg2, #eef2f1); color: var(--muted, #7a8a85); border-color: var(--line); cursor: not-allowed; opacity: .8; }

/* 2.8.6: «جدولي» كروت، والتغييرات المؤقتة */
.sch-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sch-day.today { outline: 2px solid var(--accent); }
.sch-it { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; margin-top: 6px; border-inline-start: 4px solid var(--accent, #0f766e); background: var(--bg2, #f6f8f7); }
.sch-it.act { cursor: pointer; } .sch-it.act:hover { filter: brightness(.97); } .sch-it > b.num { font-size: .85rem; color: var(--muted, #667); white-space: nowrap; }
.sch-tmp { gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 6px; }
.sch-tmp.cancel b { text-decoration: line-through; opacity: .7; }

/* 2.8.10: تصميم التقارير: الإعدادات جنب المعاينة الحية */
.dz-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.dz-prev { position: sticky; top: 10px; }
.dz-frame { width: 100%; height: 76vh; border: 1px solid var(--line); border-radius: 10px; background: #e9eef0; }
.gx-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 1000px) { .dz-wrap { grid-template-columns: 1fr; } .dz-prev { position: static; } .dz-frame { height: 70vh; } }
/* 2.8.11: سجل المستندات، والاستبيانات، والتقرير الشهري، والتقييم، وسجل العمليات بالكروت */
.alert.ok { background: var(--ok-soft, #e6f4ec); color: var(--ok, #0b7a4b); border-color: #a9d8bd; }
.doc-card.cancelled { opacity: .78; border-inline-start: 4px solid var(--bad, #b42318); }
.scan-box { max-width: 420px; margin: 0 auto; }
.sv-q { padding: 10px; } .sv-q .row { gap: 6px; } .sv-q textarea { width: 100%; margin-top: 6px; }
.sv-bar { display: inline-block; width: 120px; height: 9px; background: var(--line); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.sv-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 2px; text-align: center; } .kpi b { font-size: 1.9rem; line-height: 1.2; } .kpi small { color: var(--muted); }
.kpi small.ok, .chip .ok { color: var(--ok, #0b7a4b); } .kpi small.bad, .chip .bad { color: var(--bad, #b42318); }
.rt-trend { display: flex; gap: 14px; align-items: flex-end; overflow-x: auto; padding-top: 6px; }
.rt-trend div { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; } .rt-trend i { width: 24px; background: var(--accent); border-radius: 6px 6px 2px 2px; display: block; }
.rt-trend small { color: var(--muted); font-size: .72rem; text-align: center; }
.rt-card { display: flex; flex-direction: column; gap: 8px; } .rt-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.rt-avg { font-size: 1.6rem; font-weight: 800; } .rt-avg small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.aud-cards { display: flex; flex-direction: column; gap: 8px; }
.aud-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--card, #fff); border: 1px solid var(--line); border-inline-start: 4px solid var(--aud-c, var(--line)); }
.aud-card .ai { font-size: 1.25rem; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--aud-c, #888) 14%, transparent); flex: none; }
.aud-card .ab { flex: 1; min-width: 0; } .aud-card .at { font-weight: 700; } .aud-card .ad { color: var(--muted); font-size: .86rem; word-break: break-word; }
.aud-card .aw { color: var(--muted); font-size: .8rem; white-space: nowrap; text-align: left; }
.aud-day-h { font-weight: 800; color: var(--muted); margin: 10px 2px 2px; font-size: .9rem; }
@media print { .mo-kpis .kpi { break-inside: avoid; } }
/* 2.8.13: «الزرار الذكي» الموحّد: 🔴 مش متاح · 🟢 متاح (نبض، وصوت مرة واحدة) · 🔵 خلصت. ومعاه علامة وكلمة علشان اللي مابيفرّقش الألوان */
.sbtn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--sbc); background: var(--sbb); color: var(--sbt); border-radius: 12px; padding: 6px 12px 6px 10px; font: inherit; cursor: pointer; line-height: 1.25; text-align: start; min-height: 44px; transition: transform .12s, box-shadow .2s; }
.sbtn .sb-t { display: flex; flex-direction: column; } .sbtn .sb-t b { font-size: .92rem; } .sbtn .sb-t small { font-size: .74rem; opacity: .9; }
.sbtn .sb-ic { font-size: 1.25rem; }
.sbtn .sb-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sbc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sbc) 25%, transparent); flex: none; }
.sb-off { --sbc: #d64545; --sbb: #fff3f2; --sbt: #8f2626; cursor: default; }
.sb-on { --sbc: #17a34a; --sbb: #ecfbf1; --sbt: #0d5c2b; box-shadow: 0 0 0 0 rgba(23, 163, 74, .5); animation: sbPulse 1.8s ease-out infinite; }
.sb-on:hover { transform: translateY(-1px); }
.sb-done { --sbc: #2563eb; --sbb: #eef4ff; --sbt: #1d3f8f; }
.sb-new { animation: sbPulse .6s ease-out 4, sbNudge .5s ease-in-out 2; }
@keyframes sbPulse { 0% { box-shadow: 0 0 0 0 rgba(23, 163, 74, .55); } 70% { box-shadow: 0 0 0 12px rgba(23, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 163, 74, 0); } }
@keyframes sbNudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .sb-on, .sb-new { animation: none; } }
/* 2.8.13: ألوان مشاكل الورشة أوضح، ومع كل نوع علامة جوه الكارت */
.s-ok { --wk: #1f9d61; } .s-lecturer { --wk: #d42020; } .s-place { --wk: #e86a00; } .s-group { --wk: #7c3aed; } .s-capacity { --wk: #b45309; } .s-avail { --wk: #be185d; } .s-missing { --wk: #ca9a00; } .s-duplicate { --wk: #6b7280; }
.wk-card { border-inline-start-width: 7px; }
.wk-card.s-lecturer, .wk-card.s-place, .wk-card.s-group { border: 2px solid var(--wk); border-inline-start-width: 7px; }
.wk-card.s-lecturer { background: #ffecec; } .wk-card.s-place { background: #fff1e3; } .wk-card.s-group { background: #f3ecff; } .wk-card.s-capacity { background: #fff6e6; } .wk-card.s-avail { background: #fdecf4; } .wk-card.s-missing { background: #fffbe6; } .wk-card.s-duplicate { background: #f3f4f6; }
.wk-card .wk-ic { float: inline-end; font-size: .9rem; }
.wk-lg { font-weight: 600; } .wk-lg i { width: 16px; height: 16px; border-radius: 4px; }
.wk-with { border: 1px solid #e3e8e8; border-inline-start: 5px solid var(--wk); border-radius: 8px; padding: 6px 8px; margin: 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wk-with .grow { flex: 1; }
.wk-opt { border: 1px solid #d9e6e6; border-radius: 8px; padding: 6px 8px; display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.wk-opt .grow { flex: 1; } .wk-opt small { display: block; color: #5b6b6c; }
/* 2.8.14: «📷 سجّل حضوري» في القائمة */
.act-sb { padding: 6px 12px 2px; } .act-sb .sbtn { width: 100%; } .act-sb .sbtn .sb-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.act-tb { margin-inline-start: auto; border: 2px solid var(--sbc); background: var(--sbb); border-radius: 10px; padding: 4px 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 1.05rem; min-height: 36px; }
.act-tb .sb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sbc); }
.act-tb.sb-on { animation: sbPulse 1.8s ease-out infinite; }
/* 2.8.15: «▶ افتح مكانه»: دايرة نيلي (لون «الانتقال لمكان تاني» في كل البرامج، ومختلف عن ألوان البرنامج التانية) */
.btn-go { --go1: #6366f1; --go2: #4f46e5; width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff !important; text-decoration: none;
  background: linear-gradient(160deg, var(--go1), var(--go2)); box-shadow: 0 2px 6px rgba(79, 70, 229, .35); transition: transform .12s, box-shadow .12s; vertical-align: middle; flex: none; }
.btn-go svg { width: 16px; height: 16px; margin-inline-start: 2px; }
.btn-go:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(79, 70, 229, .45); }
table .btn-go { width: 26px; height: 26px; min-width: 26px; }
@media (pointer: coarse) { .btn-go { width: 40px; height: 40px; min-width: 40px; } table .btn-go { width: 36px; height: 36px; min-width: 36px; } }
[data-theme="dark"] .btn-go { --go1: #a5b4fc; --go2: #818cf8; color: #1e1b4b !important; }
.go-flash { animation: goFlash 2s ease-out 1; }
@keyframes goFlash { 0%, 30% { background: #e0e7ff; box-shadow: 0 0 0 3px #a5b4fc; } 100% { background: inherit; box-shadow: none; } }
/* 2.8.15: «🗂 السجلات» */
.rec-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.rec-tabs a { padding: 7px 12px; border-radius: 999px; background: #eef4f4; color: #234; text-decoration: none; font-size: .9rem; border: 1px solid #dde8e8; }
.rec-tabs a.on { background: var(--brand, #15707b); color: #fff; border-color: transparent; }
.rec-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eef2f2; }
.rec-row .grow { flex: 1; min-width: 0; } .rec-row small { display: block; color: #667; }
.vchk { border-radius: 14px; padding: 14px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.vchk.ok { background: #eafaf1; color: #0b7a4b; } .vchk.bad { background: #fdeceb; color: #b42318; } .vchk.warn { background: #fff7e6; color: #9a6700; }
.aud-fold > summary { cursor: pointer; padding: 8px 10px; border-radius: 10px; background: #f3f7f7; margin: 6px 0; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aud-fold > summary::-webkit-details-marker { display: none; } .aud-fold > summary::before { content: '📁'; } .aud-fold[open] > summary::before { content: '📂'; }
.aud-fold .aud-fold { margin-inline-start: 14px; } .aud-fold .fs { color: #667; font-size: .82rem; }
.aud-card .rep { font-size: .78rem; background: #e7eef0; border-radius: 999px; padding: 1px 7px; margin-inline-start: 6px; }
.claim { font-size: .8rem; }

/* 2.8.16: سطر المالك والشركة */
.owner-line { margin: 6px 0 0; font-size: .72rem; color: var(--muted, #6b7c7f); text-align: center; opacity: .85; }
.side .owner-line { color: inherit; opacity: .6; }
.id-logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 18px #0002; }
.id-sw { display: flex; gap: 6px; flex-wrap: wrap; }
.id-sw button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px #0002; cursor: pointer; }
.id-tone { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.id-tone label { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--line, #dde5e4); border-radius: 10px; cursor: pointer; }
.id-tone label:has(input:checked) { border-color: #4f46e5; background: #eef2ff; }
.id-tone .pl { margin-inline-start: auto; border: 0; background: none; cursor: pointer; font-size: 1rem; }

/* 2.8.17: أوقات المحاضرين و«🪄 رتّب لوحده» */
.av-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.av-k { padding: 3px 10px; border-radius: 999px; font-size: .85rem; border: 1px solid var(--line, #dde5e4); }
.av-grid { border-collapse: separate; border-spacing: 4px; }
.av-grid th { font-weight: 700; padding: 4px 6px; white-space: nowrap; }
.av-c { width: 100%; min-width: 74px; min-height: 52px; border-radius: 10px; border: 1px solid var(--line, #dde5e4); background: #f2faf6; cursor: pointer; font-size: 1.05rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.av-c small { font-size: .72rem; color: #4b5b5e; }
.av-c.av-prefer, .av-k.av-prefer { background: #fff7d6; border-color: #e8c547; }
.av-c.av-no, .av-k.av-no { background: #fde8ec; border-color: #e88a9c; }
.av-k.av- { background: #f2faf6; }
.wk-chip.pend { border-style: dashed; position: relative; padding-inline-end: 26px; }
.wk-x { position: absolute; inset-inline-end: 4px; top: 4px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; color: #888; }
.ar-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.ar-st { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; }
.ar-st span { background: #f4f7f7; border-radius: 8px; padding: 3px 8px; }
.ar-q { font-weight: 800; border-radius: 999px; padding: 4px 12px; }
.ar-q.ok { background: #dcf5e8; color: #11643f; } .ar-q.mid { background: #fff3cd; color: #7a5a00; } .ar-q.low { background: #fde2e2; color: #8b1d1d; }
.ok-t { color: #11643f; font-weight: 700; } .bad-t { color: #b42318; font-weight: 700; }
@media (max-width: 640px) { .av-c { min-width: 54px; min-height: 46px; } .av-grid th { font-size: .8rem; padding: 2px; } }

/* 2.8.18: «📋 المطلوب في الأسبوع» وطلب الأوقات */
.wkly-t td, .wkly-t th { text-align: center; }
.wkly-t td:first-child { text-align: start; }
.wkly-t tr.grp th { background: #f4f7f7; text-align: start; }
.wkly { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line, #dde5e4); border-radius: 10px; padding: 2px 4px; }
.wkly.need { border-color: #e8a33d; background: #fff7e8; }
.wkly button { border: 0; background: none; cursor: pointer; font-size: .95rem; min-width: 28px; min-height: 28px; }
.wkly b { min-width: 18px; display: inline-block; }
.av-req { background: #f6f9ff; }

/* 2.8.18: «📖 المعايير» */
.std-c summary { cursor: pointer; padding: 4px 0; }
.std-d { background: #f4f8fb; border-inline-start: 4px solid #4f6fd8; padding: 8px 12px; border-radius: 8px; line-height: 1.9; }
.std-i { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.std-i li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.8; }
.std-n { background: #eef2ff; color: #3730a3; border-radius: 8px; padding: 2px 8px; font-weight: 700; white-space: nowrap; }
.std-h { font-size: .85rem; color: #555; margin-top: 2px; }
.std-h.auto { color: #11643f; font-weight: 600; }

/* 2.8.18: الاستبيانات: الأجزاء والرسوم */
.sv-sec { font-weight: 800; color: #3730a3; margin-top: 6px; }
.sv-ch { width: 100%; max-width: 620px; height: auto; }
.sv-ch .t { font: 600 13px system-ui, Tahoma, sans-serif; fill: #233; } .sv-ch .v { font: 700 11px system-ui, Tahoma, sans-serif; fill: #fff; } .sv-ch .l { font: 11px system-ui, Tahoma, sans-serif; fill: #778; }
.sv-dist { display: grid; gap: 8px; margin-top: 8px; }
.sv-dr { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: 10px; align-items: center; font-size: .88rem; }
.sv-st { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eef2f3; flex-direction: row-reverse; }
.sv-st i { display: block; height: 100%; }
.sv-key { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; } .sv-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; }

/* 2.8.19: «🧠 تقرير اليوم الدراسي» */
.wt-s h2 { display: flex; align-items: center; gap: 8px; }
.wt-fb { display: inline-flex; gap: 4px; margin-inline-start: 6px; }
.kpi.bad b { color: #b42318; } .kpi.ok b { color: #11643f; } .kpi.warn b { color: #9a6700; }
.wt-a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f6f9fa; border-inline-start: 4px solid #7a8fa0; flex-wrap: wrap; }
.wt-a.warn { border-inline-start-color: #e8a33d; background: #fff8ec; }
.g-shot { margin: 0; } .g-shot img { width: 100%; max-width: 820px; border-radius: 12px; border: 1px solid var(--line, #dde5e4); box-shadow: 0 4px 14px #0001; cursor: zoom-in; } .g-shot img.big { max-width: none; cursor: zoom-out; }

/* ===== 2.8.21: «🗓 الجدول» بأربع خطوات، والجدول قدام العين، و«🧩 كمّل وصلّح» ===== */
.tabs a { padding: 8px 14px; border-bottom: 3px solid transparent; color: var(--muted); white-space: nowrap; text-decoration: none; }
.tabs a.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.flow-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.flow-top .pt { margin: 0; }
.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.flow-step { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); color: var(--ink); text-decoration: none; }
.flow-step small { color: var(--muted); font-size: .78rem; }
.flow-step.done b { color: var(--mint-ink, #0c5a3b); }
.flow-step.on { border: 2px solid var(--accent); background: var(--info-soft, #eef4fd); }
.flow-step:hover { border-color: var(--accent); }
@media (max-width: 640px) { .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.flow-tip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-inline-start: 5px solid var(--accent); }
.flow-tip-ic { font-size: 1.3rem; }
.flow-nav { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.flow-nav .grow, .flow-tip .grow, .flow-row .grow { flex: 1; }
.flow-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flow-row:last-child { border-bottom: 0; }
.flow-row small { display: block; color: var(--muted); }
.flow-row.warn small b { color: var(--warn); }
.flow-st { width: 1.4em; text-align: center; } .flow-ic { font-size: 1.2rem; }
.flow-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.flow-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; text-align: center; cursor: pointer; font: inherit; border: 1px solid var(--line); }
.flow-card:hover { border-color: var(--accent); }
.flow-card[aria-disabled="true"] { opacity: .55; }
.flow-card small { color: var(--muted); }
.flow-big { font-size: 1.8rem; line-height: 1; }
.flow-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 1.05rem; }
.avail-card { border-inline-start: 5px solid var(--accent); margin-bottom: 12px; }
.avail-card .hint { display: block; }
/* الشبكة قدام العين */
.wk-tools .f select { min-width: 130px; }
.wk-zoom { display: inline-flex; gap: 2px; }
.wk-legend-d summary { cursor: pointer; margin-top: 6px; }
.wk-more { position: relative; }
.wk-more > summary { list-style: none; } .wk-more > summary::-webkit-details-marker { display: none; }
.wk-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #0002; min-width: 260px; }
.wk-menu .btn { text-align: start; justify-content: flex-start; }
.wk-wrap.closed { grid-template-columns: minmax(0, 1fr); }
.wk-wrap.closed .wk-side { display: none; }
.wk-gridbox { max-height: none; overflow-x: auto; overflow-y: visible; font-size: calc(1rem * var(--wkz, 1)); }
.wk-grid { table-layout: fixed; min-width: 640px; }
.wk-grid tbody th { width: 64px; }
.wk-cell { height: var(--wkh, 74px); min-width: 0; overflow: hidden; position: relative; }
.wk-card { margin-bottom: 3px; padding: 3px 6px; line-height: 1.35; overflow: hidden; }
.wk-card b, .wk-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-card small.wk-lec { color: #4d6063; }
.wk-plus { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.wk-plus:hover { border-color: var(--accent); }
.wk-pop .wk-card { cursor: pointer; }
.wk-mtabs { position: sticky; top: 0; background: var(--card, #fff); z-index: 2; }
.wk-mrow { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
body.wk-focus .app { grid-template-columns: 1fr; }
body.wk-focus .app > .side, body.wk-focus .app > .topbar, body.wk-focus .flow-top, body.wk-focus .flow-tip, body.wk-focus .back-row, body.wk-focus .flow-steps { display: none !important; }
/* «🧩 كمّل وصلّح» */
.fp-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; }
.fp-head .bad { color: var(--bad); } .fp-head .ok { color: var(--mint-ink, #0c5a3b); }
.fp-list { max-height: 62vh; overflow: auto; padding: 2px; margin-top: 8px; }
.fp-card { border: 1px solid var(--line); border-inline-start: 5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.fp-card.fp-ok { border-inline-start-color: var(--mint, #38c98a); }
.fp-card.fp-edit { border-inline-start-color: var(--accent); }
.fp-card.fp-skip { opacity: .65; }
.fp-card.fp-need { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.fp-top { display: flex; gap: 8px; align-items: center; }
.fp-top .grow { flex: 1; }
.fp-chg { margin: 4px 0 2px; font-weight: 600; }
.fp-warn { color: var(--bad); font-size: .85rem; margin-top: 4px; }
.fp-btns { margin-top: 6px; gap: 6px; }
.fp-edit { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.fp-alt { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.fp-alt:hover { background: #f4f8f8; }
.fp-alt small { display: block; color: var(--muted); }
.fp-man select { max-width: 220px; }
.wk-tools { align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-tools select { width: auto; min-width: 150px; max-width: 240px; padding: 5px 8px; }
.wk-tools label { width: auto; }
.wk-tools .sbtn { padding: 4px 10px; min-height: 0; }
.flow-top.compact { align-items: center; margin-bottom: 6px; }
.flow-steps.mini { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.flow-steps.mini .flow-step { padding: 3px 10px; border-radius: 999px; font-size: .85rem; }
.flow-tip.slim { padding: 6px 12px; margin-bottom: 8px; font-size: .92rem; }
/* 2.8.22 */
.wkly.extra { border-color: #6b9bd8; background: #eef4fd; }
.wkly-t .wkh { display: block; font-size: .72rem; line-height: 1.3; max-width: 150px; margin: 2px auto 0; }
/* 2.8.22: نوع المحاضرة بعلامة وكلمة، واللون للحالة بس (كل الأنواع بنفس اللون الهادي) */
.kc-k0, .kc-k1, .kc-k2, .kc-k3, .kc-k4, .kc-k5 { --kc: #2b6f76; --kf: #f3f8f8; }
/* شبكة «جدولي» أهدى: الخانة الفاضية من غير إطار، و«＋» بيظهر لما تقف عليها */
.my-sgrid .gcell.free { border-color: transparent; background: transparent; }
.my-sgrid .gcell.free small { visibility: hidden; }
.my-sgrid .gcell.free:hover small { visibility: visible; }
.my-sgrid td { vertical-align: top; }
.my-sgrid tbody tr + tr > * { border-top: 2px solid #d8e4e4; }
.gcont { font-size: .74rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 4px 8px; margin-bottom: 4px; background: #f8fbfb; }
/* 2.8.23 (ملاحظة المؤسس): خانة اليوم ودرج المشكلات أصغر، علشان الجدول ياخد المساحة */
.wk-wrap { grid-template-columns: minmax(0, 1fr) 220px; gap: 8px; }
.wk-grid thead th:first-child, .wk-grid tbody th { width: 44px; min-width: 44px; max-width: 44px; padding: 2px; font-size: .78rem; white-space: normal; line-height: 1.2; }
.wk-side { gap: 8px; }
.wk-side .card { padding: 8px; }
.wk-side h3 { font-size: .9rem; margin: 0; }
.wk-side .hint { font-size: .74rem; }
.wk-chip, .wk-p { font-size: .76rem; padding: 4px 6px; }
/* 2.8.23: «📷 سجّل حضوري» في القائمة أهدأ: وهو غير متاح سطر صغير هادئ، ويكبر ويلمع فقط لما يبقى متاح */
.act-sb { padding: 4px 12px 0; }
.act-sb .sbtn { border-width: 1px; border-radius: 10px; min-height: 0; padding: 4px 10px; gap: 6px; }
.act-sb .sbtn .sb-ic { font-size: 1rem; } .act-sb .sbtn .sb-t b { font-size: .84rem; font-weight: 600; }
.act-sb .sbtn .sb-dot { width: 8px; height: 8px; box-shadow: none; }
.act-sb .sbtn.sb-off, .act-sb .sbtn.sb-done { background: transparent; border-color: var(--line, #e5e7eb); color: var(--muted, #6b7280); }
.act-sb .sbtn.sb-off .sb-t small, .act-sb .sbtn.sb-done .sb-t small { display: none; }
.act-sb .sbtn.sb-on { border-width: 2px; padding: 6px 10px; }
/* 2.8.23: شريط التقدّم */
.pg-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 9999; }
.pg-card { background: var(--card, #fff); border-radius: 14px; padding: 18px 20px; width: min(420px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 10px; }
.pg-bar { height: 10px; border-radius: 6px; background: var(--bg2, #eef2f1); overflow: hidden; }
.pg-bar i { display: block; height: 100%; width: 3%; background: var(--primary, #0f766e); border-radius: 6px; transition: width .6s ease; background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%); background-size: 16px 16px; animation: pgMove 1s linear infinite; }
@keyframes pgMove { to { background-position: 16px 0; } }
.pg-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted, #6b7280); }
.pg-steps { margin: 0; padding-inline-start: 20px; font-size: .85rem; color: var(--muted, #6b7280); }
.pg-steps li.now { color: inherit; font-weight: 700; } .pg-steps li.ok { color: var(--ok, #15803d); } .pg-steps li.ok::marker { content: '✓ '; }
@media (prefers-reduced-motion: reduce) { .pg-bar i { animation: none; } }
/* 2.8.23: قوالب إضافة جهة */
.tpl-pick { display: grid; gap: 10px; }
.tpl-k { display: flex; flex-direction: column; gap: 4px; text-align: start; cursor: pointer; font: inherit; border: 1px solid var(--line, #e5e7eb); }
.tpl-k:hover { border-color: var(--primary, #0f766e); }
/* 2.8.23: خلفيات الشاشات (الدخول والخروج) والصفحات، من «هوية البرنامج» */
.login.bg-brand::before { background-image: var(--app-logo, url(/icon.svg)); }
.login.bg-gradient { background: linear-gradient(135deg, var(--ink), color-mix(in srgb, var(--ink) 55%, var(--mint, #2bb673))); }
.login.bg-gradient::before { background: var(--app-logo, url(/icon.svg)) no-repeat center / min(70vh, 640px); opacity: .07; filter: grayscale(1) brightness(3); }
.login.bg-light { background: radial-gradient(circle at 50% 40%, #fff, #e7f0ef); }
.login.bg-light::before { background: var(--app-logo, url(/icon.svg)) no-repeat center / min(75vh, 680px); opacity: .07; filter: none; }
.login.bg-light .card { box-shadow: 0 20px 50px #0002; }
.login.bg-dots { background: var(--ink) radial-gradient(#ffffff1f 1.2px, transparent 1.3px) 0 0 / 22px 22px; }
.login.bg-dots::before { background: var(--app-logo, url(/icon.svg)) no-repeat right -100px bottom -100px / 420px; opacity: .06; }
.login.bg-plain::before { display: none; }
.login.bye .bye-card { width: min(400px, 100%); padding: 28px; text-align: center; align-items: center; }
.login.bye h2 { margin: 6px 0 0; }
/* الصفحات: لوجو حاضر علامة مائية */
body.pg-watermark .main, body.pg-corner .main, body.pg-dots .main { position: relative; z-index: 0; }
body.pg-watermark .main::before { content: ""; position: fixed; inset: 0 var(--side-w, 280px) 0 0; background: var(--app-logo, url(/icon.svg)) no-repeat center / min(60vh, 520px); opacity: .045; pointer-events: none; z-index: -1; }
body.pg-corner .main::before { content: ""; position: fixed; left: 18px; bottom: 18px; width: 180px; height: 180px; background: var(--app-logo, url(/icon.svg)) no-repeat center / contain; opacity: .07; pointer-events: none; z-index: -1; }
body.pg-dots .main { background-image: radial-gradient(color-mix(in srgb, var(--ink) 12%, transparent) 1px, transparent 1.2px); background-size: 20px 20px; }
@media (max-width: 900px) { body.pg-watermark .main::before { inset: 0; } }
@media print { body.pg-watermark .main::before, body.pg-corner .main::before { display: none; } }
.bg-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.bg-opt { display: flex; flex-direction: column; gap: 4px; align-items: center; width: 130px; cursor: pointer; text-align: center; }
.bg-opt input { position: absolute; opacity: 0; }
.bg-th { display: block; width: 130px; height: 80px; min-height: 0 !important; border-radius: 10px; border: 2px solid transparent; padding: 0 !important; }
.bg-th.login::before { background-size: 70px !important; background-position: center !important; }
.bg-opt input:checked + .bg-th { border-color: var(--mint, #2bb673); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint, #2bb673) 30%, transparent); }
.bg-opt input:focus-visible + .bg-th { outline: 2px solid var(--ink); }
.pgth { background: var(--paper, #f6f8f8); border: 1px solid var(--line, #e5e7eb); position: relative; overflow: hidden; }
.pgth::before { content: ""; position: absolute; inset: 0; background: var(--app-logo, url(/icon.svg)) no-repeat center / 46px; opacity: 0; }
.pgth-watermark::before { opacity: .12; } .pgth-corner::before { opacity: .18; background-size: 22px; background-position: left 6px bottom 6px; }
.pgth-dots { background-image: radial-gradient(#0002 1px, transparent 1.2px); background-size: 10px 10px; }
/* 2.8.23: «تنفيذ الجدول» */
.ms-per { align-items: flex-end; gap: 8px; }
.ms-days td.mg { background: var(--bg2, #f3f6f6); vertical-align: top; white-space: nowrap; }
.ms-days tr.gs td { border-top: 2px solid var(--ink, #17363d); }
.pbar-s { display: inline-block; width: 60px; height: 8px; border-radius: 4px; background: var(--bg2, #e6ecee); vertical-align: middle; overflow: hidden; }
.pbar-s i { display: block; height: 100%; background: var(--ok, #15803d); }
/* 2.8.24: التنظيف */
.cl-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cl-p { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; align-items: flex-start; }
.card.su-bulk { position: fixed !important; bottom: 16px; inset-inline-start: 300px; inset-inline-end: 24px; z-index: 40; box-shadow: 0 10px 30px #0003; gap: 10px; align-items: center; margin-top: 10px; border: 2px solid var(--mint, #2bb673); }
.su-bulk[hidden] { display: none !important; }
@media (max-width: 900px) { .card.su-bulk { inset-inline-start: 12px; inset-inline-end: 12px; } }
.su-bulk select { width: auto; max-width: 280px; flex: 0 1 auto; } .card.su-bulk { flex-wrap: wrap; }
/* 2.8.25: «🧑‍💻 ورشة الكود» */
.cd-ed { display: flex; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; overflow: hidden; height: min(62vh, 640px); direction: ltr; background: #0f1d20; }
.cd-ln { margin: 0; padding: 10px 8px; min-width: 52px; text-align: right; color: #6b8a8f; background: #0b1618; font: 12.5px/1.55 ui-monospace, Consolas, monospace; overflow: hidden; user-select: none; }
.cd-ed textarea { flex: 1; border: 0; border-radius: 0; resize: none; padding: 10px; background: transparent; color: #e6f1ef; font: 12.5px/1.55 ui-monospace, Consolas, monospace; white-space: pre; tab-size: 2; min-height: 0; }
.cd-ed textarea:focus { outline: none; box-shadow: none; }
.cd-files { gap: 6px; flex-wrap: wrap; }
.cd-foot { gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.cd-diff { margin: 0; max-height: 50vh; overflow: auto; font: 12px/1.5 ui-monospace, Consolas, monospace; background: #f7f9f9; border-radius: 8px; padding: 8px; }
.cd-diff .da { background: #dcfce7; display: block; } .cd-diff .dr { background: #fee2e2; display: block; text-decoration: line-through; text-decoration-color: #ef444455; } .cd-diff .dc { color: #6b7280; display: block; }
.cm-f { padding: 6px 0; border-bottom: 1px dashed var(--line, #e5e7eb); }
/* 2.8.26: صندوق تحذير داخل البطاقة */
.warn-box { background: #fff8e6; border: 1px solid #f0c36d; border-inline-start: 5px solid #d9822b; padding: 10px 14px; border-radius: 10px; line-height: 1.8; color: #5a3b00; }
[data-theme="dark"] .warn-box { background: #3a2c10; color: #f6dfae; }

/* 2.8.28: كروت «مين يقدر يعمل إيه» */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* 2.8.30: «🖥 إعدادات شاشة القاعة»: الشكل الفاتح وسطر الرسالة */
.proj.proj-light { background: #f6f8f8; color: #17363d; }
.proj.proj-light .sub, .proj.proj-light small { color: #44606a; }
.proj-note { margin-top: 12px; font-size: 1.25em; font-weight: 700; text-align: center; opacity: .9; }
/* 2.8.30: «📰» شريط الخبر الجديد في مجال الرؤية */
.news-strip { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--card, #fff); border: 1px solid var(--line, #d7e2e4); border-inline-start: 4px solid var(--primary, #17363d); }
.news-strip a { flex: 1; color: inherit; text-decoration: none; }
.news-strip.urgent { border-inline-start-color: var(--danger, #b42318); }
.news-strip .x { border: 0; background: none; cursor: pointer; font-size: 1.1em; opacity: .6; }
