@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --cobalt: #141414;
  --cobalt-deep: #000000;
  --accent: #d71920;
  --accent-deep: #a80f16;
  --accent-bright: #ff4d52;
  --wall: #efefec;
  --paper: #ffffff;
  --ink: #141414;
  --muted: #5e5e5e;
  --line: #d9d9d4;
  --red: #b3201f;
  --green: #116a3c;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: Barlow, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--wall); color: var(--ink); font: 400 16px/1.45 var(--body); margin: 0; min-height: 100vh; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
a { color: var(--cobalt); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

input, select, button { font: inherit; }
input, select {
  background: var(--paper); border: 1px solid #9a9a95; border-radius: 4px; color: var(--ink);
  min-height: 44px; padding: 8px 10px; width: 100%;
}

.btn {
  background: var(--paper); border: 1px solid var(--cobalt); border-radius: 4px; color: var(--cobalt);
  cursor: pointer; display: inline-block; font-weight: 600; min-height: 44px; padding: 9px 16px; text-decoration: none;
}
.btn:hover { background: #fff6cc; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: #3a3a3a; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8e1716; }
.link-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; text-decoration: underline; }

.top { align-items: center; background: var(--cobalt); color: #fff; display: flex; gap: 24px; padding: 0 16px; }
.brand { color: #fff; font: 700 24px/1 var(--display); padding: 12px 0; text-decoration: none; white-space: nowrap; }
.top nav { display: flex; flex: 1; gap: 4px; min-width: 0; overflow-x: auto; }
.top nav a { border-bottom: 4px solid transparent; color: #fff; font-weight: 500; padding: 14px 10px 10px; text-decoration: none; white-space: nowrap; }
.top nav a:hover { border-bottom-color: #8a8a8a; }
.top nav a[aria-current] { border-bottom-color: var(--accent); }
.who { color: #fff; font-weight: 500; white-space: nowrap; }
.top :focus-visible { outline-color: #fff; }

.flash { border-left: 5px solid var(--green); background: #e3f3ea; margin: 12px 0; padding: 10px 14px; }
body > .flash { margin: 12px 16px 0; }
.flash-error { background: #fbe6e5; border-left-color: var(--red); }
.flash-warn { background: #fff4cf; border-left-color: #c98a00; }
.empty { color: var(--muted); padding: 24px 0; }

/* Caja */
.register { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - 52px); }
.shelf { display: flex; flex-direction: column; min-height: 0; padding: 16px; }
.scan input { border: 2px solid var(--cobalt); font-size: 22px; font-weight: 500; min-height: 58px; padding: 10px 14px; }
.notice { background: var(--ink); border-radius: 4px; color: #fff; margin: 10px 0 0; padding: 10px 14px; }
.notice a { color: var(--accent-bright); }
.tags { align-content: start; display: grid; flex: 1; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); margin-top: 14px; min-height: 0; overflow-y: auto; padding: 2px; }
.tag {
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); cursor: pointer;
  display: grid; gap: 2px 8px; grid-template-columns: 1fr auto; min-height: 104px; padding: 0; text-align: left;
}
.tag:hover { border-color: var(--cobalt); }
.tag:active { background: #fffbea; }
.tag-name { font-weight: 500; grid-column: 1 / -1; line-height: 1.25; padding: 10px 10px 4px; }
.tag-price { align-self: end; background: var(--accent); color: #fff; font: 700 22px/1 var(--display); justify-self: start; padding: 6px 10px; }
.tag-stock { align-self: end; color: var(--muted); font-size: 13px; padding: 0 10px 6px 0; text-align: right; }
.tag-stock.is-low { color: #8a5a00; font-weight: 600; }
.tag-stock.is-out { color: var(--red); font-weight: 600; }

.ticket { background: var(--cobalt-deep); display: flex; flex-direction: column; min-height: 0; padding: 14px 14px 0; }
.ticket-body {
  background: var(--paper); box-shadow: 0 2px 0 #00000030; display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 14px 16px 8px;
}
.ticket-head { align-items: baseline; border-bottom: 2px dashed var(--line); display: flex; justify-content: space-between; margin-bottom: 4px; padding-bottom: 8px; }
.ticket-head h1 { font-size: 24px; margin: 0; }
.ticket-head .link-btn { color: var(--red); }
.lines { flex: 1; list-style: none; margin: 0; min-height: 0; overflow-y: auto; padding: 0; }
.line { border-bottom: 1px dashed var(--line); display: grid; gap: 4px 12px; grid-template-columns: 1fr auto; padding: 8px 0; }
.line-name { font-weight: 500; line-height: 1.25; }
.line-total { font-family: var(--display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.line-qty { align-items: center; display: flex; gap: 4px; grid-column: 1 / -1; }
.line-each { color: var(--muted); font-size: 14px; margin-left: 6px; }
.step { background: var(--wall); border: 0; border-radius: 3px; color: var(--cobalt); cursor: pointer; font-size: 20px; font-weight: 600; height: 36px; line-height: 1; width: 36px; }
.step:hover { background: var(--line); }
.qty { min-height: 36px; padding: 4px; text-align: center; width: 64px; }
.ticket-empty { color: var(--muted); margin: 0; padding: 20px 0; }

.ticket-foot { color: #fff; padding: 12px 2px 14px; }
.sum { align-items: center; display: flex; font-variant-numeric: tabular-nums; justify-content: space-between; min-height: 34px; }
.sum input { background: #ffffff1a; border-color: #ffffff66; color: #fff; min-height: 34px; padding: 3px 8px; text-align: right; width: 120px; }
.sum input::placeholder { color: #a8a8a8; }
.ticket-foot :focus-visible { outline-color: #fff; }
.grand { align-items: baseline; margin: 2px 0 10px; }
.grand span { font: 600 26px/1 var(--display); }
.grand output { color: #fff; font: 700 52px/1.05 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-charge {
  background: var(--accent); border: 0; border-radius: 4px; color: #fff; cursor: pointer;
  font: 700 28px/1 var(--display); min-height: 64px; padding: 12px; width: 100%;
}
.btn-charge:hover:not(:disabled) { background: var(--accent-deep); }
.btn-charge:disabled { cursor: not-allowed; opacity: .45; }
.btn-charge kbd { border: 1px solid #ffffff99; border-radius: 3px; font: 600 15px/1 var(--body); margin-left: 8px; padding: 2px 5px; vertical-align: 3px; }

.pay { border: 0; border-radius: 6px; color: var(--ink); max-width: calc(100vw - 32px); padding: 22px; width: 460px; }
.pay::backdrop { background: #000000c0; }
.pay h2 { font-size: 26px; margin: 0; }
.pay-total { color: var(--cobalt); font: 700 56px/1.1 var(--display); font-variant-numeric: tabular-nums; margin: 0 0 12px; }
.methods { border: 0; display: flex; gap: 6px; margin: 0 0 14px; padding: 0; }
.methods legend { font-weight: 500; margin-bottom: 4px; padding: 0; }
.methods label { flex: 1; }
.methods input { height: 0; min-height: 0; opacity: 0; padding: 0; position: absolute; width: 0; }
.methods span { border: 1px solid var(--cobalt); border-radius: 4px; color: var(--cobalt); cursor: pointer; display: block; font-weight: 600; padding: 10px 2px; text-align: center; }
.methods input:checked + span { background: var(--cobalt); color: #fff; }
.methods input:focus-visible + span { outline: 3px solid var(--accent-deep); outline-offset: 2px; }
#cash > label { display: block; font-weight: 500; margin-bottom: 4px; }
#received { font: 600 26px/1 var(--display); min-height: 52px; text-align: right; }
.bills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bills button { background: var(--wall); border: 0; border-radius: 3px; color: var(--ink); cursor: pointer; flex: 1; font-weight: 500; min-height: 42px; padding: 6px 8px; white-space: nowrap; }
.bills button:hover { background: var(--line); }
.pay-change { align-items: baseline; display: flex; justify-content: space-between; margin: 14px 0 0; }
.pay-change strong { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.pay-change strong.is-short { color: var(--red); }
.pay-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.pay-actions .btn-primary { flex: 1; min-height: 52px; }
.done-label { font-weight: 500; margin: 16px 0 0; }
.done-change { color: var(--green); font: 700 72px/1.05 var(--display); font-variant-numeric: tabular-nums; margin: 0; overflow-wrap: anywhere; }
.printer { border: 0; height: 1px; left: -9999px; position: absolute; top: 0; width: 1px; }

/* Páginas */
.page { margin: 0 auto; max-width: 1100px; padding: 24px 16px 48px; }
.page-narrow { max-width: 760px; }
.page-split { display: grid; gap: 40px; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.page-head { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.crumb { margin: 0 0 6px; }
.filters { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input[type="search"] { flex: 1; min-width: 200px; width: auto; }
.filters select, .filters label input { width: auto; }
.filters label { display: grid; font-size: 14px; font-weight: 500; gap: 2px; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); overflow-x: auto; }
.data { border-collapse: collapse; width: 100%; }
.data th, .data td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.data .num { text-align: right; white-space: nowrap; }
.data thead th { background: var(--wall); color: var(--muted); font-size: 14px; font-weight: 600; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tfoot th, .data tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); }
.is-low { color: var(--red); font-weight: 600; }
.is-void td { color: var(--muted); text-decoration: line-through; }
.is-void td:nth-child(5) { text-decoration: none; }
.pager { align-items: center; display: flex; gap: 16px; justify-content: center; margin-top: 16px; }
.stack { display: grid; gap: 12px; margin-bottom: 24px; }
.stack label, .auth label { display: grid; font-weight: 500; gap: 3px; }
.stack label.check { align-items: center; display: flex; font-weight: 400; gap: 8px; }
.check input { height: 20px; min-height: 0; width: 20px; }
.stack p { margin: 0; }
.stack .btn { justify-self: start; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tag-role { font-size: 14px; font-weight: 600; }
.is-off { color: var(--muted); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone .link-btn { color: var(--red); }
.void-box { margin-top: 24px; }
.void-box summary { color: var(--red); cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.presets a { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); padding: 7px 12px; text-decoration: none; }
.presets a[aria-current] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.figures { background: var(--cobalt-deep); color: #fff; display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 10px; padding: 18px 8px; }
.figures div { padding: 0 14px; }
.figures dt { color: #d6d6d6; font-size: 15px; }
.figures dd { color: #fff; font: 700 34px/1.15 var(--display); font-variant-numeric: tabular-nums; margin: 0; overflow-wrap: anywhere; }
.report-note { color: var(--muted); margin: 0 0 22px; }
.report-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.report-grid section { min-width: 0; }
.report-grid section:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Entrada */
.centered { background: var(--cobalt); display: grid; min-height: 100vh; padding: 16px; place-items: center; }
.auth { background: var(--paper); border-top: 8px solid var(--accent); max-width: 400px; padding: 26px; width: 100%; }
.auth-wide { max-width: 520px; }
.auth form { display: grid; gap: 12px; }
.auth h2 { margin: 12px 0 0; }
.auth small { color: var(--muted); font-weight: 400; }

@media (max-width: 900px) {
  .register { display: block; height: auto; padding-bottom: 150px; }
  .tags { max-height: 44vh; }
  .ticket { padding: 0; }
  .ticket-body { min-height: 140px; }
  .ticket-foot { background: var(--cobalt-deep); bottom: 0; left: 0; padding: 8px 16px 12px; position: fixed; right: 0; z-index: 5; }
  .ticket-foot .sum:not(.grand) { display: none; }
  .grand { margin: 0 0 6px; }
  .grand output { font-size: 36px; }
  .btn-charge { font-size: 24px; min-height: 52px; }
  .btn-charge kbd { display: none; }
  .page-split, .report-grid { grid-template-columns: minmax(0, 1fr); }
  .figures { gap: 14px 1px; grid-template-columns: 1fr 1fr; }
  .top { flex-wrap: wrap; gap: 0 12px; }
  .top nav { flex-basis: 100%; order: 3; }
  .top form { margin-left: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .pay[open] { animation: rise .14s ease-out; }
  @keyframes rise { from { transform: translateY(8px); } }
}

/* Meny Cell */
.brand::before { background: var(--accent); content: ""; display: inline-block; height: 18px; margin-right: 8px; vertical-align: -2px; width: 6px; }
.figures dd a { color: inherit; text-decoration-color: var(--accent); }
.figures dt { color: #c9c9c9; }
.figures { border-top: 4px solid var(--accent); }
.figures-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.figures-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-wide { max-width: 1320px; }
.span-2 { grid-column: 1 / -1; }
.report-grid section:last-child:nth-child(odd) { grid-column: auto; }
.three { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hint { color: var(--muted); font-size: 14px; }
.warn-text { color: var(--red); font-weight: 600; }
.help { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--accent); padding: 16px 20px; }
.help ul { padding-left: 20px; }
.mono-list { background: var(--wall); font-size: 14px; font-weight: 600; padding: 8px 10px; }
.choice { border: 1px solid var(--line); background: var(--paper); display: grid; gap: 10px; padding: 14px 16px; }
.choice legend { font-weight: 600; padding: 0 4px; }
.choice > label { align-items: flex-start; display: flex; font-weight: 400; gap: 10px; }
.choice > label > input { height: 20px; margin-top: 2px; min-height: 0; width: 20px; }
.choice .three label { display: grid; font-weight: 500; gap: 3px; }
.import-confirm { margin-top: 16px; max-width: 760px; }
.ncf { border: 1px solid var(--line); background: var(--paper); margin: 0; padding: 12px 14px; }
.ncf legend { font-weight: 600; padding: 0 4px; }
.pay-box { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--accent); padding: 14px 16px; }
.pay-box h3 { font: 700 22px/1.1 var(--display); margin: 0; }
.btn-small { font-size: 14px; min-height: 34px; padding: 5px 10px; }
.data small { color: var(--muted); }
.is-void td.keep { text-decoration: none; }
.is-void td:nth-child(5) { text-decoration: none; }
.more { color: var(--muted); grid-column: 1 / -1; margin: 4px 0; }
.tag-meta { color: var(--muted); font-size: 13px; grid-column: 1 / -1; line-height: 1.2; margin-top: -4px; padding: 0 10px 4px; }
.tag-price { font-size: 20px; }

.ticket-head { align-items: stretch; flex-wrap: wrap; gap: 8px; }
.customer-btn { background: var(--wall); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer; display: grid; flex: 1; font: inherit; min-width: 0; padding: 6px 10px; text-align: left; }
.customer-btn:hover { border-color: var(--ink); }
.customer-label { color: var(--muted); font-size: 12px; font-weight: 600; }
#customer-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-extra { font-size: 13px; }
.level { display: grid; font-size: 12px; font-weight: 600; gap: 2px; color: var(--muted); }
.level select { min-height: 40px; padding: 4px 6px; width: 110px; }
.line-qty { flex-wrap: wrap; }
.price { min-height: 36px; padding: 4px 6px; text-align: right; width: 96px; }
.serial { font-size: 14px; grid-column: 1 / -1; min-height: 34px; padding: 4px 8px; }
.clear-btn { align-self: flex-start; color: var(--red); }
.tax-toggle { align-items: center; cursor: pointer; display: flex; gap: 8px; }
.tax-toggle input { accent-color: var(--accent); height: 18px; min-height: 0; width: 18px; }
.pay-customer { font-weight: 500; margin: -6px 0 12px; }
.pay .field { display: grid; font-weight: 500; gap: 4px; margin-bottom: 14px; }
.dialog-body { display: grid; gap: 12px; }
.dialog-body h2 { margin: 0; }
.results { display: grid; gap: 6px; list-style: none; margin: 0; max-height: 300px; overflow-y: auto; padding: 0; }
.result { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer; display: grid; font: inherit; gap: 2px; padding: 8px 10px; text-align: left; width: 100%; }
.result:hover { border-color: var(--ink); }
.result span { color: var(--muted); font-size: 14px; }
.result span.is-low { color: var(--red); }
#customer-new summary { color: var(--accent); cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.methods input:checked + span { background: var(--ink); border-color: var(--ink); }
.receipt-link { font-weight: 600; }

@media (max-width: 900px) {
  .three { grid-template-columns: 1fr; }
  .figures-2 { max-width: none; }
  .ticket-foot .sum:has(.tax-toggle) { display: flex; }
  .register { padding-bottom: 160px; }
}
.tag-price { font-size: 18px; white-space: nowrap; }
.tags { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }

.label-preview { background: var(--paper); border: 1px dashed #999; display: flex; flex-direction: column; font: 600 12px/1.15 Arial, sans-serif; height: 125px; justify-content: space-between; padding: 6px 10px 4px; text-align: center; width: 250px; }
.label-preview p { margin: 0; }
.label-preview .label-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.label-preview .label-price { font-size: 18px; font-weight: 700; }
.label-preview .label-bars { flex: 1; margin: 3px 0 2px; min-height: 34px; }
.label-preview svg { display: block; height: 100%; width: 100%; }
.label-preview .label-code { font-size: 10px; font-weight: 400; }

.stock-page .field { display: grid; font-weight: 500; gap: 4px; }
.move-form { margin-top: 4px; }
.chosen { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--accent); padding: 12px 16px; }
.chosen-name { font: 700 24px/1.15 var(--display); margin: 0; }
.chosen-meta { color: var(--muted); margin: 2px 0 8px; }
.chosen-facts { display: flex; gap: 28px; margin: 0 0 4px; }
.chosen-facts dt { color: var(--muted); font-size: 13px; }
.chosen-facts dd { font: 700 22px/1.1 var(--display); margin: 0; }
.calc { background: var(--ink); color: #fff; padding: 12px 16px; }
.calc:empty { display: none; }
.calc p { margin: 2px 0; }
.calc strong { color: #fff; font: 700 24px/1.2 var(--display); }
.calc span { color: #d6d6d6; }
.calc.is-low strong { color: var(--accent-bright); }

mark { background: #ffe1e2; color: inherit; font-weight: 700; padding: 0; }
.suggest-wrap { flex: 1; min-width: 200px; position: relative; }
.suggest-wrap input { width: 100%; }
.suggest { background: var(--paper); border: 1px solid var(--ink); border-top: 0; box-shadow: 0 8px 18px #0000002e; left: 0; list-style: none; margin: 0; max-height: 360px; overflow-y: auto; padding: 0; position: absolute; right: 0; top: 100%; z-index: 20; }
.suggest li { border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 1px; padding: 8px 12px; }
.suggest li:last-child { border-bottom: 0; }
.suggest li span { color: var(--muted); font-size: 14px; }
.suggest li:hover, .suggest li.is-active, .result.is-active { background: var(--wall); box-shadow: inset 4px 0 0 var(--accent); }
.filters .suggest-wrap + select, .filters .suggest-wrap + .btn { align-self: flex-start; }
.filters .suggest-wrap input[type="search"], .suggest-wrap input[type="search"] { width: 100%; }
.filters label .suggest-wrap { min-width: 280px; }

th.sortable a { color: inherit; display: inline-flex; gap: 4px; text-decoration: none; white-space: nowrap; }
th.sortable a:hover { color: var(--ink); text-decoration: underline; }
th.sortable .arrow { color: #a3a3a3; font-size: 11px; }
th.is-sorted { color: var(--ink); }
th.is-sorted .arrow { color: var(--accent); }
.stock-top { margin-bottom: 20px; max-width: 640px; }
.stock-recent { margin-top: 28px; }
.stock-table tbody tr { cursor: pointer; }
.stock-table tbody tr:hover, .stock-table tbody tr.is-active { background: var(--wall); box-shadow: inset 4px 0 0 var(--accent); }
.stock-table tbody tr.is-chosen { background: #ffe9ea; box-shadow: inset 4px 0 0 var(--accent); }
@media (max-width: 900px) { .stock-top { grid-template-columns: minmax(0, 1fr); } }

.done-ask { font: 700 26px/1.2 var(--display); margin: 18px 0 0; }
.btn-wide { flex: 1; font-size: 18px; min-height: 52px; }

/* Buscar, suspender, cotizar y devolver */
.tools { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tools .btn { min-height: 40px; padding: 6px 14px; }
.tools kbd { border: 1px solid currentColor; border-radius: 3px; font: 600 12px/1 var(--body); margin-left: 4px; opacity: .7; padding: 1px 4px; }
.loaded { background: var(--ink); border-radius: 3px; color: #fff; font-size: 14px; font-weight: 600; padding: 6px 10px; }
.find { width: 760px; }
.find-head { align-items: center; display: flex; justify-content: space-between; }
.find-tabs { margin: 0; }
.find-results { max-height: 52vh; }
.find-info h3 { font: 700 24px/1.1 var(--display); margin: 6px 0 4px; }
.find-info p { margin: 2px 0; }
.return-table .qty { width: 64px; }
.return-table td small { color: var(--muted); }
.return-total { background: var(--ink); color: #fff; font-weight: 600; margin: 0; padding: 10px 14px; }
.is-invalid { border-color: var(--red) !important; outline: 2px solid var(--red); }
.btn-link-danger { border-color: var(--red); color: var(--red); margin-right: auto; }
.note-pay { margin-bottom: 14px; }
.note-pay > label { display: block; font-weight: 500; margin-bottom: 4px; }
.note-row { display: flex; gap: 6px; }
.note-row input { text-transform: uppercase; }
.note-applied { font-size: 14px; margin: 6px 0 0; }
.sr-only { clip: rect(0 0 0 0); height: 1px; overflow: hidden; position: absolute; width: 1px; }
.pay { max-height: calc(100vh - 32px); overflow-y: auto; }

.find-filters { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.find-filters #find-q { flex: 1; min-width: 220px; }
.find-date { align-items: center; display: flex; font-weight: 500; gap: 6px; }
.find-date input { min-height: 44px; width: auto; }
.result .when { color: var(--ink); }
.result .when b { font-weight: 700; }

.ex-add { border-top: 2px dashed var(--line); margin-top: 14px; padding-top: 10px; }
.ex-add h3, .find-info h3 { font: 700 22px/1.1 var(--display); margin: 0 0 8px; }
.ex-search-wrap { position: relative; }
.ex-lines { margin-top: 6px; max-height: 220px; }
.ex-qty { display: inline-block; font-weight: 600; min-width: 28px; text-align: center; }
.ret-qty { align-items: center; display: inline-flex; gap: 4px; }
.ret-qty .qty { width: 54px; }
.ex-reason { display: grid; font-weight: 500; gap: 3px; margin-top: 12px; }
.ex-summary { background: var(--ink); color: #fff; margin-top: 12px; padding: 10px 14px; }
.ex-summary p { display: flex; justify-content: space-between; margin: 2px 0; }
.ex-summary .ex-net { border-top: 1px solid #ffffff40; font: 700 24px/1.3 var(--display); margin-top: 6px; padding-top: 6px; }
.done-extra { font-weight: 500; margin: 6px 0 0; }
.ret-bulk { display: flex; gap: 8px; justify-content: flex-end; margin: 0 0 8px; }
.ret-damaged { align-items: center; display: flex; font-size: 13px; gap: 4px; justify-content: flex-end; margin-top: 4px; white-space: nowrap; }
.ret-damaged input { height: 16px; width: 16px; }
/* Colores de la lista de Buscar: venta normal, transferencia y con devolución. */
.result.kind-normal { border-left: 6px solid #1f9d55; }
.result.kind-transferencia { border-left: 6px solid #1d6fd8; }
.result.kind-retorno { border-left: 6px solid #d7141a; }
.result.kind-normal strong { color: #157a41; }
.result.kind-transferencia strong { color: #1559b3; }
.result.kind-retorno strong { color: #b00f14; }
.find-legend { display: flex; flex-wrap: wrap; font-size: 13px; gap: 14px; margin: 0 0 6px; }
.find-legend span::before { border-radius: 2px; content: ''; display: inline-block; height: 10px; margin-right: 5px; width: 10px; }
.find-legend .l-normal::before { background: #1f9d55; }
.find-legend .l-transferencia::before { background: #1d6fd8; }
.find-legend .l-retorno::before { background: #d7141a; }
.data td.is-ok { color: #157a41; }
/* Caja: apertura y cuadre. */
.cash-lead { font-size: 18px; margin: 0 0 12px; }
.cash-big { font-family: var(--display, inherit); font-size: 44px; font-weight: 700; margin: 0 0 8px; }
.cash-open { max-width: 520px; }
.cash-form { max-width: 520px; }
.cash-or { color: var(--muted); margin: 4px 0 0; }
.btn-big { font-size: 18px; min-height: 52px; width: 100%; }
.cash-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cash-sheet { margin-bottom: 20px; }
.cash-sheet td { font-size: 16px; }
.cash-sheet .cash-total td { border-top: 2px solid var(--ink); font-size: 20px; font-weight: 700; }
.cash-diff { font-size: 18px; font-weight: 700; margin: 0; min-height: 1.4em; }
.cash-diff.is-ok { color: #157a41; }
.cash-diff.is-warn { color: #1559b3; }
.cash-diff.is-low { color: var(--red); }
.cash-deposit { align-items: baseline; background: var(--ink); color: #fff; display: flex; justify-content: space-between; padding: 14px 16px; }
.cash-deposit strong { font-size: 26px; }
.bills summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.bill-grid { display: grid; gap: 8px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.bill-grid label { align-items: center; display: grid; gap: 8px; grid-template-columns: 1fr 90px; }
.bill-grid span { font-size: 14px; }
.cash-history { margin-top: 36px; }
@media (max-width: 900px) { .cash-grid { grid-template-columns: minmax(0, 1fr); } }
/* Caja estilo DTSHOP */
.cash-figures { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 12px; }
.cash-figures div { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.cash-figures dt { color: var(--muted); font-size: 14px; }
.cash-figures dd { font-size: 22px; font-weight: 700; margin: 2px 0 0; }
.cash-figures small { color: var(--muted); font-size: 13px; }
.cash-figures .is-key { background: var(--ink); border-color: var(--ink); color: #fff; }
.cash-figures .is-key dt, .cash-figures .is-key small { color: #cfcfcf; }
.cash-box { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 18px; }
.cash-balance { display: grid; gap: 10px; max-width: none; }
.cash-row { align-items: center; display: grid; gap: 12px; grid-template-columns: 170px minmax(0, 1fr); }
.cash-row > span, .cash-row > label { font-weight: 600; }
.cash-row small { color: var(--muted); display: block; font-size: 12px; font-weight: 400; }
.cash-row output { font-size: 18px; font-weight: 700; text-align: right; }
.cash-row input { text-align: right; }
.cash-balance h3 { border-top: 1px solid var(--line); font-size: 18px; margin: 8px 0 0; padding-top: 10px; }
.cash-deposit.cash-row { padding: 12px 14px; }
.cash-gasto { align-items: end; display: grid; gap: 10px; grid-template-columns: 120px minmax(0, 1fr) auto; margin-bottom: 12px; }
.cash-gasto label { display: grid; font-weight: 600; gap: 4px; }
.cash-flow { margin-top: 28px; }
.cash-flow tr.is-out td { color: var(--red); }
@media (max-width: 900px) { .cash-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cash-gasto { grid-template-columns: minmax(0, 1fr); } .cash-row { grid-template-columns: 1fr; } }
.cuadre-figures { margin-bottom: 12px; }
/* Ventana de cuadre dentro de Facturación */
.cash-dialog { max-width: 1180px; width: calc(100vw - 32px); }
.cash-dialog .dialog-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 8px; }
.cash-dialog .dialog-head h2 { margin: 0; }
.cash-frame { border: 0; display: block; height: calc(100vh - 140px); width: 100%; }
body.bare { background: var(--paper); }
body.bare .page { padding-top: 8px; }
.open-dialog { max-width: 460px; }
.open-dialog .cash-big { margin: 4px 0 8px; }
.panel-actions .btn-big { align-items: center; display: inline-flex; justify-content: center; padding: 0 28px; width: auto; }
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 4px; }
.btn-danger-soft { border-color: var(--red); color: var(--red); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
/* Colores en la lista de Facturas */
.data tr.kind-normal td:first-child { box-shadow: inset 6px 0 0 #1f9d55; }
.data tr.kind-transferencia td:first-child { box-shadow: inset 6px 0 0 #1d6fd8; }
.data tr.kind-retorno td:first-child { box-shadow: inset 6px 0 0 #d7141a; }
.data tr.kind-normal td:first-child a { color: #157a41; font-weight: 700; }
.data tr.kind-transferencia td:first-child a { color: #1559b3; font-weight: 700; }
.data tr.kind-retorno td:first-child a { color: #b00f14; font-weight: 700; }
.data tr[class^="kind-"] td:first-child { padding-left: 18px; }
.tag-stock { padding-left: 6px; }
.tag-stock.has-qty { display: grid; line-height: 1.15; }
.tag-stock.has-qty small { font-size: 12px; }
.tag-stock.has-qty b { color: var(--ink); font-size: 17px; }
.tag-stock.has-qty.is-low b { color: #8a5a00; }
/* Facturación estilo DTSHOP: la factura es una tabla en el centro y los totales a la derecha */
.register { grid-template-columns: minmax(0, 1fr) 360px; }
.bill-top { align-items: stretch; display: flex; gap: 10px; margin-bottom: 10px; }
.bill-top .customer-btn { background: var(--paper); }
.scan { position: relative; }
.search-suggest { left: 0; max-height: 420px; overflow-y: auto; position: absolute; right: 0; top: 100%; z-index: 20; }
.search-suggest .sug-item { align-items: center; cursor: pointer; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 120px 120px; padding: 10px 14px; }
.search-suggest .sug-name small { color: var(--muted); }
.search-suggest .sug-stock { color: var(--muted); font-size: 14px; text-align: right; }
.search-suggest .sug-stock.is-out { color: var(--red); font-weight: 600; }
.search-suggest .sug-price { font-weight: 600; text-align: right; }
.search-suggest .sug-empty { color: var(--muted); padding: 10px 14px; }
.bill-wrap { background: var(--paper); border: 1px solid var(--line); flex: 1; margin-top: 10px; min-height: 0; overflow: auto; }
.bill-table { border-collapse: collapse; width: 100%; }
.bill-table thead th { background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 9px 10px; position: sticky; text-align: left; top: 0; z-index: 1; }
.bill-table th.num { text-align: right; }
.bill-table td { border-bottom: 1px solid #e6e6e1; padding: 7px 10px; vertical-align: middle; }
.bill-table tr.is-last td { background: #f1f1ee; }
.bill-table .c-code { color: var(--muted); font-size: 14px; white-space: nowrap; width: 120px; }
.bill-table .c-name { min-width: 160px; }
.bill-table .line-name { display: block; font-weight: 500; line-height: 1.25; }
.bill-table .c-qty { width: 128px; }
.bill-table .line-qty { align-items: center; display: flex; gap: 3px; }
.bill-table .step { font-size: 18px; height: 32px; width: 32px; }
.bill-table .qty { font-size: 17px; font-weight: 600; height: 32px; min-height: 0; padding: 0; text-align: center; width: 48px; }
.bill-table .c-price { width: 116px; }
.bill-table .price { min-height: 32px; padding: 3px 6px; text-align: right; width: 104px; }
.bill-table .c-total { font-weight: 600; white-space: nowrap; width: 110px; }
.bill-table .c-del { text-align: center; width: 40px; }
.line-del { background: none; border: 0; border-radius: 3px; color: var(--muted); cursor: pointer; font-size: 18px; height: 32px; width: 32px; }
.line-del:hover { background: var(--wall); color: var(--ink); }
.serial-toggle { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; padding: 0; text-decoration: underline; }
.serial-toggle.has-serial { color: #1d6fd8; text-decoration: none; }
.bill-table .serial { font-size: 14px; margin-top: 4px; min-height: 30px; padding: 3px 8px; width: 100%; }
.bill-wrap .ticket-empty { padding: 24px 14px; text-align: center; }
.ticket .ticket-body { gap: 6px; }
.sum-line { align-items: baseline; border-bottom: 1px solid var(--line); display: flex; font-size: 17px; justify-content: space-between; padding: 8px 2px; }
.sum-line b { font-size: 20px; }
@media (max-width: 1100px) { .register { grid-template-columns: minmax(0, 1fr) 300px; } .bill-table .c-code { display: none; } }
@media (max-width: 900px) { .search-suggest .sug-item { grid-template-columns: minmax(0, 1fr) auto; } .search-suggest .sug-stock { display: none; } .bill-wrap { max-height: none; } }
.ticket .ticket-body { flex: 0 0 auto; } .ticket .ticket-foot { margin-top: auto; }
.bill-table tr.line { border: 0; display: table-row; padding: 0; }
.bill-table .line-qty { flex-wrap: nowrap; grid-column: auto; }
.bill-table .line-total { font-family: inherit; font-size: 16px; }
.bill-table thead th.c-code { color: #fff; font-size: 14px; }
/* Más visibilidad en la tabla de la factura */
.bill-wrap { border: 2px solid var(--ink); }
.bill-table thead th { font-size: 15px; letter-spacing: .02em; padding: 11px 12px; }
.bill-table td { border-bottom: 1px solid #cfcfca; color: var(--ink); padding: 10px 12px; }
.bill-table tbody tr:nth-child(even) td { background: #f5f5f2; }
.bill-table tr.is-last td { background: #e6e6e1; }
.bill-table .c-code { color: #3d3d3d; font-size: 15px; }
.bill-table .line-name { font-size: 18px; font-weight: 600; }
.bill-table .qty { border: 2px solid var(--ink); font-size: 19px; font-weight: 700; height: 36px; width: 52px; }
.bill-table .step { background: #dcdcd7; color: var(--ink); font-size: 20px; height: 36px; width: 36px; }
.bill-table .price { border: 1px solid #8a8a85; color: var(--ink); font-size: 17px; min-height: 36px; }
.bill-table .line-total { font-size: 19px; font-weight: 700; }
.line-del { color: #3d3d3d; font-size: 20px; }
.serial-toggle { color: #3d3d3d; font-size: 14px; }
/* Filas alternadas: blanco y gris verdoso */
.bill-table tbody tr:nth-child(odd) td { background: #ffffff; }
.bill-table tbody tr:nth-child(even) td { background: #e3ece6; }
.bill-table tr.is-last td { background: #d2e0d6; }
.bill-table tbody tr.line.is-last td { background: #d2e0d6; }
/* Tabla: número de fila, columnas separadas, pie con la suma y el último agregado marcado sin romper el alternado */
.bill-table th, .bill-table td { border-right: 1px solid #d7ddd9; }
.bill-table th:last-child, .bill-table td:last-child { border-right: 0; }
.bill-table thead th { border-right-color: #3a3a3a; }
.bill-table .c-num { color: #5e5e5e; font-size: 14px; text-align: center; width: 44px; }
.bill-table thead th.c-num { color: #fff; }
.bill-table tbody tr.line.is-last td { background: inherit; }
.bill-table tbody tr.line:nth-child(odd).is-last td { background: #ffffff; }
.bill-table tbody tr.line:nth-child(even).is-last td { background: #e3ece6; }
.bill-table tbody tr.line.is-last td:first-child { box-shadow: inset 6px 0 0 #2f6b45; color: var(--ink); font-weight: 700; }
.bill-table .price { background: #fff; color: var(--ink); }
.bill-table tfoot td { background: var(--ink); border-right-color: #3a3a3a; color: #fff; font-size: 16px; font-weight: 600; padding: 10px 12px; position: sticky; bottom: 0; }
.bill-table tfoot #foot-total { font-size: 20px; font-weight: 700; }
.bill-table tfoot .c-qty { text-align: center; }
/* Ajustes de impresión */
.print-settings { grid-column: 1 / -1; }
.print-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); margin: 10px 0 14px; }
.print-card { background: var(--paper); border: 1px solid var(--line); margin: 0; padding: 14px 16px; }
.print-card > legend { font: 700 22px var(--display); padding: 0 4px; }
.print-cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 320px; }
.print-settings .checks { border: 0; margin: 0; padding: 0; }
.print-settings .checks legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.print-settings textarea { font: inherit; font-size: 14px; padding: 8px 10px; resize: vertical; width: 100%; }
.seg { border: 1px solid var(--ink); display: inline-flex; }
.seg label { cursor: pointer; margin: 0; }
.seg input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.seg span { border-right: 1px solid var(--ink); display: block; padding: 6px 14px; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview-title { font-weight: 600; margin: 0 0 4px; }
.print-preview { background: #e9e9e6; border: 1px dashed #999; display: block; width: 100%; }
.label-frame { height: 210px; }
.receipt-frame { height: 520px; }
.print-preview + .btn { margin-top: 8px; }
#label-custom input[readonly] { background: var(--wall); color: var(--muted); }
@media (max-width: 700px) { .print-grid { grid-template-columns: 1fr; } .print-cols { grid-template-columns: 1fr; } }
.mail-test { margin-top: 10px; }
