/* Identidad Lava Pro (basada en la marca Ascender, con el cobalto un poco más oscuro)
   Blanco #FFFFFF · Nube #F1F1EF · Carbón #0D0D0F · Grafito #5F5F66 · Cobalto #2430E0 */
:root {
  --bg: #f1f1ef;          /* Nube */
  --panel: #ffffff;       /* Blanco */
  --text: #0d0d0f;        /* Carbón */
  --muted: #5f5f66;       /* Grafito */
  --line: #e4e4e0;
  --line-2: #d2d2cc;
  --primary: #2430e0;     /* Cobalto (más oscuro que el #2D3CFF de Ascender) */
  --primary-600: #1a23b5;
  --primary-50: #ecedfd;
  --side: #0d0d0f;        /* Carbón */
  --side-2: #1c1c21;
  --danger: #d02f45;
  --danger-50: #fcebed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 13, 15, .05), 0 6px 18px rgba(13, 13, 15, .05);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-clave: "Archivo", "Inter Tight", system-ui, sans-serif;
  --font-voz: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-600); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.hidden { display: none !important; }
svg.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; padding: 0 8px; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 19px; letter-spacing: -.01em; }
.brand small { color: #9fc2c6; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #cfe3e5; font-weight: 500; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: #fff; color: var(--side); }
.nav a.nav-cta { background: var(--primary); color: #fff; margin-bottom: 10px; }
.nav a.nav-cta:hover, .nav a.nav-cta.on { background: #13a3a5; color: #fff; }
.topbar { display: none; }
.main { padding: 26px 30px 60px; min-width: 0; max-width: 1500px; }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #f5f7fa; border-color: #b9c4d2; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); }
.btn.danger { color: var(--danger); border-color: #f0c2c8; }
.btn.danger:hover { background: var(--danger-50); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef1f5; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.wa:hover { background: #188a46; }
.btn.sm { height: 31px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: #eef1f5; color: var(--text); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--text); font: 14px var(--font); }
textarea.input { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 139, 141, .15); }
.input.sm { height: 31px; font-size: 13px; padding: 0 8px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: #3c4758; }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- Encabezados y paneles ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- Badges y chips ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.blue { background: #e7effd; color: #2556b8; }
.badge.violet { background: #f0eafd; color: #6a3fc0; }
.badge.green { background: #e3f6ea; color: #17803d; }
.badge.amber { background: #fdf2dc; color: #a2610a; }
.badge.red { background: var(--danger-50); color: #b42335; }
.badge.gray { background: #edf0f4; color: #5b6576; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: #3c4758; font: 500 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip span { background: #eef1f5; border-radius: 99px; padding: 0 7px; font-size: 12px; line-height: 19px; }
.chip:hover { border-color: #b9c4d2; }
.chip.on { background: var(--side); border-color: var(--side); color: #fff; }
.chip.on span { background: rgba(255, 255, 255, .18); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; height: 36px; padding: 0 13px; font: 500 13px var(--font); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--primary-50); color: var(--primary-600); }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; height: 40px; font-size: 14px; border-left: 1px solid var(--line-2); }
.seg-full button:first-child { border-left: 0; }
.seg-full button.on { background: var(--primary); color: #fff; font-weight: 600; }
.pay-box .full { grid-column: 1 / -1; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-right { display: flex; gap: 8px; align-items: center; }
.toolbar-right .input { width: 270px; }

/* ---------- Tablero de órdenes ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: #e9edf2; border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; }
.col-head .count { color: var(--muted); font-weight: 600; }
.col-list { display: flex; flex-direction: column; gap: 8px; }
.card-o { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; transition: box-shadow .12s, border-color .12s; }
.card-o:hover { border-color: #b9c4d2; box-shadow: var(--shadow); }
.card-o .folio { font-variant-numeric: tabular-nums; }
.card-o .cliente { font-weight: 600; font-size: 15px; }
.card-o .meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.card-o .meta.late { color: var(--danger); font-weight: 600; }
.card-o .btn { align-self: flex-start; margin-top: 4px; }
.col-more { text-align: center; color: var(--muted); font-size: 12.5px; padding: 6px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8fafb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .sub { color: var(--muted); font-size: 12.5px; }
.tbl tfoot td { font-weight: 700; background: #fafbfc; }

/* ---------- Detalle de orden ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .total { font-size: 18px; font-weight: 700; color: var(--text); }
.kv .sep { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 4px 0; }
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; position: relative; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; font-size: 12px; color: #fff; }
.step.done .dot { background: var(--primary); border-color: var(--primary); }
.step.done::before { background: var(--primary); }
.step b { display: block; }
.step small { color: var(--muted); }
.big-folio { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.etapa-sel { width: auto; min-width: 120px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; align-items: start; }
.pos-catalog { padding: 16px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.pos-search { display: flex; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow-y: auto; padding: 2px; }
.tile { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 14px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 92px; font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s, transform .06s; }
.tile:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 139, 141, .12); }
.tile:active { transform: scale(.98); }
.tile-name { font-weight: 600; line-height: 1.25; }
.tile-price { margin-top: auto; color: var(--primary-600); font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-price small { color: var(--muted); font-weight: 500; }
.tile-cat { font-size: 11.5px; color: var(--muted); }
.tile-med { font-size: 12.5px; font-weight: 600; color: #3c4758; background: #eef1f5; border-radius: 6px; padding: 1px 7px; align-self: flex-start; }
.tile-stock { font-size: 11.5px; font-weight: 600; color: #17803d; }
.tile-stock.bajo { color: #b42335; }
.tile.agotado { opacity: .5; cursor: not-allowed; }
.tile.agotado:hover { border-color: var(--line); box-shadow: none; }
.pos-cart { display: flex; flex-direction: column; }
.cart-sec { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cart-sec:last-child { border-bottom: 0; }
.sec-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.cli-card { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; background: var(--primary-50); border-radius: 10px; padding: 11px 12px; }
.cli-card b { display: block; font-size: 15px; }
.cli-card small { color: #44606a; }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 32, 46, .15); z-index: 20; overflow: hidden; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac-item:hover, .ac-item.on { background: var(--primary-50); }
.ac-item small { color: var(--muted); }
.ac-new { color: var(--primary-600); font-weight: 600; border-top: 1px solid var(--line); }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.line-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.line-name { font-weight: 600; }
.line-sub { font-size: 12.5px; color: var(--muted); }
.line-imp { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.line-ctrl .input { width: 82px; }
.line-ctrl .unit { font-size: 12.5px; color: var(--muted); }
.line .notas { height: 32px; font-size: 13px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.stepper button { width: 31px; height: 31px; border: 0; background: #f5f7fa; cursor: pointer; font-size: 16px; color: var(--text); }
.stepper button:hover { background: #e9edf2; }
.stepper input { width: 46px !important; height: 31px; border: 0 !important; border-radius: 0 !important; text-align: center; padding: 0 !important; box-shadow: none !important; }
.cart-empty { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.totals .t { font-size: 22px; font-weight: 800; }
.totals .lbl-t { font-size: 16px; font-weight: 700; align-self: center; }
.pay-box { background: #f7f9fb; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cambio { grid-column: 1 / -1; font-weight: 600; color: var(--primary-600); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi div { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi.accent { background: var(--side); border-color: var(--side); color: #fff; }
.kpi.accent small { color: #9fc2c6; }

/* ---------- Modal y toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(14, 26, 36, .45); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); animation: pop .14s; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.modal-body { padding: 16px 18px 18px; }
.modal-big { text-align: center; padding: 6px 0 14px; }
.modal-big .folio-xl { font-size: 40px; font-weight: 800; color: var(--primary-600); letter-spacing: .02em; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--side); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-weight: 500; max-width: 360px; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- Catálogo ---------- */
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row span { flex: 1; font-weight: 500; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd3de; border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-50); color: var(--primary-600); border-radius: 99px; padding: 4px 6px 4px 11px; font-weight: 600; font-size: 13px; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; font-size: 13px; }

/* ---------- Buscador de clientes ---------- */
.buscador { padding: 14px; margin-bottom: 16px; }
.buscador .input { height: 48px; font-size: 16px; padding: 0 14px; }
.buscador-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.buscador-hint button { border: 0; background: #eef1f5; border-radius: 6px; padding: 2px 8px; font: inherit; color: var(--text); cursor: pointer; }
.buscador-hint button:hover { background: var(--primary-50); color: var(--primary-600); }
#cli-count { margin-left: auto; font-weight: 600; }
a.badge.violet:hover { background: #e4dafb; }

/* ---------- Productos / inventario / configuración ---------- */
.inv-box { background: #f7f9fb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.guia { background: #f7f9fb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.guia summary { cursor: pointer; font-weight: 600; color: var(--primary-600); }
.guia ol { margin: 10px 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Planes y soporte ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; max-width: 1240px; margin-bottom: 18px; }
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan.dest { border: 2px solid var(--primary); }
.plan-tag { position: absolute; top: -12px; left: 24px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan h2 { font-size: 19px; }
.price { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { color: var(--primary); margin-top: 1px; }
.soporte { display: flex; gap: 16px; align-items: flex-start; max-width: 860px; }
.soporte-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center; }
.soporte-ic svg { width: 24px; height: 24px; }

/* =====================================================================
   Identidad visual (estilo Ascender)
   ===================================================================== */
/* Palabra clave: Archivo ExtraBold, ancha, en mayúsculas */
.clave, h1, .wordmark { font-family: var(--font-clave); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: -.03em; }
h1 { font-size: 30px; line-height: 1; }
.wordmark { font-size: 20px; letter-spacing: -.02em; }
/* Palabra emocional: Instrument Serif cursiva */
.voz { font-family: var(--font-voz); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; font-stretch: normal; }
/* Etiqueta en corchete punteado */
.etiqueta { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; display: inline-block; padding: 5px 10px; border: 1.5px dashed currentColor; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-size: 13px; }
/* Retícula de puntos cada 36 px */
.reticula { background-image: radial-gradient(rgba(13, 13, 15, .07) 1.5px, transparent 1.5px); background-size: 36px 36px; }
.reticula-clara { background-image: radial-gradient(rgba(255, 255, 255, .1) 1.5px, transparent 1.5px); background-size: 36px 36px; }

body { background-color: var(--bg); background-image: radial-gradient(rgba(13, 13, 15, .055) 1.3px, transparent 1.3px); background-size: 36px 36px; }
.sec-title, .tbl th, .kpi small, .big-folio, .col-head, .label, .field > label { font-family: var(--font-mono); font-weight: 500; letter-spacing: .04em; }
.sec-title, .tbl th, .kpi small, .big-folio { text-transform: uppercase; font-size: 11.5px; }
.field > label { font-size: 11.5px; text-transform: uppercase; color: var(--muted); }
.col-head { text-transform: uppercase; font-size: 12px; }
.page-head p { font-size: 14.5px; }
.kpi div, .price, .modal-big .folio-xl, .totals .t { font-family: var(--font-clave); font-stretch: 112%; font-weight: 800; letter-spacing: -.02em; }
.kpi.accent { background: var(--primary); border-color: var(--primary); }
.kpi.accent small { color: rgba(255, 255, 255, .75); }
.card-o .folio, .folio { font-family: var(--font-mono); font-weight: 500; }
.btn { font-weight: 600; border-radius: 10px; }
.btn.primary { box-shadow: 0 6px 16px -8px rgba(36, 48, 224, .6); }
.badge.blue { background: var(--primary-50); color: var(--primary-600); }
.chip.on { background: var(--text); border-color: var(--text); }
.panel, .kpi, .plan { border-color: var(--line); }

/* Barra lateral carbón con acento cobalto */
.sidebar { background: var(--side); background-image: radial-gradient(rgba(255, 255, 255, .06) 1.3px, transparent 1.3px); background-size: 36px 36px; }
.brand small { color: #9a9aa3; }
.nav a { color: #c9c9cf; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: #fff; color: var(--text); }
.nav a.nav-cta { background: var(--primary); }
.nav a.nav-cta:hover, .nav a.nav-cta.on { background: #3540f0; color: #fff; }
.nav-sep { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6f6f78; padding: 16px 12px 6px; }
.side-user { margin-top: auto; border-top: 1px solid #26262c; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-user:empty { display: none; }
.side-user-info { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side-user-info b { display: block; color: #fff; font-size: 14px; }
.side-user-info small { color: #9a9aa3; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.side-user-acc { display: flex; gap: 6px; }
.side-user-acc button { flex: 1; background: var(--side-2); color: #c9c9cf; border: 1px solid #2c2c33; border-radius: 8px; padding: 7px 6px; font: 500 12.5px var(--font); cursor: pointer; }
.side-user-acc button:hover { color: #fff; border-color: #44444c; }
.topbar .wordmark { font-size: 17px; }

h1 .badge { font-family: var(--font); font-stretch: normal; text-transform: none; letter-spacing: 0; font-size: 12px; }
.cli-card small { color: var(--muted); }
.sidebar { overflow-y: auto; }

/* Lo que sólo ve el dueño / el administrador de Lava Pro */
.rol-empleado [data-rol="dueno"] { display: none !important; }
body:not(.es-admin) [data-rol="admin"] { display: none !important; }

/* Suscripción */
.susc-estado { max-width: 860px; margin-bottom: 16px; }
.aviso-prueba { max-width: 860px; margin-bottom: 14px; border: 1.5px dashed #a2610a; color: #a2610a; background: #fdf8ec; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.fid-check { max-width: 860px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.total-plan { margin: -8px 0 14px; }

/* Buscadores */
.pos-hint { font-size: 12.5px; color: var(--muted); min-height: 16px; margin-top: -6px; }
.tile.primero { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 48, 224, .15); }
.art-ac { min-width: 260px; }
.art-ac .ac-list { z-index: 30; }

/* Gastos por categoría */
.gcat-resumen { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.gcat { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; min-width: 120px; }
.gcat span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.gcat b { font-size: 16px; }
.gcat small { color: var(--muted); font-size: 12px; }
.gcat:hover { border-color: var(--primary); }
.gcat.on { border-color: var(--primary); background: var(--primary-50); }

/* Selector de local */
.sel-local { margin: -8px 4px 0; display: flex; flex-direction: column; gap: 4px; }
.sel-local[hidden] { display: none; }
.local-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6f6f78; padding-left: 4px; }
.sel-local select { background: var(--side-2); color: #fff; border-color: #2c2c33; height: 36px; font-weight: 600; }
.local-fijo { display: inline-flex; align-items: center; gap: 6px; color: #c9c9cf; font-weight: 600; padding: 6px 8px; background: var(--side-2); border-radius: 8px; }
.upsell { margin-bottom: 18px; padding: 28px; }

/* Fidelidad */
.barra-pts { height: 8px; border-radius: 99px; background: var(--primary-50); overflow: hidden; margin-top: 6px; }
.barra-pts span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.pts-box { margin-top: 10px; border: 1.5px dashed var(--primary); border-radius: 10px; padding: 10px 12px; background: #fff; }
.pts-box.listo { border-style: solid; background: #f3fbf5; border-color: #8fd3a4; }
.pts-box.listo .barra-pts span { background: #17803d; }
.pts-box.compacto { font-size: 13px; }
.fid-promo { max-width: 760px; padding: 34px; }
.fid-lista { margin: 14px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.movs-pts { margin-top: 12px; font-size: 13px; }
.movs-pts summary { cursor: pointer; color: var(--primary-600); font-weight: 600; margin-bottom: 8px; }
.movs-pts .row-between { padding: 6px 0; border-top: 1px solid var(--line); }
.plan-actual { border: 2px solid var(--primary); }

/* Pantalla de acceso (login y primer uso) */
body.sin-sesion .app { display: none; }
.auth { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; overflow: auto; }
.auth[hidden] { display: none; }
.auth-arte { background-color: var(--text); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 100vh; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo .wordmark { font-size: 24px; }
.auth-frase .etiqueta { color: #a6aaf7; margin-bottom: 22px; }
.auth-frase h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: .95; margin: 0 0 22px; }
.auth-frase h1 .voz { color: #7f87ff; font-size: 1.08em; }
.auth-frase p { color: #b4b4bb; font-size: 18px; max-width: 30em; margin: 0; }
.auth-pie { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #8a8a93; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-form .etiqueta { align-self: flex-start; color: var(--primary); }
.auth-form h2 { font-family: var(--font-clave); font-stretch: 112%; font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; font-size: 28px; margin: 0; }
.auth-form > p { margin: -6px 0 4px; }
.auth-form .input { height: 46px; font-size: 15px; }
.auth-ayuda { font-size: 13px; margin: 0; }
.auth-error { color: var(--danger); font-weight: 600; min-height: 20px; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 44px; }
.pass-wrap .icon-btn { position: absolute; right: 6px; top: 7px; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-arte { min-height: auto; padding: 28px 22px; gap: 22px; }
  .auth-frase h1 { font-size: 38px; }
  .auth-frase p, .auth-pie { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 380px; }
  .grid-side { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
  .topbar .brand { color: var(--text); padding: 0; }
  .main { padding: 18px 16px 50px; }
  .pos, .grid-side, .grid-2 { grid-template-columns: 1fr; }
  .pos-catalog { position: static; max-height: none; }
  .tiles { max-height: 420px; }
  .board { grid-template-columns: 1fr; }
  .toolbar-right { width: 100%; }
  .toolbar-right .input { width: auto; flex: 1; }
}
@media (max-width: 560px) {
  .form-grid, .btn-grid, .pay-box { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   Agenda de retiros y entregas
   ===================================================================== */
.rol-chofer #nav a:not([data-nav="agenda"]), .rol-chofer .nav-sep, .rol-chofer .topbar .btn.primary { display: none !important; }
.ag-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ag-titulo { font-size: 16px; margin-left: 8px; display: inline-block; }
.ag-titulo::first-letter { text-transform: uppercase; }
.ag-resumen { margin: 4px 0 14px; font-size: 13.5px; }
.ok-text { color: #17803d; font-weight: 600; }
.opcion { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* Calendario semanal */
.cal { overflow: hidden; }
.cal-fila { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.cal-gutter { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 6px 0 0; text-align: right; }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-dh { border: 0; background: transparent; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font: inherit; color: var(--muted); border-left: 1px solid var(--line); }
.cal-dh span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.cal-dh b { font-size: 20px; color: var(--text); font-family: var(--font-clave); font-stretch: 112%; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.cal-dh.hoy b { background: var(--primary); color: #fff; }
.cal-dh:hover { background: #f7f8fb; }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 34px; }
.cal-ad { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-height: 34px; }
.cal-ad .cal-ev { position: static; height: auto; }
.cal-scroll { max-height: 620px; overflow-y: auto; }
.cal-cuerpo .cal-gutter { padding: 0; }
.cal-hr { height: var(--alto); position: relative; top: -7px; padding-right: 6px; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.hoy { background: rgba(36, 48, 224, .025); }
.cal-slot { height: var(--alto); border-top: 1px solid var(--line); cursor: pointer; }
.cal-slot:hover { background: var(--primary-50); }
.rol-chofer .cal-slot:hover { background: transparent; cursor: default; }
.cal-ev { position: absolute; border-radius: 7px; padding: 3px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; color: #fff; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.cal-ev b { font-weight: 700; }
.cal-ev small { display: block; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.tipo-retiro { background: var(--primary); }
.cal-ev.tipo-entrega { background: #17803d; }
.cal-ev.est-hecho, .cal-ev.est-cancelada { opacity: .45; text-decoration: line-through; }
.cal-ev.est-no_estaba { background: var(--danger); }
.cal-ahora { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.cal-ahora::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* Lista del día (celular del chofer) */
.vis-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.vis-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); cursor: pointer; }
.vis-card.tipo-entrega { border-left-color: #17803d; }
.vis-card.est-hecho, .vis-card.est-cancelada { opacity: .6; }
.vis-card.en-modal { box-shadow: none; cursor: default; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; padding: 0 0 0 12px; }
.vis-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vis-hora { font-family: var(--font-clave); font-stretch: 112%; font-weight: 800; font-size: 18px; margin-right: 4px; }
.vis-chofer { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.vis-chofer svg { width: 14px; height: 14px; }
.vis-nombre { font-size: 17px; font-weight: 700; }
.vis-dato { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.vis-dato svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.vis-dato a { color: var(--text); font-weight: 600; }
.vis-orden { font-size: 13.5px; background: #f7f8fb; border-radius: 8px; padding: 6px 10px; }
.vis-acc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vis-hecho { font-size: 13px; align-self: center; }
@media (max-width: 560px) {
  .vis-lista { grid-template-columns: 1fr; }
  .vis-acc .btn { flex: 1 1 auto; height: 40px; }
  .cal-fila { grid-template-columns: 40px repeat(7, minmax(44px, 1fr)); }
  .cal { overflow-x: auto; }
}

/* ===== Precio libre, prueba gratis y panel de fidelidad ===== */
.precio-libre { font: 600 12px var(--font); color: var(--primary); background: rgba(36,48,224,.08); border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.input-monto { font-size: 22px; height: 52px; font-weight: 700; }
.aviso-trial { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #eef0ff; border: 1px solid #cdd1fb; color: #1b2190; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.aviso-trial > div { flex: 1; min-width: 220px; }
.aviso-trial .barra-pts { margin-top: 8px; max-width: 360px; }
.aviso-trial.fin { background: #fff1f1; border-color: #f3c4c4; color: #8a1c1c; }
.aviso-trial svg { width: 20px; height: 20px; flex: none; }
.trial-box { border-left: 4px solid var(--primary); margin-bottom: 16px; }
.trial-box.fin { border-left-color: #d64545; }
.kpi-sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.fid-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fid-panel .tbl td.click { cursor: pointer; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-2, #e3e6ea); border-radius: 12px; }
#f-fid .chips { margin-top: 8px; }
#f-fid .chip { height: 28px; font-size: 12px; }
.fid-preview { display: grid; gap: 6px; }
.wa-prev { background: #dcf8c6; color: #0b3b22; border-radius: 14px 14px 4px 14px; padding: 10px 12px; font-size: 14px; }
.fid-canjes a { padding: 10px 16px; border-top: 1px solid var(--line, #eceef1); color: inherit; text-decoration: none; gap: 12px; }
.fid-canjes a:hover { background: #fafafa; }
.fid-canjes small.muted:last-child { text-align: right; }
.cli-rapido .ac-list { position: static; margin-top: 6px; }

/* Productos: botón grande para agregar dentro de cada categoría */
.add-prod { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); margin: 14px 16px 16px; min-height: 52px; border: 1.5px dashed #b9bdf5; border-radius: 12px; background: #f5f6ff; color: var(--primary); font: 600 15px var(--font); cursor: pointer; transition: background .15s, border-color .15s; }
.add-prod:hover { background: #eceeff; border-color: var(--primary); }
.add-prod svg { width: 18px; height: 18px; }
.avanzadas summary { cursor: pointer; font-weight: 600; color: var(--muted); }

/* Aviso: lista de productos de ejemplo larga */
.aviso-simple { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-radius: 12px; background: #f5f6ff; border: 1px solid #c9ccf7; }
.aviso-simple span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Gráficos de barras */
.bh { display: grid; gap: 12px; }
.bh-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; align-items: center; gap: 12px; font-size: 14px; cursor: default; }
.bh-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-label small { display: block; color: var(--muted); font-size: 12px; }
.bh-track { height: 16px; display: flex; align-items: center; }
.bh-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--primary); }
.bh-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bh-row:hover .bh-bar { filter: brightness(1.12); }
.caja-resumen { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.caja-resumen > div { display: flex; align-items: center; gap: 8px; }
.caja-resumen b { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; }
.caja-resumen .queda { margin-left: auto; }
.caja-resumen .queda b { font-size: 22px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cv-wrap { position: relative; padding-top: 18px; }
.cv-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv { display: flex; align-items: flex-end; gap: 4px; height: 190px; border-top: 1px dashed var(--line); border-bottom: 1px solid #cfcfca; padding-bottom: 0; margin-bottom: 26px; }
.cv-g { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 4px; }
.cv-g:hover { background: #f4f4f1; }
.cv-b { flex: 0 1 18px; min-width: 2px; border-radius: 4px 4px 0 0; }
.cv-x { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-tip { position: fixed; z-index: 1000; display: none; pointer-events: none; background: var(--text); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 8px; max-width: 280px; box-shadow: var(--shadow); }
.art-total { margin: 14px 18px 12px; font-size: 15px; }
#art-body .bh { padding: 0 18px 6px; }
.ver-tabla { margin: 10px 18px 16px; }
.ver-tabla summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
@media (max-width: 640px) {
  .bh-row { grid-template-columns: 1fr auto; grid-template-areas: "l v" "b b"; gap: 4px 10px; }
  .bh-label { grid-area: l; } .bh-val { grid-area: v; } .bh-track { grid-area: b; height: 12px; }
  .caja-resumen .queda { margin-left: 0; width: 100%; }
  .cv { gap: 2px; height: 160px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpis.tres { grid-template-columns: repeat(3, 1fr); }
  .kpi { padding: 11px 12px; }
  .kpi small { font-size: 10px; }
  .kpi div { font-size: 19px; }
  /* Inventario en tarjetas: nombre y cantidad arriba, botones abajo */
  .inv-tbl thead { display: none; }
  .inv-tbl, .inv-tbl tbody { display: block; }
  .inv-tbl tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .inv-tbl td { display: block; padding: 0; border: 0; }
  .inv-tbl td:nth-child(3) { display: none; }
  .inv-tbl td:nth-child(5) { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
  .inv-tbl td:nth-child(5) .icon-btn:first-of-type { margin-left: auto; }
}

/* Botón Nueva orden: el principal, grande y fácil de encontrar */
.nav a.nav-cta { min-height: 54px; font-size: 16.5px; font-weight: 700; justify-content: flex-start; border-radius: 12px; box-shadow: 0 6px 16px rgba(36, 48, 224, .28); }
.nav a.nav-cta svg { width: 22px; height: 22px; }
.btn-nueva { min-height: 50px; padding: 0 24px; font-size: 16.5px; font-weight: 700; box-shadow: 0 6px 16px rgba(36, 48, 224, .25); }
.btn-nueva svg { width: 20px; height: 20px; }
.topbar .top-nueva { min-height: 44px; padding: 0 16px; font-size: 15.5px; font-weight: 700; border-radius: 12px; box-shadow: 0 4px 12px rgba(36, 48, 224, .3); }
.opcional { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }

/* Barra de la orden en el celular (como un carrito de compras) */
.pos-barra { display: none; }
@media (max-width: 920px) {
  .pos-barra { display: block; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(13, 13, 15, .22); padding: 8px; transition: transform .2s, opacity .2s; }
  .pos-barra.fuera { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .pos-barra.pulso { animation: pb-pulso .45s; }
  @keyframes pb-pulso { 40% { transform: scale(1.025); box-shadow: 0 10px 30px rgba(36, 48, 224, .4); } }
  .main:has(.pos-barra) { padding-bottom: 90px; }
  .pb-vacio { text-align: center; color: var(--muted); font-size: 14px; padding: 10px; }
  .pb-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; background: none; border: 0; font: 600 15px var(--font); color: var(--text); cursor: pointer; }
  .pb-head b { margin-left: auto; font-size: 18px; font-variant-numeric: tabular-nums; }
  .pb-n { background: var(--primary); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: 13px; }
  .pb-flecha { color: var(--muted); font-size: 14px; }
  .pb-lista { max-height: 30vh; overflow-y: auto; border-top: 1px solid var(--line); margin: 4px 0 8px; }
  .pb-item { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .pb-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pb-nom small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .pb-step { display: inline-flex; align-items: center; gap: 6px; }
  .pb-step button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #f6f6f4; font-size: 17px; line-height: 1; cursor: pointer; }
  .pb-step b { min-width: 18px; text-align: center; }
  .pb-cant { color: var(--muted); white-space: nowrap; }
  .pb-imp { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pb-del { border: 0; background: none; color: var(--muted); font-size: 15px; padding: 4px; cursor: pointer; }
  .pb-seguir { min-height: 46px; font-size: 15.5px; }
}

/* Botones principales de la orden */
.acciones-orden { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 18px; }
.acc { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--text); font: 700 15px var(--font); text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, background .12s; }
.acc svg { width: 22px; height: 22px; flex: none; }
.acc:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(13, 13, 15, .1); }
.acc-estado { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(36, 48, 224, .3); }
.acc-estado:hover { background: #3540f0; }
.acc-wa { background: #1fa855; border-color: #1fa855; color: #fff; box-shadow: 0 8px 20px rgba(31, 168, 85, .25); }
.acc-wa:hover { background: #18934a; }
@media (max-width: 640px) {
  .acciones-orden { grid-template-columns: 1fr 1fr; gap: 8px; }
  .acc { min-height: 64px; font-size: 14px; padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .acc-estado { grid-column: 1 / -1; flex-direction: row; align-items: center; font-size: 16px; justify-content: center; }
}

/* Configuración del ticket con vista previa */
.ticket-cfg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.ticket-prev { position: sticky; top: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.papel-wrap { background: repeating-linear-gradient(45deg, #ebebe7, #ebebe7 6px, #f3f3f0 6px, #f3f3f0 12px); padding: 14px; border-radius: 12px; max-height: 70vh; overflow: auto; }
#prev-frame { display: block; border: 0; background: #fff; box-shadow: 0 6px 18px rgba(13, 13, 15, .18); min-height: 200px; }
.logo-box { display: flex; align-items: center; gap: 14px; }
.logo-thumb { width: 140px; height: 70px; border: 1.5px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; font-size: 13px; }
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rango { width: 100%; accent-color: var(--primary); }
@media (max-width: 900px) { .ticket-cfg { grid-template-columns: 1fr; } .ticket-prev { position: static; } }

/* Agenda: pegar mensaje de WhatsApp */
.pegar-wa { background: #effaf3; border: 1px solid #bfe8cf; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.pegar-wa label { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pegar-wa svg { width: 18px; height: 18px; color: #1fa855; }

/* Dibujos minimalistas */
.dib { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #eef0ff; color: var(--primary); flex: none; }
.dib svg { width: 24px; height: 24px; }
.dib.sm { width: 32px; height: 32px; border-radius: 10px; } .dib.sm svg { width: 20px; height: 20px; }
.dib.xs { width: 22px; height: 22px; border-radius: 7px; margin-right: 6px; vertical-align: middle; } .dib.xs svg { width: 15px; height: 15px; }
.dib.pago { width: 22px; height: 22px; border-radius: 6px; background: transparent; color: inherit; } .dib.pago svg { width: 19px; height: 19px; }
.con-dib { display: flex; align-items: center; gap: 10px; }
.tile .tile-dib { margin-bottom: 2px; }
.tile:hover .dib { background: #e2e5ff; }
.seg-dib button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.metodo-dib { display: inline-flex; align-items: center; gap: 4px; }
.bh-label.con-dib { gap: 8px; } .bh-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dib-btn { position: relative; border: 1.5px dashed #b9bdf5; background: #fff; border-radius: 14px; padding: 3px; cursor: pointer; flex: none; }
.dib-btn i { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font: normal 11px/20px var(--font); text-align: center; }
.dib-btn.sm { padding: 1px; border-radius: 12px; border-style: solid; border-color: transparent; } .dib-btn.sm:hover { border-color: #b9bdf5; }
.cat-row .dib-btn.sm .dib { width: 34px; height: 34px; }
.dib-capa { position: fixed; inset: 0; z-index: 2000; background: rgba(13, 13, 15, .45); display: grid; place-items: center; padding: 14px; }
.dib-caja { background: #fff; border-radius: 18px; padding: 18px; width: min(680px, 100%); max-height: 86vh; overflow-y: auto; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); }
.dib-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.dib-grupo { grid-column: 1 / -1; font: 500 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 8px; }
.dib-op { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.dib-op small { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.dib-op:hover { border-color: #b9bdf5; } .dib-op.on { border-color: var(--primary); background: #f5f6ff; }
.dib-op.on small { color: var(--primary); font-weight: 600; }
.gcat .con-dib { gap: 0; }

/* Caja: resumen grande */
.caja-hero { background: var(--text); color: #fff; border-radius: 20px; padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.ch-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.ch-per { font: 700 15px var(--font); }
.ch-fechas { font-size: 13px; color: #b4b4bb; }
.ch-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ch-n { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.ch-n small { display: flex; align-items: center; gap: 6px; color: #c9c9cf; font-size: 13.5px; font-weight: 600; }
.ch-n b { display: block; font: 800 clamp(22px, 3vw, 32px)/1.15 var(--font-clave); font-stretch: 112%; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ch-bal { background: var(--primary); border-color: var(--primary); }
.ch-bal small { color: #dfe1ff; }
.ch-bal.neg { background: #8f1d2c; border-color: #8f1d2c; }
.ch-extra { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 13.5px; color: #b4b4bb; }
.ch-extra b { color: #fff; margin-left: 4px; font-variant-numeric: tabular-nums; }
.caja-leyenda { display: flex; gap: 18px; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.caja-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cv-g.hoy { background: #f3f4ff; }
.cv-g.hoy .cv-x { color: var(--primary); font-weight: 700; }
/* Caja: hoy */
.hoy-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hoy-nums > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.hoy-nums small { color: var(--muted); font-size: 13px; font-weight: 600; }
.hoy-nums b { display: block; font-size: 21px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hoy-nums .neg b { color: var(--danger); }
.hoy-cuentas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.hoy-cuentas > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: #f7f7f5; border-radius: 12px; padding: 10px 12px; }
.hoy-cuentas .dib { grid-row: 1 / 3; }
.hoy-cuentas b { font-size: 20px; line-height: 1.1; }
.hoy-cuentas span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .caja-hero { padding: 16px; border-radius: 18px; }
  .ch-nums { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ch-bal { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .ch-bal b { margin-top: 0; }
  .ch-n { padding: 12px; }
  .ch-n b { font-size: 21px; }
  .ch-bal b { font-size: 26px; }
  .hoy-nums { gap: 6px; } .hoy-nums > div { padding: 10px; } .hoy-nums b { font-size: 16px; }
  .hoy-cuentas { grid-template-columns: 1fr; gap: 6px; }
  .hoy-cuentas > div { grid-template-columns: auto 1fr auto; grid-template-rows: auto; }
  .hoy-cuentas .dib { grid-row: auto; }
  .hoy-cuentas b { order: 3; font-size: 18px; } .hoy-cuentas span { font-size: 14px; color: var(--text); }
  .dib-picker { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}

/* Chat de soporte */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5484d; color: #fff; font: 700 11.5px/20px var(--font); text-align: center; font-style: normal; }
.nav-badge[hidden] { display: none; }
#menu-btn { position: relative; }
#menu-btn.con-aviso::after { content: ''; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }
.chat-panel { display: flex; flex-direction: column; height: calc(100dvh - 210px); min-height: 420px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head > div { min-width: 0; flex: 1; } .chat-head b { display: block; } .chat-head small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-av { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.chat-av svg { width: 20px; height: 20px; }
.chat-cuerpo { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #f6f6f3; }
.ch-lista { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.ch-dia { align-self: center; font: 600 11.5px var(--font); color: var(--muted); background: #e9e9e4; border-radius: 10px; padding: 3px 10px; margin: 8px 0 4px; }
.ch-msg { align-self: flex-start; max-width: min(78%, 460px); background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; padding: 8px 11px 5px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.ch-msg.mio { align-self: flex-end; background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 16px 16px 5px 16px; }
.ch-msg.enviando { opacity: .6; }
.ch-bienv { background: #fff; }
.ch-autor { display: block; font-weight: 700; font-size: 12px; color: var(--primary); margin-bottom: 2px; }
.ch-txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.4; }
.ch-hora { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ch-msg.mio .ch-hora { color: #c9ccff; } .ch-visto { font-style: normal; }
.ch-foto { display: block; margin: 2px -5px 4px; } .ch-foto img { display: block; max-width: 100%; max-height: 320px; border-radius: 11px; background: #eee; min-width: 120px; min-height: 80px; object-fit: cover; }
.ch-audio { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 4px 0; }
.ch-play { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 13px; cursor: pointer; flex: none; }
.ch-msg.mio .ch-play { background: #fff; color: var(--primary); }
.ch-barra { flex: 1; height: 4px; border-radius: 2px; background: rgba(0,0,0,.12); overflow: hidden; } .ch-msg.mio .ch-barra { background: rgba(255,255,255,.35); }
.ch-barra i { display: block; height: 100%; width: 0; background: currentColor; }
.ch-dur { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ch-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.ch-form[hidden], .ch-grabando[hidden] { display: none; }
.ch-form textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 20px; padding: 10px 14px; font: 15px/1.35 var(--font); max-height: 130px; outline: none; background: #fafaf8; }
.ch-form textarea:focus { border-color: var(--primary); background: #fff; }
.ch-ic { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.ch-ic:hover { background: #f0f0ec; color: var(--text); } .ch-ic svg { width: 22px; height: 22px; }
.ch-send, .ch-mic { background: var(--primary); color: #fff; } .ch-send:hover, .ch-mic:hover { background: var(--primary-600); color: #fff; }
.ch-form .ch-send { display: none; } .ch-form.con-texto .ch-send { display: grid; } .ch-form.con-texto .ch-mic { display: none; }
.ch-grabando { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.ch-grabando .rec-t { font-variant-numeric: tabular-nums; } .ch-grabando .muted { flex: 1; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e5484d; animation: parpadeo 1s infinite; }
@keyframes parpadeo { 50% { opacity: .25; } }
.avisos-btn { margin-left: auto; white-space: nowrap; } .avisos-btn.on { color: #17803d; border-color: #b7e2c4; background: #effaf2; }
.avisos-btn svg { width: 16px; height: 16px; }
/* Chat de soporte: equipo Lava Pro */
.soporte-admin { display: grid; grid-template-columns: 330px 1fr; gap: 16px; }
.sa-lista { overflow: hidden; display: flex; flex-direction: column; height: calc(100dvh - 210px); min-height: 420px; }
.sa-top { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; }
#sa-convs { overflow-y: auto; flex: 1; }
.sa-conv { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; }
.sa-conv:hover { background: #f7f7f5; } .sa-conv.on { background: var(--primary-50); }
.sa-av { width: 40px; height: 40px; border-radius: 50%; background: #e9e9e4; display: grid; place-items: center; font-weight: 700; flex: none; }
.sa-txt { flex: 1; min-width: 0; } .sa-txt b { display: block; } .sa-txt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } .sa-meta small { color: var(--muted); font-size: 11.5px; }
.sa-meta .nav-badge { margin: 0; }
.sa-volver { display: none; font-size: 20px; }
@media (max-width: 860px) {
  .soporte-admin { grid-template-columns: 1fr; }
  .soporte-admin.con-chat .sa-lista, .soporte-admin:not(.con-chat) .sa-chat { display: none; }
  .sa-volver { display: grid; }
}
@media (max-width: 640px) {
  .chat-panel, .sa-lista { height: calc(100dvh - 190px); margin: 0 -4px; }
  .ch-msg { max-width: 86%; }
  .chat-head { padding: 10px 12px; }
  .avisos-btn { padding: 6px 10px; font-size: 13px; }
}

/* Reportes: botones grandes por sección */
.rep-botones { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rep-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .15s; }
.rep-btn .dib { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 8px; } .rep-btn .dib svg { width: 28px; height: 28px; }
.rep-btn .rb-t { font-weight: 700; font-size: 16px; }
.rep-btn .rb-n { font-family: var(--font-clave); font-size: 20px; white-space: nowrap; line-height: 1.15; letter-spacing: -.01em; }
.rep-btn .rb-s { font-size: 12.5px; color: var(--muted); }
.rep-btn:hover { border-color: var(--line-2); transform: translateY(-1px); }
.rep-btn.on { border-color: var(--primary); background: var(--primary-50); }
.rep-btn.on .dib { background: var(--primary); color: #fff; }
#sec { scroll-margin-top: 12px; }
.rep-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.rep-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.rep-tile small { color: var(--muted); font-size: 12.5px; }
.rep-tile b { font-family: var(--font-clave); font-size: 22px; line-height: 1.15; }
.rep-tile span { color: var(--muted); font-size: 12px; }
.art-buscar .art-ac { position: relative; }
.art-buscar .art-lupa { position: absolute; left: 14px; top: 26px; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; z-index: 1; }
.art-buscar .art-lupa svg { width: 20px; height: 20px; }
.art-buscar #art-q { height: 52px; font-size: 17px; padding-left: 44px; border-radius: 14px; width: 100%; }
@media (max-width: 640px) {
  .rep-botones { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rep-btn { padding: 12px; }
  .rep-btn .dib { width: 38px; height: 38px; margin-bottom: 4px; } .rep-btn .dib svg { width: 22px; height: 22px; }
  .rep-btn .rb-n { font-size: 18px; }
  .rep-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rep-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rep-tile b { font-size: 18px; }
}

/* Agenda: el mensaje del cliente, tal cual lo pegaron */
.vis-msg { white-space: pre-wrap; background: #f7f7f5; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; max-height: 220px; overflow: auto; }
.msg-cliente textarea { min-height: 130px; font-size: 15px; line-height: 1.45; resize: vertical; }
.tel-detectado { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.tel-detectado.ok { color: #1f7a45; font-weight: 600; }
.mas-datos { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.mas-datos > summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.mas-datos > summary::-webkit-details-marker { display: none; }
.mas-datos > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
.mas-datos[open] > summary::after { content: '▴'; }
.mas-datos[open] { padding-bottom: 14px; }
.dom-check { margin-top: 10px; }
.msg-cliente > label { display: flex; align-items: center; gap: 6px; }
.msg-cliente > label svg { width: 15px; height: 15px; }
