/* Calza POS — estilos base
   Paleta PROVISIONAL (la identidad definitiva se decide aparte).
   Todo el color vive en estas variables: cambiar la marca = cambiar :root. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #131a24;
  --ink-2: #3d4a5c;
  --muted: #5b6878;       /* 4,9:1 sobre fondo claro (AA) */
  --border: #e3e7ee;
  --accent: #cf4a0c;        /* botones (texto blanco: 4,6:1) */
  --accent-soft: #fff1e9;
  --nav: #131a24;
  --nav-ink: #c8d2de;
  --ok: #0f7b46;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --radius: 12px;
  --radius-control: 8px;
  --radius-modal: 16px;
  --radius-pill: 999px;
  /* escala tipográfica: 10 11 12 13 15 16 18 21 24 26 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 15px;
  --fs-xl: 18px;
  --fs-2xl: 26px;
  --accent-ink: #a03d0b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14px; }
.hidden, .mhide { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, #1e293b 0%, #0e141c 55%, #080b10 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-logo .mark {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
}
.login-logo .word { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.login-card p.sub { color: var(--muted); margin: 6px 0 22px; font-size: 13px; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--nav); color: var(--nav-ink); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar .brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: 0 0 auto;
}
.sidebar .brand .name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  background: transparent; border: 0; border-radius: 8px; color: var(--nav-ink);
  cursor: pointer; text-align: left; font-size: 13px; font-weight: 500;
}
.nav-btn svg { width: 17px; height: 17px; flex: 0 0 auto; stroke-width: 1.9; }
.nav-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-btn.active { background: var(--accent); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .cash-state {
  font-size: 11px; color: #8fa0b4; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #64748b; flex: 0 0 auto; }
.dot.on { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; }
.topbar .biz { color: var(--muted); font-size: 12px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tasa-chip {
  display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--ink-2);
}
.tasa-chip b { font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #e8ecf2; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--ink-2);
}
.content { padding: 20px 22px 40px; max-width: 1500px; width: 100%; }

/* ---------------------------------------------------------------- pieces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; stroke-width: 2; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef1f5; }
.btn-danger { color: var(--danger); border-color: #f3cfcc; background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; }

.input, .select, textarea.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: none;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.b { font-weight: 600; }
.right { margin-left: auto; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef1f5; color: var(--ink-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------- mostrador */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); stroke-width: 2; }
.search-box input {
  width: 100%; padding: 14px 14px 14px 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-size: 15px; box-shadow: var(--shadow); outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; align-items: center; min-width: 0; max-width: 100%; }
.chip {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: #cfd6df; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-model { background: var(--accent-soft); border-color: #f6cdb4; color: var(--accent-ink); font-weight: 600; }

/* Tarjetas de repuesto: todas del mismo tamaño, con textos recortados parejos */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
  grid-auto-rows: 1fr;
  align-items: stretch;
  min-width: 0;
}
.part {
  display: flex; flex-direction: column; gap: 6px; padding: 10px;
  background: var(--surface); min-width: 0; height: 100%;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: left;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.part:hover { border-color: #f0b494; box-shadow: 0 6px 18px -12px rgba(16,24,40,.35); transform: translateY(-1px); }
.part .thumb {
  flex: 0 0 92px; height: 92px; width: 100%; border-radius: 8px;
  background: #f7f8fa; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: #9aa8b8; overflow: hidden;
}
.part .thumb .ph { display: flex; align-items: center; gap: 6px; color: #94a3b4; }
.part .thumb .ph i { font-style: normal; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; }
.part .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.part .thumb svg { width: 26px; height: 26px; }
.part .name {
  font-weight: 600; font-size: 13px; line-height: 1.25rem; height: 2.5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.part .codes {
  font-size: 11px; color: var(--muted); line-height: 14px; height: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.part .compat {
  font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px;
  padding: 3px 7px; height: 22px; line-height: 16px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.part .compat.sinmodelos { background: #eef1f5; color: #55637a; }
.part .bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; }
.part .price { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.part .bottom .badge { margin-left: auto; }

.cart { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 0; }
.cart-items { max-height: calc(100vh - 330px); overflow: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cart-line .n { font-size: 13px; font-weight: 500; line-height: 1.25; }
.cart-line .c { font-size: 11px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.qty button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-weight: 700; line-height: 1; color: var(--ink-2);
}
.qty button:hover { background: #eef1f5; }
.qty span { min-width: 24px; text-align: center; font-size: 12px; }
.cart-line .amount { text-align: right; font-weight: 600; font-size: 13px; }
.cart-line .del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0; }
.cart-line .del:hover { color: var(--danger); }
.cart-empty { padding: 38px 18px; text-align: center; color: var(--muted); font-size: 12px; }
.cart-total { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.cart-total .line { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.cart-total .grand { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.cart-total .grand b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.cart-total .bs { font-size: 12px; color: var(--muted); text-align: right; }

/* ---------------------------------------------------------------- modales */
.modal-back {
  position: fixed; inset: 0; background: rgba(11, 17, 25, .55); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; z-index: 60;
}
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 640px;
  max-height: 92vh; overflow: auto; box-shadow: 0 40px 80px -30px rgba(0,0,0,.5);
}
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 15px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

/* pago */
.pay-total { text-align: center; padding: 6px 0 16px; }
.pay-total .usd { font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.pay-total .bs { color: var(--muted); font-size: 13px; }
.pay-row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pay-row .m-name { font-size: 13px; }
.pay-row .m-cur { font-size: 11px; color: var(--muted); }
.change-bar { display: flex; justify-content: space-between; gap: 12px; background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 11px 14px; margin-top: 12px; font-weight: 600; }
.change-bar.short { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- tablas */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }

/* --------------------------------------------------------------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; grid-auto-rows: 1fr; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 104px;
}
.kpi .foot { margin-top: auto; }
.kpi .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi.accent .value { color: var(--accent); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 200px) 1fr 84px; gap: 10px; align-items: center; font-size: 12px; }
.mobile-pay {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 78px; z-index: 55;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 11px 12px 11px 16px;
  align-items: center; gap: 12px; box-shadow: 0 18px 36px -14px rgba(0,0,0,.6);
}
.mobile-pay > span { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-pay > span b { font-size: 18px; }
.mobile-pay > span .tiny { color: #a9b6c6; }
.mobile-pay .btn { margin-left: auto; }
.bar { height: 8px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* compat builder */
.compat-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 132px; overflow: auto; }
.mchip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.mchip button { border: 0; background: none; color: #b45420; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.model-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.model-pick label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px; cursor: pointer; }
.model-pick label:hover { border-color: #cfd6df; }
.model-pick input { margin: 0; }

.photo-drop {
  border: 1px dashed #cbd5e1; border-radius: 10px; padding: 14px; text-align: center; color: var(--muted);
  font-size: 12px; cursor: pointer; background: var(--surface-2);
}
.photo-drop img { max-height: 110px; border-radius: 8px; display: block; margin: 0 auto 8px; }

.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.section-title h2 { font-size: 18px; }
.empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13px; }

/* ticket */
.ticket { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-2); }
.ticket .sep { border-top: 1px dashed #cbd5e1; margin: 8px 0; }
.ticket .tline { display: flex; justify-content: space-between; gap: 10px; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 1080px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { position: static; }
  .cart-items { max-height: none; }
}
@media (max-width: 780px) {
  html, body { overflow-x: hidden; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; z-index: 50;
    flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .sidebar .brand, .sidebar .cash-state, .sidebar .spacer { display: none; }
  .nav-btn { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 6px; flex: 0 0 auto; width: auto; min-width: 52px; justify-content: center; }
  .sidebar { gap: 2px; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); }
  #pos-model { flex: 1 1 100%; max-width: 100% !important; }
  .nav-btn svg { width: 19px; height: 19px; }
  .content { padding: 14px 12px 92px; }
  .topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .topbar .biz { display: none; }
  .topbar .right { width: 100%; margin-left: 0; justify-content: flex-end; gap: 8px; }
  .user-chip #user-name { display: none; }
  .tasa-chip { font-size: 11px; padding: 4px 10px; }
  #logout-btn { font-size: 0; padding: 8px 10px; }
  #logout-btn svg { width: 16px; height: 16px; }
  .mobile-pay:not(.mhide) { display: flex; }
  .part .thumb { flex: 0 0 84px; height: 84px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .results { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 70px; }
  .modal { max-height: 96vh; }
}

/* ============================================================ COBRO (caja rápida) */
.modal-cobro { max-width: 1000px; }
.cobro { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; align-items: start; }
.cobro-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cobro-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mini-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mini-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 13px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; }
.recap { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; }
.recap-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 12px; }
.recap-line .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-head { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.pay-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
.pay-total-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.pay-head .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.pay-head .due { text-align: right; }
.pay-head .due .big.accent { font-size: 26px; }
.pay-head .due .big { color: var(--accent); }

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer;
  font-size: 12px; font-weight: 500; text-align: left;
}
.m-btn i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; }
.m-btn:hover { border-color: #cfd6df; }
.m-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.m-btn.on i { color: #a9b6c6; }

.pad-area { display: flex; flex-direction: column; gap: 8px; }
.amount-box {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; padding: 10px 14px;
  background: var(--ink); color: #fff; border-radius: 12px;
}
.amount-box .cur { font-size: 13px; color: #a9b6c6; font-weight: 600; }
.amount-box .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.amount-box .val.empty { color: #6c7c8f; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { padding: 7px 11px; font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad button {
  padding: 13px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font-size: 18px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.pad button:hover { background: var(--surface-2); }
.pad button:active { background: #eef1f5; }
.pad .pad-fn { background: var(--surface-2); font-size: 15px; }

.pay-list { display: flex; flex-direction: column; gap: 6px; }
.pay-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ok-soft); border: 1px solid #cfe9d9; border-radius: 8px; padding: 8px 10px;
}
.pc-name { font-size: 12px; font-weight: 600; color: var(--ok); }
.pc-meta { font-size: 11px; color: var(--ink-2); }
.pc-right { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pc-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.pc-del:hover { color: var(--danger); }
.pay-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; }
.cobro-actions { display: flex; gap: 8px; }
.cobro-actions .btn { flex: 1; }
.cobro-actions .btn-primary { flex: 1.3; }

/* ticket */
.ticket-doc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #16202b; background: #fff; }
.ticket-doc .sep { border-top: 1px dashed #9aa8b8; margin: 7px 0; }
.ticket-doc .tline { display: flex; justify-content: space-between; gap: 10px; }
.ticket-doc .tk-center { text-align: center; }
.ticket-doc .tk-biz { font-weight: 700; font-size: 13px; }
.ticket-doc .tk-small { font-size: 11px; color: #4a5566; }
.ticket-doc .tk-total { font-weight: 700; }
.ticket-doc .tk-item { margin-bottom: 4px; }
.ticket-doc .tk-brand { margin-top: 6px; letter-spacing: .1em; color: #6d7b8d; }
.ticket-doc.en-modal { max-width: 330px; margin: 0 auto; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
#print-area { display: none; }

@media print {
  body > * { display: none !important; }
  #print-area { display: block !important; }
  #print-area .ticket-doc { width: 74mm; font-size: 11px; }
}

@media (max-width: 900px) {
  .cobro { grid-template-columns: minmax(0, 1fr); }
  .cobro-right { order: -1; }
  .modal-cobro { max-width: 100%; }
  .pad button { padding: 15px 0; font-size: 18px; }
  .pay-head .big, .pay-head .due .big.accent { font-size: 24px; }
  .recap { max-height: 132px; }
}

/* Cobro: que el botón Cobrar siempre quede a la vista (pantalla de mostrador) */
.modal-cobro { max-height: 94vh; }
.modal-cobro .modal-body { padding: 14px 16px; }
.modal-cobro .m-btn { padding: 8px 10px; font-size: 12px; }
.modal-cobro .pad button { padding: 10px 0; font-size: 16px; }
.modal-cobro .amount-box { padding: 6px 12px; }
.modal-cobro .amount-box .val { font-size: 26px; }
.modal-cobro .pay-head { padding: 10px 12px; }
.modal-cobro .pay-head .big,
.modal-cobro .pay-head .due .big.accent { font-size: 24px; }
.modal-cobro .recap { max-height: 150px; }
.cobro-actions {
  position: sticky; bottom: -14px; background: var(--surface);
  padding: 8px 0 2px; z-index: 3;
}

.cobro-foot { display: flex; gap: 10px; width: 100%; }
.cobro-foot .btn { flex: 1; }
.cobro-foot .btn-primary { flex: 1.4; }
.mini-card.atajos ul { margin: 0; padding-left: 16px; }
.mini-card.atajos li { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.mini-card.atajos b { color: var(--ink); }


/* ============================================================ FOCO VISIBLE */
:focus { outline: none; }
:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

/* ======================================================== ÁREAS TÁCTILES */
.btn, .chip, .nav-btn, .m-btn, .seg button, .pad button, .pc-del {
  min-height: 38px;
}
.chip { display: inline-flex; align-items: center; }

/* ============================================ TEXTO SECUNDARIO LEGIBLE */
.tiny { font-size: 11px; color: var(--muted); }
th { color: #55637a; }

/* ===================================== INDICADOR DE TABLA DESLIZABLE (móvil) */
.table-wrap { position: relative; }
.table-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  top: 0;
  float: right;
  width: 26px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, .95));
}
@media (min-width: 781px) { .table-wrap::after { display: none; } }
.tabla-hint { display: none; }
@media (max-width: 780px) {
  .tabla-hint {
    display: flex; align-items: center; gap: 6px; justify-content: flex-end;
    font-size: 11px; color: var(--muted); padding: 6px 12px 0;
  }
}

/* ======================================================= TARJETAS EN MÓVIL */
@media (max-width: 780px) {
  /* los KPI van 2x2, no uno debajo del otro */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-height: 84px; padding: 12px; }
  .kpi .value { font-size: 18px; }
  .kpi .label { font-size: 10px; }
  /* filtros del catálogo en una sola columna */
  .filtros-catalogo { grid-template-columns: minmax(0, 1fr) !important; }
  .filtros-catalogo .btn, .filtros-catalogo .select, .filtros-catalogo .input { width: 100%; }
  /* cabecera de tarjeta que se parte en dos filas */
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .card-head .right { margin-left: 0; width: 100%; }
  .card-head .right .btn { flex: 1; }
  /* botones y chips cómodos al dedo */
  .btn, .chip, .m-btn, .seg button { min-height: 44px; }
  .pc-del { min-height: 44px; min-width: 44px; }
}

/* ==================================== COMPATIBILIDAD EN DOS LÍNEAS */
.part .compat {
  height: 34px; line-height: 15px; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* pie del cobro con pista de estado */
.cobro-pie { width: 100%; }
.cobro-hint { font-size: 12px; padding: 0 2px 8px; color: var(--ink-2); }
.cobro-hint.pendiente { color: var(--accent-ink); }
.cobro-hint.vuelto { color: var(--ok); }
.cobro-hint.listo { color: var(--ok); }
.empty .b { font-size: 13px; color: var(--ink); }

/* ajustes finales de área táctil y cabecera móvil */
@media (max-width: 780px) {
  #logout-btn { min-height: 44px; min-width: 44px; }
  .qty button { width: 40px; height: 40px; }
  .section-title { flex-wrap: wrap; row-gap: 8px; }
  .section-title .right { width: 100%; margin-left: 0; }
  .section-title .right .btn { flex: 1; }
  .recap .qty { display: flex; }
}

/* casillas de verificación cómodas */
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* campos de entrada con altura cómoda */
.input, .select, textarea.input { min-height: 40px; }
@media (max-width: 780px) { .input, .select, textarea.input { min-height: 44px; } }

/* En móvil las barras de reportes ocupan todo el ancho: el nombre ya no se corta */
@media (max-width: 780px) {
  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "n v" "b b";
    row-gap: 5px;
  }
  .bar-row > span:nth-child(1) { grid-area: n; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-row > span.bar { grid-area: b; }
  .bar-row > .v { grid-area: v; }
}
