:root{
  --bg:#F4F5F8; --surface:#FFFFFF; --ink:#182339; --muted:#6C7689;
  --line:#E5E8EF; --line-2:#D8DDE7;
  --navy:#0E2243; --navy-mid:#1A3157; --navy-soft:#EAEEF6;
  --gold:#B58A2A; --gold-soft:#FAF3E1;
  --green:#1E7B4D; --green-soft:#E7F3EC;
  --red:#B23A2E; --red-soft:#FBEBE8;
  --gray-soft:#EEF0F4;
  /* ألوان وظيفية — كل لون له معنى واحد بكل النظام */
  --info:#2E5FA3;   --info-soft:#E8EFF9;    /* معلومات */
  --warn:#B4701C;   --warn-soft:#FBF0E0;    /* تحذير */
  --shadow:0 1px 2px rgba(14,34,67,.05);
  --shadow-lg:0 8px 24px rgba(14,34,67,.10);
  --sb:252px;
}
/* ===== الوضع الليلي ===== */
:root[data-theme="dark"]{
  --bg:#0F1420; --surface:#161D2B; --ink:#E6EAF2; --muted:#93A0B6;
  --line:#232C3D; --line-2:#2F3A4C;
  --navy:#0A101C; --navy-mid:#3763AC; --navy-soft:#1B2740;
  --gold:#D3A64A; --gold-soft:#2B2517;
  --green:#3FAE79; --green-soft:#142A20;
  --red:#DF6A5B; --red-soft:#2C1917;
  --gray-soft:#1C2433;
  --info:#6C9BE0;   --info-soft:#16233A;
  --warn:#D9A253;   --warn-soft:#2A2214;
  --shadow:0 1px 2px rgba(0,0,0,.35);
  --shadow-lg:0 8px 24px rgba(0,0,0,.5);
  color-scheme:dark;
}
:root[data-theme="dark"] .sidebar{background:#0C121F}
:root[data-theme="dark"] .btn.outline,
:root[data-theme="dark"] .icon-btn{background:var(--surface)}
:root[data-theme="dark"] table.grid th{background:#111826}
:root[data-theme="dark"] .jr th,
:root[data-theme="dark"] .saved-row{background:#111826}
:root[data-theme="dark"] .xsel-btn,
:root[data-theme="dark"] .xsel-pop,
:root[data-theme="dark"] .chk .bx,
:root[data-theme="dark"] .ser-chip,
:root[data-theme="dark"] .ser-pick,
:root[data-theme="dark"] .pln-row,
:root[data-theme="dark"] .ln-row,
:root[data-theme="dark"] .line-item,
:root[data-theme="dark"] .sumx,
:root[data-theme="dark"] .payblock,
:root[data-theme="dark"] .filebox,
:root[data-theme="dark"] .meta-strip,
:root[data-theme="dark"] .jr,
:root[data-theme="dark"] .meta-grid>div{background:var(--surface)}
:root[data-theme="dark"] .xsel-s{background:#111826}
:root[data-theme="dark"] .pln-row input.cin,
:root[data-theme="dark"] .ln-row input.pin{background:#111826;color:var(--ink)}
:root[data-theme="dark"] .ser-panel{background:#1A2030;border-color:#3A3320}
:root[data-theme="dark"] .fld input,
:root[data-theme="dark"] .fld select,
:root[data-theme="dark"] .fld textarea,
:root[data-theme="dark"] .tsearch input,
:root[data-theme="dark"] .gsearch input,
:root[data-theme="dark"] .tool-chk:has(input:checked){background:rgba(181,138,42,.16);color:#E7C168}
:root[data-theme="dark"] .tool-sel,
:root[data-theme="dark"] .tool-chk,
:root[data-theme="dark"] .ser-in input{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .rep-card,
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .panel{background:var(--surface)}
:root[data-theme="dark"] table.grid tbody tr:hover{background:var(--navy-soft)}

*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
html{background:var(--bg)}
body{font-family:'Almarai',system-ui,sans-serif;background:var(--bg);color:var(--ink);font-size:13.5px;line-height:1.6}
button{font-family:inherit;border:none;background:none;cursor:pointer;color:inherit}
input,select{font-family:inherit;font-size:13.5px;color:var(--ink)}
.num{font-variant-numeric:tabular-nums}
.kufi{font-family:'Noto Kufi Arabic','Almarai',sans-serif}

