/* =====================================================================
   AE System Online — Design system "حبر" (Ink)
   RTL-first. Light + dark. Two shells: top menu / side menu.
   ===================================================================== */

@font-face { font-family: "Cairo Local"; src: url("../fonts/Cairo-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cairo Local"; src: url("../fonts/Cairo-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cairo Local"; src: url("../fonts/Cairo-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  --font-body: "Almarai", "Cairo Local", system-ui, sans-serif;
  --font-display: "Noto Kufi Arabic", "Cairo Local", "Almarai", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #EEEFF3;
  --surface: #FFFFFF;
  --surface-2: #F4F5F8;
  --surface-3: #E8EAF0;
  --border: #DEE0E7;
  --border-strong: #C7CAD4;
  --text: #15171C;
  --muted: #5A5F6B;
  --faint: #7D828F;

  --primary: #D4461C;
  --primary-hover: #B83A13;
  --primary-soft: #FCE8E1;
  --primary-ring: rgba(212, 70, 28, .22);
  --on-primary: #FFFFFF;
  --accent: #2350D8;
  --accent-soft: #E3E9FB;

  --ok: #17804F;   --ok-soft: #E1F3EA;
  --warn: #A65A06; --warn-soft: #FDF0DC;
  --bad: #C0231A;  --bad-soft: #FBE7E6;
  --info: #2350D8; --info-soft: #E3E9FB;

  --nav-bg: #14161B;
  --nav-2: #1C1F26;
  --nav-text: #F3F4F6;
  --nav-muted: #A0A5B1;
  --nav-hover: #22252D;
  --nav-active: #2C2F38;
  --nav-border: #262932;

  --r-xs: 6px; --r-sm: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 18, 24, .06);
  --shadow: 0 4px 16px rgba(16, 18, 24, .08);
  --shadow-lg: 0 18px 48px rgba(16, 18, 24, .18);
  --h-control: 40px;
  --gap: 16px;
  --topbar-h: 60px;
  --side-w: 256px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0D0F13;
  --surface: #15181E;
  --surface-2: #1B1F26;
  --surface-3: #232830;
  --border: #292E37;
  --border-strong: #363C47;
  --text: #E9EBEF;
  --muted: #9CA2AE;
  --faint: #7E8491;
  --primary: #F0643A;
  --primary-hover: #FF7A52;
  --primary-soft: #3A1E15;
  --primary-ring: rgba(240, 100, 58, .28);
  --accent: #7B97F7;
  --accent-soft: #1D2644;
  --ok: #3DC486;   --ok-soft: #12301F;
  --warn: #F0A43A; --warn-soft: #382A12;
  --bad: #FF6B5E;  --bad-soft: #3A1A18;
  --info: #7B97F7; --info-soft: #1D2644;
  --nav-bg: #0A0B0E;
  --nav-2: #111318;
  --nav-hover: #181B21;
  --nav-active: #20242C;
  --nav-border: #1C1F26;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-density="compact"] { --h-control: 34px; --gap: 12px; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; } h4 { font-size: .92rem; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.ic { flex-shrink: 0; vertical-align: middle; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
th.num { font-family: inherit; direction: inherit; }   /* a column title is words: the numbers font spread its letters (حساب الطيارين) */
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); } .primary-text { color: var(--primary); }
.small { font-size: .86rem; } .tiny { font-size: .78rem; } .big { font-size: 1.15rem; }
.bold { font-weight: 700; } .semi { font-weight: 600; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- layout helpers */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.p-0 { padding: 0 !important; }
.w-100 { width: 100%; }
.text-end { text-align: left; } .text-center { text-align: center; } .text-start { text-align: right; }

/* ---------------------------------------------------------------- shell: common */
.app { min-height: 100vh; }
.content { padding: 24px 28px 48px; max-width: 1560px; margin: 0 auto; width: 100%; }
.content.fluid { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--nav-text); text-decoration: none !important; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--on-primary); font-family: var(--font-display); font-weight: 800; font-size: 14px;
}
.brand-mark:not(.has-logo) { background: linear-gradient(180deg, #FF6B2C, #C42C0A); color: #fff; letter-spacing: .3px;
  text-shadow: 0 1px 2px rgba(110, 20, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px -2px rgba(196, 44, 10, .7); }
.brand-mark.has-logo { background: #fff; overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { min-width: 0; }
.brand-name b { font-family: var(--font-display); font-size: 15px; white-space: nowrap; }
.brand-name small { font-size: 11px; color: var(--nav-muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--nav-border);
  background: transparent; color: var(--nav-text); cursor: pointer; font: inherit; font-size: 13px;
}
.nav-btn:hover { background: var(--nav-hover); }
.nav-btn .dot { position: absolute; top: 7px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--nav-bg); }
.nav-kbd, kbd {
  font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); direction: ltr; white-space: nowrap;
}
.on-dark kbd, .nav-kbd { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--nav-muted); }

.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-family: var(--font-display); font-size: 14px;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 10px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; background: none; color: inherit; font: inherit; }
.user-chip:hover { background: var(--nav-hover); }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-chip .who b { font-size: 13px; }
.user-chip .who small { font-size: 11px; color: var(--nav-muted); }

.shift-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-decoration: none !important; white-space: nowrap;
}
.shift-chip .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.shift-chip.on { background: var(--ok-soft); color: var(--ok); }
.shift-chip.on .pulse { animation: pulse 2s infinite; }
.shift-chip.off { background: var(--warn-soft); color: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.branch-switch {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.branch-switch .lbl { display: flex; flex-direction: column; line-height: 1.1; text-align: right; }
.branch-switch .lbl small { font-size: 10px; color: var(--muted); }
.branch-switch .lbl b { font-size: 13px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); }
.seg button, .seg a {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.seg .on, .seg [aria-pressed="true"], .seg .active { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }
.on-dark .seg { background: rgba(255,255,255,.05); border-color: var(--nav-border); }
.on-dark .seg button { color: var(--nav-muted); padding: 0 9px; }
.on-dark .seg .on, .on-dark .seg [aria-pressed="true"] { background: var(--nav-active); color: var(--nav-text); box-shadow: none; }

/* ---------------------------------------------------------------- shell: top menu */
.topnav {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px;
  height: var(--topbar-h); padding: 0 24px; background: var(--nav-bg); color: var(--nav-text);
}
.topnav .menu { display: flex; align-items: center; gap: 2px; min-width: 0; }
.topnav .menu > .item { position: relative; }
.topnav .menu > .item > a, .topnav .menu > .item > button {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px; border-radius: var(--r-sm);
  color: var(--nav-text); font: inherit; font-size: 13.5px; font-weight: 600; background: transparent; border: 0;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.topnav .menu > .item > a:hover, .topnav .menu > .item > button:hover, .topnav .menu > .item.open > button { background: var(--nav-hover); }
.topnav .menu > .item.active > a, .topnav .menu > .item.active > button { background: var(--nav-active); }
.topnav .menu > .item.active > a::after, .topnav .menu > .item.active > button::after {
  content: ""; position: absolute; bottom: -11px; right: 12px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary);
}
.topnav .menu .chev { color: var(--nav-muted); transition: transform .15s; }
.topnav .menu > .item.open .chev { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 250px; padding: 6px; z-index: 60;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); display: none;
}
.item.open > .dropdown, .menu-wrap.open > .dropdown { display: block; animation: drop .12s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown a, .dropdown button.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text); text-decoration: none !important; font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: right;
}
.dropdown a .ic, .dropdown button.dd-item .ic { color: var(--muted); }
.dropdown a:hover, .dropdown a:focus-visible, .dropdown button.dd-item:hover { background: var(--surface-2); outline: none; }
.dropdown a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.dropdown a.active .ic { color: var(--primary); }
.dropdown a .kbd-end, .side-nav .kbd-end { margin-inline-start: auto; }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown .dd-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.topnav .spacer { flex: 1; }
.topnav .actions { display: flex; align-items: center; gap: 8px; }
.cta-pos {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--on-primary) !important; font-weight: 700; font-size: 13.5px; text-decoration: none !important; white-space: nowrap;
}
.cta-pos:hover { background: var(--primary-hover); }
.cta-pos kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }

.subbar {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); }
.crumbs a { color: var(--muted); }

/* ---------------------------------------------------------------- shell: side menu */
.shell-side { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex-shrink: 0; display: flex; flex-direction: column;
  gap: 14px; padding: 18px 12px 14px; background: var(--nav-bg); color: var(--nav-text); overflow: hidden;
  transition: width .18s ease;
}
.sidebar .brand { padding: 0 6px; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--nav-active) transparent; }
.side-nav a, .side-nav button.grp {
  display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 11px; border-radius: var(--r-sm);
  color: var(--nav-text); font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none !important; border: 0; background: none; cursor: pointer; text-align: right;
}
.side-nav a .ic, .side-nav button.grp .ic { color: var(--nav-muted); }
.side-nav a:hover, .side-nav button.grp:hover { background: var(--nav-hover); }
.side-nav a.active { background: var(--nav-active); }
.side-nav a.active .ic { color: var(--primary); }
.side-nav a.active::before { content: ""; position: absolute; right: 0; width: 3px; height: 22px; border-radius: 3px 0 0 3px; background: var(--primary); }
.side-nav a { position: relative; }
.side-nav a.cta { background: var(--primary); color: #fff; margin: 4px 0 8px; }
.side-nav a.cta .ic { color: #fff; }
.side-nav a.cta:hover { background: var(--primary-hover); }
.side-nav .grp .chev { margin-inline-start: auto; color: var(--nav-muted); transition: transform .15s; }
.side-nav .group.open > .grp .chev { transform: rotate(180deg); }
.side-nav .kids { display: none; flex-direction: column; gap: 1px; margin: 2px 22px 6px 0; padding-right: 10px; border-right: 1px solid var(--nav-border); }
.side-nav .group.open > .kids { display: flex; }
.side-nav .kids a { height: 34px; font-weight: 500; font-size: 13px; color: var(--nav-muted); }
.side-nav .kids a:hover { color: var(--nav-text); }
.side-nav .kids a.active { color: var(--nav-text); background: var(--nav-active); }
.side-nav .kids a.active::before { right: -11px; }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--nav-2); border: 1px solid var(--nav-border); }
.side-foot .row { justify-content: space-between; font-size: 12px; color: var(--nav-muted); }
.side-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--topbar-h);
  padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .user-chip:hover { background: var(--surface-2); }
.topbar .user-chip .who small { color: var(--muted); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 7px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 360px; max-width: 40vw; height: 40px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; font-size: 13px;
}
.search-trigger span { flex: 1; text-align: right; }
.search-trigger:hover { border-color: var(--border-strong); }

html.side-collapsed .sidebar { width: 72px; }
html.side-collapsed .sidebar .brand-name, html.side-collapsed .side-nav .lbl, html.side-collapsed .side-nav .chev,
html.side-collapsed .side-nav .nav-kbd, html.side-collapsed .side-nav .kids, html.side-collapsed .side-foot .row span { display: none; }
html.side-collapsed .side-nav a, html.side-collapsed .side-nav button.grp { justify-content: center; padding: 0; }
html.side-collapsed .side-foot { padding: 8px; align-items: center; }

.mobile-toggle { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head h1 { font-size: 1.55rem; }
.page-head p { color: var(--muted); font-size: 13.5px; }
.page-head .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-control); padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn .ic { color: currentColor; opacity: .85; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--surface); }
.btn-dark:hover { opacity: .9; background: var(--text); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--bad); }
.btn-soft-danger { color: var(--bad); }
.btn-soft-danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.btn-icon { width: var(--h-control); padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn .kbd-in { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,.06); color: inherit; opacity: .8; }
.btn-primary .kbd-in, .btn-dark .kbd-in, .btn-ok .kbd-in { background: rgba(255,255,255,.2); }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-primary); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-danger):not(.btn-ok).loading::after { border-color: var(--text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- cards / stats */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head.flat { border-bottom: 0; padding-bottom: 6px; }
.card-head h2 { font-size: 1rem; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .lbl { font-size: 12.5px; color: var(--muted); }
.stat .val { font-family: var(--font-display); font-size: 1.65rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.stat .val small { font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--muted); margin-inline-start: 4px; }
.stat .note { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .note.up { color: var(--ok); } .stat .note.down { color: var(--bad); }
.stat .note.bad { color: var(--bad); } .stat .note.warn { color: var(--warn); }
.stat .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
.stat.hero { background: var(--nav-bg); border-color: var(--nav-bg); color: var(--nav-text); }
.stat.hero .lbl, .stat.hero .note, .stat.hero .val small { color: var(--nav-muted); }
.stat.hero .ico { background: var(--primary); color: #fff; }
.stat.hero .note.up { color: #5FD89C; }

/* ---------------------------------------------------------------- badges / pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-dark { background: var(--text); color: var(--surface); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.dot-sep::before { content: "•"; margin: 0 6px; color: var(--faint); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .err { font-size: 12px; color: var(--bad); font-weight: 600; }
.req::after { content: " *"; color: var(--primary); }
.input, .select, .textarea, input[type=text].input, input[type=number].input {
  width: 100%; height: var(--h-control); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-left: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237D828F' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); outline: none; }
.input.is-invalid { border-color: var(--bad); }
input.is-invalid, .is-invalid > input { border-color: var(--bad); outline-color: var(--bad); }
.input[readonly] { background: var(--surface-2); }
.input.num, .input[type=number] { font-family: var(--font-mono); }
.input.num::placeholder, .input[type=number]::placeholder, .mono::placeholder { font-family: var(--font-body); letter-spacing: 0; }   /* «امسح او اكتب» was spread letter by letter */
.input-lg { height: 48px; font-size: 16px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group > :last-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group > * + * { margin-right: -1px; }
.pct-group .pct-in { flex: 0 0 74px; width: 74px; text-align: center; background: var(--surface-2); }
.pct-group .pct-in:focus { background: var(--surface); }
.pct-group .pct-sign { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.addon { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-right: 38px; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 18px 0; border-top: 1px dashed var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > h3 { margin-bottom: 12px; font-size: .95rem; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { transform: translateX(-16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--primary-ring); }
.setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .t b { display: block; font-size: 14px; }
.setting-row .t span { font-size: 12.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------------------------------------------------------------- tables */
/* release note: every table's body text is now bold-weight and full-contrast by default (not just on hover) -
   the previous 400-weight small text and hover-only action buttons were hard to read on shared/tablet screens
   (cashiers, warehouse staff) with no reliable hover. Scoped to .table specifically so it doesn't change
   weight/contrast anywhere else in the app (badges, cards, meta text outside tables are unaffected). */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: right; font-weight: 800; font-size: 12.5px; color: var(--text);
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-weight: 700; color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table th.t-num { font-family: var(--font-body); }
.table .t-num { text-align: left; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.table .t-num .sub, .table .t-num small:not(.num) { font-family: var(--font-body); direction: rtl; }   /* words under a number */
.table .t-act { width: 1%; white-space: nowrap; text-align: left; }
.table .t-act .btn { visibility: visible; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--border); }
.table .sub { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table .row-muted td { color: var(--faint); }
.table .small { font-weight: 700; }
.table .muted { font-weight: 600; }
.table .faint { font-weight: 600; }
.table-card { overflow: hidden; }
.table-card .table th:first-child { border-top-right-radius: 0; }

.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .field { min-width: 150px; }
.filters .field.wide { min-width: 260px; flex: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; }
.pager a, .pager span.cur { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; background: var(--surface); }
.pager span.cur { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 700; }
.pager a:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on, .tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.tabs .count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ---------------------------------------------------------------- empty / skeleton / alerts */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--surface-2); color: var(--faint); margin-bottom: 4px; }
.empty b { color: var(--text); font-size: 15px; font-family: var(--font-display); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-xs); height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid transparent; font-size: 13.5px; }
.alert .ic { margin-top: 2px; }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert b { color: inherit; }
.banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; font-size: 13px; font-weight: 600;
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--border);
}
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner a { color: inherit; text-decoration: underline; font-weight: 800; }

/* ---------------------------------------------------------------- modal */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(12, 14, 18, .5); backdrop-filter: blur(2px); overflow-y: auto; }
.modal-root.open { display: flex; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .14s ease-out; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 1100px; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.05rem; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 20px; max-height: calc(88vh - 140px); overflow-y: auto; }
/* a modal body laid out as a column (.col) scrolls as a whole: its parts keep their own height. Without this a part
   with overflow hidden (a table card) was squeezed to a sliver on a laptop screen - the recipe window's ingredients
   showed one cut row and the «ضيف خامة» header disappeared (owner report 2026-10-19) */
.modal-body.col > * { flex-shrink: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-foot .spacer { flex: 1; }

/* ---------------------------------------------------------------- toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 520px; padding: 12px 16px; border-radius: var(--r); background: var(--nav-bg); color: var(--nav-text); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; pointer-events: auto; animation: toastIn .18s ease-out; }
.toast .ic { color: var(--nav-muted); }
.toast.ok .ic { color: #5FD89C; } .toast.bad .ic { color: #FF8A7E; } .toast.warn .ic { color: #F5B94D; }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(12px); opacity: 0; } }

/* ---------------------------------------------------------------- command palette */
.palette { max-width: 640px; }
.palette .p-search { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette .p-search input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.palette .p-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.palette .p-group { padding: 8px 10px 4px; font-size: 11.5px; color: var(--faint); font-weight: 700; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.palette .p-item .ic { color: var(--muted); }
.palette .p-item .p-sub { font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.palette .p-item.on { background: var(--primary-soft); }
.palette .p-item.on .ic { color: var(--primary); }
.palette .p-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }

.shortcuts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.shortcuts-grid .sc { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }

/* ---------------------------------------------------------------- misc components */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.tile-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0; background: var(--surface-2); color: var(--muted); }
.tile-ic.primary { background: var(--primary-soft); color: var(--primary); }
.tile-ic.ok { background: var(--ok-soft); color: var(--ok); }
.tile-ic.bad { background: var(--bad-soft); color: var(--bad); }
.tile-ic.warn { background: var(--warn-soft); color: var(--warn); }
.tile-ic.info { background: var(--info-soft); color: var(--info); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.totals { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.totals .line { display: flex; justify-content: space-between; gap: 12px; }
.totals .line.grand { padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 1.2rem; font-weight: 800; font-family: var(--font-display); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 700; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.chart-box { position: relative; width: 100%; }
.help-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 800; cursor: help; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--muted); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.thumb { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; display: grid; place-items: center; color: var(--faint); }
.menu-wrap { position: relative; display: inline-block; }
.menu-wrap > .dropdown { top: calc(100% + 6px); }
.menu-wrap.left > .dropdown { right: auto; left: 0; }

/* reminder popup */
.reminder { position: fixed; bottom: 20px; right: 20px; z-index: 150; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s ease-out; }
.reminder .rh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--primary); color: #fff; font-weight: 700; }
.reminder .rb { padding: 14px 16px; font-size: 13.5px; }
.reminder .rf { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; background: var(--nav-bg); color: var(--nav-text); overflow: hidden; }
.auth-side h2 { font-size: 2.1rem; line-height: 1.35; max-width: 460px; }
.auth-side h2 em { font-style: normal; color: var(--primary); }
.auth-side .feat { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.auth-side .feat div { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--nav-muted); }
.auth-side .feat b { display: block; color: var(--nav-text); font-size: 14.5px; }
.auth-side .feat .tile-ic { background: var(--nav-active); color: var(--primary); }
.auth-side .grid-art { position: absolute; inset: 0; background-image: linear-gradient(var(--nav-border) 1px, transparent 1px), linear-gradient(90deg, var(--nav-border) 1px, transparent 1px); background-size: 44px 44px; opacity: .5; mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 70%); pointer-events: none; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card .lead { color: var(--muted); }
.auth-foot { font-size: 13px; color: var(--muted); text-align: center; }
/* a <button> made to read exactly like the <a> links beside it in .auth-foot (used for the "معندكش حساب؟"
   modal opener, which can't be a plain <a href> since it has no page of its own to navigate to) */
.link-plain { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-plain:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- error / blocked */
.center-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px; }
.center-page .code { font-family: var(--font-display); font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; }

.clock-chip { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-size: 12px; color: var(--muted); white-space: nowrap; }
.clock-chip b { font-family: var(--font-mono); font-size: 13px; color: var(--text); font-weight: 700; }
.topnav .clock-chip, .on-dark .clock-chip { color: var(--nav-muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .topnav .menu > .item > a, .topnav .menu > .item > button { padding: 0 8px; font-size: 13px; }
  .topnav .menu .item-ic { display: none; }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topnav .menu { display: none; }
  .topnav .mobile-toggle { display: inline-grid; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .search-trigger { width: 220px; }
  .topnav .user-chip .who { display: none; }
  .shell-side .sidebar { position: fixed; right: 0; z-index: 80; transform: translateX(100%); transition: transform .2s; width: 280px; }
  html.nav-open .shell-side .sidebar { transform: none; }
  .topbar .mobile-toggle { display: inline-grid; }
  .mobile-drawer { display: none; }
}
@media (max-width: 760px) {
  /* phones (audit F1-04/05/06): a period switch wraps on its own lines, the period bar and the card-head buttons
     wrap, and a dropdown is never wider than the screen (core/app.js fitDropdown moves it back inside) */
  .seg.seg-wrap { display: flex; flex-wrap: wrap; max-width: 100%; }
  .filters .field:has(> .seg-wrap) { min-width: 0; max-width: 100%; }
  .page-head .period-bar, .page-head .period-bar form { flex-wrap: wrap; max-width: 100%; }
  .page-head .period-bar .input { width: auto; flex: 1 1 130px; min-width: 0; }
  .card-head:has(> .acts-wrap) { flex-wrap: wrap; }
  .card-head .acts-wrap { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .dropdown { max-width: calc(100vw - 16px); }
  .content { padding: 16px 16px 40px; }
  .g2, .g3, .g4, .g5, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .subbar { padding: 8px 16px; flex-wrap: wrap; }
  .topnav { padding: 0 12px; gap: 8px; }
  .topnav .cta-pos span, .topnav .cta-pos kbd { display: none; }
  .topbar { padding: 0 12px; }
  .search-trigger { width: auto; flex: 1; }
  .search-trigger kbd { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .shortcuts-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-root { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-width: none !important; }
  .table .t-act .btn { visibility: visible; }
  /* phone top bar (side shell): icons only, nothing pushes the page sideways */
  .topbar { gap: 6px; }
  .clock-chip { display: none; }
  .topbar .search-trigger { flex: 0 0 auto; width: 38px; padding: 0; justify-content: center; }
  .topbar .search-trigger span, .topbar .user-chip .who, .topbar [data-modal="shortcuts-modal"],
  .topbar > div[style*="width:1px"], .branch-switch .lbl, .branch-switch > svg:last-child { display: none; }
  .shift-chip { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* top shell on a phone: the attendance clock button (layouts/_clock.html) goes icon-only, no shortcuts key */
  .topnav .clock-btn .clock-lbl, .topnav .actions [data-modal="shortcuts-modal"] { display: none; }
  html, body { overflow-x: hidden; }
}

.mobile-drawer {
  /* starts BELOW the header (not top:0) so it never covers/hides the header's own buttons and text (menu
     button, brand, branch/terminal, shift chip, ...) - it used to sit at top:0 with a higher z-index than the
     header, visually swallowing the right side of the header bar behind it (release note).
     --drawer-top is set from JS (core/app.js: syncDrawerTop) to the header's real on-screen bottom edge, which
     --topbar-h alone doesn't capture once a trial/maintenance/notice banner sits above the header (or that
     banner wraps to two lines on a narrow phone) - falls back to --topbar-h before JS runs / if it never does. */
  position: fixed; top: var(--drawer-top, var(--topbar-h)); right: 0; bottom: 0; z-index: 90; width: 300px; max-width: 86vw;
  flex-direction: column; gap: 12px; padding: 16px 12px; background: var(--nav-bg); color: var(--nav-text);
  overflow-y: auto; display: none; box-shadow: -8px 0 24px rgba(0,0,0,.18);
}
/* bug fix: the POS page's menu button (data-toggle-nav) is shown at every screen width (app/templates/pos/index.html
   always renders it, unlike the regular top layout's .mobile-toggle which only appears under 1100px) - but the
   rules that reveal the drawer used to live inside the 1100px media query, so clicking it did nothing on a
   normal-width cashier screen. Unconditional here so the button works at any screen size, on any page. */
html.nav-open .mobile-drawer { display: flex; }
/* scrim dims the page content behind the drawer, same "starts below the header" reasoning as .mobile-drawer
   above (and the same --drawer-top) - the header/banner stay visible and usable while the drawer is open,
   instead of a stale, un-offset scrim leaving a lit-up sliver of page content jammed against the header. */
html.nav-open .scrim { display: block; position: fixed; top: var(--drawer-top, var(--topbar-h)); right: 0; bottom: 0; left: 0; z-index: 70; background: rgba(0,0,0,.4); }
/* "نقطة البيع" stays visible while the rest of the list scrolls (release note): sticky, not pulled out of the
   scroll container, so it keeps its place right under "الرئيسية" until the list scrolls under it, then pins. */
.side-nav a.cta, .mobile-drawer .side-nav a.cta { position: sticky; top: 0; z-index: 2; }

/* ---------------------------------------------------------------- print */
@media print {
  body { background: #fff; }
  .topnav, .subbar, .sidebar, .topbar, .no-print, .toasts, .banner, .page-head .acts, .filters, .pager { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; }
  .shell-side { display: block; }
}

/* platform inbox bell + dismissible notice banners (services/inbox.py) */
.inbox-bell { position: relative; }
.inbox-bell .bell-count { position: absolute; top: 2px; inset-inline-start: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notice-banner .grow { text-align: center; }
.notice-banner .icon-btn { width: 28px; height: 28px; color: inherit; }
.inbox-row.unread { background: var(--primary-soft); }
/* import wizard progress (static/js/core/import.js) */
.imp-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.imp-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.imp-bar span { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.imp-extra .table td { vertical-align: top; }
.imp-units { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--r); }
.imp-units-head { display: flex; flex-direction: column; gap: 2px; }
.imp-unit { display: grid; grid-template-columns: 64px repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; }
.imp-unit-no { padding-bottom: 10px; font-size: .85rem; color: var(--muted); }
.imp-unit .field { margin: 0; }
.imp-unit-more { align-self: flex-start; }
@media (max-width: 640px) {
  .imp-unit { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 8px; border-top: 1px solid var(--border); }
  .imp-unit-no { grid-column: 1 / -1; padding: 0; }
}
.imp-extra tr.is-bad td { background: var(--warn-soft); }

/* purchase invoice: discount on the whole invoice as an amount or a % */
.disc-in { display: inline-flex; align-items: center; gap: 6px; }
.disc-mode, .tax-mode { flex-wrap: nowrap; white-space: nowrap; flex-shrink: 0; }
.disc-mode button, .tax-mode button { height: 28px; padding: 0 9px; font-size: 12px; }
.disc-mode-line { vertical-align: middle; margin-inline-start: 4px; padding: 2px; }
.disc-mode-line button { height: 22px; padding: 0 6px; font-size: 11px; }

/* ---- تثبيت السيستم كبرنامج (static/js/core/install.js) */
.ins-box { position: fixed; z-index: 1200; bottom: 16px; inset-inline: 16px; margin-inline: auto; max-width: 440px; display: flex; gap: 14px;
  align-items: flex-start; padding: 16px 16px 14px; border-radius: var(--r-xl); background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: ins-in .25s ease-out; }
@keyframes ins-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ins-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; direction: ltr;
  background: linear-gradient(145deg, #ff8a3d, #d4461c); color: #fff; font-weight: 800; font-size: 17px; }
.ins-t { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.6; }
.ins-t b { display: block; font-size: 15px; margin-bottom: 2px; }
.ins-t p { margin: 0; color: var(--muted); }
.ins-t ol { margin: 4px 0 0; padding-inline-start: 18px; color: var(--muted); }
.ins-t li { margin: 2px 0; }
.ins-share { vertical-align: -4px; color: #0a84ff; }
.ins-acts { display: flex; gap: 8px; margin-top: 10px; }
.ins-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ins-t b.ins-k, .ins-k { display: inline-grid; margin-bottom: 0; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; line-height: 1; margin: 0 2px; }
.ins-t .ins-note { margin-top: 6px; font-size: 12.5px; }
.ins-box[data-mode="installed"] .ins-ic { background: linear-gradient(145deg, #2fbf71, #17804f); }
/* «ثبت السيستم على جهازك» on top of the user menu (2026-11-04a) */
.dd-install { display: flex; align-items: center; gap: 10px; width: calc(100% - 12px); margin: 4px 6px 6px; padding: 10px 12px; border: 1px solid var(--primary-ring);
  border-radius: var(--r); background: var(--primary-soft); color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: background .15s, border-color .15s; }
.dd-install:hover, .dd-install:focus-visible { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%); outline: none; }
.dd-install[hidden] { display: none; }
.dd-install-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--on-primary, #fff); }
.dd-install-t { display: grid; min-width: 0; line-height: 1.35; }
.dd-install-t b { font-size: 13.5px; }
.dd-install-t small { font-size: 11.5px; color: var(--muted); }
.dd-install[data-mode="installed"] .dd-install-ic { background: var(--ok); }
@media print { .ins-box { display: none !important; } }

/* ---- محلك أونلاين (templates/online_store/*.html) */
.os-hero .card-body { display: flex; gap: 18px; align-items: flex-start; padding: 22px; }
.os-hero h2 { font-size: 20px; margin-bottom: 6px; }
.os-hero-ic { flex: none; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #FF8A3D, #D4461C); }
.os-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 960px) { .os-grid { grid-template-columns: minmax(0, 1fr); } }
.os-link { display: flex; gap: 8px; align-items: center; }
.os-link .input { flex: 1; min-width: 0; }
.os-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.os-qr-row { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.os-qr { flex: none; width: 128px; height: 128px; background: #fff; border-radius: 10px; padding: 4px; border: 1px solid var(--border); }
.os-qr svg { width: 100%; height: 100%; display: block; }
.os-slug { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; }
.os-bulk { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.os-cats { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-bottom: 12px; }
.os-cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r); }
.os-find { display: flex; gap: 8px; margin-bottom: 8px; } .os-find .input { flex: 1; min-width: 0; } .os-find .select { width: 130px; }
.os-products { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); }
.os-p { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.os-p:last-child { border-bottom: 0; } .os-p.off { opacity: .6; }
.os-pn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .os-pn small { font-size: 12px; }
.os-pick input { width: 16px; height: 16px; }
.os-pr { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--muted); cursor: pointer; }
.os-sel-bar { flex-wrap: wrap; }
.os-more { margin: 6px auto; }
.os-sel-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-3); }
.os-sel-bar span { flex: 1; font-weight: 700; }
.os-h { margin: 18px 0 6px; font-size: 14px; color: var(--muted); }
.os-off { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* محلك أونلاين - «شكل الصفحة» (js/pages/online_store_look.js) */
.ol-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 960px) { .ol-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.os-h.mt-0 { margin-top: 0; }
.ol-colors { display: flex; flex-wrap: wrap; gap: 10px; }
/* القالب: a picture of each theme, the picked one framed */
.ol-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ol-th { position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 3px; padding: 6px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); }
.ol-th input { position: absolute; opacity: 0; pointer-events: none; }
.ol-th img { width: 100%; height: auto; aspect-ratio: 120 / 169; object-fit: cover; object-position: top; border-radius: 9px; display: block; background: var(--surface-3); }
.ol-th b { font-size: 13.5px; margin-top: 3px; } .ol-th small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.ol-th:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ol-th:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.ol-sw { position: relative; cursor: pointer; }
.ol-sw input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.ol-sw > span:not(.sr-only) { display: block; width: 36px; height: 36px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ol-sw input[type=radio]:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.ol-sw input[type=radio]:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 4px; }
.ol-custom { display: flex; align-items: center; border-radius: 12px; }
.ol-custom input[type=color] { width: 36px; height: 36px; border: 1px dashed var(--border); border-radius: 12px; padding: 2px; background: var(--surface); cursor: pointer; }
.ol-custom:has(input[type=radio]:checked) input[type=color] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.ol-cover { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ol-cover-prev { width: 220px; max-width: 100%; aspect-ratio: 2.6 / 1; border-radius: var(--r); background: var(--surface-3); overflow: hidden;
  display: grid; place-items: center; text-align: center; padding: 0; }
.ol-cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.ol-cover-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; flex: 1; min-width: 200px; }
.ol-days { display: flex; flex-wrap: wrap; gap: 6px; }
.chk-chip { cursor: pointer; } .chk-chip input { position: absolute; opacity: 0; }
.chk-chip span { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.chk-chip input:checked + span { background: var(--text); color: var(--surface); border-color: var(--text); }
.chk-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.ol-banners { display: flex; flex-direction: column; gap: 12px; }
.ol-bn { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; border: 1px solid var(--border); border-radius: var(--r-lg, 14px); padding: 12px; }
.ol-bn.off { opacity: .6; }
@media (max-width: 760px) { .ol-bn { grid-template-columns: minmax(0, 1fr); } }
.ol-bn-prev { aspect-ratio: 2.4 / 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; text-align: center; }
.ol-bn-prev img { width: 100%; height: 100%; object-fit: cover; }
.ol-bn-txt { width: 100%; height: 100%; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; text-align: right; }
.ol-bn-txt b { font-size: 16px; line-height: 1.3; } .ol-bn-txt span { font-size: 12px; opacity: .9; }
.ol-bcolors { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ol-bc { width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.ol-bc.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.ol-link { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; } .ol-link > * { flex: 1; min-width: 160px; }
.ol-pick { position: relative; }
.ol-pick-dd { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, .15)); max-height: 240px; overflow-y: auto; }
.ol-pick-dd button { display: block; width: 100%; text-align: right; padding: 8px 12px; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.ol-pick-dd button:hover { background: var(--surface-3); }
.seg-sm button { padding: 5px 10px; font-size: 12.5px; }
.os-credit { text-align: center; margin: 22px 0 6px; font-size: 12px; color: var(--muted); }
.os-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.os-tabs .chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text); text-decoration: none; }
.os-tabs .chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.os-search { margin-inline-start: auto; } .os-search .input { width: 260px; max-width: 100%; }
.os-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.os-order { display: flex; flex-direction: column; }
.os-order.st-new { border-color: #E4572E; box-shadow: 0 0 0 2px rgba(228, 87, 46, .15); }
.os-o-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.os-o-total { font-size: 17px; }
.os-o-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.os-o-cust { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.os-o-cust > div { flex-basis: 100%; }
.os-o-items { list-style: none; padding: 0; margin: 0; border-top: 1px dashed var(--border); padding-top: 8px; }
.os-o-items li { display: grid; grid-template-columns: 1fr auto 90px; gap: 8px; font-size: 13.5px; padding: 3px 0; }
.os-o-items li span:last-child { text-align: left; }
.os-o-acts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border); }
/* invoice: QR of the shop page (sales/print_invoice.html) */
.shopqr { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 6px; }

/* محلك أونلاين: the new-order alarm (static/js/core/online_alert.js) - full screen, over everything, until answered */
.oa { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px;
  background: rgba(20, 22, 27, .72); backdrop-filter: blur(3px); animation: oa-bg 1.2s ease-in-out infinite alternate; }
.oa[hidden] { display: none; }
.oa-card { width: min(440px, 100%); background: var(--surface, #fff); color: var(--text, #14161B); border-radius: 26px;
  padding: 28px 22px 18px; text-align: center; border: 4px solid var(--primary); box-shadow: 0 0 0 0 rgba(212, 70, 28, .6), 0 30px 80px rgba(0, 0, 0, .45);
  animation: oa-pulse 1.1s ease-out infinite; }
.oa.in .oa-card { animation: oa-pop .45s cubic-bezier(.2, 1.6, .4, 1) both, oa-pulse 1.1s ease-out .45s infinite; }
.oa-ring { width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--primary); animation: oa-shake 1.1s ease-in-out infinite; }
.oa h2 { font-size: 30px; font-weight: 800; margin: 0 0 6px; color: var(--primary); }
.oa-num { font-size: 20px; font-weight: 800; direction: ltr; margin: 0; }
.oa-who { font-size: 16px; margin: 6px 0 0; }
.oa-tot { font-size: 26px; font-weight: 800; margin: 8px 0 0; }
.oa-more { margin: 6px 0 0; font-weight: 700; color: var(--primary); }
.oa-acts { display: flex; gap: 10px; margin-top: 18px; }
.oa-acts .btn { flex: 1; justify-content: center; font-size: 17px; min-height: 52px; }
.oa-link { display: block; width: 100%; margin-top: 8px; background: none; border: 0; color: var(--muted, #756E63); font: inherit;
  font-size: 13px; text-decoration: underline; cursor: pointer; }
.oa-link[hidden] { display: none; }
@keyframes oa-bg { from { background: rgba(20, 22, 27, .72); } to { background: rgba(160, 45, 12, .72); } }
@keyframes oa-pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 70, 28, .65), 0 30px 80px rgba(0, 0, 0, .45); }
  100% { box-shadow: 0 0 0 26px rgba(212, 70, 28, 0), 0 30px 80px rgba(0, 0, 0, .45); } }
@keyframes oa-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes oa-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg) scale(1.08); } 30% { transform: rotate(12deg) scale(1.08); }
  45% { transform: rotate(-8deg); } 60% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .oa, .oa-card, .oa-ring, .oa.in .oa-card { animation: none; } }
.os-o-docs { background: var(--surface-2); }
.os-users { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; }
.os-users[hidden] { display: none; }
.os-branches { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.os-br { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.os-br-n { min-width: 140px; }
.os-br .os-link { flex: 1; min-width: 200px; margin: 0; }
/* billing: add-on features (services/addons.py) */
.xaddon { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: block; }
.addon-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; }
.addon-t { display: flex; flex-direction: column; gap: 2px; max-width: 520px; }
.addon-t b { font-size: 16px; }
.addon-st { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addon-price { font-size: 18px; } .addon-price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.addon-buy { margin-top: 10px; } .addon-buy > summary { list-style: none; display: inline-flex; cursor: pointer; }
.addon-buy > summary::-webkit-details-marker { display: none; }
.addon-price-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; border-top: 1px solid var(--border); }
.addon-price-row .addon-n { min-width: 120px; align-self: center; }
.addon-price-row .field { min-width: 160px; flex: 1; }
.line-note { height: 30px; margin-top: 4px; font-size: 12.5px; max-width: 260px; }

/* ================================================================ the way in, phase 2 (layouts/app.html .arr):
   the first page after a login starts under the same dark as the login page's cover (auth.css .fx-cover); the dark
   lifts up while the page comes in piece by piece. Only with html.ae-arrive (removed after 2.2 s); never for reduced
   motion. */
.arr { display: none; }
html.ae-arrive .arr { display: block; position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.arr-a { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(212, 70, 28, .26), transparent 340px), var(--nav-bg);
  box-shadow: 0 6px 0 var(--primary); }
.arr-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--nav-text); }
.arr-in .brand-mark { width: 58px; height: 58px; font-size: 20px; border-radius: 16px; box-shadow: 0 16px 40px -14px rgba(212, 70, 28, .9); }
.arr-in b { font-family: var(--font-display); font-size: 18px; }
@keyframes arr-up { to { transform: translateY(-101%); } }
@keyframes arr-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes arr-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
html.ae-arrive .arr-a, html.ae-arrive .arr-in { animation: arr-up .62s .12s cubic-bezier(.7, 0, .2, 1) both; }
/* the page itself: bars first, then the content block by block */
html.ae-arrive .topnav, html.ae-arrive .topbar, html.ae-arrive .subbar, html.ae-arrive .banner { animation: arr-drop .5s .3s cubic-bezier(.2, .8, .2, 1) both; }
html.ae-arrive #main > * { animation: arr-rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .42s; }
html.ae-arrive #main > :nth-child(2) { animation-delay: .5s; } html.ae-arrive #main > :nth-child(3) { animation-delay: .58s; }
html.ae-arrive #main > :nth-child(4) { animation-delay: .66s; } html.ae-arrive #main > :nth-child(5) { animation-delay: .74s; }
html.ae-arrive #main > :nth-child(n+6) { animation-delay: .82s; }
@media (prefers-reduced-motion: reduce) { html.ae-arrive .arr { display: none; } html.ae-arrive * { animation: none !important; } }

/* الفاتورة الالكترونية */
.eta-branch, .eta-device { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.eta-device.new { border-style: dashed; }
.eta-bn { font-size: 15px; }
.eta-key { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-2); padding: 10px; border-radius: 10px; }
.eta-key code { font-size: 14px; word-break: break-all; }
.eta-st { white-space: nowrap; }
.eta-err { color: var(--bad); font-size: 12.5px; }
.eta-json { direction: ltr; text-align: left; background: var(--surface-2); padding: 12px; border-radius: 10px; max-height: 480px; overflow: auto; font-size: 12px; }
.eta-guide h3 { margin-top: 18px; }
.eta-guide ol, .eta-guide ul { padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.eta-guide code { direction: ltr; unicode-bidi: isolate; }

/* the setting the global search jumped to */
.find-flash { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 10px; animation: find-flash 1.2s ease-in-out 3; }
@keyframes find-flash { 0%, 100% { background: transparent; } 50% { background: var(--primary-soft); } }
@media (prefers-reduced-motion: reduce) { .find-flash { animation: none; background: var(--primary-soft); } }

/* phones: a segmented toggle (e.g. the reports' «العرض») wraps instead of pushing the page sideways */
@media (max-width: 600px) {
  .seg { flex-wrap: wrap; max-width: 100%; }
  .filters .field:has(> .seg) { max-width: 100%; min-width: 0; }
}

/* suggestion dropdown for <input list> (core/app.js AE.combo) */
.ae-combo-list { position: absolute; z-index: 60; max-height: 240px; overflow: auto; padding: 4px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .35); display: flex; flex-direction: column; }
.ae-combo-list[hidden] { display: none; }
/* «بحث في القايمة» (select[data-search]) */
.ss-box { position: fixed; z-index: 1200; padding: 6px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.ss-box .ss-q { height: 36px; margin-bottom: 4px; }
.ss-list { max-height: 250px; overflow: auto; }
.ss-list .ae-combo-item.picked { font-weight: 700; color: var(--primary); }
.ss-empty { padding: 10px; color: var(--muted); font-size: 13px; text-align: center; }
select[data-search] { cursor: pointer; }
/* «تقريب السعر» under a % box */
.pr-round { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.pr-round-l { font-size: 12px; color: var(--muted); margin-inline-end: 2px; }
.pr-round button { all: unset; cursor: pointer; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2, var(--muted)); background: var(--surface); }
.pr-round button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pr-round button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* flex: none (2026-11-04b): a long list (every unit / supplier before the first letter) used to squeeze every row into
   the 240px box until only the dots of the letters showed; now each row keeps its height and the list scrolls */
.ae-combo-item { all: unset; flex: none; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 14px; color: var(--text); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-combo-item:hover, .ae-combo-item.on { background: var(--surface-2); }

/* a banner with buttons on a phone: the text gets the full width, the buttons go under it (the pharmacy first-run
   banner was squeezed into a 14-line column between its two buttons) */
@media (max-width: 720px) {
  .banner.banner-wrap { flex-wrap: wrap; }
  .banner.banner-wrap > .grow { flex: 1 1 calc(100% - 32px); }
}
.ae-suggest .ae-sg-item { display: flex; flex-direction: column; gap: 2px; white-space: normal; }
.ae-suggest .l2 { font-size: 12px; color: var(--muted); }
.ae-suggest .have { color: var(--warn); font-weight: 600; }

/* bulk price: a value per price level (products page) */
.seg.seg-wrap { flex-wrap: wrap; }
.bp-lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bp-lv { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.bp-lv-sum { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }

/* a phone (390px): the brand on one line, the shop name shorter and tighter gaps, so the top bar never runs past the
   screen edge (kept last: the general phone rules above set the bar's padding and gaps) */
@media (max-width: 420px) { .brand-name b { font-size: 14px; } .brand-name small { max-width: 92px; } .topnav { padding: 0 10px; gap: 6px; } }

/* «لمين الصنف ده» (templates/crm/_target.html) */
.tg-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.tg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex: none; }
.tg-seg label { position: relative; cursor: pointer; }
.tg-seg input { position: absolute; opacity: 0; }
.tg-seg span { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.tg-seg input:checked + span { background: var(--primary); color: #fff; }
.tg-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.tg-ages { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chip { position: relative; cursor: pointer; }
.tg-chip input { position: absolute; opacity: 0; }
.tg-chip span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface); }
.tg-chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tg-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.in-app [data-install-app] { display: none !important; }

/* ------------------------------------------------------------ «اختصاراتك» (js/core/myshortcuts.js) */
.mk-list { display: grid; gap: 6px; margin-bottom: 10px; }
.mk-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.mk-row .mk-l { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row .muted { flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.mk-row .mk-pin { color: var(--primary); display: inline-flex; }
.mk-actions { gap: 8px; }
.mk-target { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-weight: 700; overflow-wrap: anywhere; }
.mk-combo { text-align: center; font-weight: 800; letter-spacing: .5px; cursor: pointer; }
.mk-pickbar { position: fixed; z-index: 2000; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 24px); padding: 10px 14px; border-radius: 12px; background: #111; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.3); font-weight: 700; }
.mk-pickbar[hidden] { display: none; }
body.mk-picking { cursor: crosshair; }
.mk-hover { outline: 3px solid var(--primary) !important; outline-offset: 2px; }
.pins-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.pin-tile { position: relative; display: flex; align-items: center; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 700; min-width: 0; }
.pin-tile > a { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; }
.pin-tile:hover { border-color: var(--primary); }
.pin-tile .ic { color: var(--primary); flex-shrink: 0; }
.pin-tile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-tile .pin-x { position: absolute; top: 4px; left: 4px; opacity: 0; }
.pin-tile:hover .pin-x, .pin-tile:focus-within .pin-x { opacity: 1; }
@media (hover: none) { .pin-tile .pin-x { opacity: .7; } }

/* «الألوان والمقاسات» picker (js/core/size_grid.js, 2026-10-26) */
.size-grid { display: flex; flex-direction: column; gap: 14px; }
.size-grid .sg-h { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.size-grid .sg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-grid .sg-btn { min-width: 84px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; transition: border-color .12s, background .12s; }
.size-grid .sg-btn b { font-size: 16px; }
.size-grid .sg-btn small { font-size: 11.5px; color: var(--muted); }
.size-grid .sg-btn:hover:not([disabled]), .size-grid .sg-btn:focus-visible { border-color: var(--primary); outline: none; }
.size-grid .sg-color.on { border-color: var(--primary); background: var(--primary-soft); }
.size-grid .sg-size:not([disabled]) small { color: var(--ok, #1a7f37); font-weight: 600; }
.size-grid .sg-btn.out { opacity: .5; cursor: not-allowed; background: var(--surface-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.size-grid .sg-btn.out small { text-decoration: none; }
.size-grid .sg-color.out { cursor: pointer; }
/* محلك أونلاين: «شحن للمحافظات» */
.os-govs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 14px 0 8px; }
.os-govs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.os-gov { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.os-gov .check { min-width: 0; white-space: nowrap; }
.os-gov .input { width: 100%; min-width: 0; height: 34px; }
.os-gov:has(input[type=checkbox]:not(:checked)) { opacity: .55; }
#quickadd-modal .pr-round { margin: -6px 0 10px; }

/* «شاشة كاملة» platform notice (2026-11-02e, layouts/app.html + js/core/notice_modal.js) */
.nm-root { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg, #0b0d12) 45%, transparent); backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1); animation: nm-in .28s ease-out; }
html.nm-open { overflow: hidden; }
.nm-root.nm-out { animation: nm-fade .25s ease-in forwards; }
.nm-card { position: relative; overflow: hidden; width: min(520px, 100%); text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 34px 28px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.28);
  animation: nm-pop .34s cubic-bezier(.2,.9,.3,1.2); }
.nm-glow { position: absolute; inset: -40% -20% auto; height: 220px; border-radius: 50%; opacity: .35; filter: blur(40px);
  background: var(--primary); pointer-events: none; }
.nm-ok .nm-glow { background: var(--ok); } .nm-warn .nm-glow { background: var(--warn); } .nm-bad .nm-glow { background: var(--bad); }
.nm-ic { position: relative; display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; color: #fff;
  background: var(--primary); box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.nm-ok .nm-ic { background: var(--ok); } .nm-warn .nm-ic { background: var(--warn); } .nm-bad .nm-ic { background: var(--bad); }
.nm-tag { position: relative; display: block; margin: 16px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.nm-card h2 { position: relative; margin: 0 0 10px; font-size: 22px; line-height: 1.45; }
.nm-body { position: relative; margin: 0 auto 22px; max-width: 420px; color: var(--text-2, var(--muted)); line-height: 1.9; white-space: pre-line; }
.nm-actions { position: relative; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.nm-actions .btn { min-width: 150px; justify-content: center; }
.nm-foot { position: relative; display: block; margin-top: 16px; color: var(--faint, var(--muted)); font-size: 12px; }
@keyframes nm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nm-fade { to { opacity: 0; } }
@keyframes nm-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .nm-card { padding: 28px 18px 18px; border-radius: 18px; } .nm-actions .btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .nm-root, .nm-card { animation: none; } }
form.live-busy ~ [data-live-part], form.live-busy + [data-live-part] { opacity: .55; transition: opacity .15s; }
/* «سجل المكالمات» (2026-11-02m) */
tr.cl-missed td:first-child { box-shadow: inset 3px 0 var(--bad, #c0392b); }
.cl-note .input { min-width: 170px; }

/* «صور التصنيفات» in محلك أونلاين (2026-11-03b) */
.oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.oc-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-align: center; }
.oc-pic { width: 96px; height: 96px; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.oc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oc-n { font-size: 13.5px; line-height: 1.35; }
.oc-act { display: flex; gap: 6px; align-items: center; }

/* 2026-11-03d: the row you opened stays lit; sortable column titles */
.table tbody tr.row-last > td { background: color-mix(in srgb, var(--primary) 13%, transparent); }
.table tbody tr.row-last > td:first-child { box-shadow: inset -3px 0 0 var(--primary); }
.table thead th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table thead th.sortable:hover { color: var(--primary); }
.table thead th.sortable::after { content: "↕"; opacity: .3; font-size: 11px; margin-inline-start: 4px; }
.table thead th.sorted.desc::after { content: "↓"; opacity: .9; }
.table thead th.sorted.asc::after { content: "↑"; opacity: .9; }
.stk-badge { display: inline-block; min-width: 26px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; background: var(--surface-2, #f1f3f5); color: var(--muted); margin-inline-start: 6px; vertical-align: 1px; }
.stk-badge.zero { background: color-mix(in srgb, var(--warn, #d97706) 16%, transparent); color: var(--warn, #b45309); }
.stk-badge.neg { background: color-mix(in srgb, var(--bad, #dc2626) 15%, transparent); color: var(--bad, #b91c1c); }
.ins-en { font-size: 12px; color: var(--faint); margin: 0 2px; }
/* pinned pages on the dashboard (2026-11-04b): a button like the main ones, right after them, with a small × */
.pin-btn { position: relative; display: inline-flex; }
.pin-btn > .btn .ic { color: var(--primary); }
.pin-btn .pin-x { position: absolute; top: -7px; inset-inline-end: -7px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.pin-btn:hover .pin-x, .pin-btn:focus-within .pin-x { opacity: 1; }
.pin-btn .pin-x:hover { color: var(--bad); border-color: currentColor; }
@media (hover: none) { .pin-btn .pin-x { opacity: .85; } }
/* 2026-11-06 07d «اطبع باركود الأصناف»: the labels page in a window */
.modal.ql-modal { width: min(1180px, 96vw); max-width: none; height: 88vh; display: flex; flex-direction: column; }
.ql-modal .ql-frame { flex: 1; width: 100%; border: 0; border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 var(--r) var(--r); }
/* 2026-11-08e: extra users (billing card + platform pricing card) */
.eu-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.eu-price { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border, #e5e5e5); border-radius: 10px; background: var(--surface-2, transparent); }
.eu-price b { font-size: 1.25rem; } .eu-price small { color: var(--muted, #777); }
.eu-row .eu-n { width: 90px; }
.pp-eu .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.pp-eu .form-grid .full { grid-column: 1 / -1; }
.pp-eu-hint { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 10px; }
.pp-eu > p { margin: 8px 0; }

/* «تخصيص شاشة البيع» link on /settings/pos (services/pos_custom.py) */
.pc-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none; border-color: var(--primary); background: var(--primary-soft); }
.pc-link:hover { box-shadow: 0 0 0 3px var(--primary-ring); }
.pc-link-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
/* 2026-11-11f «الأصناف»: the wide pager (10 numbers, first / last, type a page) */
.pager-wide { flex-wrap: wrap; }
.pager-wide .pages { flex-wrap: wrap; }
.pager-wide .page-jump { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.pager-wide .page-jump .input { width: 72px; height: 32px; padding: 0 8px; text-align: center; }
.pager-wide .page-jump label { color: var(--muted); }
@media (max-width: 640px) {
  .pager-wide { justify-content: center; }
  .pager-wide > span:first-child { flex-basis: 100%; text-align: center; }
  .pager-wide .page-jump { margin-inline-start: 0; }
}
/* sortable column titles */
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; margin: -2px -4px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: var(--r-xs); white-space: nowrap; }
.th-sort:hover { background: var(--surface-2); }
.th-sort svg { opacity: .35; flex: none; }
.th-sort.on { color: var(--primary); }
.th-sort.on svg { opacity: 1; }
/* 2026-11-17n «بدون خصم» on a line of the invoice edit page */
.se-nd { display: inline-flex; gap: 6px; align-items: center; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.se-nd:has(input:checked) { color: #9A5B00; font-weight: 700; }
/* 2026-11-17n «الدفع بالدولار» (js/pages/fx_pay.js): what the treasury pays, dollars × the rate */
.fx-calc { font-weight: 700; color: #15803d; background: color-mix(in srgb, #16a34a 8%, transparent); border-radius: 10px; padding: 8px 12px; min-height: 0; }
.fx-calc:empty { display: none; }
[data-fx-box][hidden], [data-fx-only][hidden] { display: none; }
/* 2026-11-17p «إضافة دين»: the amounts added before, in its window */
.debt-list { border-top: 1px dashed var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.debt-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.debt-row.off { opacity: .6; }
.debt-row.off b { text-decoration: line-through; }
