/* =========================================================
   Tindi — Design System (Glassmorphism, retinted)
   Vanilla CSS, no build step.
   ========================================================= */

/* ---------- Fonts (vendored locally, woff2, latin) ---------- */
/* Figtree — display / headings / wordmark / buttons (variable: 700–800) */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/figtree.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/figtree.woff2") format("woff2"); }
/* Inter — body + UI */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
/* JetBrains Mono — barcodes / technical codes */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/jetbrains-mono-700.woff2") format("woff2"); }

:root {
  /* Font stacks */
  --font-figtree: "Figtree";
  --font-inter: "Inter";
  --font-jetbrains-mono: "JetBrains Mono";
  --font-display: var(--font-figtree), "Inter", system-ui, sans-serif;
  --font-body: var(--font-inter), system-ui, sans-serif;
  --font-mono: var(--font-jetbrains-mono), ui-monospace, monospace;

  /* ----- Tindi brand palette (source of truth) ----- */
  --mandarina:      #FF5A36;   /* PRIMARY: buttons, accents, the spark, active states */
  --mandarina-deep: #E8431F;   /* hover / pressed for primary */
  --menta:          #12B886;   /* SUCCESS only: sale complete, positive states */
  --tindi-ink:      #17161E;   /* text + dark surfaces */
  --tindi-ink-soft: #6A6470;   /* muted / secondary text */
  --crema:          #FFF6F0;   /* warm app background (never cold #FFFFFF) */
  --niebla:         #EFE5DD;   /* borders, hairlines, soft surfaces */

  /* Brand / accent (names kept; mapped to Tindi so components inherit) */
  --brand-1: var(--mandarina);
  --brand-2: var(--mandarina-deep);
  --brand-3: var(--menta);

  /* Glass surfaces — translucent WHITE over warm crema (retinted, still frosted).
     The blur picks up the warm ambient glows behind, so glass reads as Tindi. */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-blur: 16px;
  --glass-shadow: 0 10px 34px rgba(23, 22, 30, 0.12);

  /* Text — ink on warm, light surfaces */
  --ink: #17161E;
  --ink-soft: #6A6470;
  --on-glass: #17161E;
  --on-glass-soft: #6A6470;

  /* Inputs */
  --input-bg: rgba(255, 255, 255, 0.92);

  --radius: 18px;
  --radius-sm: 12px;
  --gap: 18px;

  --ok: #12B886;
  --danger: #e11d48;

  color-scheme: light;
}

* { box-sizing: border-box; }

/* Inline stroke icons (referenced from the sprite via <use>). */
.icon {
  width: 1.05em; height: 1.05em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.15em;
}

/* The [hidden] attribute must always win, even over component display rules
   (e.g. .auth-gate{display:grid}). Without this, toggling el.hidden=true on a
   flex/grid element does nothing and overlays never disappear. */
[hidden] { display: none !important; }

/* overflow-x must be clamped on BOTH html and body — iOS Safari ignores it
   when set only on body, letting a wide child zoom the whole page out. */
html, body { height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--on-glass);
  /* warm crema canvas — never cold white */
  background: linear-gradient(135deg, #FFF1E8 0%, #FFF6F0 45%, #FFEDE2 100%);
  background-attachment: fixed;
  min-height: 100dvh;
}

/* ---------- Animated gradient blobs (warm ambient glows) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.22;
  animation: float 18s ease-in-out infinite alternate;
}
.blob--1 { background: var(--mandarina); top: -12%; left: -8%; }
.blob--2 { background: var(--mandarina-deep); bottom: -16%; right: -6%; animation-delay: -6s; }
.blob--3 { background: var(--menta); top: 30%; right: 25%; animation-delay: -11s; opacity: 0.14; }

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4%, 6%) scale(1.12); }
}

/* ---------- Glass primitive ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(135%);
  backdrop-filter: blur(var(--glass-blur)) saturate(135%);
}
/* Fallback when backdrop-filter is unsupported: use a more opaque bg
   so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.92); }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--gap);
  padding: 12px clamp(14px, 3vw, 28px);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: var(--gap);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { width: 38px; height: 38px; border-radius: 10px; display: block; flex: none; filter: drop-shadow(0 2px 6px rgba(232, 67, 31, 0.28)); }
.brand__logo--lg { width: 52px; height: 52px; border-radius: 14px; }
.brand__name { margin: 0; font-size: 1.3rem; letter-spacing: .2px; font-family: var(--font-display); font-weight: 800; }

.nav { display: flex; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.nav__btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--on-glass-soft);
  padding: 8px 16px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  transition: background .18s, color .18s, border-color .18s;
}
.nav__btn:hover { color: var(--on-glass); background: rgba(23, 22, 30, .06); }
.nav__btn.is-active {
  color: #fff; background: var(--mandarina); border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 90, 54, .32);
}

/* ---------- Layout ---------- */
.content { padding: 0 clamp(14px, 3vw, 28px) 40px; max-width: 1180px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; animation: rise .25s ease; }
/* Let cards / grid items shrink so the table scroll-areas contain themselves
   instead of forcing the page wider than the screen. */
.view, .grid, .grid > *, .card, .summary { min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 920px) {
  #view-venta .grid { grid-template-columns: 1fr 320px; }
  #view-ajustes .grid { grid-template-columns: 1.4fr 1fr; }
}

/* ---------- Cards ---------- */
.card { border-radius: var(--radius); padding: clamp(16px, 2.5vw, 24px); }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h2 { margin: 0; font-size: 1.15rem; }
.card__head > .search, .card__head > .btn, .card__head > .head-tools { margin-inline-start: auto; }
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
h1, h2, h3 { font-family: var(--font-display); }
h2 { font-weight: 700; }

.hint { color: var(--on-glass-soft); font-size: .88rem; margin: 6px 2px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700;
  font-family: var(--font-display);
  border-radius: var(--radius-sm); padding: 11px 18px; border: 1px solid transparent;
  transition: transform .12s ease, filter .18s ease, background .18s ease;
  color: #fff;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 3px solid var(--mandarina); outline-offset: 2px; }
.btn--primary { background: linear-gradient(135deg, var(--mandarina), var(--mandarina-deep)); box-shadow: 0 6px 18px rgba(255, 90, 54, .38); }
.btn--primary:hover { background: var(--mandarina-deep); filter: brightness(1.02); }
.btn--ghost { background: rgba(255, 255, 255, .6); border-color: var(--niebla); color: var(--ink); }
.btn--ghost:hover { background: #fff; border-color: var(--mandarina); color: var(--mandarina-deep); }
.btn--danger { background: rgba(225, 29, 72, .9); }
.btn--danger:hover { filter: brightness(1.06); }
.btn--block { width: 100%; }
.file-label { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.field > span { color: var(--on-glass); font-weight: 600; }
.field small { font-weight: 400; color: var(--on-glass-soft); }
.field--full { grid-column: 1 / -1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

input, select, .search {
  font: inherit; color: var(--ink); background: var(--input-bg);
  border: 1px solid var(--niebla); border-radius: 10px; padding: 10px 12px;
  width: 100%; transition: box-shadow .15s, border-color .15s;
}
input::placeholder { color: #a89fa0; }
input:focus, select:focus, .search:focus {
  outline: none; border-color: var(--mandarina);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, .25);
}
.search { max-width: 280px; }

/* ---------- Items table ---------- */
.table-wrap {
  min-width: 0; max-width: 100%;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}
.items { width: 100%; border-collapse: collapse; min-width: 600px; }
.items th, .items td { padding: 9px 8px; text-align: left; }
.items thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .6px;
  color: var(--on-glass-soft); border-bottom: 1px solid var(--niebla);
}
.items tbody tr { border-bottom: 1px solid rgba(23, 22, 30, .08); }
.items tbody tr:hover { background: rgba(23, 22, 30, .04); }
.items td input, .items td select { padding: 7px 8px; }
.items .col-id { width: 48px; color: var(--on-glass-soft); font-variant-numeric: tabular-nums; }
.items .col-qty { width: 72px; }
.items .col-unit { width: 100px; }
.items .col-val { width: 120px; }
.items .col-vat { width: 74px; }
.items .col-total { width: 120px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.items .col-act { width: 44px; text-align: center; }
td.col-total { text-align: right; }

.icon-btn {
  appearance: none; border: none; background: rgba(225, 29, 72, .12); color: var(--danger);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 1rem; line-height: 1;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(225, 29, 72, .22); color: #b3093a; }

/* ---------- Summary ---------- */
.summary { align-self: start; position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.summary h2 { margin: 0; }
.totals { margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.totals div { display: flex; justify-content: space-between; align-items: baseline; }
.totals dt { color: var(--on-glass-soft); margin: 0; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__grand { padding-top: 10px; border-top: 1px solid var(--niebla); }
.totals__grand dt { color: var(--ink); font-weight: 700; }
.totals__grand dd { font-size: 1.5rem; color: var(--ink); font-weight: 800; font-family: var(--font-display); }
.summary__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.summary__actions--stack { flex-direction: column; }

/* ---------- Overlay / receipt ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(23, 22, 30, 0.45); padding: 18px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
/* `display:grid` above would otherwise override the [hidden] attribute. */
.overlay[hidden] { display: none; }
.overlay__panel {
  border-radius: var(--radius); padding: 18px; width: min(800px, 100%);
  max-height: 92dvh; overflow: auto;
}
.overlay__actions { display: flex; gap: 10px; margin-top: 16px; }
.overlay__actions .btn { flex: 1; }

/* Document tabs (Recibo / Factura) */
.doctabs { display: flex; gap: 6px; margin-bottom: 14px; }
.doctab {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  color: var(--on-glass-soft); background: rgba(23, 22, 30, .05);
  border: 1px solid var(--niebla); border-radius: 999px; padding: 8px 20px;
}
.doctab.is-active { color: #fff; background: linear-gradient(135deg, var(--mandarina), var(--mandarina-deep)); border-color: transparent; }

.doc { background: #fff; color: var(--ink); border-radius: var(--radius-sm); }

/* Compact thermal receipt */
.doc.receipt {
  max-width: 340px; margin: 0 auto;
  padding: 20px; font-size: 13px; line-height: 1.5;
}
.receipt {
  background: #fff; color: var(--ink); border-radius: var(--radius-sm);
  padding: 20px; font-size: 13px; line-height: 1.5;
}
.receipt h3 { margin: 0 0 2px; text-align: center; font-size: 1.1rem; font-family: var(--font-display); font-weight: 800; }
.receipt .r-sub { text-align: center; color: #555; font-size: 12px; margin: 0; }
.receipt hr { border: none; border-top: 1px dashed #ccc; margin: 12px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt th, .receipt td { padding: 4px 2px; text-align: left; vertical-align: top; }
.receipt td.num, .receipt th.num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt .r-totals td { padding: 3px 2px; }
.receipt .r-grand td { font-weight: 700; font-size: 15px; border-top: 1px solid #333; padding-top: 6px; }
.receipt .r-foot { text-align: center; color: #555; margin-top: 12px; }
/* receipt / ticket footer brand mark */
.r-tindi { text-align: center; color: var(--mandarina); font-weight: 700; font-family: var(--font-display); margin-top: 10px; letter-spacing: .2px; }

/* Business logo in the receipt header (replaces the store-name-only header).
   Constrained so it never overflows a 58/80mm ticket or pushes the layout. */
.r-logo { text-align: center; margin: 0 0 8px; }
.r-logo img {
  display: block; margin: 0 auto;
  max-height: 120px; max-width: 100%; width: auto; height: auto;
  object-fit: contain;
}

/* ---------- Formal invoice (Factura) ---------- */
.doc.invoice { padding: 28px clamp(20px, 4vw, 40px); font-size: 13px; line-height: 1.55; }
.inv__head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.inv__biz { display: flex; gap: 12px; align-items: center; }
.inv__logo {
  width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden;
}
.inv__logo img { width: 100%; height: 100%; display: block; }
/* Uploaded business logo: don't force it into the 46px Tindi-mark box. */
.inv__logo--photo { width: auto; height: auto; border-radius: 0; overflow: visible; }
.inv__logo--photo img { width: auto; height: auto; max-height: 56px; max-width: 200px; object-fit: contain; }
.inv__biz h3 { margin: 0; font-size: 1.2rem; font-family: var(--font-display); font-weight: 800; }
.inv__biz p, .inv__meta p { margin: 1px 0; color: #555; font-size: 12px; }
.inv__meta { text-align: right; }
.inv__meta h4 { margin: 0 0 4px; font-size: 1rem; letter-spacing: 1px; font-family: var(--font-display); }
.inv__meta p { color: #333; }
.inv__cust {
  margin: 18px 0; padding: 12px 14px; background: var(--crema);
  border-radius: 10px; font-size: 12.5px;
}
.inv__items { width: 100%; border-collapse: collapse; margin-top: 4px; }
.inv__items th { background: var(--ink); color: #fff; padding: 8px; text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.inv__items td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.inv__items .num, .inv__totals .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv__totals { display: flex; justify-content: flex-end; margin-top: 14px; }
.inv__totals table { min-width: 240px; border-collapse: collapse; }
.inv__totals td { padding: 5px 8px; }
.inv__totals tr.g td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--mandarina); }
.inv__foot { margin-top: 22px; padding-top: 12px; border-top: 1px dashed #ccc; color: #666; text-align: center; }

/* ---------- Low stock ---------- */
tr.is-low td.col-qty input { border-color: #e11d48; box-shadow: 0 0 0 2px rgba(225,29,72,.25); }
.low-badge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  color: #fff; background: #e11d48; border-radius: 999px; padding: 1px 7px; vertical-align: middle;
}

/* ---------- Manual / free-item lines ---------- */
tr.is-manual { border-left: 3px solid rgba(18, 184, 134, 0.55); }
.manual-badge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700;
  color: #0b7a5b; background: rgba(18, 184, 134, .14); border: 1px solid rgba(18, 184, 134, .35);
  border-radius: 999px; padding: 1px 7px; vertical-align: middle;
}

/* ---------- Barcode column (products table) ---------- */
.items .col-barcode { width: 100px; }
.items .col-barcode input { font-family: var(--font-mono); font-size: .85rem; }

/* ---------- Scan flash feedback ---------- */
@keyframes scan-flash {
  0%   { box-shadow: var(--glass-shadow), 0 0 0 0 rgba(18, 184, 134, .7); }
  60%  { box-shadow: var(--glass-shadow), 0 0 0 10px rgba(18, 184, 134, 0); }
  100% { box-shadow: var(--glass-shadow); }
}
.scan-flash { animation: scan-flash 0.32s ease-out; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--glass-shadow); z-index: 80; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .12);
}
.toast.is-success { background: var(--menta); border-color: transparent; box-shadow: 0 8px 24px rgba(18, 184, 134, .4); }
.toast.is-error { background: rgba(180,20,60,.96); border-color: transparent; }

/* ---------- The Spark (success burst) ---------- */
.spark-burst {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  pointer-events: none;
}
.spark-burst svg {
  width: 128px; height: 128px; fill: var(--mandarina);
  filter: drop-shadow(0 10px 28px rgba(255, 90, 54, .45));
}

/* ---------- Figures / prices (Inter tabular, money stays aligned) ---------- */
.totals dd,
.totals__grand dd,
.items .col-total,
.items .col-id,
.report-card__total,
.inv__items .num,
.inv__totals .num,
.receipt td.num,
.receipt th.num { font-variant-numeric: tabular-nums; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pagination .btn { min-width: 100px; }
.pagination__info { color: var(--on-glass-soft); font-size: .88rem; white-space: nowrap; }

/* ---------- Tindi wordmark (lowercase, dotless final "i" with the spark) ---------- */
.wordmark {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -0.01em; line-height: 1;
  color: var(--ink);
  text-transform: lowercase;
}
.wordmark__i { position: relative; display: inline-block; }
.wordmark__spark {
  position: absolute; left: 50%; top: -0.42em;
  width: 0.42em; height: 0.42em;
  transform: translateX(-50%);
  fill: var(--mandarina);
}
.wordmark--on-dark { color: #fff; }
.wordmark--on-mandarina { color: #fff; }
.wordmark--on-mandarina .wordmark__spark { fill: #fff; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Print: only the receipt ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .bg, .topbar, .content, .no-print, #toast { display: none !important; }
  .overlay { position: static; background: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .overlay__panel { box-shadow: none; border: none; background: none; padding: 0; width: auto; max-height: none; overflow: visible; }
  .doc { border-radius: 0; }
  .doc.receipt { padding: 0; max-width: none; }
  .doc.invoice { padding: 0; }
  /* Thermal safety: cap the logo (~14mm) and render grayscale-friendly so it
     degrades cleanly on a monochrome 58/80mm printer and never bleeds. */
  .r-logo img, .inv__logo--photo img {
    max-height: 14mm; width: auto; height: auto;
    filter: grayscale(1) contrast(1.1);
    -webkit-filter: grayscale(1) contrast(1.1);
  }
}

/* ---------- Product image — confirm preview ---------- */
.img-confirm-panel { width: min(480px, 100%); text-align: center; }
.img-confirm__preview {
  display: block; max-width: 100%; max-height: 58dvh;
  border-radius: var(--radius-sm); margin: 0 auto;
  object-fit: contain;
}

/* ---------- Product image — lightbox ---------- */
.img-lightbox-panel {
  width: min(700px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  position: relative;
}
.img-lightbox__img {
  display: block; max-width: 100%; max-height: 70dvh;
  border-radius: var(--radius-sm); object-fit: contain;
}
.img-lightbox-close {
  position: absolute; top: 0; right: 0;
  background: rgba(23, 22, 30, .08); color: var(--ink);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.img-lightbox-close:hover { background: rgba(23, 22, 30, .16); color: var(--ink); }
.img-lightbox__actions { width: 100%; margin-top: 0; }

/* ---------- Ajustes · Factura / Recibo (business logo) ---------- */
.logo-settings { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.logo-settings__control { flex: 1 1 200px; min-width: 180px; }
.logo-settings__preview { flex: 1 1 260px; min-width: 240px; }
.logo-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: 14px; margin-bottom: 14px;
  background: rgba(23, 22, 30, .04); border: 1px dashed var(--niebla);
  border-radius: var(--radius-sm);
}
.logo-preview.has-logo { background: #fff; }
.logo-preview img { max-height: 120px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.logo-preview__ph {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--on-glass-soft); font-size: 13px;
}
.logo-preview__ph .icon { width: 28px; height: 28px; }
/* Live receipt preview reuses .doc.receipt; keep it self-contained in the card. */
.logo-receipt-preview { max-width: 320px; margin: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  .view.is-active { animation: none; }
  .btn:active { transform: none; }
  .scanner__reticle span { animation: none; }
  .scanner__flash.is-on { animation: none; }
}

/* =========================================================
   Camera scanner (shared) + bulk scan-to-stock
   ========================================================= */
/* Barcode field + inline "Escanear" button (add-product modal). */
.field-scan { display: flex; gap: 8px; align-items: stretch; }
.field-scan input { flex: 1; min-width: 0; }
.btn--scan { flex: none; white-space: nowrap; }

/* Scan button inside a product-table barcode cell. */
.items .col-barcode { width: 132px; }
.barcode-cell { display: flex; gap: 4px; align-items: center; }
.barcode-cell input { flex: 1; min-width: 0; }
.barcode-cell .p-scan { flex: none; }

/* The scanner sheet. Sits above other overlays (e.g. the bulk sheet it is
   launched from) so the live camera is never hidden behind them. */
.scanner-overlay { z-index: 70; }
.scanner-panel { width: min(460px, 100%); }
.scanner__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.scanner__title { margin: 0; font-size: 1.15rem; }
.scanner__close { flex: none; }

.scanner__stage {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62dvh;
  border-radius: var(--radius-sm); overflow: hidden; background: #17161E;
}
.scanner__video { width: 100%; height: 100%; object-fit: cover; display: block; background: #17161E; }

/* Framing reticle: a bright window with a sweeping scan line. */
.scanner__reticle {
  position: absolute; inset: 14% 10%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .85); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(23, 22, 30, .38);
}
.scanner__reticle span {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--mandarina), transparent);
  box-shadow: 0 0 12px var(--mandarina);
  animation: scan-sweep 2.1s ease-in-out infinite;
}
@keyframes scan-sweep { 0%,100% { top: 4%; } 50% { top: 96%; } }

/* Success flash over the feed. */
.scanner__flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: var(--menta); }
.scanner__flash.is-on { animation: scanner-flash 0.34s ease-out; }
@keyframes scanner-flash { 0% { opacity: .0; } 25% { opacity: .38; } 100% { opacity: 0; } }

/* The Tindi spark over the live feed. */
.scanner__spark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.scanner__spark svg { width: 84px; height: 84px; fill: var(--mandarina); filter: drop-shadow(0 6px 18px rgba(255, 90, 54, .5)); }

/* Torch toggle. */
.scanner__torch {
  position: absolute; right: 12px; bottom: 12px; z-index: 4;
  width: 44px; height: 44px; border-radius: 999px;
  background: rgba(23, 22, 30, .55); color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.scanner__torch.is-on { background: var(--mandarina); border-color: transparent; color: #fff; }

/* Running count (continuous mode). */
.scanner__count {
  position: absolute; left: 12px; bottom: 12px; z-index: 4;
  min-width: 34px; text-align: center; padding: 6px 12px; border-radius: 999px;
  background: rgba(23, 22, 30, .6); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255,255,255,.2);
}

.scanner__status { text-align: center; margin: 12px 0 0; font-weight: 600; color: var(--on-glass); }
.scanner__hint {
  margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 90, 54, .1); border: 1px solid rgba(255, 90, 54, .28);
  color: var(--on-glass); font-size: .9rem; line-height: 1.4;
}
.scanner__debug {
  margin: 6px 0 0; text-align: center; font-family: var(--font-mono);
  font-size: .72rem; color: var(--on-glass-soft); word-break: break-word;
}

/* Animated "rotate your phone / lay the code horizontal" cue over the feed. */
.scanner__rotate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px 20px; max-width: 80%; text-align: center;
  border-radius: var(--radius-sm); color: #fff;
  background: rgba(23, 22, 30, .6); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.scanner__rotate-phone {
  width: 48px; height: 48px; fill: none; stroke: var(--mandarina);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transform-origin: 50% 50%;
}
.scanner__rotate span { font-size: .84rem; font-weight: 600; line-height: 1.3; }
/* Static fallback when motion is reduced: just show it already landscape. */
@media (prefers-reduced-motion: reduce) {
  .scanner__rotate-phone { transform: rotate(-90deg); }
}

/* Bulk scan-to-stock sheet. */
.bulk-panel { width: min(560px, 100%); }
.bulk-list-wrap { max-height: 46dvh; overflow: auto; margin: 4px 0; }
.bulk-list { display: flex; flex-direction: column; gap: 8px; }
.bulk-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.55); border: 1px solid var(--niebla);
}
.bulk-row.is-new { border-color: rgba(255, 90, 54, .35); background: rgba(255, 90, 54, .06); }
.bulk-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bulk-row__name { font-weight: 700; }
.bulk-row__meta { font-size: .82rem; color: var(--on-glass-soft); }
.bulk-row__fields { display: flex; gap: 8px; }
.bulk-row__fields input { flex: 1; min-width: 0; }
.bulk-row__qty input { width: 64px; }
.bulk-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--menta); color: #fff; font-weight: 700; font-size: .78rem;
}
.bulk-badge--new { background: var(--mandarina); }
.bulk-del { flex: none; }
@media (max-width: 560px) {
  .bulk-row { flex-wrap: wrap; }
  .bulk-row__qty input { width: 100%; }
}

/* =========================================================
   Multi-tenant additions: topbar actions, auth gate,
   reports, seller accounts
   ========================================================= */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.topbar__actions { display: flex; gap: 10px; align-items: center; }
.user-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--glass-bg, rgba(255,255,255,.6)); border: 1px solid var(--glass-border, rgba(255,255,255,.65));
  font-size: 0.85rem; font-weight: 600; color: var(--on-glass, #17161E);
  max-width: 260px;
}
.user-badge__txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Auth gate ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 20px;
  background: rgba(23, 22, 30, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 400px; padding: 26px;
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 16px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.auth-brand .brand__name { font-family: var(--font-display); font-size: 1.5rem; color: var(--on-glass); margin: 0; }
.auth-panel { display: flex; flex-direction: column; gap: 12px; }
.auth-title { color: var(--on-glass); text-align: center; margin: 0 0 6px; font-family: var(--font-display); font-size: 1.3rem; }
.auth-switch { text-align: center; margin: 6px 0 0; color: var(--on-glass-soft); font-size: 0.9rem; }
.auth-switch a { color: var(--mandarina-deep); font-weight: 700; text-decoration: underline; cursor: pointer; }
.auth-error {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(225, 29, 72, 0.1); border: 1px solid rgba(225, 29, 72, 0.35);
  color: #b3093a; font-size: 0.9rem; text-align: center; line-height: 1.4;
}
/* Friendly notice variant (e.g. "check your email"), not an error. */
.auth-error.is-info {
  background: rgba(18, 184, 134, 0.12);
  border-color: rgba(18, 184, 134, 0.4);
  color: #0b7a5b;
}

/* ---------- Reports ---------- */
.report-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap); margin: 8px 0 20px;
}
.report-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
}
.report-card__label { color: var(--on-glass-soft); font-size: 0.85rem; }
.report-card__total { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--on-glass); }
.report-card__count { color: var(--on-glass-soft); font-size: 0.8rem; }
.report-subhead { color: var(--on-glass); font-family: var(--font-display); margin: 4px 0 10px; font-size: 1.05rem; }
.report-card__nudge {
  margin-top: 2px; font-size: .78rem; line-height: 1.35; color: var(--mandarina-deep);
  background: rgba(255, 90, 54, .08); border: 1px solid rgba(255, 90, 54, .25);
  border-radius: 8px; padding: 4px 8px;
}

/* Period selector (Hoy / Semana / Mes / Personalizado) — doctab-style pills. */
.report-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.period-btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600; font-size: .88rem;
  color: var(--on-glass-soft); background: rgba(23, 22, 30, .05);
  border: 1px solid var(--niebla); border-radius: 999px; padding: 7px 16px;
  transition: background .18s, color .18s;
}
.period-btn:hover { color: var(--on-glass); background: rgba(23, 22, 30, .09); }
.period-btn.is-active {
  color: #fff; background: linear-gradient(135deg, var(--mandarina), var(--mandarina-deep));
  border-color: transparent; box-shadow: 0 4px 12px rgba(255, 90, 54, .28);
}

/* Custom date range row */
.report-custom { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0 0 14px; }
.report-custom .field { flex: 0 1 180px; }

/* Insights strip — plain-language one-liners with the spark bullet. */
.insights { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.insight {
  font-size: .86rem; line-height: 1.45; color: var(--on-glass);
  background: rgba(255, 255, 255, .55); border: 1px solid var(--niebla);
  border-radius: 999px; padding: 6px 14px;
}
.insight strong { font-weight: 700; }

/* Two-column report blocks (top products · payment mix, etc.). */
.report-cols { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 920px) { .report-cols { grid-template-columns: 1fr 1fr; } }
.report-col { min-width: 0; }
.items--report { min-width: 0; }

/* Horizontal bar rows (payment mix, peak days/hours). Single-hue fills with
   direct value labels — the number never depends on the color alone. */
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row__label { flex: 0 0 92px; font-size: .84rem; color: var(--on-glass); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row__track { flex: 1; height: 12px; border-radius: 6px; background: rgba(23, 22, 30, .07); overflow: hidden; }
.bar-row__fill { display: block; height: 100%; border-radius: 6px; background: var(--mandarina-deep); }
.bar-row__value { flex: 0 0 auto; min-width: 56px; text-align: right; font-size: .84rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--on-glass); }

/* "Tendencias y comparación" — collapsed by default; lazy-loads on open. */
.report-trends { margin-top: var(--gap); padding: 0; overflow: hidden; }
.trends-toggle {
  appearance: none; cursor: pointer; font: inherit; border: none; background: transparent;
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: clamp(16px, 2.5vw, 24px);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--on-glass);
}
.trends-toggle:hover { background: rgba(23, 22, 30, .04); }
.trends-toggle:focus-visible { outline: 3px solid var(--mandarina); outline-offset: -3px; }
.trends-toggle__chev { width: 1.2em; height: 1.2em; color: var(--on-glass-soft); transition: transform .25s ease; }
.trends-toggle.is-open .trends-toggle__chev { transform: rotate(180deg); }
#trendsBody { padding: 0 clamp(16px, 2.5vw, 24px) clamp(16px, 2.5vw, 24px); }
.trends-loading { text-align: center; padding: 10px 0 16px; }

/* Comparison deltas: arrow + text always accompany the color. */
.kpi-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-delta--up { color: #0b7a5b; }
.kpi-delta--down { color: #b3093a; }
.kpi-delta--flat { color: var(--on-glass-soft); font-weight: 600; }

/* Trend chart (inline SVG, single series). */
.chart-wrap { margin: 4px 0 18px; }
.chart-wrap svg { width: 100%; max-width: 760px; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--mandarina-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--mandarina-deep); stroke: #fff; stroke-width: 2; }
.chart-grid { stroke: rgba(23, 22, 30, .1); stroke-width: 1; }
.chart-axis { fill: var(--on-glass-soft); font-size: 11px; font-family: var(--font-body); }
.chart-value { fill: var(--on-glass); font-size: 11.5px; font-weight: 700; font-family: var(--font-body); }
.hint-inline { color: var(--on-glass-soft); font-weight: 400; font-size: .78rem; }

@media (max-width: 560px) {
  .report-periods { width: 100%; }
  .period-btn { flex: 1 1 auto; text-align: center; padding: 7px 10px; }
  .bar-row__label { flex-basis: 72px; }
}

@media print { .auth-gate { display: none !important; } }

/* ============================================================
   Responsive — tablet & mobile
   Desktop is the baseline; these refine smaller screens while
   keeping the same glass / pill / spacing language.
   ============================================================ */

/* Tablet & below: keep brand + actions on the first row and turn the
   section nav into a full-width, horizontally scrollable pill bar. */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 10px clamp(12px, 3vw, 20px); }
  .brand { order: 1; }
  .topbar__actions { order: 2; margin-inline-start: auto; }
  .nav {
    order: 3; width: 100%; margin-inline-start: 0;
    flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav__btn { flex: 0 0 auto; white-space: nowrap; }
}

/* Once the venta/ajustes grids stack (below the 920px split), the summary
   scrolls with the page instead of sticking under a taller header. */
@media (max-width: 919px) {
  .summary { position: static; top: auto; }
}

/* Phone: tighten spacing; search & head tools span the full width. */
@media (max-width: 560px) {
  .brand__name { font-size: 1.15rem; }
  .brand__logo { width: 34px; height: 34px; }

  .auth-card { padding: 22px 18px; }

  .card__head { align-items: stretch; }
  .card__head > .search,
  .card__head > .btn,
  .card__head > .head-tools { margin-inline-start: 0; width: 100%; }
  .head-tools { width: 100%; justify-content: flex-start; }
  .head-tools .search { flex: 1 1 auto; }
  .search { max-width: none; }

  .summary__actions .btn { flex: 1 1 auto; }

  .overlay { padding: 10px; }
  .overlay__panel { padding: 14px; max-height: 94dvh; }
  .overlay__actions { flex-direction: column; }

  .totals__grand dd { font-size: 1.3rem; }
  .user-badge { max-width: 124px; }
}

/* ---------- Label print dialog (etiquetas de código de barras) ---------- */
.lp-panel { width: min(640px, 100%); }

.lp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 14px; }
@media (max-width: 560px) { .lp-presets { grid-template-columns: 1fr; } }
.lp-preset {
  appearance: none; cursor: pointer; font: inherit; text-align: left;
  background: rgba(255, 255, 255, .6); border: 1px solid var(--niebla);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.lp-preset:hover { background: #fff; border-color: var(--mandarina); }
.lp-preset.is-active { border-color: var(--mandarina); box-shadow: 0 0 0 2px rgba(255, 90, 54, .25); background: #fff; }
.lp-preset strong { display: block; font-size: .92rem; }
.lp-preset small { color: var(--on-glass-soft); }

.lp-checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.lp-checkbox input { width: auto; }

.lp-subhead { margin: 16px 0 6px; font-size: .95rem; }

.lp-profile-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lp-profile-select { flex: 1 1 200px; min-width: 0; }
.lp-profile-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lp-profile-tools .btn { padding: 8px 10px; font-size: .85rem; }

.lp-qty-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; padding-right: 2px; }
.lp-qty-row { display: flex; align-items: center; gap: 10px; }
.lp-qty-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.lp-qty-row > span small { color: var(--on-glass-soft); }
.lp-qty-row input { width: 82px; flex: none; }
.lp-offset { max-width: 280px; margin-top: 10px; }

.lp-preview {
  background: #fff; border: 1px solid var(--niebla); border-radius: var(--radius-sm);
  padding: 10px; overflow: auto;
}
/* Guides shown only on screen so the user sees where each sticker falls. */
#lpPreview .lp-page { box-shadow: 0 0 0 1px #e6e3e9; margin-bottom: 4px; }
#lpPreview .lp-cell { outline: 1px dashed #e8e4ea; outline-offset: -1px; }

.lp-direct { margin-top: 12px; flex-wrap: wrap; align-items: flex-start; }
.lp-direct small { flex-basis: 100%; color: var(--on-glass-soft); font-weight: 400; margin-left: 24px; }
.lp-tip { display: flex; align-items: baseline; gap: 6px; }
.lp-tip .icon { color: var(--mandarina); }

/* =========================================================
   Plan gating — upsell prompt + lock badges
   The upsell is a compact glass card in Tindi voice, shown by
   the plan gates instead of the locked feature. The badge is a
   small chip marking plan-locked entry points.
   ========================================================= */
.upsell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  margin: 8px 0 14px; padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-strong);
  border: 1px dashed rgba(255, 90, 54, .5);
}
.upsell__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: .78rem;
  color: var(--mandarina-deep); background: rgba(255, 90, 54, .12);
}
.upsell__msg { margin: 0; color: var(--on-glass); font-size: .95rem; max-width: 52ch; }
.upsell__msg strong { color: var(--mandarina-deep); }

.plan-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: .72rem;
  color: var(--mandarina-deep); background: rgba(255, 90, 54, .12);
}
.trends-toggle .plan-badge { margin-left: auto; }

/* =========================================================
   Primeros pasos — onboarding checklist (Venta view)
   Collapsible glass card, same language as the trends toggle.
   ========================================================= */
.onboarding { padding: 0; overflow: hidden; margin-bottom: var(--gap); }
.onb-toggle {
  appearance: none; cursor: pointer; font: inherit; border: none; background: transparent;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: clamp(14px, 2.2vw, 20px) clamp(16px, 2.5vw, 24px);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--on-glass);
  text-align: left;
}
.onb-toggle:hover { background: rgba(23, 22, 30, .04); }
.onb-toggle:focus-visible { outline: 3px solid var(--mandarina); outline-offset: -3px; }
.onb-spark { color: var(--mandarina); font-size: .9em; }
.onb-toggle__count {
  margin-left: auto; color: var(--on-glass-soft);
  font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.onb-toggle__chev { width: 1.2em; height: 1.2em; flex: none; color: var(--on-glass-soft); transition: transform .25s ease; }
.onboarding.is-collapsed .onb-toggle__chev { transform: rotate(-90deg); }
#onbBody { padding: 0 clamp(16px, 2.5vw, 24px) clamp(14px, 2.2vw, 20px); }

.onb-progress {
  height: 8px; border-radius: 4px; overflow: hidden;
  background: rgba(23, 22, 30, .07); margin-bottom: 14px;
}
.onb-progress__fill {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--mandarina), var(--mandarina-deep));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.onb-all-done { margin: 0 0 12px; font-weight: 600; color: var(--on-glass); }

.onb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.onb-list--locked { margin-top: 8px; }
.onb-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .55); border: 1px solid var(--niebla);
  transition: opacity .25s ease, background .25s ease;
}
.onb-step.is-done { opacity: .62; }
.onb-check {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  color: transparent; background: rgba(255, 255, 255, .7); border: 2px solid var(--niebla);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.onb-step.is-done .onb-check { background: var(--menta); border-color: var(--menta); color: #fff; }
.onb-step__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onb-step__txt strong { font-size: .95rem; color: var(--on-glass); }
.onb-step__txt small { color: var(--on-glass-soft); font-size: .8rem; line-height: 1.35; }
.onb-cta { flex: none; padding: 8px 14px; font-size: .85rem; }
.onb-done-tag {
  flex: none; font-family: var(--font-display); font-weight: 700; font-size: .78rem;
  color: var(--menta); padding: 3px 10px; border-radius: 999px;
  background: rgba(18, 184, 134, .12);
}

/* Locked "disponible en Pyme/Plus" teasers — quiet, dashed, non-blocking. */
.onb-step.is-locked {
  border-style: dashed; border-color: rgba(255, 90, 54, .4);
  background: rgba(255, 90, 54, .05);
}
.onb-step.is-locked .onb-check {
  border-color: rgba(255, 90, 54, .4); background: rgba(255, 90, 54, .1);
  color: var(--mandarina-deep); font-size: .9rem;
}
.onb-step.is-locked .onb-step__txt small strong { color: var(--mandarina-deep); }

.onb-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.onb-hide {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--on-glass-soft);
  padding: 4px 10px; border-radius: 8px;
}
.onb-hide:hover { color: var(--on-glass); background: rgba(23, 22, 30, .05); }
.onb-hide:focus-visible { outline: 3px solid var(--mandarina); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .onb-progress__fill, .onb-step, .onb-check, .onb-toggle__chev { transition: none; }
}

/* =========================================================
   IMPUESTOS — disclosure "IVA (avanzado)" (form de producto y
   editor por producto). Plegado por defecto: la mayoría nunca
   lo abre; el default del negocio hace el trabajo.
   ========================================================= */
.tax-adv summary {
  cursor: pointer; color: var(--on-glass-soft);
  font-size: .88rem; font-weight: 600; padding: 2px 0;
}
.tax-adv summary:hover { color: var(--on-glass); }
.tax-adv[open] summary { margin-bottom: 10px; }
.tax-adv > .form, .tax-adv > .field { margin-top: 4px; }
.tax-adv > .hint { margin-left: 0; }
