:root {
  /* Tokenurile vin din docs/brand.md (sursa de adevăr). Numele vechi (--ritm, --gold) rămân ca alias-uri. */
  --cobalt: #2F5BFF;
  --cobalt-deep: #1D3FD1;
  --cobalt-soft: #E6ECFF;
  --ink: #0D1830;
  --puls: #C8F04B;
  --puls-ink: #1B2A05;
  --puls-soft: #F3FBD9;
  --paper: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #EDF1F9;
  --line: #DDE3EE;
  --band: #0D1830;
  --band-fg: #F5F7FB;
  --muted: #5B6680;
  --ok: #14A37F;
  --ok-soft: #DCF3EA;
  --warn: #E39A1B;
  --warn-soft: #FDF0D8;
  --bad: #E5484D;
  --bad-soft: #FCE4E5;
  /* text în culoare de semnal: aceeași nuanță, mai închisă, ca să se citească pe alb și pe fundalul „soft” (≥ 4,5:1) */
  --ok-ink: #0F7A5F;
  --warn-ink: #936412;
  --bad-ink: #CE1D23;
  --shadow: 0 1px 2px rgba(13, 24, 48, .06), 0 4px 12px rgba(13, 24, 48, .05);
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 28px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --nav-h: 64px;
  /* alias-uri folosite în codul existent */
  --ritm: var(--cobalt); --ritm-deep: var(--cobalt-deep); --ritm-soft: var(--cobalt-soft); --ritm-ink: #FFFFFF;
  --gold: var(--puls); --gold-ink: var(--puls-ink); --gold-soft: var(--puls-soft);
  --r-sm: var(--r-s); --r: var(--r-m); --r-lg: var(--r-l);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cobalt: #6F8DFF; --cobalt-deep: #4F70FF; --cobalt-soft: #18264A; --ink: #EEF2FA; --paper: #0A1222; --surface: #111C33; --surface-2: #17223D;
    --line: #22304D; --band: #050B18; --band-fg: #EEF2FA; --muted: #9AA6C2; --ritm-ink: #0D1830; --puls-soft: #26301A;
    --ok-soft: #0E3229; --warn-soft: #3A2A10; --bad-soft: #3D1A1D; --ok-ink: #2CC79B; --warn-ink: #F0B24A; --bad-ink: #FF6B70; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --cobalt: #6F8DFF; --cobalt-deep: #4F70FF; --cobalt-soft: #18264A; --ink: #EEF2FA; --paper: #0A1222; --surface: #111C33; --surface-2: #17223D;
    --line: #22304D; --band: #050B18; --band-fg: #EEF2FA; --muted: #9AA6C2; --ritm-ink: #0D1830; --puls-soft: #26301A;
    --ok-soft: #0E3229; --warn-soft: #3A2A10; --bad-soft: #3D1A1D; --ok-ink: #2CC79B; --warn-ink: #F0B24A; --bad-ink: #FF6B70; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.45 var(--body); font-feature-settings: "tnum" 1;
  padding-top: env(safe-area-inset-top, 0px);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
a { color: var(--ritm); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ritm) 55%, transparent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow: auto; padding: 18px 12px 24px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .04em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.nav-group { margin: 14px 10px 6px; font-size: 12px; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--ritm-soft); color: var(--ritm-deep); font-weight: 650; }
.nav a.active svg { color: var(--ritm); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a.active { color: var(--ink); } }
:root[data-theme="dark"] .nav a.active { color: var(--ink); }
.nav .badge { margin-left: auto; }
.side-foot { margin: 20px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }

.main { min-width: 0; padding: 22px 28px 60px; max-width: 1280px; width: 100%; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open {
    display: block; position: fixed; inset: 0; z-index: 60; height: 100%;
    padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
    padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--surface); }
  .topbar .title { font-family: var(--display); font-weight: 700; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 14px 14px calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0px)); }
  .page-head h1 { display: none; }
  .page-head { margin-bottom: 12px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h);
    font-size: 11.5px; color: var(--muted); text-decoration: none; font-weight: 600;
  }
  .bottom-nav a svg { width: 23px; height: 23px; }
  .bottom-nav a.active { color: var(--ritm); }
  .bottom-nav a.scan-tab span.dot {
    display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%;
    background: var(--ritm); color: var(--ritm-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--ritm) 45%, transparent);
  }
  .bottom-nav a.scan-tab.active span.dot { background: var(--ritm-deep); }
}

/* ---------- elemente ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.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)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ritm); color: var(--ritm-ink); border-color: var(--ritm); }
.btn.primary:hover { background: var(--ritm-deep); }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 14px; }
.btn.lg { min-height: 54px; font-size: 17px; border-radius: 16px; padding: 0 22px; }
.btn.block { width: 100%; }
.icon-btn { min-width: 42px; padding: 0; }
.icon-btn.sm { min-width: 34px; }

label.field { display: block; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--ritm); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ritm) 22%, transparent); }
.input.sm { min-height: 36px; padding: 6px 10px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ritm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 34px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ritm { background: var(--ritm-soft); color: var(--ritm); }
.badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge.gold { background: var(--gold-soft); color: var(--warn-ink); }
.dot-c { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* tabele */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t tr.cancelled td { opacity: .5; text-decoration: line-through; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }

/* KPI */
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .k-val { font-family: var(--mono); font-size: 26px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.delta-up { color: var(--ok-ink); font-weight: 700; }
.delta-down { color: var(--bad-ink); font-weight: 700; }

.hero-total {
  background: var(--ritm); color: var(--ritm-ink); border-radius: var(--r-lg); padding: 20px 22px;
  position: relative; overflow: hidden;
}
.hero-total .k-label { opacity: .85; font-weight: 600; }
.hero-total .k-val { font-family: var(--mono); font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.hero-total .k-sub { opacity: .85; margin-top: 6px; }
.hero-total::after {
  /* simbolul ritm (docs/brand.md): trei bare crescătoare și punctul Puls = „live” */
  content: ""; position: absolute; right: 18px; top: 50%; width: 92px; height: 92px; transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cg fill='%23fff' fill-opacity='.24'%3E%3Crect x='13' y='26' width='6' height='14' rx='3'/%3E%3Crect x='23' y='18' width='6' height='22' rx='3'/%3E%3Crect x='33' y='11' width='6' height='29' rx='3'/%3E%3C/g%3E%3Ccircle cx='36' cy='10' r='4.6' fill='%23C8F04B'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero-total > * { position: relative; z-index: 1; }

.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ritm); border-radius: 99px; }
.progress.done > div { background: var(--ok); }

/* lista mobilă */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li.click { cursor: pointer; }
.list .main-txt { flex: 1; min-width: 0; }
.list .main-txt b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.list .main-txt span { font-size: 13px; color: var(--muted); }

/* ---------- vânzare ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } }
.scan-bar { display: flex; gap: 8px; }
.scan-bar .input { flex: 1; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.balloon {
  position: relative; border: 0; cursor: pointer; padding: 12px 8px 10px; min-height: 92px; border-radius: 48% 48% 44% 44% / 52% 52% 40% 40%;
  background: var(--b);
  color: #fff; font-weight: 700; font-size: 13px; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; touch-action: manipulation;
}
.balloon::after { content: ""; position: absolute; bottom: -7px; left: 50%; width: 10px; height: 8px; transform: translateX(-50%); background: var(--b); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.balloon .p { font-family: var(--mono); font-size: 14px; opacity: .95; }
.balloon:active { transform: scale(.96); }
.search-results { margin-top: 8px; }
.cart { position: sticky; top: 16px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .nm { font-weight: 650; }
.cart-line .meta { font-size: 13px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.qty button { width: 38px; height: 36px; border: 0; background: var(--surface-2); font-size: 18px; font-weight: 700; cursor: pointer; }
.qty input { width: 46px; height: 36px; border: 0; text-align: center; background: var(--surface); font-weight: 700; }
.pay-bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--band); color: var(--band-fg);
}
.pay-bar .tot { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.pay-bar .lbl { font-size: 12.5px; opacity: .75; }
@media (max-width: 1000px) {
  .cart { position: static; }
  .pay-bar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom, 0px)); z-index: 35; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
}

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 90; background: #05040c; color: #fff; display: flex; flex-direction: column; }
.scan-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.scanner.with-panel .scan-view { flex: 0 0 46%; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 7%; right: 7%; top: 50%; height: min(42%, 220px); transform: translateY(-50%); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(5, 4, 12, .45); }
.scan-frame i { position: absolute; width: 28px; height: 28px; border: 4px solid #fff; }
.scan-frame i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.scan-frame i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.scan-frame i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.scan-frame i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.scan-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff4d6d; box-shadow: 0 0 10px #ff4d6d; opacity: .8; animation: scanl 1.8s ease-in-out infinite alternate; }
@keyframes scanl { from { transform: translateY(-60px); } to { transform: translateY(60px); } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } }
.scanner.flash-ok .scan-frame i { border-color: #3CCB8E; }
.scanner.flash-ok .scan-frame { animation: okflash .45s ease-out; }
.scanner.flash-bad .scan-frame i { border-color: #FF6B86; }
@keyframes okflash { 0% { box-shadow: 0 0 0 100vmax rgba(30, 158, 106, .55); } 100% { box-shadow: 0 0 0 100vmax rgba(5, 4, 12, .45); } }
.scan-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.scan-title { flex: 1; font-weight: 700; font-size: 16px; text-align: center; }
.scan-title span { font-weight: 500; opacity: .8; }
.scan-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.scan-round svg { width: 22px; height: 22px; }
.scan-round.on { background: #F2C94C; color: #1f1b3a; }
.scan-zoom { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; display: flex; align-items: center; gap: 8px; font-size: 12px; background: rgba(0,0,0,.4); padding: 6px 12px; border-radius: 99px; }
.scan-zoom input { width: 150px; accent-color: #fff; }
.scan-msg { position: absolute; left: 12px; right: 12px; bottom: 12px; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.55); font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.scan-msg svg { width: 20px; height: 20px; flex: none; }
.scan-msg span { flex: 1; }
.scan-msg.ok { background: rgba(30, 158, 106, .92); }
.scan-msg.bad { background: rgba(217, 61, 91, .92); }
.scan-bottom { background: var(--paper); color: var(--ink); padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); overflow: auto; }
.scanner.with-panel .scan-bottom { flex: 1; min-height: 0; border-radius: 20px 20px 0 0; margin-top: -16px; position: relative; }
.scanner:not(.with-panel) .scan-bottom { background: #05040c; color: #fff; }
.scanner:not(.with-panel) .scan-manual summary { color: rgba(255,255,255,.8); }
.scan-manual summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 6px 0; }
.sp-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sp-tot { font-size: 20px; }

/* ---------- vânzare (v1.4) ---------- */
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 0; border-radius: var(--r-lg); cursor: pointer; text-align: left;
  background: var(--cobalt); color: var(--ritm-ink); }
.scan-cta > svg { width: 44px; height: 44px; flex: none; padding: 9px; border-radius: 14px; background: rgba(255,255,255,.18); }
.scan-cta b { display: block; font-family: var(--display); font-size: 20px; }
.scan-cta small { display: block; opacity: .85; font-size: 13px; margin-top: 2px; }
.scan-cta.slim { padding: 12px 16px; }
.scan-cta.slim small { display: none; }
.scan-cta.slim > svg { width: 36px; height: 36px; padding: 7px; }
.scan-cta.slim b { font-size: 17px; }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cline:last-child { border-bottom: 0; }
.cline.fresh { animation: fresh 1.2s ease-out; border-radius: 10px; }
@keyframes fresh { from { background: var(--ok-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .cline.fresh { animation: none; } }
.cline .nm { font-weight: 650; line-height: 1.3; }
.cline .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cline-tot { font-weight: 800; font-size: 16px; text-align: right; white-space: nowrap; }
.cline-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 42px; height: 40px; border: 0; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.stepper button svg { width: 18px; height: 18px; }
.stepper button:active { background: var(--ritm-soft); }
.stepper input { width: 54px; height: 40px; border: 0; text-align: center; font-weight: 800; font-size: 16px; background: transparent; color: var(--ink); }
.cline-ctrl .btn:first-of-type { margin-left: auto; }
.cline-ctrl .stepper + .btn { margin-left: auto; }
.empty-cart { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 10px; color: var(--muted); text-align: center; }
.empty-cart svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 4px; }
.empty-cart b { color: var(--ink); }

/* ---------- finisaje generale (v1.4) ---------- */
.card { box-shadow: 0 1px 2px rgba(31, 27, 58, .04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { box-shadow: none; } }
:root[data-theme="dark"] .card { box-shadow: none; }
.btn { transition: background-color .12s, transform .06s; }
.btn:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }
.page-head p { max-width: 70ch; }
@media (max-width: 900px) {
  .page-head { justify-content: flex-end; }
  .page-head > div:first-child:empty { display: none; }
  .page-head p { display: none; }
  .card { border-radius: 16px; }
  .pos .card-head h3 { font-size: 17px; }
}
.cost-vat-toggle { display: inline-flex; margin-left: 6px; vertical-align: middle; }
.cost-vat-toggle button { padding: 2px 8px; min-height: 24px; font-size: 12px; }
.lbl-opts { display: flex; flex-wrap: wrap; gap: 8px; }
/* ---------- modale ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(18, 14, 40, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 10px 18px 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px 18px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
@media (max-width: 640px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal-foot .btn { flex: 1; }
}

.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); top: calc(14px + env(safe-area-inset-top, 0px)); display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow); animation: tin .18s ease-out; }
.toast.ok { background: var(--ok-ink); color: #fff; }
.toast.bad { background: var(--bad-ink); color: #fff; }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.offline-pill { background: var(--warn-soft); color: var(--warn-ink); }

/* ---------- calendar ---------- */
.roster-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.roster { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
table.roster th, table.roster td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
table.roster th { padding: 6px 2px; font-weight: 600; color: var(--muted); min-width: 40px; background: var(--surface); }
table.roster th.today { color: var(--ritm); }
table.roster th.wkend { background: var(--surface-2); }
table.roster .who { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 8px 10px; min-width: 130px; font-weight: 600; white-space: nowrap; }
table.roster td .cell { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; cursor: default; font-size: 12px; line-height: 1.1; }
table.roster td .cell small { font-weight: 500; font-size: 10px; opacity: .85; }
table.roster td.edit .cell { cursor: pointer; }
table.roster td.today { box-shadow: inset 0 0 0 2px var(--ritm); }
.k-tura { background: var(--ritm-soft); color: var(--ritm); }
.k-liber { color: var(--muted); }
.k-concediu { background: var(--gold-soft); color: var(--warn-ink); }
.k-medical { background: var(--bad-soft); color: var(--bad-ink); }
.k-cerere { background: repeating-linear-gradient(45deg, var(--gold-soft), var(--gold-soft) 4px, transparent 4px, transparent 8px); color: var(--warn-ink); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; border: 1px solid var(--line); }

/* heatmap */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(16px, 1fr)); gap: 2px; font-size: 11px; color: var(--muted); min-width: 560px; }
.heat div { height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }

/* etichete — previzualizare */
.label-sheet { display: flex; flex-wrap: wrap; gap: 8px; background: var(--surface-2); padding: 12px; border-radius: var(--r); max-height: 520px; overflow: auto; }
.lbl { background: #fff; color: #000; border: 1px dashed #bbb; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.2mm; text-align: center; font-family: Arial, sans-serif; }
.lbl .ln { font-size: 7.5pt; font-weight: 700; line-height: 1.1; max-height: 2.3em; overflow: hidden; width: 100%; }
.lbl .lp { font-size: 11pt; font-weight: 800; line-height: 1.1; }
.lbl .ls { font-size: 6pt; color: #333; }
.lbl svg { max-width: 100%; display: block; flex: none; }
.lbl .ln, .lbl .lp, .lbl .ls { flex: none; }
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  body { background: #fff; padding: 0; }
  body::before { display: none; }
  #print-area { display: block; }
  #print-area .lbl { border: 0; }
}

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ritm); border-bottom-color: var(--ritm); }

.clock-btn { min-height: 64px; font-size: 18px; border-radius: 18px; }
.clock-live { font-family: var(--mono); font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.stockpair { display: inline-flex; gap: 6px; }
.pill-loc { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); white-space: nowrap; }
.pill-loc.zero { background: var(--bad-soft); color: var(--bad-ink); }
.pill-loc.low { background: var(--warn-soft); color: var(--warn-ink); }
.code-chip { font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.json { font-size: 12px; color: var(--muted); word-break: break-word; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* corecturi v1.0.1 */
.grid > .card, .grid > .stack { margin-top: 0; }
[data-close-side] { display: none; }
@media (max-width: 900px) { .side.open [data-close-side] { display: inline-flex; } }

/* ---------- manual și ajutor (v1.3) ---------- */
.help-btn { min-width: 34px; padding: 0; border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ritm); border-color: color-mix(in srgb, var(--ritm) 35%, var(--line)); }
.ui-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: .92em; white-space: nowrap; vertical-align: baseline; line-height: 1.5; }
.ui-chip svg { width: 14px; height: 14px; }
.ui-chip.primary { background: var(--ritm); color: var(--ritm-ink); border-color: var(--ritm); }
.ui-chip.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.ui-chip.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.ui-chip.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.ui-chip.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.ui-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--ritm); vertical-align: middle; }
.ui-ic svg { width: 100%; height: 100%; }
.help-gt { font-size: 15px; color: var(--muted); font-family: var(--body); font-weight: 650; margin: 18px 2px 8px; }
.help-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
.help-sec > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.help-sec > summary::-webkit-details-marker { display: none; }
.help-sec > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: auto; flex: none; transition: transform .15s; }
.help-sec[open] > summary::after { transform: rotate(225deg); }
@media (prefers-reduced-motion: reduce) { .help-sec > summary::after { transition: none; } }
.help-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ritm-soft); color: var(--ritm); flex: none; }
.help-ic svg { width: 21px; height: 21px; }
.help-t { display: flex; flex-direction: column; min-width: 0; }
.help-t span { font-size: 13.5px; color: var(--muted); }
.help-body { padding: 0 16px 16px 68px; max-width: 760px; }
@media (max-width: 640px) { .help-body { padding-left: 16px; } }
.help-steps { counter-reset: st; list-style: none; padding: 0; margin: 4px 0 12px; }
.help-steps li { counter-increment: st; position: relative; padding: 2px 0 10px 38px; line-height: 1.6; }
.help-steps li::before { content: counter(st); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--ritm); color: var(--ritm-ink); font-family: var(--display); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.help-steps li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 30px; bottom: 2px; width: 2px; background: var(--ritm-soft); }
.help-tips, .help-admin { border-radius: 12px; padding: 10px 14px; margin: 8px 0 12px; font-size: 14px; line-height: 1.6; }
.help-tips { background: var(--surface-2); }
.help-admin { background: var(--gold-soft); }
.help-admin b { display: inline-flex; align-items: center; gap: 6px; }
.help-admin b svg { width: 16px; height: 16px; }
.help-tips ul, .help-admin ul { margin: 6px 0 0; padding-left: 18px; }
.help-faq { border-top: 1px solid var(--line); padding: 10px 0; }
.help-faq p { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }
.help-visual { margin: 2px 0 14px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow-step { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; background: var(--ritm-soft); color: var(--ritm-deep); font-weight: 650; font-size: 13.5px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flow-step { color: var(--ink); } }
:root[data-theme="dark"] .flow-step { color: var(--ink); }
.flow-step svg { width: 16px; height: 16px; }
.flow-arrow { color: var(--muted); font-weight: 700; }
.help-modal .help-sec { border: 0; margin: 0; }
.help-modal .help-sec > summary { padding-left: 0; cursor: default; }
.help-modal .help-sec > summary::after { display: none; }
.help-modal .help-body { padding: 0; }
.legend-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.legend-row:last-child { border-bottom: 0; }
.legend-vis { width: 150px; flex: none; display: flex; align-items: center; }
.help-news ul { margin: 0; padding-left: 18px; line-height: 1.6; }
.help-news li { margin-bottom: 6px; }
.help-news + .help-news { margin-top: 12px; }
.welcome-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.welcome-step:last-child { border-bottom: 0; }
.welcome-step p { margin: 3px 0 0; color: var(--muted); line-height: 1.55; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 104px; transition: transform .08s; }
.tile:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:active { transform: none; } }
.tile b { font-size: 15px; margin-top: auto; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--ritm-soft); color: var(--ritm); margin-bottom: 8px; }
.tile-ic svg { width: 21px; height: 21px; }
.tile.primary { background: var(--cobalt); color: var(--ritm-ink); border-color: transparent; }
.tile.primary small { color: inherit; opacity: .85; }
.tile.primary .tile-ic { background: rgba(255,255,255,.2); color: inherit; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tile { min-height: 92px; } }

.scan-mode { height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- transfer marfă (v1.5) ---------- */
.dir-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dir-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; padding: 0 10px; }
.dir-switch button svg { width: 20px; height: 20px; flex: none; }
.dir-switch button.on { background: var(--ritm); color: var(--ritm-ink); border-color: var(--ritm); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chips button span { color: var(--muted); font-weight: 700; margin-left: 2px; }
.chips button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips button.on span { color: inherit; opacity: .75; }
.chip-sel { flex: none; width: auto !important; height: 34px; min-height: 34px !important; border-radius: 99px !important; padding: 0 12px !important; font-size: 13px; }
.pick-card { padding: 4px 12px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick.on .nm { color: var(--ritm-deep); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pick.on .nm { color: var(--ink); } }
:root[data-theme="dark"] .pick.on .nm { color: var(--ink); }
.pick-check input { width: 22px; height: 22px; accent-color: var(--ritm); display: block; }
.pick-main { flex: 1; min-width: 0; }
.pick-main .nm { font-weight: 650; line-height: 1.25; }
.pick-st { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pick-st .neg { color: var(--bad-ink); font-weight: 700; }
.pick-st .low { color: var(--warn-ink); font-weight: 700; }
.pick-warn { font-size: 12px; color: var(--warn-ink); font-weight: 600; margin-top: 2px; }
.pick-add { min-width: 40px; padding: 0; }
.stepper.sm button { width: 34px; height: 34px; }
.stepper.sm input { width: 44px; height: 34px; font-size: 15px; }
.move-bar { position: sticky; bottom: 10px; z-index: 20; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(31, 27, 58, .12); }
.move-bar.has { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.move-bar.has .btn.ghost { color: var(--paper); }
.mb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mb-txt span { font-size: 12.5px; opacity: .75; }
.tight-tabs { margin-bottom: 10px; }
@media (max-width: 900px) {
  .move-bar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom, 0px)); margin: 0; }
}

/* ---------- mai compact pe telefon (v1.5) ---------- */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .main { padding-left: 10px; padding-right: 10px; }
  .card { padding: 12px; border-radius: 14px; }
  .card + .card, .stack > * + * { margin-top: 10px; }
  .grid { gap: 10px; }
  .card-head { margin-bottom: 8px; }
  .list li { padding: 10px 0; gap: 10px; }
  .kpi { padding: 10px 12px; }
  .kpi .k-val { font-size: 21px; }
  .hero-total { padding: 16px; border-radius: 18px; }
  .hero-total .k-val { font-size: 34px; }
  .tabs button { padding: 9px 11px; }
  .btn { min-height: 40px; }
  .input { min-height: 42px; }
  .modal-body { padding: 8px 14px 14px; }
  .modal-head { padding: 14px 14px 4px; }
  .modal-foot { padding: 10px 14px 14px; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }
  .page-head { margin-bottom: 8px; }
  .tile { padding: 12px; min-height: 84px; }
  .tile-ic { width: 34px; height: 34px; margin-bottom: 6px; }
}

/* categorie și preț sub denumire (v1.5.1) */
.p-meta { color: var(--muted); font-size: 13px; }
.list .main-txt .p-meta { display: block; }
.p-cat { color: var(--muted); }
.p-price { color: var(--ink); font-weight: 750; }

/* ---------- vânzare compactă (v1.5.3) ---------- */
.pos2 { gap: 12px; }
.pos-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pos-find { display: flex; gap: 8px; }
.pos-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.pos-search:focus-within { border-color: var(--ritm); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ritm) 20%, transparent); }
.pos-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pos-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); height: 100%; }
.pos-scan { height: 50px; min-height: 50px; border-radius: 14px; padding: 0 16px; font-size: 15px; box-shadow: 0 6px 16px color-mix(in srgb, var(--ritm) 28%, transparent); }
.pos-scan svg { width: 20px; height: 20px; }
.res-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.res { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.res:last-child { border-bottom: 0; }
.res:active { background: var(--ritm-soft); }
.res-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-main b { font-weight: 650; line-height: 1.25; }
.res-add { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ritm-soft); color: var(--ritm); flex: none; }
.res-add svg { width: 18px; height: 18px; }
.res-empty { padding: 12px; color: var(--muted); font-size: 14px; }
.quick-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quick-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; flex: none; }
.quick-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.quick-strip::-webkit-scrollbar { display: none; }
.qchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 13.5px; cursor: pointer; touch-action: manipulation; }
.qchip i { width: 12px; height: 14px; border-radius: 50% 50% 45% 45%; background: var(--b); flex: none; }
.qchip b { color: var(--muted); font-weight: 700; }
.qchip:active { transform: scale(.97); }
.cart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px 6px; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.cart-head b { font-size: 15px; }
.pos2 .cline { padding: 10px 0; gap: 4px 10px; }
.pos2 .cline .nm { font-size: 15px; }
.pos2 .cline-ctrl { margin-top: 2px; }
.pos2 .stepper button { width: 38px; height: 36px; }
.pos2 .stepper input { width: 48px; height: 36px; }
.empty-cart { width: 100%; border: 0; background: transparent; cursor: pointer; font: inherit; }
.empty-cart svg { width: 40px; height: 40px; opacity: 1; color: var(--ritm); padding: 8px; border-radius: 14px; background: var(--ritm-soft); }
.empty-cart span { max-width: 32ch; font-size: 13.5px; }
.pb-lbl { font-size: 12.5px; opacity: .75; }
.pay-bar { margin-top: 10px; }
.topbar [data-tactions]:empty { display: none; }
.topbar .help-btn { min-height: 32px; min-width: 32px; }
.topbar [data-tactions] .btn.sm { min-height: 32px; }
@media (max-width: 1000px) {
  .pos2 .cart { padding-bottom: 76px; }
  .pay-bar { padding: 10px 10px 10px 16px; }
  .pay-bar .tot { font-size: 26px; }
  .pay-bar .btn.lg { min-height: 50px; padding: 0 20px; }
}

/* ---------- adaptare la orice telefon (v1.5.4) ---------- */
/* nimic nu mai poate ieși peste lățimea ecranului: fără mișcare stânga-dreapta */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
body { overflow-wrap: break-word; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.shell, .shell > div, .main, .card, .stack, .pos-left, .cart { min-width: 0; max-width: 100%; }
img, svg, video, canvas { max-width: 100%; }
.dir-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dir-switch button span { white-space: normal; line-height: 1.15; text-align: left; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.res-main b, .pick-main .nm, .cline .nm, .list .main-txt b { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  :root { --nav-h: 56px; }
  /* inputuri de 16px: telefonul nu mai face zoom când scrii (zoom-ul era ce muta pagina) */
  .input, input, select, textarea, .pos-search input { font-size: 16px; }
  .main { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom, 0px)); }
  /* bara de jos: mereu lipită jos, mai joasă */
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; transform: translateZ(0); -webkit-transform: translateZ(0); will-change: transform;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -4px 18px rgba(31, 27, 58, .06); }
  .bottom-nav a { height: var(--nav-h); gap: 1px; font-size: 10.5px; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.scan-tab span.dot { width: 40px; height: 40px; margin-top: -12px; }
  .bottom-nav a.scan-tab span.dot svg { width: 20px; height: 20px; }
  .topbar { padding: 8px 12px; }
  .topbar .title { font-size: 17px; }
  .pay-bar, .move-bar { bottom: calc(var(--nav-h) + 6px + env(safe-area-inset-bottom, 0px)); }
  /* cât timp scrii, barele de jos se ascund ca să nu acopere tastatura */
  body.typing .bottom-nav, body.typing .pay-bar, body.typing .move-bar { display: none; }
  body.typing .main { padding-bottom: 24px; }
}
@media (max-width: 360px) {
  .main { padding-left: 8px; padding-right: 8px; }
  .bottom-nav a { font-size: 9.5px; }
  .pay-bar .tot { font-size: 22px; }
  .pos-scan span { display: none; }
  .pos-scan { padding: 0 14px; }
}
.scanner { height: 100vh; height: 100dvh; }

/* ---------- calendar: ture în culoarea fiecăruia (v1.6) ---------- */
.cal-tools { margin: 0 0 10px; gap: 10px; }
.cal-tools .muted { flex: 1; min-width: 200px; }
table.roster td .cell.k-on { background: var(--uc); color: #fff; border-radius: 6px; margin: 3px; height: 38px; }
table.roster td .cell.k-on small { color: #fff; opacity: .95; font-weight: 700; }
table.roster td .cell.pend { box-shadow: inset 0 0 0 2px rgba(255,255,255,.85); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); }
table.roster td .cell.k-del { margin: 3px; height: 38px; border-radius: 6px; border: 2px dashed var(--uc); opacity: .7; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--uc) 18%, transparent) 0 6px, transparent 6px 12px); }
table.roster td.edit .cell { user-select: none; -webkit-user-select: none; }
table.roster td.edit:active .cell { transform: scale(.94); }
table.roster th.who { z-index: 3; }
.cal-bar { margin-top: 12px; }
@media (max-width: 900px) { table.roster td .cell { height: 40px; } table.roster th { min-width: 38px; } .cal-tools .muted { font-size: 12.5px; } }

/* ---------- consumabile și cheltuieli (v1.7) ---------- */
.sup-add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .sup-add { grid-template-columns: minmax(0, 1fr) 90px; } .sup-add [data-name] { grid-column: 1 / -1; } .sup-add .btn { grid-column: 1 / -1; } }
.sup-price { width: 92px; flex: none; }
.sup-price .input, .sup-price-in { min-height: 38px; padding: 6px 8px; text-align: right; }
.sup-price-in { width: 92px; }
.exp-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.exp-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exp-in-name { flex: 1; min-width: 0; }
.exp-in-qty { width: 70px; flex: none; }
.exp-price { width: 100px; flex: none; }
.exp-price .input { text-align: right; }
.exp-total { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ritm-soft); font-weight: 700; }
.exp-total b { font-family: var(--mono); font-size: 22px; }
.day-card { padding: 4px 14px 6px; margin-bottom: 10px; }
.day-head { display: flex; align-items: center; gap: 8px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.exp-line { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.exp-line:last-child { border-bottom: 0; }
.mbars { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 10px; }
.mbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.mbar i { width: 100%; max-width: 34px; background: var(--ritm-soft); border-radius: 6px 6px 2px 2px; }
.mbar.on i { background: var(--ritm); }
.mbar.on span { color: var(--ink); font-weight: 700; }

/* ---------- praguri target și bonus (v1.8) ---------- */
.tier-bar { position: relative; height: 12px; background: var(--surface-2); border-radius: 99px; margin: 14px 0 6px; }
.tier-fill { position: absolute; inset: 0 auto 0 0; background: var(--ritm); border-radius: 99px; }
.tier-mark { position: absolute; top: -6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.tier-mark i { width: 4px; height: 24px; border-radius: 2px; background: var(--muted); opacity: .6; }
.tier-mark.on i { background: var(--ok); opacity: 1; }
.tier-mark em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 1px; }
.tier-mark.on em { color: var(--ok-ink); }
.tier-labels { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.tier-labels .on { color: var(--ok-ink); font-weight: 650; }
.bonus-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.bonus-sum b { color: var(--ink); }
.tier-ed { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tier-row { display: grid; grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, .8fr) auto; gap: 8px; align-items: end; }
.tier-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ritm); color: var(--ritm-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 9px; }
@media (max-width: 640px) { .tier-row { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) auto; } .tier-row label:nth-of-type(2) { grid-column: 2 / 4; grid-row: 2; } .tier-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); } }
.ladder { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ladder-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.ladder-step > div { flex: 1; min-width: 0; }
.ladder-step .ls-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-weight: 800; font-size: 13px; flex: none; }
.ladder-step .ls-n svg { width: 16px; height: 16px; }
.ladder-step.on { background: var(--ok-soft); }
.ladder-step.on .ls-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.ladder-step.next { box-shadow: inset 0 0 0 2px var(--ritm); }

/* ---------- ecranul de pornire a turei (v1.9) ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--paper); }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.gate-card img { border-radius: 16px; margin-bottom: 4px; }
.gate-card h1 { font-size: 26px; }
.gate-card p { margin: 0 0 8px; }
.gate-card .btn.lg { min-height: 60px; font-size: 18px; }

/* ---------- tablou bonus: listă / grilă, compact / extins (v1.10) ---------- */
.emp-money { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.emp-money b { color: var(--ink); }
.bonus-sum em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; }
.emp-card.compact { padding: 10px 12px; }
.emp-card.compact .tier-bar { margin: 10px 0 12px; height: 8px; }
.emp-card.compact .tier-mark i { height: 18px; }
.emp-table td, .emp-table th { white-space: nowrap; }
.emp-table tr.emp-total td { border-top: 2px solid var(--line); background: var(--surface-2); }

/* ---------- profit și cheltuieli (v1.11) ---------- */
.pl { display: flex; flex-direction: column; margin-top: 8px; }
.pl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pl-row span { display: flex; flex-direction: column; }
.pl-row small { color: var(--muted); font-size: 11.5px; }
.pl-row.muted { color: var(--muted); }
.pl-row.pl-sub { padding-left: 12px; }
.pl-row.pl-strong { font-weight: 700; border-bottom-style: solid; }
.pl-row.pl-total { font-weight: 800; font-size: 16px; border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; }
.pl-row.pos b { color: var(--ok-ink); } .pl-row.neg b { color: var(--bad-ink); }
.pl-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 2px; }
.kpi-pos .k-val { color: var(--ok-ink); } .kpi-neg .k-val { color: var(--bad-ink); }
.ord-q { width: 96px; flex: none; }
.ord-q span { font-size: 11px !important; margin-bottom: 2px !important; }
.ord-q .input { min-height: 36px; padding: 6px 8px; text-align: right; }

/* ---------- profit editabil (v1.12) ---------- */
.pl-row[data-k] { cursor: pointer; position: relative; padding-right: 26px; border-radius: 6px; }
.pl-row[data-k]:hover { background: var(--surface-2); }
.pl-row .pl-ed { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); opacity: .45; }
.pl-row[data-k]:hover .pl-ed { opacity: 1; }
.pl-row .pl-ed svg { width: 16px; height: 16px; }
.pl-row.is-manual b { color: var(--warn-ink); }
.mtag { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--gold-soft); color: var(--warn-ink); margin-left: 4px; vertical-align: 1px; }
.mtag.x { background: var(--ritm-soft); color: var(--ritm); }
.pl-add { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 4px 12px; padding: 4px 8px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.pl-add:hover { color: var(--ritm); border-color: var(--ritm); }
.pl-add svg { width: 14px; height: 14px; }
.pl-parts { font-size: 12px; color: var(--muted); padding: 2px 0 6px 12px; }

/* ---------- defecte (v1.14) ---------- */
.dir-switch.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ret-dest { margin-top: 6px; }
.ret-dest button { padding: 5px 10px; min-height: 30px; font-size: 13px; }

/* ---------- v1.15: mărime text, căutare globală, avizier, checklist, vânzare pe calculator ---------- */
html { zoom: var(--fs, 1); }
.side-search { display: flex; align-items: center; gap: 8px; width: calc(100% - 20px); margin: 4px 10px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.side-search svg { width: 16px; height: 16px; }
.side-search span { flex: 1; text-align: left; }
.side-search kbd { font: 11px var(--body); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); }
.topbar [data-gsearch] { margin-left: 2px; }
.gs-res { max-height: 60vh; overflow: auto; }
.gs-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 4px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.gs-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.gs-item span { display: flex; flex-direction: column; min-width: 0; }
.gs-item small { color: var(--muted); font-size: 12.5px; }
.gs-item.on, .gs-item:hover { background: var(--ritm-soft); }
.notice-strip { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--nc, var(--ritm)); }
.notice .n-main { flex: 1; min-width: 0; }
.notice .n-main b { display: block; }
.notice .n-main p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); white-space: pre-line; }
.notice.unread { background: color-mix(in srgb, var(--nc, var(--ritm)) 8%, var(--surface)); }
.notice .n-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cl-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cl-box { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.cl-box b { display: flex; justify-content: space-between; }
.cl-box .progress { margin: 6px 0 4px; height: 8px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cl-item:last-child { border-bottom: 0; }
.cl-item .cl-box2 { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.cl-item.done .cl-box2 { background: var(--ok); border-color: var(--ok); color: #fff; }
.cl-item .cl-box2 svg { width: 16px; height: 16px; }
.cl-item .cl-t { flex: 1; min-width: 0; }
.cl-item.done .cl-t b { text-decoration: line-through; opacity: .6; }
.cl-item small { display: block; color: var(--muted); font-size: 12px; }
.swap-card .list li { align-items: center; }
.home-edit { display: flex; flex-direction: column; gap: 6px; }
.home-edit .he-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.home-edit .he-row span { flex: 1; }
.pos-browse { display: none; }
@media (min-width: 1000px) {
  .pos-browse { display: block; }
  .pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: calc(100vh - 290px); overflow: auto; padding: 2px; }
  .pb-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-height: 84px; }
  .pb-card:hover { border-color: var(--ritm); }
  .pb-card b { font-size: 13.5px; line-height: 1.25; flex: 1; }
  .pb-card .p-price { font-size: 14px; }
  .pb-card small { color: var(--muted); font-size: 11.5px; }
  .pb-card.low small { color: var(--bad-ink); }
  .pos2 .cart { position: sticky; top: 12px; align-self: start; }
  .pos2 .cart-card { max-height: calc(100vh - 170px); overflow: auto; }
}
.cost-hist { display: flex; flex-direction: column; gap: 2px; }
.ch-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.ch-row .ch-d { width: 86px; color: var(--muted); flex: none; }
.ch-row .ch-v { flex: 1; }
.abc { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12px; }
.abc.A { background: var(--ok-soft); color: var(--ok-ink); } .abc.B { background: var(--gold-soft); color: var(--warn-ink); } .abc.C { background: var(--bad-soft); color: var(--bad-ink); }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.cmp { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.cmp .k-label { font-size: 12.5px; color: var(--muted); }
.cmp .cv { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.cmp .cv b { font-family: var(--mono); font-size: 20px; }
.cmp .cv small { color: var(--muted); }

@media (max-width: 640px) { .hide-sm { display: none; } }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 10px; }

/* ---------- poze la produse (v1.16) ---------- */
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.thumb.ph { display: grid; place-items: center; color: var(--muted); opacity: .55; }
.thumb.ph svg { width: 18px; height: 18px; }
.thumb.ph.lg { width: 100%; height: 120px; border-radius: 14px; }
.thumb.ph.lg svg { width: 34px; height: 34px; }
.list li .thumb { margin-right: 2px; }
.res .thumb { width: 44px; height: 44px; }
.pd-photo { position: relative; margin-bottom: 12px; }
.pd-photo img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 14px; background: var(--surface-2); cursor: zoom-in; }
.pd-ph-act { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.pd-ph-act .btn { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.pb-img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 2px; background: var(--surface-2); }
.st-thumb { display: flex; align-items: center; gap: 10px; }

/* ---------- cifre care se potrivesc singure în spațiu (v1.17) ---------- */
.kpi, .cmp, .hero-total, .card.kpi { min-width: 0; container-type: inline-size; }
.kpi .k-val, .hero-total .k-val, .cmp .cv b, .exp-total b, .stat-big {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; font-variant-numeric: tabular-nums; min-width: 0; }
.kpi .k-val { font-size: clamp(16px, 13cqi, 26px); line-height: 1.15; letter-spacing: -.02em; }
.hero-total .k-val { font-size: clamp(26px, 11cqi, 44px); }
.cmp .cv { min-width: 0; flex-wrap: wrap; }
.cmp .cv b { font-size: clamp(16px, 10cqi, 22px); }
.unit { font-size: .58em; font-weight: 600; opacity: .7; margin-left: .22em; letter-spacing: 0; }
.kpi .k-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { font-size: 12.5px; }
/* grilele de indicatori se aranjează după spațiul disponibil */
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
@media (max-width: 640px) { .grid.g4, .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.g4 > :last-child:nth-child(odd), .grid.g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* carduri de valoare pe locații: o cifră mare + rânduri compacte */
.loc-card { container-type: inline-size; }
.loc-card .stat-big { font-family: var(--mono); font-weight: 750; font-size: clamp(20px, 11cqi, 30px); letter-spacing: -.02em; margin: 4px 0 2px; }
.loc-card .stat-cap { color: var(--muted); font-size: 12.5px; }
.stat-rows { margin-top: 10px; border-top: 1px solid var(--line); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); }
.stat-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- previzualizare ca angajat (v1.18) ---------- */
.viewas-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: var(--band); color: var(--band-fg); font-size: 13.5px; font-weight: 600; }
.viewas-bar svg { width: 18px; height: 18px; flex: none; }
.viewas-bar span { flex: 1; min-width: 0; }
.viewas-bar .btn { background: var(--puls); color: var(--puls-ink); border-color: var(--puls); white-space: nowrap; }
body.viewing-as .topbar { top: calc(42px + env(safe-area-inset-top, 0px)); }

/* ---------- v1.19: target zilnic, prognoză, sugestii, ore de vârf, notificări, instruire, prețuri ---------- */
.target-card { display: flex; flex-direction: column; gap: 12px; }
.tc-day .progress { height: 12px; margin: 6px 0 4px; }
.tc-month .progress.thin { height: 6px; margin: 6px 0 4px; }
.tc-num { font-family: var(--mono); font-weight: 750; font-size: 18px; font-variant-numeric: tabular-nums; }
.tc-num small { font-size: 13px; font-weight: 600; color: var(--muted); }
.tc-month .tc-num { font-size: 15px; }
.fc-big { font-family: var(--mono); font-weight: 800; font-size: clamp(24px, 6vw, 32px); margin: 2px 0; }
.pairs { margin: 8px 0 4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pairs-t { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pairs-t svg { width: 14px; height: 14px; }
.pairs-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pairs-row::-webkit-scrollbar { display: none; }
.pair { flex: none; display: flex; align-items: center; gap: 8px; max-width: 230px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pair .thumb { width: 34px; height: 34px; }
.pair span { display: flex; flex-direction: column; min-width: 0; }
.pair b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair small { font-size: 11.5px; color: var(--muted); }
.pair > svg { width: 18px; height: 18px; color: var(--ritm); flex: none; }
.pair:hover { border-color: var(--ritm); }
table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12px; }
table.heat th { font-weight: 600; color: var(--muted); padding: 2px 4px; text-align: center; }
table.heat td { position: relative; min-width: 38px; height: 34px; text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
table.heat td.r { background: none; text-align: right; padding-left: 8px; }
.two { position: absolute; top: 1px; right: 2px; font-style: normal; font-size: 9px; font-weight: 800; background: var(--gold); color: var(--gold-ink); border-radius: 4px; padding: 0 3px; line-height: 13px; }
.notif-state { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.notif-state > svg { width: 24px; height: 24px; color: var(--muted); flex: none; }
.notif-state > div { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.notif-state.on > svg { color: var(--ok-ink); }
.nc-group { margin-top: 14px; }
.nc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.nc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nc-row:last-child { border-bottom: 0; }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { left: 21px; }
.train-cta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--ink); text-decoration: none; background: var(--ritm-soft); border-color: transparent; }
.train-cta > svg { width: 28px; height: 28px; color: var(--ritm); flex: none; }
.train-cta > div { flex: 1; display: flex; flex-direction: column; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; margin: 12px 0; }
.tr-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tr-card span:last-child { display: flex; flex-direction: column; }
.tr-card small { color: var(--muted); }
.tr-card.done { border-color: var(--ok); }
.tr-card.done .tile-ic { background: var(--ok); color: #fff; }
.tr-steps { margin: 10px 0 0; padding-left: 22px; line-height: 1.6; }
.tr-steps li { margin-bottom: 6px; }
.tr-opts { display: flex; flex-direction: column; gap: 8px; }
.tr-opt { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.tr-opt:hover:not(:disabled) { border-color: var(--ritm); }
.tr-opt.right { border-color: var(--ok); background: var(--ok-soft); }
.tr-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.bp-prev { margin-top: 10px; }
tr.bp-bad td { color: var(--bad-ink); }

/* ---------- două prețuri (v1.21) ---------- */
.alt-box { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.alt-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.alt-row .input { flex: 1; min-width: 0; }
.alt-row .alt-price { flex: none; width: 110px; text-align: right; }
.alt-row span.alt-price { font-weight: 700; }
.price-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pc-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.pc-opt span { font-weight: 650; }
.pc-opt b { font-family: var(--mono); font-size: 24px; }
.pc-opt:hover, .pc-opt:focus { border-color: var(--ritm); background: var(--ritm-soft); }
.modal-bg.modal-top, .modal-top { z-index: 400 !important; }

/* ---------- v1.23: vânzare mai fluentă ---------- */
.pay-bar { gap: 10px; }
.pay-bar .pb-mid { flex: 1; min-width: 0; }
.pay-scan { min-height: 50px; border-radius: 14px; padding: 0 14px; gap: 6px; }
.pay-scan svg { width: 22px; height: 22px; }
@media (max-width: 999px) { .pos-find .pos-scan { display: none; } .pay-scan span { display: none; } .pay-scan { width: 54px; padding: 0; justify-content: center; } }
@media (min-width: 1000px) { .pay-scan { display: none; } }
.pb-head { display: flex; align-items: flex-start; gap: 6px; }
.pb-head .chips { flex: 1; min-width: 0; }
.pos-browse { display: block; padding: 10px; }
.pos-browse.hidden { display: none; }
.show-grid { align-self: flex-start; }
.pb-card { display: flex; flex-direction: column; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pb-card b { font-size: 13px; line-height: 1.2; }
.pb-card small { color: var(--muted); font-size: 11px; }
.pb-card.low small { color: var(--bad-ink); }
.pb-card:active { transform: scale(.97); }
@media (max-width: 999px) {
  .pb-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 112px; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .pb-grid::-webkit-scrollbar { display: none; }
  .pb-img { height: 64px; }
}
/* glisare în bon */
.cline { position: relative; touch-action: pan-y; transition: transform .18s ease; background: var(--surface); }
.cline.sw-l, .cline.sw-r { transition: none; }
.cline.sw-l::after, .cline.sw-r::after { content: attr(data-swl); position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: 13px; white-space: nowrap; border-radius: 10px; }
.cline.sw-l::after { left: 100%; background: var(--bad-soft); color: var(--bad-ink); margin-left: 8px; }
.cline.sw-r::after { right: 100%; background: var(--ok-soft); color: var(--ok-ink); margin-right: 8px; }
.cline.sw-go.sw-l::after { background: var(--bad-ink); color: #fff; }
.cline.sw-go.sw-r::after { background: var(--ok-ink); color: #fff; }
.cart-card { overflow: hidden; }
/* calculator de rest */
.cash-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 8px; }
.cash-btns button { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.cash-btns button.on { border-color: var(--ritm); background: var(--ritm-soft); color: var(--ritm); }
.rest-box { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px; border-radius: 14px; background: var(--ok-soft); }
.rest-box span { font-weight: 700; color: var(--ok-ink); }
.rest-box b { font-family: var(--mono); font-size: 32px; color: var(--ok-ink); font-variant-numeric: tabular-nums; }
.rest-box.short { background: var(--bad-soft); } .rest-box.short span, .rest-box.short b { color: var(--bad-ink); }
/* bandă offline */
.net-bar { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 9px 14px; padding-top: calc(9px + env(safe-area-inset-top, 0px)); font-size: 13.5px; }
.net-bar svg { width: 18px; height: 18px; flex: none; }
.net-bar.off { background: var(--bad-ink); color: #fff; }
.net-bar.sync { background: var(--ritm); color: #fff; }
/* buton flotant de scanare */
.fab-scan { position: fixed; right: 16px; bottom: calc(var(--nav-h, 0px) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 55; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--ritm); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--ritm) 45%, transparent); display: grid; place-items: center; cursor: pointer; }
.fab-scan svg { width: 26px; height: 26px; }
@media (min-width: 901px) { .fab-scan { bottom: 22px; right: 22px; } }
body[data-page="vanzare"] .fab-scan, body[data-page="retur"] .fab-scan, body:has(.gate) .fab-scan, body.typing .fab-scan, body:has(.move-bar.has) .fab-scan { display: none; }
.fab-acts { display: flex; flex-direction: column; gap: 8px; }
.fab-act { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fab-act svg { width: 22px; height: 22px; color: var(--ritm); flex: none; }
.fab-act span { display: flex; flex-direction: column; }
.fab-act small { color: var(--muted); }
.input.lg-num { font-size: 28px; font-weight: 800; text-align: center; min-height: 60px; }
.notice.handover { border-left-color: var(--gold); background: var(--gold-soft); }
/* mod o mână (telefon) */
@media (max-width: 900px) {
  body.one-hand .pos2 { display: flex; flex-direction: column-reverse; }
  body.one-hand .modal-bg { align-items: flex-end; }
  body.one-hand .modal { border-radius: 22px 22px 0 0; max-height: 88vh; }
  body.one-hand .modal-foot .btn { min-height: 52px; flex: 1; }
  body.one-hand .topbar [data-tactions] { display: none; }
}

/* ---------- selecție multiplă în Stoc (v1.24) ---------- */
.sel-head { padding: 4px 4px 8px; border-bottom: 1px solid var(--line); }
.sel-list li { gap: 10px; }
.sel-list li input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ritm); flex: none; }
.sel-list li.on { background: var(--ritm-soft); border-radius: 10px; }
.sel-bar { position: sticky; bottom: 12px; margin-top: 12px; }
.del-sample { margin: 0 0 6px; padding-left: 20px; line-height: 1.6; }

/* ---------- import: ce există deja (v1.25) ---------- */
.imp-check { margin: 4px 0 10px; }
.imp-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink); }
.imp-del { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: 13.5px; }
.imp-del .check { align-items: flex-start; margin-top: 8px; min-height: 0; }

.purge-force { align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bad-soft); margin: 8px 0; min-height: 0; }

.imp-dup { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); font-size: 13.5px; }
.imp-dup svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--warn-ink); }

.dup-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed color-mix(in srgb, var(--warn) 30%, transparent); flex-wrap: wrap; }
.dup-row > div:first-child { flex: 1; min-width: 200px; }
.seg.sm button { padding: 5px 10px; font-size: 12.5px; min-height: 30px; }

/* ---------- etichete optimizate pentru scanare (v1.28) ---------- */
.lbl { justify-content: flex-start !important; gap: 0.3mm; box-sizing: border-box; }
.lbl .ltop { display: flex; align-items: baseline; justify-content: space-between; gap: 1mm; width: 100%; flex: none; line-height: 1.05; }
.lbl .lk { font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl .lp { font-weight: 800; white-space: nowrap; margin-left: auto; }
.lbl .lp small { font-size: .62em; font-weight: 700; }
.lbl .ln { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; line-height: 1.12; width: 100%; text-align: left; flex: none; }
.lbl .lstore { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lbl .lcode { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lbl .ldig { font: 600 6pt/1 Arial, sans-serif; letter-spacing: .12em; color: #000; flex: none; }
.lbl svg.bc { background: #fff; }
@media print { .lbl, .lbl * { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- câmpuri numerice fără săgeți și ferestre mai sigure (v1.31) ---------- */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field > span svg, label > span > svg { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.modal-body svg:not([class]):not([width]) { max-width: 100%; }
.modal.nudge { animation: nudge .28s ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* câmpul de alertă stoc: chenar roșu discret, ca să iasă în evidență fără să încarce pagina (v1.31.1) */
.alert-field > span { color: color-mix(in srgb, var(--bad) 75%, var(--muted)); }
.alert-field .input { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 3%, var(--surface)); }
.alert-field .input:focus { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 14%, transparent); outline: none; }

/* ---------- brand ritm (v1.32): cifrele mari în Geist Mono, mai strânse ---------- */
.hero-total .k-val, .kpi .k-val, .pay-bar .tot, .clock-live, .fc-big, .rest-box b, .loc-card .stat-big { letter-spacing: -.05em; }

/* brand v0.1 (docs/brand.md): Încasează e butonul principal Cobalt; Scanează e secundar pe banda întunecată */
.pay-bar .pay-scan { background: color-mix(in srgb, var(--band-fg) 14%, transparent); color: var(--band-fg); border-color: transparent; }

/* rezultatul comparației din pagina Platformă (v1.33) */
.notice.ok { --nc: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.notice.bad { --nc: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }

/* ---------- Consola ritm (proprietarul platformei, v1.34) ---------- */
.console { min-height: 100vh; min-height: 100dvh; background: var(--paper); }
.console-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); background: var(--band); color: var(--band-fg); }
.console-top .brand { padding: 0; }
.console-top .brand-sub { color: color-mix(in srgb, var(--band-fg) 70%, transparent); }
.console-top .btn.ghost { color: var(--band-fg); }
.console-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.console-head { display: flex; align-items: center; gap: 12px; }
.console-head h1 { flex: 1; }
.grid.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ---------- logare ritm: email + PIN (v1.35) ---------- */
.login-form { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
.pin-input { font-family: var(--mono); letter-spacing: .35em; font-size: 20px; text-align: center; }
.login-err { color: var(--bad-ink); font-size: 13.5px; min-height: 1em; margin: 0; }

/* ---------- logo spre Acasă, Consola ritm sus (v1.36) ---------- */
.brand-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-link:hover .brand-name { color: var(--cobalt); }
.console-top .brand-link:hover .brand-name { color: var(--band-fg); }
.console-btn { margin: 0 10px 12px; width: calc(100% - 20px); justify-content: center; }
.topbar-logo { display: none; flex: none; }
.topbar-logo img { display: block; border-radius: 8px; }
@media (max-width: 999px) { .topbar-logo { display: block; } }
