html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:root {
  --bg: #f3f7f5; --card: #ffffff; --ink: #14231d; --muted: #66756e; --line: #e0e8e4;
  --pri: #0e8f64; --pri-d: #0a6e4d; --pri-l: #e3f5ee;
  --danger: #c0392b; --warn: #d68910; --blue: #2471a3;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1714; --card: #17211d; --ink: #e8f1ed; --muted: #93a39b; --line: #263530; --pri-l: #12302a; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Cairo", system-ui, sans-serif; font-size: 16px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.splash { padding: 40vh 16px 0; text-align: center; color: var(--muted); }

/* التخطيط */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--pri); color: #fff; }
.top .muted { color: #d7f3e8; }
.brand { font-weight: 700; font-size: 1.15rem; }
#view { padding: 16px 16px 96px; max-width: 760px; margin: 0 auto; }
.bar { position: fixed; bottom: 0; inset-inline: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.bar a { display: flex; flex-direction: column; align-items: center; font-size: .72rem; color: var(--muted); padding: 2px 6px; min-width: 56px; }
.bar a span { font-size: 1.3rem; line-height: 1.2; }
.bar a.on { color: var(--pri); font-weight: 700; }

/* مكونات */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.empty { text-align: center; color: var(--muted); }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
input[type=checkbox] { width: auto; margin: 0; }
input:focus, select:focus { outline: 2px solid var(--pri); outline-offset: 0; }
.btn { display: inline-block; padding: 10px 16px; font: inherit; font-weight: 600; color: #fff; background: var(--pri); border: 0; border-radius: 10px; cursor: pointer; text-align: center; }
.btn:active { background: var(--pri-d); }
.btn.sec { background: var(--pri-l); color: var(--pri); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.btn[disabled] { opacity: .5; }
.note { background: var(--pri-l); color: var(--pri-d); padding: 8px 12px; border-radius: 10px; font-size: .88rem; margin-bottom: 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--pri-l); color: var(--pri); }
.badge.off { background: #fdecea; color: var(--danger); }
.badge.wait { background: #fef5e6; color: var(--warn); }

/* قوائم */
.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .ic { font-size: 1.6rem; }
.tile b { display: block; }
.tile.soon { opacity: .55; }
.stat { text-align: center; }
.stat b { display: block; font-size: 1.6rem; color: var(--pri); }

/* التسجيل */
.auth { max-width: 420px; margin: 0 auto; padding: 8vh 16px 24px; text-align: center; }
.auth .logo { font-size: 3rem; }
.auth form { text-align: right; }
.tabs { display: flex; gap: 6px; margin: 16px 0; background: var(--card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 8px; font: inherit; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--pri); color: #fff; font-weight: 700; }
.lock { text-align: center; }
.lock .big { font-size: 3rem; }

/* الحضور */
.days { display: flex; gap: 6px; margin: 10px 0; }
.days button { flex: 1; padding: 8px 2px; font: inherit; font-size: .8rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.days button small { display: block; color: var(--muted); }
.days button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.days button.on small { color: #d7f3e8; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.counts span { font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.stu { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
.stu .n { width: 22px; color: var(--muted); font-size: .8rem; text-align: center; }
.stu .nm { flex: 1; font-weight: 600; min-width: 0; }
.seg { display: flex; gap: 4px; }
.seg button { padding: 6px 7px; font: inherit; font-size: .75rem; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.seg button.on[data-s=present] { background: var(--pri); color: #fff; border-color: var(--pri); }
.seg button.on[data-s=absent] { background: var(--danger); color: #fff; border-color: var(--danger); }
.seg button.on[data-s=no_kit] { background: var(--warn); color: #fff; border-color: var(--warn); }
.seg button.on[data-s=late] { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width: 420px) { .seg button { padding: 6px 5px; font-size: .7rem; } }

/* جداول */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--card); }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.tbl th { background: var(--pri-l); color: var(--pri-d); }
.tbl td.l { text-align: right; }
.scroll { overflow-x: auto; margin-bottom: 12px; }

/* معاينة Excel */
.sheet .ex { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.user .row { margin-top: 8px; }
.user input[type=date] { width: auto; margin: 0; }

/* الإشعارات */
.toast { position: fixed; bottom: 84px; inset-inline: 16px; margin: auto; max-width: 420px; padding: 10px 14px; background: #1f2d27; color: #fff; border-radius: 12px; text-align: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; z-index: 20; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--danger); }
.busy { position: fixed; inset: 0; background: rgba(0,0,0,.18); display: grid; place-items: center; z-index: 30; }
.busy[hidden] { display: none; }
.busy span { width: 38px; height: 38px; border: 4px solid #fff; border-top-color: var(--pri); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ===== مظهر زجاجي عصري ===== */
:root {
  --glass: rgba(255, 255, 255, .58);
  --glass-b: rgba(255, 255, 255, .78);
  --glass-shadow: 0 8px 28px rgba(14, 60, 45, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass: rgba(255, 255, 255, .07);
    --glass-b: rgba(255, 255, 255, .14);
    --glass-shadow: 0 8px 28px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
  }
}
html { scroll-behavior: smooth; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 60vmax at 95% -8%, rgba(14, 143, 100, .30), transparent 60%),
    radial-gradient(50vmax 50vmax at -8% 32%, rgba(36, 113, 163, .24), transparent 60%),
    radial-gradient(55vmax 55vmax at 85% 108%, rgba(214, 137, 17, .20), transparent 60%);
}
.card, .tile {
  background: var(--glass); border: 1px solid var(--glass-b); border-radius: 22px;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.item, .stu { background: var(--glass); border-color: var(--glass-b); border-radius: 16px; }
.top {
  background: rgba(14, 143, 100, .80); border-bottom: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
}
.bar {
  background: var(--glass); border-top: 1px solid var(--glass-b);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
}
.bar a { transition: color .2s, transform .2s var(--ease); }
.bar a:active { transform: scale(.9); }
.btn { border-radius: 14px; transition: transform .2s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
input, select { border-radius: 12px; transition: outline-color .2s; }

/* خانات الرئيسية */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 12px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 8px; min-height: 176px; padding: 18px 10px 14px; text-align: center; overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease); will-change: transform;
}
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 42%);
  opacity: .65;
}
.tile .pic { width: 96px; height: 96px; display: grid; place-items: center; font-size: 3.2rem; transition: transform .4s var(--ease); }
.tile .pic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.tile b { font-size: 1rem; line-height: 1.4; position: relative; }
.tile .no { position: absolute; top: 10px; inset-inline-start: 14px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.tile .tag { position: absolute; top: 9px; inset-inline-end: 10px; font-size: .68rem; padding: 1px 8px; border-radius: 99px; background: var(--pri-l); color: var(--pri); }
.tile.soon { opacity: .6; }
@media (hover: hover) {
  a.tile:hover { transform: scale(1.045) translateY(-3px); box-shadow: 0 18px 40px rgba(14, 60, 45, .22), inset 0 1px 0 rgba(255, 255, 255, .9); }
  a.tile:hover .pic { transform: scale(1.1) translateY(-2px); }
}
a.tile:active { transform: scale(.96); transition-duration: .12s; }

/* ظهور تدريجي وسلس */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#view > * { animation: rise .45s var(--ease) backwards; }
#view > *:nth-child(2) { animation-delay: .04s; }
#view > *:nth-child(3) { animation-delay: .08s; }
#view > *:nth-child(4) { animation-delay: .12s; }
#view > *:nth-child(n+5) { animation-delay: .16s; }
#view > .tiles { animation: none; }
#view > .row.between { margin-bottom: 14px; }
.tiles .tile { animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ===== ثيم داكن أزرق ===== */
:root {
  color-scheme: dark;
  --bg: #010d2b; --card: rgba(255, 255, 255, .06); --ink: #eaf1ff; --muted: #93a6cf; --line: rgba(130, 165, 255, .16);
  --pri: #4d8dff; --pri-d: #2f6fe0; --pri-l: rgba(77, 141, 255, .16);
  --danger: #ff5d5d; --warn: #ffb020; --blue: #4d8dff;
  --glass: linear-gradient(160deg, rgba(88, 140, 255, .16), rgba(255, 255, 255, .04));
  --glass-b: rgba(120, 160, 255, .22);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .10);
}
body { background: transparent; }
body::before {
  background:
    radial-gradient(60vmax 50vmax at 100% 0%, rgba(40, 100, 255, .22), transparent 60%),
    radial-gradient(50vmax 50vmax at 0% 100%, rgba(20, 70, 200, .18), transparent 60%);
}
.top { background: rgba(2, 12, 38, .62); border-bottom: 1px solid var(--glass-b); }
.top .brand { color: #fff; }
.top .muted { color: #9fb6e8; }
.bar {
  inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 620px; margin-inline: auto;
  padding: 8px 6px; border: 1px solid var(--glass-b); border-radius: 26px;
  background: rgba(4, 16, 48, .74); box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
}
#view { padding-bottom: 120px; }
#view.wide { max-width: 1080px; }
#view.wide2 { max-width: 1080px; }
.hscroll { margin: 4px 0 -2px; font-size: .78rem; color: #8fb4f5; }
input, select, textarea { background: rgba(255, 255, 255, .06); }
.note, .tbl th { color: #a9c8ff; }
.badge.off { background: rgba(255, 93, 93, .16); color: #ff8a8a; }
.badge.wait { background: rgba(255, 176, 32, .16); color: #ffc65a; }
.btn.sec { background: rgba(77, 141, 255, .16); color: #a9c8ff; }
.toast { background: #0b1f55; border: 1px solid var(--glass-b); }
.days button, .seg button { background: rgba(255, 255, 255, .05); }
.seg button.on[data-s=present] { background: #22b573; border-color: #22b573; }
.seg button.on[data-s=late] { background: #8b6cf0; border-color: #8b6cf0; }

/* الغلاف والواجهة العلوية */
#cover {
  display: none; position: absolute; top: 0; inset-inline: 0; height: 150vw; max-height: 760px; z-index: -1; pointer-events: none;
  background: url(images/cover-m.webp) top center / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
}
body.home #cover { display: block; }
.hero { display: flex; justify-content: flex-end; align-items: center; min-height: min(290px, 72vw); margin: -4px 0 10px; }
.hero-t { width: 52%; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); line-height: 1.25; margin: 0; font-weight: 700; text-shadow: 0 2px 16px rgba(0, 0, 0, .65); }
.hero p { margin: 8px 0 0; color: #b8c9ee; }
.hero-line { display: block; width: 70%; height: 3px; margin: 12px auto 0; border-radius: 3px; background: linear-gradient(90deg, transparent, #3d86ff, transparent); }
@media (min-width: 800px) {
  #cover { height: 560px; max-height: none; background: url(images/cover-d.webp) center 72% / cover no-repeat; }
  .hero { min-height: 470px; }
  .hero-t { width: 38%; }
  .hero h1 { font-size: 3rem; }
}

/* الخانات في الثيم الداكن */
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { min-height: 196px; -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%); }
.tile::before { opacity: .35; }
.tile .pic { width: 108px; height: 108px; }
.tile .pic img { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); }
.tile .tag { background: rgba(77, 141, 255, .16); color: #a9c8ff; }
@media (hover: hover) {
  a.tile:hover { box-shadow: 0 20px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(100, 160, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
}

/* اللوغو */
.top { padding: 6px 16px; }
.brand { display: flex; align-items: center; }
.logo-s { display: block; height: 52px; width: auto; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.logo-l { display: block; width: min(320px, 86%); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5)); }

/* الشريط بالأيقونات */
.bar { padding: 6px; }
.bar a { flex: 1; max-width: 130px; gap: 2px; font-size: .74rem; padding: 4px 6px; }
.bar a img { width: 34px; height: 34px; object-fit: contain; opacity: .65; filter: grayscale(.8) brightness(.85); transition: filter .25s, opacity .25s, transform .35s var(--ease); }
.bar a[data-k=book] img { width: 42px; height: 42px; }
.bar a.on img { opacity: 1; filter: none; transform: translateY(-3px) scale(1.12); }
.bar a.on { color: #cfe0ff; }

/* رابط الرجوع */
#crumb { max-width: 760px; margin: 0 auto; padding: 12px 16px 0; }
#crumb:empty { display: none; }
.back { display: inline-block; padding: 6px 14px; border-radius: 99px; background: var(--pri-l); color: #a9c8ff; font-size: .85rem; transition: transform .2s var(--ease); }
.back:active { transform: scale(.94); }

/* اختصارات الرئيسية وبطاقة الدفتر */
.qa, .bigcard {
  background: var(--glass); border: 1px solid var(--glass-b); border-radius: 22px; box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; text-align: center; font-size: .85rem; font-weight: 600; }
.qa img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.bigcard { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px; }
.bigcard img { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.bigcard div { flex: 1; display: flex; flex-direction: column; }
.bigcard b { font-size: 1.15rem; }
.bigcard i { font-style: normal; font-size: 2rem; color: var(--muted); }
@media (hover: hover) {
  .qa:hover, .bigcard:hover { transform: scale(1.03) translateY(-3px); box-shadow: 0 20px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(100, 160, 255, .45); }
}
.qa:active, .bigcard:active { transform: scale(.97); transition-duration: .12s; }

/* الطباعة */
#print-root { display: none; }
@media print {
  html, body { background: #fff; color: #000; }
  #app, #toast, #busy, #cover { display: none !important; }
  body::before { display: none !important; }
  #print-root { display: block; }
  .doc { font-family: "Cairo", Arial, sans-serif; color: #000; }
  .doc h1 { text-align: center; font-size: 20px; border: 2px solid #000; border-radius: 10px; padding: 8px; margin: 0 0 12px; }
  .doc .meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
  .doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .doc th, .doc td { border: 1px solid #000; padding: 6px 8px; text-align: center; }
  .doc th { background: #eee; }
  .doc .sign { display: flex; justify-content: space-between; margin-top: 40px; font-weight: 700; }
  @page { size: A4; margin: 14mm; }
}

/* ===== ألوان الجنس والإعفاء ===== */
.gm { background: rgba(110, 168, 255, .18) !important; }
.gf { background: rgba(255, 150, 200, .20) !important; }
.ex { background: rgba(255, 110, 110, .22) !important; }
.tagx { font-size: .7rem; padding: 1px 8px; border-radius: 99px; background: rgba(255, 110, 110, .35); margin-inline-start: 6px; }
.item .row.gap { flex-wrap: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: .82rem; }
.chip input { width: auto; margin: 0; }
.gbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.gm-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; margin-top: 4px; border-radius: 8px; }
.gm-row select { width: 64px; margin: 0; padding: 4px; }
.g select[data-ld] { margin: 6px 0; }

/* ===== النوافذ المنبثقة ===== */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.mzb { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }

/* ===== استعمال الزمن على الشاشة ===== */
#view .tt { width: 100%; border-collapse: collapse; font-size: .85rem; }
#view .tt th, #view .tt td { border: 1px solid var(--line); padding: 8px 4px; text-align: center; min-width: 58px; }
#view .tt td.tm { font-size: .72rem; color: var(--muted); white-space: nowrap; }
#view .tt td.has { background: rgba(90, 160, 255, .25); font-weight: 700; cursor: pointer; }
#view .tt td[data-d] { color: var(--muted); cursor: pointer; }
#view .tt tr.brk td { padding: 3px; background: var(--bg); }
.eq input { margin: 0; padding: 6px; min-width: 56px; text-align: center; }
.eq td:first-child input { text-align: right; min-width: 150px; }

/* ===== صفحات PDF (خلفية بيضاء دائماً) ===== */
.pdf-host { position: fixed; left: -12000px; top: 0; }
.pg { width: 794px; min-height: 1123px; box-sizing: border-box; padding: 44px 44px 36px; background: #fff; color: #000; direction: rtl; font-family: "Cairo", Arial, sans-serif; border: 5px double #444; position: relative; }
.pg * { box-sizing: border-box; }
.pg h1.box { text-align: center; font-size: 24px; margin: 20px auto 50px; width: 70%; padding: 14px; border: 2px solid #777; border-radius: 16px; background: #ece8f3; }
.pg h1.plain { text-align: center; font-size: 22px; margin: 14px 0 22px; }
.pg h1.u { text-decoration: underline; }
.pg .kv { font-size: 19px; }
.pg .kv div { margin: 0 0 26px; font-weight: 700; }
.pg .kv span { font-weight: 400; }
.pg .oh { display: grid; grid-template-columns: 1fr 1fr; font-size: 14px; font-weight: 700; margin-bottom: 18px; }
.pg .oh .c { grid-column: 1 / 3; text-align: center; margin-bottom: 4px; }
.pg .oh .r { text-align: right; }
.pg table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pg th, .pg td { border: 1px solid #000; padding: 6px 4px; text-align: center; }
.pg th { background: #f0f0f0; }
.pg td.l { text-align: right; padding-inline-start: 8px; }
.pg .pt.tall td { height: 44px; font-size: 15px; }
.pg .pt.cl td { padding: 1px 4px; line-height: 1.15; }
.pg.modern .pt.cl td { padding: 3px 4px; }
.pg .tt th { background: #fff; color: #6b3fa0; font-size: 20px; }
.pg .tt td { height: 62px; font-size: 20px; font-weight: 700; }
.pg .tt td.tm { font-size: 12px; color: #6b3fa0; height: 44px; }
.pg .tt tr.brk td { height: 22px; background: #fff; }
.pg .tt td.has { background: #e9e1f5; }
.pg .tt.fx { table-layout: fixed; }
.pg .tt.fx td, .pg .tt.fx th { overflow: hidden; }
.pg .sig { margin: 30px 8px 0; font-weight: 700; font-size: 15px; }
.pg .sig.u { text-decoration: underline; }
.pg .foot { position: absolute; bottom: 24px; inset-inline: 44px; display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.pg .meta2 { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
.pg table.meta td { text-align: right; padding: 7px 10px; font-size: 14px; }
.pg .ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.pg .gcard { border: 2px solid #3a6ea5; border-radius: 12px; padding: 0 0 8px; min-height: 130px; }
.pg .gcard .gh { background: #e4edf9; padding: 5px 10px; font-weight: 700; border-radius: 10px 10px 0 0; font-size: 14px; }
.pg .gcard ol, .pg .gcard ul { list-style: none; margin: 6px 0 0; padding-inline: 14px; font-size: 14px; line-height: 1.9; }
.pg .gcard li { padding: 0 6px; border-radius: 6px; }
.pg .gcard .gno { display: inline-block; min-width: 22px; color: #0f3a8a; }
.pg .gcard.ex { border-color: #d98a2b; }
.pg .gm { background: #dbeafe !important; }
.pg .gf { background: #fce7f3 !important; }
.pg .ex { background: #fecaca !important; }
.pg .rc-meta { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.pg .rc-meta .oval { border: 1.5px solid #000; border-radius: 50%; padding: 12px 26px; }
.pg table.rc { table-layout: fixed; font-size: 9px; }
.pg table.rc th, .pg table.rc td { padding: 0; height: 17px; line-height: 17px; font-size: 9px; overflow: hidden; }
.pg table.rc .no { width: 30px; }
.pg table.rc .nm { width: 130px; text-align: right; padding-inline-start: 4px; white-space: nowrap; }
.pg table.rc th.dd { font-size: 7px; font-weight: 400; }
.pg .legend { margin-top: 10px; font-size: 12px; }

@media print {
  .pg.print { display: block; page-break-after: always; border: 0; width: auto; min-height: 0; }
}

/* ===== تحسين الشكل: ألوان هادئة وشارات جانبية ===== */
.gm, .gf, .ex { background: rgba(255, 255, 255, .04) !important; }
.gm { border-inline-start: 3px solid #6ea8ff !important; background-image: linear-gradient(90deg, transparent, rgba(110, 168, 255, .13)) !important; }
.gf { border-inline-start: 3px solid #ff9ccb !important; background-image: linear-gradient(90deg, transparent, rgba(255, 156, 203, .15)) !important; }
.ex { border-inline-start: 3px solid #ff7a7a !important; background-image: linear-gradient(90deg, transparent, rgba(255, 122, 122, .17)) !important; }
.gm-row { background: rgba(255, 255, 255, .04); }
.chip { cursor: pointer; background: rgba(255, 255, 255, .03); transition: background .2s, border-color .2s; }
.chip.on { background: rgba(77, 141, 255, .22); border-color: rgba(120, 170, 255, .6); color: #d6e6ff; }
.chip.block { display: flex; width: 100%; border-radius: 12px; margin-bottom: 6px; }
.pref { margin: 4px 0 10px; }
button.chip { font: inherit; color: var(--ink); }
.stack { max-height: 46vh; overflow: auto; }
.okc { border-color: rgba(80, 200, 140, .55); background: rgba(40, 160, 110, .14); }
.badc { border-color: rgba(255, 120, 120, .55); background: rgba(200, 60, 60, .14); }
.msg { white-space: pre-wrap; font: inherit; font-size: .9rem; line-height: 1.8; background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; max-height: 40vh; overflow: auto; }
textarea { width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.mzb { background: rgba(8, 22, 58, .92); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); border: 1px solid rgba(140, 180, 255, .28); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); max-height: 90vh; overflow: auto; animation: rise .25s ease both; }
.mzb h3 { margin: 0 0 10px; }
.modal { backdrop-filter: blur(3px); }
.item, .stu { transition: transform .15s, background .2s; }

/* ===== معاينة الطباعة ===== */
.pvw { position: fixed; inset: 0; z-index: 60; background: #060e22; display: flex; flex-direction: column; }
.pvbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(10, 25, 60, .95); border-bottom: 1px solid var(--line); }
.pvbody { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; -webkit-overflow-scrolling: touch; }
.pvbody img { width: 100%; max-width: 820px; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
#print-root img { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  #print-root img { display: block; width: 210mm; height: 297mm; page-break-after: always; break-after: page; }
  #print-root.land img { width: 297mm; height: 210mm; }
  #print-root img:last-child { page-break-after: auto; break-after: auto; }
  .pvw { display: none !important; }
}

/* ===== التصميم العصري للوثائق ===== */
.pg.modern { border: 0; background: #fff url(images/fr-p.webp) center / 100% 100% no-repeat; padding: 116px 56px 120px; color: #0b1f4d; }
.pg.modern.runner { background-image: url(images/bg-p-runner.webp); }
.pg.modern h1.plain, .pg.modern h1.box { position: relative; width: max-content; max-width: 78%; margin: 6px auto 20px; padding: 9px 34px; border-radius: 40px; background: linear-gradient(90deg, #08246a, #1448a8); color: #fff; font-size: 22px; text-decoration: none; box-shadow: 0 4px 10px rgba(8, 36, 106, .35); }
.pg.modern h1.box { font-size: 24px; margin-bottom: 26px; }
.pg.modern h1::before, .pg.modern h1::after { content: ""; position: absolute; top: 50%; width: 60px; height: 2px; background: #0b2a6b; }
.pg.modern h1::before { left: calc(100% + 10px); }
.pg.modern h1::after { right: calc(100% + 10px); }
.pg.modern .oh { font-size: 12px; color: #0b2a6b; margin-bottom: 8px; }
.pg.modern .oh .c { margin-bottom: 1px; }
.pg.modern th { background: #0f3a8a; color: #fff; border-color: #0f3a8a; }
.pg.modern td { border-color: #9db6e0; }
.pg.modern tbody tr:nth-child(even) td { background: rgba(225, 236, 255, .75); }
.pg.modern .pt td { padding: 3px 4px; }
.pg.modern .pt.tall td { height: 36px; }
.pg.modern table.rc th { background: #0f3a8a; color: #fff; }
.pg.modern table.rc td { height: 16px; line-height: 16px; }
.pg.modern table.rc th, .pg.modern table.rc td { border-color: #7f9bd0; }
.pg.modern .tt th { background: #fff; color: #0f3a8a; border-color: #0f3a8a; }
.pg.modern .tt td { height: 56px; border-color: #9db6e0; }
.pg.modern .tt td.has { background: #cfe0ff; color: #08246a; }
.pg.modern .tt td.tm { color: #0f3a8a; background: #fff; height: 40px; }
.pg.modern .foot { position: static; inset: auto; margin-top: 14px; color: #0b2a6b; }
.pg.modern .sig { color: #0b2a6b; margin-top: 18px; }
.pg.modern .rc-meta .oval { border-color: #0f3a8a; }
.pg.modern .gcard { border-color: #0f3a8a; background: rgba(255, 255, 255, .8); }
.pg.modern .gcard .gh { background: linear-gradient(90deg, #08246a, #1448a8); color: #fff; }
.pg.modern table.meta td { background: rgba(255, 255, 255, .85); border-color: #0f3a8a; }
.pg.modern .kvm { padding-inline-start: 6px; }
.kvm .kr { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 3px 0; font-size: 17px; background: linear-gradient(270deg, rgba(210, 225, 255, .85), rgba(210, 225, 255, 0)); border-radius: 12px; }
.kvm .kr b { font-weight: 800; }
.kvm .kr span { font-weight: 400; }
.kvm .ic { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: linear-gradient(135deg, #08246a, #1d56c4); }
.pg.modern .legend { color: #0b2a6b; }

/* مفتاح التصميم في المعاينة */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { font: inherit; font-size: .85rem; padding: 6px 12px; color: var(--ink); background: transparent; border: 0; cursor: pointer; }
.seg button.on { background: rgba(77, 141, 255, .35); font-weight: 700; }
.pg.modern .gcard li { line-height: 1.6; }
.pg.modern .gcard { min-height: 100px; }
.pg.modern .pgi { position: static; }

/* ===== وثائق أفقية: البرمجة السنوية والوحدات ===== */
.pg.land { width: 1123px; min-height: 794px; padding: 26px 34px 24px; }
.pg.land .lh { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.pg.land h1.plain { margin: 6px auto 10px; font-size: 20px; }
.pg.land .fc { border: 1.5px solid #555; border-radius: 10px; padding: 7px 12px; font-size: 14px; margin-bottom: 10px; background: #f4f4f4; }
.pg.land table { font-size: 13px; }
.pg.land th.rh { width: 110px; }
.pg.land table.at td { vertical-align: top; }
.pg.land table.at td.l { text-align: right; line-height: 1.55; }
.pg.land ul.bl { margin: 4px 0 0; padding-inline: 16px 0; }
.pg.land table.ut td { padding: 5px 5px; line-height: 1.5; }
.pg.land table.ut td.l { text-align: right; }
.pg.land .ukv { font-size: 11px; margin: 3px 0 7px; }
.pg.land .fbn { font-size: 12px; margin-top: 6px; }
.pg.land .usig { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin: 14px 12px 0; }
.pg.modern.land { background-image: url(images/fr-l.webp); padding: 100px 58px 112px; }
.pg.modern.land .lh { color: #0b2a6b; }
.pg.modern.land h1.plain { margin-top: 0; margin-bottom: 10px; }
.pg.modern.land .fc { background: rgba(225, 236, 255, .8); border-color: #0f3a8a; }
.card.link { display: block; text-decoration: none; color: inherit; }
.card.link .muted { display: block; margin-top: 4px; }

/* ===== تحرير الوحدات + بطاقة المتابعة ===== */
.pg .lh { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.pg.land .ao { margin-bottom: 6px; }
.fld { margin: 6px 0; }
.fld textarea { width: 100%; resize: vertical; }
.fld .rst { margin-top: 4px; }
.sess { border-top: 1px dashed rgba(255,255,255,.18); padding-top: 8px; margin-top: 8px; }
.crow { display: flex; gap: 6px; margin: 6px 0; align-items: center; }
.crow .ctx { flex: 1; min-width: 0; }
.crow .pct { width: 74px; text-align: center; }
.evw { overflow-x: auto; margin: 8px 0; }
table.evs { border-collapse: collapse; width: 100%; font-size: 13px; }
table.evs th, table.evs td { border: 1px solid rgba(255,255,255,.18); padding: 3px 4px; text-align: center; }
table.evs td.nm, table.evs th.nm { text-align: right; white-space: nowrap; }
table.evs tr.tot td { font-weight: 700; background: rgba(110,168,255,.12); }
.cellb { width: 38px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: inherit; font-size: 16px; font-weight: 700; }
.pg .evh { font-size: 9px; margin-bottom: 5px; line-height: 1.5; }
.pg table.ev { table-layout: fixed; font-size: 9px; }
.pg table.ev th, .pg table.ev td { padding: 0; height: 15px; line-height: 15px; font-size: 8.5px; overflow: hidden; }
.pg table.ev .nm { text-align: right; padding-inline-start: 3px; white-space: nowrap; }
.pg table.ev tr.tot td { font-weight: 700; background: #eee; }
.pg .evb { font-size: 8.5px; margin-top: 6px; border: 1.5px solid #444; border-radius: 8px; padding: 6px 10px; line-height: 1.7; }
.pg .evb .muted2 { color: #444; margin-top: 4px; font-size: 10px; }

.pg table.ev td.xc { text-align: center; font-weight: 700; font-size: 9px; color: #7f1d1d; }

.fstu { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed rgba(255,255,255,.14); }
.fstu select, .inl select { min-width: 54px; }
.inl { display: inline-flex; flex-direction: column; font-size: .7rem; gap: 2px; }
.num { width: 58px; text-align: center; }
details.card summary { cursor: pointer; }

.pg table.ev.fm th, .pg table.ev.fm td { font-size: 8px; }
.pg table.ev tr.sub th { font-size: 6.5px; line-height: 8px; height: 26px; font-weight: 600; }
.pg table.ev th.lg { font-size: 7px; font-weight: 600; }
.pg table.ev.cc th, .pg table.ev.exm th { font-size: 8px; line-height: 10px; height: auto; padding: 2px 1px; }
.pg table.ev.cc td, .pg table.ev.exm td { font-size: 9px; height: 17px; line-height: 17px; }
.pg table.ev th.gp { font-size: 7px; }

/* ===== التصميم البسيط: نفس بنية العصري بدون خلفية وبألوان هادئة ===== */
.pg:not(.modern) { border: 1px solid #c3d2ec; color: #0b1f4d; padding: 52px 52px 44px; }
.pg:not(.modern) .oh { color: #0b2a6b; }
.pg:not(.modern) h1.plain, .pg:not(.modern) h1.box { position: relative; width: max-content; max-width: 92%; margin: 6px auto 22px; padding: 7px 28px; border: 1.5px solid #9db6e0; border-radius: 40px; background: #e9f0fb; color: #0b2a6b; font-size: 19px; text-decoration: none; }
.pg:not(.modern) h1.plain::before, .pg:not(.modern) h1.plain::after { content: ""; position: absolute; top: 50%; width: 56px; height: 1.5px; background: #9db6e0; }
.pg:not(.modern) h1.plain::before { left: calc(100% + 10px); }
.pg:not(.modern) h1.plain::after { right: calc(100% + 10px); }
.pg:not(.modern) th { background: #e3ebf8; color: #0b2a6b; border-color: #9db6e0; }
.pg:not(.modern) td { border-color: #b7c9e8; }
.pg:not(.modern) .foot { position: static; inset: auto; margin-top: 14px; color: #0b2a6b; }
.pg:not(.modern) .sig { color: #0b2a6b; }
.warnbox { background: #fff3cd; color: #7a5300; border: 1px solid #f0c36d; }
@media (prefers-color-scheme: dark) { .warnbox { background: #3b2e0a; color: #ffd98a; border-color: #7a5c1a; } }

/* التدرج السنوي */
.pg table.pc { table-layout: fixed; font-size: 11.5px; }
.pg table.pc th, .pg table.pc td { padding: 3px 4px; line-height: 1.35; text-align: center; font-size: 11.5px; }
.pg table.pc td.tm { font-weight: 700; background: #eef3fb; font-size: 13px; }
.pg table.pc td.gy { background: #dfe5ef; }
.pg .psg { display: flex; justify-content: space-between; margin-top: 18px; font-weight: 700; font-size: 12.5px; }
table.pcw input[type=date] { width: 128px; }
table.pcw .ctx { min-width: 110px; }

/* دفاتر التكوين والأنشطة اللاصفية */
.pg .nbt { text-align: right; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.pg .nbf { display: flex; gap: 8px; align-items: baseline; margin: 9px 0; font-size: 14px; }
.pg .nbf .v { flex: 1; border-bottom: 1.5px dotted #666; min-height: 20px; padding: 0 4px; }
.pg .nbs b { display: block; margin: 14px 0 2px; font-size: 14px; }
.pg .nbs .tx { white-space: pre-wrap; line-height: 18px; font-size: 13px; }
.pg .nbs .dl { border-bottom: 1.5px dotted #777; height: 18px; }

/* الدفتر اليومي */
.chk{display:flex;gap:8px;align-items:center;padding:4px 0}
.dact{border:1px solid var(--line,#d8dee8);border-radius:10px;padding:10px;margin:8px 0}
.dact textarea{width:100%}
.pg .dday{font-weight:800;font-size:13px;margin:8px 0 4px;padding:3px 10px;background:#eef3fa;border-radius:6px}
.pg .dcr{display:flex;gap:8px;margin-bottom:5px}
.pg .dc{flex:1;border:1px solid #333;border-radius:6px;padding:6px 8px;font-size:11.5px;line-height:1.7;min-width:0}
.pg .dc.dce{border:0}
.pg .dch{display:flex;justify-content:space-between;border-bottom:1px solid #999;margin-bottom:3px}
.pg .dca{border-bottom:1px dashed #aaa;padding-bottom:2px;margin-bottom:2px}
.pg .dca:last-child{border-bottom:0}
.pg .dd{letter-spacing:1px;color:#777;overflow:hidden}
.pg table.dtb td{font-size:10.5px;vertical-align:top;padding:3px 4px}
.pg table.dtb .da{border-bottom:1px solid #bbb;min-height:1.6em;padding:1px 0}
.pg table.dtb .da:last-child{border-bottom:0}
.pg table.dtb tr td{background:#fff}.pg table.dtb tr.alt td{background:#eef3fa}
.btn.auto{opacity:.75;border-style:dashed}

/* رموز الأزرار (PNG أبيض يلوّنه لون النص) */
.ic{display:inline-block;width:1.15em;height:1.15em;vertical-align:-.2em;margin-inline:0 .3em;background:currentColor;-webkit-mask:var(--m) center/contain no-repeat;mask:var(--m) center/contain no-repeat}
.btn .ic:only-child{margin:0}
.big .ic{width:1em;height:1em;margin:0}
.ic-eye{--m:url(images/ic-eye.png)}.ic-print{--m:url(images/ic-print.png)}.ic-down{--m:url(images/ic-down.png)}.ic-x{--m:url(images/ic-x.png)}
.ic-check{--m:url(images/ic-check.png)}.ic-redo{--m:url(images/ic-redo.png)}.ic-lock{--m:url(images/ic-lock.png)}.ic-warn{--m:url(images/ic-warn.png)}

/* المذكرات */
.pg .mzb{border:1px solid #333;border-radius:6px;padding:6px 10px;margin:4px 0 6px;font-size:11px;line-height:1.7}
.pg .mzb .m3{display:flex;justify-content:space-between}
.pg table.mz{font-size:calc(9.6px*var(--k,1));line-height:1.45}
.pg table.mz td,.pg table.mz th{padding:calc(3px*var(--k,1)) calc(4px*var(--k,1));vertical-align:top}
.pg table.mz td.l{text-align:right}
.pg table.mz .mg{text-align:right;font-size:calc(10.5px*var(--k,1))}
.pg table.mz .mact{font-weight:800;background:#eef3fa;text-align:center;color:#1d3a8a}
.pg table.mz .mph{vertical-align:middle;text-align:center;font-weight:800;color:#5b2d8a}
.pg table.mz .mh{margin-top:3px;color:#5b2d8a;text-decoration:underline}
.pg table.mz .mh:first-child{margin-top:0}

.pg table.mzi{margin:4px 0 6px;font-size:calc(10.5px*var(--k,1))}.pg table.mzi td{text-align:right;padding:3px 8px}
.pg table.mz .mh{text-decoration:none}.pg table.mz .mh b{color:#5b2d8a;text-decoration:underline}
.pg table.mz .mh{color:inherit}.pg table.mz{font-size:calc(10.4px*var(--k,1))}

/* محرر المذكرة داخل المنصة (يحاكي الورقة) */
.mzw{overflow-x:auto;padding-bottom:8px}
.mzp{min-width:760px;background:#fff;color:#111;border-radius:10px;padding:12px;border:1px solid #c9d3e6}
.mztitle{background:#0a2a7a;color:#fff;text-align:center;border-radius:20px;padding:6px;font-weight:800;margin:0 auto 10px;max-width:260px}
.mzed{width:100%;border-collapse:collapse;table-layout:fixed;font-size:12px}
.mzed td,.mzed th{border:1px solid #9fb0d4;padding:4px;vertical-align:top;text-align:right;color:#111}
.mzed th{background:#0a2a7a;color:#fff;text-align:center}
.mzed.mzi{margin-bottom:8px}
.mzed .mg{background:#f4f7fd}
.mzed .mact{background:#e4ecfa;text-align:center;font-weight:800;color:#1d3a8a}
.mzed .mph{text-align:center;vertical-align:middle;font-weight:800;color:#5b2d8a}
.mzed .mph .btn{padding:2px 6px;margin-top:6px}.mzed .mph .btn .ic{width:1em;height:1em;margin:0}
.mzed .m2{display:flex;justify-content:space-between;gap:8px}
.mzt{width:100%;border:1px dashed #b7c4e2;background:#fbfcff;color:#111;border-radius:4px;padding:4px;font:inherit;line-height:1.55;resize:none;overflow:hidden;box-sizing:border-box}
.mzt.inl{display:inline-block;width:78%;vertical-align:top}
.mzt:focus,.mzi2:focus,.mzd:focus{outline:2px solid #2f6bff;background:#fff}
.mzi2{border:1px dashed #b7c4e2;background:#fbfcff;color:#111;border-radius:4px;padding:3px 6px;font:inherit;width:60%}.mzi2.sm{width:80px}
.mzd{width:52px;border:1px dashed #b7c4e2;background:#fbfcff;color:#111;border-radius:4px;padding:3px;text-align:center}
.mzed .mph .btn{color:#1d3a8a;background:#e4ecfa;border:1px solid #9fb0d4}

/* ترويسة المذكرة المضغوطة */
.pg table.mzi{font-size:calc(9.2px*var(--k,1));line-height:1.4;margin:3px 0 5px}
.pg table.mzi td{padding:2px 5px;text-align:right}
.pg table.mzi td.lb{background:#e4ecfa;font-weight:800;color:#1d3a8a;white-space:nowrap}
.mzed.mzi{font-size:11.5px}.mzed .lb{background:#e4ecfa;font-weight:800;color:#1d3a8a}
.mzt.full{width:100%}
.mzed .mzi2{width:100%}.mzed .mzi2.sm{width:100%}

/* رسومات ظروف الإنجاز */
.mdg{position:relative;margin:2px auto 4px;width:calc(100%*var(--k,1))}
.mdg .mdw{position:relative;width:100%;height:0;padding-top:60.61%;overflow:hidden;border:1px solid #c9d8f5;border-radius:6px;box-sizing:content-box}.mdg svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.mdg .mdn{position:absolute;top:2px;right:2px;z-index:1;background:#1d4ed8;color:#fff;border-radius:50%;width:11px;height:11px;font-size:8px;line-height:11px;text-align:center;font-weight:700}
.mztog{display:flex;gap:4px;margin-bottom:4px}.mztog .btn{padding:2px 8px;font-size:11px}
.mzsl{border:1px solid #c9d8f5;border-radius:6px;padding:4px;margin-bottom:4px;background:#f7faff}
.mzsl select,.mzsl input{width:100%;margin:2px 0;font-size:11px;color:#111;background:#fff;border:1px solid #b7c4e2;border-radius:4px;padding:2px}
.mzsl input[type=number]{width:48px}
.mzpv svg{width:100%;height:auto}

/* تخطيط الملاعب */
.fdm,.fdc{position:relative;direction:ltr;background:#fff;margin:0 auto}
.fdc{border:2px solid #0b1f4d;border-radius:14px;background-image:radial-gradient(#cfdaf3 1px,transparent 1px);background-size:14px 14px;user-select:none;-webkit-user-select:none}
.fdi{position:absolute;box-sizing:border-box;background:#e6efff;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:700;color:#0b1f4d;line-height:1.15;overflow:hidden;font-family:inherit}
.fdi.nb{background:transparent;border:none}
.fdi.ti{background:linear-gradient(90deg,#e6efff,#cddfff)}
.fdi[data-id] svg{position:absolute;left:0;top:0;display:block}
.fdi:has(svg){background:transparent}
.fdt{position:relative;z-index:1;direction:rtl;padding:0 2px}
.fdt.fl{background:rgba(244,248,255,.92);border-radius:4px;padding:1px 4px}
.fdv{position:absolute;display:flex;align-items:center;justify-content:center;transform:rotate(-90deg);direction:rtl;text-align:center}
.fdc .fdi{cursor:move;touch-action:none}
.fdc .fdi.sel{outline:2px dashed #2563eb;outline-offset:1px;overflow:visible}
.fdh,.fdb{position:absolute;width:22px;height:22px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px #0005;touch-action:none;z-index:5;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;color:#fff}
.fdh{background:#2563eb;cursor:nwse-resize}
.fdx{background:#dc2626}.fdr{background:#0b1f4d}
.fdpn{position:fixed;left:8px;right:8px;bottom:8px;z-index:60;padding:10px;max-height:45vh;overflow:auto;box-shadow:0 -4px 18px #0b1f4d44;margin:0}
#fdp:not(:empty){height:0}
#view:has(.fdpn){padding-bottom:170px}
.fdpn .wrap{flex-wrap:wrap}
.fdpn input{width:100%;margin-top:6px}
.fdpn{background:#10224f!important;backdrop-filter:none!important;border:1px solid #2b4a9a}
.fdpn .btn.sm{padding:6px 10px;font-size:13px}
.fdpn input{padding:8px}
.fdi.ti .fdt{white-space:nowrap}
.fdi.ti .fdt{white-space:normal!important;font-size:inherit}
.fdi:has(.fdv){overflow:visible}
.fdv{white-space:nowrap}

.pg .pt.cl{font-size:calc(14px*var(--k,1))}
.pg .pt.cl th{font-size:calc(14px*var(--k,1));padding:calc(5px*var(--k,1)) 4px}
.pg .pt.cl td,.pg.modern .pt.cl td{padding:calc(4px*var(--k,1)) calc(4px*var(--k,1));line-height:1.2;font-size:calc(14px*var(--k,1))}
/* وضوح القوائم المنسدلة (حاسوب) */
select option,select optgroup{color:#111;background:#fff}

.pg.land table.rc, .pg.land table.rc th, .pg.land table.rc td { font-size: 11px; height: 19px; line-height: 19px; }
.pg.land table.rc th.dd { font-size: 8px; }
.pg.land table.rc .no { width: 36px; }
.pg.land table.rc .nm { width: 190px; }
.pg.land .rc-meta { margin-bottom: 8px; }
.pg .eqp td, .pg .eqp th { padding: 3px 5px; font-size: 13px; }
.pg .eqp td.l:last-child { width: 28%; }

.mzalt { margin-bottom: 4px; }
.mzalt .btn { font-size: 12px; padding: 3px 8px; }

/* ملخص بياني لبطاقة المتابعة */
.pg .ev2 { display: flex; gap: 8px; margin-top: 6px; }
.pg .ev2c { flex: 1 1 0; min-width: 0; overflow: hidden; border: 1.5px solid #9db6e0; border-radius: 9px; padding: 4px 7px 5px; background: rgba(255, 255, 255, .94); color: #0b1f4d; }
.pg .ev2t { display: flex; justify-content: space-between; align-items: center; font-size: 9px; margin-bottom: 3px; }
.pg .ev2t span { font-size: 7.5px; color: #3b4f7a; }
.pg .ev2r { display: grid; grid-template-columns: 62px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: start; }
.pg .ev2d { position: relative; width: 62px; height: 62px; grid-row: 1; }
.pg .ev2n { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.pg .ev2k { grid-column: 1; grid-row: 2; text-align: center; font-size: 7px; line-height: 1.4; margin-top: 1px; }
.pg .ev2b { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.pg .ev2br { margin-bottom: 3px; }
.pg .ev2l { display: flex; align-items: center; gap: 4px; font-size: 7.5px; line-height: 10px; }
.pg .ev2l .tx { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 9.5px; }   /* التفاف لا قطع بالنقاط: html2canvas يشوّه نص ellipsis العربي */
.pg .ev2l .tx .mn { margin-inline-end: 4px; }
.pg .ev2l b { flex: none; width: 24px; text-align: left; }
.pg .ev2l em { flex: none; font-style: normal; font-weight: 800; width: 48px; text-align: left; }
.pg .ev2tr { height: 5px; border-radius: 3px; background: #e3eaf8; overflow: hidden; }
.pg .ev2tr i { display: block; height: 100%; border-radius: 3px; }

/* ===== البرمجة السنوية (عمودية، تنظيم المفتش) ===== */
.pg h1.plain.apt { border: 1.5px solid #333; border-radius: 8px; padding: 6px 12px; margin: 6px 0 10px; font-size: 17px; }
.pg table.ap { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; margin-top: 8px; color: #000; }
.pg table.ap td, .pg table.ap th, .pg table.ap li { color: #000; }
.pg table.ap th, .pg table.ap td { border: 1.5px solid #444; padding: 6px 7px; vertical-align: top; text-align: right; line-height: 1.55; word-break: break-word; }
.pg table.ap th.apc { background: #eee; font-size: 13px; }
.pg table.ap th.apc span { display: block; font-weight: 700; font-size: 12px; margin-top: 3px; }
.pg table.ap td.api b, .pg table.ap td.apo b { display: block; margin-bottom: 3px; font-size: 12px; }
.pg table.ap th.apn { background: #eee; text-align: center; font-size: 14px; }
.pg table.ap ul.bl { margin: 3px 0 0; padding-inline: 12px 0; }
.pg.modern table.ap th { background: rgba(225, 236, 255, .9); color: #0b2a6b; }
.pg.modern table.ap td, .pg.modern table.ap li { color: #0b1f4d; }
.pg.modern table.ap th, .pg.modern table.ap td { border-color: #0f3a8a; }
.pg.modern h1.plain.apt { border-color: #0f3a8a; }

.pg table.ap .apb { display: none; }
/* النمط العصري: بطاقات بجو المنصة (كحلي/أزرق/ذهبي) */
.pg.modern .fc.apf, .pg.modern .fc { border: 1.5px solid #b9cdf3; border-radius: 16px; padding: 9px 16px; background: linear-gradient(100deg, #e9f1ff, #fff6dc); }
.pg.modern table.ap { border-collapse: separate; border-spacing: 6px; margin: 2px -6px 0; width: calc(100% + 12px); }
.pg.modern table.ap th, .pg.modern table.ap td { border: 0; border-radius: 16px; }
.pg.modern table.ap th.apc { position: relative; background: linear-gradient(135deg, #0a2463, #2f6bff); color: #fff; padding: 9px 10px 10px; font-size: 13px; box-shadow: 0 4px 10px rgba(15, 58, 138, .25); }
.pg.modern table.ap th.apc span { color: #eaf1ff; font-weight: 600; font-size: 11.5px; }
.pg.modern table.ap .apb { display: inline-block; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; text-align: center; margin-inline-end: 8px; background: linear-gradient(135deg, #ffd75e, #ff9d1f); color: #0a2463; font-style: normal; font-weight: 900; font-size: 13px; }
.pg.modern table.ap td.api { background: #eaf1ff; border: 1.5px solid #c3d5f6; }
.pg.modern table.ap td.api b { display: inline-block; background: #0f3a8a; color: #fff; border-radius: 999px; padding: 1px 12px; margin-bottom: 6px; font-size: 11px; }
.pg.modern table.ap td.apo { background: #fff; border: 1.5px solid #c3d5f6; }
.pg.modern table.ap td.apo b { display: inline-block; background: linear-gradient(135deg, #ffd75e, #ff9d1f); color: #0a2463; border-radius: 999px; padding: 1px 10px; margin-bottom: 5px; font-size: 10.5px; }
.pg.modern table.ap th.apn { color: #fff; font-size: 13.5px; padding: 7px 4px; box-shadow: 0 3px 8px rgba(15, 58, 138, .2); }
.pg.modern table.ap th.apn.ind { background: linear-gradient(135deg, #0a2463, #2f6bff); }
.pg.modern table.ap th.apn.col { background: linear-gradient(135deg, #b45309, #f59e0b); color: #fff; }
.pg.modern table.ap td.apk { background: #fff; border: 1.5px solid #c3d5f6; }
.pg.modern table.ap ul.bl { list-style: none; padding-inline: 0; }
.pg.modern table.ap ul.bl li { position: relative; padding-inline-start: 13px; margin-bottom: 3px; }
.pg.modern table.ap ul.bl li::before { content: ''; position: absolute; right: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #2f6bff; }
.pg.modern table.ap td.api ul.bl li::before { background: #f59e0b; }

.pg.modern table.ap { font-size: 10.5px; border-spacing: 5px; }
.pg.modern table.ap th, .pg.modern table.ap td { line-height: 1.38; padding: 6px 7px; }
.pg.modern table.ap th.apc { font-size: 12.5px; padding: 8px 9px 9px; }
.pg.modern table.ap th.apc span { font-size: 11px; }
.pg.modern table.ap ul.bl li { margin-bottom: 2px; padding-inline-start: 11px; }
.pg.modern table.ap ul.bl li::before { width: 5px; height: 5px; }
.pg.modern table.ap td.apo b { white-space: nowrap; font-size: 10px; padding: 1px 8px; margin-bottom: 4px; }
.pg.modern table.ap th.apn { font-size: 12.5px; padding: 6px 3px; }
.pg.modern .fc { padding: 7px 14px; font-size: 13px; margin-bottom: 4px; }

/* بطاقة البداية */
.onb { display: grid; gap: 8px; margin-bottom: 12px; }
.onbi { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--glass-b, #2a4a9a); border-radius: 12px; }
.onbi i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(110,168,255,.18); flex: none; }
.onbi.ok { opacity: .6; } .onbi.ok i { background: #1f9d63; color: #fff; }
.onbi span { display: flex; flex-direction: column; }
.onbi small { font-size: .78rem; }
.list .item > b { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.list .item > .muted.small { white-space: nowrap; flex: none; }

/* المساعدة */
.hq { background: rgba(110,168,255,.18); border: 1px solid var(--glass-b, #2a4a9a); color: #cfe0ff; border-radius: 999px; padding: 3px 10px; font-size: .8rem; margin-inline-end: 8px; }
.hq1 { border-top: 1px solid rgba(255,255,255,.1); padding: 8px 0; }
.hq1 summary { cursor: pointer; font-weight: 600; line-height: 1.7; }
.hq1 p { margin: 6px 0 2px; line-height: 1.9; color: #cfe0ff; }
.hsec h3 { margin: 0 0 4px; }

/* استعمال الزمن: هوية المنصة (أزرق كحلي + ذهبي) وألوان المستويات */
.pg .tt td { height: 108px; border-color: #b9c9e8; }
.pg .tt tbody td:not(.has):not(.tm) { background: #fff; }
.pg .tt td.tm { height: 108px; color: #0f3a8a; background: #f3f6fd; font-size: 13px; font-weight: 700; }
.pg .tt th { background: #0f3a8a; color: #fff; border-color: #0f3a8a; font-size: 21px; padding: 12px 4px; }
.pg.modern .tt th { background: #0f3a8a; color: #fff; }
.pg .tt tr.brk td { height: 36px; font-size: 14px; font-weight: 700; color: #0f3a8a; background: #e8eefb; }
.pg .tt td.has small { display: block; font-size: 11px; font-weight: 600; opacity: .8; margin-top: 5px; }
.pg .tt td.has.l1, #view .tt td.has.l1 { background: #cfe0ff; color: #08246a; }
.pg .tt td.has.l2, #view .tt td.has.l2 { background: #ffe5a8; color: #5a3a00; }
.pg .tt td.has.l3, #view .tt td.has.l3 { background: #cdeedd; color: #0b4a33; }
.pg.modern .tt td.has.l1 { background: #cfe0ff; color: #08246a; } .pg.modern .tt td.has.l2 { background: #ffe5a8; color: #5a3a00; } .pg.modern .tt td.has.l3 { background: #cdeedd; color: #0b4a33; }
.pg .tth { display: flex; justify-content: space-between; margin: 0 2px 12px; font-size: 16px; font-weight: 700; color: #0f3a8a; }
.pg .ttl { display: flex; gap: 18px; align-items: center; margin: 14px 2px 0; font-size: 14px; color: #0f3a8a; }
.pg .ttl i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -3px; border: 1px solid #9db6e0; }
.pg .ttl i.l1 { background: #cfe0ff; } .pg .ttl i.l2 { background: #ffe5a8; } .pg .ttl i.l3 { background: #cdeedd; }
.pg .ttl .ttn { margin-inline-start: auto; font-weight: 700; }
.pg.modern .tt td, .pg.modern .tt td.tm { height: 90px; }
.pg.modern .tt tr.brk td { height: 34px; }
.pg.modern .tt tbody td:not(.has):not(.tm) { background: #fff; }

.pg .ths { font-size: 8px; font-weight: 400; white-space: nowrap; }

/* استعمال الزمن بصفحة عرضية */
.pg.land .tt td, .pg.land .tt td.tm, .pg.modern.land .tt td, .pg.modern.land .tt td.tm { height: 50px; padding: 3px 4px; }
.pg.land .tt th, .pg.modern.land .tt th { font-size: 17px; padding: 8px 4px; }
.pg.land .tt td.tm { font-size: 12px; }
.pg.land .tt tr.brk td, .pg.modern.land .tt tr.brk td { height: 26px; font-size: 13px; }
.pg.land .tt td.has small { font-size: 10px; margin-top: 2px; }
.pg.land .tth { font-size: 14px; margin-bottom: 8px; }
.pg.land .ttl { margin-top: 10px; font-size: 13px; }
.pg.land .tt td.has { font-size: 17px; }

.pg .pc small.wd { font-size: 10px; font-weight: 400; color: #475569; margin-inline-start: 4px; }
.pcw small.wdh { display: block; font-size: 11px; color: #64748b; }
.pcw small.wdh.bad { color: #b91c1c; font-weight: 700; }
.evs .gap{color:#b45309;font-size:11px;font-weight:700}
/* صفحات إضافية: سطر «تابع لـ…» أعلى الصفحة ورقم الصفحة أسفلها (بلون ذهبي يغاير الإطار) */
.pg .ct { text-align: center; font-size: 14px; font-weight: 700; color: #0b2a6b; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1.5px solid #b8860b; }
.pg .pn { position: absolute; left: 0; right: 0; bottom: 9px; text-align: center; font-size: 14px; font-weight: 700; color: #b8860b; line-height: 18px; }
.pg.modern .pn { color: #f0c24d; bottom: 22px; }
/* أسفل الوثيقة: الإمضاءات في سطر واحد (يمين/يسار، وإن كانت ثلاثة فيمين ووسط ويسار) ثم السنة الدراسية في آخر سطر وسطه */
.pg .sgr { display: flex; justify-content: space-between; margin: 26px 8px 0; font-weight: 700; font-size: 14px; color: #0b2a6b; }
.pg .yrc { text-align: center; margin: 22px 0 0; font-weight: 700; font-size: 14px; color: #0b2a6b; }
.pg .yrc.yfix { position: absolute; left: 0; right: 0; margin: 0; }
.auth .hook { font-size: clamp(1.5rem, 7vw, 1.9rem); line-height: 1.3; margin: 6px 0 4px; font-weight: 700; }
.auth .hook-s { margin: 0 0 14px; }

.auth .about-btn { display: block; width: fit-content; margin: 2px auto 16px; padding: 9px 26px; border: 1.5px solid #f0c24d; border-radius: 999px; color: #fff; background: rgba(240, 194, 77, .12); font-weight: 700; font-size: 1rem; text-decoration: none; text-align: center; }
.auth .about-btn span { color: #f0c24d; margin-inline-start: 4px; }
.auth .about-btn:active { background: rgba(240, 194, 77, .28); }
