/* Portal B2B Anvelope — sistem vizual: neutru, dens, lizibil. Tokeni in :root; mod intunecat automat. */
:root {
  color-scheme: light dark;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f7f9fc; --surface-hover: #eff3f9;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --line: #e3e8ef; --line-strong: #cbd5e1;
  --topbar: #0f1b33; --topbar-text: #e8edf6;
  --accent: #1d4ed8; --accent-hover: #1e40af; --on-accent: #ffffff;
  --ok: #157f3c; --ok-bg: #eaf7ef; --warn: #9a5b00; --warn-bg: #fff6e0; --err: #b3261e; --err-bg: #fdecea;
  --radius: 8px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 6px rgba(15, 23, 42, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131b; --surface: #151c27; --surface-2: #1a2230; --surface-hover: #1e2838;
    --text: #e8edf5; --text-2: #c3cddb; --muted: #8a97a9; --line: #243042; --line-strong: #33425a;
    --topbar: #0a1220; --topbar-text: #e8edf6;
    --accent: #6ea2ff; --accent-hover: #8bb4ff; --on-accent: #0b1220;
    --ok: #4cc38a; --ok-bg: #12281f; --warn: #e0a84a; --warn-bg: #2b2412; --err: #ff8a80; --err-bg: #2f1a19;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- bara de sus ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--topbar); color: var(--topbar-text); }
.topbar-row { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.brand-logo { height: 34px; width: auto; max-width: 180px; display: block; background: #fff; border-radius: 6px; padding: 3px 8px; }
.brand-text { font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-weight: 500; opacity: .75; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .25); }
.spacer { flex: 1; }
.cart-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: inherit; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.cart-chip:hover { background: rgba(255, 255, 255, .18); }
.account { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; opacity: .9; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-inverse { background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: inherit; border-radius: 6px; padding: 6px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.btn-inverse:hover { background: rgba(255, 255, 255, .12); }
.tabs { max-width: 1440px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--topbar-text); opacity: .72; padding: 11px 14px; cursor: pointer; white-space: nowrap; font-weight: 500; }
.tabs button:hover { opacity: 1; }
.tabs button[aria-current="page"] { opacity: 1; border-bottom-color: #fff; font-weight: 600; }
.tabs .count { margin-left: 6px; background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* ---------- pagina ---------- */
main { max-width: 1440px; margin: 0 auto; padding: 20px; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
h1 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 650; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.searchbox { position: relative; flex: 1 1 360px; max-width: 640px; display: block; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; height: 42px; padding: 0 12px 0 38px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 15px; }
.hint { color: var(--muted); font-size: 12px; margin: -6px 0 12px; }

/* ---------- butoane ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not([disabled]) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover:not([disabled]) { background: var(--surface-hover); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon.danger:hover { color: var(--err); background: var(--err-bg); }
.btn-icon .chev { transition: transform .15s; }
.btn-icon[aria-expanded="true"] .chev { transform: rotate(90deg); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); height: 32px; }
.stepper .step { width: 30px; height: 100%; border: 0; background: transparent; cursor: pointer; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.stepper .step:hover { background: var(--surface-hover); }
.stepper input { width: 54px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; background: transparent; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- grid ---------- */
.grid-wrap { overflow: auto; max-height: calc(100vh - 250px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.grid td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; background: var(--surface); }
.grid tbody tr:hover td { background: var(--surface-hover); }
.grid tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.c-actions { position: sticky; right: 0; box-shadow: -8px 0 8px -8px rgba(15, 23, 42, .2); white-space: nowrap; }
.grid th.c-actions { z-index: 3; }
.c-actions .row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.c-name { min-width: 200px; font-weight: 500; }
.c-code { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-attr { color: var(--text-2); white-space: nowrap; }
.c-specs { display: none; }
.c-price { font-weight: 600; }
.subgrid { width: 100%; border-collapse: collapse; font-size: 13px; }
.subgrid th { position: static; background: transparent; padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; }
.subgrid td { background: transparent !important; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.lines-row > td { padding: 0 0 0 52px; background: var(--surface-2) !important; }
.doc-row { cursor: pointer; }
.doc-row .c-code { font-weight: 600; color: var(--text); }

.thumb { display: inline-block; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); padding: 0; overflow: hidden; cursor: zoom-in; vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.thumb.ph { cursor: default; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); }
.zoom-pop { position: fixed; z-index: 60; width: 300px; height: 300px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 14px 36px rgba(15, 23, 42, .3); padding: 8px; pointer-events: none; }
.zoom-pop img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10, 16, 28, .85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: min(94vw, 960px); max-height: 82vh; background: #fff; border-radius: 10px; object-fit: contain; }
.lightbox .close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: #0f172a; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lightbox .cap { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; padding: 0 16px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.neutral::before { display: none; }
.chip.stock-available { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.chip.stock-limited { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip.stock-very_low { color: var(--err); background: var(--err-bg); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.ok-mark { color: var(--ok); display: inline-flex; }
.bad-mark { color: var(--err); display: inline-flex; }
.spec { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--text-2); }
.spec b { font-weight: 600; color: var(--muted); margin-right: 4px; }

/* catalog compact: incape pe pagina fara scroll lateral (desktop); sub 1100px devine carduri */
.grid-catalog { font-size: 12.5px; }
.grid-catalog th, .grid-catalog td { padding: 5px 8px; }
.grid-catalog th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
.grid-catalog .c-attr { white-space: normal; }
.grid-catalog .c-name { min-width: 0; }
.grid-catalog .c-actions .row { gap: 6px; }
.grid-catalog .thumb { width: 38px; height: 38px; }
.grid-catalog .stepper { height: 30px; }
.grid-catalog .stepper .step { width: 26px; }
.grid-catalog .stepper input { width: 42px; }
.grid-catalog .btn-sm { height: 30px; padding: 0 9px; }
.grid-catalog .chip { padding: 1px 8px; }

/* ---------- mesaje, totaluri, liste ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 3px; background: var(--surface); margin: 0 0 10px; }
.alert svg { flex: none; margin-top: 2px; }
.alert.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.alert.warn svg { color: var(--warn); }
.alert.err { border-left-color: var(--err); background: var(--err-bg); }
.alert.err svg { color: var(--err); }
.alert.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.alert.ok svg { color: var(--ok); }
.alert .msg-text { white-space: pre-line; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.cart-foot { display: grid; grid-template-columns: 1fr 360px; gap: 20px; margin-top: 16px; align-items: start; }
.summary dl { margin: 0 0 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { font-size: 17px; font-weight: 700; color: var(--text); }
.summary .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary .actions .btn { flex: 1 1 auto; }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; flex-wrap: wrap; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.sk-row { height: 44px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.sk-row:last-child { border-bottom: 0; }
.sk-row::after { content: ""; height: 12px; width: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-row::after { animation: none; } .btn-icon .chev { transition: none; } }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .35); max-width: calc(100vw - 32px); }

/* ---------- autentificare ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(180deg, var(--topbar) 0, var(--topbar) 36%, var(--bg) 36%); }
.auth-card { width: 100%; max-width: 410px; padding: 28px; }
.auth-logo { display: block; max-height: 56px; max-width: 220px; margin: 0 auto 18px; }
.auth h1 { text-align: center; font-size: 20px; }
.auth .sub { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.field { display: block; margin: 0 0 14px; }
.field span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font-size: 16px; }
.auth .btn { width: 100%; height: 44px; }

/* ---------- mobil ---------- */
@media (max-width: 760px) {
  main { padding: 12px; }
  .topbar-row { padding: 8px 12px; gap: 8px; }
  .brand-logo { height: 28px; max-width: 130px; }
  .brand-sub, .who, .hide-sm { display: none; }
  .tabs { padding: 0 6px; }
  .tabs button { padding: 10px 12px; }
  h1 { font-size: 19px; }
  .btn, .btn-icon { min-height: 40px; }
  .btn-icon { width: 40px; height: 40px; }
  .stepper { height: 40px; }
  .stepper .step { width: 40px; }
  .stepper input { width: 56px; font-size: 16px; }
  .searchbox input { height: 46px; font-size: 16px; }
  .cart-foot { grid-template-columns: 1fr; }
  .lightbox img { max-height: 78vh; }

  .grid-wrap { max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .grid, .grid tbody { display: block; }
  .grid thead { display: none; }
  .grid tbody tr:hover td { background: transparent; }
  .grid td { display: block; padding: 0; border: 0; background: transparent; }
  .c-actions { position: static; box-shadow: none; }
  .grid td.c-attr { display: none; }
  .grid td.c-specs { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .grid tr { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 12px; box-shadow: var(--shadow); }

  .grid-catalog tr { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px 12px; grid-template-areas: "thumb code price" "thumb name price" "specs specs specs" "stock stock stock" "act act act"; align-items: start; }
  .grid-catalog .c-thumb { grid-area: thumb; }
  .grid-catalog .c-code { grid-area: code; font-size: 12px; }
  .grid-catalog .c-name { grid-area: name; min-width: 0; }
  .grid-catalog .c-price { grid-area: price; font-size: 16px; }
  .grid-catalog .c-specs { grid-area: specs; }
  .grid-catalog .c-stock { grid-area: stock; }
  .grid-catalog .c-actions { grid-area: act; }
  .grid-catalog .c-actions .row { justify-content: space-between; }
  .grid-catalog .c-actions .btn { flex: 1; }

  .grid-cart tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 12px; grid-template-areas: "code code del" "name name name" "qty stock ok" "price value value"; align-items: center; }
  .grid-cart td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .grid-cart .c-code { grid-area: code; font-size: 12px; }
  .grid-cart .c-name { grid-area: name; min-width: 0; }
  .grid-cart .c-qty { grid-area: qty; }
  .grid-cart .c-stock { grid-area: stock; }
  .grid-cart .c-ok { grid-area: ok; text-align: right; }
  .grid-cart .c-price { grid-area: price; }
  .grid-cart .c-value { grid-area: value; text-align: right; font-weight: 700; font-size: 15px; }
  .grid-cart .c-del { grid-area: del; text-align: right; }
  .grid-cart .num { text-align: left; }
  .grid-cart .c-value.num { text-align: right; }

  .grid-stack tr { display: block; }
  .grid-stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; }
  .grid-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .grid-stack td[data-label=""]::before { display: none; }
  .grid-stack .lines-row { padding: 0; border: 0; box-shadow: none; background: transparent; margin: -6px 0 10px; }
  .grid-stack .lines-row > td { display: block; padding: 0; background: transparent !important; }
  .subgrid, .subgrid tbody { display: block; }
  .subgrid thead { display: none; }
  .subgrid tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 6px 0 0 8px; box-shadow: none; }
  .subgrid td { display: flex; justify-content: space-between; padding: 3px 0; border: 0; }
  .subgrid td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .doc-row .c-code { font-size: 14px; }
  .grid-stack .doc-row { position: relative; }
  .grid-stack .doc-row td[data-label=""] { position: absolute; top: 6px; right: 6px; display: block; padding: 0; }
  .grid-stack .doc-row td[data-label="Număr"] { padding-right: 48px; }
  .subgrid td { gap: 12px; }
}

@media (max-width: 1100px) {
  .catalog-wrap { max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .grid-catalog { font-size: 13px; display: block; }
  .grid-catalog tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; }
  .grid-catalog thead { display: none; }
  .grid-catalog tbody tr:hover td { background: transparent; }
  .grid-catalog td { display: block; padding: 0; border: 0; background: transparent; }
  .grid-catalog td.c-actions { position: static; box-shadow: none; }
  .grid-catalog td.c-attr { display: none; }
  .grid-catalog td.c-specs { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .grid-catalog tr { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px 12px; grid-template-areas: "thumb code price" "thumb name price" "specs specs specs" "stock stock stock" "act act act"; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 12px; box-shadow: var(--shadow); }
  .grid-catalog .c-thumb { grid-area: thumb; }
  .grid-catalog .c-code { grid-area: code; font-size: 12px; }
  .grid-catalog .c-name { grid-area: name; }
  .grid-catalog .c-price { grid-area: price; font-size: 16px; }
  .grid-catalog .c-specs { grid-area: specs; }
  .grid-catalog .c-stock { grid-area: stock; }
  .grid-catalog .c-actions { grid-area: act; }
  .grid-catalog .c-actions .row { justify-content: space-between; }
  .grid-catalog .c-actions .btn { flex: 1; }
  .grid-catalog .thumb { width: 56px; height: 56px; }
  .grid-catalog .stepper { height: 40px; }
  .grid-catalog .stepper .step { width: 40px; }
  .grid-catalog .stepper input { width: 56px; font-size: 16px; }
  .grid-catalog .btn-sm { height: 40px; }
}

/* ---------- cautare pe tag-uri, filtre, ordonare, numar pe pagina ---------- */
.tagbox { position: relative; flex: 1 1 420px; max-width: 760px; min-height: 42px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 4px 6px 4px 36px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: text; }
.tagbox:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.tagbox > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tags { display: contents; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 500; }
.tag-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; opacity: .85; }
.tag-x:hover { background: rgba(255, 255, 255, .22); opacity: 1; }
.tag-input { flex: 1 1 140px; min-width: 120px; height: 32px; border: 0; background: transparent; outline: none; font-size: 15px; }
.tagbox .btn-icon { margin-left: auto; }
.select { height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; }
.select-sm { height: 32px; font-size: 13px; }
.facets { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.facet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facet-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 44px; }
.facet-btn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; }
.facet-btn:hover { background: var(--surface-hover); }
.facet-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.facet-btn .n { opacity: .7; margin-left: 6px; font-size: 12px; }
.pager .select { margin-left: auto; }
@media (max-width: 760px) {
  .tagbox { flex-basis: 100%; max-width: none; min-height: 46px; }
  .tag { height: 32px; font-size: 14px; }
  .tag-x { width: 28px; height: 28px; }
  .tag-input { font-size: 16px; height: 36px; }
  .select { flex: 1 1 100%; height: 44px; font-size: 16px; }
  .select-sm { flex: 0 0 auto; height: 40px; }
  .facet { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .facet::-webkit-scrollbar { display: none; }
  .facet-label, .facet-btn { flex: none; }
  .facet-btn { height: 36px; }
  .pager .select { margin-left: 0; }
}
.pad { padding: 10px 12px; margin: 0; }

/* ---------- pagina de garda (login) ---------- */
body.is-login main { max-width: none; padding: 0; }
.cover { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.cover-hero { background: linear-gradient(160deg, #0b1630 0%, #14315f 100%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 32px; }
.cover-logo { background: #fff; border-radius: 14px; padding: 16px 26px; max-height: 110px; max-width: 320px; width: auto; height: auto; align-self: flex-start; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.cover-hero .brand-text { font-size: 28px; font-weight: 700; }
.cover-hero h1 { font-size: 36px; line-height: 1.15; color: #fff; margin: 0 0 12px; font-weight: 700; }
.cover-hero .lead { font-size: 17px; line-height: 1.5; color: rgba(255, 255, 255, .85); max-width: 460px; margin: 0; }
.cover-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cover-points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .92); }
.cover-points svg { flex: none; margin-top: 2px; color: #7fb2ff; }
.cover-form { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg); }
.cover-form .auth-card { box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 22px; font-weight: 650; }
.auth-card .sub { color: var(--muted); margin: 6px 0 20px; text-align: left; }
@media (max-width: 860px) {
  .cover { grid-template-columns: 1fr; min-height: 100vh; }
  .cover-hero { padding: 28px 20px 24px; gap: 18px; }
  .cover-logo { max-height: 72px; max-width: 220px; padding: 10px 18px; }
  .cover-hero h1 { font-size: 26px; margin-bottom: 8px; }
  .cover-hero .lead { font-size: 15px; }
  .cover-points { gap: 10px; font-size: 14px; }
  .cover-form { padding: 20px 16px 32px; align-items: flex-start; }
}
.auth-card .btn { width: 100%; height: 44px; }

/* buton set de 4 bucati */
.btn-set4 .lbl-long { display: none; }
.btn-set4 { min-width: 40px; }
@media (max-width: 1100px) {
  .btn-set4 .lbl-short { display: none; }
  .btn-set4 .lbl-long { display: inline; }
  .grid-catalog .c-actions .row { flex-wrap: wrap; }
  .grid-catalog .c-actions .btn-set4 { flex: 1 1 100%; }
}
.facets .hint { margin: 0; }
.facet-btn { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }

/* antete aliniate cu valorile coloanei */
.grid th.num, .subgrid th.num { text-align: right; }
.grid th.center, .subgrid th.center { text-align: center; }

/* adaugare in cos: woosh spre cos si mesaj sub butonul de cos */
.fly { position: fixed; z-index: 100; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; pointer-events: none; box-shadow: 0 6px 16px rgba(29, 78, 216, .45); }
.fly.trail { box-shadow: none; }
.carttip { position: fixed; z-index: 95; background: #0f172a; color: #fff; border: 1px solid rgba(255, 255, 255, .16); padding: 10px 14px; border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .4); font-size: 13px; line-height: 1.4; display: flex; gap: 12px; align-items: center; max-width: min(340px, calc(100vw - 16px)); }
.carttip::before { content: ""; position: absolute; top: -6px; left: var(--arrow-left, 24px); width: 10px; height: 10px; background: #0f172a; border-left: 1px solid rgba(255, 255, 255, .16); border-top: 1px solid rgba(255, 255, 255, .16); transform: rotate(45deg); }
.carttip.show { animation: tip-in .22s ease-out; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tip-link { background: none; border: 0; color: #8bb4ff; cursor: pointer; font-weight: 600; padding: 4px 2px; white-space: nowrap; }
.tip-link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .carttip.show { animation: none; } }

/* anvelopa care zboara spre cos: cauciuc negru cu janta deschisa si contur luminos (vizibil si pe fundal inchis) */
.fly { background: radial-gradient(circle, #cbd5e1 0 22%, #1f2937 24%, #0b1220 100%); color: #e5e7eb; border: 2px solid #0b1220; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 8px 18px rgba(0, 0, 0, .4); }
.fly svg { display: block; }
.fly.trail { background: #0b1220; border-color: #0b1220; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }

/* telefon: toate valorile filtrelor se vad (se impacheteaza pe mai multe randuri, fara derulare laterala ascunsa) */
@media (max-width: 760px) {
  .facet { flex-wrap: wrap; overflow: visible; gap: 6px; padding-bottom: 0; }
  .facet-label { flex: 0 0 100%; margin-top: 4px; }
  .facet-btn { flex: 0 1 auto; height: auto; min-height: 36px; padding: 6px 12px; white-space: normal; text-align: left; max-width: 100%; line-height: 1.25; }
}
