/* plantora.info /shop-dashboard (2026-10, Shop Dashboard v2).
 * Sidebar layout and look follow the Shop Stats mock-up. Everything uses logical properties (inline-start / inline-end,
 * text-align: start) so right-to-left Arabic mirrors by itself; nothing here needs an [dir=rtl] override except the
 * numbers inside a table, which stay left-to-right. Dark mode follows the system. */

:root {
  color-scheme: light dark;
  --bg: #f5f7f4; --surface: #ffffff; --surface-2: #f0f3ef; --line: #e3e8e2; --grid: #edf0ec;
  --ink: #16221a; --ink-2: #4f5d53; --ink-3: #6b786f;
  --brand: #2f7d4f; --brand-ink: #ffffff; --brand-soft: #e2f0e7;
  --blue: #2b6cb0; --blue-soft: #e3eefa;
  --good: #0a7a0a; --warn: #b87a00; --warn-soft: #fbf0dc; --bad: #c53030; --bad-soft: #fbe4e4;
  --shadow: 0 1px 2px rgba(16, 24, 18, .04), 0 6px 18px rgba(16, 24, 18, .04);
  --radius: 14px;
  /* Shop Stats */
  --s1: #2a78d6; --prev: #b9c0bb; --crit: #d03b3b; --admin: #6250d6; --admin-soft: #ebe8fb;
  --seq0: #eef4fc; --seq1: #cde2fb; --seq2: #9ec5f4; --seq3: #5598e7; --seq4: #2a78d6; --seq5: #184f95;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512; --surface: #18201b; --surface-2: #1f2822; --line: #2a352e; --grid: #232d26;
    --ink: #e8efe9; --ink-2: #b4c1b8; --ink-3: #94a399;
    --brand: #5cc185; --brand-ink: #0d1a12; --brand-soft: #1d3426;
    --blue: #6ea8e6; --blue-soft: #1b2b3d;
    --good: #4fd16a; --warn: #e0a84a; --warn-soft: #3a2e18; --bad: #ef7b7b; --bad-soft: #3a1f1f;
    --shadow: none;
    --s1: #3987e5; --prev: #56605a; --crit: #e66767; --admin: #9085e9; --admin-soft: #2a2547;
    --seq0: #1d2630; --seq1: #173459; --seq2: #1c5cab; --seq3: #2a78d6; --seq4: #5598e7; --seq5: #9ec5f4;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.dash {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 'Nunito', 'Segoe UI', system-ui, -apple-system, 'Noto Naskh Arabic', Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.has-modal, body.has-drawer { overflow: hidden; }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
.boot { padding: 48px; text-align: center; color: var(--ink-3); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.num { text-align: end; font-variant-numeric: tabular-nums; }
bdi, .num, .tbl td.num { unicode-bidi: isolate; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-inline-end: 1px solid var(--line); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; padding: 0 8px 4px; color: var(--ink); text-decoration: none; }
.shopname { padding: 0 8px 14px; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.navlink {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2);
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.navlink:hover { background: var(--surface-2); }
.navlink.is-on { background: var(--brand-soft); color: var(--brand); }
.navtext { flex: 1; }
.badge-count { background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.side .lang-btn { border-color: var(--line); background: var(--surface-2); color: var(--ink-2); min-height: 36px; padding: 6px 12px; }
.topbar { display: none; }
.main { padding: 22px 26px 60px; min-width: 0; }
.netbar { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-weight: 700; }
#page:focus { outline: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .topbar-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 30; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  [dir='rtl'] .side { transform: translateX(105%); }
  .side.is-open, [dir='rtl'] .side.is-open { transform: none; }
  .main { padding: 14px 14px 60px; }
}

/* ---------- page pieces ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; letter-spacing: -.01em; }
.page-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin-bottom: 10px; }
.empty { color: var(--ink-3); padding: 24px 8px; text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.linkish.danger { color: var(--bad); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 800; padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad); }
.icon-btn { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.in {
  width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; min-height: 38px;
}
.in--sm { width: 96px; min-height: 32px; padding: 4px 8px; }
.in.is-bad { border-color: var(--bad); }
textarea.in { resize: vertical; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; min-width: 0; }
.fld > span { color: var(--ink-2); font-size: 13px; }
.field-error { color: var(--bad); font-size: 12.5px; font-weight: 700; }
.status { padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.status.ok { background: var(--brand-soft); color: var(--brand); }
.status.error { background: var(--bad-soft); color: var(--bad); }
.check, .radio { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 6px 0; }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 10px 0; }
legend { font-weight: 800; margin-bottom: 4px; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill--ok, .pill--done { background: var(--brand-soft); color: var(--brand); }
.pill--warn, .pill--new { background: var(--warn-soft); color: var(--warn); }
.pill--bad, .pill--cancelled { background: var(--bad-soft); color: var(--bad); }
.pill--out_for_delivery { background: var(--blue-soft); color: var(--blue); }
.pill--preparing { background: #e8efdf; color: #4d6b2f; }
@media (prefers-color-scheme: dark) { .pill--preparing { background: #26331d; color: #a8c98a; } }
.pill--muted { background: var(--surface-2); color: var(--ink-3); }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 700; font-size: 12.5px; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.live.is-on { color: var(--good); }
.live.is-on i { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
@media (prefers-reduced-motion: reduce) { .live.is-on i { animation: none; } * { scroll-behavior: auto !important; } }

/* ---------- tabs and filters ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
a.tab { text-decoration: none; }
.tab { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.tab.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.count { background: var(--surface-2); color: var(--ink-2); border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 800; min-width: 22px; text-align: center; }
.tab.is-on .count { background: rgba(255, 255, 255, .25); color: inherit; }
.count--hot { background: var(--bad); color: #fff; }
.filters { margin-bottom: 12px; }
.filters-main { display: flex; gap: 8px; margin-bottom: 8px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.filters-grid .fld { margin: 0; }
.filters--inline { display: flex; gap: 8px; flex-wrap: wrap; }
.filters--inline .in { width: auto; min-width: 150px; flex: 1 1 150px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: start; color: var(--ink-3); font-weight: 700; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.tbl td.act { white-space: nowrap; }
.tbl .num { text-align: end; }
.row-click { cursor: pointer; }
.row-click:hover td, .tbl tr.is-selected td { background: var(--surface-2); }
.tbl .chk { width: 34px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.thumb--empty { border: 1px dashed var(--line); }
.prod { min-width: 180px; }
.prod strong { display: block; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.subrow td { background: var(--surface-2); }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.opt { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.opt-label { min-width: 150px; font-weight: 700; }
.opt label { display: flex; align-items: center; gap: 6px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.more { text-align: center; margin: 8px 0 16px; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }

@media (max-width: 760px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface); }
  .tbl td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: start; }
  .tbl td::before { content: attr(data-label); color: var(--ink-3); font-weight: 700; font-size: 12px; flex: none; }
  .tbl td.chk::before, .tbl td.act::before { content: none; }
  .tbl td.act { flex-wrap: wrap; justify-content: flex-start; }
  .subrow td:first-child { display: none; }
}

/* ---------- order drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; width: min(480px, 100vw); background: var(--surface); z-index: 41;
  border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, .18);
}
[dir='rtl'] .drawer { box-shadow: 10px 0 40px rgba(0, 0, 0, .18); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; }
.drawer-body { padding: 14px 16px 28px; overflow-y: auto; flex: 1; }
.od-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.num-big { font-size: 20px; font-weight: 800; text-decoration: none; color: var(--ink); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0; margin: 14px 0; }
.step { text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 700; position: relative; }
.step i { display: grid; place-items: center; width: 24px; height: 24px; margin: 0 auto 4px; border-radius: 50%; background: var(--surface-2); font-style: normal; font-size: 12px; position: relative; z-index: 1; }
.step::before { content: ''; position: absolute; top: 12px; inset-inline: -50% 50%; height: 2px; background: var(--line); }
.step:first-child::before { content: none; }
.step.is-past i, .step.is-now i { background: var(--brand); color: var(--brand-ink); }
.step.is-past::before, .step.is-now::before { background: var(--brand); }
.step.is-now { color: var(--ink); }
.od-cancelled { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-weight: 700; margin: 12px 0; }
.od-sec { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); }
.od-sec h3 { font-size: 12.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.od-line { margin-bottom: 3px; }
.with-copy { display: flex; align-items: center; gap: 6px; }
.od-items { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 10px; }
.od-items li { display: flex; align-items: center; gap: 10px; }
.od-items img, .od-items .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.od-item-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.od-totals { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.od-totals div { display: flex; justify-content: space-between; }
.od-totals .grand { font-weight: 800; font-size: 15px; }
.od-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

/* ---------- modal, toast, pop-ups ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: min(460px, 100%); max-width: 100%; min-width: 0; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal--wide { width: min(720px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.modal-head .icon-btn { flex: none; margin-inline-start: 8px; }
.modal-body { padding: 16px 18px 0; overflow-y: auto; min-width: 0; }
.modal-body .in, .modal-body select, .modal-body input[type="date"] { max-width: 100%; min-width: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
/* In a window the buttons stay in view: the form scrolls, the buttons wait at the bottom edge. */
.modal-body .modal-actions { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 16px; margin-top: 8px; z-index: 1; box-shadow: 0 -8px 8px -8px rgba(0, 0, 0, .12); }
@media (max-width: 560px) {
  .backdrop { padding: 10px; }
  .modal, .modal--wide { width: 100%; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 14px 14px 0; }
  .modal-body .modal-actions .btn { flex: 1 1 120px; }
}
.toast { position: fixed; inset-inline: 0; bottom: 18px; margin-inline: auto; width: max-content; max-width: 90vw; z-index: 80; padding: 10px 16px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; background: var(--ink); color: var(--bg); }
.toast.is-on { opacity: 1; }
.toast--error { background: var(--bad); color: #fff; }
.popups { position: fixed; inset-block-start: 14px; inset-inline-end: 14px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 28px)); }
.popup { background: var(--surface); border: 2px solid var(--brand); border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); display: flex; gap: 10px; align-items: center; justify-content: space-between; animation: pop .25s ease; }
.popup-text { display: flex; flex-direction: column; min-width: 0; }
.popup-actions { display: flex; align-items: center; gap: 4px; flex: none; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- products editor ---------- */
.pe-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.pe-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pe-photo { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.pe-photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.pe-photo .badge { position: absolute; top: 4px; inset-inline-start: 4px; }
.pe-variant { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 600px) { .pe-variant { grid-template-columns: 1fr 1fr; } }

/* ---------- overview ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 800; padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.seg button.is-on { background: var(--brand); color: var(--brand-ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-l { color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.kpi-v { font-size: 24px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -.01em; }
.kpi--big .kpi-v { font-size: 30px; }
.kpi--hot { border-color: var(--warn); background: var(--warn-soft); }
.delta { font-size: 12px; font-weight: 800; }
.delta--up { color: var(--good); }
.delta--down { color: var(--bad); }
.delta--flat, .delta--none { color: var(--ink-3); }
.chart { width: 100%; height: auto; max-height: 260px; }
.chart text { fill: var(--ink-3); font-size: 11px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: 10px; align-items: center; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: var(--grid); border-radius: 6px; overflow: hidden; display: block; }
.hbar-track i { display: block; height: 100%; border-radius: 6px; }
.hbar-v { font-weight: 800; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.lowlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lowlist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* ---------- settings, stats ---------- */
.se { max-width: 640px; }
.se-logo { width: 88px; height: 88px; object-fit: cover; border-radius: 16px; background: var(--surface-2); }
.se-banner { width: 100%; max-height: 160px; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.se-name { font-size: 17px; font-weight: 800; }
.soon { max-width: 560px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ---------- invoice (on screen it lives in the hidden #print-root) ---------- */
#print-root { display: none; }
.invoice { background: #fff; color: #111; font: 13px/1.5 'Nunito', 'Segoe UI', Tahoma, system-ui, sans-serif; max-width: 780px; margin: 0 auto; padding: 8px; }
.invoice h1 { font-size: 26px; margin-bottom: 4px; }
.invoice h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #555; margin-bottom: 4px; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #2f7d4f; padding-bottom: 12px; margin-bottom: 14px; }
.inv-stamp { color: #c53030; font-weight: 800; border: 2px solid #c53030; display: inline-block; padding: 2px 10px; border-radius: 6px; transform: rotate(-4deg); }
.inv-meta { min-width: 220px; }
.inv-line { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
.inv-sub { color: #555; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.inv-table th { background: #2f7d4f; color: #fff; text-align: start; padding: 7px 8px; font-size: 12px; }
.inv-table td { padding: 7px 8px; border-bottom: 1px solid #ddd; }
.inv-table .num { text-align: end; }
.inv-totals { margin-inline-start: auto; width: 320px; }
.inv-grand { font-size: 16px; font-weight: 800; border-top: 2px solid #111; margin-top: 4px; padding-top: 6px; }
.inv-foot { margin-top: 28px; text-align: center; color: #555; border-top: 1px solid #ddd; padding-top: 12px; }

@page { size: A4; margin: 14mm; }
@media print {
  body.printing-invoice { background: #fff; }
  body.printing-invoice > *:not(#print-root) { display: none !important; }
  body.printing-invoice #print-root { display: block !important; }
  .invoice { max-width: none; padding: 0; }
  .inv-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Shop Stats (2026-10) ---------- */
.adminbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--admin-soft); border: 1px solid var(--admin); color: var(--ink); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.adminbar b { color: var(--admin); }
.adminbar .grow { flex: 1; }
.adminbar select { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; width: auto; min-width: 160px; }
.stats-head { align-items: flex-end; }
.stats-custom { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: -4px 0 14px; }
.stats-custom label { display: flex; flex-direction: column; gap: 2px; }
.stats-custom .in--sm { width: 150px; }
.stats-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stats-kpis .kpi-v small { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.stats-kpis .kpi-v.is-neg { color: var(--crit); }
.stats-kpis .delta .vs { color: var(--ink-3); font-weight: 400; }
.stats-kpis .bench { font-size: 11.5px; color: var(--admin); margin-top: 4px; }
@media (max-width: 1100px) { .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats-grid { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.stats-card { margin-bottom: 0; }
.stats-card.c4 { grid-column: span 4; } .stats-card.c5 { grid-column: span 5; } .stats-card.c6 { grid-column: span 6; }
.stats-card.c7 { grid-column: span 7; } .stats-card.c8 { grid-column: span 8; } .stats-card.c12 { grid-column: span 12; }
@media (max-width: 1100px) { .stats-card.c4, .stats-card.c5, .stats-card.c6, .stats-card.c7, .stats-card.c8 { grid-column: span 12; } }
.stats-card .hint { color: var(--ink-3); font-size: 12.5px; margin: 2px 0 12px; }
.stats-ch { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.stats-card .admin-h { color: var(--admin); }
.stats-card.admin-only { border-color: var(--admin); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.stats-chart svg { display: block; max-width: 100%; touch-action: pan-y; }
.stats-chart svg text { fill: var(--ink-3); font-size: 11px; font-family: inherit; }
.stats-tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); opacity: 0; transition: opacity .08s; z-index: 80; min-width: 140px; max-width: 280px; }
.stats-tip.is-on { opacity: 1; }
.stats-tip-t { color: var(--ink-3); font-size: 11.5px; margin-bottom: 3px; }
.stats-tip-r { display: flex; justify-content: space-between; gap: 14px; }
.wfrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 92px; gap: 10px; align-items: center; padding: 6px 0; }
.wfrow.is-net { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.wflab { font-size: 13px; color: var(--ink-2); }
.wflab b { color: var(--ink); }
.wf .track { height: 14px; position: relative; }
.wf .bar { position: absolute; top: 0; height: 14px; border-radius: 4px; cursor: default; }
.wf .amt { font-weight: 800; font-size: 13px; }
@media (max-width: 600px) { .wfrow { grid-template-columns: 110px minmax(0, 1fr) 80px; } }
.costs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.costs label { font-size: 12px; color: var(--ink-3); display: block; }
.costs .in { margin-top: 3px; font-weight: 700; }
.costsum { margin-top: 12px; display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.stats-card .note { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.stats-card .note--warn { color: var(--warn); }
.stats-card .btn { margin-top: 10px; }
.stats-empty { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; color: var(--ink-2); }
.miss { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .miss { grid-template-columns: 1fr; } }
.mcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.mcard .k { font-size: 12px; color: var(--ink-3); }
.mcard .v { font-size: 20px; font-weight: 800; margin: 2px 0; }
.mcard .v small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.mcard .dd { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.mcard ul { margin: 6px 0 0; padding-inline-start: 16px; font-size: 12.5px; color: var(--ink-2); }
.tblwrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 820px; }
.stats-table th { text-align: start; color: var(--ink-3); font-weight: 700; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.stats-table th.r, .stats-table td.r { text-align: end; }
.stats-table .thbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: 700; }
.stats-table .thbtn:hover { color: var(--ink); }
.stats-table td { padding: 9px 8px; border-bottom: 1px solid var(--grid); }
.stats-table tbody tr:hover td { background: var(--surface-2); }
.stats-table--bench { min-width: 520px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.tag--low { background: rgba(208, 59, 59, .12); color: var(--crit); }
.tag--ok { background: rgba(12, 163, 12, .12); color: var(--good); }
.tag--warn { background: rgba(250, 178, 25, .18); color: var(--warn); margin-inline-start: 6px; }
.tag--none { background: var(--surface-2); color: var(--ink-3); }
.marg { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.marg .b { display: inline-block; height: 6px; border-radius: 3px; background: var(--s1); }
.heatwrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 44px repeat(24, minmax(10px, 1fr)); gap: 2px; font-size: 10.5px; color: var(--ink-3); min-width: 440px; }
.heat .hl { text-align: center; }
.heat .hd { align-self: center; }
.heat .c { aspect-ratio: 1 / 1; border-radius: 3px; cursor: default; min-width: 10px; }
.heat .c:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
.scale { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.scale i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 8px; }
.split span { display: block; height: 100%; }
.stats-card .best { font-weight: 700; font-size: 13px; margin: 12px 0 4px; }
.top3 { font-size: 13px; }
.top3 > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.stats-card .hbar-track span { display: block; height: 100%; border-radius: 0 6px 6px 0; background: var(--s1); }
.stats-card .hbar { grid-template-columns: minmax(80px, 120px) 1fr 70px; padding: 5px 0; font-size: 13px; }
.ops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.optile { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.optile .k { font-size: 12px; color: var(--ink-3); }
.optile .v { font-size: 18px; font-weight: 800; }
.footer-note { margin-top: 18px; color: var(--ink-3); font-size: 12px; }
.stats.is-loading { opacity: .6; transition: opacity .15s; }

/* Wide tables on a phone: they scroll sideways inside their card, with a line that says so, a shadow on the side that has more
 * (works the same left-to-right and right-to-left) and the first column (the product) kept in view. */
.scroll-hint { display: none; font-size: 12px; color: var(--ink-3); margin: 0 0 6px; }
@media (max-width: 700px) {
  .scroll-hint { display: block; }
  .tblwrap {
    background:
      linear-gradient(to right, var(--surface) 30%, rgba(0, 0, 0, 0)) left center / 36px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, rgba(0, 0, 0, 0)) right center / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) right center / 12px 100% no-repeat scroll;
    -webkit-overflow-scrolling: touch;
  }
  .stats-table { min-width: 720px; }
  .stats-table th:first-child, .stats-table td:first-child { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); min-width: 120px; max-width: 150px; white-space: normal; box-shadow: 1px 0 0 var(--line); }
  .stats-table tbody tr:hover td:first-child { background: var(--surface-2); }
}

/* The shop's own money lines (under the monthly costs on the Stats page). */
.costs-sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0 12px; }
.lines-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lines h3 { font-size: 14px; margin: 0; }
.lines .hint { margin: 4px 0 8px; }
.line-list { list-style: none; margin: 8px 0; padding: 0; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.line-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.line-main .tag { margin-inline-start: 0; }
.line-amt { text-align: end; display: flex; flex-direction: column; align-items: flex-end; }
.line-actions { grid-column: 1 / -1; display: flex; gap: 14px; }
.line-form { display: grid; gap: 8px; margin-top: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.line-form .fld label { font-size: 12px; color: var(--ink-3); display: block; margin-bottom: 2px; }
.line-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.line-form-actions .btn { margin-top: 0; }

/* ---------- Selling tools (2026-10): discounts, coupons, hours and pause, share link and QR ---------- */
.note { background: var(--brand-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; }
.note--warn { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); }
.sell-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; border: 1px solid var(--warn); }
.sell-banner a { font-weight: 800; }
.sell-banner .btn { margin: 0; }
.badge-off { display: inline-block; background: var(--bad); color: #fff; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 8px; margin-inline-start: 6px; }
.sell-disc { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.sell-price { display: flex; flex-direction: column; gap: 1px; }
.sell-price s { text-decoration-thickness: 1.5px; }
.sell-table td.act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sell-table .code { letter-spacing: .06em; font-size: 14px; }
.sell-form .opts { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
.sell-form .opts .check { margin: 2px 0; }
.sell-form .field-error span { display: block; }
.sell-pause .fld-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.sell-pause .fld-row .fld { margin-bottom: 0; min-width: 200px; }
.sell-pause h3, .sell-hours h3, .sell-share h3 { margin: 0 0 6px; font-size: 16px; }
.sell-day { display: grid; grid-template-columns: 110px minmax(150px, 200px) 1fr; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.sell-day-name { font-weight: 800; }
.sell-times { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sell-times label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.sell-day .small { grid-column: 3; }
.sell-qrbox { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.sell-qr { width: 260px; height: 260px; border-radius: 12px; border: 1px solid var(--line); background: #fff; image-rendering: pixelated; }
.sell-share .modal-actions { justify-content: flex-start; }
@media (max-width: 700px) {
  .sell-day { grid-template-columns: 1fr; gap: 6px; }
  .sell-day .small { grid-column: 1; }
  .sell-qr { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1; }
  .sell-table { min-width: 640px; }
}

/* ---------- Shop staff (2026-10) ---------- */
.staff-badge { margin: -8px 8px 12px; padding: 3px 10px; width: fit-content; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }
.navlink--btn { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: start; }
.note--readonly { background: var(--surface-2); border: 1px solid var(--line); }
.staff-table td.act { white-space: nowrap; }
.staff-table td.act .btn + .btn { margin-inline-start: 6px; }
.staff-matrix { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.staff-matrix .staff-area { margin-bottom: 6px; }
.staff-matrix .opts { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
.staff-form .fld select.in { max-width: 100%; }
.card-title { margin: 0 0 8px; font-weight: 800; }
