/* نظام الألوان: نهاري / ليلي. كل الصفحات تقرأ هذه المتغيرات فقط (لا ألوان ثابتة للخلفيات والنصوص). */
:root,html[data-theme="light"]{
  color-scheme:light;
  --canvas:#f7f4ec; --surface:#ffffff; --soft:#faf7ef; --soft2:#efeadd; --raised:#ffffff;
  --fg:#26352f; --fg-strong:#0d1f1a; --muted:#5d6a63; --faint:#8b958f;
  --line:#e3dcc9; --line2:#d9d1bd;
  --brand:#0c3b2e; --brand2:#14523f; --teal:#9a7a2c; --brand-text:#0c3b2e; --link:#8a6d24;
  --brand-soft:#f3ecd6; --brand-soft2:#e9dcb8; --brand-hover:#f7f1de;
  --ok-fg:#15803d; --ok-bg:#dcfce7; --ok-bd:#86efac;
  --warn-fg:#92400e; --warn-bg:#fef3c7; --warn-bg2:#fde68a; --warn-bd:#fcd34d;
  --bad-fg:#b91c1c; --bad-bg:#fee2e2; --bad-bd:#fecaca;
  --info-fg:#075985; --info-bg:#e0f2fe; --info-bd:#bae6fd; --blue:#1d4ed8; --blue-soft:#eff6ff;
  --sel:#fef9c3; --shadow:rgba(15,23,42,.08); --shadow2:rgba(15,23,42,.18); --scrim:rgba(15,23,42,.45);
  --input-bg:#ffffff; --input-fg:#111827; --focus:#b08d3c;
  --hdr-bg:#0c3b2e; --hdr-fg:#ffffff; --crumb-bg:#14523f;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --canvas:#0f1814; --surface:#16231d; --soft:#1b2b24; --soft2:#22342b; --raised:#1d2d26;
  --fg:#e6e9e1; --fg-strong:#f6f4ea; --muted:#a3b0a7; --faint:#7d8c83;
  --line:#2b3d34; --line2:#36493f;
  --brand:#2a7a5b; --brand2:#339070; --teal:#d4b45e; --brand-text:#e9dcb8; --link:#e0c46f;
  --brand-soft:#2a2d1c; --brand-soft2:#3a3a20; --brand-hover:#2b2f1e;
  --ok-fg:#6ee7a0; --ok-bg:#12372a; --ok-bd:#1f6a49;
  --warn-fg:#fbbf5a; --warn-bg:#3a2d10; --warn-bg2:#4a3912; --warn-bd:#7a5a17;
  --bad-fg:#fca5a5; --bad-bg:#3b1a1f; --bad-bd:#7a2a33;
  --info-fg:#7dd3fc; --info-bg:#10304a; --info-bd:#1d5a87; --blue:#8ab4ff; --blue-soft:#15233f;
  --sel:#3a3512; --shadow:rgba(0,0,0,.45); --shadow2:rgba(0,0,0,.6); --scrim:rgba(0,0,0,.65);
  --input-bg:#111823; --input-fg:#e8eef8; --focus:#d4b45e;
  --hdr-bg:#0a2a20; --hdr-fg:#ffffff; --crumb-bg:#0e382a;
}
/* زر التبديل */
.theme-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;
  border-radius:999px;padding:3px 12px;font-size:13px;line-height:1.6;cursor:pointer;font-family:inherit}
.theme-btn:hover{background:rgba(255,255,255,.22)}
.theme-btn.solid{border-color:var(--line2);background:var(--surface);color:var(--fg)}
.theme-float{position:fixed;bottom:14px;inset-inline-start:14px;z-index:9999;background:var(--surface);color:var(--fg);border:1px solid var(--line2);box-shadow:0 2px 10px var(--shadow2);padding:6px 14px;font-size:14px}
.theme-float:hover{background:var(--soft2)}
@media print{.theme-btn{display:none!important}}
/* الطباعة دائما بيضاء */
@media print{html,body{background:#fff!important;color:#000!important;color-scheme:light}}

/* زر الوضع: أيقونة صغيرة فقط (شمس/قمر) */
.theme-btn{width:32px;height:32px;padding:0!important;justify-content:center;border-radius:50%;font-size:16px;line-height:1;gap:0}
.theme-float{width:38px;height:38px;font-size:18px;padding:0!important}
