/* Caserito POS — colores corporativos: negro + anaranjado
   (el layout sigue el prototipo de design/project/, la paleta no) */

/* Fuente Manrope servida localmente: la app debe funcionar SIN internet
   (fuente variable, cubre los pesos 400 a 800) */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --bg: #F6F5F1;
  --ink: #1A1A1A;
  --dark: #151515;
  --dark-hover: #262626;
  --primary: #EA580C;
  --primary-hover: #C2410C;
  --primary-soft: #FFEDD5;
  --border: #E4E2DB;
  --border-l: #EEECE4;
  --line: #F2F0E9;
  --muted: #6D6862;
  --faint: #928D85;
  --red: #B91C1C;
  --amber: #B45309;
  --ok: #067647;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--ink);
}
input, select, button, textarea { font-family: 'Manrope', sans-serif; }
button { cursor: pointer; }
[hidden] { display: none !important; }

@keyframes popIn  { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { 0% { transform: translateY(14px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }

/* Aviso de emergencia: sin conexión con el servidor */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--red); color: #fff; text-align: center;
  padding: 10px 16px; font-size: 14px; font-weight: 800;
}

/* ===== Layout general ===== */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ===== Sidebar ===== */
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--dark); color: #ECECEC;
  display: flex; flex-direction: column; padding: 20px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: #9A9A9A; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  font-weight: 700; font-size: 15px; color: #B3B3B3; text-decoration: none;
}
.nav-item:hover { background: var(--dark-hover); color: #B3B3B3; }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; border-top: 1px solid var(--dark-hover);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-rol { font-size: 11px; color: #9A9A9A; font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.avatar-admin { background: var(--primary); }
.avatar-cajero { background: #52525B; }
.logout { color: #9A9A9A; display: flex; padding: 6px; border-radius: 8px; }
.logout:hover { color: #fff; background: var(--dark-hover); }

/* Función bloqueada por plan */
.nav-candado { margin-left: auto; font-size: 11px; opacity: 0.8; }
.plan-lock {
  max-width: 520px; margin: 80px auto; text-align: center;
  background: #fff; border: 1.5px solid var(--border); border-radius: 18px; padding: 40px 34px;
}
.plan-lock-icono { font-size: 42px; margin-bottom: 10px; }
.plan-lock h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.plan-lock p { font-size: 14.5px; font-weight: 600; color: var(--muted); line-height: 1.65; margin: 0; }

/* ===== Páginas genéricas ===== */
.page { padding: 28px 32px; overflow-y: auto; height: 100%; }
.page h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; }
.page-actions { display: flex; gap: 10px; align-items: center; }
.inv-search { width: 320px; height: 48px; }
@media (max-width: 1180px) { .inv-search { width: 210px; } }
.page-sub { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.row-title { display: flex; align-items: center; gap: 12px; }

.card { background: #fff; border: 1.5px solid var(--border); border-radius: 16px; }
.card.pad { padding: 24px; }
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 16px; }
.card-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-note { font-size: 12.5px; color: var(--faint); font-weight: 600; margin-top: 14px; }

/* ===== Tablas ===== */
.table-card { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 14px 16px; text-align: left; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; border-bottom: 1.5px solid var(--border-l);
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.table tbody tr:hover { background: #FAFAF7; }
.table .num { text-align: right; }
.table .b { font-weight: 700; }
.table .bb { font-weight: 800; }
.table .muted, .muted { color: var(--muted); }
.table-empty { text-align: center; color: var(--faint); padding: 32px 16px !important; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge-ok      { background: #DCFCE7; color: var(--ok); }
.badge-low     { background: #FEF3C7; color: var(--amber); }
.badge-crit    { background: #FEE2E2; color: var(--red); }
.badge-neutral { background: var(--border); color: var(--muted); }
.badge-dark    { background: var(--dark); color: #fff; }
.badge-accent  { background: var(--primary-soft); color: var(--primary-hover); }

/* ===== Botones ===== */
.btn-primary {
  height: 48px; padding: 0 22px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 800;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #CBC6BE; cursor: not-allowed; }
.btn-outline {
  height: 48px; padding: 0 18px; border: 1.5px solid var(--border); border-radius: 12px;
  background: #fff; font-size: 15px; font-weight: 800; color: var(--ink);
}
.btn-outline:hover { background: var(--bg); }
.btn-outline.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; color: var(--primary); }
.btn-outline.btn-sm:hover { border-color: var(--primary); background: #fff; }
.btn-dark { height: 56px; border: none; border-radius: 12px; background: var(--dark); color: #fff; font-size: 17px; font-weight: 800; }
.btn-dark:hover { background: var(--dark-hover); }
.btn-block { width: 100%; }
.btn-edit {
  height: 34px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 13px; font-weight: 700; color: var(--ink);
}
.btn-edit:hover { border-color: var(--primary); color: var(--primary); }
a.btn-edit { display: inline-flex; align-items: center; text-decoration: none; }
.acciones-venta { white-space: nowrap; }
.acciones-venta .btn-edit + .btn-edit, .acciones-venta .btn-edit + .btn-anular { margin-left: 6px; }
.btn-anular { color: var(--red); }
.btn-anular:hover { border-color: var(--red); color: var(--red); }

/* ===== Chips ===== */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 700;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.chips-sm { margin-top: 10px; gap: 6px; }

/* ===== Formularios ===== */
.field { display: block; }
.field span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 14px; font-size: 15px; font-weight: 600; outline: none; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field .input-lg { height: 56px; font-size: 22px; font-weight: 800; border-radius: 12px; }
.form-col { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 10px; }
.form-row .field { flex: 1; }
.form-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.form-msg { font-size: 13.5px; font-weight: 700; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--red); }

/* ===== Vender ===== */
.vender { display: flex; height: 100%; min-height: 0; }
.vender-left { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 18px 20px 0 24px; }
.vr-titulo { margin: 0 0 12px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; }

/* Pestañas de categorías */
.cat-tabs { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; flex-shrink: 0; }
.cat-tab {
  height: 46px; padding: 0 20px; border-radius: 10px; border: 1.5px solid var(--border);
  background: #fff; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.vender-search { display: flex; gap: 10px; }
.input-search {
  flex: 1; height: 52px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 18px; font-size: 16px; font-weight: 600; background: #fff; outline: none; color: var(--ink);
}
.input-search:focus { border-color: var(--primary); }
.input-barcode {
  width: 250px; height: 52px; border: 1.5px dashed #C9C6BC; border-radius: 12px;
  padding: 0 16px; font-size: 15px; font-weight: 600; background: #FDFDFB; outline: none; color: var(--ink);
}
.input-barcode:focus { border-color: var(--primary); border-style: solid; }
.barcode-msg { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--red); }
.vender .chips { margin-top: 16px; }
.grid-wrap { flex: 1; overflow-y: auto; margin-top: 16px; padding-bottom: 24px; }

/* Navegación estilo POS táctil: categorías → productos */
.nav-vender { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.btn-volver-cats {
  height: 44px; padding: 0 18px; border-radius: 11px; border: 1.5px solid var(--border);
  background: #fff; font-size: 14.5px; font-weight: 800; color: var(--ink); cursor: pointer;
}
.btn-volver-cats:hover { border-color: var(--primary); color: var(--primary); }
.btn-volver-cats:active { transform: scale(0.97); }
.cat-actual { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 16px;
  padding: 18px; min-height: 140px; cursor: pointer; text-align: left;
}
.cat-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(234, 88, 12, 0.12); }
.cat-card:active { transform: scale(0.97); }
.cat-card-ini {
  width: 44px; height: 44px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 21px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.cat-card-nombre { font-size: 16.5px; font-weight: 800; line-height: 1.2; margin-top: auto; }
.cat-card-n { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.tile {
  text-align: left; background: #fff; border: 1.5px solid var(--border); border-radius: 16px;
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(21, 21, 21, 0.10); }
.tile:active { transform: scale(0.97); box-shadow: none; }

/* Zona visual: foto del producto o monograma con el color de su categoría */
.tile-media {
  position: relative; height: 86px; flex-shrink: 0; background: var(--line); color: var(--faint);
  display: flex; align-items: center; justify-content: center;
}
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-letra { font-size: 32px; font-weight: 800; }
.tile-oferta {
  position: absolute; bottom: 7px; left: 7px; background: var(--primary); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); letter-spacing: 0.01em;
}
.tile-kg {
  position: absolute; bottom: 7px; right: 7px; background: rgba(21, 21, 21, 0.78); color: #fff;
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
}
.tile-ing {
  position: absolute; top: 7px; right: 7px; width: 25px; height: 25px;
  border-radius: 50%; background: #fff; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--muted); cursor: pointer;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}
.tile-ing:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.1); }
.tile-ing { left: 7px; right: auto; }
.tile-add {
  position: absolute; top: 7px; right: 7px; width: 27px; height: 27px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 18px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); transition: transform 0.1s ease;
}
.tile:hover .tile-add { transform: scale(1.12); }

/* Cuerpo del tile */
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-name {
  font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.tile-price { margin-top: auto; font-size: 17.5px; font-weight: 800; letter-spacing: -0.02em; color: var(--dark); }
.tile-price small { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.tile-stock { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--faint); }
.tile-stock .punto { width: 7px; height: 7px; border-radius: 50%; background: #16A34A; flex-shrink: 0; }
.tile-stock.low { color: var(--amber); }
.tile-stock.low .punto { background: var(--amber); }
.tile-stock.crit { color: var(--red); }
.tile-stock.crit .punto { background: var(--red); }
.tile-stock.neutro .punto { background: var(--faint); }

/* Sin stock: se ve apagado (sigue vendible por si el stock está desactualizado) */
.tile.agotado .tile-media { filter: grayscale(1); opacity: 0.55; }
.tile.agotado .tile-name, .tile.agotado .tile-price { color: var(--muted); }

/* Carrito */
.cart { width: 385px; flex-shrink: 0; background: #fff; border-left: 1.5px solid var(--border); display: flex; flex-direction: column; }
.cart-dark { background: var(--dark); color: #fff; padding: 14px 20px; flex-shrink: 0; }
.cart-dark-fila { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cart-dark-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.cart-dark-count { font-size: 12px; font-weight: 700; color: #FDBA74; white-space: nowrap; }
.cart-dark-sub { font-size: 12px; font-weight: 600; color: #B3B3B3; margin-top: 3px; }
.cl-thumb {
  width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border-l); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.cart-body { flex: 1; overflow-y: auto; padding: 0 20px; }
.cart-empty {
  border: 1.5px dashed #DDDACF; border-radius: 12px; padding: 28px 16px; text-align: center;
  color: var(--faint); font-size: 14px; font-weight: 600; margin-top: 8px;
}
.cart-lines { display: flex; flex-direction: column; gap: 10px; }
.cart-line { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-l); border-radius: 12px; padding: 10px 12px; }
.cl-info { flex: 1; min-width: 0; }
.cl-name { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.cl-price { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.cl-sin { font-size: 11.5px; font-weight: 800; color: var(--amber); margin-top: 3px; }
.cl-oferta { font-size: 11.5px; font-weight: 800; color: var(--primary); margin-top: 3px; }

/* Fiado en el cobro */
.pm-fiado { grid-column: span 2; }
.fiado-select {
  width: 100%; height: 48px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 14.5px; font-weight: 600; background: #fff; color: var(--ink); outline: none;
}
.fiado-select:focus { border-color: var(--primary); }
.fiado-nuevo { display: flex; gap: 8px; margin-top: 10px; }
.fiado-nuevo input {
  flex: 1; min-width: 0; height: 38px; border: 1.5px solid var(--border); border-radius: 9px;
  padding: 0 11px; font-size: 13.5px; font-weight: 600; outline: none;
}
.fiado-nuevo input:focus { border-color: var(--primary); }
.check-row {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; padding: 4px 2px;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.btn-comanda { white-space: nowrap; }

/* Modal de ingredientes */
.ing-lista { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; max-height: 320px; overflow-y: auto; }
.ing-item {
  display: flex; align-items: center; gap: 11px; border: 1px solid var(--border-l);
  border-radius: 10px; padding: 11px 13px; font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.ing-item input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.ing-item.quitado span { text-decoration: line-through; color: var(--faint); }
.ing-item.quitado { background: #FAFAF7; }
.cl-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1;
}
.qty-n { width: 24px; text-align: center; font-weight: 800; font-size: 15px; }
.cl-total { width: 64px; text-align: right; font-weight: 800; font-size: 14px; }
.cart-foot { padding: 12px 20px 16px; border-top: 1.5px solid var(--border-l); display: flex; flex-direction: column; gap: 10px; }

/* Total destacado + teclado + botones de pago */
.total-box {
  background: var(--dark); border-radius: 12px; padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.total-box span { color: #B3B3B3; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.total-box b { color: #FDBA74; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.mult-row {
  display: flex; align-items: center; gap: 8px; background: var(--primary-soft); color: var(--primary-hover);
  font-size: 12.5px; font-weight: 800; padding: 8px 12px; border-radius: 9px;
}
.mult-row button { margin-left: auto; border: none; background: transparent; color: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button {
  height: 38px; border-radius: 9px; border: 1.5px solid var(--border);
  background: #fff; font-size: 15.5px; font-weight: 800; color: var(--ink); cursor: pointer;
}
.keypad button:hover { border-color: var(--primary); color: var(--primary); }
.keypad button:active { transform: scale(0.94); }
.keypad .kp-c { color: var(--red); }
.pagos-stack { display: flex; flex-direction: column; gap: 8px; }
.btn-pago {
  height: 48px; border: none; border-radius: 11px; font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer;
}
.btn-pago.efectivo { background: var(--primary); color: #fff; }
.btn-pago.efectivo:hover { background: var(--primary-hover); }
.btn-pago.tarjeta { background: var(--dark); color: #fff; }
.btn-pago.tarjeta:hover { background: var(--dark-hover); }
.btn-pago.otros { background: #fff; border: 1.5px solid var(--border); color: var(--ink); }
.btn-pago.otros:hover { border-color: var(--primary); color: var(--primary); }
.btn-pago:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-pago:active:not(:disabled) { transform: scale(0.98); }
.dcto-row { display: flex; align-items: center; gap: 8px; }
.dcto-row #dctoChips { display: flex; gap: 8px; }
.dcto-label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.totals { display: flex; flex-direction: column; gap: 5px; }
.tot-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--muted); }
.tot-dcto { font-weight: 700; color: var(--amber); }
.tot-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.tot-total span:first-child { font-size: 16px; font-weight: 800; }
.tot-total span:last-child { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.btn-cobrar {
  height: 64px; border: none; border-radius: 14px; background: var(--primary); color: #fff;
  font-size: 22px; font-weight: 800; letter-spacing: 0.02em;
}
.btn-cobrar:hover { filter: brightness(1.06); }
.btn-cobrar:active { transform: scale(0.98); }
.btn-cobrar:disabled { background: #CBC6BE; cursor: not-allowed; transform: none; filter: none; }

/* ===== Modales ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(21, 21, 21, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  width: 520px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px);
  overflow-y: auto; background: #fff; border-radius: 20px; padding: 28px; animation: fadeUp 0.22s ease;
}
.modal-pay { width: 560px; }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 18px; }

/* Modal de cobro */
.pay-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.pay-title { font-size: 21px; font-weight: 800; }
.pay-total { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.seg-row { display: flex; gap: 8px; margin-bottom: 18px; }
.seg-btn {
  flex: 1; height: 48px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 800;
}
.seg-btn.active { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary); }
.factura-fields { display: flex; gap: 8px; margin: -8px 0 18px; }
.factura-fields input {
  height: 46px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px;
  font-size: 14.5px; font-weight: 600; outline: none;
}
.factura-fields input:focus { border-color: var(--primary); }
.factura-fields input:first-child { width: 170px; }
.factura-fields input:last-child { flex: 1; }
.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.pm-btn {
  height: 58px; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fff; color: var(--ink); font-size: 16px; font-weight: 800;
}
.pm-btn.active { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary); }
.efectivo-box { border: 1.5px solid var(--border-l); background: #FAFAF7; border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.efectivo-box input#recibido {
  width: 100%; height: 54px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 16px; font-size: 22px; font-weight: 800; outline: none; background: #fff;
}
.efectivo-box input#recibido:focus { border-color: var(--primary); }
.vuelto-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.vuelto-row span:first-child { font-size: 15px; font-weight: 800; color: var(--primary-hover); }
.vuelto-row span:last-child { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--primary-hover); }
.vuelto-row .neg { color: var(--red); }
.pay-error { font-size: 13.5px; font-weight: 700; color: var(--red); margin-bottom: 12px; }
.pay-actions { display: flex; gap: 10px; }
.pay-actions .btn-outline { flex: 1; height: 58px; }
.pay-actions .btn-confirm { flex: 2; height: 58px; font-size: 17px; }

/* Paso venta OK */
.ok-step { text-align: center; padding: 12px 8px; animation: popIn 0.25s ease; }
.ok-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ok-sub { font-size: 14.5px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.ok-box {
  display: flex; flex-direction: column; gap: 8px; background: #FAFAF7;
  border: 1.5px solid var(--border-l); border-radius: 14px; padding: 18px; margin: 20px 0;
}
.ok-row { display: flex; justify-content: space-between; font-size: 15px; }
.ok-row span { font-weight: 600; color: var(--muted); }
.ok-row b { font-weight: 800; }
.ok-vuelto span, .ok-vuelto b { color: var(--amber); font-weight: 800; }
.ok-vuelto b { font-size: 19px; }

/* ===== Reportes ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi { background: #fff; border: 1.5px solid var(--border); border-radius: 16px; padding: 20px 22px; }
.kpi-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.kpi-label { font-size: 13px; font-weight: 700; }
.kpi-dark .kpi-label { color: #9A9A9A; }
.kpi-amt { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.kpi-sub { font-size: 13px; font-weight: 700; margin-top: 4px; }
.kpi-sub-accent { color: #FDBA74; }
.rep-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin: 14px 0; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-amt { font-size: 11px; font-weight: 700; color: var(--muted); }
.bar { width: 100%; border-radius: 8px 8px 4px 4px; background: #FED7AA; }
.bar-hoy { background: var(--primary); }
.bar-lbl { font-size: 12px; font-weight: 800; color: var(--muted); }
.pm-list { display: flex; flex-direction: column; gap: 14px; }
.pm-row { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-lg { height: 14px; flex: 1; }
.meter-fill { height: 100%; border-radius: 999px; }
.meter-accent { background: var(--primary); }
.top-list { display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; align-items: center; gap: 14px; }
.top-name { width: 220px; font-size: 13.5px; font-weight: 700; }
.top-units { width: 90px; text-align: right; font-size: 13px; font-weight: 800; color: var(--muted); }

/* ===== Caja ===== */
.caja-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; max-width: 980px; }
.sum-list { display: flex; flex-direction: column; }
.sum-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.sum-row span { font-weight: 600; color: var(--muted); }
.sum-row b { font-weight: 800; }
.sum-row .neg { color: var(--red); }
.sum-total { display: flex; justify-content: space-between; padding: 14px 0 2px; font-size: 16px; }
.sum-total span { font-weight: 800; }
.sum-total b { font-weight: 800; font-size: 20px; }
.retiro-row { display: flex; gap: 8px; margin-top: 18px; }
.retiro-row input {
  height: 42px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 12px;
  font-size: 14px; font-weight: 600; outline: none; min-width: 0;
}
.retiro-row input:focus { border-color: var(--primary); }
.retiro-row input:first-child { width: 130px; }
.retiro-row input:nth-child(2) { flex: 1; }
.retiro-row .btn-outline { height: 42px; padding: 0 14px; font-size: 13.5px; white-space: nowrap; }
.arqueo { display: flex; flex-direction: column; gap: 14px; }
.arqueo .card-title { margin-bottom: 0; }
.dif-box { border-radius: 12px; padding: 16px; background: var(--bg); }
.dif-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.dif-amt { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--muted); }
.dif-box.dif-ok { background: #DCFCE7; }
.dif-box.dif-ok .dif-label, .dif-box.dif-ok .dif-amt { color: var(--ok); }
.dif-box.dif-bad { background: #FEE2E2; }
.dif-box.dif-bad .dif-label, .dif-box.dif-bad .dif-amt { color: var(--red); }

/* ===== Imágenes de producto ===== */
.prod-cell { display: flex; align-items: center; gap: 10px; }
.thumb {
  width: 36px; height: 36px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border-l); background: var(--line); flex-shrink: 0; display: inline-block;
}
.thumb-empty { background: var(--line); }
/* Zona de carga de imagen (clic o arrastrar y soltar) */
.drop-zone {
  border: 2px dashed #C9C6BC; border-radius: 14px; background: #FDFDFB;
  min-height: 148px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone.dz-over { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone.tiene-img { border-style: solid; border-color: var(--border); background: #fff; cursor: default; }
.dz-vacio { text-align: center; padding: 22px 16px; color: var(--muted); pointer-events: none; }
.dz-vacio svg { color: var(--primary); margin-bottom: 8px; }
.dz-titulo { font-size: 14px; font-weight: 700; color: var(--ink); }
.dz-titulo u { color: var(--primary); text-underline-offset: 3px; }
.dz-hint { font-size: 12px; font-weight: 600; color: var(--faint); margin-top: 4px; }
.dz-preview { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px; }
.dz-preview img {
  width: 112px; height: 112px; object-fit: cover; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--line); flex-shrink: 0;
}
.dz-info { flex: 1; min-width: 0; }
.dz-listo { font-size: 14px; font-weight: 800; color: var(--ok); }
.dz-acciones { display: flex; gap: 8px; margin-top: 12px; }
.dz-btn {
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.dz-btn:hover { border-color: var(--primary); color: var(--primary); }
.dz-btn-rojo { color: var(--red); }
.dz-btn-rojo:hover { border-color: var(--red); color: var(--red); }

/* ===== Importador CSV ===== */
.csv-pasos { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.csv-pasos a { color: var(--primary); font-weight: 800; }
.csv-resultado { border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.csv-ok { background: #DCFCE7; color: var(--ok); font-weight: 800; padding: 10px 14px; border-radius: 10px; }
.csv-err { background: #FEE2E2; color: var(--red); padding: 10px 14px; border-radius: 10px; margin-top: 8px; line-height: 1.6; }

/* ===== Kardex de stock ===== */
.stock-actual { font-size: 14px; font-weight: 600; color: var(--muted); margin: -10px 0 14px; }
.stock-actual b { color: var(--ink); font-weight: 800; }
.movs-titulo { font-size: 14px; font-weight: 800; margin: 20px 0 10px; }
.movs-lista { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.mov-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--border-l); border-radius: 10px; padding: 9px 12px; font-size: 13.5px;
}
.mov-info b { font-weight: 800; }
.mov-delta { font-weight: 800; margin-left: 4px; }
.mov-delta.pos { color: var(--ok); }
.mov-delta.neg { color: var(--red); }
.mov-final { font-weight: 800; color: var(--muted); white-space: nowrap; }
.mini { font-size: 12px; font-weight: 600; color: var(--faint); }

/* ===== Configuración ===== */
.conf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 980px; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-l); border-radius: 12px; padding: 12px 14px; }
.user-row .avatar { width: 38px; height: 38px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 700; font-size: 14.5px; }
.user-mail { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.user-inactivo { opacity: 0.55; }
.user-acciones { display: flex; gap: 6px; }

/* ===== Login ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 400px; max-width: calc(100vw - 40px); background: #fff; border: 1.5px solid var(--border);
  border-radius: 20px; padding: 32px; animation: fadeUp 0.25s ease;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand-sub-dark { font-size: 11px; color: var(--muted); font-weight: 600; }
.login-title { margin: 0 0 18px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error {
  background: #FEE2E2; color: var(--red); font-size: 13.5px; font-weight: 700;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
}
.login-hint { font-size: 12px; color: var(--faint); font-weight: 600; margin-top: 18px; line-height: 1.5; }

/* ===== Responsivo (sidebar colapsada bajo 1180px, como el prototipo) ===== */
@media (max-width: 1180px) {
  .sidebar { width: 72px; }
  .sb-label { display: none; }
  .brand, .nav-item, .sidebar-user { justify-content: center; }
  .logout { display: none; }
  .cart { width: 320px; }
  .input-barcode { width: 170px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .cats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cat-card { min-height: 118px; padding: 14px; }
  .page { padding: 20px 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .rep-grid, .caja-grid, .conf-grid { grid-template-columns: 1fr; }
  .top-name { width: 140px; }
}
