/* ALmond Store — operations console.
   Warm paper surfaces, teal for anything you can act on, almond amber for the brand.
   Built to be read fast on a Mac and used one-handed in the warehouse. */
:root {
  color-scheme: light;
  --page: #f6f5f2; --surface: #ffffff; --sunken: #f1efea;
  --ink: #1a1815; --ink2: #5b5750; --muted: #8c877e;
  --line: #e4e1da; --grid: #eceae4; --axis: #cfccc4; --border: #e4e1da; --hover: rgba(26,24,21,.045);
  --brand: #c0893f;
  --accent: #0f6f62; --accent-ink: #0b544a; --accent-soft: #e6f1ef;
  --s1: #0f6f62; --s2: #c0893f;
  --good: #15803d; --good-text: #15803d; --good-soft: #e8f3ec;
  --warn: #b45309; --warn-text: #b45309; --warn-soft: #fbf0e2;
  --serious: #c2410c; --crit: #b91c1c; --crit-text: #b91c1c; --crit-soft: #fbeaea;
  --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(26,24,21,.05), 0 1px 1px rgba(26,24,21,.03);
  --nav-h: 54px;
  /* page groups in the side menu: one colour each, so you know where you are at a glance */
  --g-today: #2563eb; --g-sell: #15803d; --g-stock: #d9730d; --g-make: #7c3aed; --g-money: #b8860b; --g-set: #6b7280;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0d0c; --surface: #1a1917; --sunken: #232220;
    --ink: #e9e6e0; --ink2: #a8a39a; --muted: #7d7870;
    --line: #35322e; --grid: #292725; --axis: #4a4641; --border: #35322e; --hover: rgba(255,255,255,.05);
    --brand: #d9a35f; --accent: #2f9d89; --accent-ink: #58c9b4; --accent-soft: #14312c;
    --s1: #2b8d7c; --s2: #b8823f;
    --good: #2f9e52; --good-text: #5bc87d; --good-soft: #16281c;
    --warn: #b07a1e; --warn-text: #e0a33c; --warn-soft: #2b2113;
    --crit: #b4393c; --crit-text: #ef7b7b; --crit-soft: #2b1718;
    --shadow: none;
    --g-today: #6c9cff; --g-sell: #4cc47a; --g-stock: #f0a04b; --g-make: #a78bfa; --g-money: #e2b93b; --g-set: #9ca3af;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0d0c; --surface: #1a1917; --sunken: #232220;
  --ink: #e9e6e0; --ink2: #a8a39a; --muted: #7d7870;
  --line: #35322e; --grid: #292725; --axis: #4a4641; --border: #35322e; --hover: rgba(255,255,255,.05);
  --brand: #d9a35f; --accent: #2f9d89; --accent-ink: #58c9b4; --accent-soft: #14312c;
  --s1: #2b8d7c; --s2: #b8823f;
  --good: #2f9e52; --good-text: #5bc87d; --good-soft: #16281c;
  --warn: #b07a1e; --warn-text: #e0a33c; --warn-soft: #2b2113;
  --crit: #b4393c; --crit-text: #ef7b7b; --crit-soft: #2b1718;
  --shadow: none;
  --g-today: #6c9cff; --g-sell: #4cc47a; --g-stock: #f0a04b; --g-make: #a78bfa; --g-money: #e2b93b; --g-set: #9ca3af;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .sub { color: var(--ink2); }
h1 { font-size: 19px; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; margin: 0; }
.hint { color: var(--ink2); font-size: 12.5px; margin: 2px 0 12px; max-width: 72ch; }
.hint:empty { display: none; }
a { color: var(--accent-ink); }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  height: var(--nav-h); padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
a.brand {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none;
  font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; padding: 4px 8px 4px 4px;
  border-radius: var(--r); margin-right: 6px;
}
a.brand:hover { background: var(--hover); }
.brand .mark { width: 22px; height: 22px; flex: none; }
.brand .eg { color: var(--muted); font-weight: 450; }
.top nav { display: flex; align-items: center; gap: 1px; flex: 1 1 auto; min-width: 0; overflow: hidden; flex-wrap: nowrap; }
.top nav a {
  padding: 6px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none;
  white-space: nowrap; font-size: 13px; font-weight: 500; position: relative;
}
.top nav a:hover { background: var(--hover); color: var(--ink); }
.top nav a.on { color: var(--ink); font-weight: 600; background: var(--hover); }
.top nav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px 2px 0 0; }
.top nav a .dot {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; font-size: 10px;
  text-align: center; margin-left: 5px; background: var(--crit); color: #fff; font-weight: 700; padding: 0 4px;
}
.right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
#syncInfo { font-size: 12px; white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 72px; }

.more { position: relative; flex: none; }
.top .more > a { padding: 6px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 500; }
.top .more > a:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 760px) { .top .more { display: none; } }
/* phone: the More tab's sheet */
#moreSheet .sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; }
#moreSheet .sheet { position: fixed; left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 61; background: var(--surface);
  border-radius: 16px; padding: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.25); max-height: 70vh; overflow: auto; }
#moreSheet .sheet a { display: block; padding: 13px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 500; }
#moreSheet .sheet a + a { border-top: 1px solid var(--grid); }
#moreSheet .sheet a:active { background: var(--hover); }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 10px 30px rgba(26,24,21,.14); padding: 5px; min-width: 190px; z-index: 40;
}
.more-menu a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; }
.more-menu a:hover { background: var(--hover); }

/* ---------------------------------------------------------------- controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 16px; }
.controls label { color: var(--ink2); font-size: 12px; display: flex; align-items: center; gap: 6px; }
select, input[type=date], input[type=number], input[type=text], input[type=password], input[type=search], textarea {
  font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 8px; padding: 6px 9px; min-height: 32px;
}
select { -webkit-appearance: none; appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 8px; padding: 6px 12px; min-height: 32px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- cards and numbers */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.kpis .card, .kpis .kpi { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 13px 16px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpi .lab { color: var(--ink2); font-size: 11.5px; font-weight: 500; }
.kpi .val { font-size: 23px; font-weight: 620; letter-spacing: -.02em; margin-top: 3px; line-height: 1.15;
  font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--muted); font-size: 11.5px; margin-top: 3px; min-height: 16px; }
.up { color: var(--good-text); font-weight: 600; } .down { color: var(--crit-text); font-weight: 600; }

.banner { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  border-radius: var(--r); padding: 10px 13px; margin-bottom: 14px; color: var(--ink); font-size: 13px; }
.banner.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.err { color: var(--crit-text); min-height: 18px; margin-top: 8px; font-size: 13px; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; } svg { display: block; width: 100%; height: auto; }
.tick { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; font-size: 12px; color: var(--ink2); }
.legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top-style: dashed; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--page); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); display: none; white-space: nowrap; z-index: 50; }
.tip b { display: block; font-weight: 600; }
.bars .row { display: grid; grid-template-columns: minmax(90px, 170px) 1fr 96px; align-items: center; gap: 10px; padding: 5px 0; }
.bars .name { color: var(--ink2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 12px; background: var(--sunken); border-radius: 4px; }
.bars .fill { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bars .fill.neg { background: var(--crit); }
.bars .num { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- tables */
.tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tools input[type=search] { min-width: 180px; flex: 0 1 260px; }
.sortby { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink2); }
.sortby select { padding: 5px 28px 5px 8px; font-size: 12.5px; max-width: 190px; }
.dirbtn { font-size: 12px; padding: 5px 10px; }
.bartools { justify-content: flex-end; margin-bottom: 4px; }
.showmore { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 0 2px; border-top: 1px dashed var(--grid); margin-top: 6px; }
.showmore [data-more] { min-width: 140px; }
tr.total td { border-top: 1.5px solid var(--axis); background: var(--sunken); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
thead { background: var(--surface); }
thead th { background: var(--surface); color: var(--ink2); font-weight: 550; font-size: 11.5px;
  letter-spacing: .01em; user-select: none; border-bottom: 1px solid var(--axis); }
/* a long table gets its own scroll box, so the header can stay put while the rows move */
.tall { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.tall thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--axis); }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--ink); }
th:first-child, td:first-child, .l { text-align: left; }
td.num { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--hover); }
tr.total td { font-weight: 650; border-top: 1px solid var(--axis); background: var(--sunken); }
tr.dim td { opacity: .5; }
tr.warnrow td { background: var(--warn-soft); }

.st { display: inline-flex; align-items: center; gap: 6px; }
.ic { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex: none; }
.alert { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--grid); align-items: flex-start; }
.alert:last-child { border-bottom: 0; } .alert .t { font-weight: 600; } .alert .d { color: var(--ink2); font-size: 12.5px; }
.alert a { margin-left: auto; font-size: 12px; white-space: nowrap; }
pre.brief { white-space: pre-wrap; font: inherit; line-height: 1.75; margin: 0; direction: rtl; text-align: right; }
td input[type=number], td input[type=text] { width: 100%; min-width: 70px; text-align: left; }
td input.missing { border-color: var(--warn); background: var(--warn-soft); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink2); }
.saved { color: var(--good-text); font-size: 12px; margin-left: 8px; }
details { color: var(--ink2); font-size: 12.5px; margin-top: 10px; } summary { cursor: pointer; padding: 4px 0; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }
a.skul { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--axis); }
a.skul:hover { border-bottom-style: solid; color: var(--accent-ink); }
ul.plain { margin: 6px 0 0; padding-left: 20px; line-height: 1.8; } ul.plain li { margin: 2px 0; }
textarea { font: inherit; padding: 8px; }

/* spreadsheet-style editing */
.sheet { max-height: 68vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.sheet table { border-collapse: separate; border-spacing: 0; }
.sheet thead th { top: 0; }
.sheet td:first-child, .sheet th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); border-right: 1px solid var(--grid); }
.sheet th:first-child { z-index: 3; }
.sheet td { padding: 0; border-right: 1px solid var(--grid); }
.sheet td:first-child, .sheet td.l { padding: 0 10px; }
.sheet td input[type=text], .sheet td input[type=number], .sheet td select { border: 0; border-radius: 0; background: transparent; height: 36px; padding: 0 10px; width: 100%; }
.sheet td input:focus, .sheet td select:focus { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet td input.missing { background: var(--warn-soft); }
.sheet td input[type=checkbox] { margin: 0 12px; }
.sheet td:nth-child(2) input { text-align: right; font-variant-numeric: tabular-nums; }
.ptools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ptools label { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink2); }

/* tabs inside a page */
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; max-width: 100%; background: var(--sunken); padding: 3px; border-radius: var(--r); border: 0; }
.tb { padding: 6px 12px; border-radius: 7px; color: var(--ink2); text-decoration: none; font-size: 13px; font-weight: 500; }
.tb:hover { color: var(--ink); } .tb.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 200;
  max-width: 100vw; padding: 0 12px;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--page);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 28px rgba(0,0,0,.26);
  animation: toastin .18s cubic-bezier(.2,.8,.2,1); max-width: min(92vw, 460px); }
.toast.bad { background: var(--crit); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; padding: 0; flex: none; }
.toast span { white-space: pre-wrap; }
.toast.stay { align-items: flex-start; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--ink2); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes toastin { from { transform: translateY(10px); opacity: 0 } }

.skel { background: linear-gradient(90deg, var(--sunken) 25%, var(--hover) 37%, var(--sunken) 63%);
  background-size: 400% 100%; animation: sh 1.3s ease infinite; border-radius: 6px; height: 13px; }
@keyframes sh { from { background-position: 100% 0 } to { background-position: 0 0 } }

.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 22px; }

/* ---------------------------------------------------------------- phone */
.tabbar { display: none; }
@media (max-width: 760px) {
  .wrap { padding: 14px 14px calc(78px + env(safe-area-inset-bottom)); }
  .top nav { display: none; }
  .top { height: 52px; }
  #syncInfo { display: none; }
  .top .right .btn { padding: 6px 9px; }
  .top .right .btn .lbl { display: none; }
  .brand .eg { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .card, .kpis .kpi { padding: 11px 13px; }
  .kpi .val { font-size: 19px; } .kpi .note { font-size: 11px; min-height: 0; }
  .card { padding: 14px; border-radius: 12px; }
  h2 { font-size: 15px; }

  table.auto, table.auto tbody, table.auto tr, table.auto td { display: block; width: auto; }
  table.auto thead { display: none; }
  table.auto tr { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; background: var(--surface); }
  table.auto tr:hover td { background: transparent; }
  table.auto td { border: 0; padding: 3px 0; text-align: left !important; white-space: normal;
    display: grid; grid-template-columns: 44% 1fr; gap: 10px; align-items: baseline; }
  table.auto td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; }
  table.auto td:first-child { font-weight: 600; font-size: 14.5px; border-bottom: 1px solid var(--grid);
    padding-bottom: 7px; margin-bottom: 5px; grid-template-columns: 1fr; }
  table.auto td:first-child::before { display: none; }
  table.auto tr.total { background: var(--sunken); }
  .scroll:has(> table.auto) { overflow-x: visible; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tb { white-space: nowrap; }

  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }   /* clear of the bar at the bottom */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
    color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 500; padding: 3px 0; border-radius: 8px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 0; left: 50%; margin-left: 4px; background: var(--crit); color: #fff;
    border-radius: 9px; font-size: 9px; font-weight: 700; padding: 1px 5px; }
}
@media (max-width: 1150px) { #syncInfo { display: none; } }   /* the pages need that space more */
@media (min-width: 761px) and (max-width: 1100px) {
  th, td { padding: 10px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (hover: none) {
  .btn { min-height: 38px; } input, select { min-height: 38px; }
  .tb { padding: 8px 14px; }
}

/* ---------------------------------------------------------------- date picker */
.dp-btn { min-width: 150px; text-align: left; font-variant-numeric: tabular-nums; } .dp-btn.empty { color: var(--muted); }
.dp-ov { position: fixed; inset: 0; z-index: 100; background: rgba(26,24,21,.4); display: flex; align-items: flex-end; justify-content: center; animation: ovin .15s ease-out; }
.dp-ov.top { align-items: flex-start; padding-top: 12vh; }
.dp { width: min(420px, 100%); background: var(--surface); border-radius: 18px 18px 0 0; padding: 14px 16px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); animation: dpin .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 600px) { .dp-ov { align-items: center; } .dp { border-radius: 18px; padding-bottom: 22px; } }
.dp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dp-top b { font-size: 14px; text-align: center; flex: 1; }
.dp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font: inherit; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink2); cursor: pointer; }
.chip:hover { background: var(--hover); color: var(--ink); }
.dp-wheels { position: relative; display: grid; grid-template-columns: 1fr 1.7fr 1.2fr; gap: 4px; height: 200px; }
.dp-band { position: absolute; left: 0; right: 0; top: 80px; height: 40px; background: var(--accent-soft); border-radius: 10px; pointer-events: none; }
.wheel { position: relative; height: 200px; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; outline: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wheel::-webkit-scrollbar { display: none; }
.wpad { height: 80px; } .wi { height: 40px; line-height: 40px; text-align: center; scroll-snap-align: center; font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; user-select: none; }
.wi.sel { color: var(--ink); font-weight: 600; } .wi.off { opacity: .3; }
.wheel:focus-visible { outline: 2px solid var(--accent); border-radius: 10px; }
@keyframes dpin { from { transform: translateY(24px); opacity: .6 } } @keyframes ovin { from { opacity: 0 } }

/* quick search */
.pal { width: min(560px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 56px rgba(0,0,0,.26); overflow: hidden; align-self: flex-start; }
.pal input { width: 100%; border: 0; border-bottom: 1px solid var(--grid); border-radius: 0; padding: 14px 16px; font-size: 16px; background: transparent; outline: none; }
.pal-r { max-height: 50vh; overflow: auto; padding: 6px; }
.pal-g { font-size: 11.5px; color: var(--muted); padding: 8px 10px 4px; }
.pal-i { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.pal-i span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.pal-i.on, .pal-i:hover { background: var(--accent-soft); }

/* pick list */
.room { padding: 16px; } .roomh { font-size: 16px; margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; }
.wall { margin-bottom: 16px; }
.wallh { font-size: 12.5px; font-weight: 600; color: var(--ink2); border-bottom: 1px solid var(--grid); padding-bottom: 5px; margin-bottom: 7px; display: flex; gap: 8px; align-items: baseline; }
.place { padding: 7px 0 9px; } .placeh { font-size: 13px; margin-bottom: 3px; }
table.picks { width: 100%; } table.picks td { border-bottom: 0; padding: 4px 6px; }
table.picks input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

@media print {
  .top, .tabbar, .controls, .tools, .btn, a.btn, .kpis { display: none !important; }
  body { background: #fff; } .card { break-inside: avoid; border: 0; padding: 0 0 10px; box-shadow: none; }
  .room { break-before: page; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* arabic / right-to-left */
[dir=rtl] body { font-family: -apple-system, system-ui, "SF Arabic", "Segoe UI", Tahoma, Arial, sans-serif; }
[dir=rtl] svg, [dir=rtl] .chart, [dir=rtl] .bars .track, [dir=rtl] .dp-wheels { direction: ltr; }
[dir=rtl] .right { margin-left: 0; margin-right: auto; }
[dir=rtl] a.brand { margin-right: 0; margin-left: 6px; }
[dir=rtl] th, [dir=rtl] td { text-align: right; }
[dir=rtl] td.num, [dir=rtl] th.num { text-align: left; direction: ltr; }
[dir=rtl] .top nav a .dot { margin-left: 0; margin-right: 5px; }
[dir=rtl] ul.plain { padding-left: 0; padding-right: 20px; }
[dir=rtl] .dp-btn { text-align: right; }
[dir=rtl] .sheet td:first-child, [dir=rtl] .sheet th:first-child { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--grid); }
[dir=rtl] table.auto td { text-align: right !important; }
[dir=rtl] .alert a { margin-left: 0; margin-right: auto; }
[dir=rtl] .hint, [dir=rtl] .note, [dir=rtl] .banner, [dir=rtl] .alert .t, [dir=rtl] .alert .d,
[dir=rtl] .empty, [dir=rtl] li, [dir=rtl] .muted, [dir=rtl] summary { unicode-bidi: plaintext; }

/* dark mode is read in a dim room: softer text, borders instead of shadows, calmer colour */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .kpis { box-shadow: none; }
  :root:not([data-theme="light"]) .top { background: #141311; }
  :root:not([data-theme="light"]) .bars .track { background: #242220; }
  :root:not([data-theme="light"]) .bars .fill { background: #2b8d7c; }
  :root:not([data-theme="light"]) .card { border-color: #302d29; }
  :root:not([data-theme="light"]) .kpi .val { color: #f0ede7; }
  :root:not([data-theme="light"]) .tick { fill: #8a857d; }
  :root:not([data-theme="light"]) .tip, :root:not([data-theme="light"]) .toast { background: #efece6; color: #191715; }
  :root:not([data-theme="light"]) input, :root:not([data-theme="light"]) select,
  :root:not([data-theme="light"]) textarea { background: #141312; }
  :root:not([data-theme="light"]) .btn { background: #232220; border-color: #3d3935; }
  :root:not([data-theme="light"]) .btn:hover { background: #2b2927; }
  :root:not([data-theme="light"]) .btn.primary { background: var(--accent); border-color: var(--accent); color: #06201c; font-weight: 600; }
  :root:not([data-theme="light"]) .btn.primary:hover { background: var(--accent-ink); }
  :root:not([data-theme="light"]) .tabs { background: #161513; }
  :root:not([data-theme="light"]) .tb.on { background: #2e2c29; }
  :root:not([data-theme="light"]) .sheet td input:focus, :root:not([data-theme="light"]) .sheet td select:focus { background: #16322d; }
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpis { box-shadow: none; }
:root[data-theme="dark"] .top { background: #141311; }
:root[data-theme="dark"] .bars .track { background: #242220; }
:root[data-theme="dark"] .bars .fill { background: #2b8d7c; }
:root[data-theme="dark"] .card { border-color: #302d29; }
:root[data-theme="dark"] .kpi .val { color: #f0ede7; }
:root[data-theme="dark"] .tick { fill: #8a857d; }
:root[data-theme="dark"] .tip, :root[data-theme="dark"] .toast { background: #efece6; color: #191715; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #141312; }
:root[data-theme="dark"] .btn { background: #232220; border-color: #3d3935; }
:root[data-theme="dark"] .btn:hover { background: #2b2927; }
:root[data-theme="dark"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #06201c; font-weight: 600; }
:root[data-theme="dark"] .btn.primary:hover { background: var(--accent-ink); }
:root[data-theme="dark"] .tabs { background: #161513; }
:root[data-theme="dark"] .tb.on { background: #2e2c29; }
:root[data-theme="dark"] .sheet td input:focus, :root[data-theme="dark"] .sheet td select:focus { background: #16322d; }

.login .card label { gap: 5px; color: var(--ink2); }
.login .card input { font-size: 15px; }
.login h1 { margin-bottom: 0; }
.login .sub { margin: 0 0 6px; font-size: 13px; }
.login code { background: var(--sunken); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650; flex: none; }
.rolechip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sunken); color: var(--ink2); }

.loginbox { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login .card { width: 100%; gap: 6px; }
.login .card label { margin-top: 6px; font-weight: 500; }
.login .card input { font-size: 16px; }      /* 16px keeps iOS from zooming the page */
.login .card .btn.primary { margin-top: 14px; justify-content: center; }
.btn.link { background: none; border: 0; color: var(--accent-ink); padding: 6px; min-height: 0; justify-content: center; font-size: 12.5px; }
.btn.link:hover { background: none; text-decoration: underline; }
#httpNote { text-align: center; line-height: 1.6; }

/* camera scanner */
.withcam { display: flex; gap: 6px; } .withcam input { flex: 1; min-width: 0; }
.cambtn { flex: none; padding: 6px 10px; }
.cam-ov { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; }
.cam { display: flex; flex-direction: column; width: 100%; height: 100%; color: #fff; }
.cam-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.cam-top b { flex: 1; font-size: 15px; } .cam-count { font-size: 13px; color: #9fe3d6; font-weight: 600; }
.cam-top .btn { background: #262422; border-color: #3d3935; color: #fff; }
.cam-top .btn.primary { background: var(--accent); border-color: var(--accent); }
.cam-view { position: relative; flex: 1; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 10%; right: 10%; top: 20%; bottom: 20%; border: 2px solid rgba(255,255,255,.85);
  border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.cam-flash { position: absolute; inset: 0; background: #3fbfa8; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: camflash .35s ease-out; }
@keyframes camflash { from { opacity: .45 } to { opacity: 0 } }
.cam-msg { text-align: center; padding: 10px 14px 4px; font-size: 13px; color: #d8d4cc; }
.cam-last { text-align: center; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); font: 600 16px/1.4 ui-monospace, Menlo, monospace; min-height: 24px; color: #fff; }

/* shelf labels */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.label { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "qr text" "bar bar"; align-items: center; gap: 8px 12px; border: 1px dashed var(--axis); border-radius: 10px; padding: 10px; background: #fff; color: #111; break-inside: avoid; }
.label .qr { grid-area: qr; width: 96px; height: 96px; flex: none; }
.label .qr svg { display: block; width: 100%; height: 100%; }
.label .bar { grid-area: bar; height: 44px; }
.label .bar svg { display: block; width: 100%; height: 100%; }
.ltext { grid-area: text; display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.ltext b { font-size: 19px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.ltext span { font-size: 12px; color: #555; }
@media print {
  .noprint { display: none !important; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label { border: 1px dashed #999; padding: 3mm; }
  .label .qr { width: 24mm !important; height: 24mm !important; }
  .label .bar { height: 12mm; }
  .ltext b { font-size: 13pt; white-space: nowrap; }
}

/* icons inside buttons keep their own size; the global svg rule is for charts */
.btn svg { width: auto; height: auto; flex: none; display: block; }
.top .right { flex: none; }
@media (max-width: 760px) {
  #logoutBtn { display: none; }          /* sign out lives on the account page on a phone */
  .top .right { gap: 5px; }
}

/* sales by governorate: tile map + table */
.geo-wrap { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
.gtiles { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 46px; gap: 4px; }
.gtile { border: 1px solid var(--grid); border-radius: 7px; padding: 4px 5px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--sunken); overflow: hidden; color: var(--ink); }
.gtile b { font-size: 9.5px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.gtile span { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.gtile.dark, .gtile.dark span { color: #fff; }
@media (max-width: 760px) { .geo-wrap { grid-template-columns: 1fr; } .gtiles { max-width: 360px; } }

/* size runs: one chip per size, red where a selling size is empty */
.runs { display: grid; gap: 10px; }
.run { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.run-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.run-s { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sz { display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 4px 6px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sz i { font-style: normal; font-weight: 400; font-size: 11px; opacity: .8; }
.sz.hole { background: var(--crit-soft); color: var(--crit-text); outline: 1.5px solid var(--crit); }
.sz.empty { background: var(--sunken); color: var(--muted); }
.bad { color: var(--crit-text); font-weight: 600; }
.toast.bad { color: #fff; }

.cyc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.btn.cyc { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: auto; padding: 10px 12px; text-align: start; }
.warn-t { color: var(--warn-text); }

/* pick list: the confirm bar stays at the bottom of the screen while you walk */
.pickbar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
@media (max-width: 760px) { .pickbar { bottom: 74px; } }
@media print { .pickbar { display: none; } }

/* FBA shipment wizard */
.fsteps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.fsteps li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 13px; }
.fsteps li span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font-weight: 600; font-size: 12px; }
.fsteps li.done { color: var(--accent-ink); background: var(--accent-soft); }
.fsteps li.now { color: #fff; background: var(--accent); }
.fsteps li.now span { color: var(--accent); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); margin-top: 8px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fgroup { border-top: 1px solid var(--grid); padding-top: 10px; margin-top: 10px; }
.fgroup:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
table.boxgrid td, table.boxgrid th { white-space: nowrap; }
table.picks { width: 100%; }
table.picks td { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) { table.picks td { padding-left: 4px; padding-right: 4px; } }

/* production board */
.prod { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 10px; background: var(--surface); }
.prod.late { border-color: var(--crit); }
.prod-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.fsteps li small { opacity: .75; font-size: 11px; }

.updbar { margin: 10px auto; max-width: 1200px; display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }

.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.codes code { font-size: 17px; padding: 8px 10px; background: var(--sunken); border-radius: 8px; text-align: center; letter-spacing: .05em; }
.waytag { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.waytag.fba { background: color-mix(in srgb, var(--s1) 16%, transparent); color: var(--s1); }
.waytag.es { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--ink); }
.seg { display: inline-flex; gap: 6px; }
.trackbar .tb-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; }
.trackbar .track { height: 10px; background: var(--sunken); border-radius: 5px; overflow: hidden; }
.trackbar .fill { height: 100%; background: var(--good); border-radius: 5px; min-width: 2px; }

/* ---------------------------------------------------------------- side menu */
.g-today { --g: var(--g-today); } .g-sell { --g: var(--g-sell); } .g-stock { --g: var(--g-stock); }
.g-make { --g: var(--g-make); } .g-money { --g: var(--g-money); } .g-set { --g: var(--g-set); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 0;
  background: transparent; color: var(--ink2); cursor: pointer; font: inherit; flex: none; position: relative; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.menubtn { display: inline-flex; margin-right: 2px; }          /* always there: it also switches the menu style back */
.menubtn[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: 2px; right: 0; min-width: 15px; height: 15px; line-height: 15px;
  border-radius: 8px; background: var(--crit); color: #fff; font-size: 9.5px; font-weight: 700; padding: 0 3px; text-align: center; }
body.sidemenu .top nav, body.sidemenu .top .more { display: none !important; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 300px; max-width: 86vw; z-index: 70; background: var(--surface);
  border-right: 1px solid var(--line); box-shadow: 8px 0 40px rgba(0,0,0,.18); transform: translateX(-104%); transition: transform .2s ease;
  display: flex; flex-direction: column; visibility: hidden; }
[dir=rtl] .drawer { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); transform: translateX(104%); box-shadow: -8px 0 40px rgba(0,0,0,.18); }
body.dr-open .drawer, body.dr-pinned .drawer { transform: none; visibility: visible; }
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 69; }
body.dr-pinned .drawer { top: var(--nav-h); box-shadow: none; z-index: 20; width: 270px; }
body.dr-pinned .wrap { margin-left: 270px; max-width: none; padding-left: 24px; padding-right: 24px; }
[dir=rtl] body.dr-pinned .wrap { margin-left: 0; margin-right: 270px; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.dr-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--grid); }
.dr-tools { display: flex; align-items: center; gap: 4px; }
.dr-body { overflow-y: auto; padding: 6px 8px 12px; flex: 1; }
.dr-group { margin-top: 10px; }
.dr-gname { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--g); padding: 4px 8px; }
.dr-gname i { width: 10px; height: 10px; border-radius: 3px; background: var(--g); display: inline-block; }
.dr-item { display: block; padding: 7px 10px 8px 26px; border-radius: 9px; text-decoration: none; color: var(--ink); position: relative; }
[dir=rtl] .dr-item { padding: 7px 26px 8px 10px; }
.dr-item:hover { background: var(--hover); }
.dr-item.on { background: color-mix(in srgb, var(--g) 13%, transparent); }
.dr-item.on::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: var(--g); }
[dir=rtl] .dr-item.on::before { left: auto; right: 10px; }
.dr-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.dr-desc { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.dr-badge { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--warn); border-radius: 9px; padding: 0 6px; line-height: 17px; }
.dr-badge.critical { background: var(--crit); }
.dr-foot { border-top: 1px solid var(--grid); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dr-foot .btn { padding: 5px 10px; font-size: 12.5px; }
/* the page you are on: its name, in its group's colour */
.ph { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 2px 0 8px; border-bottom: 2px solid color-mix(in srgb, var(--g) 35%, transparent); }
.ph i { width: 11px; height: 11px; border-radius: 3px; background: var(--g); align-self: center; }
.ph b { font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.ph span { color: var(--muted); font-size: 13px; }
body[data-group] .card > h2 { position: relative; }
body[data-group="today"] { --g: var(--g-today); } body[data-group="sell"] { --g: var(--g-sell); } body[data-group="stock"] { --g: var(--g-stock); }
body[data-group="make"] { --g: var(--g-make); } body[data-group="money"] { --g: var(--g-money); } body[data-group="set"] { --g: var(--g-set); }
body[data-group] #page .card > h2::before { content: ""; display: inline-block; width: 4px; height: 13px; border-radius: 2px; background: var(--g); margin-right: 8px; vertical-align: -1px; }
[dir=rtl] body[data-group] #page .card > h2::before { margin-right: 0; margin-left: 8px; }
td.wrapl { white-space: normal; min-width: 150px; }
.sub3 { font-size: 13px; font-weight: 650; margin: 16px 0 6px; }
.kindgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.kind { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 4px 0; }
.kind input { margin-top: 3px; }

/* ---------------------------------------------------------------- logo and reports */
.brand img.brandlogo { height: 26px; max-width: 120px; object-fit: contain; flex: none; }
.logoprev { width: 160px; height: 70px; border: 1px dashed var(--axis); border-radius: 10px; display: grid; place-items: center; padding: 6px; background: var(--sunken); }
.logoprev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.rtile { text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
[dir=rtl] .rtile { text-align: right; }
.rtile b { display: block; font-size: 13.5px; }
.rtile span { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.rtile:hover { border-color: var(--axis); }
.rtile.on { border-color: var(--g, var(--accent)); box-shadow: inset 0 0 0 1px var(--g, var(--accent)); background: color-mix(in srgb, var(--g, var(--accent)) 7%, var(--surface)); }
.rfilters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 12.5px; color: var(--ink2); }
.rfilters label { display: inline-flex; gap: 6px; align-items: center; }
.rfilters select { padding: 5px 28px 5px 8px; font-size: 12.5px; }
.rfilters .rf { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rfilters .rf input { width: 130px; padding: 5px 8px; font-size: 12.5px; }
.rnotes { margin-top: 10px; font-size: 12.5px; color: var(--ink2); }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; color: #000; font: 10pt/1.4 -apple-system, "Helvetica Neue", Arial, sans-serif; }
  #printArea .phead { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
  #printArea .plogo { height: 46px; max-width: 160px; object-fit: contain; }
  #printArea .pstore { font-size: 9pt; color: #555; } #printArea h1 { font-size: 16pt; margin: 0; } #printArea .pmeta { font-size: 9pt; color: #555; }
  #printArea table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  #printArea th { text-align: right; border-bottom: 1px solid #000; padding: 4px 5px; } #printArea th:first-child { text-align: left; }
  #printArea td { padding: 3px 5px; border-bottom: 0.5px solid #ccc; text-align: right; white-space: nowrap; } #printArea td.l { text-align: left; }
  #printArea tr.total td { border-top: 1.5px solid #000; font-weight: 700; }
  #printArea a { color: #000; text-decoration: none; } #printArea .pnotes { font-size: 8pt; color: #444; margin-top: 10px; }
  @page { margin: 12mm; }
}

/* ---------------------------------------------------------------- thermal labels (sizes in mm, black on white) */
.tlbl { background: #fff; color: #000; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden;
  font-family: "Helvetica Neue", Arial, sans-serif; outline: 1px dashed #bbb; }
.lb-top { display: flex; gap: 1mm; flex: 1; min-height: 0; align-items: center; }
.lb-top.qrleft { flex-direction: row-reverse; }
.lb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .3mm; }
.lb-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.lb-logo { max-height: 6mm; max-width: 24mm; object-fit: contain; align-self: flex-start; margin-bottom: .5mm; }
.lb-qr { flex: none; } .lb-qr svg, .lb-bar svg { width: 100%; height: 100%; display: block; }
.lb-bar { margin: .5mm auto 0; flex: none; }
.lb-err { font-size: 6pt; color: #b00; }
.lbprev { overflow: auto; padding: 4px; background: repeating-conic-gradient(var(--sunken) 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip.small { font-size: 11.5px; padding: 3px 9px; }
.lnrow { grid-template-columns: 3fr 1fr auto; }
label.chk { display: inline-flex; gap: 6px; align-items: center; flex-direction: row; }
@media print { body.printing #printArea .tlbl { outline: 0; } }
@media (max-width: 760px) {
  .menubtn { display: none; }          /* on a phone the More tab at the bottom opens the menu */
  .brand img.brandlogo { max-width: 70px; height: 22px; }
}
.ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ftile h2 { margin-bottom: 2px; } .upl { cursor: pointer; }
.banner.info { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.seclist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.seclist li { display: flex; gap: 10px; align-items: flex-start; }
.seclist li > span { width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; color: #fff; flex: none; margin-top: 1px; }
.seclist li.ok > span { background: var(--good); } .seclist li.bad > span { background: var(--crit); } .seclist li.minor > span { background: var(--warn); }
