/* =====================================================================
   قرآني — التصميم الجديد (v2)
   مستوحى من المصاحف المخطوطة ومواقع القرآن الحديثة:
   ورق عاجي دافئ، أخضر زمردي عميق، ذهب هادئ، خط Tajawal (كالأصل)،
   ونجمة ثمانية (خاتم) كعنصر زخرفي.
   يُحمَّل بعد style.css فيعيد تعريف المظهر فقط.
   ===================================================================== */

/* ---------- الألوان: الوضع الداكن (ليلي حبري) ---------- */
:root {
  --bg: #0b1310;
  --bg-2: #0f1a16;
  --card: #111c18;
  --card-2: #16231e;
  --card-border: rgba(214, 180, 106, .14);
  --surface: #0e1814;
  --surface-2: #13201b;
  --hover: rgba(214, 180, 106, .07);
  --input-bg: #0c1613;
  --option-bg: #14211c;
  --text: #e8e2d2;
  --muted: #9ba79e;
  --title: #f3ead3;
  --brand: #1d6f54;
  --brand-2: #56b995;
  --accent: #d6b46a;
  --on-grad: #ffffff;
  --danger: #ff9d9d;
  --danger-bg: rgba(255, 157, 157, .1);
  --gold-soft: rgba(214, 180, 106, .12);
  --grad: linear-gradient(160deg, #1f7659 0%, #13523f 100%);
  --grad-text: linear-gradient(120deg, #f0dca6, #d6b46a);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 18px 40px -24px rgba(0, 0, 0, .7);
  --focus: rgba(86, 185, 149, .2);
  --bar-empty: rgba(232, 226, 210, .08);
  --selection: rgba(214, 180, 106, .3);
  --scrollbar: rgba(214, 180, 106, .2);
  --header-bg: rgba(11, 19, 16, .88);
  --header-border: rgba(214, 180, 106, .14);
  --viewer-bg: #08100d;
  --loading-bg: rgba(8, 16, 13, .92);
  --modal-bg: rgba(4, 9, 7, .7);
  --canvas-shadow: 0 1px 0 rgba(214, 180, 106, .25), 0 24px 50px -20px rgba(0, 0, 0, .85);
  --radius: 16px;
  --ink-strong: #f3ead3;
  --pattern-opacity: .09;
  --font-ui: 'Tajawal', system-ui, -apple-system, 'Segoe UI', 'Noto Naskh Arabic', sans-serif;
}

/* ---------- الألوان: الوضع الفاتح (ورق المصحف) ---------- */
[data-theme="light"] {
  --bg: #f5efe1;
  --bg-2: #eee5d0;
  --card: #fffdf7;
  --card-2: #fbf7ec;
  --card-border: rgba(122, 92, 38, .16);
  --surface: #faf5e9;
  --surface-2: #ffffff;
  --hover: rgba(15, 92, 69, .06);
  --input-bg: #fffefa;
  --option-bg: #fffefa;
  --text: #1f2a25;
  --muted: #6d6a5b;
  --title: #0d3b2e;
  --brand: #0f5c45;
  --brand-2: #0f6b50;
  --accent: #a47a2c;
  --on-grad: #ffffff;
  --danger: #a82a22;
  --danger-bg: #fbeae7;
  --gold-soft: rgba(164, 122, 44, .11);
  --grad: linear-gradient(160deg, #13664d 0%, #0b4434 100%);
  --grad-text: linear-gradient(120deg, #0d3b2e, #0f6b50);
  --shadow: 0 1px 2px rgba(80, 56, 16, .05), 0 12px 30px -18px rgba(80, 56, 16, .28);
  --focus: rgba(15, 107, 80, .16);
  --bar-empty: rgba(13, 59, 46, .08);
  --selection: rgba(164, 122, 44, .22);
  --scrollbar: rgba(122, 92, 38, .25);
  --header-bg: rgba(245, 239, 225, .9);
  --header-border: rgba(122, 92, 38, .16);
  --viewer-bg: #ece3cf;
  --loading-bg: rgba(236, 227, 207, .92);
  --modal-bg: rgba(26, 36, 30, .35);
  --canvas-shadow: 0 1px 0 rgba(122, 92, 38, .2), 0 22px 44px -22px rgba(60, 40, 10, .55);
  --ink-strong: #0d3b2e;
  --pattern-opacity: .11;
}

/* ---------- الخط: Tajawal كما في التصميم الأصلي ---------- */
body { font-family: var(--font-ui); }

/* ---------- الخلفية: زخرفة هندسية خفيفة بدل التوهّج والشبكة ---------- */
.bg-fx {
  -webkit-mask-image: linear-gradient(180deg, #000 0, transparent 460px);
  mask-image: linear-gradient(180deg, #000 0, transparent 460px);
}
.bg-fx::before {
  inset: 0;
  filter: none;
  animation: none;
  opacity: var(--pattern-opacity);
  background: var(--accent);
  /* نجوم ثمانية متشابكة (خاتم) */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M44 18l7.6 18.4L70 44l-18.4 7.6L44 70l-7.6-18.4L18 44l18.4-7.6z'/%3E%3Cpath d='M25.6 25.6h36.8v36.8H25.6z'/%3E%3Cpath d='M0 0l7.6 18.4M88 0l-7.6 18.4M0 88l7.6-18.4M88 88l-7.6-18.4M0 0l18.4 7.6M88 0L69.6 7.6M0 88l18.4-7.6M88 88l-18.4-7.6'/%3E%3C/g%3E%3C/svg%3E") repeat 0 0 / 88px 88px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M44 18l7.6 18.4L70 44l-18.4 7.6L44 70l-7.6-18.4L18 44l18.4-7.6z'/%3E%3Cpath d='M25.6 25.6h36.8v36.8H25.6z'/%3E%3Cpath d='M0 0l7.6 18.4M88 0l-7.6 18.4M0 88l7.6-18.4M88 88l-7.6-18.4M0 0l18.4 7.6M88 0L69.6 7.6M0 88l18.4-7.6M88 88l-18.4-7.6'/%3E%3C/g%3E%3C/svg%3E") repeat 0 0 / 88px 88px;
}
.bg-fx::after { display: none; }

/* ---------- عنصر النجمة الثمانية (يُستخدم كزخرفة) ---------- */
.card-title::before, .surah-panel-title::before, .footer-orn,
.stat-label::before, .surah-num::before {
  content: "";
  display: inline-block;
  width: 13px; height: 13px;
  flex: none;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg%3E%3Crect x='5' y='5' width='14' height='14'/%3E%3Crect x='5' y='5' width='14' height='14' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg%3E%3Crect x='5' y='5' width='14' height='14'/%3E%3Crect x='5' y='5' width='14' height='14' transform='rotate(45 12 12)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* =====================================================================
   الشريط العلوي
   ===================================================================== */
.app-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 0 var(--header-border), 0 4px 0 -3px var(--header-border);
}
.header-inner { padding: 10px 24px; gap: 20px; }
.brand { gap: 12px; cursor: pointer; border-radius: 14px; transition: opacity .15s; }
.brand:hover { opacity: .85; }
.brand:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 4px; }
.brand-logo { height: 44px; filter: none; border-radius: 0; }
.brand-title {
  font-size: 26px; font-weight: 900; letter-spacing: 1px; line-height: 1.2;
  background: none; color: var(--ink-strong);
}
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 0; }
.header-actions { gap: 10px; }

/* التبويبات: شريط واحد متصل */
.tabs {
  gap: 2px; flex-wrap: nowrap;
  padding: 4px;
  background: var(--card-2);
  border: 1px solid var(--card-border);
  border-radius: 999px;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 0;
  color: var(--muted);
  padding: 8px 18px;
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--hover); color: var(--title); transform: none; }
.tab-btn.active {
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(15, 92, 69, .7);
}
.tab-ico { margin: 0; }
.tab-lbl-m { display: none; }
.listen-tab { color: var(--accent); padding: 8px 12px; }
.listen-tab:hover { color: var(--accent); }

.theme-toggle, .user-chip { background: var(--card-2); border-color: var(--card-border); }
.theme-toggle { width: 40px; height: 40px; }
.theme-toggle:hover { transform: rotate(20deg); box-shadow: none; }
.user-chip { padding: 3px 4px 3px 14px; }
.user-name { font-weight: 600; }

/* =====================================================================
   البطاقات والعناوين والأزرار
   ===================================================================== */
.container { max-width: 1480px; margin: 18px auto 20px; }
.tab-panel { padding: 0 20px; }
.card {
  background: var(--card);
  border-color: var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  padding: 24px 26px;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800;
  border: 0; padding: 0;
  margin-bottom: 16px;
  color: var(--title);
}

.btn { font-weight: 600; }
.btn:hover { transform: translateY(-1px); box-shadow: none; }
.btn.primary {
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 10px 22px -12px rgba(15, 92, 69, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 14px 28px -12px rgba(15, 92, 69, .85); }
.btn.lg { padding: 13px 32px; }
.icon-btn { background: var(--card-2); border-color: var(--card-border); border-radius: 12px; }
.icon-btn:hover { color: var(--brand-2); border-color: color-mix(in srgb, var(--brand-2) 55%, transparent); transform: none; background: var(--hover); }

.select, .text-input, .ayah-input, .page-input, .date-picker, .surah-search {
  border-color: var(--card-border); border-radius: 11px;
}
.text-input:focus, .ayah-input:focus, .select:focus, .date-picker:focus, .page-input:focus, .surah-search:focus {
  border-color: color-mix(in srgb, var(--brand-2) 70%, transparent);
}

/* =====================================================================
   المصحف والتفسير
   ===================================================================== */
/* زر قائمة السور: للشاشات الصغيرة فقط (على الحاسوب القائمة ظاهرة دائماً) */
/* وكذلك زر إغلاق القائمة (✕): لا يعمل إلا عندما تنزلق القائمة على الشاشات الصغيرة */
.icon-btn.surah-toggle-btn, .icon-btn.surah-close { display: none; }
@media (max-width: 1024px) { .icon-btn.surah-toggle-btn, .icon-btn.surah-close { display: inline-grid; } }
.surah-panel {
  background: var(--card); backdrop-filter: none;
  top: 90px; max-height: calc(100vh - 110px);
}
.surah-panel-head { padding: 16px 16px 12px; }
.surah-panel-title {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 900; border: 0; padding: 0;
}
.surah-search { margin: 12px 14px 6px; background: var(--input-bg); }
.surah-list { padding: 6px 10px 10px; }
.surah-item { padding: 7px 8px; border-radius: 12px; gap: 12px; }
.surah-item.active { background: var(--grad); box-shadow: 0 8px 18px -12px rgba(15, 92, 69, .9); }
/* رقم السورة داخل نجمة ثمانية */
.surah-num {
  position: relative;
  width: 34px; height: 34px;
  background: none; border: 0;
  color: var(--title);
  font-size: 12px; font-weight: 700;
  font-family: var(--font-ui);
}
.surah-num::before {
  position: absolute; inset: 0;
  width: auto; height: auto;
  background: var(--gold-soft);
  z-index: 0;
}
.surah-num { isolation: isolate; }
.surah-num::before { z-index: -1; }
.surah-item:hover .surah-num::before { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.surah-item.active .surah-num { background: none; color: #fff; }
.surah-item.active .surah-num::before { background: rgba(255, 255, 255, .18); }
.surah-name { font-size: 15px; font-weight: 700; }
.surah-page { font-size: 11px; }

.mushaf-toolbar {
  background: var(--card); backdrop-filter: none;
  padding: 8px 12px; margin-bottom: 10px;
}
.page-input { width: 70px; font-weight: 600; }
.mushaf-status { margin-bottom: 10px; }
.status-chip {
  background: var(--gold-soft); color: var(--title);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 13px; font-weight: 800; padding: 5px 14px;
}
.status-chip.muted {
  font-size: 12.5px; font-weight: 600;
  background: transparent; color: var(--muted); border-color: var(--card-border);
}
.pdf-viewer {
  background:
    radial-gradient(ellipse 60% 70% at 50% 45%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--viewer-bg);
  backdrop-filter: none;
  height: calc(100vh - 196px);
  padding: 8px;
}
.pdf-layer { gap: 3px; }
.pdf-pages .pdf-page { border-radius: 2px; box-shadow: var(--canvas-shadow); }

/* =====================================================================
   المتابعة
   ===================================================================== */
.date-bar { padding: 14px 20px; gap: 14px; }
.date-ico { color: var(--accent); }
.date-display { display: flex; flex-direction: column; align-items: center; }
.date-greg { font-size: 20px; font-weight: 800; line-height: 1.4; }
.date-hijri { font-size: 14px; color: var(--accent); margin-top: 2px; font-weight: 700; }
.friday-badge { border-radius: 14px; font-weight: 600; }

.form-card { padding-bottom: 26px; }
.form-section {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.form-section:last-of-type { border-bottom: 1px solid var(--card-border); }
.form-section-title { font-size: 15.5px; font-weight: 700; margin-bottom: 14px; }
.fs-ico {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--gold-soft); border: 0; color: var(--accent);
}
.range-box { background: var(--card); border-radius: 12px; }
.range-tag {
  background: var(--gold-soft); color: var(--title);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 12px; font-weight: 700;
}
.range-arrow { color: var(--accent); }
.toggle-switch { background: var(--bar-empty); border-color: var(--card-border); }
.section-toggle input:checked + .toggle-switch { background: var(--brand); border-color: var(--brand); }

.habit-card { background: var(--card); border-width: 1px; border-radius: 14px; padding: 16px 12px; }
.habit-card:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--brand-2) 50%, transparent); }
.habit-ico { color: var(--brand-2); }
.habit-name { font-size: 14px; font-weight: 800; }
.habit-card::after { background: var(--brand); color: #fff; }
.habit-card:has(input:checked) {
  background: color-mix(in srgb, var(--brand-2) 8%, var(--card));
  border-color: var(--brand-2);
  box-shadow: inset 0 0 0 1px var(--brand-2);
}

/* الملاحظات بعرض كامل */
#notes { display: block; width: 100%; min-height: 84px; line-height: 1.8; }
.form-actions { margin-top: 18px; }

/* السجل: قائمة قابلة للتمرير بدل صفحة طويلة جداً */
.history-card .entries-list {
  max-height: 560px; overflow-y: auto;
  padding-inline-end: 4px;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 40px), transparent);
  padding-bottom: 30px;
}
.entries-list { gap: 8px; }
.entry {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  align-items: center;
  transition: border-color .15s;
}
.entry:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.entry-date {
  background: var(--gold-soft); color: var(--title);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 12px;
  min-width: 70px; padding: 6px 10px;
}
.entry-day { font-size: 20px; font-weight: 900; line-height: 1.15; }
.entry-mon { font-size: 11px; color: var(--muted); opacity: 1; font-weight: 600; }
.entry-line b { color: var(--brand-2); }
.tag {
  background: transparent; color: var(--muted);
  border-color: var(--card-border); font-size: 11.5px;
}

/* =====================================================================
   الإحصائيات
   ===================================================================== */
.dash-topbar { margin-bottom: 14px; }
.stats-grid { gap: 16px; }
.stat-card { padding: 26px 22px 24px; }
.stat-card:hover { transform: none; }
.stat-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600;
}
.stat-label::before { width: 10px; height: 10px; }
.stat-value {
  font-size: 38px; font-weight: 900; line-height: 1.2;
  background: none; color: var(--ink-strong);
}
.stat-sub { font-size: 12.5px; }
.progress-bar { height: 8px; background: var(--bar-empty); }
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--brand-2)); }

.rev-stat, .journey-item, .habit-stat {
  background: var(--surface);
  border-radius: 14px;
}
.rev-stat b, .journey-num {
  background: none; color: var(--ink-strong);
  font-size: 26px; font-weight: 900;
}
.rev-stat span, .journey-lbl { font-size: 12px; }
.rev-cell { width: 18px; height: 18px; border-radius: 5px; }
.rev-cell.on { background: var(--brand-2); border-color: var(--brand-2); }
.rev-last b { color: var(--brand-2); }
.habit-stat-name { font-weight: 600; }

/* =====================================================================
   الاستماع والنوافذ
   ===================================================================== */
.listen-popover {
  background: var(--card);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 16px;
  padding: 12px 14px;
}
.repeat-mode-btn.active { background: var(--grad); color: #fff; }
.modal { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.dd-menu { border-radius: 14px; }
.dd-item.active { background: var(--brand); color: #fff; }

/* =====================================================================
   شاشة الدخول: بطاقة بإطار مذهّب مزدوج كصفحة المصحف
   ===================================================================== */
.auth-card {
  max-width: 440px;
  padding: 34px 32px 26px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: -9px;
  box-shadow: 0 30px 60px -30px rgba(40, 28, 8, .45);
}
.auth-basmala {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}
.auth-logo { height: 64px; filter: none; border-radius: 0; margin-bottom: 4px; }
.auth-brand .brand-title { font-size: 34px; }
.auth-tabs { border-radius: 999px; background: var(--card-2); }
.auth-tab { border-radius: 999px; }
.auth-tab.active { background: var(--grad); color: #fff; }
.auth-title { font-size: 19px; font-weight: 800; }
.auth-field > span { font-weight: 600; }

/* =====================================================================
   التذييل
   ===================================================================== */
.app-footer {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border-top: 0; padding: 26px 20px 30px;
}
.footer-orn { width: 16px; height: 16px; opacity: .8; }

/* =====================================================================
   الهاتف: شريط تبويبات سفلي ثابت، رأس مضغوط، صفحة مصحف واحدة كبيرة
   ===================================================================== */
@media (max-width: 720px) {
  .app-header {
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: var(--bg);
  }
  .header-inner {
    flex-direction: row; flex-wrap: nowrap; align-items: center;
    padding: 8px 14px; gap: 8px;
  }
  .brand { justify-content: flex-start; text-align: right; gap: 8px; }
  .brand-logo { height: 34px; }
  .brand-title { font-size: 21px; }
  .brand-sub { display: none; }
  .header-actions { flex-wrap: nowrap; gap: 6px; margin-inline-start: auto; }
  .user-chip { padding: 2px 3px 2px 10px; }
  .user-chip .user-ico { display: none; }
  .user-name { max-width: 90px; font-size: 12px; }
  .theme-toggle { width: 36px; height: 36px; }

  /* التبويبات تصبح شريطاً سفلياً */
  .tabs {
    position: fixed; z-index: 120;
    inset-inline: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 0; border: 0;
    border-top: 1px solid var(--card-border);
    background: var(--card);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .35);
  }
  .tab-btn, .listen-tab {
    flex-direction: column; gap: 1px;
    padding: 6px 2px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
    color: var(--muted);
  }
  .tab-btn .ic-svg, .tab-ico .ic-svg { width: 21px; height: 21px; }
  .tab-btn.active {
    background: transparent; color: var(--brand-2); box-shadow: none;
  }
  .tab-btn.active .tab-ico {
    background: var(--gold-soft);
    border-radius: 999px; padding: 2px 14px;
  }
  .tab-lbl-m { display: inline; }
  .listen-tab { order: 5; color: var(--accent); }

  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .container { margin-top: 10px; }
  .tab-panel { padding: 0 10px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card-title { font-size: 17px; }

  /* المصحف */
  .mushaf-toolbar { flex-direction: row; flex-wrap: nowrap; padding: 6px 8px; gap: 6px; }
  .toolbar-group { gap: 5px; }
  .toolbar-group.grow { display: none; }
  .mushaf-toolbar .toolbar-group:first-child { flex: 1; justify-content: flex-start; }
  .mushaf-toolbar .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  #btn-zoom-fit, #t-btn-zoom-fit { display: none; }
  .page-input { width: 54px; padding: 6px 4px; }
  .page-of { font-size: 12px; }
  .status-chip { font-size: 12.5px; }
  .pdf-viewer {
    /* ارتفاع الصفحة نفسها (نسبة الصفحة ~1.4) دون فراغ أسفلها، ضمن حدود الشاشة */
    height: min(calc((100vw - 20px) * 1.36), calc(100dvh - 56px - 50px - 44px - 72px - 30px - env(safe-area-inset-bottom)));
    min-height: 0;
    padding: 8px;
    border-radius: 14px;
  }

  /* لوحة الاستماع فوق الشريط السفلي مباشرة */
  .listen-popover {
    left: 8px !important; right: 8px !important;
    top: auto !important;
    bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    width: auto;
    max-height: 62vh !important;
  }

  /* المتابعة */
  .range-box { flex: none; }
  .range-box .select { flex: 1 1 0; }
  .date-bar { padding: 12px; gap: 8px; justify-content: center; }
  .date-ico { display: none; }
  .date-display { order: -1; flex-basis: 100%; }
  .form-section { padding: 14px 12px; }
  .habit-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .habit-card { padding: 12px 6px; }
  .habit-desc { display: none; }
  .habit-name { font-size: 13px; }
  .history-card .entries-list { max-height: 440px; }
  .entry-body { min-width: 0; }

  /* الإحصائيات */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-grid .stat-card:first-child { grid-column: 1 / -1; }
  .stat-card { padding: 18px 12px; margin-bottom: 0; }
  .stat-value { font-size: 32px; }
  .rev-stats { grid-template-columns: 1fr 1fr; }
  /* المخطط: الشهر كاملاً في عرض الشاشة بدل التمرير */
  .chart-wrap { overflow: visible; }
  .chart-svg { width: 100%; height: auto; }
  .journey { grid-template-columns: 1fr 1fr; }

  .auth-card { padding: 28px 20px 22px; }
  .app-footer { padding-bottom: 20px; }
}
