/* =====================================================================
   خزانة — الأنماط (عربي، من اليمين إلى اليسار، الجوال أولاً)
   ===================================================================== */
:root {
  --bg: #f6f1e8;
  --bg-2: #efe7d8;
  --card: #ffffff;
  --ink: #1e2a2b;
  --muted: #6b7775;
  --line: #e6ded0;
  --primary: #1d5c58;
  --primary-2: #2b7a73;
  --primary-soft: #e3efed;
  --accent: #c99a3b;
  --accent-soft: #f6ecd6;
  --danger: #b3443a;
  --danger-soft: #f9e6e3;
  --ok: #2e7d4f;
  --ok-soft: #e4f2e9;
  --warn: #a4660c;
  --warn-soft: #fbefd8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(30, 42, 43, .06), 0 1px 2px rgba(30, 42, 43, .05);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.65; min-height: 100vh;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.35; font-weight: 700; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .7em; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 10px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  background: var(--primary); color: #fff; font-weight: 600; text-decoration: none;
  transition: background .15s, transform .05s, box-shadow .15s; min-height: 42px; white-space: nowrap;
}
.btn svg, .link-btn svg, .chip svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
.btn:hover { background: var(--primary-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.secondary:hover { background: #d4e6e3; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #f2d5d0; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: #b2872f; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; min-width: 38px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; }

/* ---------- الحقول ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 5px; color: #2f3c3d; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  outline: none; transition: border-color .15s, box-shadow .15s; min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(43, 122, 115, .15); }
textarea { min-height: 88px; resize: vertical; }
input[type=number] { direction: ltr; text-align: right; }
input[type=tel], input[type=password].pin { direction: ltr; text-align: right; letter-spacing: .08em; }
input[type=url] { direction: ltr; text-align: left; }
input[type=file] { width: 100%; padding: 8px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2.collapse { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); font-size: .8rem; color: #3b4747; border: 1px solid transparent;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.primary { background: var(--primary-soft); color: var(--primary); }
.chip.accent { background: var(--accent-soft); color: #8a661f; }
.chip.toggle { cursor: pointer; user-select: none; border-color: var(--line); background: var(--card); }
.chip.toggle.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.error-text { color: var(--danger); font-size: .86rem; margin-top: 6px; }
.note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .88rem; color: #6d4f12; }
.note.info { background: var(--primary-soft); color: var(--primary); }
.note.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- البطاقات ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid rgba(230, 222, 208, .6); }
.card + .card { margin-top: 12px; }
.card.soft { background: var(--primary-soft); border-color: transparent; box-shadow: none; }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h3 { margin: 0; }
.list { display: grid; gap: 12px; }
@media (min-width: 720px) { .list.cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .list.cols3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- شريط التقدم ---------- */
.progress { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); border-radius: 999px; transition: width .4s; }
.progress.gold > i { background: linear-gradient(90deg, #e0b865, var(--accent)); }
.progress.lg { height: 14px; }

/* ---------- الصفحة العامة ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(246, 241, 232, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--primary); }
.brand svg { width: 34px; height: 34px; }
.brand .sub { font-size: .72rem; color: var(--muted); font-weight: 500; display: block; line-height: 1.1; }
.shell { display: flex; flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; }
.sidenav { display: none; }
main { flex: 1; padding: 16px 14px calc(var(--nav-h) + 24px); min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.35rem; }
.bottomnav {
  position: fixed; bottom: 0; right: 0; left: 0; height: var(--nav-h); background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; align-items: stretch; z-index: 20; padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .66rem; font-weight: 600; white-space: nowrap; padding: 0 2px; min-width: 0;
}
.bottomnav a svg, .sidenav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--primary); }
@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidenav { display: block; width: 230px; padding: 18px 10px; border-left: 1px solid var(--line); }
  .sidenav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none;
    color: var(--ink); font-weight: 600; margin-bottom: 4px;
  }
  .sidenav a.on { background: var(--primary-soft); color: var(--primary); }
  .sidenav a:hover { background: var(--bg-2); }
  main { padding: 22px 24px 40px; }
}

/* ---------- شاشة الدخول ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 14px; background:
  radial-gradient(1200px 500px at 50% -10%, #e3efed 0%, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; }
.auth-logo svg { width: 72px; height: 72px; }
.auth-logo h1 { font-size: 1.9rem; color: var(--primary); margin: 0; }
.auth-logo p { color: var(--muted); margin: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { flex: 1; background: none; border: 0; padding: 10px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- الشاشات الفارغة والتحميل ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; margin: 0 auto 10px; opacity: .8; }
.empty h3 { color: var(--ink); }
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.splash svg { width: 80px; height: 80px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الكتب ---------- */
.book-card { display: flex; gap: 12px; }
.cover { width: 64px; height: 88px; border-radius: 8px; flex: none; background: linear-gradient(160deg, var(--primary-2), var(--primary)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; overflow: hidden; box-shadow: inset -4px 0 0 rgba(0,0,0,.15); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.c1 { background: linear-gradient(160deg, #2b7a73, #1d5c58); }
.cover.c2 { background: linear-gradient(160deg, #d2a75a, #a67a23); }
.cover.c3 { background: linear-gradient(160deg, #6a7fa8, #3f5584); }
.cover.c4 { background: linear-gradient(160deg, #a66d5e, #7a4538); }
.cover.c5 { background: linear-gradient(160deg, #6f9d7a, #3e6e4b); }
.book-meta { flex: 1; min-width: 0; }
.book-meta h3 { margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
select.inline { width: auto; min-height: 32px; padding: 3px 28px 3px 8px; font-size: .82rem; border-radius: 8px; }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .filters { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- لوحة التحكم ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat .l { font-size: .82rem; color: var(--muted); }
.today-card { border-right: 5px solid var(--accent); }
.today-card.done { border-right-color: var(--ok); }
.big-num { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: var(--bg-2); border-radius: 10px; padding: 6px 2px; text-align: center; font-size: .72rem; color: var(--muted); }
.day b { display: block; font-size: 1rem; color: var(--ink); }
.day.hit { background: var(--primary-soft); color: var(--primary); } .day.hit b { color: var(--primary); }
.day.today { outline: 2px solid var(--accent); }

/* ---------- الجداول ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.table-wrap { overflow-x: auto; }
.rank { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--bg-2); font-weight: 700; font-size: .8rem; }
.rank.r1 { background: #f3dfae; color: #7a5a12; } .rank.r2 { background: #e5e5e5; color: #555; } .rank.r3 { background: #ecd3c2; color: #7a4a2b; }

/* ---------- النوافذ ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 30, 30, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-back { align-items: center; padding: 20px; } }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px 24px; animation: up .2s ease-out; }
@media (min-width: 640px) { .modal { border-radius: 20px; } }
@keyframes up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 16px; flex-wrap: wrap; }
.book-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin-bottom: 6px; }
.book-pick.on { border-color: var(--primary); background: var(--primary-soft); }
.book-pick input { width: 18px; height: 18px; }
.book-pick .ord { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- التنبيهات ---------- */
#toasts { position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 900px) { #toasts { bottom: 20px; } }
.toast { background: #1e2a2b; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: .9rem; animation: up .2s ease-out; }
.toast.ok { background: var(--ok); } .toast.danger { background: var(--danger); }

/* ---------- شريط الوضع ---------- */
.mode-banner { background: var(--warn-soft); color: var(--warn); font-size: .82rem; text-align: center; padding: 6px 10px; border-bottom: 1px solid #efdcb5; }
.invite-box { display: flex; gap: 6px; align-items: center; }
.invite-box input { direction: ltr; text-align: left; font-size: .8rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-row:last-child { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv b { color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 480px) { .hide-sm { display: none; } }


/* ---------- إضافات نسخة Laravel ---------- */
details.logbox { margin-top: 8px; }
details.logbox > summary { list-style: none; display: inline-flex; }
details.logbox > summary::-webkit-details-marker { display: none; }
details.logbox[open] > summary { margin-bottom: 8px; }
.logbox .row input[type=number] { flex: 1 1 110px; width: auto; }
form.inline { display: inline; }
.back-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; margin-bottom: 10px; }
.back-link svg { width: 16px; height: 16px; }
.form-card { max-width: 640px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tabs a { flex: 1; text-align: center; padding: 10px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.chip.toggle:has(input:focus-visible), .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg button:disabled { opacity: .5; cursor: not-allowed; }
.list > .card { margin-top: 0; }
.empty .btn svg { width: 18px; height: 18px; margin: 0; opacity: 1; }

/* =====================================================================
   الدفعة الثانية: الوضع الليلي، الترحيب، القارئ، الفوائد، التقارير
   ===================================================================== */

/* ---------- الوضع الليلي (تفضيل على الجهاز) ---------- */
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #121a1a; --bg-2: #1c2727; --card: #18211f; --ink: #e6ece9; --muted: #98a6a2; --line: #2a3836;
  --primary: #5fbfb3; --primary-2: #7fd0c5; --primary-soft: #1d3331;
  --accent: #d9ae58; --accent-soft: #33290f;
  --danger: #e58a80; --danger-soft: #3a1f1c; --ok: #6cc08c; --ok-soft: #17301f; --warn: #e0ae5c; --warn-soft: #33270f;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3);
}
:root[data-theme=dark] .btn, :root[data-theme=dark] .btn.accent { color: #0f1716; }
:root[data-theme=dark] .btn.secondary { color: var(--primary); }
:root[data-theme=dark] .btn.secondary:hover { background: #254340; }
:root[data-theme=dark] .btn.ghost { color: var(--ink); }
:root[data-theme=dark] .btn.danger { color: var(--danger); }
:root[data-theme=dark] .btn.danger:hover { background: #4a2622; }
:root[data-theme=dark] .chip { color: var(--ink); }
:root[data-theme=dark] .chip.ok { color: var(--ok); } :root[data-theme=dark] .chip.warn { color: var(--warn); }
:root[data-theme=dark] .chip.danger { color: var(--danger); } :root[data-theme=dark] .chip.primary { color: var(--primary); }
:root[data-theme=dark] .chip.accent, :root[data-theme=dark] .note { color: var(--accent); }
:root[data-theme=dark] .note.info { color: var(--primary); } :root[data-theme=dark] .note.danger { color: var(--danger); }
:root[data-theme=dark] .chip.toggle.on, :root[data-theme=dark] .book-pick .ord { color: #0f1716; }
:root[data-theme=dark] .field > span { color: var(--ink); }
:root[data-theme=dark] .topbar { background: rgba(18, 26, 26, .92); }
:root[data-theme=dark] .auth-wrap { background: radial-gradient(1200px 500px at 50% -10%, #1d3331 0%, transparent 60%), var(--bg); }
:root[data-theme=dark] .card { border-color: var(--line); }
:root[data-theme=dark] .rank.r1 { background: #4a3c14; color: #f0d48a; }
:root[data-theme=dark] .rank.r2 { background: #3a3f3f; color: #d5dada; }
:root[data-theme=dark] .rank.r3 { background: #46301f; color: #e6b99a; }
:root[data-theme=dark] .toast { background: #2a3836; }
/* صفحات الكتاب في القارئ تُعتَّم دون قلب الألوان الحادّ */
:root[data-theme=dark] #reader-canvas { filter: invert(.9) hue-rotate(180deg) brightness(.95); }

/* ---------- الدخول السريع ورمز الانضمام ---------- */
input.pin-lg { font-size: 1.6rem; text-align: center !important; letter-spacing: .5em !important; min-height: 58px; }
.join-code { background: var(--bg-2); border: 0; }
.join-code label { display: block; margin-bottom: 8px; }
.join-code input, .join-code-value { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; text-transform: uppercase; font-weight: 700; }
.join-code input { flex: 1 1 140px; width: auto; text-align: center; }
.invite-row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .invite-row { grid-template-columns: 1fr 2fr; } }
.invite-row .field { margin: 0; }
.invite-box input.join-code-value { text-align: center; font-size: 1rem; }

/* ---------- شرائح الترحيب ---------- */
.slides .slide { text-align: center; padding: 26px 6px 10px; min-height: 250px; }
.slide-icon { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 26px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.slide-icon svg { width: 46px; height: 46px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 16px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: width .2s, background .2s; }
.dots i.on { width: 22px; border-radius: 999px; background: var(--primary); }

/* ---------- الفوائد ---------- */
.benefit-text { white-space: pre-line; margin: 0 0 8px; line-height: 1.9; }
.benefit-prompt { border-right: 5px solid var(--accent); }
.benefit-prompt .row input[type=number] { width: auto; }
.benefit-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.benefit-row:last-of-type { border-bottom: 0; }
.benefit-row.is-featured { padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); margin: 8px 0; }
.featured { background: var(--accent-soft); border-color: var(--accent); box-shadow: none; }
.featured-label { color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
:root:not([data-theme=dark]) .featured-label { color: #8a661f; }
.featured-label svg { width: 15px; height: 15px; }
/* لوحة الشرف: تمييز هادئ لصاحب أفضل فائدة */
.honor { background: var(--bg-2); border: 0; }
.best-benefit { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.best-author { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.idle-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#late-reminder { font-size: .88rem; }

/* ---------- القارئ ---------- */
.reader { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); }
.reader-bar, .reader-foot { background: var(--card); border-color: var(--line); padding: 8px 12px; }
.reader-bar { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.reader-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reader-stage { flex: 1; overflow: auto; padding: 12px; text-align: center; }
#reader-canvas { max-width: none; display: inline-block; box-shadow: var(--shadow); background: #fff; border-radius: 4px; }
.reader-foot { border-top: 1px solid var(--line); position: sticky; bottom: 0; }
.reader-nav { justify-content: center; }
.reader-nav input { width: 76px; min-height: 36px; padding: 4px 8px; text-align: center; }
.reader-meta { margin-top: 8px; }
.reader-foot details textarea { margin-top: 8px; }

/* ---------- التقارير القابلة للطباعة ---------- */
.report { max-width: 860px; }
.report h1 { margin-top: 10px; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.report .stat { box-shadow: none; background: var(--bg-2); }
.report .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.bar-row { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: .9rem; }
.bar-row b { text-align: left; color: var(--primary); }
@media print {
  :root, :root[data-theme=dark] { color-scheme: light; --bg: #fff; --bg-2: #f3efe6; --card: #fff; --ink: #1e2a2b; --muted: #5d6967; --line: #ddd5c6; --primary: #1d5c58; --primary-2: #2b7a73; --primary-soft: #e3efed; --accent: #c99a3b; --accent-soft: #f6ecd6; --shadow: none; }
  .topbar, .sidenav, .bottomnav, .no-print, #toasts, .benefit-prompt { display: none !important; }
  main { padding: 0 !important; }
  .shell { max-width: none; }
  .report { max-width: none; border: 0; padding: 0; }
  .table-wrap { overflow: visible; }
  tr, .benefit-row, .stat, .bar-row { break-inside: avoid; }
  .progress > i, .stat, .benefit-row.is-featured { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}
