/* ============================================================
   هوية المنصة — مستمدة من شعار الجامع (الأخضر والذهبي)
   وشعار خيركم (البرتقالي والزيتوني والبني) ومكتب إشراف الشرق
   التخطيط: شريط جانبي فاتح يبرز شعار الجامع + شريط تاريخ أخضر
   ============================================================ */
@font-face { font-family: 'KFGQPC Hafs'; src: url('../fonts/hafs.18.woff2') format('woff2'), url('../fonts/hafs.18.ttf') format('truetype'); font-display: swap; }

:root {
  --green: #0e4b36;
  --green-2: #15634a;
  --green-ink: #0a3628;
  --gold: #b27b2c;
  --gold-2: #c9973f;
  --gold-soft: #f4ead6;
  --orange: #e8701f;
  --olive: #5b7314;
  --brown: #6b3219;
  --sharq: #b85a06;

  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --line: #e5e0d3;
  --line-2: #efebe1;
  --ink: #17231e;
  --ink-2: #33423b;
  --muted: #6a756f;
  --primary: var(--green);
  --primary-ink: #ffffff;
  --accent: var(--gold);
  --band: var(--green);
  --band-ink: #eef3ef;
  --page-bg: #fffdf7;
  --page-ink: #1a1a14;
  --page-frame: #b27b2c;
  --hl: rgba(178, 123, 44, .16);
  --sel: rgba(14, 75, 54, .14);
  --play: rgba(232, 112, 31, .2);

  --ok: #1f7a4d; --ok-bg: #e5f2ea;
  --warn: #a96608; --warn-bg: #fbefd9;
  --bad: #b23a26; --bad-bg: #f9e4df;
  --info: #2f6687; --info-bg: #e3eef4;
  --wa: #1d9e55; --wa-ink: #fff;

  --shadow: 0 1px 2px rgba(23, 35, 30, .05), 0 4px 16px rgba(23, 35, 30, .05);
  --shadow-lg: 0 12px 40px rgba(10, 30, 22, .18);
  --r: 14px; --r-sm: 9px;

  --f-ui: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
  --f-display: 'Reem Kufi', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --f-quran: 'KFGQPC Hafs', 'Amiri Quran', 'Scheherazade New', serif;
  --side-w: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #2f8f6b; --green-2: #3aa47c; --green-ink: #bfe3d3; --gold: #d3a253; --gold-2: #e1b46a; --gold-soft: #2c2619;
    --orange: #f08a43; --olive: #9cb64a; --brown: #c98a6a; --sharq: #e08a3c;
    --bg: #0d1513; --surface: #141e1b; --surface-2: #18231f; --line: #26342f; --line-2: #1f2b27; --ink: #e8eeea; --ink-2: #c8d3cd; --muted: #93a29b;
    --primary: #2f8f6b; --primary-ink: #fff; --band: #0f3a2b; --band-ink: #e6efe9;
    --page-bg: #17201c; --page-ink: #ece6d6; --page-frame: #8c6a33; --hl: rgba(211, 162, 83, .2); --sel: rgba(47, 143, 107, .28); --play: rgba(240, 138, 67, .25);
    --ok: #5cc28d; --ok-bg: #16301f; --warn: #e6a64a; --warn-bg: #33270f; --bad: #ec7c66; --bad-bg: #3a1c16; --info: #7fb5d6; --info-bg: #16283a;
    --wa: #25b863; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #2f8f6b; --green-2: #3aa47c; --green-ink: #bfe3d3; --gold: #d3a253; --gold-2: #e1b46a; --gold-soft: #2c2619;
  --orange: #f08a43; --olive: #9cb64a; --brown: #c98a6a; --sharq: #e08a3c;
  --bg: #0d1513; --surface: #141e1b; --surface-2: #18231f; --line: #26342f; --line-2: #1f2b27; --ink: #e8eeea; --ink-2: #c8d3cd; --muted: #93a29b;
  --primary: #2f8f6b; --primary-ink: #fff; --band: #0f3a2b; --band-ink: #e6efe9;
  --page-bg: #17201c; --page-ink: #ece6d6; --page-frame: #8c6a33; --hl: rgba(211, 162, 83, .2); --sel: rgba(47, 143, 107, .28); --play: rgba(240, 138, 67, .25);
  --ok: #5cc28d; --ok-bg: #16301f; --warn: #e6a64a; --warn-bg: #33270f; --bad: #ec7c66; --bad-bg: #3a1c16; --info: #7fb5d6; --info-bg: #16283a;
  --wa: #25b863; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.02rem; font-weight: 700; }
h4 { font-size: .92rem; font-weight: 700; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }
.t-muted { color: var(--muted); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86rem; letter-spacing: .02em; }
.num, .kpi-v, .mono, .tbl td { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sp { flex: 1; }
.link { font-size: .85rem; }

#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
#boot img { width: 140px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.97); } }

/* ---------- أزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font: 600 .9rem/1 var(--f-ui); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--green-2); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-2); }
.btn-soft { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-soft:hover { border-color: var(--green); color: var(--green); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-wa:hover { filter: brightness(1.06); }
.btn-on-dark { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .18); }
.btn-sm { height: 32px; padding: 0 11px; font-size: .82rem; border-radius: 8px; gap: 5px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: .98rem; border-radius: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--green); }
.icon-btn.wa { color: var(--wa); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- حقول ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; min-width: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--sel); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
select.sm { height: 32px; width: auto; font-size: .82rem; padding: 0 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; }
.field.inline select, .field.inline input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; }
.inp-ic { position: relative; display: flex; align-items: center; }
.inp-ic > .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.inp-ic input { padding-inline-start: 42px; height: 48px; }
.inp-ic .eye { position: absolute; inset-inline-end: 4px; }
.inp-row { display: flex; gap: 8px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 180px; }
.search .ic { position: absolute; inset-inline-start: 11px; color: var(--muted); width: 18px; }
.search input { padding-inline-start: 38px; }

/* ---------- عناصر ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.seg button { height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 .85rem var(--f-ui); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--green); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 500 .84rem var(--f-ui); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--green); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { height: 42px; padding: 0 14px; border: 0; background: none; color: var(--muted); font: 600 .9rem var(--f-ui); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--green); border-bottom-color: var(--gold); }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--green)); border-radius: 99px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-art { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.empty-art .ic { width: 28px; height: 28px; }
.empty h4 { color: var(--ink-2); font-size: 1rem; }
.dcell { display: grid; line-height: 1.35; }
.dcell b { font-size: .85rem; }
.dcell span { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.dcell small { font-size: .74rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lgd { width: 12px; height: 12px; border-radius: 3px; background: var(--line-2); border: 1px solid var(--line); display: inline-block; }
.lgd.full { background: var(--green); border-color: var(--green); }
.lgd.part { background: linear-gradient(0deg, var(--gold) 50%, var(--line-2) 50%); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--ok); }

/* ---------- الهيكل ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 14px 14px; overflow-y: auto; z-index: 40; }
.brand { display: grid; justify-items: center; gap: 4px; padding: 6px 6px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); text-decoration: none !important; }
.brand-logo { width: 168px; height: auto; }
.brand-sub { font-size: .8rem; color: var(--muted); }
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .lf-logo { background: #fbf8f1; border-radius: 16px; padding: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo, :root:not([data-theme="light"]) .lf-logo { background: #fbf8f1; border-radius: 16px; padding: 10px; } }
.nav { display: grid; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .92rem; text-decoration: none !important; position: relative; }
.nav-i:hover { background: var(--surface-2); color: var(--green); }
.nav-i.on { background: var(--green); color: #fff; }
.nav-i.on .ic { color: var(--gold-2); }
.nav-badge { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font: 700 .72rem/20px var(--f-ui); text-align: center; font-style: normal; }
.side-foot { margin-top: auto; padding-top: 16px; }
.partners { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); }
.partners img { height: 40px; width: auto; object-fit: contain; }
.partners img:last-child { height: 48px; }
.side-scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 64px; padding-block: 8px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); background: var(--band); color: var(--band-ink); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--band); }
.topbar .icon-btn { color: var(--band-ink); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.menu-btn, .top-logo { display: none; }
.datebar { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.db-day { display: grid; line-height: 1.2; }
.db-day b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; color: #fff; }
.db-time { font-size: .8rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.db-dates { display: grid; line-height: 1.35; padding-inline-start: 18px; border-inline-start: 1px solid rgba(255, 255, 255, .18); }
.db-h { font-weight: 600; color: #fff; font-size: .92rem; }
.db-g { font-size: .8rem; opacity: .78; }
.db-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: rgba(255, 255, 255, .1); color: #fff; white-space: nowrap; }
.db-chip.live { background: var(--gold); }
.db-chip.off { background: rgba(178, 58, 38, .5); }
.db-chip.remote { background: rgba(47, 102, 135, .6); }
.db-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.top-acts { display: flex; align-items: center; gap: 6px; }
.sync { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: .74rem; background: rgba(255, 255, 255, .08); cursor: pointer; white-space: nowrap; }
.sync .ic { width: 15px; height: 15px; }
.sync.busy .ic { animation: spin 1s linear infinite; }
.sync.err, .sync.local { color: #ffd59a; }
@keyframes spin { to { transform: rotate(-360deg); } }
.usr { position: relative; }
.usr-btn { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 8px 0 4px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 10px; }
.usr-btn:hover { background: rgba(255, 255, 255, .08); }
.usr-btn .ic { width: 16px; opacity: .7; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #fff; font-weight: 700; }
.usr-n { display: grid; line-height: 1.25; text-align: start; }
.usr-n b { font-size: .86rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-n small { font-size: .72rem; opacity: .75; }
.usr-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.usr-menu a, .usr-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; background: none; border-radius: 8px; color: var(--ink-2); font: 500 .9rem var(--f-ui); cursor: pointer; text-decoration: none !important; }
.usr-menu a:hover, .usr-menu button:hover { background: var(--surface-2); }
.page { padding-block: 24px 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); max-width: 1320px; width: 100%; margin: 0 auto; display: grid; gap: 18px; align-content: start; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head p { margin-top: 4px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bottom-nav { display: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-alert { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-main.one { grid-template-columns: minmax(0, 1fr); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.rep-tbl td:first-child { white-space: nowrap; }
.col { display: grid; gap: 18px; min-width: 0; }
.sub-h { margin: 16px 0 10px; }

/* ---------- الرئيسية ---------- */
.hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 28px; border-radius: 18px; background: var(--green); color: #fff; }
:root[data-theme="dark"] .hero { background: #0f3a2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #0f3a2b; } }
.hero::after { content: ""; position: absolute; inset-inline-end: -40px; top: -60px; width: 300px; height: 300px; background: url('../img/logo-mosque.png') center/contain no-repeat; opacity: .07; filter: brightness(4) grayscale(1); pointer-events: none; }
.hero-t { position: relative; z-index: 1; display: grid; gap: 4px; }
.eyebrow { color: var(--gold-2); font-size: .85rem; font-weight: 600; letter-spacing: .02em; }
.hero h1 { color: #fff; }
.hero-s { opacity: .88; font-size: .95rem; }
.hero-s b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.hero-acts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.onboard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-style: dashed; border-color: var(--gold); background: var(--gold-soft); }
.onboard p { margin-top: 4px; max-width: 62ch; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.kpi-l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-v { font-size: 1.75rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.kpi-v.sm { font-size: 1.2rem; padding-block: 5px; }
.kpi-v small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.kpi-s { font-size: .78rem; color: var(--muted); }
.hal-list { display: grid; gap: 10px; }
.hal { display: grid; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: inherit; text-decoration: none !important; transition: border-color .15s; }
.hal:hover { border-color: var(--gold); }
.hal-t { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.hal-t span { font-size: .82rem; }
.hal-n { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); }
.hal-n b { color: var(--ink); }
.feed, .alerts, .upc, .times, .msgs, .top { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed li span { color: var(--ink-2); }
.feed li small { margin-inline-start: auto; }
.alerts li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.alerts li > div { flex: 1; display: grid; line-height: 1.35; font-size: .88rem; min-width: 0; }
.alerts li > div span { font-size: .78rem; }
.upc li, .times li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: .85rem; }
.upc li:last-child, .times li:last-child { border-bottom: 0; }
.times .tm { display: grid; font-size: .8rem; color: var(--muted); margin-inline-start: auto; text-align: end; }
.times .tm b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- التحضير اليومي ---------- */
.daybar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.dn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dn-t { display: grid; line-height: 1.3; min-width: 190px; text-align: center; }
.dn-t b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; color: var(--green); }
.dn-t span { font-weight: 600; font-size: .9rem; }
.dn-t small { color: var(--muted); font-size: .78rem; }
.dn input[type=date] { width: auto; height: 36px; font-size: .85rem; }
.tabs-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tabs-row .tabs { border: 0; gap: 6px; }
.tabs-row .tab { height: 36px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); margin: 0; }
.tabs-row .tab.on { background: var(--green); border-color: var(--green); color: #fff; }
.tabs-row .search { max-width: 300px; }
.att-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 99px; font-size: .8rem; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.as b { color: var(--ink); font-variant-numeric: tabular-nums; }
.as.ok b { color: var(--ok); } .as.warn b { color: var(--warn); } .as.bad b { color: var(--bad); } .as.info b { color: var(--info); }
.srows { display: grid; gap: 8px; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; border-inline-start: 4px solid var(--line); }
.srow.st-present { border-inline-start-color: var(--ok); }
.srow.st-late { border-inline-start-color: var(--warn); }
.srow.st-absent { border-inline-start-color: var(--bad); background: color-mix(in srgb, var(--bad-bg) 40%, var(--surface)); }
.srow.st-excused { border-inline-start-color: var(--info); }
.sr-main { display: grid; gap: 2px; min-width: 0; }
.sr-name { font-weight: 700; color: var(--ink); font-size: .98rem; }
.sr-sub { font-size: .78rem; color: var(--muted); }
.sr-entries { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.entry { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font: 500 .8rem var(--f-ui); color: var(--ink-2); cursor: pointer; text-align: start; }
.entry i { font-style: normal; font-weight: 700; font-size: .72rem; padding: 1px 7px; border-radius: 5px; }
.entry.hifz i { background: var(--sel); color: var(--green); }
.entry.review i { background: var(--gold-soft); color: var(--gold); }
.entry b { color: var(--ok); font-size: .74rem; }
.att-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.att-seg button { height: 32px; min-width: 50px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 600 .8rem var(--f-ui); cursor: pointer; }
.att-seg button:hover { color: var(--ink); }
.att-seg button.on.ok { background: var(--ok); color: #fff; }
.att-seg button.on.warn { background: var(--warn); color: #fff; }
.att-seg button.on.bad { background: var(--bad); color: #fff; }
.att-seg button.on.info { background: var(--info); color: #fff; }
.sr-acts { display: flex; gap: 6px; align-items: center; }

/* ---------- الجداول ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.filters select { width: auto; min-width: 140px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card .tbl-wrap { border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: start; font-size: .76rem; font-weight: 700; color: var(--muted); padding: 11px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .cb { width: 40px; }
.tbl .acts { text-align: end; white-space: nowrap; width: 1%; }
.cell-name { display: grid; line-height: 1.35; color: var(--ink); }
.cell-name small { color: var(--muted); font-size: .76rem; }
.mini-prog { display: grid; gap: 3px; min-width: 90px; }
.mini-prog small { color: var(--muted); font-size: .74rem; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .76rem; font-weight: 700; }
.log-tbl td:nth-child(3) { min-width: 170px; }
.log-tbl td:nth-child(4) { white-space: nowrap; }
.tag.hifz { background: var(--sel); color: var(--green); }
.tag.review { background: var(--gold-soft); color: var(--gold); }
.muted-row td { opacity: .55; }

/* ---------- ملف الطالب ---------- */
.prof-head { align-items: center; }
.prof-id { display: grid; gap: 4px; }
.prof-id p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .84rem; color: var(--muted); }
.back .ic { width: 16px; }
.student-hero .ring { position: relative; z-index: 1; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 9; }
.card .ring-bg { stroke: var(--line-2); }
.ring-fg { fill: none; stroke: var(--gold-2); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.2; }
.ring-t b { font-size: 1.35rem; }
.ring-t span { font-size: .72rem; opacity: .8; }
.juzmap { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; direction: rtl; }
.jz { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 7px; background: var(--line-2); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; font-size: .74rem; font-weight: 600; color: var(--muted); }
.jz::before { content: ""; position: absolute; inset: auto 0 0; height: calc(var(--f) * 100%); background: var(--gold); opacity: .55; }
.jz.full { background: var(--green); border-color: var(--green); color: #fff; }
.jz.full::before { display: none; }
.jz span { position: relative; }
.suras-done { margin-top: 12px; font-size: .86rem; }
.suras-done summary { cursor: pointer; color: var(--green); font-weight: 600; }
.suras-done p { margin-top: 8px; color: var(--ink-2); line-height: 1.9; }
.next-items { display: grid; gap: 10px; }
.ni { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.ni-t { grid-row: span 2; padding: 6px 12px; border-radius: 8px; font-size: .78rem; font-weight: 700; }
.ni-t.hifz { background: var(--sel); color: var(--green); }
.ni-t.review { background: var(--gold-soft); color: var(--gold); }
.ni > span.t-muted { font-size: .8rem; }
.ni-acts { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.tab-body { padding-top: 14px; }
.att-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.ac { display: grid; gap: 1px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: .78rem; line-height: 1.35; border-top: 3px solid var(--line); }
.ac b { font-size: .82rem; }
.ac small { color: var(--muted); }
.ac i { font-style: normal; font-weight: 700; font-size: .74rem; margin-top: 3px; }
.ac.ok { border-top-color: var(--ok); } .ac.ok i { color: var(--ok); }
.ac.warn { border-top-color: var(--warn); } .ac.warn i { color: var(--warn); }
.ac.bad { border-top-color: var(--bad); } .ac.bad i { color: var(--bad); }
.ac.info { border-top-color: var(--info); } .ac.info i { color: var(--info); }
.msgs li { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.msg-h { display: flex; justify-content: space-between; gap: 10px; }
.msgs details summary { cursor: pointer; font-size: .82rem; color: var(--green); margin-top: 4px; }
.msgs pre, .preview, .q-text { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .88rem; line-height: 1.85; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; margin: 8px 0 0; }
.ann-list { display: grid; gap: 10px; }
.ann { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.ann > .ic { color: var(--gold); margin-top: 3px; }
.ann p { white-space: pre-wrap; margin: 4px 0; font-size: .9rem; }

/* ---------- الرسائل ---------- */
.msg-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.tpl-list { padding: 10px; display: grid; gap: 12px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.tpl-cat h4 { font-size: .74rem; color: var(--muted); padding: 4px 10px; letter-spacing: .02em; }
.tpl-i { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 600 .86rem var(--f-ui); text-align: start; cursor: pointer; }
.tpl-i small { font-size: .68rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tpl-i:hover { background: var(--surface-2); }
.tpl-i.on { background: var(--sel); color: var(--green); }
.composer { display: grid; gap: 16px; }
.composer .card-h { margin: 0; }
.cmp-sec { display: grid; gap: 10px; }
.cmp-sec select { width: auto; }
.cmp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmp-fields .span2 { grid-column: 1 / -1; }
.rec-n { font-size: .88rem; }
.preview { max-height: 360px; overflow-y: auto; margin: 0; }
.cmp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* ---------- التقويم ---------- */
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-t { display: grid; text-align: center; }
.cal-t b { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; }
.cal-t span { color: var(--gold); font-weight: 600; font-size: .88rem; }
.cal-w, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-w span { text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cd { min-height: 64px; display: grid; align-content: start; gap: 1px; padding: 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); text-align: start; font: inherit; color: var(--muted); cursor: pointer; }
.cd.empty { border: 0; background: none; cursor: default; }
.cd b { font-size: .95rem; color: var(--ink-2); }
.cd .hd { font-size: .68rem; color: var(--gold); line-height: 1.3; }
.cd i { font-style: normal; font-size: .64rem; font-weight: 700; margin-top: 2px; }
.cd.regular { background: var(--ok-bg); border-color: transparent; }
.cd.regular b { color: var(--ok); }
.cd.extra { background: var(--sel); border-color: var(--green); }
.cd.remote { background: var(--info-bg); border-color: transparent; } .cd.remote i { color: var(--info); }
.cd.off { background: var(--bad-bg); border-color: transparent; } .cd.off i { color: var(--bad); }
.cd.today { outline: 2px solid var(--gold); outline-offset: -2px; }
.lgd.reg { background: var(--ok-bg); } .lgd.extra { background: var(--sel); border-color: var(--green); } .lgd.remote { background: var(--info-bg); } .lgd.off { background: var(--bad-bg); }

/* ---------- التقارير ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--f-ui); }
.bar-r.ok { fill: var(--ok); } .bar-r.warn { fill: var(--warn); } .bar-r.bad { fill: var(--bad); }
.top li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.top li b { margin-inline-start: auto; font-size: .82rem; color: var(--green); }
.rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: .8rem; }
.top li:first-child .rk { background: var(--gold); color: #fff; }

/* ---------- الإعدادات ---------- */
.settings { display: grid; gap: 18px; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: .9rem; padding: 6px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: inset-inline-start .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { inset-inline-start: 21px; }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.save-bar .btn { box-shadow: var(--shadow-lg); }

/* ---------- النوافذ ---------- */
.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(8, 20, 15, .5); backdrop-filter: blur(2px); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .2s ease; overflow: hidden; }
@keyframes rise { from { transform: translateY(14px); opacity: .6; } }
.modal.sm { width: min(420px, 100%); }
.modal.lg { width: min(780px, 100%); }
.modal.xl { width: min(1100px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { font-size: 1.05rem; }
.modal-b { padding: 18px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.modal-f, .modal-f.in { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.modal-f.in { margin: 0 -18px -18px; position: sticky; bottom: -18px; }
.confirm-t { font-size: .95rem; line-height: 1.8; }

/* نافذة التسميع */
.rec-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rec-top input[type=date] { height: 36px; width: auto; }
.segs-box { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.segs-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: .9rem; }
.segs-h span { font-size: .78rem; }
.segs { display: grid; gap: 8px; }
.segs-empty { padding: 14px; text-align: center; font-size: .86rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.seg-row { display: grid; grid-template-columns: minmax(150px, 1.6fr) minmax(70px, .7fr) minmax(70px, .7fr) auto auto auto; gap: 8px; align-items: end; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.seg-row label { display: grid; gap: 3px; }
.seg-row label span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.seg-row input, .seg-row select { height: 38px; }
.seg-row .chip { height: 38px; }
.s-info { font-size: .74rem; white-space: nowrap; padding-bottom: 10px; }
.segs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.short-grid, .juz-grid { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; max-height: 210px; overflow-y: auto; }
.amount { font-size: .86rem; color: var(--ink-2); }
.amount span { display: inline-flex; align-items: center; gap: 6px; }
.amount .ic { color: var(--gold); width: 18px; }
.amount b { color: var(--green); }
.rec-eval { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.grade-seg button { min-width: 64px; }
.grade-seg button.on { background: var(--green); color: #fff; }
.steppers { display: flex; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.stepper span { font-size: .8rem; color: var(--muted); font-weight: 600; padding-inline: 4px 6px; }
.stepper b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { width: 30px; height: 30px; }
.creds { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); }
.creds > div { display: flex; align-items: center; gap: 8px; }
.creds span { font-size: .8rem; color: var(--muted); }
.creds b { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
.nf-b { display: grid; gap: 8px; }
.nf-segs { display: grid; gap: 8px; }
.nf-segs .seg-row { grid-template-columns: minmax(150px, 1.6fr) minmax(70px, .7fr) minmax(70px, .7fr) auto; }

/* قائمة الإرسال */
.q-head { display: grid; gap: 8px; }
.q-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--wa); transition: width .3s; }
.q-tip { font-size: .82rem; }
.q-list { display: grid; gap: 6px; }
.q-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.q-item.done { background: var(--ok-bg); border-color: transparent; }
.q-item.done .q-send { background: var(--ok); }
.q-who { display: grid; line-height: 1.4; min-width: 0; }
.q-who span { font-size: .8rem; direction: ltr; text-align: end; justify-self: start; }
.q-acts { display: flex; gap: 4px; align-items: center; }
.q-text { grid-column: 1 / -1; margin: 0; }

/* الاستيراد */
.drop { display: grid; justify-items: center; gap: 8px; padding: 36px 18px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.drop .ic { width: 38px; height: 38px; color: var(--gold); }
.drop.over, .drop:hover { border-color: var(--green); background: var(--sel); }
.imp-help { display: grid; gap: 10px; font-size: .88rem; color: var(--ink-2); line-height: 1.8; }
.imp-help .btn { justify-self: start; }
.imp-step { display: grid; gap: 14px; }
.imp-file-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-file-name .ic { color: var(--ok); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.map-i { display: grid; gap: 4px; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.map-i span { font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-i select { height: 36px; font-size: .84rem; }
.imp-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-opts { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.imp-prev { max-height: 340px; overflow-y: auto; }
.imp-done { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px 0; }
.imp-done > .ic { width: 52px; height: 52px; padding: 12px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.imp-done .row-actions { justify-content: center; margin-top: 8px; }

/* ---------- المصحف ---------- */
.mushaf { position: relative; display: grid; gap: 14px; }
.mushaf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.mushaf-bar select { width: auto; max-width: 190px; height: 38px; }
.m-pg { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }
.m-pg input { width: 78px; height: 38px; text-align: center; }
.m-tools { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.mushaf-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pg-nav { width: 44px; height: 88px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--green); cursor: pointer; display: grid; place-items: center; }
.pg-nav:hover { border-color: var(--gold); }
.page-wrap { display: flex; justify-content: center; min-width: 0; }
.page-frame { width: min(640px, 100%); padding: 9px; border-radius: 6px; background: var(--page-frame); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 7px); box-shadow: var(--shadow-lg); }
.page-in { background: var(--page-bg); border-radius: 3px; padding: 14px 24px 12px; outline: 1.5px solid var(--page-frame); outline-offset: -6px; min-height: 560px; display: flex; flex-direction: column; }
.pg-head, .pg-foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--gold); font-weight: 600; padding: 4px 6px; }
.pg-head { border-bottom: 1px solid color-mix(in srgb, var(--page-frame) 40%, transparent); margin-bottom: 8px; }
.pg-head .ph-sura, .pg-head .ph-juz { font-family: var(--f-display); }
.pg-foot { justify-content: center; margin-top: auto; padding-top: 8px; }
.pf-num { min-width: 38px; height: 26px; display: grid; place-items: center; border: 1px solid var(--page-frame); border-radius: 99px; font-variant-numeric: tabular-nums; }
.page-body { --qs: 1; font-family: var(--f-quran); font-size: calc(1.55rem * var(--qs)); line-height: 2.15; color: var(--page-ink); text-align: justify; text-align-last: center; word-spacing: .02em; flex: 1; }
.page-body.centered { text-align: center; text-align-last: center; padding: 40px 10% 20px; }
.page-body .ay { cursor: pointer; border-radius: 6px; transition: background .15s; padding: 0 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.page-body .ay:hover { background: var(--hl); }
.page-body .ay.hl { background: var(--hl); }
.page-body .ay.sel { background: var(--sel); box-shadow: inset 0 -2px 0 var(--green); }
.page-body .ay.playing, .follow-t .ay.playing { background: var(--play); }
.sura-head { margin: 10px 0 4px; display: flex; justify-content: center; }
.sura-head span { display: inline-block; min-width: 72%; padding: 4px 30px; text-align: center; font-size: .82em; color: var(--page-ink); border: 1.5px solid var(--page-frame); border-radius: 4px; background: linear-gradient(90deg, transparent, var(--hl), transparent); position: relative; line-height: 1.9; }
.sura-head span::before, .sura-head span::after { content: "۞"; position: absolute; top: 50%; transform: translateY(-50%); color: var(--page-frame); font-size: .8em; }
.sura-head span::before { right: 10px; } .sura-head span::after { left: 10px; }
.basmala { text-align: center; font-size: .95em; margin-bottom: 2px; }
.m-loading { text-align: center; color: var(--muted); font-family: var(--f-ui); font-size: .95rem; padding: 60px 0; }
.m-note { font-size: .76rem; color: var(--muted); text-align: center; max-width: 72ch; margin: 0 auto; }
.sel-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.sel-msg { font-size: .88rem; line-height: 1.7; }
.sel-actions { display: flex; gap: 8px; }
.ay-pop { position: absolute; z-index: 10; width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.ay-pop .pop-t { font-size: .78rem; color: var(--muted); padding: 4px 8px 6px; font-weight: 600; }
.ay-pop button { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 9px; border: 0; background: none; border-radius: 8px; font: 500 .88rem var(--f-ui); color: var(--ink-2); cursor: pointer; text-align: start; }
.ay-pop button:hover { background: var(--surface-2); color: var(--green); }
.ay-pop .ic { width: 17px; }
.mushaf-modal .modal-b { background: var(--bg); }
.mushaf-modal .page-in { min-height: 480px; }

/* الاستماع */
.quick-l { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick-l .btn { white-space: normal; height: auto; min-height: 44px; padding-block: 8px; text-align: start; }
.listen-grid .card .row-actions { margin-top: 18px; }
.listen-grid .card > .t-muted { margin-top: 12px; }
.follow-t { font-family: var(--f-quran); font-size: 1.5rem; line-height: 2.2; color: var(--page-ink); max-height: 62vh; overflow-y: auto; text-align: justify; padding: 6px 4px; }
.follow-t .ay { cursor: pointer; border-radius: 6px; }
.follow-t .ay:hover { background: var(--hl); }
.ft-s { font-family: var(--f-display); font-size: 1rem; color: var(--gold); text-align: center; margin: 6px 0; }
.follow { background: var(--page-bg); }

/* المشغّل المصغّر */
.mini-player { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 16px; background: var(--green-ink); color: #fff; box-shadow: var(--shadow-lg); }
:root[data-theme="dark"] .mini-player { background: #0b2a1f; border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mini-player { background: #0b2a1f; border: 1px solid var(--line); } }
.mp-info { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.mp-title { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { font-size: .74rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub .t-bad { color: #ffb4a3; }
.mp-ctrl { display: flex; align-items: center; gap: 2px; }
.mp-ctrl .icon-btn { color: #fff; width: 36px; height: 36px; }
.mp-ctrl .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mp-ctrl .mp-main { background: var(--gold); width: 42px; height: 42px; border-radius: 50%; }
body.has-player .page { padding-bottom: 110px; }

/* تنبيه عائم */
#toast-root { position: fixed; z-index: 120; top: calc(76px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .2s ease; transition: opacity .35s, transform .35s; }
.toast .ic { width: 18px; color: var(--ok); }
:root .toast.ok .ic { color: #6fd39d; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.bad .ic, .toast.warn .ic { color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-8px); }

/* ---------- شاشة الدخول ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; background: var(--green); color: #fff; display: grid; place-items: center; padding: 40px 24px; }
:root[data-theme="dark"] .login-art { background: #0f3a2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-art { background: #0f3a2b; } }
.la-pattern { position: absolute; inset: 0; opacity: .1; background-image:
  radial-gradient(circle at 50% 50%, transparent 38%, var(--gold-2) 39%, var(--gold-2) 41%, transparent 42%),
  linear-gradient(45deg, transparent 47%, var(--gold-2) 48%, var(--gold-2) 52%, transparent 53%),
  linear-gradient(-45deg, transparent 47%, var(--gold-2) 48%, var(--gold-2) 52%, transparent 53%);
  background-size: 64px 64px; }
.la-in { position: relative; display: grid; justify-items: center; gap: 22px; text-align: center; }
.la-medal { width: min(340px, 70vw); height: min(340px, 70vw); max-width: 100%; border-radius: 50%; background: #fdfbf6; display: grid; place-items: center; padding: 42px; overflow: hidden; box-shadow: 0 0 0 10px rgba(255, 255, 255, .06), 0 0 0 11px rgba(201, 151, 63, .45), 0 24px 60px rgba(0, 0, 0, .3); }
.la-medal img { max-height: 100%; max-width: 100%; object-fit: contain; filter: none !important; }
.la-sub { font-family: var(--f-display); font-size: 1.15rem; color: var(--gold-2); }
.la-date { display: grid; gap: 2px; font-size: .92rem; opacity: .92; }
.la-date b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
.la-clock { margin-top: 6px; font-size: 1.05rem; color: var(--gold-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.login-form { display: grid; place-items: center; padding-block: 40px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); background: var(--bg); }
.lf { width: min(400px, 100%); display: grid; gap: 16px; }
.lf-logo { display: none; width: 150px; justify-self: center; }
.lf h1 { font-size: 1.7rem; }
.lf-err { padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: .88rem; font-weight: 600; }
.lf .btn-lg { width: 100%; }
.lf-help { font-size: .8rem; color: var(--muted); line-height: 1.7; }
.lf-demo { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .82rem; }
.lf-demo div { display: grid; gap: 2px; }
.lf-demo code { background: rgba(255, 255, 255, .5); border: 0; color: inherit; }
.lf-partners { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 6px; }
.lf-partners img { height: 46px; width: auto; }
.lf-partners img:last-child { height: 56px; }
:root[data-theme="dark"] .lf-partners, :root[data-theme="dark"] .partners { background: #fff; border-radius: 12px; padding: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lf-partners { background: #fff; border-radius: 12px; padding: 10px; } }

/* ---------- الطباعة ---------- */
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body { background: #fff; color: #000; }
  @page { margin: 12mm; }
}
.cards-print { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8mm; }
.cred-card { border: 1.5px solid #0e4b36; border-radius: 4mm; padding: 5mm; break-inside: avoid; display: grid; gap: 2.5mm; font-size: 11pt; color: #000; }
.cc-head { display: flex; align-items: center; gap: 3mm; border-bottom: 1px solid #b27b2c; padding-bottom: 2mm; }
.cc-head img { width: 16mm; }
.cc-head div { display: grid; font-size: 9pt; line-height: 1.4; }
.cc-name { font-weight: 700; font-size: 13pt; }
.cc-row { display: flex; justify-content: space-between; }
.cc-row b { font-family: Menlo, Consolas, monospace; font-size: 12pt; }
.cc-url { font-size: 9pt; color: #0e4b36; text-align: center; }
.rep-print { color: #000; font-size: 10.5pt; }
.rep-print header { display: flex; align-items: center; gap: 6mm; border-bottom: 2px solid #0e4b36; padding-bottom: 4mm; margin-bottom: 5mm; }
.rep-print header > img { width: 26mm; }
.rep-print header h2 { color: #0e4b36; }
.rp-logos { margin-inline-start: auto; display: flex; gap: 4mm; align-items: center; }
.rp-logos img { height: 14mm; }
.rep-print table { width: 100%; border-collapse: collapse; margin-bottom: 5mm; }
.rep-print th, .rep-print td { border: 1px solid #999; padding: 2mm 3mm; text-align: start; }
.rep-print th { background: #f1ece0; }
.rep-print h3 { color: #0e4b36; margin: 4mm 0 2mm; }
.rep-print footer { display: flex; justify-content: space-between; margin-top: 12mm; }

/* ============================================================
   الشاشات المتوسطة والصغيرة
   ============================================================ */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .msg-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tpl-list { position: static; max-height: none; display: flex; overflow-x: auto; gap: 14px; }
  .tpl-cat { min-width: 200px; }
  .db-chip { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); padding-top: max(18px, env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; }
  .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-scrim.on { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .usr-n { display: none; }
  .srow { grid-template-columns: minmax(0, 1fr); }
  .att-seg { justify-self: start; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .bn-i { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font: 600 .7rem var(--f-ui); color: var(--muted); background: none; border: 0; text-decoration: none !important; cursor: pointer; }
  .bn-i .ic { width: 22px; height: 22px; }
  .bn-i.on { color: var(--green); }
  .page { padding-bottom: 96px; }
  body.has-player .page { padding-bottom: 170px; }
  .mini-player { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .lf-logo { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { gap: 6px; padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .datebar { gap: 10px; }
  .db-dates { padding-inline-start: 10px; }
  .db-g { display: none; }
  .db-h { font-size: .82rem; }
  .db-day b { font-size: 1rem; }
  .sync span { display: none; }
  .sync { padding: 0 7px; }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: 16px; gap: 14px; }
  .hero { padding: 20px 18px; }
  .hero-acts, .hero-acts .btn { width: 100%; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-v { font-size: 1.45rem; }
  .card { padding: 14px; }
  .form-grid, .cmp-fields, .perm-list { grid-template-columns: minmax(0, 1fr); }
  .seg-row, .nf-segs .seg-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seg-row select { grid-column: 1 / -1; }
  .s-info { display: none; }
  .tabs-row .search { max-width: none; }
  .filters select { flex: 1; min-width: 0; }
  .sr-acts { flex-wrap: wrap; }
  .att-seg { width: 100%; }
  .att-seg button { flex: 1; min-width: 0; padding: 0 4px; }
  .dn-t { min-width: 0; flex: 1; }
  .dn input[type=date] { display: none; }
  .mushaf-stage { grid-template-columns: minmax(0, 1fr); }
  .pg-nav { display: none; }
  .page-frame { padding: 5px; }
  .page-in { padding: 10px 12px; min-height: 420px; }
  .page-body { font-size: calc(1.3rem * var(--qs)); line-height: 2.05; }
  .mushaf-bar select { max-width: none; flex: 1; }
  .m-tools { margin-inline-start: 0; width: 100%; justify-content: space-between; }
  .modal-back { padding: 0; align-items: end; }
  .modal, .modal.lg, .modal.xl, .modal.sm { width: 100%; border-radius: 18px 18px 0 0; max-height: 94vh; max-height: 94dvh; }
  .modal-f { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .rec-eval { flex-direction: column; align-items: stretch; }
  .grade-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grade-seg button { min-width: 0; padding: 0 2px; font-size: .78rem; }
  .steppers { justify-content: space-between; }
  .cd { min-height: 52px; padding: 4px; }
  .cd i { display: none; }
  .cd .hd { font-size: .62rem; }
  /* الجداول تتحول إلى بطاقات */
  .tbl-wrap { border: 0; background: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; position: relative; }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
  .tbl td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: start; flex: none; }
  .tbl td:first-child[data-l]::before, .tbl td.cb + td[data-l]::before { display: none; }
  .tbl td:first-child, .tbl td.cb + td { text-align: start; font-size: .95rem; }
  .tbl .cb { position: absolute; inset-inline-end: 8px; top: 10px; width: auto; padding: 0; }
  .tbl .acts { width: auto; justify-content: flex-end; border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 6px; }
  .tbl tbody tr:hover td { background: none; }
  .imp-prev .tbl tr { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============================================================
   الإضافات: الاختبارات، لوحة الشرف، التسميع المنزلي، التسجيل
   ============================================================ */
.nav-sec { display: block; padding: 14px 12px 4px; font-size: .7rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chip.neg.on { background: var(--bad); border-color: var(--bad); }
.chip-in { width: 90px; height: 32px; border-radius: 99px; text-align: center; font-size: .84rem; }
.tabs.pills { border: 0; gap: 6px; }
.tabs.pills .tab { height: 34px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); margin: 0; }
.tabs.pills .tab.on { background: var(--green); border-color: var(--green); color: #fff; }
.jz.cert::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 7px; height: 7px; background: var(--gold-2); transform: rotate(45deg); }
.lgd.cert { background: var(--gold-2); transform: rotate(45deg) scale(.7); border: 0; }

/* يحتاج إجراء */
.actions-list { list-style: none; margin: 0; padding: 0; display: grid; }
.actions-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.actions-list li:last-child { border-bottom: 0; }
.actions-list li > div { flex: 1; display: grid; line-height: 1.4; min-width: 0; font-size: .88rem; }
.ax-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.ax-ic .ic { width: 19px; height: 19px; }

/* بانر الطالب */
.banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.banner > .ic { color: var(--gold); flex: none; }
.banner > div { flex: 1; display: grid; line-height: 1.5; min-width: 0; }
.banner span { font-size: .86rem; color: var(--ink-2); }

/* النقاط في الملف */
.pts-big { display: flex; align-items: baseline; gap: 8px; }
.pts-big b { font-size: 2.2rem; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.pts-big span { color: var(--muted); }
.pts-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.pts-chips span { font-size: .76rem; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2); }
.pts-chips span.neg b { color: var(--bad); }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ex-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.ex-list li:last-child { border-bottom: 0; }
.ex-list li > div { flex: 1; display: grid; line-height: 1.4; min-width: 0; font-size: .88rem; }
.ex-list .px-cert { color: var(--gold); }

/* الاختبارات */
.cand-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cand { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: center; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.cand:hover { border-color: var(--gold); }
.cand b { font-size: .88rem; }
.cand span { font-size: .76rem; color: var(--muted); grid-row: 2; }
.cand .ic { grid-row: 1 / 3; grid-column: 2; color: var(--gold); }
.ex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ex-l { font-size: .82rem; font-weight: 600; color: var(--ink-2); min-width: 80px; }
.ex-segs { display: grid; gap: 8px; }
.seg-row.sm3 { grid-template-columns: minmax(150px, 1.6fr) minmax(70px, .7fr) minmax(70px, .7fr) auto; }
.q-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.q-tools select { width: auto; }
.qs { display: grid; gap: 10px; }
.qcard { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 8px; }
.qc-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.qc-h span.t-muted { font-size: .8rem; }
.qc-score { margin-inline-start: auto; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.qc-ay { font-family: var(--f-quran); font-size: 1.35rem; line-height: 2; color: var(--page-ink); background: var(--page-bg); border-radius: 10px; padding: 6px 14px; margin: 0; }
.qc-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sard-box { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.sard-box .field.inline input { width: 110px; }
.ex-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--sel); position: sticky; bottom: -18px; }
.es-score { display: flex; align-items: baseline; gap: 6px; margin-inline-end: 6px; }
.es-score b { font-size: 1.8rem; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1; }
.es-score span { font-size: .8rem; color: var(--muted); }

/* الصور */
.img-prev { display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.img-prev img { max-height: 62vh; width: auto; max-width: 100%; box-shadow: var(--shadow-lg); border-radius: 4px; }
.img-modal .modal-f { flex-wrap: wrap; }
.img-print img { width: 100%; display: block; }
@media print { .img-print.land { page: land; } }
@page land { size: A4 landscape; margin: 0; }

/* لوحة الشرف */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 10px 0 4px; }
.pd { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.pd b { font-size: .92rem; line-height: 1.35; overflow-wrap: anywhere; }
.pd span { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pd-medal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font: 600 1.4rem var(--f-display); color: var(--green-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.pd-1 .pd-medal { width: 66px; height: 66px; background: #d9ac4a; font-size: 1.7rem; }
.pd-2 .pd-medal { background: #c9d0d4; }
.pd-3 .pd-medal { background: #cf9466; }
.pd-base { display: block; width: 100%; border-radius: 10px 10px 4px 4px; background: linear-gradient(var(--sel), transparent); margin-top: 6px; }
.pd-1 .pd-base { height: 70px; background: linear-gradient(color-mix(in srgb, var(--gold) 30%, transparent), transparent); }
.pd-2 .pd-base { height: 48px; }
.pd-3 .pd-base { height: 34px; }
.rank-tbl td.num, .rank-tbl th { text-align: center; }
.rank-tbl th:nth-child(2), .rank-tbl td:nth-child(2) { text-align: start; white-space: nowrap; }
.rk1 { background: #d9ac4a !important; color: #fff !important; } .rk2 { background: #c9d0d4 !important; color: var(--ink) !important; } .rk3 { background: #cf9466 !important; color: #fff !important; }
.rules { list-style: none; margin: 0 0 10px; padding: 0; display: grid; }
.rules li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.rules b { color: var(--green); font-variant-numeric: tabular-nums; }
.my-pts { display: grid; gap: 14px; }
.mp-big { display: grid; justify-items: center; text-align: center; }
.mp-big span { color: var(--muted); font-size: .86rem; }
.mp-big b { font-size: 3rem; line-height: 1.15; color: var(--green); font-variant-numeric: tabular-nums; }
.mp-big small { color: var(--muted); }
.mp-break { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.mp-break div { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: .8rem; }
.mp-break b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.top li.me { background: var(--gold-soft); border-radius: 8px; padding-inline: 8px; }
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; display: grid; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.pick:hover { background: var(--surface-2); }
.pick small { margin-inline-start: auto; color: var(--muted); font-size: .74rem; }
.feed li .icon-btn { width: 30px; height: 30px; }

/* التسميع المنزلي */
.hr-card { display: grid; gap: 14px; }
.hr-opts { display: grid; gap: 8px; }
.hr-opt { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; }
.hr-opt.on { border-color: var(--green); background: var(--sel); }
.hr-opt b { font-size: .9rem; min-width: 0; }
.hr-other { display: grid; gap: 10px; }
.hr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hr-list li { padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; gap: 6px; }
.hl-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hl-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hl-fb p { flex-basis: 100%; margin: 0; font-size: .88rem; padding: 8px 10px; border-radius: 8px; background: var(--surface); border-inline-start: 3px solid var(--gold); }
.hl-audio audio, .rv-audio audio, .rc-play audio { width: 100%; }
.rc { display: grid; justify-items: center; gap: 12px; text-align: center; }
.rc-t { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.rc-meter { width: 100%; height: 70px; color: var(--green); }
.rc-time { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.rc-btn { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 8px var(--sel); transition: transform .1s; }
.rc-btn .ic { width: 34px; height: 34px; }
.rc-btn.on { background: var(--bad); box-shadow: 0 0 0 8px var(--bad-bg); animation: pulseRec 1.4s ease-in-out infinite; }
@keyframes pulseRec { 50% { box-shadow: 0 0 0 14px var(--bad-bg); } }
.rc-msg { font-size: .86rem; max-width: 36ch; }
.rc-play { width: 100%; }
.rc-list { display: grid; gap: 8px; }
.rc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ri-main { flex: 1; display: grid; gap: 3px; min-width: 200px; font-size: .9rem; }
.ri-side { display: flex; align-items: center; gap: 8px; }
.rv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rv-ref { justify-self: start; }

/* التسجيل */
.lf-reg { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; border: 1.5px dashed var(--gold); color: var(--gold); font-weight: 600; text-decoration: none !important; }
.lf-reg:hover { background: var(--gold-soft); }
.reg { min-height: 100vh; background: var(--bg); }
.reg-h { background: var(--green); color: #fff; text-align: center; padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; justify-items: center; gap: 6px; }
.reg-logo { width: 150px; height: 150px; border-radius: 50%; background: #fdfbf6; display: grid; place-items: center; padding: 18px; box-shadow: 0 0 0 6px rgba(201, 151, 63, .35); }
.reg-logo img { max-height: 100%; max-width: 100%; }
.reg-h h1 { color: #fff; margin-top: 8px; }
.reg-h p { color: var(--gold-2); }
.reg-main { max-width: 760px; margin: -40px auto 0; padding-bottom: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; }
.reg-form { display: grid; gap: 16px; padding: 22px; }
.reg-form h3 { color: var(--green); padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.reg-form .btn-lg { width: 100%; }
.hp { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.reg-form { position: relative; }
.reg-done, .reg-closed { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 34px 20px; }
.reg-done > .ic, .reg-closed > .ic { width: 56px; height: 56px; padding: 13px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.reg-closed > .ic { background: var(--warn-bg); color: var(--warn); }
.reg-done p { max-width: 52ch; line-height: 1.9; }
.reg-back { text-align: center; }
.reg-share { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.rs-qr img { width: 132px; height: 132px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; display: block; }
.rs-t { flex: 1; min-width: 240px; display: grid; gap: 10px; }
.rs-t .card-h { margin: 0; }
.rs-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); overflow-wrap: anywhere; }
.ap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ap { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-content: start; }
.ap-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ap-h b { font-size: 1rem; }
.ap-d { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .84rem; }
.ap-d dt { color: var(--muted); }
.ap-d dd { margin: 0; overflow-wrap: anywhere; }
.ap-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.ap-a select { flex: 1; min-width: 0; max-width: 260px; }

@media (max-width: 640px) {
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-row.sm3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .seg-row.sm3 select { grid-column: 1 / -1; }
  .podium { gap: 4px; }
  .pd b { font-size: .8rem; }
  .ap-list { grid-template-columns: minmax(0, 1fr); }
  .reg-form { padding: 16px; }
  .rs-qr { margin-inline: auto; }
}

/* الدخول إلى حساب مستخدم */
.imp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px max(18px, env(safe-area-inset-right, 0px)) 9px max(18px, env(safe-area-inset-left, 0px)); background: var(--gold-soft); border-bottom: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--ink); font-size: .88rem; }
.imp-bar > .ic { color: var(--gold); }
.imp-bar span { flex: 1; min-width: 180px; }
.icon-btn.inv { color: var(--wa); }
.icon-btn.inv.done { color: var(--ok); opacity: .7; }
.icon-btn.imp { color: var(--gold); }
/* تواريخ الحدث */
.ev-dates { gap: 10px; }
.ev-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-row .field { flex: 1; min-width: 150px; }
.day-pick .chip { height: auto; min-height: 34px; padding: 4px 12px; }
.day-pick .chip b { font-weight: 700; }
.ev-sum { font-size: .82rem; color: var(--green); line-height: 1.7; }
