/* Cairo (SIL Open Font License, renderer/fonts/OFL-Cairo.txt), bundled so the app works offline. */
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/cairo-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/cairo-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --paper: #edf2f8;
  --card: #ffffff;
  /* High contrast (اختيار "تباين عالٍ"): darker text, secondary text and lines than before. */
  --ink: #0b1a2b;
  --muted: #33475e;
  --line: #b9c7d6;
  /* Entry boxes: a strong border; read-only boxes a dashed border on grey. */
  --field-line: #5f7690;
  --field-ink: #000000;
  --ro-line: #7f93ab;
  --ro-bg: #e6ebf2;
  --ro-ink: #1a2b3d;
  --side: #0a2540;
  --side-ink: #b9cce4;
  --side-active: #12355b;
  --accent: #1b64d1;
  --accent-soft: #e2ecfa;
  --amber: #c98a2b;
  --amber-soft: #f8eedb;
  --plum: #5b5bd6;
  --danger: #c2412d;
  --danger-soft: #fbe6e2;
  --blue: #1f5fa8;
  --blue-soft: #e1ecf8;
  --input: #ffffff;
  --soft: #f4f7fb;
  --soft-2: #eaf0f7;
  --title-font: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 37, 64, .06), 0 4px 14px rgba(10, 37, 64, .05);
  /* Theme tokens (الإعدادات ← المظهر والثيمات): the side menu, the home page's cards and chart. The theme chosen sets them on :root from THEMES in theme.js. */
  --t-side: #042c53; --t-side-2: #0c447c; --t-rail: #85b7eb; --t-brand: #378add; --t-ink: #c4dbf4; --t-mute: #6d97c4;
  --t-avatar: #185fa5; --t-quick-bg: #cfe2f8; --t-quick-ink: #0c447c; --t-quick-hover: #b5d4f4;
  --t-kpi1: #0c447c; --t-kpi2: #185fa5; --t-kpi3: #0f6e56; --t-kpi4: #3c3489;
  --t-chart-s: #185fa5; --t-chart-p: #85b7eb; --t-chart-l: #1d9e75;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; font-size: 14px; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
td.num, span.num, div.num { direction: ltr; unicode-bidi: isolate; }

/* Layout — a navy icon rail; a light-blue highlight glides to the open section */
.app { display: grid; grid-template-columns: 76px 1fr; grid-template-rows: minmax(0, 1fr); height: 100vh; }
.sidebar { position: relative; z-index: 20; background: var(--t-side); display: flex; flex-direction: column; align-items: center; padding: 14px 0; }
.brand { margin-bottom: 18px; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--t-brand); color: #fff; display: grid; place-items: center; font: 700 22px/1 var(--title-font); }
#nav { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nav-tab { position: relative; z-index: 1; width: 52px; height: 52px; border: 0; border-radius: 14px; background: none; color: var(--t-rail); display: grid; place-items: center; cursor: pointer; transition: color .25s; }
.nav-tab.bottom { margin-top: auto; }
.nav-tab .chip svg { width: 24px; height: 24px; display: block; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.nav-tab:hover { color: #fff; }
.nav-tab:hover .chip svg { transform: translateY(-2px) scale(1.08); }
.nav-tab.active { color: #fff; }
.nav-tab.active .chip svg { animation: tabPop .5s cubic-bezier(.3, 1.6, .5, 1); }
.nav-tab:focus-visible { outline: 2px solid var(--t-rail); outline-offset: 2px; }
.nav-tab .lbl { position: absolute; right: calc(100% + 14px); top: 50%; white-space: nowrap; background: var(--t-side); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 9px;
  opacity: 0; pointer-events: none; transform: translate(8px, -50%); transition: opacity .18s, transform .22s; }
.nav-tab .lbl::after { content: ''; position: absolute; left: 100%; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left-color: var(--t-side); }
.nav-tab:hover .lbl, .nav-tab:focus-visible .lbl { opacity: 1; transform: translate(0, -50%); }
.rail-glow { position: absolute; top: 0; left: 12px; width: 52px; height: 52px; border-radius: 14px; background: #185fa5; opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.3, 1.35, .45, 1), opacity .2s; }
.rail-glow::before { content: ''; position: absolute; right: -12px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px 0 0 4px; background: var(--t-rail); }
@keyframes tabPop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: none; } }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar h1 { margin: 0; font: 700 22px/1.2 var(--title-font); color: var(--ink); white-space: nowrap; }
body.is-home .topbar { border-bottom: 0; padding-bottom: 0; }
body.is-home .topbar h1 { display: none; }
.gsearch { position: relative; flex: 1; max-width: 760px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--t-rail); border-radius: 12px; padding: 0 12px; height: 42px; color: var(--accent); }
.gsearch > svg { width: 18px; height: 18px; flex: none; }
.gsearch input, .gsearch input:not([type=checkbox]):focus { flex: 1; border: 0 !important; background: none; padding: 0; height: 100%; box-shadow: none; }
.gsearch { border: 1.5px solid var(--field-line); }
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gsearch kbd { font: 12px/1 "Segoe UI", sans-serif; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; }
.gs-list { position: absolute; top: calc(100% + 6px); right: 0; left: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; max-height: 420px; overflow-y: auto; }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: right; color: var(--ink); }
.gs-item.on, .gs-item:hover { background: var(--accent-soft); }
.gs-item .k { font-size: 11px; color: var(--muted); margin-right: auto; }
.gs-empty { padding: 10px; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
/* Many buttons in the top bar (البنوك والشيكات …): the search box gives up room so nothing runs off the window's edge */
.gsearch { min-width: 140px; }
.gsearch input { min-width: 0; width: 100%; }
.tb-bell { position: relative; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 6px; border-radius: 10px; }
.tb-bell svg { width: 24px; height: 24px; display: block; }
.tb-bell:hover { background: var(--accent-soft); }
.bell-n { position: absolute; top: 0; left: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--t-avatar); color: #fff; display: grid; place-items: center; font: 700 18px/1 var(--title-font); }
.content { padding: 18px 24px 40px; overflow-y: auto; flex: 1; }
.content.enter { animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Home page */
.hm { display: grid; gap: 16px; }
.hm-hello { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.hm-hello h2 { margin: 0; font: 700 26px/1.3 var(--title-font); }
.hm-hello .d { color: var(--muted); }
.hm-rates { color: var(--accent); }
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.hm-kpi { border-radius: 14px; padding: 16px 18px; color: #fff; display: grid; gap: 2px; animation: secIn .45s both; }
.hm-kpi .l { color: rgba(255, 255, 255, .78); }
.hm-kpi .v { font: 800 30px/1.25 var(--title-font); }
.hm-kpi .s { font-size: 13px; color: rgba(255, 255, 255, .9); }
.hm-quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.hm-quick button { border: 0; border-radius: 14px; background: var(--t-quick-bg); color: var(--t-quick-ink); padding: 16px 8px; display: grid; justify-items: center; gap: 8px; cursor: pointer; font: inherit; font-size: 15px; transition: transform .2s, background .2s; }
.hm-quick button svg { width: 26px; height: 26px; }
.hm-quick button:hover { background: var(--t-quick-hover); transform: translateY(-3px); }
.hm-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.hm-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.hm-card h3 { margin: 0; font: 700 18px/1.4 var(--title-font); display: flex; align-items: baseline; gap: 10px; }
.hm-card h3 small { margin-right: auto; font: 400 13px/1.4 inherit; color: var(--muted); }
.hm-card h3 button { margin-right: auto; border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; }
.hm-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 200px; border-bottom: 1px solid var(--line); margin-top: 14px; }
.hm-chart .g { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; flex: 1; }
.hm-chart .bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.hm-chart .bar { width: 22px; border-radius: 5px 5px 0 0; min-height: 2px; transform-origin: bottom; animation: barUp .7s cubic-bezier(.2, .9, .3, 1) both; }
.hm-chart .bar.s { background: var(--t-chart-s); }
.hm-chart .bar.p { background: var(--t-chart-p); }
.hm-x { display: flex; justify-content: space-around; color: var(--muted); padding-top: 6px; }
.hm-x span { flex: 1; text-align: center; }
.hm-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 6px; }
.hm-sum > div { background: var(--bg, rgba(24, 95, 165, .06)); border-radius: 10px; padding: 8px 12px; display: grid; }
.hm-sum span { font-size: 12px; color: var(--muted); }
.hm-sum b { font-size: 19px; font-weight: 600; }
.hm-sum .pos { color: #0f6e56; } .hm-sum .neg { color: #a32d2d; }
.hm-svg { position: relative; margin-top: 6px; }
.hm-svg svg { width: 100%; height: auto; display: block; }
.hm-svg .gl { stroke: var(--line); stroke-width: 1; } .hm-svg .gl.base { stroke-width: 1.5; }
.hm-svg .ax { fill: var(--muted); font-size: 11px; }
.hm-svg .bs { fill: var(--t-chart-s); } .hm-svg .bp { fill: var(--t-chart-p); }
.hm-svg .bs, .hm-svg .bp { transform-box: fill-box; transform-origin: bottom; animation: barUp .7s cubic-bezier(.2, .9, .3, 1) both; }
.hm-svg .ln { fill: none; stroke: var(--t-chart-l); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hm-svg .dt { fill: var(--card); stroke: var(--t-chart-l); stroke-width: 2.5; }
.hm-svg .hit { fill: transparent; cursor: default; }
.hm-svg .hit:hover, .hm-svg .hit:focus { fill: rgba(24, 95, 165, .07); outline: none; }
.hm-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--t-side); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; line-height: 1.6; white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 2; }
.hm-tip.on { opacity: 1; }
.th-page > p { margin: 0 0 14px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.th-card { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 10px; cursor: pointer; text-align: start; display: grid; gap: 10px; transition: transform .15s, border-color .15s; }
.th-card:hover { transform: translateY(-2px); border-color: var(--field-line); }
.th-card.sel { border: 2px solid var(--accent); padding: 9px; }
.th-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.th-name { display: flex; justify-content: space-between; align-items: baseline; } .th-name small { color: var(--muted); }
.th-mini { display: flex; height: 104px; border-radius: 9px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); }
.th-rail { width: 28px; display: flex; flex-direction: column; gap: 6px; align-items: center; padding-top: 9px; }
.th-rail i { width: 15px; height: 15px; border-radius: 5px; display: block; }
.th-pg { flex: 1; padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.th-k { display: flex; gap: 5px; } .th-k b { flex: 1; height: 24px; border-radius: 6px; display: block; }
.th-c { flex: 1; border-radius: 6px; display: flex; align-items: flex-end; gap: 4px; padding: 5px; }
.th-c u { flex: 1; border-radius: 2px 2px 0 0; display: block; }
.hm-legend { display: flex; gap: 18px; color: var(--muted); margin-top: 8px; }
.hm-legend i.line { height: 3px; border-radius: 2px; width: 16px; vertical-align: middle; }
.hm-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
@keyframes barUp { from { transform: scaleY(0); } to { transform: none; } }
.hm-list { margin-top: 8px; }
.hm-li { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 2px; font: inherit; color: var(--ink); text-align: right; }
button.hm-li { cursor: pointer; transition: background .15s, padding .2s; }
button.hm-li:hover { background: var(--soft); padding-right: 8px; }
.hm-li .dot { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid currentColor; flex: none; }
.hm-li b { margin-right: auto; font-size: 18px; }
.hm-li .t { color: var(--muted); min-width: 90px; }
.hm-li .amt { min-width: 80px; text-align: left; font-weight: 700; }
.hm-badge { font-size: 13px; border-radius: 7px; padding: 1px 9px; flex: none; }
.hm-badge.blue { background: #cfe2f8; color: #0c447c; } .hm-badge.green { background: #d6f0dd; color: #27500a; }
.hm-badge.purple { background: #e4e2fb; color: #3c3489; } .hm-badge.amber { background: #faeeda; color: #633806; } .hm-badge.gray { background: var(--soft-2); color: var(--muted); }
@media (max-width: 1100px) { .hm-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-row { grid-template-columns: 1fr; } }

/* Section pages: every screen of a section, in cards (as the site's تعريفات page) */
.sec-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; }
.sec-head .chip { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--tab); }
.sec-head .chip svg { width: 24px; height: 24px; }
.sec-head .sub { color: var(--muted); font-size: 13px; }
.sec-head input { margin-right: auto; width: 240px; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: stretch; }
.sec-card.wide { grid-column: 1 / -1; }
.sec-card.wide ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.sec-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; border-top: 3px solid var(--tab); animation: secIn .4s both; transition: transform .2s, border-color .2s; }
.sec-card:hover { transform: translateY(-2px); border-color: var(--tab); }
.sec-card h3 { margin: 0; padding: 12px 16px 10px; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font: 700 22px/1.1 var(--title-font); color: var(--tab); }
.sec-card h3 span { margin-right: auto; font: 400 12px/1 "Segoe UI", Tahoma, sans-serif; color: var(--muted); }
.sec-card ul { list-style: none; margin: 0; padding: 0 0 8px; }
.sec-card li button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: right; padding: 7px 16px; cursor: pointer; color: var(--ink); transition: background .15s, padding .2s, color .15s; }
.sec-card li button::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tab); opacity: .55; flex: none; }
.sec-card li button:hover, .sec-card li button:focus-visible { background: var(--soft); color: var(--tab); padding-right: 22px; outline: none; }
.sec-card li button mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
@keyframes secIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #b9c8da; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 3px 7px; border-radius: 6px; }
.icon-btn:hover { background: var(--paper); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 6px; }
input, select, textarea { border: 1px solid var(--line); background: var(--input); border-radius: 7px; padding: 6px 9px; outline: none; min-width: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { border: 1.5px solid var(--field-line); color: var(--field-ink); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #6b7f96; opacity: 1; }
input[readonly], textarea[readonly] { border: 1px dashed var(--ro-line) !important; background: var(--ro-bg); color: var(--ro-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.mini { padding: 1px 4px; font-size: 12px; }
textarea { resize: vertical; min-height: 54px; }
.inline { display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid.c1 { grid-template-columns: 1fr; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 6px 0; }
.checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* Document toolbar */
.toolbar-doc { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; padding: 8px 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(10, 37, 64, .06), 0 4px 14px rgba(10, 37, 64, .05); }
.tb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 11px; cursor: pointer; font-size: 13.5px; color: var(--ink); transition: background .15s, color .15s; }
.tb .ico { width: 17px; height: 17px; flex: none; }
.tb:hover { background: var(--accent-soft); color: var(--accent); }
.tb:disabled { opacity: .35; cursor: default; background: none; color: var(--muted); }
/* Buttons of one purpose joined in a single framed group */
.tb-grp { display: inline-flex; border: 1.5px solid var(--field-line); border-radius: 10px; overflow: hidden; background: var(--card); }
.tb-grp .tb + .tb { border-inline-start: 1px solid #c9d4e1; }
.tb-grp.nav .tb { padding: 6px 9px; }
/* حفظ: the one button that stands out */
.tb.tb-save { background: linear-gradient(#2373e6, #1b64d1); color: #fff; font-weight: 700; font-size: 14.5px; padding: 8px 22px; border-radius: 10px;
  box-shadow: 0 2px 6px rgba(27, 100, 209, .35), inset 0 1px 0 rgba(255, 255, 255, .18); letter-spacing: .2px; }
.tb.tb-save .ico { width: 19px; height: 19px; }
.tb.tb-save:hover { background: linear-gradient(#1b64d1, #1557b8); color: #fff; box-shadow: 0 3px 10px rgba(27, 100, 209, .45); }
.tb.tb-save:active { transform: translateY(1px); }
/* إلغاء / حذف: at the far end, in red */
.tb-gap { flex: 1; }
.tb.tb-danger { border: 1.5px solid #e9a99c; border-radius: 10px; color: var(--danger); }
.tb.tb-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Document card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.doc-card { padding: 16px 18px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.doc-grid .wide { grid-column: span 2; }
/* بطاقة الزبون: four even columns in every part of the card, so the boxes line up from one section to the next */
.doc-grid.cust-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .doc-grid.cust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc-grid.cust-grid input:not([type=checkbox]):not([type=radio]), .doc-grid.cust-grid select { height: 38px; }
.last-no { float: left; font-weight: 500; color: var(--accent); font-size: 12px; }
.last-no b { font-weight: 700; }
.more-toggle { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 8px 0 4px; font-size: 13px; }
.more-toggle::before { content: '▾ '; }
.more-toggle.open::before { content: '▴ '; }
.more { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 10px; }
.locked input, .locked select, .locked textarea { background: var(--soft-2); }
.status { display: inline-block; padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; text-align: center; }
.status.new { background: var(--accent-soft); color: var(--accent); }
.status.posted { background: var(--blue-soft); color: var(--blue); }
.status.cancelled { background: var(--danger-soft); color: var(--danger); }
h4.sec { margin: 18px 0 6px; font-size: 14px; color: var(--side); }
.sec-toggle { border: 0; background: none; font: inherit; font-weight: 700; color: var(--side); cursor: pointer; padding: 0; }
.sec-toggle::before { content: '▸ '; }

/* Account picker */
.acc-pick { display: grid; grid-template-columns: 120px auto 1fr; gap: 4px; align-items: center; }
.acc-pick .acc-name { background: var(--soft-2); color: var(--ink); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--soft); }
tbody tr:hover { background: #f3f7fc; }
tr.clickable { cursor: pointer; }
td.actions { white-space: nowrap; text-align: left; width: 1%; }
tfoot td { font-weight: 700; background: var(--soft); }
.table-wrap { overflow-x: auto; }
table.lines { margin-top: 6px; }
table.lines td { padding: 4px 5px; }
table.lines input, table.lines select { width: 100%; padding: 5px 7px; }
table.lines .acc-pick { grid-template-columns: 110px auto 1fr; }
/* سند قيد: each line row carries "acc-pick" for the account search; it stays a table row, not a grid. */
table.lines tr.acc-pick { display: table-row; }
table.lines.narrow { max-width: 460px; }
/* Item card formula table: narrower material name, wider warehouse/unit so their text is readable. */
table.lines.fm th.fm-name { width: 240px; max-width: 260px; }
table.lines.fm th.c-fmu { width: 100px; min-width: 100px; }
table.lines.fm th.c-fmw { width: 170px; min-width: 170px; }
/* Item card «بيان التكلفة» table: wider so the statement and the expense name are readable. */
table.lines.narrow.fm-ex { max-width: 760px; }
table.lines.fm-ex th.fm-st { width: 240px; }
table.lines.fm-ex th.fm-am { width: 110px; }
table.lines.fm-ex .acc-pick { grid-template-columns: 80px auto 1fr; }
table.lines th.c-cur { min-width: 110px; }
table.lines th.c-bank { min-width: 130px; }
table.lines th.c-in { min-width: 80px; }
table.lines th.c-rate { width: 64px; }
table.lines th.c-main { width: 84px; }
.c-n { width: 34px; } .c-code { width: 120px; } .c-sel { width: 120px; } .c-qty { width: 80px; } .c-price { width: 110px; } .c-total { width: 110px; } .c-x { width: 34px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.neg { color: var(--danger); }
.pick-table td { padding: 7px 10px; }

/* Footer */
.doc-foot { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.foot-grid .wide { grid-column: span 2; }
.foot-grid .grand input { font-size: 17px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.cur-totals { grid-column: span 2; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.cur-totals div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.cur-totals .grand { border: 0; font-weight: 700; color: var(--accent); }

.muted { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); }
.num-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.num-grid span { font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.num-grid span.used { background: #e3eaf2; color: var(--muted); text-decoration: line-through; }
.rep-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.rep-link { text-align: right; border: 1px solid var(--line); background: var(--card); padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.rep-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rep-note { padding: 10px 14px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.rep-table tr.bold td { font-weight: 700; background: var(--soft); }
tr.sel-row td { background: var(--accent-soft); }
.it-head { display: grid; grid-template-columns: 100px minmax(220px, 1fr) 160px 190px; gap: 10px 14px; align-items: end; }
.it-head .checks { padding-bottom: 8px; white-space: nowrap; }
.it-upd { margin-top: 6px; font-size: 12px; color: var(--muted); }
.it-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.it-cards.it-row2 { grid-template-columns: 2fr 1fr; margin-top: 12px; align-items: start; }
.it-card { border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 10px 14px 14px; background: #fff; }
.it-open table.lines input:not([type=hidden]) { height: 39px; }
.it-open .it-upd { margin-top: 8px; font-size: 13px; }
.it-card h4 { margin: 0 0 8px; font-size: 14px; color: var(--side); }
.it-card .doc-grid { grid-template-columns: minmax(0, 1fr); }
.it-cards.it-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.it-prod { margin-top: 12px; }
.it-prod[hidden] { display: none; }
.it-prod .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.it-sub { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--side); }
@media (max-width: 900px) { .it-cards.it-two, .it-prod .doc-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .it-head { grid-template-columns: 1fr 1fr; } .it-cards, .it-cards.it-row2 { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.filters { padding: 10px 0; border-bottom: 1px dashed var(--line); margin-bottom: 8px; }
.tabs .tab { white-space: nowrap; }
.tabs { flex-wrap: wrap; row-gap: 2px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 16px 0 10px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Tree */
.tree-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.tree { padding: 12px 14px; max-height: calc(100vh - 140px); overflow: auto; }
.tree ul { list-style: none; margin: 0; padding-right: 18px; }
.tree > ul { padding: 0; }
.tree li { padding: 2px 0; }
.tree li > ul { display: none; }
.tree li.open > ul { display: block; }
.tree .tw { display: inline-block; width: 16px; cursor: pointer; color: var(--muted); transition: transform .12s; }
.tree li.open > .tw { transform: rotate(90deg); }
.tree a { cursor: pointer; padding: 1px 6px; border-radius: 5px; }
.tree a:hover { background: var(--paper); }
.tree a.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree li.inactive > a { color: var(--muted); text-decoration: line-through; }

/* Home */
.quick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); cursor: pointer; }
.quick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick .q-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--paper); }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 260px; padding: 10px 6px 0; border-bottom: 1px solid var(--line); margin-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.bar { width: 13px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.s, .lg.s { background: var(--accent); }
.bar.e, .lg.e { background: var(--amber); }
.bar.p, .lg.p { background: var(--plum); }
.chart-x { font-size: 11px; color: var(--muted); padding-top: 6px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }

/* Modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 24, 44, .5); display: grid; place-items: center; z-index: 50; }
.modal { background: var(--card); border-radius: 12px; width: min(620px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: min(900px, 94vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; }
.toast { position: fixed; bottom: 24px; left: 24px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 60; box-shadow: var(--shadow); max-width: 520px; }
.toast.error { background: var(--danger); }

/* Print */
#print-area { display: none; }
.doc { font-size: 13px; color: #000; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 14px; }
.doc-head h2 { margin: 0 0 4px; }
.doc-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; margin-bottom: 14px; }
.doc table th { background: #eee; color: #000; }
.doc .totals { width: 320px; margin-right: auto; margin-top: 12px; }
.doc .totals div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #999; }
.doc .totals .grand { font-weight: 700; font-size: 16px; border: 0; }
.doc .sign { display: flex; justify-content: space-between; margin-top: 60px; }
/* Report result: a page preview (A4 width) with its header, under a bar of print / PDF / Excel buttons */
.rep-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.rep-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.rep-paper { background: #fff; color: #000; max-width: 210mm; margin: 0 auto 24px; padding: 12mm; box-shadow: 0 2px 14px rgba(15, 40, 80, .14); border-radius: 4px; overflow-x: auto; }
.rep-paper .head-img { margin-bottom: 6px; }
.rep-paper .custom-head img { max-width: 100%; }
.rep-paper .doc.shaded tbody tr:nth-child(even) td { background: #eee; }
.rep-paper .rep-table { width: 100%; }
/* print preview window: the paper is a whole A4 sheet */
body.print-window .rep-paper { width: 210mm; max-width: none; min-height: 297mm; }
.rep-paper:has(> .is-report) { padding-top: 10mm; }
.pv-pages { font-size: 13px; color: var(--muted); }
.pv-pages.warn { color: #b23b3b; font-weight: 600; }
/* one-page reports: tighter rows */
.fit-a4 .bs-table td, .fit-a4 .rep-table td { padding-top: 4px; padding-bottom: 4px; }
/* the balance sheet fills the paper: the sides stretch down to the page and the grand totals sit at the bottom */
.fit-a4 .bs-sheet { min-height: 200mm; }
@media print {
  @page { size: A4; margin: 12mm; }
  /* التقارير: الهامش العلوي 10 مم بدل 12 (ترتفع الترويسة)؛ باقي السندات كما هي. */
  @page report-page { size: A4; margin: 10mm 12mm 12mm; }
  #print-area:has(.is-report) { page: report-page; }
  body { background: #fff; }
  .app, .modal-backdrop, .toast { display: none !important; }
  #print-area { display: block; }
}

/* users and login */
.perm-grid { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.perm-grid th, .perm-grid td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: center; }
.perm-grid td:first-child { text-align: right; }
.perm-grid tr.grp th { background: var(--soft-2); text-align: right; }
.perm-grid thead th { position: sticky; top: 0; background: var(--paper); font-weight: 600; }
.rep-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rep-perm { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.rep-perm label { display: block; padding: 2px 0; }
.login-overlay { position: fixed; inset: 0; background: var(--side); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-box { width: 340px; display: flex; flex-direction: column; gap: 10px; }
.login-box h2 { margin: 0; color: var(--accent); }
.login-box h3 { margin: 0 0 6px; }
.login-err { color: #b23b3b; }
.tb[disabled] { opacity: .45; cursor: not-allowed; }

/* report options like the site: remember / defaults, checkbox list, detail rows */
.rep-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rep-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rep-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rep-head { grid-column: 1 / -1; font-weight: 600; color: var(--accent); margin-top: 6px; }
.rep-table tr.sub td { font-size: 12px; color: var(--muted); background: var(--soft); padding-top: 2px; padding-bottom: 2px; }
select[multiple] { min-height: 64px; }
.rep-sub { margin: 14px 12px 6px; color: var(--accent); }

/* balance sheet: two sides, theme colours (blue header, amber group bars, danger for negatives) */
.bs-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; padding: 0 12px 12px; }
.bs-side { display: flex; flex-direction: column; min-width: 0; --bs-head: #185FA5; --bs-foot: #0C447C; border: 1px solid var(--bs-head); }
.bs-side.bs-liab { --bs-head: #534AB7; --bs-foot: #26215C; }
.bs-fill { flex: 1 1 auto; background: repeating-linear-gradient(135deg, var(--card) 0 6px, var(--soft) 6px 12px); }
.bs-sheet tr.sec-0 { --sg-bg: #FAC775; --sg-fg: #633806; --st-bg: #FAEEDA; }
.bs-sheet tr.sec-1 { --sg-bg: #9FE1CB; --sg-fg: #085041; --st-bg: #E1F5EE; }
.bs-sheet tr.sec-2 { --sg-bg: #F5C4B3; --sg-fg: #712B13; --st-bg: #FAECE7; }
.bs-sheet tr.sec-3 { --sg-bg: #CECBF6; --sg-fg: #3C3489; --st-bg: #EEEDFE; }
.bs-sheet tr.sec-profit { --sg-bg: #C0DD97; --sg-fg: #27500A; --st-bg: #EAF3DE; }
@media print { .bs-plus { visibility: hidden; } }
.bs-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--card); }
.bs-table th { background: var(--bs-head, var(--blue)); color: #fff; font-weight: 600; padding: 8px 10px; text-align: start; }
.bs-table th:last-child, .bs-table td:last-child { width: 34%; text-align: end; }
.bs-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.bs-table td.num { direction: ltr; font-variant-numeric: tabular-nums; }
.bs-group td { background: var(--sg-bg, var(--amber-soft)); color: var(--sg-fg, #6b4510); font-weight: 700; }
.bs-total td { background: var(--st-bg, var(--soft-2)); color: var(--sg-fg, inherit); font-weight: 700; }
.bs-row td:first-child { padding-inline-start: calc(10px + var(--d, 0) * 18px); }
.bs-row.has-k { cursor: pointer; }
.bs-row.has-k:hover td { background: var(--accent-soft); }
.bs-kid td { background: var(--soft); font-size: 13px; }
.bs-plus { display: inline-block; width: 16px; margin-inline-end: 6px; color: var(--accent); font-weight: 700; text-align: center; }
.bs-row.open > td > .bs-plus { visibility: visible; }
.bs-table tr.neg td:last-child { background: var(--danger); color: #fff; }
.bs-table tfoot td { background: var(--bs-foot, var(--side)); color: #fff; font-weight: 700; padding: 8px 10px; }
/* income statement: same look as the balance sheet (group bars, total rows, final bar) */
.content .rep-table tbody tr.is-group td { background: var(--amber-soft); color: #6b4510; font-weight: 700; }
.content .rep-table tbody tr.is-total td { background: var(--soft-2); font-weight: 700; }
.content .rep-table tbody tr.is-final td { background: var(--side); color: #fff; font-weight: 700; }
.content .rep-table tbody tr.is-group:hover td, .content .rep-table tbody tr.is-total:hover td { background-color: inherit; }
@media print { .rep-table tr.is-group td, .rep-table tr.is-final td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 900px) { .bs-sheet { grid-template-columns: 1fr; } }
@media print { .bs-sheet { grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; } .bs-table th, .bs-table tfoot td, .bs-group td, .bs-total td, .bs-fill, .bs-table tr.neg td:last-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* invoice page additions */
.rep-table td.loss { background: #c0392b; color: #fff; }
.mini-chk { font-weight: normal; font-size: 12px; margin-inline-start: 6px; }
td.nowrap { white-space: nowrap; }

/* print options (خيارات الطباعة) */
#print-area .custom-head img { max-width: 100%; }
#print-area .doc-head.small { font-size: 11px; }
#print-area .words { margin: 8px 0; font-weight: bold; }
#print-area .doc-foot-print div { margin: 3px 0; }
#print-area .print-notes { margin-top: 10px; white-space: pre-wrap; border-top: 1px dashed #999; padding-top: 6px; }
#print-area .print-tail { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
#print-area .rep-print-foot { margin-top: 12px; font-size: 11px; text-align: center; color: #555; }
#print-area .doc.shaded tbody tr:nth-child(even) td { background: #eee; }
tr.locked-row td { background: var(--soft-2); }

/* The site's document layout (فواتير و سندات): rows of label + value cells */
.hs { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.hs + .hs, .hs-more > .hs { margin-top: 6px; }
.hs-row { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); }
.hs-row:first-child { border-top: 0; }
.hs-cell { display: flex; align-items: stretch; flex: 1 1 auto; min-width: 0; border-inline-start: 1px solid var(--line); }
.hs-cell:first-child { border-inline-start: 0; }
.hs-cell > .l { background: var(--soft-2); padding: 6px 10px; white-space: nowrap; display: flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
.hs-cell > .v { padding: 4px 8px; display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.hs-cell.grow { flex: 3 1 320px; }
.hs-cell.fix { flex: 0 0 auto; }
.hs-cell > .v > input:not([type=checkbox]), .hs-cell > .v > select { min-width: 0; }
/* one height (34px, like the line tables) for every box, drop-down and button in the invoice header */
.hs-cell .v input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .hs-cell .v select, .hs-cell .v .btn:not(.icon-btn) { height: 34px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 1.2; }
.hs-cell input.num-sm { width: 110px; }
.hs-cell input[type=date] { width: 150px; }
.hs-chk { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.hs-cell .acc-pick { flex: 1; min-width: 260px; }
.acc-pick.icons-first { grid-template-columns: auto 120px 1fr; }
.acc-icons { display: inline-flex; }
.hs-fold { display: block; margin: 4px 0 4px auto; margin-inline-start: 0; border: 0; background: none; color: var(--blue); font-size: 16px; cursor: pointer; padding: 2px 8px; }
.hs-more { margin-bottom: 8px; }
.hs-sec { display: flex; align-items: center; gap: 6px; margin: 14px 0 4px; font-weight: 700; color: var(--side); }
.hs-sec .hs-fold { margin: 0; }
.doc-card table.lines thead th { background: var(--side); color: #fff; font-weight: 600; font-size: 13px; text-align: center; }
.doc-card table.lines tfoot td { background: var(--soft-2); }
.doc-card table.lines td.ln { text-align: center; color: var(--muted); }
.doc-card table.lines td.item-no { text-align: center; color: var(--muted); font-size: 12px; }
.line-ico { display: inline-flex; gap: 2px; }
.ct-result { min-width: 60px; font-weight: 700; }

/* Line icons in documents */
.icon-btn { display: inline-grid; place-items: center; color: var(--accent); padding: 4px; }
.icon-btn .ico { width: 18px; height: 18px; display: block; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { color: var(--muted); }
.btn .ico { width: 16px; height: 16px; }
.rep-open .ico { width: 16px; height: 16px; }
#print-area .no-print, #print-area .rep-open { display: none; }

/* Compact header of the lines table (one row, no wrapping) */
.doc-card table.lines thead th { padding: 7px 6px; line-height: 1.3; white-space: nowrap; vertical-align: middle; height: 38px; }
.doc-card table.lines thead th .mini-chk { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; font-size: 11px; font-weight: 400; vertical-align: middle; }
.doc-card table.lines thead th .mini-chk input { width: 13px; height: 13px; margin: 0; }
.doc-card table.lines thead th .th-ico { color: #b5d4f4; padding: 1px 3px; vertical-align: middle; }
.doc-card table.lines thead th .th-ico .ico { width: 15px; height: 15px; }
.doc-card table.lines thead th .th-ico:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Type-ahead list */
.suggest { position: fixed; z-index: 80; max-height: 320px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 37, 64, .16); padding: 5px; direction: rtl; animation: sgIn .14s ease-out; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.sg-item.on, .sg-item:hover { background: var(--accent-soft); }
.sg-no { min-width: 82px; color: var(--muted); font-size: 12px; text-align: right; }
.sg-name { flex: 1; color: var(--ink); }
.sg-sub { color: var(--muted); font-size: 12px; }
.sg-empty { padding: 9px 10px; color: var(--muted); font-size: 13px; }
@keyframes sgIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.acc-pick .acc-name { background: var(--input); color: var(--ink); }

/* Saving window */
.saving { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(8, 24, 44, .28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.saving.show { opacity: 1; pointer-events: auto; }
.saving-box { background: var(--card); border-radius: 18px; padding: 26px 34px; min-width: 260px; display: grid; justify-items: center; gap: 6px; box-shadow: 0 20px 50px rgba(8, 24, 44, .3);
  transform: scale(.92); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.saving.show .saving-box { transform: none; }
.saving-mark { width: 64px; height: 64px; position: relative; margin-bottom: 6px; }
.saving-mark .spin { position: absolute; inset: 4px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.saving-mark .tick { position: absolute; inset: 0; width: 64px; height: 64px; opacity: 0; }
.saving-mark .tick circle { fill: #0f6e56; }
.saving-mark .tick path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.saving.ok .spin { opacity: 0; }
.saving.ok .tick { opacity: 1; animation: tickPop .35s cubic-bezier(.3, 1.6, .5, 1); }
.saving.ok .tick path { animation: tickDraw .35s .12s ease-out forwards; }
.saving-t { font-size: 17px; }
.saving.ok .saving-t { color: #0f6e56; }
.saving-s { color: var(--muted); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tickPop { from { transform: scale(.5); } to { transform: none; } }
@keyframes tickDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .saving.ok .tick path { stroke-dashoffset: 0; } }

/* Top bar: person picture at the far right, then the back button */
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; padding: 0; border: 2px solid #b5d4f4; background: #cfe2f8; overflow: hidden; cursor: pointer; display: grid; place-items: center; transition: border-color .2s, transform .2s; }
.avatar:hover { border-color: var(--accent); transform: scale(1.04); }
.avatar svg, .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.nav-back { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--accent); display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s; }
.nav-back svg { width: 20px; height: 20px; }
.nav-back:hover { background: var(--accent-soft); transform: translateX(3px); }
body.is-home .topbar h1 { display: none; }

/* Unsaved changes window */
#unsaved, #closebox { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(8, 24, 44, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
#unsaved.show, #closebox.show { opacity: 1; pointer-events: auto; }
#closebox { z-index: 120; }
#closebox.show .uns-box { transform: none; }
/* نافذة الإغلاق: باب يُفتح وسهم خروج، وسطر آخر نسخة، وتنبيه ما لم يُحفظ. */
.cb-art .fr { fill: #fff; stroke: #185fa5; stroke-width: 2.5; }
.cb-art .dr { fill: #85b7eb; stroke: #185fa5; stroke-width: 2; stroke-linejoin: round; transform-origin: 20px 34px; animation: cbDoor 2s ease-in-out infinite; }
.cb-art .kn { fill: #185fa5; }
.cb-art .ar { fill: none; stroke: #c98a2b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: cbArrow 2s ease-in-out infinite; }
@keyframes cbDoor { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.7); } }
@keyframes cbArrow { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.cb-info { display: flex; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 10px; padding: 8px 12px; margin: -6px 0 10px; font-size: 13px; color: var(--muted); }
.cb-info b { color: var(--ink); }
.cb-warn { background: var(--amber-soft); color: #633806; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.6; text-align: start; }
.cb-warn b { color: #412402; }
#closebox .btn.ghost { border-color: transparent; background: none; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .cb-art .dr, .cb-art .ar { animation: none; } }
.uns-box { width: min(440px, 92vw); background: var(--card); border-radius: 20px; padding: 26px 28px 22px; text-align: center; box-shadow: 0 24px 60px rgba(8, 24, 44, .35); transform: translateY(14px) scale(.96); transition: transform .32s cubic-bezier(.3, 1.4, .5, 1); }
#unsaved.show .uns-box { transform: none; }
.uns-art { position: relative; width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; background: #e1ecf8; display: grid; place-items: center; }
.uns-art svg { width: 58px; height: 58px; }
.uns-art .pg { fill: #fff; stroke: #185fa5; stroke-width: 2.5; }
.uns-art .ln { stroke: #85b7eb; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.uns-art .pen path { fill: #c98a2b; stroke: #633806; stroke-width: 1.5; stroke-linejoin: round; }
.uns-art .pen { transform-origin: 46px 44px; animation: penWrite 1.4s ease-in-out infinite; }
.uns-art .dot { position: absolute; top: 6px; left: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); border: 3px solid var(--card); animation: dotPulse 1.4s ease-in-out infinite; }
.uns-box h3 { margin: 4px 0 6px; font-size: 20px; }
.uns-box p { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.uns-box p b { color: var(--ink); }
.uns-actions { display: grid; gap: 8px; }
.uns-actions .btn { justify-content: center; padding: 10px 14px; font-size: 15px; }
.uns-actions .btn.danger { border-color: var(--danger-soft); background: var(--danger-soft); }
@keyframes penWrite { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg) translate(-2px, 1px); } }
@keyframes dotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* Search window filters */
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.pick-bar input[type=search] { flex: 1 1 220px; }
.seg { display: inline-flex; background: var(--soft-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--card); color: var(--accent); font-weight: 700; box-shadow: 0 1px 3px rgba(10, 37, 64, .15); }
.pick-count { color: var(--muted); font-size: 13px; margin-right: auto; }
.pick-table tr.inactive td { color: var(--muted); }
.tag-off { font-size: 11px; background: var(--danger-soft); color: var(--danger); border-radius: 6px; padding: 1px 6px; }
.gs-item mark { background: #fde9b8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* Reports on screen: alternating row colours, and the row under the mouse stands out */
.content .rep-table tbody tr:not(.bold):not(.sub):nth-child(even) td { background: #e8f0fa; }
.content .rep-table tbody tr:not(.bold):not(.sub):nth-child(odd) td { background: var(--card); }
.content .rep-table tbody tr:not(.sub):not(.zz):hover td { background: #b9d6f6; }
.content .rep-table tbody tr:not(.sub):hover td:first-child { box-shadow: inset -4px 0 0 var(--accent); }
.content .rep-table tbody tr:not(.sub) td { transition: background-color .12s; }

/* Report tables on screen: narrow number column, one-line name, one-line headers; number and name stay pinned while months scroll */
.rep-screen .rep-fit { --x: 0px; --no: 46px; }
.rep-screen .rep-fit.has-x { --x: 38px; }
.rep-screen .rep-fit.no-no { --no: 0px; }
.rep-screen .rep-fit th { white-space: nowrap; }
.rep-screen .rep-fit th.c-x { width: var(--x); min-width: var(--x); max-width: var(--x); padding-inline: 4px; }
.rep-screen .rep-fit .c-no { width: var(--no); min-width: var(--no); max-width: var(--no); padding-inline: 4px; text-align: center; white-space: nowrap; }
.rep-screen .rep-fit .c-name { min-width: 150px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-screen .rep-fit.has-x .c-x, .rep-screen .rep-fit .c-no, .rep-screen .rep-fit .c-name { position: sticky; background-clip: padding-box; }
.rep-screen .rep-fit .c-x { right: 0; }
.rep-screen .rep-fit .c-no { right: var(--x); }
.rep-screen .rep-fit .c-name { right: calc(var(--x) + var(--no)); }
/* No cell breaks into two lines (a date like 2026-11-07 broke at its hyphens): the table scrolls sideways instead; long text is cut with … and shown in full on hover. */
.rep-screen .rep-fit td { white-space: nowrap; }
.rep-screen .rep-fit td:not(.c-name):not(.c-no) { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.rep-screen .rep-fit th.c-no, .rep-screen .rep-fit th.c-name, .rep-screen .rep-fit th.c-x { z-index: 2; }
.rep-screen .rep-fit td.c-x, .rep-screen .rep-fit td.c-no, .rep-screen .rep-fit td.c-name { z-index: 1; }
.rep-screen .rep-fit tfoot td.c-no, .rep-screen .rep-fit tfoot td.c-name, .rep-screen .rep-fit tfoot td.no-print { background: var(--soft); }

/* صورة الترويسة: controls beside a scaled A4 header preview (2 px = 1 mm) */
.hi-wrap { display: grid; grid-template-columns: minmax(260px, 1fr) 400px; gap: 18px; align-items: start; margin-bottom: 8px; }
.hi-controls { display: grid; gap: 10px; }
.hi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hi-row input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.hi-help { margin: 0; font-size: 12px; line-height: 1.7; }
.hi-preview { display: grid; gap: 6px; }
.hi-page { width: 400px; min-height: 170px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 14px 10px; box-shadow: var(--shadow); }
.hi-page #hi-box { width: 372px; }
.hi-page .head-img img { display: inline-block; max-width: 100%; }
.hi-empty { height: 50px; border: 2px dashed var(--line); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.hi-lines { margin-top: 10px; display: grid; gap: 6px; }
.hi-lines span { height: 6px; border-radius: 3px; background: var(--soft-2); }
.hi-lines span:nth-child(2) { width: 70%; } .hi-lines span:nth-child(3) { width: 45%; }
.custom-head:has(.head-img) { flex: 1 1 100%; }
.doc-head:has(.head-img) { flex-wrap: wrap; }
#print-area .head-img { margin-bottom: 6px; }
#print-area .custom-head .head-img img { max-width: 100%; }
@media (max-width: 1150px) { .hi-wrap { grid-template-columns: 1fr; } }

/* السنوات المالية */
.fy-table td { vertical-align: middle; }
.fy-table .fy-year { font-size: 18px; }
.fy-table tr.fy-current td { background: var(--accent-soft); }
/* السنوات المالية: خط أكبر وأوضح (يتبع حجم خط الجداول من الإعدادات) */
.fy-page .fy-table th { font-size: calc(var(--hd-s, var(--tb-s)) + 2px); padding: 12px 14px; color: var(--ink); }
.fy-page .fy-table td { font-size: calc(var(--tb-s) + 3px); padding: 14px; }
.fy-page .fy-table .fy-year { font-size: calc(var(--tb-s) + 6px); }
.fy-page .fy-table .status { font-size: calc(var(--tb-s) + 0px); padding: 4px 12px; }
.fy-page .fy-table .btn.small { font-size: calc(var(--tb-s) + 1px); padding: 7px 14px; }
.fy-page .fy-table .num { font-weight: 600; }
.fy-page .inline .btn { font-size: calc(var(--tb-s) + 1px); }

/* مركز الزبائن و الموردين */
.pc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 12px; }
.pc-bar input[type=search] { flex: 1 1 220px; max-width: 320px; }
/* إدارة المخزون: مربع رقم صغير، ثم البحث والمخزن والفئة بعرض واحد؛ عدسة البحث داخل المربع بدل النص. */
.pc-bar #sm-code, .pc-bar #sm-q, .pc-bar #sm-wh, .pc-bar #sm-kind, .pc-bar #sm-abc { box-sizing: border-box; height: 40px; }
.pc-bar #sm-code { flex: 0 0 90px; width: 90px; max-width: 90px; }
.pc-bar #sm-q, .pc-bar #sm-wh, .pc-bar #sm-kind, .pc-bar #sm-abc { flex: 0 1 200px; width: 200px; max-width: 200px; }
.pc-bar #sm-q { background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='7'/%3E%3Cpath d='m21 21-6-6'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 32px; }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chips button { border: 1.5px solid var(--field-line); background: var(--card); color: var(--ink); border-radius: 9px; padding: 4px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.pc-chips button .num { color: var(--muted); margin-inline-start: 3px; }
.pc-chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pc-chips button.on .num { color: #dce9fb; }
.pc-sum { margin-inline-start: auto; font-size: 13px; color: var(--muted); }
.pc-sum b { color: var(--ink); }
.pc-table th.sortable { cursor: pointer; user-select: none; }
.pc-table th.sorted { color: var(--accent); text-decoration: underline; }
.pc-table tr.inactive td { color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
.pc-tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 8px; white-space: nowrap; }
.pc-tag.red { background: #fcebeb; color: #791f1f; }
.pc-tag.amber { background: #faeeda; color: #633806; }
.pc-tag.blue { background: #e6f1fb; color: #0c447c; }
.pc-tag.gray { background: var(--soft-2); color: var(--muted); }
td.neg, b.neg, .num.neg { color: #a32d2d; }
b.pos { color: #0f6e56; }
tr.pc-due td { background: #fdf5e6; }
.pt-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; }
.pt-id { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pt-id h2 { margin: 0; font-size: 20px; }
.pt-code { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 16px; }
.pt-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pt-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.pt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pt-kpi { background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.pt-kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pt-kpi b { font-size: 19px; direction: ltr; text-align: right; }
.pt-kpi b small { font-size: 12px; color: var(--muted); }
.pt-age { display: flex; height: 26px; border-radius: 8px; overflow: hidden; font-size: 11.5px; color: #fff; margin: 4px 0; }
.pt-age span { display: flex; align-items: center; gap: 4px; padding: 0 8px; white-space: nowrap; overflow: hidden; min-width: 0; }
.pt-age .a-current { background: #1d9e75; } .pt-age .a-d30 { background: #378add; } .pt-age .a-d60 { background: #ba7517; } .pt-age .a-d90 { background: #a32d2d; }
.pt-note-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 12px; align-items: end; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.pt-note-form .wide { grid-column: 1 / -1; }
.pt-note-form .form-actions { margin: 0; }
.pt-notes { display: flex; flex-direction: column; gap: 6px; }
.pt-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.pt-note .b { flex: 1 1 240px; }
.pt-note.due { border-color: #ba7517; background: #fdf5e6; }
.pt-note.done { opacity: .6; }
.pt-note.done .b { text-decoration: line-through; }
.pt-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.pt-data div { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.pt-data span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pc-table td, .pc-table th, .pt-head ~ .card .rep-table td.num { white-space: nowrap; }

/* النقد والبنوك */
.ck-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ck { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
/* "> span": only the box's title, not the number inside <b> (money() wraps it in a span) */
.ck > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ck b { font-size: 20px; direction: ltr; text-align: right; }
.ck small { font-size: 12px; color: var(--muted); }
.ck.clickable { cursor: pointer; } .ck.clickable:hover { border-color: var(--accent); }
.ck.dark { background: #0a2540; border-color: #0a2540; } .ck.dark > span, .ck.dark small { color: #b9cce4; } .ck.dark b { color: #fff; }
.ck.alert { background: #fdf1ec; border-color: #f0997b; } .ck.alert b { color: #993c1d; }
.cash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .cash-grid { grid-template-columns: 1fr; } }
.cash-card { padding: 12px 14px; margin-bottom: 12px; }
.cash-card h3 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.cash-card .link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.cash-do { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cash-do:last-child { border-bottom: 0; }
.cash-do .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cash-do .tx { flex: 1; font-weight: 600; }
.cash-do .tx small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cash-acc { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 4px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.cash-acc:hover { background: var(--accent-soft); }
.cash-acc > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-acc b { white-space: nowrap; direction: ltr; }
.cash-acc b small { color: var(--muted); font-weight: 500; }
.cash-out { margin: 8px 0 0; font-size: 12.5px; }
.cash-menu { position: relative; display: inline-block; }
.cash-menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 37, 64, .18); padding: 8px; min-width: 230px; max-height: 70vh; overflow: auto; }
.cash-menu-list b { display: block; font-size: 12px; color: var(--muted); padding: 6px 8px 2px; }
.cash-menu-list button { display: block; width: 100%; text-align: right; border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.cash-menu-list button:hover { background: var(--accent-soft); color: var(--accent); }
.cash-acc > span { white-space: normal; overflow: visible; font-size: 13px; line-height: 1.5; }

/* صفحة قسم الزبائن / الموردين */
.ps { display: flex; flex-direction: column; gap: 12px; }
.ps-hero { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #1b64d1, #0c447c); color: #fff; box-shadow: 0 4px 16px rgba(12, 68, 124, .25); transition: transform .15s, box-shadow .15s; }
.ps-hero:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(12, 68, 124, .32); }
.ps-hero > .ic { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.ps-hero > .ic .ico { width: 28px; height: 28px; }
.ps-hero .tx b { display: block; font-size: 20px; }
.ps-hero .tx small { color: #cfe0f7; font-size: 13px; }
.ps-hero .st { margin-inline-start: auto; display: flex; gap: 26px; }
.ps-hero .st > span { text-align: center; }
.ps-hero .st b { display: block; font-size: 22px; direction: ltr; }
.ps-hero .st b.warn { color: #ffd8cc; }
.ps-hero .st small { color: #cfe0f7; font-size: 12px; }
.ps-hero .go { font-size: 26px; color: #cfe0f7; }
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ps-tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.ps-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.ps-tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ps-tile .ic .ico { width: 22px; height: 22px; }
.ps-tile b { display: block; font-size: 15px; color: var(--ink); }
.ps-tile small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ps-badge { display: inline-block; font-size: 11.5px; padding: 0 8px; border-radius: 9px; background: #faeeda; color: #633806; margin-inline-start: 4px; vertical-align: middle; }
.ps-rep { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.ps-rep h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.ps-rep h3 .ico { color: #185fa5; width: 19px; height: 19px; }
.ps-rg { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 14px; }
.ps-rg button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 8px 10px; border-radius: 9px; color: var(--ink); }
.ps-rg button:hover { background: var(--accent-soft); color: var(--accent); }
.ps-rg .ico { width: 18px; height: 18px; color: #378add; flex: none; }

/* قسم التقارير: المجموعات مربعات متساوية، وتقارير المجموعة المختارة تحتها */
.rp { display: flex; flex-direction: column; gap: 12px; }
.rp-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--field-line); border-radius: 12px; padding: 0 12px; height: 42px; color: var(--muted); }
.rp-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rp-search input, .rp-search input:not([type=checkbox]):focus { flex: 1; border: 0 !important; box-shadow: none; background: none; padding: 0; height: 100%; font-size: 14px; }
.rp-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .rp-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-g { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.rp-g:hover { border-color: var(--accent); }
.rp-g .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.rp-g .ic .ico { width: 21px; height: 21px; }
.rp-g b { display: block; font-size: 14.5px; color: var(--ink); line-height: 1.35; }
.rp-g small { font-size: 12px; color: var(--muted); }
.rp-g.on { background: var(--accent); border-color: var(--accent); }
.rp-g.on b, .rp-g.on small { color: #fff; }
.rp-g.on .ic { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }
.rp-panel { padding: 12px 14px; }
.rp-head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.rp-head .ico { width: 21px; height: 21px; }
.rp-head small { margin-inline-start: auto; font-weight: 400; font-size: 13px; color: var(--muted); }
.rp-list { columns: 2 260px; column-gap: 22px; }
.rp-item { all: unset; box-sizing: border-box; break-inside: avoid; display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--ink); }
.rp-item .ico { width: 17px; height: 17px; color: var(--c); flex: none; }
.rp-item:hover { background: var(--accent-soft); color: var(--accent); }
.rp-item mark { background: #fac775; color: inherit; border-radius: 3px; }
.rp-search .ico { width: 19px; height: 19px; flex: none; }

/* ---------- المستشار المحاسبي (renderer/js/advisor.js) ---------- */
.adv { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .adv { grid-template-columns: 1fr; } }
.adv-chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; overflow: hidden; }
.adv-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.adv-top .muted { font-size: 12.5px; }
.adv .av { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #eeedfe; color: #534ab7; display: inline-flex; align-items: center; justify-content: center; }
.adv .av svg { width: 17px; height: 17px; }
.adv .av.big { width: 52px; height: 52px; }
.adv .av.big svg { width: 28px; height: 28px; }
.adv-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--soft); }
.adv-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.adv-msg .b { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; line-height: 1.75; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.adv-msg.me { justify-content: flex-start; }
.adv-msg.me .b { background: #e6f1fb; border-color: #b5d4f4; color: #042c53; max-width: 80%; white-space: pre-wrap; }
.adv-msg.ai .b { flex: 1; }
.adv-msg.err .b { background: var(--danger-soft); border-color: #f0b8ad; color: #7a1f12; }
.adv-msg .b p { margin: 0 0 6px; }
.adv-msg .b h4 { margin: 10px 0 4px; font-size: 14.5px; color: var(--ink); }
.adv-msg .b h4:first-child { margin-top: 0; }
.adv-msg .b ul, .adv-msg .b ol { margin: 2px 0 8px; padding-inline-start: 22px; }
.adv-msg .b code { background: var(--soft); padding: 0 4px; border-radius: 4px; font-size: 12.5px; }
.adv-msg .b .table-wrap { margin: 6px 0 8px; overflow-x: auto; }
.adv-msg .b .rep-table { font-size: 13px; }
.adv-msg .meta { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.adv-link { border: 0; background: #eeedfe; color: #3c3489; border-radius: 6px; padding: 0 6px; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.adv-link:hover { background: #cecbf6; }
.adv-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.adv-wait .dots { display: inline-flex; gap: 3px; }
.adv-wait .dots i { width: 6px; height: 6px; border-radius: 50%; background: #534ab7; animation: adv-dot 1s infinite ease-in-out; }
.adv-wait .dots i:nth-child(2) { animation-delay: .15s; }
.adv-wait .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes adv-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .adv-wait .dots i { animation: none; opacity: .6; } }
.adv-hello { margin: auto; text-align: center; max-width: 560px; padding: 20px 8px; }
.adv-hello h3 { margin: 10px 0 4px; font-size: 18px; }
.adv-hello p { color: var(--muted); margin: 0 0 14px; line-height: 1.7; }
.adv-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.adv-suggest button { border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.adv-suggest button:hover { border-color: #534ab7; color: #3c3489; background: #eeedfe; }
.adv-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--card); align-items: flex-end; }
.adv-input textarea { flex: 1; resize: none; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; color: var(--field-ink); background: var(--input); max-height: 160px; }
.adv-input textarea:focus { outline: 2px solid #afa9ec; outline-offset: 0; border-color: #534ab7; }
.adv-setup { padding: 20px 22px; overflow-y: auto; line-height: 1.75; }
.adv-setup h3 { margin: 0 0 6px; }
.adv-setup ol { padding-inline-start: 22px; margin: 6px 0 12px; }
.adv-key { display: flex; gap: 8px; margin: 6px 0 12px; }
.adv-key input { flex: 1; direction: ltr; text-align: left; font-family: Consolas, monospace; }
.adv-health { padding: 12px 14px; max-height: calc(100vh - 150px); overflow-y: auto; }
.adv-health h3 { margin: 0; display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.adv-health > .muted { margin: 2px 0 10px; font-size: 12.5px; }
.adv-ok { padding: 14px; text-align: center; color: #0f6e56; background: #e1f5ee; border-radius: 8px; }
.adv-f { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--card); }
.adv-f.red { border-inline-start: 3px solid #a32d2d; }
.adv-f.amber { border-inline-start: 3px solid #ba7517; }
.adv-f.blue { border-inline-start: 3px solid #185fa5; }
.adv-f summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 13.5px; list-style: none; }
.adv-f summary::-webkit-details-marker { display: none; }
.adv-f summary .t { flex: 1; font-weight: 600; }
.adv-f summary .n { color: var(--muted); }
.adv-f > p { margin: 0 10px 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.adv-f ul { list-style: none; margin: 0 10px 6px; padding: 0; }
.adv-f li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; font-size: 12.5px; border-top: 1px dashed var(--line); }
.adv-f li.clickable { cursor: pointer; }
.adv-f li.clickable:hover { background: var(--accent-soft); }
.adv-f li small { color: var(--muted); }
.adv-f > small { display: block; margin: 0 10px 6px; }
.adv-f > .btn { margin: 0 10px 10px; }
.adv-ask-btn svg { width: 15px; height: 15px; vertical-align: -3px; color: #534ab7; }
/* the floating button (bottom left) and its small chat window */
.adv-fab { position: fixed; left: 20px; bottom: 20px; z-index: 35; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #534ab7; color: #eeedfe; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: background .2s; }
.adv-fab:hover { background: #3c3489; }
.adv-fab:focus-visible { outline: 2px solid #afa9ec; outline-offset: 2px; }
.adv-fab svg { width: 24px; height: 24px; }
.adv-fab[hidden], .adv-fab-panel[hidden] { display: none; }
body.has-adv-fab .toast { left: 80px; }
.adv-fab-panel { position: fixed; left: 20px; bottom: 80px; z-index: 36; width: 380px; max-width: calc(100vw - 40px); height: min(540px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 37, 64, .18); }
.adv-fab-panel .av { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #eeedfe; color: #534ab7; display: inline-flex; align-items: center; justify-content: center; }
.adv-fab-panel .av svg { width: 17px; height: 17px; }
.adv-fab-panel .av.big { width: 40px; height: 40px; }
.adv-fab-panel .av.big svg { width: 22px; height: 22px; }
.adv-fab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adv-fab-panel .adv-top { padding: 8px 10px; gap: 6px; }
.adv-fab-panel .adv-top b { font-size: 13.5px; white-space: nowrap; }
.adv-fab-panel .adv-top .link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; white-space: nowrap; padding: 2px 4px; cursor: pointer; }
.adv-fab-panel .adv-hello h3 { font-size: 15px; }
.adv-fab-panel .adv-hello p { font-size: 12.5px; }
.adv-fab-panel .adv-suggest button { font-size: 12px; }
@media print { .adv-fab, .adv-fab-panel { display: none; } }
bdi.num { direction: ltr; unicode-bidi: isolate; }
.adv-badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.adv-badge.none { background: var(--soft); color: var(--muted); border-color: var(--line); }
.adv-badge.warn { background: #faeeda; color: #633806; border-color: #fac775; }
.adv-badge.ok { background: #e1f5ee; color: #085041; border-color: #9fe1cb; }
.adv-badge.bad { background: #fcebeb; color: #791f1f; border-color: #f7c1c1; }
.adv-test { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; background: var(--card); }
.adv-test[hidden] { display: none; }
.adv-test-sum { font-weight: 600; margin-bottom: 6px; }
.adv-test-sum.ok { color: #085041; } .adv-test-sum.bad { color: #791f1f; }
.adv-steps { list-style: none; margin: 0; padding: 0; }
.adv-steps li { display: flex; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line); font-size: 13px; line-height: 1.6; }
.adv-steps .ic { width: 16px; flex: none; text-align: center; font-weight: 700; }
.adv-steps li.ok .ic { color: #0f6e56; } .adv-steps li.bad .ic { color: #a32d2d; } .adv-steps li.info .ic { color: var(--muted); }
.adv-steps small { display: block; color: var(--muted); font-size: 12.5px; }
.adv-steps small.fix { color: var(--ink); }
.adv-tech { margin-top: 8px; font-size: 12.5px; }
.adv-tech pre { background: var(--soft); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; font-size: 12px; text-align: left; }
.adv-keyrow {display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 13.5px; }

/* ---------- عمليات الشيكات: tabs by status, and بطاقة الشيك (renderer/js/banks.js) ---------- */
.chq-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
/* مربعات الحالات أعلى كشف الشيكات: الاسم والمبلغ والعدد؛ المختار بلون التمييز. */
.chq-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.chq-tabs button.chq-box { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 10px; padding: 9px 12px; text-align: start; }
.chq-tabs button.chq-box .l { font-size: 13px; color: var(--muted); }
.chq-tabs button.chq-box b { font-size: 18px; color: var(--ink); }
.chq-tabs button.chq-box small { font-size: 12px; color: var(--muted); }
.chq-tabs button.chq-box:hover:not(:disabled) { border-color: var(--accent); }
.chq-tabs button.chq-box.on { background: var(--accent); border-color: var(--accent); }
.chq-tabs button.chq-box.on .l, .chq-tabs button.chq-box.on b, .chq-tabs button.chq-box.on small { color: #fff; }
.chq-tabs button.chq-box.zero { opacity: .55; cursor: default; }
.chq-tabs button.chq-box.done:not(.on) { background: var(--soft); }
.chq-tabs button.chq-box.done:not(.on) b { color: var(--muted); }
.chq-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 18px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chq-tabs button .num { color: var(--muted); margin-inline-start: 4px; }
.chq-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chq-tabs button.on .num { color: #dce9fb; }
.chq-opbar { margin-bottom: 10px; gap: 8px; flex-wrap: wrap; align-items: center; }
.chq-opbar select { min-width: 260px; }
.chq-opbar .muted { font-size: 12.5px; }
.chq-table tbody tr.clickable:hover { background: var(--accent-soft); }
.chq-card .chq-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chq-card .chq-head .pc-tag { font-size: 13px; padding: 3px 12px; }
.chq-card .chq-head .amt { font-size: 20px; font-weight: 700; }
.pc-tag.green { background: #e1f5ee; color: #085041; }
.chq-card .chq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; padding: 10px 12px; background: var(--soft); border-radius: 8px; }
.chq-card .chq-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chq-card .chq-grid span { font-size: 12px; color: var(--muted); }
.chq-card .chq-grid b { font-weight: 600; overflow-wrap: anywhere; }
.chq-card .chq-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.chq-tl { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.chq-tl li { position: relative; padding: 4px 14px 8px 0; padding-inline-start: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.chq-tl li::before { content: ''; position: absolute; inset-inline-start: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chq-tl li .d { color: var(--muted); font-size: 12.5px; min-width: 78px; }
.chq-tl li small { color: var(--muted); font-size: 12px; }
.chq-tl li small.n { flex-basis: 100%; }
.chq-docs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.danger-card { border-color: #f0b8ad; }
.danger-card .btn.danger { border-color: #e9a99c; background: var(--danger-soft); }

/* ---------- عمليات الشيكات: instant filters, row actions, selection bar ---------- */
.chq-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; }
.chq-search { position: relative; flex: 1 1 320px; min-width: 240px; }
.chq-search svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.chq-search input { width: 100%; padding: 8px 10px; padding-inline-start: 34px; font: inherit; border: 1px solid var(--field-line); border-radius: 8px; background: var(--input); color: var(--field-ink); }
.chq-filters select { padding: 7px 8px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--input); color: var(--field-ink); }
/* ارتفاع واحد لكل مربعات الفلاتر (البحث والقوائم وزر مسح الفلاتر). */
.chq-filters .chq-search input, .chq-filters select { box-sizing: border-box; height: 40px; padding-top: 0; padding-bottom: 0; }
.chq-range { display: inline-flex; align-items: center; gap: 4px; }
.chq-range input { padding: 6px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; }
.chq-dnote { flex-basis: 100%; font-size: 11.5px; }
/* الفلاتر في سطر واحد: البحث يأخذ الباقي، الفترة والبنك بعرض ثابت. */
.chq-filters { flex-wrap: nowrap; }
.chq-filters .chq-search { flex: 3 1 240px; min-width: 200px; }
.chq-filters #cf-period, .chq-filters #cf-bank, .chq-filters #cf-cur { flex: 1 1 150px; width: auto; min-width: 120px; }
.chq-filters .chq-range { white-space: nowrap; }
/* اسم البنك المختصر بجانب رقم الشيك (صف بسطر واحد). */
.chq-table td small.chq-bk { display: inline; margin-inline-start: 4px; }
/* سطر أرصدة البنوك أسفل صفحة البنوك والشيكات */
.chq-list:has(+ .chq-banks) { margin-bottom: 12px; }
.chq-banks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 4px 80px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.chq-banks:empty { display: none; }
.chq-banks .link { color: var(--ink); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.chq-banks .link:hover { color: var(--accent); text-decoration: underline; }
.chq-banks small { color: var(--muted); }
.chq-list { padding: 0; overflow: hidden; margin-bottom: 70px; }
.chq-table { width: 100%; }
.chq-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.chq-table th.sortable:hover, .chq-table th.sortable.on { color: var(--accent); }
.chq-table td small { display: block; font-size: 11.5px; }
.chq-table td.num small { display: inline; }
.chq-table tr.sel td { background: var(--accent-soft); }
.chq-acts-cell { white-space: nowrap; }
.chq-acts-cell .btn { margin-inline-start: 4px; }
.chq-selbar { position: fixed; bottom: 14px; inset-inline-start: 50%; transform: translateX(50%); z-index: 40; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  max-width: calc(100vw - 260px); padding: 10px 16px; background: #0a2540; color: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(10, 37, 64, .35); font-size: 13.5px; }
.chq-selbar small { color: #b9cce4; }
.chq-selbar .ops { display: flex; flex-wrap: wrap; gap: 6px; }
.chq-selbar .btn { background: #12355b; color: #fff; border-color: #2a5d8f; }
.chq-selbar .btn.primary { background: var(--accent); border-color: var(--accent); }
.chq-selbar .link { color: #b9cce4; }

/* ---------- صورة الشيك and its cropping (renderer/js/banks.js) ---------- */
.chq-img { margin-bottom: 12px; text-align: center; }
.chq-img img { max-width: 100%; max-height: 260px; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; background: #fff; }
.chq-img-acts { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.chq-img.empty-img { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--soft); }
.img-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 15, 30, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; }
.img-lightbox img { max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 6px; }
.img-lightbox span { color: #cfe0f4; font-size: 13px; }
.crop-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.crop-tools label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.crop-stage { max-height: 480px; overflow: auto; background: #1d2733; border-radius: 8px; padding: 2px; direction: ltr; text-align: center; }
.crop-inner { position: relative; display: inline-block; touch-action: none; cursor: crosshair; user-select: none; }
.crop-inner canvas { display: block; }
.crop-frame { position: absolute; border: 2px solid #4ea1ff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; }
.crop-frame i { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #4ea1ff; border-radius: 3px; }
.crop-frame i[data-h=nw] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-frame i[data-h=ne] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-frame i[data-h=sw] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-frame i[data-h=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }

/* ---------- التقارير: the result as a screen, and the print preview window (renderer/js/reports.js) ---------- */
.rep-screen { padding: 12px 14px; }
.rep-screen-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.rep-screen-head h2 { margin: 0; font-size: 17px; }
.rep-screen .rep-table { width: 100%; }
/* The preview window shows the report page only: no side menu, no top bar. */
body.print-window .sidebar, body.print-window .topbar { display: none !important; }
body.print-window .app { display: block; }
body.print-window .main { margin: 0; padding: 0; }
body.print-window .content { padding: 12px 16px; }
body.print-window .print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
body.print-window .print-bar b { margin-inline-end: auto; }
body.print-window .rep-paper .no-print { display: none; }

/* ---------- عمليات الشيكات: the "⋯" menu, status-change animation, print row in the card, WhatsApp button ---------- */
.cf-pop { position: fixed; z-index: 60; min-width: 210px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(10, 37, 64, .22); display: flex; flex-direction: column; }
.cf-pop button { text-align: start; border: 0; background: none; font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.cf-pop button:hover, .cf-pop button:focus { background: var(--accent-soft); outline: none; }
.cf-pop hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; }
.chq-table tr.chq-leaving td { animation: chq-leave .42s ease forwards; }
@keyframes chq-leave { to { opacity: 0; transform: translateX(-24px); background: #e1f5ee; } }
.chq-table tr.chq-flash td { animation: chq-flash 1.4s ease; }
.chq-table tr.chq-flash .badge { animation: chq-pop .5s ease; }
@keyframes chq-flash { 0%, 30% { background: #d4f0e4; } 100% { background: transparent; } }
@keyframes chq-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .chq-table tr.chq-leaving td, .chq-table tr.chq-flash td, .chq-table tr.chq-flash .badge { animation: none; } }
.chq-acts-cell .btn[disabled] { opacity: .45; cursor: not-allowed; }
.chq-print-row { display: flex; justify-content: flex-end; margin: 6px 0 -4px; }
.btn.wa { color: #0f6e3c; border-color: #9fd8b5; }
.btn.wa svg { color: #1aa35a; }

/* ---------- صفحة الزبون: the cards, the all-years tick, sortable headings ---------- */
.pt-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.pt-kpi { border-top: 3px solid var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.pt-kpi.clickable { cursor: pointer; }
.pt-kpi.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(10, 37, 64, .12); }
.pt-kpi > small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pt-kpi.up { border-top-color: #1d9e75; } .pt-kpi.up > small { color: #0f6e56; }
.pt-kpi.down { border-top-color: #ba7517; } .pt-kpi.down > small { color: #854f0b; }
.pt-kpi.alert { border-top-color: #a32d2d; } .pt-kpi.alert b { color: #a32d2d; }
.pt-kpi:first-child { border-top-color: var(--accent); }
.pt-tabs { align-items: center; }
.pt-allyears { margin-inline-start: auto; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; }
.rep-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.rep-table th.sortable:hover, .rep-table th.sortable.on { color: var(--accent); }

/* ---------- التقارير: the several-choice box (renderer/js/reports.js) ---------- */
.msel { position: relative; }
.msel-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 9px; font: inherit; text-align: start;
  border: 1px solid var(--field-line); border-radius: 6px; background: var(--input); color: var(--field-ink); cursor: pointer; min-height: 34px; }
.msel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the list arrow, drawn (the ▾ character is missing from some fonts) */
.msel-btn i { flex: none; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.6px 1.6px 0; transform: translateY(-2px) rotate(45deg); }
.msel-list { position: absolute; z-index: 30; top: calc(100% + 3px); inset-inline-start: 0; min-width: 100%; max-height: 260px; overflow-y: auto; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 26px rgba(10, 37, 64, .18); }
.msel-list label { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 5px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.msel-list label:hover { background: var(--accent-soft); }
.msel-list .msel-all { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 2px; font-weight: 600; }
.pt-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ================= Readability (2026-11): Segoe UI for text and numbers, larger sizes, stronger contrast =================
   Cairo stays for headings; Segoe UI (part of Windows, offline) has solid, wide digits and a calm Arabic. */
:root {
  --paper: #eef1f5;
  --muted: #2b3d51;
  --line: #c3cfdb;
  --soft: #f5f7fa;
  --soft-2: #e9eef4;
  --text-font: "Segoe UI", Tahoma, "Cairo", sans-serif;
}
body { font-family: var(--text-font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.num, td.num, span.num, b.num { font-family: "Segoe UI", Tahoma, sans-serif; font-variant-numeric: tabular-nums lining-nums; }
h1, h2, h3, .topbar h1 { font-family: var(--title-font); }
table td, .rep-table td { font-size: 14.5px; }
table th, .rep-table th { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.rep-table tfoot td, .rep-table tr.bold td { font-weight: 600; }
.field label { font-size: 13px; }
.muted { color: var(--muted); }
.pc-tag, .badge { font-size: 12.5px; }
.gs-item .k, .hm-li .t, .sec-head .sub { font-size: 12.5px; }
.pt-kpi b, .ck b, .hm-kpi .v { font-family: "Segoe UI", Tahoma, sans-serif; font-weight: 600; letter-spacing: 0; }
.pt-kpi span, .ck > span { font-size: 13px; }
.pt-kpi > small, .ck small { font-size: 12.5px; }
.btn { font-weight: 500; }
small { font-size: 12.5px; }

/* ================= The side menu: wide, with each section's name and colour ================= */
.app { grid-template-columns: 214px 1fr; transition: grid-template-columns .25s ease; }
.sidebar { align-items: stretch; padding: 12px 10px; background: var(--t-side); }
.rail-glow { display: none; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; flex: none; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-txt b { color: #e6f1fb; font: 700 17px/1.2 var(--title-font); }
.brand-company { color: var(--t-rail); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav { align-items: stretch; gap: 3px; overflow-y: auto; overflow-x: hidden; }
.nav-tab { width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border-radius: 10px; color: var(--t-ink); font-size: 14.5px; text-align: start; transition: background .18s, color .18s; }
.nav-tab .chip { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 28%, var(--t-side)); color: color-mix(in srgb, var(--c) 45%, #ffffff); transition: background .18s, color .18s, transform .2s; }
.nav-tab .chip svg { width: 19px; height: 19px; }
.nav-tab .lbl { position: static; opacity: 1; transform: none; background: none; padding: 0; color: inherit; font-size: 14.5px; font-weight: 500; pointer-events: none; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-tab .lbl::after { display: none; }
.nav-tab .cnt { font-size: 11.5px; color: var(--t-rail); background: color-mix(in srgb, var(--t-rail) 14%, transparent); border-radius: 8px; padding: 0 6px; }
.nav-tab:hover { background: color-mix(in srgb, var(--t-rail) 10%, transparent); color: #fff; }
.nav-tab:hover .chip { transform: scale(1.06); }
.nav-tab.active { background: color-mix(in srgb, var(--t-rail) 16%, transparent); color: #fff; }
.nav-tab.active::before { content: ''; position: absolute; right: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px 0 0 3px; background: var(--c); }
.nav-tab.active .chip { background: color-mix(in srgb, var(--c) 18%, #ffffff); color: color-mix(in srgb, var(--c) 75%, var(--t-side)); }
.nav-group { font-size: 11px; color: var(--t-mute); padding: 12px 10px 4px; letter-spacing: .3px; }
.nav-group:first-child { padding-top: 2px; }
body.nav-folded .nav-group { height: 1px; width: 28px; padding: 0; margin: 8px 0; overflow: hidden; font-size: 0; background: var(--t-side-2); }
.nav-tab.active .cnt { color: #fff; background: rgba(255, 255, 255, .18); }
.nav-tab.bottom { margin-top: auto; border-top: 1px solid var(--t-side-2); border-radius: 0 0 10px 10px; padding-top: 4px; height: 50px; }
.nav-tab:focus-visible { outline: 2px solid var(--t-rail); outline-offset: 1px; }
.nav-fold { margin: 8px auto 0; width: 30px; height: 26px; border: 1px solid var(--t-side-2); border-radius: 8px; background: none; color: var(--t-rail); cursor: pointer; display: grid; place-items: center; }
.nav-fold svg { width: 16px; height: 16px; transition: transform .25s; }
.nav-fold:hover { color: #fff; border-color: var(--t-brand); }
/* Folded: icons only; the name shows on hover as before. */
body.nav-folded .app { grid-template-columns: 76px 1fr; }
body.nav-folded .sidebar { align-items: center; padding: 12px 0; }
body.nav-folded .brand-txt, body.nav-folded .nav-tab .cnt { display: none; }
body.nav-folded #nav { align-items: center; overflow: visible; }
body.nav-folded .nav-tab { width: 52px; height: 52px; justify-content: center; padding: 0; }
body.nav-folded .nav-tab .chip { width: 38px; height: 38px; }
body.nav-folded .nav-tab .lbl { position: absolute; right: calc(100% + 14px); top: 50%; white-space: nowrap; background: var(--t-side); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 9px;
  opacity: 0; transform: translate(8px, -50%); transition: opacity .18s, transform .22s; flex: none; }
body.nav-folded .nav-tab:hover .lbl, body.nav-folded .nav-tab:focus-visible .lbl { opacity: 1; transform: translate(0, -50%); }
body.nav-folded .nav-fold svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .app, .nav-tab, .nav-tab .chip, .nav-fold svg { transition: none; } }
.app { grid-template-columns: 232px 1fr; } body.nav-folded .app { grid-template-columns: 76px 1fr; }
.adv-prov { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; margin: 6px 0 10px; } .adv-prov legend { font-weight: 600; padding: 0 6px; }

/* ================= Font choice (الإعدادات ← الخط): the family, weight and size come from settings, set on :root by applyFontSettings() in core.js ================= */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/tajawal-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/tajawal-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/tajawal-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/tajawal-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/tajawal-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/tajawal-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root { --f-w: 500; --f-s: 15px; }
body { font-weight: var(--f-w); font-size: var(--f-s); }
.num, td.num, span.num, b.num, .pt-kpi b, .ck b, .hm-kpi .v { font-family: inherit; font-variant-numeric: tabular-nums lining-nums; }
table td, .rep-table td { font-size: calc(var(--f-s) - .5px); }
table th, .rep-table th { font-size: calc(var(--f-s) - 1px); font-weight: 700; color: var(--ink); }
.rep-table tfoot td, .rep-table tr.bold td { font-weight: 700; }
.rep-table tr.sub td, .chart-x, .legend, .muted, .gs-item .k, .hm-li .t { font-size: 12.5px; }
.doc, .doc table, #print-area, .rep-paper { font-family: var(--text-font); font-weight: var(--f-w); }
.doc { font-size: calc(var(--f-s) - 1px); color: #000; }
.doc table th { background: #e4e4e4; color: #000; font-weight: 700; font-size: calc(var(--f-s) - 1px); }
.doc table td { font-size: calc(var(--f-s) - 1px); color: #000; }
.rep-paper .doc.shaded tbody tr:nth-child(even) td, #print-area .doc.shaded tbody tr:nth-child(even) td { background: #e4e4e4; }
#print-area .rep-print-foot { font-size: 12px; color: #333; }
#print-area .print-tail { font-size: 12.5px; }
#print-area .doc-head.small { font-size: 12.5px; }
/* خصائص البرنامج ← الخط: the controls, and beside them a sample of the screen and of the print */
.font-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .font-wrap { grid-template-columns: 1fr; } }
.font-grp { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 12px; margin: 0 0 10px; }
.font-grp legend { padding: 0 6px; font-weight: 700; color: var(--accent); }
.font-rng { display: flex; align-items: center; gap: 10px; }
.font-rng input { flex: 1; padding: 0; border: 0; background: none; }
.font-rng output { min-width: 44px; text-align: center; font-weight: 700; }
.font-pv-screen { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); display: flex; flex-direction: column; gap: 10px; position: sticky; top: 8px; }
.font-pv-screen .font-pv-title { margin: 0; font-size: var(--t-s); }
.font-pv-print { background: #fff; color: #000; border: 1px dashed var(--line); border-radius: 6px; padding: 10px; }

/* customer card: contact rows, route days, legacy fields */
.contact-rows { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 640px; }
.contact-row { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px; align-items: center; width: 100%; }
.contact-row[hidden] { display: none; }
.contact-type { font-size: 12px; font-weight: 600; color: var(--ink); }
.route-days { gap: 6px 16px; }
details.legacy { margin-top: 14px; }
details.legacy summary { cursor: pointer; font-size: 12px; color: var(--muted, #666); margin-bottom: 8px; }
[data-add-row][hidden] { display: none; }

/* report page: letterhead centered, title in the middle, date small at the top left */
.doc-head.centered { justify-content: center; text-align: center; margin-bottom: 8px; }
.doc-head.centered .head-img, .doc-head.centered .custom-head { margin-inline: auto; text-align: center; }
.rep-titlebar { position: relative; text-align: center; margin: 0 0 12px; padding-top: 4px; }
.rep-titlebar h2 { margin: 0 0 4px; }
.rep-titlebar .rep-when { position: absolute; left: 0; top: 0; font-size: 11px; color: #444; font-variant-numeric: tabular-nums; }
.rep-titlebar .rep-period { font-size: 12px; color: #333; }
/* balance sheet colours must win over the generic .doc table rules and the row shading */
.doc .bs-table th { background: var(--bs-head, var(--blue)); color: #fff; }
.doc .bs-table td { color: #000; }
.doc .bs-table tfoot td { background: var(--bs-foot, var(--side)); color: #fff; }
.rep-paper .doc.shaded .bs-table tbody tr:nth-child(even) td, #print-area .doc.shaded .bs-table tbody tr:nth-child(even) td { background: transparent; }
.doc .bs-table tbody tr.bs-group td, .rep-paper .doc.shaded .bs-table tbody tr.bs-group td { background: var(--sg-bg, var(--amber-soft)); color: var(--sg-fg, #6b4510); }
.doc .bs-table tbody tr.bs-total td, .rep-paper .doc.shaded .bs-table tbody tr.bs-total td { background: var(--st-bg, var(--soft-2)); color: var(--sg-fg, #000); }
.doc .bs-table tbody tr.neg td:last-child, .rep-paper .doc.shaded .bs-table tbody tr.neg td:last-child { background: var(--danger); color: #fff; }
@media print { .doc .bs-table th, .doc .bs-table tfoot td, .doc .bs-table td, .doc .bs-fill, .doc .bs-table tr.neg td:last-child { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* income statement on the print page: same colours as the balance sheet, not overridden by row shading */
.rep-paper .doc .rep-table tbody tr.is-group td, #print-area .doc .rep-table tbody tr.is-group td { background: var(--amber-soft); color: #6b4510; font-weight: 700; }
.rep-paper .doc .rep-table tbody tr.is-total td, #print-area .doc .rep-table tbody tr.is-total td { background: var(--soft-2); color: #000; font-weight: 700; }
.rep-paper .doc .rep-table tbody tr.is-final td, #print-area .doc .rep-table tbody tr.is-final td { background: var(--side); color: #fff; font-weight: 700; }
.rep-paper .doc.shaded .rep-table tbody tr.is-group:nth-child(even) td, #print-area .doc.shaded .rep-table tbody tr.is-group:nth-child(even) td { background: var(--amber-soft); }
.rep-paper .doc.shaded .rep-table tbody tr.is-total:nth-child(even) td, #print-area .doc.shaded .rep-table tbody tr.is-total:nth-child(even) td { background: var(--soft-2); }
.rep-paper .doc.shaded .rep-table tbody tr.is-final:nth-child(even) td, #print-area .doc.shaded .rep-table tbody tr.is-final:nth-child(even) td { background: var(--side); }
@media print { .doc .rep-table tr.is-total td, .doc .rep-table tr.is-group td, .doc .rep-table tr.is-final td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* cheque number column: full width of the number, with room before the bank name */
.rep-table .c-chq { white-space: nowrap; text-align: center; direction: ltr; padding-inline: 10px; min-width: 90px; }

/* serial number column in item grids (مطابقة الجرد، أرصدة المخزون الابتدائية) */
table.lines .c-sn { width: 44px; text-align: center; color: var(--muted); }

/* إدارة المخزون: ستة مؤشرات في صف واحد */
.ck-row.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1150px) { .ck-row.six { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }

/* ================= سلّم خطوط موحّد (2026-11): نفس الأحجام والأوزان في الأقسام كلها. آخر الملف ليغلب ما قبله ================= */
:root { --fs-xs: 12.5px; --fs-sm: 13.5px; --fs-lg: 16px; --fs-xl: 22px; }
.cash-card h3, .pt-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.cash-card h3 small, .cash-card h4 small { font-size: var(--fs-xs); font-weight: 500; }
.ck > span, .pt-kpi span { font-size: var(--fs-sm); font-weight: 600; }
.ck b, .pt-kpi b { font-size: var(--fs-xl); font-weight: 700; }
.ck small, .pt-kpi > small { font-size: var(--fs-xs); font-weight: 500; }
.cash-acc > span, .cash-do .tx { font-size: var(--fs-sm); }
.cash-do .tx { font-weight: 600; }
.cash-acc b { font-size: var(--fs-sm); font-weight: 700; }
.cash-do .tx small, .cash-acc span small, .cash-out { font-size: var(--fs-xs); font-weight: 500; }
.cash-card .link { font-size: var(--fs-sm); font-weight: 600; }
.pc-tag, .badge { font-size: var(--fs-xs); font-weight: 600; }
table th, .rep-table th { font-size: calc(var(--f-s) - .5px); }
.cash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cash-two .sec { margin: 4px 0 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 700; }
@media (max-width: 900px) { .cash-two { grid-template-columns: 1fr; gap: 8px; } }

/* ================= الخط من الإعدادات (خصائص البرنامج ← الخط). آخر الملف ليغلب ما قبله =================
   --f-s النص خارج المربعات (والأحجام الصغيرة تتبعه)، --in-* داخل المربعات، --tb-s الجداول، --t-s العناوين، --p-s الطباعة.
   Defaults give the sizes the program had before; core.js applyFontSettings sets the chosen ones. */
:root { --in-font: var(--text-font); --in-w: 500; --in-s: 15px; --tb-s: 15px; --t-s: 22px; --p-s: 14px;
  --fs-xs: calc(var(--f-s) - 2.5px); --fs-sm: calc(var(--f-s) - 1.5px); --fs-lg: calc(var(--t-s) - 6px); --fs-xl: var(--t-s); }
/* outside the boxes */
.field label { font-size: calc(var(--f-s) - 2px); }
small, .muted, .rep-table tr.sub td, .chart-x, .legend, .gs-item .k, .hm-li .t, .sec-head .sub, .contact-type { font-size: var(--fs-xs); }
.nav-tab, .nav-tab .lbl { font-size: calc(var(--f-s) - .5px); }
/* inside the boxes (a box with its own size keeps it) */
input, select, textarea { font-family: var(--in-font); font-size: var(--in-s); font-weight: var(--in-w); }
.sticky-notice { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); background: var(--card); color: var(--ink); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 10px 10px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); font-size: 14px; }
.sn-x { flex: none; width: 28px; height: 28px; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sn-x:hover { background: var(--soft); color: var(--ink); }
.sn-x:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
.sn-x svg { width: 16px; height: 16px; }
/* أرقام لاتينية في حقول التاريخ والأرقام الأصلية: المتصفح يرسمها بلغته (عربية عند كثيرين). الخط يغطي الأرقام العربية وفاصلتها فقط (tools/build-digits-font.py). */
@font-face { font-family: "DaftarDigits"; font-style: normal; font-weight: 200 1000; font-display: block; src: url("fonts/daftar-digits.woff2") format("woff2"); unicode-range: U+0660-066C, U+06F0-06F9; }
html input[type=date], html input[type=number], html input[type=time], html input[type=datetime-local], html input[type=month] { font-family: "DaftarDigits", var(--in-font); }
.doc-grid.cust-grid input:not([type=checkbox]):not([type=radio]), .doc-grid.cust-grid select { height: auto; min-height: calc(var(--in-s) + 23px); }
/* tables */
table td, .rep-table td { font-size: calc(var(--tb-s) - .5px); font-weight: var(--tb-w, 400); }
table th, .rep-table th { font-size: calc(var(--hd-s, var(--tb-s)) - .5px); }
/* شريط الخط في أعلى التقرير: --rf-d فرق الحجم بالبكسل، --rf-w السماكة (يُحفظ لكل تقرير) */
.rep-screen .rep-table td { font-weight: var(--rf-w, var(--tb-w, 400)); }
.rep-screen.rf-hc .rep-table thead th { background: var(--rf-hc); color: var(--rf-hci); }
.rep-screen.rf-z .rep-table tbody tr:nth-child(even) td { background: var(--soft-2); }
.rep-fontbar input[type=color] { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
/* الطباعة بنفس شكل الشاشة (إن فُعّلت): حجم الطباعة + فرق التقرير */
.doc.rf-print table td { font-size: calc(var(--p-s) + var(--rf-d, 0px)); font-weight: var(--rf-w, inherit); }
.doc.rf-print table th { font-size: calc(var(--p-s) + var(--rf-d, 0px)); }
.doc.rf-print.rf-hc table thead th { background: var(--rf-hc); color: var(--rf-hci); }
.doc.rf-print.rf-z table tbody tr:nth-child(even) td { background: #f1f4f8; }
.rep-fontbar { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 8px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.rep-fontbar .btn { min-width: 40px; padding-inline: 8px; font-weight: 700; }
.rep-fontbar .btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.rep-fontbar output { min-width: 34px; text-align: center; font-size: 13px; color: var(--muted); }
/* titles */
.topbar h1, .sec-card h3 { font-size: var(--t-s); }
.hm-hello h2 { font-size: calc(var(--t-s) + 4px); }
.hm-card h3 { font-size: calc(var(--t-s) - 4px); }
.hm-kpi .v { font-size: calc(var(--t-s) + 8px); }
/* print and PDF: their own size */
.doc { font-size: var(--p-s); }
.doc table th, .doc table td { font-size: var(--p-s); }

/* number boxes: typed by hand, no small up/down arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* line tables: one height (34px) for every box, drop-downs included; invoice warehouse wider, unit narrower */
table.lines input:not([type=checkbox]):not([type=radio]), table.lines select { height: 34px; box-sizing: border-box; }
table.lines th.c-wh { width: var(--wh-w, 180px); min-width: var(--wh-w, 180px); }
table.lines th.c-unit { width: var(--unit-w, 90px); min-width: var(--unit-w, 90px); }
/* printed documents (not reports): every line sits the same 10px inside the page edge, like the table text */
.doc:not(.is-report) .doc-head, .doc:not(.is-report) .doc-meta, .doc:not(.is-report) > h4, .doc:not(.is-report) .doc-foot-print,
.doc:not(.is-report) .sign, .doc:not(.is-report) .print-notes, .doc:not(.is-report) .print-tail { padding-inline: 10px; }
.doc:not(.is-report) .doc-foot-print { margin-top: 8px; }
/* open pages: a tab for every screen opened, under the top bar */
.tabbar { display: flex; align-items: flex-end; gap: 4px; padding: 6px 24px 0; background: var(--paper); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabbar[hidden], body.print-window .tabbar { display: none !important; }
.ptab { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 220px; padding: 7px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0;
  background: var(--soft); color: var(--muted); cursor: pointer; font-size: 13px; user-select: none; }
.ptab:hover { color: var(--ink); }
.ptab.on { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.ptab-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptab-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 1px 4px; border-radius: 4px; font-size: 11px; line-height: 1; }
.ptab-x:hover { background: rgba(163, 45, 45, .14); color: #a32d2d; }
.ptab-n { margin-inline-start: auto; align-self: center; padding: 0 6px 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* chart of accounts: icons, balance on every row, "add account" on groups, search */
.tree-find { margin-bottom: 8px; position: sticky; top: 0; background: var(--card); z-index: 1; }
.tree-find input { width: 100%; box-sizing: border-box; height: 38px; }
.tree-none { margin: 6px 4px; }
.tree li.tr-hide { display: none; }
.tree li.open > .tr-row > .tw { transform: rotate(90deg); }
.tree .tr-row { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 7px; }
.tree .tr-row:hover { background: var(--paper); }
.tree .tr-row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.tree .tr-row > a:hover { background: none; }
.tree .tr-ico { width: 17px; height: 17px; flex: none; color: var(--accent); }
.tree .tr-ico.file { color: var(--muted); }
.tree .tr-no { color: var(--muted); font-size: .92em; }
.tree .tr-bal { flex: none; min-width: 90px; text-align: left; color: var(--ink); }
.tree .tr-bal.zero { color: var(--muted); }
.tree .tr-bal.neg { color: #a32d2d; }
.tree .tr-act { flex: none; width: 104px; }
.tree .tr-add { width: 100%; flex: none; border: 1px solid var(--field-line); background: var(--input); color: var(--accent); border-radius: 6px; padding: 1px 9px; font-size: 12px; cursor: pointer; opacity: 0; }
.tree .tr-row:hover .tr-add, .tree .tr-add:focus-visible { opacity: 1; }
.tree-path { padding: 8px 10px; background: var(--paper); border-radius: 8px; font-size: 13px; line-height: 1.6; }
.tree-note { padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 13px; line-height: 1.6; }
/* backup page */
.bk-page { max-width: 760px; display: grid; gap: 14px; }
.bk-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.bk-ico { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bk-blue .bk-ico { background: #e6f0fb; color: #1f5fa8; }
.bk-green .bk-ico { background: #e6f4ea; color: #2b7a43; }
.bk-red .bk-ico { background: #fdebe7; color: #b3382a; }
.bk-body { flex: 1; min-width: 0; }
.bk-body h3 { margin: 0 0 4px; font-size: 16px; }
.bk-body p { margin: 0 0 4px; line-height: 1.7; }
.bk-act { flex: none; }

/* purchase invoice: cost per unit with the tax and transport share */
table.lines th.c-cost, table.lines td.c-cost { width: 88px; min-width: 88px; text-align: center; color: var(--muted); }
table.lines th.c-final, table.lines td.c-final { color: var(--accent); font-weight: 700; background: var(--accent-soft); }

/* purchase invoice: roomy name and warehouse columns; tax and transport columns only when they apply */
table.lines.purch th.c-name { min-width: 220px; }
table.lines.purch th.c-wh { width: var(--wh-w, 120px); min-width: var(--wh-w, 120px); }
table.lines.purch th.c-unit { width: var(--unit-w, 90px); min-width: var(--unit-w, 90px); }
table.lines.purch th.c-price, table.lines.purch th.c-total { min-width: 96px; }
table.lines.purch.hide-tax .c-tax, table.lines.purch.hide-fr .c-fr { display: none; }
table.lines td.c-cost:empty::before { content: '—'; opacity: .45; }
.table-wrap { overflow-x: auto; }
.cost-note { margin: 4px 10px 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft, #fdf3dc); color: #7a5410; font-size: 13px; }
table.lines.purch th.c-qty { min-width: 72px; }
/* purchase invoice: smaller item-number box; text inside the drop-downs sits a little higher */
table.lines.invl th.c-code { width: 56px; min-width: 56px; }
table.lines.invl.bc th.c-code { width: 110px; min-width: 110px; }
table.lines.invl th.c-name { min-width: 190px; }
table.lines.invl th.c-wh { width: var(--wh-w, 130px); min-width: var(--wh-w, 130px); }
/* a box with its small icon inside it (item search, item card, price details); the icon takes no column width */
table.lines .lbox { position: relative; }
table.lines .lbox input { padding-inline-end: 30px; }
table.lines .lbox .icon-btn { position: absolute; inset-inline-end: 3px; top: 50%; transform: translateY(-50%); padding: 3px; }
table.lines .lbox .icon-btn .ico { width: 16px; height: 16px; }
/* the magnifier shows while the name is empty; the item card shows beside a filled name when the pointer is on the row */
table.lines .lbox input:not(:placeholder-shown) ~ .lens { display: none; }
table.lines .lbox .lcard { display: none; }
table.lines tr:hover .lbox input:not(:placeholder-shown) ~ .lcard { display: inline-grid; }
table.lines select { padding-top: 2px; padding-bottom: 7px; line-height: 1.2; }
/* Boxes in forms and report options: a dropdown is the same height as a text, number or date box (it was taller). */
.field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]), .field select { box-sizing: border-box; height: calc(var(--in-s) + 24px); padding-top: 0; padding-bottom: 0; line-height: 1.2; }

/* item card, معادلة الإنتاج: share bar, flagged zero-cost component, totals */
.fm-pct { white-space: nowrap; text-align: center; font-size: 12px; }
.fm-pct .fm-bar { display: inline-block; width: 44px; height: 6px; margin-inline-end: 6px; border-radius: 3px; background: var(--soft-2); vertical-align: middle; overflow: hidden; }
.fm-pct .fm-bar i { display: block; height: 100%; background: var(--accent); }
#fm-rows tr.fm-warn td { background: var(--amber-soft); }
#fm-rows tr.fm-warn .fm-pct small { color: #6b4510; font-weight: 700; }
.fm-zero-note { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--amber-soft); color: #6b4510; font-size: 13px; }
.fm-sums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 6px; }
.fm-sums > div { background: var(--soft); border-radius: 8px; padding: 8px 12px; }
.fm-sums span { display: block; font-size: 12px; color: var(--muted); }
.fm-sums b { font-size: 18px; }
.fm-sums .all { background: var(--accent-soft); }
.fm-sums .all b, .fm-sums .all span { color: var(--accent); }
table.lines th.c-n, td.fm-n { width: 34px; text-align: center; color: var(--muted); }

/* سند إنتاج وتعبئة */
.pk .pk-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-inline-end: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.pk-more { display: contents; } .pk-more[hidden], .pk-more-btn[hidden] { display: none; }
.pk-more-btn { align-self: end; }
.pk table.lines th.c-code { width: 96px; min-width: 96px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pk-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--soft); }
.pk-card.on { border: 1.5px solid var(--accent); background: var(--card); }
.pk-card h4 { margin: 0 0 2px; font-size: 14px; }
.pk-card .sub { font-size: 12px; color: var(--muted); }
.pk-unit { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 4px; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.pk-unit span { font-size: 12px; } .pk-unit b { font-size: 18px; }
.pk-cnt { display: flex; align-items: center; gap: 6px; margin: 10px 0; }
.pk-cnt input { width: 100%; text-align: center; font-size: 20px; font-weight: 600; height: 42px; }
.pk-sec { margin-top: 14px; padding: 4px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.pk-rawd tr.pk-grp td { background: var(--soft); color: var(--side); font-weight: 600; font-size: 13px; padding: 5px 10px; }
.pk-rawd > summary { display: flex; align-items: center; margin: 10px 0; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--side); list-style: none; }
.pk-rawd > summary::-webkit-details-marker { display: none; }
.pk-rawd > summary::after { content: '▾'; margin-inline-start: 10px; color: var(--muted); }
.pk-rawd[open] > summary::after { content: '▴'; }
.pk-rawd > summary small { margin-inline-start: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.pk-rawd > summary .muted { margin-inline-start: 8px; font-weight: 400; font-size: 13px; }
.pk-rawd[open] > summary { margin-bottom: 4px; }
.pk h4.sec { display: flex; align-items: center; margin: 12px 0 10px; }
.pk h4.sec small { margin-inline-start: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.pk-kpis .a { background: var(--accent-soft); color: var(--accent); } .pk-kpis .a span { color: var(--accent); }
.pk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
.pk-kpis > div { border-radius: 10px; padding: 10px 12px; background: var(--soft); }
.pk-kpis span { display: block; font-size: 12px; color: var(--muted); }
.pk-kpis b { font-size: 18px; }
.pk-sec .two-col .cur-totals { grid-column: auto; align-self: start; }
.pr-head { display: grid; grid-template-columns: 110px 170px minmax(140px, 1fr) 130px; grid-auto-columns: 170px; gap: 10px 14px; align-items: end; }
@media (max-width: 760px) { .pr-head { grid-template-columns: 1fr 1fr; } }
.pk-kpis .ok { background: #e6f4ea; } .pk-kpis .warn { background: #fdf3dc; } .pk-kpis .bad { background: #fdebe7; color: #a32d2d; }
.pk-share { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pk-share .btn.on { background: var(--side); color: #fff; }
.fm-mv { white-space: nowrap; text-align: center; } .fm-mv .icon-btn { font-size: 11px; padding: 2px 4px; }
th.c-mv { width: 62px; }
tr.fm-total td { background: var(--soft); font-weight: 600; }
.pk-share input { width: 110px; text-align: center; }
.bk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.bk-stats > div { background: var(--soft); border-radius: 10px; padding: 8px; text-align: center; }
.bk-stats span { display: block; font-size: 12px; color: var(--muted); } .bk-stats b { font-size: 18px; }
.bk-scope { display: grid; gap: 8px; margin-bottom: 10px; }
.bk-opt { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.bk-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bk-opt.off { opacity: .55; cursor: not-allowed; } .bk-opt span { display: grid; } .bk-opt small { color: var(--muted); }
.bk-enc { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.bk-warn { background: #fdf3dc; color: #7a5200; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.bk-file { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--soft); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.bk-file span:first-child { color: var(--muted); }
.bk-prog { padding: 14px 0; } .bk-bar { height: 10px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bk-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.bk-prog-row { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); }
table.lines .pk-share input { width: 120px; }
.app-ver { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px 2px; font-size: 11px; line-height: 1.4; color: rgba(255,255,255,.6); text-align: center; }
body.nav-folded .app-ver { display: none; }

.pk-grid { align-items: stretch; }
.pk-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 4px; align-content: start; }
.pk-card .pk-cnt, .pk-card .pk-unit { margin: 6px 0; }
.pk .pk-kpis { margin-top: 8px; }
.pk-unit { align-items: center; min-height: 40px; } .pk-unit span { white-space: nowrap; }
.pk-kpis > div { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.pk-kpis b { line-height: 1.2; }

#pk-kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* منع تحديد نص الواجهة بالنقر المزدوج (أزرار، قوائم، عناوين، بطاقات)؛ يبقى التحديد والنسخ في الإدخال والجداول ورسائل المستشار */
body { user-select: none; -webkit-user-select: none; }
input, textarea, select, [contenteditable], table td, table th, pre, code, .adv-msg .b, .adv-f, .selectable { user-select: text; -webkit-user-select: text; }
table th.sortable, table th.c-mv { user-select: none; -webkit-user-select: none; }

/* سند التعبئة: مواد السند القابلة للتعديل */
.pk-rawbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.pk-rawbar .btn { padding: 5px 12px; font-size: 13px; }
.pk-rawd table.lines input[data-f=rcode] { width: 84px; text-align: center; }
.pk-rawd table.lines input[data-f=rqty] { font-size: 15px; font-weight: 600; text-align: center; }
.pk-rawd tr.pk-chg input[data-f=rcode], .pk-rawd tr.pk-chg input[data-f=rqty] { border-color: #e0b04a; background: #fdf7e8; }
.pk-rawd td.c-mv { text-align: center; width: 40px; }

/* إدارة المخزون: بطاقات المخازن (ضغطة تفلتر القائمة) */
.ck.sm-wh { cursor: pointer; }
.ck.sm-wh:hover { border-color: var(--accent); }
.ck.sm-wh.sel { outline: 2px solid var(--accent); background: var(--accent-soft); }

/* الشيكات: لون ثابت لكل حالة (مربعات الحالات، شريط السطر، حبة الحالة) ولون للاستحقاق القريب. الترتيب والأعمدة كما هي. */
.st-all { --sc: #534AB7; }
.st-box, .st-withdrawn, .st-returned_from_customer { --sc: #185FA5; }
.st-deposited, .st-collection { --sc: #BA7517; }
.st-cleared, .st-cashed { --sc: #3B6D11; }
.st-endorsed, .st-endorsed_returned, .st-cash { --sc: #993556; }
.st-returned_from_bank, .st-returned_to_source, .st-returned, .st-returned_from_supplier, .st-stopped { --sc: #A32D2D; }
.st-issued, .st-reissued { --sc: #534AB7; }
.chq-tabs button.chq-box { border-top: 3px solid var(--sc, var(--line)); }
.chq-tabs button.chq-box:hover:not(:disabled) { border-color: var(--sc, var(--accent)); }
.chq-tabs button.chq-box .l { color: var(--sc, var(--muted)); font-weight: 600; }
.chq-tabs button.chq-box.on { background: var(--sc, var(--accent)); border-color: var(--sc, var(--accent)); }
.chq-tabs button.chq-box.on .l, .chq-tabs button.chq-box.on b, .chq-tabs button.chq-box.on small { color: #fff; }
.chq-tabs button.chq-box.done:not(.on) .l { color: var(--muted); }
.chq-table tbody tr[class*="st-"] > td:first-child { border-inline-start: 4px solid var(--sc, transparent); }
.chq-table .badge.chq-st { background: color-mix(in srgb, var(--sc, #888) 14%, transparent); color: color-mix(in srgb, var(--sc, #555) 82%, black); font-weight: 600; }
.chq-table td.chq-soon { color: #854F0B; font-weight: 600; }

/* إدارة المخزون: ألوان بنفس طريقة الشيكات (العرض كما هو). لكل مخزن لون، وشريط على السطور التي تحتاج نظرة. */
.ck.sm-wh, .ck.sm-items { border-top: 3px solid var(--sc, var(--line)); }
.ck.sm-items { --sc: #5F5E5A; }
.ck.sm-wh > span { color: var(--sc); font-weight: 600; }
.ck.sm-wh:hover { border-color: var(--sc); }
.ck.sm-wh.sel { background: var(--sc); border-color: var(--sc); outline: none; }
.ck.sm-wh.sel > span, .ck.sm-wh.sel > b, .ck.sm-wh.sel > small { color: #fff; }
.pc-table tbody tr.sm-neg > td:first-child { border-inline-start: 4px solid #A32D2D; }
.pc-table tbody tr.sm-nocost > td:first-child { border-inline-start: 4px solid #BA7517; }
.pc-table tbody tr.sm-above > td:first-child { border-inline-start: 4px solid #185FA5; }
.pc-table td.sm-use { color: #0F6E56; }
.cash-acc b.pos { color: #0F6E56; }

/* سند التعبئة: ألوان (العرض كما هو). لون لكل صنف معبأ، ولكل قسم، وأسهم نقل المواد. */
.pk-card { border-top: 3px solid var(--sc, var(--line)); }
.pk-card h4 { color: var(--sc, inherit); }
.pk-card.on { border-color: var(--sc, var(--accent)); border-top-width: 3px; }
.pk-card:hover { border-color: var(--sc, var(--accent)); }
.pk-card .pk-cnt input:focus { border-color: var(--sc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc, var(--accent)) 18%, transparent); }
.pk-unit { background: color-mix(in srgb, var(--sc, var(--accent)) 13%, transparent); color: var(--sc, var(--accent)); }
.pk-kpis .a { background: color-mix(in srgb, var(--sc, var(--accent)) 13%, transparent); color: var(--sc, var(--accent)); }
.pk-kpis .a span { color: var(--sc, var(--accent)); }
.pk-kpis .pk-more { background: #FAEEDA; } .pk-kpis .pk-more b { color: #854F0B; }
.pk-kpis .pk-less { background: #E6F1FB; } .pk-kpis .pk-less b { color: #0C447C; }
.pk .pk-sec { border-top: 3px solid var(--sc, var(--line)); }
.pk .pk-sec:nth-of-type(1) { --sc: #185FA5; } .pk .pk-sec:nth-of-type(2) { --sc: #3B6D11; } .pk .pk-sec:nth-of-type(3) { --sc: #BA7517; } .pk .pk-rawd { --sc: #534AB7; }
.pk .pk-n { background: color-mix(in srgb, var(--sc, var(--accent)) 15%, transparent); color: var(--sc, var(--accent)); font-weight: 600; }
.pk h4.sec { color: var(--sc, var(--side)); }
.pk-rawd > summary { color: var(--sc); }
.pk-rawd td.c-mv, .pk-rawd th.c-mv { width: 96px; white-space: nowrap; text-align: center; }
.pk-rawd .c-mv .icon-btn { font-size: 12px; padding: 3px 6px; border-radius: 6px; }
.pk-rawd .c-mv .icon-btn[data-action=pk-raw-up], .pk-rawd .c-mv .icon-btn[data-action=pk-raw-down] { color: #185FA5; }
.pk-rawd .c-mv .icon-btn[data-action=pk-raw-up]:hover:not(:disabled), .pk-rawd .c-mv .icon-btn[data-action=pk-raw-down]:hover:not(:disabled) { background: #E6F1FB; }
.pk-rawd .c-mv .icon-btn[data-action=pk-raw-del] { color: #A32D2D; }
.pk-rawd .c-mv .icon-btn[data-action=pk-raw-del]:hover { background: #FCEBEB; }
.pk-rawd .c-mv .icon-btn:disabled { opacity: .3; cursor: default; }
.pk-rawd tr[data-r]:hover > td { background: color-mix(in srgb, #534AB7 6%, transparent); }
.pk-rawbar .btn[data-action=pk-raw-add] { color: #185FA5; border-color: #85B7EB; }
.pk-rawbar .btn[data-action=pk-raw-last] { color: #0F6E56; border-color: #5DCAA5; }
.pk-rawbar .btn[data-action=pk-raw-reset] { color: #5F5E5A; }
.pk-rawbar .btn[data-action=pk-raw-adopt] { color: #3B6D11; border-color: #97C459; }

.pk-rawd tfoot tr.pk-tot td { background: color-mix(in srgb, #534AB7 12%, #fff); color: #3C3489; font-weight: 700; font-size: 15px; padding: 8px 10px; border-top: 2px solid #534AB7; }
.pk-rawd tfoot tr.pk-tot td:first-child { text-align: start; }

.rep-note-i { display: inline-block; white-space: nowrap; margin-inline-end: 18px; }

/* print/PDF: no scroll box around a report table (it was cut at the sides and drew a scrollbar); fitWide shrinks a wide table to the page */
@media print { #print-area .table-wrap { overflow: visible; } }

/* سند الصرف (simple page): one header row, cash / card, one total; extra options folded */
.ev .ev-head { display: grid; grid-template-columns: 110px 160px 1fr 90px; gap: 18px; align-items: end; margin-bottom: 14px; }
.ev .ev-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev .ev-f > span { font-size: 12px; color: var(--muted); }
.ev .ev-f > input, .ev .ev-f > textarea { border: 0; border-bottom: 1.5px solid var(--field-line); border-radius: 0; background: transparent; padding: 5px 2px; }
.ev .ev-f > input:focus, .ev .ev-f > textarea:focus { outline: none; border-bottom-color: var(--accent); }
.ev .ev-method { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ev .ev-method > span:first-child { color: var(--muted); font-size: 13px; }
.ev .ev-seg { display: inline-flex; border: 1.5px solid var(--accent); border-radius: 10px; overflow: hidden; }
.ev .ev-seg button { border: 0; background: transparent; color: var(--accent); padding: 6px 22px; font: inherit; cursor: pointer; }
.ev .ev-seg button + button { border-inline-start: 1.5px solid var(--accent); }
.ev[data-method=cash] [data-m=cash], .ev[data-method=card] [data-m=card], .ev[data-method=both] [data-m=both] { background: var(--accent); color: #fff; }
.ev[data-method=card] .ev-cash, .ev[data-method=cash] .ev-card { display: none; }
.ev .ev-pay { margin-bottom: 12px; }
.ev .ev-box { max-width: 360px; margin-bottom: 8px; }
.ev .ev-hint { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ev .ev-tbl input, .ev .ev-tbl select { border: 0; border-bottom: 1.5px solid var(--field-line); border-radius: 0; background: transparent; }
.ev:not(.ev-more) .ev-cashtbl :is(th, td):nth-child(4), .ev:not(.ev-more) .ev-cashtbl :is(th, td):nth-child(5),
.ev:not(.ev-more) .ev-cardtbl :is(th, td):nth-child(5), .ev:not(.ev-more) .ev-cardtbl :is(th, td):nth-child(6) { display: none; }
.ev .ev-foot { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: end; margin-top: 6px; }
.ev .ev-total { display: flex; flex-direction: column; align-items: flex-end; }
.ev .ev-total span { font-size: 12px; color: var(--muted); }
.ev .ev-total b { font-size: 24px; font-weight: 600; color: var(--accent); }
.ev .ev-more-btn { margin-top: 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; padding: 4px 0; }
.ev .ev-more-btn:hover { color: var(--accent); }
.ev .ev-extra { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ev.ev-more .ev-extra { display: block; }
.ev .ev-extra .cur-totals { margin-top: 8px; }
@media (max-width: 800px) { .ev .ev-head { grid-template-columns: 1fr 1fr; } .ev .ev-foot { grid-template-columns: 1fr; } }

/* "آخر مستند / آخر صنف": the last number reached, above a new document */
.last-doc { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.last-doc b { font-size: 16px; font-weight: 700; }
.last-doc span { color: var(--muted); font-size: 13px; }
.last-doc:hover { border-color: var(--accent); }
.last-doc.none { cursor: default; color: var(--muted); background: var(--soft); border-color: var(--line); }

/* خيارات التقارير: أقسام قابلة للطي وأزرار الفترة السريعة */
.rep-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.rep-fold { margin-top: 12px; border: 1px solid var(--border, #e2e6ec); border-radius: 10px; padding: 0 12px; background: var(--surface, #fff); }
.rep-fold > summary { cursor: pointer; padding: 10px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.rep-fold > summary::-webkit-details-marker { display: none; }
.rep-fold > summary::after { content: '▾'; color: var(--muted, #6b7685); margin-inline-start: 8px; }
.rep-fold[open] > summary::after { content: '▴'; }
.rep-fold > summary small { color: var(--muted, #6b7685); font-weight: 400; margin-inline-start: auto; padding-inline: 8px; }
.rep-fold > .doc-grid, .rep-fold > .rep-checks { padding: 4px 0 12px; }


/* سند الصرف: المبلغ بعرض صغير، ثم العملة، ثم حساب البنك بخط واضح */
.ev .ev-tbl { width: auto; min-width: 0; }
.ev .ev-tbl input[data-f=amount] { width: 130px; font-size: 15px; font-weight: 600; text-align: center; }
.ev .ev-tbl select[data-f=currency_id] { width: 100px; }

/* تقرير طويل على الشاشة: أول الأسطر فقط مع زر عرض المزيد */
.rep-more { margin: 10px 0 4px; padding: 8px 12px; border: 1px dashed var(--hc2, #9cc6f5); border-radius: 8px; background: var(--hc4, #f3f9ff); color: var(--hct, #134f9e); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* سند القبض/الدفع المبسّط */
.vr:not(.vr-fx) .fx { display: none; }
.vr table.lines { width: auto; min-width: 0; }
.vr #v-cash input[data-f=amount], .vr #v-cheques input[data-f=amount] { width: 130px; font-size: 15px; font-weight: 600; text-align: center; }
.vr #v-cash select[data-f=currency_id] { width: 100px; }
.vr .cur-totals .after { font-weight: 600; }
/* الترويسة بسطر واحد: خانة الزبون تتقلّص بدل أن ينزل الرصيد والحالة لسطر ثان */
.vr-head > .hs-row { flex-wrap: nowrap; }
.vr-head .hs-cell.grow { flex: 1 1 0; min-width: 0; }
.vr-head .acc-pick { min-width: 0; flex-wrap: nowrap; }
.vr-head .hs-cell > .v { flex-wrap: nowrap; }
.vr-head .acc-pick input { min-width: 0; }
.vr-head input.num-sm { width: 90px; }
.vr-head input[type=date] { width: 135px; }

/* سند الإنتاج والتعبئة: جدول المواد الخام أوضح وأكبر */
.pk-rawd table.lines { font-size: 15px; }
.pk-rawd table.lines thead th { font-size: 14px; font-weight: 600; padding: 9px 8px; }
.pk-rawd table.lines tbody td { padding: 7px 8px; }
.pk-rawd table.lines tbody td:nth-child(3) { font-weight: 600; }
.pk-rawd table.lines input[data-f=rqty] { font-size: 15px; font-weight: 600; text-align: center; }
.pk-rawd table.lines input[data-f=rcode] { font-size: 15px; font-weight: 600; }
.pk-rawd small.pk-fq { font-weight: 500; font-size: 12px; }
.pk-rawd .c-mv .icon-btn { opacity: .45; transition: opacity .12s; }
.pk-rawd tr:hover .c-mv .icon-btn { opacity: 1; }
.pk-rawd tfoot tr.pk-sub td { font-weight: 600; font-size: 15px; padding: 8px 10px; }
.pk-rawd tfoot tr.pk-grand td { font-weight: 700; font-size: 16px; padding: 10px; }
.pk-whbox { display: flex; flex-direction: column; gap: 4px; max-width: 320px; margin-bottom: 8px; }

/* مربع البنك: خانة رمز صغيرة وقائمة بنك أوسع */
.bank-pick { align-items: center; }
.bank-pick .bank-no { width: 56px !important; flex: none; text-align: center; }
.bank-pick .bank-sel { flex: 1; min-width: 150px; }
.vr table.lines select[data-f=currency_id] { min-width: 112px; padding-inline-end: 22px; }

/* مخزن الصنف في سطر الفاتورة: أيقونتا «تغيير» والتنبيه صغيرتان */
.wh-chg, .wh-split { padding: 0 4px; min-width: 0; height: 20px; font-size: 12px; line-height: 1; }
.wh-split { color: #b45309; }
#lines select[data-f=warehouse_id]:disabled { opacity: .85; }
/* الأيقونتان داخل مربع المخزن (على طرفه) لا تحته: يبقى المربع بارتفاع باقي الخانات ولا يعلو عنها */
#lines td:has(> .wh-chg), #lines td:has(> .wh-split) { position: relative; }
#lines td > .wh-chg, #lines td > .wh-split { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 6px; z-index: 1; }
#lines td > .wh-chg ~ .wh-split { inset-inline-start: 24px; }
#lines td:has(> .wh-chg) select[data-f=warehouse_id], #lines td:has(> .wh-split) select[data-f=warehouse_id] { padding-inline-start: 24px; }
#lines td:has(> .wh-chg):has(> .wh-split) select[data-f=warehouse_id] { padding-inline-start: 42px; }
/* فاتورة المبيعات: عرض المخزن يتسع لاسمه مع الأيقونة، والوحدة قريبة منه */
table.lines.invl th.c-wh { width: 150px; min-width: 150px; }
table.lines.invl th.c-unit { width: 110px; min-width: 110px; }

/* تنبيه فشل الحفظ + صيانة البرنامج */
#save-alert { position: sticky; top: 0; z-index: 9999; background: #b3261e; color: #fff; padding: 10px 16px; font-size: 14px; line-height: 1.7; }
#save-alert .btn { margin-inline-start: 8px; }
#save-alert .muted { color: #ffd9d6; font-size: 12px; }
.hm-maint { display: flex; align-items: center; gap: 14px; padding: 4px 2px; }
.hm-maint .warn { color: #a05a00; }
.mt-steps { display: grid; gap: 8px; margin: 6px 0 10px; }
.mt-step { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.mt-step span { width: 22px; text-align: center; }
.mt-step.now { color: var(--ink); font-weight: 700; }
.mt-step.ok { color: var(--ink); } .mt-step.ok span { color: #1e8e4e; }
.mt-ready { display: flex; gap: 12px; align-items: center; background: #e6f4ea; border-radius: 12px; padding: 12px 14px; }
.mt-ready > span { font-size: 34px; color: #1e8e4e; line-height: 1; }
.mt-ready h3 { margin: 0 0 4px; color: #17653a; }
.mt-h { margin: 14px 0 6px; }
.mt-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 2px; }
.mt-acts { display: flex; gap: 8px; flex: none; }
.mt-fixed { color: #1e8e4e; }
/* بطاقة الصنف الجديدة: سطر آخر صنف أوضح */
.it-last { font-size: 15px; padding: 10px 16px; border-width: 2px; }
.it-last b { font-size: 20px; }

/* حركات الصنف: فلاتر وبطاقات */
.sm-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.sm-per { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.sm-per input { height: 32px; }
.sm-sum { margin-bottom: 12px; }

.hm-side { display: grid; justify-items: end; gap: 6px; text-align: end; }
.hm-side .hm-maint { flex-direction: column; align-items: flex-end; gap: 4px; padding: 0; }
.hm-side #hm-maint-last { font-size: 12px; }

/* شاشة الدخول: نموذج + لوحة العلامة (ألوانها من شعار ديكو) */
.boot-cover { position: fixed; inset: 0; z-index: 1100; background: var(--side); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 14px; }
.boot-mark { width: 58px; height: 58px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font: 700 28px/58px var(--title-font); text-align: center; }
.login-overlay { background: color-mix(in srgb, var(--side) 9%, #fff); transition: opacity .25s; padding: 16px; box-sizing: border-box; }
.login-overlay.out { opacity: 0; pointer-events: none; }
.login-overlay [hidden] { display: none !important; }
.login-split { width: 860px; max-width: 100%; min-height: 470px; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; animation: loginIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes loginIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.login-box { width: auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 34px 44px; text-align: start; min-width: 0; }
.login-box.shake { animation: loginShake .4s; }
@keyframes loginShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.login-logo { height: 76px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.login-ver { font-size: 12px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.login-head { display: grid; gap: 2px; }
.login-hi { margin: 0; font: 700 22px/1.4 var(--title-font); color: var(--ink); }
.login-co { color: var(--muted); font-size: 14px; }
.login-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: var(--soft); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 14px; }
.login-av { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.login-link { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; }
.login-fld { display: grid; gap: 5px; }
.login-fld label { font-size: 13px; color: var(--muted); }
.login-box input[name=username], .login-pw input { width: 100%; box-sizing: border-box; height: 44px; font-size: 15px; }
.login-box input:focus-visible, .login-eye:focus-visible, .login-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
.login-box input[aria-invalid=true] { border-color: #b42318; }
.login-pw { position: relative; }
.login-pw input { padding-inline-end: 44px; }
.login-eye { position: absolute; inset-inline-end: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.login-eye:hover { color: var(--ink); background: var(--soft); }
.login-eye svg { width: 20px; height: 20px; }
.login-caps { color: #8a5a00; font-size: 13px; }
.login-err { color: #b42318; font-size: 13px; }
.login-rem { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.login-go { height: 46px; font-size: 16px; }
.login-go[aria-busy] { display: inline-flex; align-items: center; justify-content: center; gap: 10px; opacity: 1; cursor: progress; }
.login-spin { width: 22px; height: 22px; flex: none; animation: loginSpin .8s linear infinite; }
@keyframes loginSpin { to { transform: rotate(360deg); } }
.login-box.busy { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .login-spin { animation: loginPulse 1.2s ease-in-out infinite; } @keyframes loginPulse { 50% { opacity: .35; } } }
.login-brand { position: relative; overflow: hidden; background: var(--side); color: #fff; display: flex; align-items: flex-end; padding: 30px; }
.lb-c { position: absolute; border-radius: 50%; }
.lb-1 { width: 230px; height: 230px; background: #2f6fb3; top: -60px; inset-inline-end: -50px; opacity: .92; }
.lb-2 { width: 150px; height: 150px; background: #f08a1c; top: 90px; inset-inline-end: 120px; opacity: .92; }
.lb-3 { width: 110px; height: 110px; background: #7ab82c; top: 30px; inset-inline-end: 200px; opacity: .92; }
.lb-4 { width: 90px; height: 90px; background: #9aa6b2; top: 215px; inset-inline-end: 40px; opacity: .8; }
.lb-txt { position: relative; display: grid; gap: 2px; }
.lb-txt b { font: 700 30px/1.3 var(--title-font); }
.lb-txt span { font-size: 15px; opacity: .85; }
@media (max-width: 760px) { .login-split { grid-template-columns: 1fr; min-height: 0; } .login-brand { display: none; } .login-box { padding: 28px 24px; } }
@media (prefers-reduced-motion: reduce) { .login-split, .login-box.shake { animation: none; } }

/* زر الصيانة في رأس الواجهة الرئيسية */
.hm-maint-btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); color: var(--accent); border-radius: 14px; padding: 8px 16px 8px 14px; cursor: pointer; font: inherit; text-align: start; transition: transform .2s, box-shadow .2s, background .2s; }
.hm-maint-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent); }
.hm-maint-btn:active { transform: none; }
.hm-maint-btn svg { flex: none; }
.hm-maint-btn span { display: grid; line-height: 1.35; }
.hm-maint-btn b { font-size: 14px; }
.hm-maint-btn small { font-size: 12px; color: var(--muted); }
.hm-maint-btn small.warn { color: #a05a00; }

/* ضبط المخازن */
.wfx-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.wfx-warn { color: #a05a00; font-size: 13px; }
.wfx-sec { margin-top: 12px; }
.wfx-done { margin-bottom: 12px; background: #e6f4ea; border-color: #b7dfc3; color: #17653a; }
.wfx-done a { color: inherit; font-weight: 700; }

/* قائمة الحساب (الأيقونة بجانب الجرس) + حول التطبيق */
.av-wrap { position: relative; flex: none; }
.av-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 10px 28px rgba(20, 40, 70, .18); z-index: 60; }
.av-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.av-head b { font-size: 15px; color: var(--ink); }
.av-head span { font-size: 12px; color: var(--muted); }
.av-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: start; }
.av-item:hover { background: var(--hover, rgba(24, 95, 165, .08)); }
.av-item svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.av-item.av-out { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 12px; }
.av-item.av-out svg { color: #b42318; }
.about .ab-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.about .ab-row span { color: var(--muted); }
.about .form-actions { margin-top: 14px; justify-content: center; }

.wmg-move td { background: rgba(24, 95, 165, .07); }

.pk-chip { display: inline-block; padding: 1px 8px; margin: 1px 2px; border-radius: 10px; background: var(--surface-2, #eef1f4); font-size: .85em; }

.sm-zero { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* إدارة المخزون: خط أكبر وأوضح في الجدول والبطاقات */
.sm-page .ck b { font-size: 24px; }
.sm-page .ck > span { font-size: 16px; }
.sm-page .ck b span { font-size: inherit; } /* الأرقام (money) داخل b بنفس حجم رقم عدد الأصناف */
.sm-page .ck small { font-size: 14px; }
.sm-page .pc-bar input, .sm-page .pc-bar select, .sm-page .sm-zero { font-size: 16px; }
.sm-page .pc-table th { font-size: 15px; padding: 11px 12px; }
.sm-page .pc-table td { font-size: 17px; padding: 11px 12px; color: var(--text, #1a1a1a); }
.sm-page .pc-table tfoot td { font-size: 17px; }
.sm-legend { margin: 4px 12px 10px; font-size: 14px; color: var(--muted); }
.sm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline: 10px 4px; vertical-align: -1px; }
.sm-dot.neg { background: #c0392b; } .sm-dot.nocost { background: #d9a21b; } .sm-dot.above { background: #2f6fb5; }
.sm-recent summary { cursor: pointer; padding: 6px 4px; }
.sm-recent summary h3 { font-size: 17px; }

/* البنوك والشيكات (قوائم الشيكات وسجل العمليات): خط أكبر وأوضح، بنفس مقاسات إدارة المخزون */
.bkc-page .chq-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 10px; overflow-x: auto; container-type: inline-size; }
.bkc-page .chq-tabs button.chq-box { min-width: 0; }
.bkc-page .chq-tabs button.chq-box { padding: 11px 14px; gap: 3px; }
.bkc-page .chq-tabs button.chq-box .l { font-size: 15px; }
.bkc-page .chq-tabs button.chq-box b { font-size: 24px; }
.bkc-page .chq-tabs button.chq-box small { font-size: 13px; }
@container (max-width: 1000px) { .bkc-page .chq-tabs button.chq-box b { font-size: 20px; } .bkc-page .chq-tabs button.chq-box .l { font-size: 14px; } }
.bkc-page .chq-filters .chq-search input, .bkc-page .chq-filters select, .bkc-page .chq-range input { font-size: 16px; }
.bkc-page .chq-filters .chq-search input, .bkc-page .chq-filters select { height: 44px; }
.bkc-page .chq-table th, .bkc-page .rep-table th { font-size: 14px; padding: 11px 12px; }
.bkc-page .chq-table td, .bkc-page .rep-table td { font-size: 16px; padding: 11px 12px; color: var(--text, #1a1a1a); }
.bkc-page .chq-table tfoot td, .bkc-page .rep-table tfoot td { font-size: 16px; }
.bkc-page .chq-table td small { font-size: 13px; }
.bkc-page .chq-table td.chq-acts-cell { white-space: nowrap; }
.bkc-page .chq-table .btn.small { font-size: 14px; padding: 6px 14px; }
.bkc-page .chq-table .badge { font-size: 14px; padding: 3px 12px; }
.bkc-page .chq-table td:nth-child(3) { white-space: normal; min-width: 150px; }
.bkc-page .chq-table td:not(:nth-child(3)), .bkc-page .chq-table th { white-space: nowrap; }
.bkc-page .chq-table th, .bkc-page .chq-table td { padding-inline: 9px; }
.bkc-page .chq-list { overflow-x: auto; }
.bkc-page .chq-banks { font-size: 15px; gap: 8px 20px; }
.bkc-page .chq-banks b { font-size: 16px; }
.bkc-page .chq-selbar { font-size: 16px; }

/* خيارات التقارير (ما عدا كشف حساب الزبون): خط أكبر، و«تطبيق» بجانب الفترات السريعة */
.rep-form .field > label { font-size: 14px; }
.rep-form input:not([type=checkbox]), .rep-form select { font-size: 16px; }
.rep-form .rep-checks label, .rep-form .checks label { font-size: 16px; }
.rep-form .rep-apply { margin: 12px 0 8px; }
.rep-form .rep-fold > summary { font-size: 16px; }

/* جدول نتيجة التقرير: خط أوضح */
.content .rep-table td { font-size: calc(var(--tb-s) + 1px + var(--rf-d, 0px)); }
.content .rep-table th { font-size: calc(var(--hd-s, var(--tb-s)) + var(--rf-d, 0px)); }

/* التقارير الكبيرة: «تطبيق» وأزرار الفترات السريعة في صف واحد */
.rep-apply { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-apply .rep-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }

/* تقرير عريض (أكثر من 9 أعمدة): يتّسع في الصفحة بلا قص — حشوة أقل وخط 15 ونصوص قابلة للالتفاف (الاسم والرقم يبقيان على سطر واحد) */
.content .rep-table.fit-compact td { font-size: calc(var(--tb-s) + var(--rf-d, 0px)); padding-inline: 6px; }
.content .rep-table.fit-compact th { font-size: calc(var(--hd-s, var(--tb-s)) - 1px + var(--rf-d, 0px)); padding-inline: 5px; white-space: normal; }
.rep-screen .rep-fit.fit-compact td:not(.c-name):not(.c-no):not(.c-date):not(.num):not(.money) { white-space: normal; }
.rep-screen .rep-fit.fit-compact td { max-width: none; }
.rep-screen .rep-fit td.c-date, .rep-screen .rep-fit th.c-date { white-space: nowrap; }

/* تقارير المخزون: «تقارير إضافية» مطوية */
.rp-more { margin-top: 12px; border-top: 0.5px solid var(--border); padding-top: 8px; }
.rp-more summary { cursor: pointer; padding: 6px 4px; font-size: 15px; color: var(--muted); }
.rp-more summary small { margin-inline-start: 6px; }

/* ================= Phone layout (<= 760px): drawer menu, search from an icon, bigger touch targets ================= */
.m-btn, .nav-scrim, .nav-x { display: none; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
  .app, body.nav-folded .app { grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
  /* the menu becomes a drawer from the right (RTL) */
  .sidebar, body.nav-folded .sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 86vw); z-index: 1100; align-items: stretch; padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
    transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; overflow-y: auto; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(8, 24, 44, .5); z-index: 1090; }
  .nav-fold { display: none; }
  .nav-x { display: grid; place-items: center; flex: none; margin-inline-start: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--t-rail) 16%, transparent); color: #fff; cursor: pointer; }
  .nav-x svg { width: 22px; height: 22px; }
  body.nav-folded .brand-txt { display: flex; }
  body.nav-folded .nav-tab .cnt { display: inline; }
  body.nav-folded #nav, #nav { align-items: stretch; overflow: visible; }
  body.nav-folded .nav-tab, .nav-tab { width: 100%; height: 48px; justify-content: flex-start; padding: 0 8px; }
  body.nav-folded .nav-tab .chip { width: 32px; height: 32px; }
  body.nav-folded .nav-tab .lbl { position: static; opacity: 1; transform: none; background: none; padding: 0; font-size: 15px; flex: 1; }
  body.nav-folded .nav-group { height: auto; width: auto; padding: 12px 10px 4px; margin: 0; overflow: visible; font-size: 11px; background: none; }
  .nav-tab.active::before { right: 0; }
  /* top bar */
  .topbar { position: relative; flex-wrap: wrap; gap: 8px; row-gap: 0; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  body.is-home .topbar { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  body.is-home .topbar h1 { display: block; }
  .topbar h1 { flex: 1; min-width: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .m-btn { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--accent); cursor: pointer; }
  .m-btn svg { width: 24px; height: 24px; }
  .m-btn:active { background: var(--accent-soft); }
  .gsearch { display: none; }
  body.gs-open .gsearch { display: flex; position: absolute; inset: 6px 8px; z-index: 5; height: auto; max-width: none; min-width: 0; }
  .gsearch kbd { display: none; }
  .topbar-actions { order: 10; flex: 1 1 100%; justify-content: flex-start; }
  .topbar-actions .btn { margin-top: 8px; }
  .avatar { width: 38px; height: 38px; }
  .tb-bell { padding: 8px; }
  /* content and controls */
  .content { padding: 12px 12px calc(32px + env(safe-area-inset-bottom)); overflow-x: auto; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; min-height: 40px; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 34px; }
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-grid .wide { grid-column: 1 / -1; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal-backdrop { align-items: end; }
  .modal, .modal.wide { width: 100vw; max-height: 92vh; max-height: 92dvh; border-radius: 14px 14px 0 0; }
  .modal-body { padding: 12px; }
  .sticky-notice { top: 64px; max-width: calc(100vw - 24px); }
  /* document toolbar stays at the top like on the computer, only a little tighter so it takes fewer rows */
  .toolbar-doc { gap: 6px; padding: 6px; }
  .toolbar-doc .tb { padding: 6px 8px; font-size: 13px; }
  .toolbar-doc .tb.tb-save { padding: 8px 16px; }
  .toolbar-doc .tb-grp.nav .tb { padding: 6px 7px; }
  /* document header rows: one field per row, label beside the field */
  .hs-cell, .hs-cell.grow, .hs-cell.fix { flex: 1 1 100%; display: grid; grid-template-columns: 112px minmax(0, 1fr); border-inline-start: 0; border-top: 1px solid var(--line); }
  .hs-row > .hs-cell:first-child { border-top: 0; }
  .hs-cell:not(:has(> .l)) { grid-template-columns: minmax(0, 1fr); }
  .hs-cell > .l { white-space: normal; font-size: 13px; }
  .hs-cell > .v { padding: 6px 8px; }
  .hs-cell input.num-sm, .hs-cell input[type=date], .hs-cell .v > input:not([type=checkbox]):not([type=radio]), .hs-cell .v > select { width: 100%; }
  .hs-cell .v input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .hs-cell .v select, .hs-cell .v .btn:not(.icon-btn) { height: 42px; }
  .hs-cell .acc-pick { min-width: 0; width: 100%; }
  .hs-row, .vr-head > .hs-row { flex-wrap: wrap; }
  .vr-head .hs-cell.grow { flex: 1 1 100%; }
  .vr-head .hs-cell > .v { flex-wrap: wrap; }
  .vr-head input.num-sm, .vr-head input[type=date] { width: 100%; }
  .vr-head .acc-pick { flex-wrap: wrap; }
  /* line tables (invoices, vouchers, ...) as cards; data-l on each cell holds the column name (set by app.js) */
  table.lines, table.lines tbody, table.lines tfoot { display: block; width: 100%; max-width: none; }
  table.lines thead, table.lines.invl tfoot { display: none; }
  table.lines tr:not(.acc-pick) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  table.lines td { display: block; padding: 0; min-width: 0; border: 0; background: none; }
  table.lines td:empty { display: none; }
  table.lines td[data-l]:not([data-l=""])::before { content: attr(data-l); display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
  table.lines td[data-l="#"] { grid-column: 1 / -1; color: var(--muted); text-align: start; }
  table.lines td[data-l="#"]:not([data-l=""])::before { content: "سطر "; display: inline; margin: 0; font-size: inherit; }
  table.lines td:has(.acc-pick), table.lines td:has(.lbox), table.lines td:has(textarea), table.lines td:has([data-f=name]), table.lines td:has([data-action=inv-insert-line]), table.lines td:has(> button:only-child) { grid-column: 1 / -1; }
  table.lines td[data-f=total] { font-weight: 600; align-self: end; padding-bottom: 8px; }
  table.lines input, table.lines select { min-height: 42px; }
  /* home */
  .hm { grid-template-columns: minmax(0, 1fr); }
  .hm-hello { flex-wrap: wrap; gap: 8px; }
  .hm-hello h2 { font-size: 21px; }
  .hm-side, .hm-side .hm-maint { justify-items: start; align-items: flex-start; text-align: start; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hm-kpi { padding: 12px; }
  .hm-kpi .v { font-size: 22px; }
  .hm-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hm-quick button { padding: 12px 4px; font-size: 13px; }
  /* home cards stay inside the screen: the chart, the three totals and the document rows no longer push the page sideways */
  .hm-row { grid-template-columns: minmax(0, 1fr); }
  .hm-card { min-width: 0; padding: 14px; }
  .hm-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .hm-sum > div { padding: 6px 8px; min-width: 0; }
  .hm-sum b { font-size: 15px; overflow-wrap: anywhere; }
  .hm-svg { overflow: hidden; }
  .hm-legend { flex-wrap: wrap; }
  /* last documents: line 1 = type, number, party; line 2 = date (start) and amount (end); same columns in every row */
  .hm-li:has(> .hm-badge) { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 8px; align-items: center; padding: 10px 2px; }
  .hm-li:has(> .hm-badge) .pty { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .hm-li:has(> .hm-badge) .t { grid-column: 1 / 3; grid-row: 2; margin: 0 !important; min-width: 0; }
  .hm-li:has(> .hm-badge) .amt { grid-column: 3; grid-row: 2; min-width: 0; text-align: end; }
  .login-overlay { overflow-y: auto; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .sidebar, body.nav-open .sidebar { transition: none; } }

/* خط الجداول لكل شاشة (tablefont.js): تكبير الجدول نفسه بالنص والحشوة، وشريط عائم صغير */
#content table:not(table table) { zoom: var(--tf-s, 1); }
#content.tf-bold table td, #content.tf-bold table th { font-weight: 700 !important; }
.tf-bar { position: fixed; left: 80px; bottom: 24px; z-index: 34; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); opacity: .55; transition: opacity .15s; }
.tf-bar:hover, .tf-bar:focus-within { opacity: 1; }
.tf-bar[hidden] { display: none; }
.tf-bar button { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.tf-bar button:hover { background: var(--soft-2); }
.tf-bar button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tf-bar output { min-width: 36px; text-align: center; font-size: 13px; color: var(--muted); }
@media print { .tf-bar { display: none !important; } }

/* الشركات: نافذة التبديل */
.co-list { display: grid; gap: 8px; margin-bottom: 12px; }
.co-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.co-row.cur { border-color: var(--accent); background: var(--accent-soft); }
.co-name { font-size: 17px; }
.co-act { display: flex; gap: 6px; }

/* شاشة الدخول: أزرار الشركات */
.login-cos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.login-cos > span { color: var(--muted); font-size: 14px; }
.login-co-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 20px; padding: 6px 16px; font-size: 16px; font-weight: 600; cursor: pointer; }
.login-co-btn:hover { background: var(--soft); }
.login-co-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.login-co-btn:disabled { opacity: .6; cursor: wait; }

/* الجوال: اختيار «الزبائن / شجرة الحسابات» بحجم الحقول الأخرى وفي صف واحد مع أيقونات البحث، ثم الرقم والاسم في صف تحته (بدل مربع كبير بعرض كامل) */
@media (max-width: 760px) {
  .hs-cell .v:has(> #party-source) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .hs-cell .v > #party-source { flex: 1 1 120px; width: auto; min-width: 0; height: 38px; font-size: 14px; }
  .hs-cell .v:has(> #party-source) > .acc-pick { display: contents; }
  .hs-cell .v:has(> #party-source) .acc-icons { display: inline-flex; gap: 4px; }
  .hs-cell .v:has(> #party-source) .acc-no { flex: 0 0 110px; width: 110px; min-width: 0; }
  .hs-cell .v:has(> #party-source) .acc-name { flex: 1 1 120px; min-width: 0; width: auto; }
}

/* نسخة الويب: رابط تحميل البرنامج المكتبي تحت نموذج الدخول */

/* مؤشر الانتظار (يظهر إن تأخر الخادم) */
.busy-ind { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--card, #fff); color: var(--text, #222); border: 1px solid var(--line, #ddd); box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 14px; animation: busyIn .2s ease; pointer-events: none; }
.busy-ind[hidden] { display: none; }
.busy-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent-soft, #cfe3f5); border-top-color: var(--accent, #1976d2); animation: spin .8s linear infinite; }
@keyframes busyIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .busy-spin { animation-duration: 2s; } }
.busy-ind.retry { border-color: var(--warn, #e0a800); }
.busy-ind.retry .busy-spin { border-top-color: var(--warn, #e0a800); }
/* تقرير كثير الأعمدة: الرؤوس والنصوص القصيرة في سطر واحد */
.content .rep-table.fit-compact th[data-nw], .content .rep-table.fit-compact td[data-nw], .rep-screen .rep-fit.fit-compact td[data-nw] { white-space: nowrap !important; }
.rep-info { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.rep-info span { background: var(--accent-soft); color: var(--accent); font-size: 13px; padding: 2px 10px; border-radius: 8px; }
.rep-info small { font-size: inherit; opacity: .8; }

/* مربع الصنف في فلاتر التقارير: الحقل مع عدسة بحث بجانبه */
.item-pick-row { display: flex; gap: 6px; align-items: stretch; }
.item-pick-row .item-pick { flex: 1; min-width: 0; }
.item-pick-row .item-code { flex: none; width: 76px; text-align: center; }
.item-pick-box { position: relative; flex: 1; min-width: 0; display: block; }
.item-pick-box .item-pick { width: 100%; padding-inline-end: 38px; }
.item-pick-box .item-pick::-webkit-calendar-picker-indicator { display: none !important; }
.item-lens { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; }
.item-lens:hover { background: var(--line); color: var(--text, inherit); }
.item-lens svg { width: 18px; height: 18px; }

/* شريط تنبيه التحديث الدائم (إصدار قديم) */
.upd-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 24px; background: #fdecea; color: #8a1f17; border-bottom: 1px solid #f2b8b1; font-size: 14px; }
.upd-banner .btn { flex: none; }
