/* ============================================================
   Semico Gourmet Pastry — paletă brand (auriu + ciocolatiu + cireșiu)
   ============================================================ */
:root[data-theme="dark"] {
  --bg:        #2a1c12;
  --bg-elev:   #3a2a1c;
  --bg-float:  #4a3525;
  --bg-input:  #4a3525;
  --border:    #5e4530;
  --border-strong: #7a5e44;
  --fg:        #f7ead2;
  --fg-muted:  #c5b39a;
  --fg-dim:    #94806a;
  --accent:    #e5c462;
  --accent-fg: #2f1e0e;
  --accent-hover: #efd58c;
  --success:   #34d465;
  --warning:   #e5b933;
  --danger:    #e05550;
  --status-nou: #2196ff;
  --status-prep: #e5b933;
  --status-livrare: #d8a3d4;
  --status-final: #34d465;
  --shadow-card: 0 1px 0 rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.4);
  --shadow-pop:  0 2px 0 rgba(0,0,0,.35), 0 14px 36px rgba(0,0,0,.5);
}

:root[data-theme="light"] {
  --bg:        #fbf5e8;
  --bg-elev:   #ffffff;
  --bg-float:  #f5edd9;
  --bg-input:  #ffffff;
  --border:    #e8dbbe;
  --border-strong: #c9b68c;
  --fg:        #2f1e0e;
  --fg-muted:  #6e5640;
  --fg-dim:    #a0866a;
  --accent:    #b8860b;
  --accent-fg: #ffffff;
  --accent-hover: #9a6f09;
  --success:   #15803d;
  --warning:   #b45309;
  --danger:    #b22222;
  --status-nou: #0a84ff;
  --status-prep: #b45309;
  --status-livrare: #8e44ad;
  --status-final: #16a34a;
  --shadow-card: 0 1px 0 rgba(91, 60, 17, .05), 0 4px 14px rgba(91, 60, 17, .08);
  --shadow-pop:  0 2px 0 rgba(91, 60, 17, .06), 0 12px 32px rgba(91, 60, 17, .14);
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }

/* Mobile overflow safeguards: targeted max-width pe containere si form controls.
   NU aplicam regula globala pe .main * deoarece sparge layout-ul intern Leaflet. */
input, select, textarea, .btn { min-width: 0; }
img, video, iframe { max-width: 100%; }
input, select, textarea {
  max-width: 100%;
  width: 100%;
  min-width: 0;
}
.card, .filters, .order-row, .product-card,
.flash, .empty, .login-card,
.modal-dialog, .pin-popup,
.page-header, .product-list, .order-list { max-width: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  /* Disable double-tap-to-zoom (and the 300ms tap delay). Pinch-zoom still works. */
  touch-action: manipulation;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ============================================================
   Layout chrome
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  height: 52px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.brand {
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  color: var(--fg);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  width: 28px; height: 28px; object-fit: contain;
  border-radius: 4px;
  flex: 0 0 auto;
}
.brand-text { line-height: 1; white-space: nowrap; }
@media (max-width: 400px) { .brand-text { font-size: 14px; } }
@media (max-width: 340px) { .brand-text { font-size: 13px; } }
.topbar-actions { display: flex; gap: 8px; }
.logout-form { margin: 0; }
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--bg-float); color: var(--fg); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-icon { display: none; }
[data-theme="dark"] .theme-icon--dark { display: inline-block; }
[data-theme="light"] .theme-icon--light { display: inline-block; }

.main {
  padding: 16px 14px calc(84px + env(safe-area-inset-bottom)) 14px;
  max-width: 960px; margin: 0 auto;
}
@media (max-width: 480px) {
  .main { padding: 12px 10px calc(80px + env(safe-area-inset-bottom)) 10px; }
  .card { padding: 10px; }
}
.main--centered {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding-bottom: 16px;
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  display: flex; justify-content: space-around;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 6px 4px max(6px, env(safe-area-inset-bottom)) 4px;
}
/* Forteaza Leaflet sa stea sub bottom-nav */
.leaflet-container { z-index: 1; }
.leaflet-pane,
.leaflet-top,
.leaflet-bottom { z-index: 400; }
.leaflet-popup-pane { z-index: 700; }
.nav-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  color: var(--fg-muted);
  font-size: 11px;
  border-radius: 8px;
  transition: color .15s ease, background-color .15s ease;
}
.nav-item:hover { color: var(--fg); }
.nav-item.is-active { color: var(--accent); }
.nav-icon { width: 22px; height: 22px; display: block; }
.nav-label { font-size: 11px; }

/* ============================================================
   Flashes
   ============================================================ */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.flash {
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 14px;
}
.flash--success { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.flash--danger  { border-color: color-mix(in srgb, var(--danger) 60%, var(--border)); color: var(--danger); }
.flash--warning { border-color: color-mix(in srgb, var(--warning) 60%, var(--border)); }

/* ============================================================
   Forms & buttons
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 13px; color: var(--fg-muted); font-weight: 500; }
/* Inputuri stilizate global (oriunde apar in app, nu doar in .field) */
input[type=text],
input[type=password],
input[type=number],
input[type=date],
input[type=time],
input[type=tel],
input[type=search],
input[type=email],
input[type=url],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg-input);
  color: var(--fg);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  /* >=16px stops iOS Safari auto-zooming when a field gains focus. */
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--accent);
}
textarea { min-height: 80px; resize: vertical; }

/* File input — wrap nativ + buton stilizat brand */
input[type=file] {
  width: 100%;
  padding: 0;
  background: var(--bg-input);
  color: var(--fg);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
input[type=file]::-webkit-file-upload-button,
input[type=file]::file-selector-button {
  background: var(--bg-float);
  color: var(--fg);
  border: none;
  border-right: 1.5px solid var(--border-strong);
  padding: 10px 14px;
  font: inherit;
  font-weight: 500;
  margin-right: 10px;
  cursor: pointer;
  border-radius: 7px 0 0 7px;
}
input[type=file]::-webkit-file-upload-button:hover,
input[type=file]::file-selector-button:hover {
  background: var(--bg-input);
  color: var(--accent);
}

/* Placeholder color (global) — match brand palette */
::placeholder { color: var(--fg-dim); opacity: 1; }
input::placeholder, textarea::placeholder { color: var(--fg-dim); opacity: 1; }
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: var(--fg-dim); }
input::-moz-placeholder, textarea::-moz-placeholder { color: var(--fg-dim); opacity: 1; }

/* Custom checkbox — border auriu + bifa ciocolat */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; min-width: 20px;
  margin: 0;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  position: relative; cursor: pointer;
  touch-action: manipulation;
  vertical-align: middle;
  transition: background-color .12s ease, border-color .12s ease;
}
input[type="checkbox"]:hover { border-color: var(--accent-hover); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: '✓';
  color: var(--accent-fg);
  font-weight: 700; font-size: 14px; line-height: 1;
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Custom select — fundal brand + sageata aurie (SVG inline) */
.field select,
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: var(--bg-input);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23b8860b" d="M6 8L0 0h12z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
}
[data-theme="dark"] .field select,
[data-theme="dark"] select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23e5c462" d="M6 8L0 0h12z"/></svg>');
}
/* Option styling — limited on iOS Safari but works on desktop/Android */
select option { background: var(--bg-elev); color: var(--fg); }

/* Date inputs — lasam iconita nativa, dar fortam color-scheme conform temei
   (face si picker-ul si iconita sa fie in tonurile temei). */
input[type="date"] {
  cursor: pointer; min-width: 0; max-width: 100%;
  position: relative;
}
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="number"] { color-scheme: dark; }
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="number"] { color-scheme: light; }
/* Iconita nativa calendar — ascunsa complet (click pe input deschide picker via JS) */
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Ascunde textul "zz.ll.aaaa" cand inputul e gol — chiar si pe focus,
   pana cand user-ul alege o data (JS scoate clasa .is-empty la change). */
input[type="date"].is-empty::-webkit-datetime-edit-year-field,
input[type="date"].is-empty::-webkit-datetime-edit-month-field,
input[type="date"].is-empty::-webkit-datetime-edit-day-field,
input[type="date"].is-empty::-webkit-datetime-edit-text {
  color: transparent;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--fg);
  font-weight: 500;
  transition: transform .05s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
  min-height: 40px;
  touch-action: manipulation;
}
.btn:hover { background: var(--bg-float); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border-strong)); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 12%, var(--bg-elev)); }
.btn--ghost  { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn--ghost:hover { color: var(--fg); background: var(--bg-elev); }
.btn--sm { padding: 6px 10px; font-size: 13px; min-height: 32px; }
.btn--block { width: 100%; }

.inline-form { display: inline; margin: 0; }

/* ============================================================
   Login
   ============================================================ */
.body--login { background: var(--bg); }
.login-card {
  width: 100%; max-width: 360px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.login-logo {
  width: 96px; height: 96px; object-fit: contain;
  margin: 0 auto 12px;
  display: block;
}
.login-card form { text-align: left; }
.login-brand { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.login-subtitle { color: var(--fg-muted); margin: 4px 0 20px 0; font-size: 14px; }

/* ============================================================
   Page headers, cards, tables
   ============================================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.page-title { font-size: 18px; font-weight: 600; margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 12px; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.list-table { width: 100%; border-collapse: collapse; min-width: 100%; }
.list-table th, .list-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.list-table th { color: var(--fg-muted); font-weight: 500; }
.list-table tr:last-child td { border-bottom: none; }
.list-table td.actions-cell { white-space: nowrap; text-align: right; min-width: 0; }
.list-table td.actions-cell .row-gap { justify-content: flex-end; flex-wrap: nowrap; }
.list-table { min-width: max-content; }
@media (max-width: 480px) { .list-table { min-width: 100%; } }

/* Items table pe /comenzi/nou — compact, fara scroll orizontal */
.items-wrap { width: 100%; max-width: 100%; overflow: hidden; }
.list-table--items { min-width: 0; width: 100%; table-layout: auto; }
.list-table--items th.qty-col, .list-table--items td.qty-col { width: 70px; }
.list-table--items .qty-input {
  width: 64px; min-width: 0; padding: 8px 6px; text-align: center;
}
.list-table--items .item-product { padding: 8px 6px; min-width: 0; }
.list-table--items .item-name { font-weight: 600; font-size: 14px; line-height: 1.3; word-break: break-word; }
.list-table--items .item-desc {
  font-size: 11px; color: var(--fg-muted); line-height: 1.3; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-table--items .item-cat {
  display: inline-block;
  font-size: 10px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-top: 3px;
}
.list-table--items .line-price { white-space: nowrap; font-size: 13px; }

@media (max-width: 480px) {
  .list-table--items th, .list-table--items td { padding: 6px 4px; font-size: 13px; }
  .list-table--items .item-name { font-size: 13px; }
  .list-table--items .item-desc { font-size: 10px; }
  .list-table--items .item-cat { font-size: 9px; }
  .list-table--items th.qty-col, .list-table--items td.qty-col { width: 56px; }
  .list-table--items .qty-input { width: 50px; padding: 6px 4px; font-size: 13px; }
  .list-table--items .line-price { font-size: 12px; }
}

.empty {
  text-align: center; padding: 40px 16px; color: var(--fg-muted);
  border: 1px dashed var(--border-strong); border-radius: 10px;
}

/* ============================================================
   Catalog
   ============================================================ */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 2px 8px 2px;
  margin: 0 -2px 12px -2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar { display: none; width: 0; height: 0; }
.chip {
  flex: 0 0 auto;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--fg-muted); font-size: 13px;
  cursor: pointer;
}
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* Radio buttons stilizati ca chip-uri (folosit pentru discount type) */
.discount-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio { display: inline-block; cursor: pointer; position: relative; }
.chip-radio input {
  position: absolute; opacity: 0;
  width: 1px; height: 1px; overflow: hidden;
}
.chip-radio span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-float);
  border: 1.5px solid var(--border-strong);
  color: var(--fg);
  font-weight: 500;
  font-size: 13px;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
  touch-action: manipulation;
  user-select: none;
}
.chip-radio:hover span { border-color: var(--accent); }
.chip-radio input:checked + span {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.chip-radio input:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* v19: Status chips on /comenzi/<id> — re-use chip-radio + status colors */
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-radio--status .status {
  padding: 4px 10px;
  opacity: 0.5;
  transition: opacity .12s ease;
}
.chip-radio--status input:checked + .status {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.product-list {
  display: flex; flex-direction: column; gap: 8px;
}
.product-card {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
  padding: 10px;
}
.product-card.is-hidden { display: none; }
.product-thumb {
  flex: 0 0 84px;
  width: 84px; height: 84px;
  background: var(--bg-float);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb-placeholder { color: var(--fg-dim); font-size: 11px; padding: 0 4px; text-align: center; }
.product-body {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
}
.product-name { font-weight: 600; font-size: 15px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-cat { font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.product-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 600; color: var(--accent); font-size: 15px; }
.product-actions {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  align-self: center;
}
@media (max-width: 480px) {
  .product-card { flex-wrap: nowrap; gap: 8px; padding: 8px; }
  .product-thumb { flex: 0 0 56px; width: 56px; height: 56px; }
  .product-name { font-size: 14px; }
  .product-price { font-size: 14px; }
  .product-cat { font-size: 10px; }
  .product-desc { font-size: 11px; -webkit-line-clamp: 2; }
  .product-actions { flex: 0 0 auto; gap: 4px; }
  .product-actions .qty-btn {
    width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px;
    font-size: 14px;
  }
  .product-actions .qty-input {
    width: 36px; min-width: 0; min-height: 30px;
    padding: 4px; font-size: 14px;
  }
}
.qty-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg-float);
  color: var(--fg); display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex: 0 0 32px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.chip, .nav-item, .icon-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.qty-btn:hover { background: var(--bg-input); }
.qty-input {
  width: 44px; text-align: center;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); padding: 6px;
}

/* Gramaj sub descriere/categorie pe cardul de catalog */
.product-gramaj { font-size: 12px; color: var(--fg-muted); }

/* Card layout v18: thumb | body | actions (simple/variant trigger).
   Variant panel apare DEDESUBT card-ului, expandabil via ∨. */
.product-card-main {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
}
.product-card { flex-direction: column; padding: 10px; cursor: pointer; }
.product-card .product-card-main { gap: 12px; }
@media (max-width: 480px) {
  .product-card { padding: 8px; }
  .product-card .product-card-main { gap: 8px; }
}

/* Variant ∨ toggle button — sub qty-trio, aliniat la dreapta, lățime icon */
.variant-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 34px;
  margin: 4px 0 0 auto;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: background-color .12s ease;
  touch-action: manipulation;
  flex: 0 0 36px;
}
.variant-toggle:hover { background: var(--bg-float); }
.variant-toggle.is-open { background: var(--bg-float); }
.variant-toggle svg { display: block; }

.product-card .product-actions {
  flex-direction: column;
  gap: 4px;
}

/* Variant panel inline sub card */
.variant-panel {
  width: 100%;
  display: flex; flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.variant-panel[hidden] { display: none; }
.variant-row {
  display: flex; align-items: center; gap: 8px;
}
.variant-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: lowercase;
  letter-spacing: .02em;
  flex: 0 0 auto;
  min-width: 50px;
}
.variant-price {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  flex: 1 1 auto;
  white-space: nowrap;
}

/* qty-trio = un singur set −/input/+, folosit pe baza + variante */
.qty-trio {
  display: inline-flex; align-items: center; gap: 4px;
  flex: 0 0 auto;
}
.qty-trio .qty-btn {
  width: 34px; height: 34px; min-width: 34px;
  flex: 0 0 34px;
  font-size: 16px;
}
.qty-trio .qty-input {
  width: 44px; min-width: 0;
  min-height: 34px;
  padding: 2px 4px;
  font-size: 14px;
  text-align: center;
}
@media (max-width: 480px) {
  .variant-label { font-size: 11px; min-width: 40px; }
  .variant-price { font-size: 13px; }
  .qty-trio { gap: 4px; }
  .qty-trio .qty-btn { width: 36px; height: 36px; min-width: 36px; flex: 0 0 36px; font-size: 16px; }
  .qty-trio .qty-input { width: 40px; min-height: 36px; font-size: 14px; }
}

/* Modal price-list mirror (uses same class names) */
.modal-price-list .qty-trio .qty-btn {
  width: 34px; height: 34px; min-width: 34px; flex: 0 0 34px; font-size: 16px;
}
.modal-price-list .qty-trio .qty-input {
  width: 50px; min-height: 34px; font-size: 14px;
}

/* Modal mirror compatibility — modal uses .price-row markup */
.modal-price-list .price-row,
.modal-price-list .price-row-qty {
  display: flex; align-items: center; gap: 8px;
}
.modal-price-list .price-row-label {
  font-size: 13px; color: var(--fg-muted); text-transform: lowercase;
  letter-spacing: .02em; flex: 0 0 auto; min-width: 60px;
}
.modal-price-list .price-row-price {
  color: var(--accent); font-weight: 600; font-size: 16px;
  flex: 1 1 auto; white-space: nowrap;
}
.modal-price-list .price-row-qty .qty-btn {
  width: 34px; height: 34px; min-width: 34px; flex: 0 0 34px; font-size: 16px;
}
.modal-price-list .price-row-qty .qty-input {
  width: 50px; min-height: 34px; font-size: 14px; text-align: center;
}

/* Variant suffix in order form / order detail */
.item-variant {
  color: var(--fg-muted);
  font-weight: 400;
  font-size: 12px;
}

/* Variant editor inside catalog/product_form.html */
.variants-wrap {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
}
.variants-wrap--v19 .variant-row {
  grid-template-columns: 1fr 100px 80px auto;
}
.variants-wrap--v19 .variant-row--header > span:nth-child(2),
.variants-wrap--v19 .variant-row--header > span:nth-child(3) {
  text-align: right;
  padding-right: 14px;
}
.variant-row {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 6px;
  align-items: center;
}
.variant-row--header {
  padding: 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.variant-row--header > span { padding: 0 2px; }
.variant-row input { margin: 0; }
.variant-row .variant-price,
.variant-row .variant-mult { text-align: right; }
@media (max-width: 480px) {
  .variant-row { grid-template-columns: 1fr 84px auto; gap: 4px; }
  .variants-wrap--v19 .variant-row {
    grid-template-columns: 1fr 70px 56px auto;
  }
  .variant-row--header { font-size: 10px; }
}

/* Modal specs (catalog product modal) */
.modal-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0 0 14px;
  font-size: 13px;
}
.modal-specs dt {
  color: var(--fg-muted);
  font-weight: 500;
}
.modal-specs dd {
  margin: 0;
  color: var(--fg);
}
.modal-price-list {
  display: flex; flex-direction: column; gap: 8px;
  margin: 10px 0 16px;
}
.modal-price-list .price-row-qty .qty-btn {
  width: 34px; height: 34px;
  min-width: 34px; flex: 0 0 34px;
  font-size: 16px;
}
.modal-price-list .price-row-qty .qty-input {
  width: 50px; min-height: 34px; font-size: 14px;
}
.modal-price-list .price-row-price { font-size: 16px; }

.cart-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--bg-float);
  border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 20;
}
.cart-bar[hidden] { display: none; }
.cart-bar-info { font-size: 14px; }
.cart-bar-info strong { color: var(--accent); }
@media (min-width: 720px) { .cart-bar { max-width: 720px; left: 50%; transform: translateX(-50%); right: auto; width: calc(100% - 24px); } }

/* Gestionare produse / categorii */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 12px; background: transparent; border: none;
  color: var(--fg-muted); font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tab.is-active { color: var(--fg); border-color: var(--accent); }
.tab-panel[hidden] { display: none; }

.thumb-sm {
  width: 44px; height: 44px; object-fit: cover; border-radius: 6px;
  background: var(--bg-float);
}

/* Status badges */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--status-nou) 18%, var(--bg-elev));
  color: var(--status-nou);
  border: 1px solid color-mix(in srgb, var(--status-nou) 35%, transparent);
}
.status--nou         { background: color-mix(in srgb, var(--status-nou) 18%, var(--bg-elev));     color: var(--status-nou);     border-color: color-mix(in srgb, var(--status-nou) 35%, transparent); }
.status--in_pregatire{ background: color-mix(in srgb, var(--status-prep) 18%, var(--bg-elev));    color: var(--status-prep);    border-color: color-mix(in srgb, var(--status-prep) 35%, transparent); }
.status--asteapta_livrare { background: color-mix(in srgb, var(--status-livrare) 18%, var(--bg-elev)); color: var(--status-livrare); border-color: color-mix(in srgb, var(--status-livrare) 35%, transparent); }
.status--finalizat   { background: color-mix(in srgb, var(--status-final) 18%, var(--bg-elev));   color: var(--status-final);   border-color: color-mix(in srgb, var(--status-final) 35%, transparent); }

.geocode-warning {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 18%, var(--bg-elev));
  color: var(--warning); font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
}

/* ============================================================
   Comenzi
   ============================================================ */
.filters {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; margin-bottom: 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
  max-width: 100%;
}
.filters .field { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.filters .field input,
.filters .field select { max-width: 100%; }
/* Perechea De la / Pana la — pe acelasi rand chiar si pe mobil.
   Folosim CSS Grid 1fr 1fr pentru ca flex cu min-width:0 nu forteaza
   <input type="date"> sub min-content-width pe iOS Safari/Brave. */
.date-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.date-pair > * {
  min-width: 0;
  overflow: hidden;
  margin: 0;
}
.date-pair input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Date input wrapper: input nativ + buton aurie (calendar icon) extern dreapta
   + placeholder overlay ("De la"/"Pana la") cand inputul e gol */
.date-input {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.date-input input[type=date] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  width: auto;
  padding-right: 12px;
}
.date-input__placeholder {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  pointer-events: none;
  font-size: 14px;
  z-index: 1;
}
.filter-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
}
.status-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.status-checks label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-float); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
}
.status-checks input { accent-color: var(--accent); }

.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 12px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--fg);
  transition: border-color .15s ease, transform .05s ease;
}
.order-row:hover { border-color: var(--border-strong); }
.order-row:active { transform: translateY(1px); }
.order-row__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-row__client { font-weight: 600; }
.order-row__meta { color: var(--fg-muted); font-size: 12px; }
.order-row__total { text-align: right; font-weight: 600; color: var(--accent); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px;
  animation: modal-fade .15s ease;
}
body.modal-open { overflow: hidden; }
body.modal-open .bottom-nav { display: none; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: var(--bg-elev); color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 80px);
  overflow: auto;
  box-shadow: var(--shadow-pop);
  position: relative;
  animation: modal-pop .2s ease;
}
@media (min-width: 640px) { .modal-dialog { border-radius: 14px; } }
@keyframes modal-pop { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(0,0,0,.3); border: none; color: white;
  font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 2;
  touch-action: manipulation;
}
.modal-close:hover { background: rgba(0,0,0,.5); }
.modal-image {
  width: 100%; max-height: 360px;
  background: var(--bg-float);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.modal-image[hidden] { display: none !important; }
@media (min-width: 640px) { .modal-image { border-radius: 14px 14px 0 0; } }
.modal-image img { width: 100%; height: 100%; object-fit: contain; max-height: 360px; }
.modal-image-placeholder { color: var(--fg-dim); padding: 60px 0; font-size: 14px; }
.modal-body { padding: 18px 18px 14px; }
.modal-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; line-height: 1.25; }
.modal-cat-row { margin-bottom: 10px; }
.modal-cat {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-float); color: var(--fg-muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.modal-desc { color: var(--fg-muted); line-height: 1.55; margin: 10px 0 14px; white-space: pre-wrap; }
.modal-price { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.modal-qty { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.modal-qty .qty-btn { width: 40px; height: 40px; font-size: 20px; flex: 0 0 40px; }
.modal-qty .qty-input { width: 60px; height: 40px; font-size: 16px; }
.modal-footer { padding: 12px 18px 18px; border-top: 1px solid var(--border); }
.modal-dialog--sm { max-width: 360px; }
.nav-picker-options { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.nav-picker-btn {
  justify-content: flex-start;
  font-size: 15px;
  padding: 12px 14px;
  background: var(--bg-float);
  border: 1.5px solid var(--border-strong);
}
.nav-picker-btn:hover { background: var(--bg-input); border-color: var(--accent); }
.nav-picker-icon { font-size: 20px; line-height: 1; margin-right: 6px; }

/* Client picker dropdown */
.client-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-float);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  max-height: 280px; overflow: auto;
  z-index: 10;
  box-shadow: var(--shadow-pop);
  margin-top: 4px;
}
.client-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  touch-action: manipulation;
}
.client-option:last-child { border-bottom: none; }
.client-option:hover,
.client-option.is-focused {
  background: var(--bg-input);
}
.client-option--empty {
  cursor: default; text-align: center; font-style: italic;
}
.client-option--empty:hover { background: var(--bg-float); }

/* ============================================================
   Map
   ============================================================ */
.map-page { display: flex; flex-direction: column; gap: 12px; }
#map { height: 60vh; min-height: 360px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }

/* ============================================================
   Mobile compact safeguards (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  /* Inputuri: reduc padding intern */
  input[type=date], input[type=text], input[type=tel],
  input[type=search], input[type=password], input[type=number],
  input[type=email], select {
    padding: 8px 10px;
    width: 100%;
    max-width: 100%;
  }
  input[type=date]::-webkit-calendar-picker-indicator { display: none; }

  /* Tabele compact pe mobil */
  .list-table { min-width: 100%; table-layout: auto; }
  .list-table th, .list-table td { padding: 8px 6px; font-size: 13px; }
  /* Doar pe tabelul de produse din Gestionare: ascunde Categorie + Pret */
  .list-table--manage th:nth-child(3), .list-table--manage td:nth-child(3),
  .list-table--manage th:nth-child(4), .list-table--manage td:nth-child(4) { display: none; }

  /* Actiuni in tabel: butoane icon-only — ascunde text "Editeaza"/"Sterge" */
  .actions-cell .btn .btn-label { display: none; }
  .actions-cell .btn {
    min-width: 32px; min-height: 32px;
    padding: 6px 8px; gap: 0;
  }
  .actions-cell .row-gap { gap: 4px; }

  /* Cart bar mai compact */
  .cart-bar { padding: 8px 10px; }
}

/* Butoane icon-only (ghost arrows etc.) — fara label, doar SVG */
.btn--icon {
  min-width: 32px; min-height: 32px;
  padding: 6px 8px;
}

/* ============================================================
   v21: Kebab (three-dot) action menu
   ============================================================ */
.kebab-wrap { position: relative; display: inline-block; }
.kebab-trigger {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1;
}
.kebab-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  min-width: 180px;
  z-index: 1100;
  box-shadow: var(--shadow-pop);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.kebab-menu[hidden] { display: none; }
.kebab-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.kebab-item:hover { background: var(--bg-float); color: var(--fg); }
.kebab-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ============================================================
   v22: Visits custom calendar
   ============================================================ */
.visits-app { max-width: 720px; margin: 0 auto; }
.visits-header {
  padding: 14px 14px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 52px; z-index: 5;
}
.visits-header-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.visits-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--accent);
}
.visits-h1 { font-size: 22px; font-weight: 700; margin: 2px 0 0; letter-spacing: -.4px; }
.visits-fab {
  width: 42px; height: 42px; border-radius: 12px; border: none;
  background: var(--accent); color: var(--accent-fg);
  font-size: 22px; font-weight: 600; cursor: pointer;
  display: grid; place-items: center;
}
[hidden] { display: none !important; }

.visits-segment {
  display: flex; gap: 6px; background: transparent;
  padding: 0; margin-bottom: 12px;
}
.visits-segment button {
  flex: 1; padding: 8px 0;
  border: 1px solid var(--border); background: transparent;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--fg-muted); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.visits-segment button:hover {
  background: var(--bg-input); color: var(--fg);
}
.visits-segment button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.visits-segment button.is-active {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.visits-segment button.is-active:hover {
  background: var(--accent); color: var(--accent-fg);
}
.visits-nav { display: flex; align-items: center; gap: 8px; }
.visits-nav button[data-nav] {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer;
  font-size: 18px; color: var(--fg);
}
.visits-nav [data-title] {
  flex: 1; padding: 8px 0; background: transparent; border: none;
  font-weight: 600; font-size: 15px; color: var(--fg); cursor: pointer;
}
.visits-main { padding: 14px 12px 80px; }

/* Month grid */
.vm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.vm-weekday {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--fg-dim); padding-bottom: 6px;
  text-transform: uppercase; letter-spacing: .5px;
}
.vm-cell {
  aspect-ratio: 1/1.05; border: 1px solid var(--border); background: var(--bg-elev);
  border-radius: 10px; padding: 5px; position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start;
}
.vm-cell.is-other-month { opacity: .35; }
.vm-cell.is-today {
  border-color: var(--accent); border-width: 2px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev));
}
.vm-cell-num { font-size: 13px; font-weight: 600; color: var(--fg); }
.vm-cell-count {
  position: absolute; top: 4px; right: 6px;
  font-size: 12px; font-weight: 700; color: var(--accent);
}

/* Week list */
.vw-day {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.vw-day.is-today { border-color: var(--accent); }
.vw-day-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.vw-day-label { font-size: 11px; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; }
.vw-day-num { font-size: 17px; font-weight: 700; margin-left: 8px; }
.vw-add {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px dashed var(--border-strong); background: transparent; cursor: pointer;
  color: var(--fg-muted); font-size: 16px; line-height: 1;
}
.vw-empty { font-size: 12px; color: var(--fg-dim); font-style: italic; }
.vw-visit {
  display: flex; align-items: center; gap: 8px; background: var(--bg-float);
  border-radius: 8px; padding: 7px 10px;
  border-left: 3px solid var(--accent); font-size: 13px;
  cursor: pointer; margin-top: 4px;
}
.vw-visit.is-done { text-decoration: line-through; opacity: .55; }
.vw-visit-body { flex: 1; min-width: 0; }
.vw-visit-name { display: block; font-weight: 600; color: var(--fg); }
.vw-visit-addr {
  display: block; font-size: 11px; color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.vw-done {
  display: inline-flex; align-items: center; cursor: pointer;
  padding: 2px; flex: 0 0 auto;
}
.vw-done input { width: 20px; height: 20px; cursor: pointer; margin: 0; accent-color: var(--accent); }

/* Day cards */
.vd-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; border-left: 4px solid var(--accent);
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  cursor: pointer;
}
.vd-card.is-done .vd-name { text-decoration: line-through; opacity: .6; }
.vd-done {
  display: inline-flex; align-items: center; justify-content: flex-end; cursor: pointer;
  padding: 4px;
}
.vd-done input { width: 20px; height: 20px; cursor: pointer; margin: 0; accent-color: var(--accent); }
.vd-arrows { display: flex; flex-direction: column; gap: 2px; }
.vd-arrows button {
  width: 26px; height: 22px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer;
  font-size: 10px; line-height: 1; color: var(--fg-muted);
}
.vd-arrows button:disabled { opacity: .3; cursor: default; }
.vd-name { font-size: 16px; font-weight: 600; color: var(--fg); }
.vd-addr {
  font-size: 12px; color: var(--fg-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vd-meta { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.vd-tag {
  display: inline-flex; gap: 4px; font-size: 11px; font-weight: 600;
  background: var(--bg-float); color: var(--fg-muted);
  padding: 2px 8px; border-radius: 999px; margin-top: 4px;
}
.vd-empty { text-align: center; padding: 60px 20px; color: var(--fg-dim); }

/* Bottom sheet for add/edit visit */
.visit-sheet {
  border: none; padding: 0; background: transparent;
  width: 100vw;
  height: 100vh; height: 100dvh;
  max-height: 100vh; max-height: 100dvh;
  max-width: none; margin: 0;
}
.visit-sheet::backdrop { background: rgba(0,0,0,.55); }
.visit-sheet-inner {
  width: 100%; max-width: 520px; margin: auto auto 0;
  background: var(--bg-elev); color: var(--fg);
  border-radius: 18px 18px 0 0;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; animation: vs-slide .25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes vs-slide { from { transform: translateY(100%); } to { transform: none; } }
.visit-sheet-handle {
  width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong);
  margin: 10px auto;
}
.visit-sheet-head {
  display: flex; justify-content: space-between; padding: 4px 18px 8px;
}
.visit-sheet-title { font-size: 18px; font-weight: 700; margin: 0; }
.visit-sheet-body { padding: 4px 18px; }
.visit-sheet-foot {
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}

.recur-chips, .end-chips, .scope-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.recur-chips button, .end-chips button, .scope-chips button {
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--fg-muted);
}
.recur-chips button.is-active,
.end-chips button.is-active,
.scope-chips button.is-active {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}

.weekday-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 8px;
}
.weekday-cell {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-elev); cursor: pointer;
  font-size: 13px; color: var(--fg);
}
.weekday-cell input {
  margin: 0; width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--accent);
}
.weekday-cell:hover { background: var(--bg-input); }

/* ============================================================
   v18: Toast notifications
   ============================================================ */
.toast-host {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2000;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--fg);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
  max-width: 90vw;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--danger { background: var(--danger); color: white; }

/* ============================================================
   v18: Cart-bar overlap fix — extra space when cart-bar visible
   ============================================================ */
body.has-cart-bar .main {
  padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
}
@media (max-width: 480px) {
  body.has-cart-bar .main {
    padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }
}

/* ============================================================
   v18: Pin popup "Marchează finalizat" button
   ============================================================ */
.pin-order__actions { margin-top: 6px; }
.pin-finalize-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  background: #16a34a; color: white !important;
  border: none; font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.pin-finalize-btn:hover:not(:disabled) { background: #15803d; }
.pin-finalize-btn:disabled { opacity: 0.5; cursor: default; }

.pin-visit-done-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px;
  background: #16a34a; color: white !important;
  border: none; font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.pin-visit-done-btn[data-done="1"] { background: #6b7280; }
.pin-visit-done-btn:hover:not(:disabled) { background: #15803d; }
.pin-visit-done-btn[data-done="1"]:hover:not(:disabled) { background: #4b5563; }
.pin-visit-done-btn:disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   v18: Import modal (<dialog>) styling
   ============================================================ */
.import-modal {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 18px;
  background: var(--bg-elev);
  color: var(--fg);
  max-width: 420px;
  width: calc(100vw - 24px);
  box-shadow: var(--shadow-pop);
}
.import-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* ============================================================
   Misc helpers
   ============================================================ */
.muted { color: var(--fg-muted); }
.tiny { font-size: 12px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.hide-mobile { }
@media (max-width: 600px) { .hide-mobile { display: none !important; } }

/* iOS focus-zoom guard: small quantity fields keep their compact box but use a
   >=16px font so tapping them does not auto-zoom the page. Placed last so it
   overrides the earlier compact overrides at equal specificity. */
.qty-input,
.list-table--items .qty-input,
.qty-trio .qty-input { font-size: 16px; }
