:root {
  --bg: #eef0f3; --surface: #ffffff; --surface-2: #f6f7f9;
  --text: #23262d; --muted: #6b7180; --border: #dfe2e8;
  --brand: #c49a6c; --brand-dark: #a87d52; --brand-soft: #f5ece2;
  --slate: #4b4f5a; --slate-dark: #3c4049; --slate-soft: #e7e8ec;
  --ok: #2f8f5b; --ok-soft: #e3f3ea; --bad: #c2453d; --bad-soft: #fbe7e5;
  --warn: #b7791f; --warn-soft: #fdf1dc; --info: #3b6fb6; --info-soft: #e5eefa;
  --radius: 14px; --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px -12px rgb(0 0 0 / .2);
  color-scheme: light;
}
:root.dark {
  --bg: #1b1d22; --surface: #24272e; --surface-2: #2b2e36;
  --text: #eceef2; --muted: #a2a8b5; --border: #393d47;
  --brand-soft: #3a2f24; --slate-soft: #30333b;
  --ok-soft: #1f3a2b; --bad-soft: #42221f; --warn-soft: #3d3020; --info-soft: #1f2d42;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { font-size: 17.5px; } /* تكبير عام لكل عناصر النظام (كان ١٦) */
body { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.65; }
@media (max-width: 600px) { html { font-size: 16.5px; } body { font-size: 16px; } }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- أزرار وحقول ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 10px; padding: .55rem 1.05rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-slate { background: var(--slate); color: #fff; }
.btn-slate:hover { background: var(--slate-dark); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg, .btn svg { width: 1.15rem; height: 1.15rem; }
.field { display: grid; gap: .3rem; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.input { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: .55rem .75rem; min-height: 2.6rem; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; border-color: var(--brand); }
textarea.input { min-height: 5rem; resize: vertical; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: .55rem .8rem; margin: 0 1.25rem; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .5rem; }

/* ---------- الدخول ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%), var(--slate); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 2rem; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .6); }
.auth-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: block; margin: 0 auto 1rem; border: 1px solid var(--border); object-fit: contain; }
.auth-card h1 { font-size: 1.35rem; text-align: center; margin: 0; }
.auth-card p.sub { text-align: center; color: var(--muted); margin: .25rem 0 1.5rem; font-size: .9rem; }
.auth-card form { display: grid; gap: 1rem; }
.auth-card .btn { width: 100%; padding: .7rem; }
.auth-foot { text-align: center; margin-top: 1.25rem; font-size: .85rem; }

/* ---------- الهيكل ---------- */
.layout { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1000px) { .layout { grid-template-columns: 260px 1fr; } }
.sidebar { background: var(--surface); border-inline-start: 1px solid var(--border); padding: 1rem; position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 40; transform: translateX(100%); transition: transform .25s; overflow-y: auto; }
.sidebar.open { transform: none; box-shadow: -20px 0 40px -20px rgb(0 0 0 / .4); }
@media (min-width: 1000px) { .sidebar { position: sticky; top: 0; height: 100vh; transform: none; width: auto; box-shadow: none; } .menu-btn { display: none !important; } }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 39; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: 14px; background: var(--slate); color: #fff; text-decoration: none; }
.side-brand img { width: 42px; height: 42px; border-radius: 10px; background: #fff; object-fit: contain; }
.side-brand b { display: block; font-size: 1rem; line-height: 1.3; }
.side-brand small { color: color-mix(in srgb, var(--brand) 80%, #fff); font-size: .72rem; letter-spacing: .04em; }
.side-user { text-align: center; padding: 1.25rem 0 .75rem; }
.avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto .5rem; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 1.5rem; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--brand); }
.side-user b { display: block; }
.side-user small { color: var(--muted); }
.nav { display: grid; gap: .15rem; }
.nav-title { font-size: .8rem; font-weight: 700; color: var(--brand-dark); margin: 1rem .6rem .35rem; }
:root.dark .nav-title { color: var(--brand); }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 10px; text-decoration: none; color: var(--text); font-size: .93rem; }
.nav a svg { width: 1.1rem; height: 1.1rem; color: var(--muted); flex: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--slate); color: #fff; }
.nav a.active svg { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .6rem; padding: .75rem 1.25rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.15rem; margin: 0; flex: 1; }
.content { padding: 1.25rem; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- لوحة القيادة ---------- */
.summary { background: var(--slate); color: #fff; border-radius: 18px; padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; position: relative; overflow: hidden; }
.summary::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 28px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.summary h2 { margin: 0 0 .9rem; font-size: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; position: relative; z-index: 1; }
.summary h2 small { font-weight: 400; opacity: .75; }
.chips { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); position: relative; z-index: 1; }
@media (min-width: 700px) { .chips { grid-template-columns: repeat(4, 1fr); } }
.chip { background: rgb(255 255 255 / .09); border: 1px solid rgb(255 255 255 / .12); border-radius: 12px; padding: .65rem .85rem; }
.chip b { display: block; font-size: 1.45rem; line-height: 1.2; }
.chip span { font-size: .8rem; opacity: .8; }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1150px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: .6rem; min-height: 96px; padding: 1rem 1.1rem; border-radius: 16px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem; box-shadow: 0 10px 24px -16px rgb(0 0 0 / .55); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgb(0 0 0 / .6); }
.tile.brand { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.tile.slate { background: linear-gradient(135deg, #5a5f6b, var(--slate-dark)); }
.tile svg.ic { width: 1.6rem; height: 1.6rem; flex: none; }
.tile svg.bg { position: absolute; inset-inline-end: -14px; bottom: -18px; width: 92px; height: 92px; opacity: .18; }
.tile.soon { filter: grayscale(.35); opacity: .7; cursor: default; }
.tile.soon:hover { transform: none; }
.tile .soon-tag { position: absolute; top: .55rem; inset-inline-end: .65rem; font-size: .68rem; background: rgb(255 255 255 / .22); padding: .05rem .5rem; border-radius: 99px; font-weight: 600; }
.section-title { font-size: 1rem; margin: 1.75rem 0 .75rem; }

/* ---------- بطاقات وجداول ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.1rem 1.25rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar .input { min-height: 2.45rem; width: auto; }
.toolbar .grow .input { width: 100%; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: .7rem .85rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.wrap { white-space: normal; min-width: 160px; }
tr.inactive td { opacity: .55; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.pill { display: inline-block; padding: .08rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--slate-soft); color: var(--text); }
.pill.brand { background: var(--brand-soft); color: var(--brand-dark); }
:root.dark .pill.brand { color: var(--brand); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.link { color: var(--brand-dark); font-weight: 600; text-decoration: none; }
:root.dark .link { color: var(--brand); }
.link:hover { text-decoration: underline; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; }

.grid-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.h-card { padding: 1.1rem 1.2rem; display: grid; gap: .5rem; }
.h-card h3 { margin: 0; font-size: 1.05rem; }
.h-card .meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; }
.h-card .row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .35rem; }

.stats-row { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1rem; }
@media (min-width: 800px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: .82rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.profile-head .avatar { margin: 0; }
.profile-head h2 { margin: 0; font-size: 1.3rem; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem 1.25rem; font-size: .92rem; }
.kv div span { display: block; color: var(--muted); font-size: .78rem; }

/* الحضور */
.att-list { display: grid; gap: .5rem; }
.att-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; flex-wrap: wrap; }
.att-row .name { flex: 1; min-width: 140px; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: .4rem .75rem; cursor: pointer; font-size: .85rem; border-inline-start: 1px solid var(--border); }
.seg button:first-child { border-inline-start: 0; }
.seg button[aria-pressed="true"].present { background: var(--ok); color: #fff; }
.seg button[aria-pressed="true"].absent { background: var(--bad); color: #fff; }
.seg button[aria-pressed="true"].late { background: var(--warn); color: #fff; }
.seg button[aria-pressed="true"].excused { background: var(--info); color: #fff; }

/* صفحة إدارة الطلاب */
.crumbs { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.1rem; margin-bottom: 1rem; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-size: .92rem; }
.crumbs a { color: #fff; opacity: .85; text-decoration: none; }
.crumbs a:hover { opacity: 1; text-decoration: underline; }
.filters-card { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 700px) { .filters-card { grid-template-columns: 2fr 1fr 1fr; } }
.action-bar { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.action-bar .grp { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.action-bar .input { width: auto; min-height: 2.45rem; }
.btn-brand-soft { background: var(--brand); color: #fff; }
.btn-brand-soft:hover { background: var(--brand-dark); }
.sel-count { font-size: .85rem; font-weight: 600; }
.dd { position: relative; }
.dd summary { list-style: none; }
.dd summary::-webkit-details-marker { display: none; }
.dd-menu { position: absolute; top: calc(100% + .35rem); inset-inline-end: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: .6rem .75rem; display: grid; gap: .35rem; min-width: 200px; max-height: 60vh; overflow: auto; }
.dd-menu .check { white-space: nowrap; font-size: .9rem; cursor: pointer; }
.data-table thead th { background: var(--slate); color: #fff; font-size: .82rem; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th .sort-ind { opacity: .6; font-size: .7rem; }
.data-table th.cb, .data-table td.cb { width: 2.4rem; text-align: center; }
.data-table tbody tr.selected { background: var(--brand-soft); }
.data-table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem .25rem; font-size: .88rem; }
.pager .grp { display: flex; gap: .5rem; align-items: center; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .print-title { margin-bottom: .75rem; } .print-title b { display: block; font-size: 1.1rem; } .print-title span { color: #555; font-size: .85rem; }
  .crumbs { display: none; }
  .data-table thead th { background: #eee !important; color: #000 !important; }
  .data-table td, .data-table th { padding: .35rem .5rem; font-size: .78rem; white-space: normal; }
}

/* حقل اختيار متعدد */
.checks-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks-field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.checks-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .35rem .75rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; max-height: 180px; overflow: auto; margin-top: .3rem; }
.checks-list .check { font-size: .9rem; }
.checks-list input { accent-color: var(--brand); }

/* صور الهوية */
.id-files { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.id-file { padding: 1rem; display: grid; gap: .65rem; }
.id-file-head { display: flex; justify-content: space-between; align-items: baseline; }
.id-file-preview { aspect-ratio: 85.6 / 54; border-radius: 10px; border: 1px dashed var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.id-file-preview a { display: block; width: 100%; height: 100%; }
.id-file-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.id-file .row { display: flex; gap: .4rem; flex-wrap: wrap; }
.pdf-badge { display: grid; place-items: center; height: 100%; font-weight: 700; color: var(--bad); }
label.btn { cursor: pointer; }
label.btn.loading { opacity: .6; pointer-events: none; }

/* شارة الإشعارات على البطاقة */
.tile-badge { position: absolute; top: .55rem; inset-inline-end: .65rem; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 99px; background: #c2453d; color: #fff; font-size: .8rem; display: grid; place-items: center; box-shadow: 0 0 0 3px rgb(255 255 255 / .35); }

/* الإشعارات */
.notes { display: grid; gap: .55rem; }
.note { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--slate); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.note:hover { background: var(--surface-2); }
.note > svg { width: 1.4rem; height: 1.4rem; flex: none; color: var(--muted); }
.note b { display: block; font-size: .95rem; }
.note small { color: var(--muted); }
.note.bad { border-inline-start-color: var(--bad); } .note.bad > svg { color: var(--bad); }
.note.warn { border-inline-start-color: var(--warn); } .note.warn > svg { color: var(--warn); }
.note.info { border-inline-start-color: var(--info); } .note.info > svg { color: var(--info); }
.note.ok { border-inline-start-color: var(--ok); } .note.ok > svg { color: var(--ok); }

/* المكتبة */
.lib-card { position: relative; }
.lib-icon { width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); }
.lib-icon svg { width: 1.3rem; height: 1.3rem; }
code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; font-size: .88rem; word-break: break-all; }

/* الخطط */
.progress-block { display: grid; gap: .3rem; margin-top: .35rem; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; }
.progress { height: .55rem; border-radius: 99px; background: var(--slate-soft); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .4s; }
.progress span.ok { background: var(--ok); }
.progress span.warn { background: var(--warn); }
.progress span.bad { background: var(--bad); }
.inactive-card { opacity: .65; }

/* السجل الذهبي */
.gold-banner { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: 18px; color: #3a2a17; background: linear-gradient(135deg, #f3dfb8, #d9b27c 55%, #c49a6c); box-shadow: 0 14px 30px -18px rgb(120 80 30 / .6); }
.gold-banner svg { width: 2.4rem; height: 2.4rem; fill: #fff6e3; stroke: #8a6235; }
.gold-banner b { display: block; font-size: 1.1rem; }
.gold-banner span { font-size: .85rem; opacity: .8; }
.awards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.award { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 14px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.award > svg { width: 1.6rem; height: 1.6rem; flex: none; color: var(--brand-dark); fill: color-mix(in srgb, var(--brand) 35%, transparent); }
.award b { display: block; font-size: .95rem; }
.award small { color: var(--muted); }
.rank-title { display: flex; align-items: center; gap: .5rem; }
.rank-title svg { width: 1.2rem; height: 1.2rem; color: var(--brand-dark); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.rank li { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 10px; }
.rank li:nth-child(odd) { background: var(--surface-2); }
.rank .pos { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--slate-soft); flex: none; }
.rank li.top1 .pos { background: #e3b04b; color: #fff; }
.rank li.top2 .pos { background: #a9b0bb; color: #fff; }
.rank li.top3 .pos { background: #c08457; color: #fff; }
.rank .who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.rank .who small { color: var(--muted); font-size: .76rem; }
.rank b { font-size: .9rem; white-space: nowrap; }

/* بطاقات الطلاب */
.id-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.id-card { width: 100%; max-width: 380px; aspect-ratio: 85.6 / 54; border-radius: 14px; overflow: hidden; background: #fff; color: #23262d; border: 1px solid #d9dce3; display: flex; flex-direction: column; box-shadow: var(--shadow); break-inside: avoid; }
.id-top { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: #4b4f5a; color: #fff; }
.id-top img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; }
.id-top b { display: block; font-size: .85rem; line-height: 1.2; }
.id-top small { color: #d9b892; font-size: .62rem; letter-spacing: .06em; }
.id-top > span { margin-inline-start: auto; font-size: .7rem; background: #c49a6c; padding: .1rem .55rem; border-radius: 99px; }
.id-body { flex: 1; display: flex; align-items: center; gap: .8rem; padding: .5rem .85rem; }
.id-avatar { width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; background: #f5ece2; color: #a87d52; font-size: 1.6rem; font-weight: 700; border: 2px solid #c49a6c; flex: none; }
.id-info { display: grid; gap: .05rem; font-size: .74rem; color: #555b66; }
.id-info b { font-size: 1rem; color: #23262d; margin-bottom: .1rem; }
.id-foot { display: flex; justify-content: space-between; align-items: center; padding: .35rem .85rem; border-top: 2px solid #c49a6c; font-size: .7rem; color: #6b7180; background: #faf6f1; }
.id-foot b { color: #23262d; letter-spacing: .08em; }

/* نافذة */
.modal { border: 0; padding: 0; border-radius: 18px; width: min(640px, calc(100vw - 1.5rem)); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .5); }
.modal::backdrop { background: rgb(20 22 28 / .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 1.25rem; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

.toast { position: fixed; bottom: 1.25rem; inset-inline-start: 50%; transform: translate(50%, 150%); background: var(--slate-dark); color: #fff; padding: .7rem 1.2rem; border-radius: 12px; opacity: 0; transition: .25s; z-index: 100; max-width: calc(100vw - 2rem); }
.toast.show { transform: translate(50%, 0); opacity: 1; }
.toast.error { background: var(--bad); }

@media print {
  .sidebar, .topbar, .toolbar, .no-print, .scrim { display: none !important; }
  .layout { display: block; } .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
  th { position: static; }
  .id-grid { grid-template-columns: repeat(2, 85.6mm); gap: 6mm; justify-content: center; }
  .id-card { width: 85.6mm; height: 54mm; max-width: none; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .gold-banner, .award, .rank .pos { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid-cards { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== المحفّظ الذاتي ===== */
.tile.wide { grid-column: 1 / -1; min-height: 88px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.tile.wide small { display: block; font-weight: 500; font-size: .82rem; opacity: .85; margin-top: .1rem; }
.hifz-hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; border-inline-start: 4px solid var(--brand); }
.juz-mini { display: grid; grid-template-columns: repeat(15, 7px); gap: 2px; direction: rtl; }
.juz-mini i { display: block; height: 9px; border-radius: 2px; background: linear-gradient(to top, var(--brand) var(--p), var(--slate-soft) var(--p)); }
.juz-mini.lg { grid-template-columns: repeat(30, 1fr); gap: 3px; max-width: 640px; }
.juz-mini.lg i { height: 22px; border-radius: 4px; }
.code-chip { font-size: 1.05rem; letter-spacing: .1em; background: var(--brand-soft); color: var(--brand-dark); padding: .15rem .55rem; border-radius: 8px; }

/* ===== مركز التقارير ===== */
.report-tiles { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .report-tiles { grid-template-columns: repeat(2, 1fr); } }
.report-tile { position: relative; overflow: hidden; display: flex; align-items: center; gap: .85rem; min-height: 96px; padding: 1.1rem 1.3rem; border-radius: 16px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #1f6f80, #155563); box-shadow: 0 10px 24px -16px rgb(0 0 0 / .55); transition: transform .15s, box-shadow .15s; }
.report-tile:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgb(0 0 0 / .6); }
.report-tile svg.ic { width: 1.7rem; height: 1.7rem; flex: none; }
.report-tile svg.bg { position: absolute; inset-inline-end: -10px; bottom: -16px; width: 90px; height: 90px; opacity: .14; }
.report-tile b { display: block; font-size: 1.08rem; }
.report-tile small { display: block; opacity: .85; font-size: .82rem; margin-top: .15rem; line-height: 1.5; }
.report-head { display: flex; gap: .75rem; align-items: center; border-bottom: 1px solid var(--border); }
.report-head img { width: 44px; height: 44px; object-fit: contain; }
.report-sub { margin: 1rem 1.1rem .4rem; font-size: 1rem; }
.report-kpis { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.report-kpis div { background: var(--surface-2); border-radius: 12px; padding: .6rem .8rem; }
.report-kpis b { display: block; font-size: 1.3rem; line-height: 1.3; }
.report-kpis span { font-size: .8rem; color: var(--muted); }
.total-row td { font-weight: 700; background: var(--surface-2); }
.month-grid td.day, .month-grid th { text-align: center; }
.month-grid td.day { padding: .3rem .2rem; min-width: 1.9rem; }
.att-dot { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 6px; font-size: .78rem; font-weight: 700; }
.att-dot.ok { background: var(--ok-soft); color: var(--ok); } .att-dot.bad { background: var(--bad-soft); color: var(--bad); }
.att-dot.warn { background: var(--warn-soft); color: var(--warn); } .att-dot.info { background: var(--info-soft); color: var(--info); }
@media print {
  .report-out { border: 0; }
  .report-kpis div, .att-dot, .total-row td, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-out td, .report-out th { font-size: .75rem; padding: .3rem .4rem; }
}

/* ===== الخطة السنوية ===== */

.ap-hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; border-inline-start: 4px solid var(--brand); }
.ap-hero img { width: 56px; height: 56px; object-fit: contain; }
.ap-hero h2 { margin: 0 0 .4rem; font-size: 1.25rem; }
.ap-stats { display: flex; gap: .5rem; flex-wrap: wrap; }
.ap-stats span { background: var(--surface-2); border-radius: 99px; padding: .2rem .75rem; font-size: .85rem; }
.ap-stats span.now { background: var(--brand-soft); color: var(--brand-dark); }
.ap-filters { flex-wrap: wrap; gap: .6rem; }
.tabs-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.tabs-pills button { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: .35rem .9rem; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; color: inherit; }
.tabs-pills button[aria-selected="true"] { background: var(--slate); border-color: var(--slate); color: #fff; }
.ap-axis { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 1.25rem; overflow: hidden; box-shadow: var(--shadow); }
.ap-axis > header { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.2rem; background: var(--c); color: #fff; }
.ap-axis > header h3 { margin: 0; font-size: 1.15rem; }
.ap-axis > header p { margin: .25rem 0 0; font-size: .9rem; opacity: .92; }
.ap-num { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: rgb(255 255 255 / .2); display: grid; place-items: center; font-weight: 700; }
.ap-op { padding: 1rem 1.2rem; border-top: 1px solid var(--border); }
.ap-op:first-of-type { border-top: 0; }
.ap-op h4 { margin: 0 0 .5rem; font-size: 1.02rem; padding-inline-start: .65rem; border-inline-start: 3px solid var(--c); }
.ap-ind { font-size: .9rem; margin-bottom: .6rem; }
.ap-ind ul { margin: .2rem 0 0; padding-inline-start: 1.2rem; }
.ap-quarters { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .75rem; }
@media (min-width: 900px) { .ap-quarters { grid-template-columns: repeat(4, 1fr); } }
.ap-q { background: var(--surface-2); border-radius: 10px; padding: .5rem .7rem; font-size: .88rem; }
.ap-q span { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .15rem; }
.ap-q.empty { color: var(--muted); }
.ap-q.all { grid-column: 1 / -1; }
.ap-gantt th, .ap-gantt td { text-align: center; padding: .4rem .25rem; }
.ap-gantt .ap-mean { text-align: start; min-width: 240px; white-space: normal; }
.ap-gantt td.m { width: 2rem; min-width: 1.8rem; }
.ap-gantt td.m.on { background: color-mix(in srgb, var(--c) 70%, transparent); background-clip: padding-box; border: 2px solid var(--surface); border-radius: 6px; }
.ap-gantt th.now { background: var(--brand-soft); color: var(--brand-dark); }
.ap-gantt td.now:not(.on) { background: color-mix(in srgb, var(--brand) 8%, transparent); }
@media print {
  .ap-axis { break-inside: auto; box-shadow: none; }
  .ap-op { break-inside: avoid; }
  .ap-axis > header, .ap-gantt td.m.on, .ap-q { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* متابعة تنفيذ الخطة */
.ap-progress { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.ap-pct b { display: block; font-size: 2rem; line-height: 1.1; color: var(--ok); }
.ap-pct span { font-size: .8rem; color: var(--muted); }
.ap-bar { display: flex; height: 12px; border-radius: 99px; background: var(--slate-soft); overflow: hidden; }
.ap-bar i { display: block; height: 100%; }
.ap-bar i.done { background: var(--ok); } .ap-bar i.doing { background: var(--info); }
.ap-legend { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; margin-top: .45rem; font-size: .85rem; }
.ap-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; background: var(--slate-soft); margin-inline-end: .3rem; vertical-align: middle; }
.ap-legend i.done { background: var(--ok); } .ap-legend i.doing { background: var(--info); } .ap-legend i.paused { background: var(--warn); }
.ap-late { border: 0; background: var(--bad-soft); color: var(--bad); font: inherit; font-weight: 700; font-size: .85rem; border-radius: 99px; padding: .2rem .75rem; cursor: pointer; }
.ap-ax-pct { flex: none; width: 130px; text-align: center; }
.ap-ax-pct b { display: block; font-size: 1.35rem; line-height: 1.2; }
.ap-ax-pct span { display: block; font-size: .75rem; opacity: .9; margin-bottom: .3rem; }
.ap-ax-pct .ap-bar { background: rgb(255 255 255 / .25); height: 8px; }
.ap-ax-pct .ap-bar i.done { background: #fff; } .ap-ax-pct .ap-bar i.doing { background: rgb(255 255 255 / .55); }
.ap-op-head { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.ap-op-pct { flex: none; font-size: .8rem; font-weight: 700; background: var(--surface-2); border-radius: 99px; padding: .15rem .6rem; }
.ap-st-col { min-width: 168px; }
.ap-st-cell { display: flex; gap: .3rem; align-items: center; }
.ap-st-cell .icon-btn { width: 2rem; height: 2rem; flex: none; }
select.ap-st { min-height: 2.1rem; padding: .2rem .5rem; font-size: .85rem; font-weight: 600; }
select.ap-st.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
select.ap-st.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
select.ap-st.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ap-gantt tr.is-done .ap-mean { color: var(--muted); }
.ap-note { margin-top: .3rem; font-size: .82rem; background: var(--surface-2); border-radius: 8px; padding: .25rem .5rem; display: flex; gap: .35rem; align-items: flex-start; }
.ap-note svg { width: .85rem; height: .85rem; flex: none; margin-top: .2rem; }
.ap-upd { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
@media print { .ap-st-cell .icon-btn { display: none; } select.ap-st { appearance: none; border: 0; background: none !important; } .ap-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ===== الرسوم ===== */

.fee-bar { flex-wrap: wrap; gap: .5rem; }
.fee-bar .input { width: auto; min-width: 0; }
.fee-bar #fe-q { min-width: 200px; }
.fee-month { display: inline-flex; gap: .25rem; align-items: center; }
.fee-month .icon-btn { width: 2.3rem; height: 2.3rem; font-size: 1.3rem; font-weight: 700; }
.fee-year { width: 6.5rem !important; }
.fee-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: .75rem; }
@media (min-width: 900px) { .fee-kpis { grid-template-columns: repeat(4, 1fr); } }
.fee-kpis .card { padding: .85rem 1rem; }
.fee-kpis span { display: block; font-size: .82rem; color: var(--muted); }
.fee-kpis b { display: block; font-size: 1.45rem; line-height: 1.35; }
.fee-kpis .ok b { color: var(--ok); } .fee-kpis .bad b { color: var(--bad); }
.fee-kpis .ap-bar { margin-top: .35rem; height: 8px; }
.fee-counts { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.fee-counts button { border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; font-size: .88rem; border-radius: 99px; padding: .25rem .75rem .25rem .4rem; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.fee-counts button:hover { border-color: var(--brand); }
.fee-hint { display: flex; gap: .5rem; align-items: center; background: var(--warn-soft); color: var(--text); border-radius: 12px; padding: .55rem .85rem; margin-bottom: .75rem; font-size: .88rem; }
.fee-hint svg { width: 1.1rem; height: 1.1rem; color: var(--warn); flex: none; }
.fee-table tr.fee-unpaid td:first-child { box-shadow: inset -4px 0 0 var(--bad); }
.fee-table tr.fee-partial td:first-child { box-shadow: inset -4px 0 0 var(--warn); }
.fee-table tr.fee-paid td:first-child { box-shadow: inset -4px 0 0 var(--ok); }
.txt-bad { color: var(--bad); }
.fee-year th, .fee-year td.fy { text-align: center; padding: .4rem .3rem; min-width: 2.6rem; }
.fee-year th.now { background: var(--brand-soft); color: var(--brand-dark); }
.fee-year td.fy.ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.fee-year td.fy.warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .82rem; }
.fee-year td.fy.bad { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.fee-year td.fy.free { color: var(--info); font-size: .78rem; }
.print-only-flex { display: none !important; }
@media print {
  .print-only-flex { display: flex !important; }
  .fee-kpis { grid-template-columns: repeat(4, 1fr); }
  .fee-kpis .card, .fee-year td.fy, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* رسوم الذكور والإناث وتقارير الحلقات */
.fee-halves { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .9rem; align-items: stretch; }
@media (min-width: 760px) { .fee-halves { grid-template-columns: 1fr 1fr; } }
.fee-half-card { text-align: start; font: inherit; color: inherit; cursor: pointer; padding: 1rem 1.1rem; display: grid; gap: .35rem; border: 1px solid var(--border); border-top: 5px solid var(--brand); transition: transform .15s, box-shadow .15s; }
.fee-half-card:hover { transform: translateY(-2px); }
.fee-half-card[aria-pressed="true"] { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.fee-half-card.fee-half-f { border-top-color: var(--brand-dark); }
.fee-half-card.fee-half-u { border-top-color: var(--muted); }
.fee-half-card > b { font-size: 1.15rem; }
.fee-half-card > span { font-size: .85rem; color: var(--muted); }
.fh-nums { display: flex; gap: 1.5rem; color: var(--text) !important; font-size: 1.05rem !important; font-weight: 700; }
.fh-nums small { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; }
.fh-nums em { font-style: normal; color: var(--bad); }
.fee-show-all { justify-self: start; }
.fee-half { margin-bottom: 1.25rem; }
.fee-half-head { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .75rem 1rem; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; margin-bottom: .75rem; }
.fee-half-head h2 { margin: 0; font-size: 1.2rem; }
.fee-half-head .fs small { color: rgb(255 255 255 / .8); }
.fee-half-head .fs.ok b, .fee-half-head .fs.bad b { color: #fff; }
.fee-half-head .ap-bar { background: rgb(255 255 255 / .3); }
.fee-half-head .ap-bar i.done { background: #fff; }
.fee-stats { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.fee-stats .fs { display: grid; line-height: 1.3; }
.fee-stats .fs small { font-size: .72rem; color: var(--muted); }
.fee-stats .fs b { font-size: .98rem; }
.fee-stats .fs.ok b { color: var(--ok); } .fee-stats .fs.bad b { color: var(--bad); }
.fee-stats .ap-bar { width: 80px; height: 6px; margin-top: .2rem; }
.fee-hq { margin-bottom: .85rem; overflow: hidden; }
.fee-hq > summary { list-style: none; cursor: pointer; display: flex; gap: .75rem 1.25rem; align-items: center; flex-wrap: wrap; padding: .85rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.fee-hq > summary::-webkit-details-marker { display: none; }
.fee-hq:not([open]) > summary { border-bottom: 0; }
.fee-hq-title { display: flex; gap: .5rem; align-items: center; min-width: 200px; flex: 1; }
.fee-hq-title svg { width: 1.2rem; height: 1.2rem; color: var(--brand); flex: none; transition: transform .2s; }
.fee-hq-title b { font-size: 1.05rem; }
.fee-hq-title .muted { font-size: .82rem; }
.fee-hq-actions { display: flex; gap: .35rem; }
.fee-print-head { padding: .75rem 1rem; }
@media print {
  .fee-hq > summary { background: none; }
  .fee-half-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-one .fee-print-all, body.print-one .fee-kpis, body.print-one .fee-half-head,
  body.print-one .fee-hq:not(.print-target), body.print-one .fee-half:not(:has(.print-target)) { display: none !important; }
  body.print-one .fee-hq.print-target { border: 0; box-shadow: none; }
  body:not(.print-one) .fee-print-head { display: none !important; }
}

/* شريط الأشهر في الرسوم */
.fee-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.fee-mo { font: inherit; color: inherit; text-align: start; cursor: pointer; display: grid; gap: .15rem; padding: .55rem .7rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); border-top: 4px solid var(--border); transition: transform .12s; }
.fee-mo:hover { transform: translateY(-2px); }
.fee-mo b { font-size: .98rem; }
.fee-mo small { font-size: .72rem; color: var(--muted); }
.fee-mo .fm-pct { font-size: 1.15rem; font-weight: 700; }
.fee-mo .fm-bar { height: 6px; border-radius: 99px; background: var(--slate-soft); overflow: hidden; }
.fee-mo .fm-bar i { display: block; height: 100%; background: var(--muted); }
.fee-mo .fm-amt { font-size: .72rem; color: var(--muted); direction: ltr; text-align: end; }
.fee-mo.ok { border-top-color: var(--ok); } .fee-mo.ok .fm-pct { color: var(--ok); } .fee-mo.ok .fm-bar i { background: var(--ok); }
.fee-mo.warn { border-top-color: var(--warn); } .fee-mo.warn .fm-pct { color: var(--warn); } .fee-mo.warn .fm-bar i { background: var(--warn); }
.fee-mo.bad { border-top-color: var(--bad); } .fee-mo.bad .fm-pct { color: var(--bad); }
.fee-mo.none .fm-pct { color: var(--muted); }
.fee-mo.cur b::after { content: " ●"; color: var(--brand); font-size: .7rem; }
.fee-mo.on { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.fee-month-title { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: 0 0 .65rem; }
.fee-month-title svg { width: 1.2rem; height: 1.2rem; color: var(--brand); }
@media (max-width: 640px) { .fee-strip { display: flex; overflow-x: auto; padding-bottom: .3rem; } .fee-mo { flex: none; width: 112px; } }

/* ===== الإدخال السريع للدفعات ===== */
.fee-entry-cta { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.2rem; margin-bottom: 1rem; border-radius: 16px; color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 10px 24px -16px rgb(0 0 0 / .55); transition: transform .15s; }
.fee-entry-cta:hover { transform: translateY(-2px); }
.fee-entry-cta b { display: block; font-size: 1.15rem; }
.fee-entry-cta small { opacity: .9; }
.fe-cta-ic { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 12px; background: rgb(255 255 255 / .22); flex: none; }
.fe-cta-ic svg { width: 1.5rem; height: 1.5rem; }
.fe-entry-top { display: grid; gap: .65rem; margin-bottom: 1rem; }
.fe-step { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fe-num { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem; }
.fe-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.fe-row .input { width: auto; }
.fe-group { margin-bottom: .85rem; overflow: hidden; }
.fe-group-head { display: flex; gap: .5rem; align-items: center; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fe-group-head svg { width: 1.1rem; height: 1.1rem; color: var(--brand); }
.fe-item { display: flex; align-items: center; gap: .85rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.fe-item:last-child { border-bottom: 0; }
.fe-item:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.fe-item.on { background: var(--ok-soft); }
.fe-item.done { cursor: default; opacity: .75; }
.fe-tick { position: absolute; opacity: 0; pointer-events: none; }
.fe-box { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 8px; border: 2px solid var(--border); color: transparent; font-weight: 800; font-size: 1.1rem; background: var(--surface); }
.fe-item.on .fe-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.fe-item.done .fe-box { background: var(--surface-2); color: var(--ok); }
.fe-tick:focus-visible + .fe-box { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); }
.fe-who { flex: 1; min-width: 0; display: grid; }
.fe-who b { font-size: 1rem; }
.fe-who small { color: var(--muted); font-size: .8rem; }
.fe-amt { display: flex; align-items: center; gap: .3rem; flex: none; }
.fe-amt .input { width: 6.5rem; text-align: center; font-weight: 700; }
.fe-amt small { color: var(--muted); }
.fe-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .8rem 1rem; margin-top: .5rem; border-radius: 16px 16px 0 0; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 -10px 24px -18px rgb(0 0 0 / .45); }
.fe-savebar #en-sum { flex: 1; min-width: 180px; display: grid; }
.fe-savebar #en-sum b { font-size: 1.05rem; }
.fe-savebar #en-sum span { font-size: .82rem; }
@media (max-width: 640px) { .fe-item { gap: .6rem; padding: .65rem .7rem; } .fe-amt .input { width: 5.3rem; } .fe-savebar .btn-lg { flex: 1; } }
.fe-item { position: relative; }

/* ===== المحاضرة المباشرة ===== */
.lv-warn { border-inline-start: 4px solid var(--brand); margin-bottom: 1rem; line-height: 1.8; }
.lv-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .lv-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.lv-stage { position: relative; aspect-ratio: 16 / 9; background: #111318; overflow: hidden; padding: 0; }
.lv-stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; transform: scaleX(-1); }
.lv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .7rem; align-items: center; justify-content: center; color: #e9e3da; text-align: center; padding: 1rem; }
.lv-empty[hidden], .lv-badge[hidden], .lv-live-ctl[hidden], #lv-go[hidden], #lv-preview[hidden] { display: none !important; }
.lv-empty svg { width: 44px; height: 44px; opacity: .7; }
.lv-badge { position: absolute; top: .8rem; inset-inline-start: .8rem; display: inline-flex; gap: .45rem; align-items: center; background: #c0392b; color: #fff; font-weight: 700; padding: .3rem .8rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.lv-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #fff; animation: lvPulse 1.4s infinite; }
@keyframes lvPulse { 50% { opacity: .3; } }
.lv-side { display: grid; gap: .8rem; }
.lv-side .btn { width: 100%; justify-content: center; }
.lv-meter { height: 6px; border-radius: 6px; background: var(--line, rgba(0,0,0,.08)); overflow: hidden; }
.lv-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2e9d5b, #e2b33a); transition: width .08s; }
.lv-live-ctl { display: grid; gap: .6rem; }
.lv-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.lv-row .btn { font-size: .85rem; padding-inline: .4rem; }
.lv-stat { display: flex; align-items: baseline; gap: .5rem; justify-content: center; padding: .6rem; border-radius: 12px; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.lv-stat b { font-size: 1.8rem; color: var(--brand); }
.lv-side .is-off { border-color: var(--bad); color: var(--bad); }
.lv-help { font-size: .85rem; margin: 0; line-height: 1.8; word-break: break-word; }