/* Blanquita TPV — estilos propios (lo demás es Tailwind) */
:root {
  --rojo: #D42A2A;
  --rojo-oscuro: #B12222;
  --amarillo: #F5D53B;
  --crema: #F5F1E8;
  --tinta: #1E1B18;
}
html, body { height: 100%; }
body { background: var(--crema); color: var(--tinta); -webkit-tap-highlight-color: transparent; user-select: none; font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif; }
h1, h2, h3, .ticket-total, .display, .tile-price, .topbar-title, #pin-sucursal { font-family: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif; }

/* Barra superior blanca */
.topbar { background: #fff; border-bottom: 1px solid #E6DCCB; padding: 10px 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 0 rgba(30,27,24,.02), 0 6px 18px -12px rgba(30,27,24,.25); position: relative; z-index: 5; }
.topbar-logo { height: 40px; display: block; }
.topbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.topbar-sub { font-size: 12px; color: #7A6E5F; }
.btn { border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background .12s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn-ghost { background: #F5F1E8; color: #5F544A; }
.btn-ghost b { color: var(--tinta); }
.btn-outline { background: #fff; color: var(--tinta); border: 1.5px solid #E6DCCB; }
.btn-outline:hover { border-color: #C9B89E; }
.btn-primary { background: var(--rojo); color: #fff; box-shadow: 0 6px 14px -8px rgba(212,42,42,.7); }
.btn-primary:hover { background: var(--rojo-oscuro); }
.btn-pay { width: 100%; background: var(--rojo); color: #fff; font-weight: 800; font-size: 19px; padding: 16px; border-radius: 14px; box-shadow: 0 10px 24px -12px rgba(212,42,42,.8); transition: background .12s, transform .05s; }
.btn-pay:hover { background: var(--rojo-oscuro); }
.btn-pay:active { transform: scale(.99); }
.btn-pay:disabled { background: #E6DCCB; color: #9B8F7E; box-shadow: none; }

/* Panel del ticket */
.ticket-panel { width: 360px; background: #fff; border-left: 1px solid #E6DCCB; display: flex; flex-direction: column; box-shadow: -12px 0 30px -24px rgba(30,27,24,.35); }
.ticket-title { font-size: 17px; font-weight: 700; }
.ticket-footer { border-top: 1px solid #E6DCCB; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #fff; }
.ticket-total { font-size: 40px; font-weight: 800; color: var(--rojo); letter-spacing: -.02em; }
.pin-card { box-shadow: 0 30px 80px -30px rgba(30,27,24,.35); }
/* 2026-10-10 (video de Toño): con 16 perfiles la tarjeta era más alta que la pantalla y, al estar centrada, se recortaba
   arriba y abajo sin poder bajar. Ahora la pantalla se desplaza y la tarjeta solo se centra cuando cabe. */
#pin-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; align-items: flex-start; }
#pin-screen > .pin-card { margin: auto; flex-shrink: 0; }
#pin-grid { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
input, textarea { user-select: text; }
.tabular { font-variant-numeric: tabular-nums; }

/* Teclas grandes para dedo */
.key {
  min-height: 56px; border-radius: 12px; font-size: 26px; font-weight: 700;
  background: #fff; border: 1px solid #E6DCCB; color: var(--tinta);
  box-shadow: 0 1px 0 rgba(30,27,24,.04);
  transition: background .08s, transform .05s;
}
.key:active { background: #F1EADD; transform: scale(.97); }
.key.key-danger { background: #FBEAEA; color: #9A3423; border-color: #F3CFCF; }
.key.key-accent { background: var(--amarillo); border-color: #E3C22A; }
.key.key-primary { background: var(--rojo); color: #fff; border-color: var(--rojo-oscuro); }
.key.key-primary:active { background: var(--rojo-oscuro); }

/* Botones de producto */
.tile {
  background: #fff; border: 1.5px solid #E6DCCB; border-radius: 16px; padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px;
  min-height: 124px; text-align: left; transition: border-color .1s, transform .05s, box-shadow .12s;
  box-shadow: 0 8px 20px -16px rgba(30,27,24,.35);
}
.tile:hover { border-color: #C9B89E; }
.tile:active { transform: scale(.98); border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(212,42,42,.15); }
.tile .tile-unit {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: #F1EADD; color: #6F655B;
}
.tile .tile-unit.kg { background: #FBF0B2; color: #6B5200; }
.tile .tile-name { font-size: 17px; font-weight: 700; line-height: 1.15; }
.tile .tile-price { font-size: 26px; font-weight: 800; color: var(--rojo); letter-spacing: -.01em; }
.tile .tile-price small { font-size: 12px; font-weight: 600; color: #6F655B; }

/* Pestañas de categoría */
.tab-btn { white-space: nowrap; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1.5px solid #E6DCCB; background: #fff; color: #5F544A; transition: all .12s; }
.tab-btn.on { background: var(--rojo); color: #fff; border-color: var(--rojo); box-shadow: 0 6px 14px -8px rgba(212,42,42,.7); }

/* Filas del ticket */
.cart-item { padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.cart-item:active { background: #FBF7EF; }

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(30, 27, 24, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal.hidden { display: none; }
.sheet { background: #fff; border-radius: 20px; box-shadow: 0 24px 70px rgba(30,27,24,.3); width: 100%; overflow: hidden; display: flex; flex-direction: column; max-height: 96vh; }

/* Display grande de captura */
.display { background: #F5F1E8; border: 1px solid #EFE7D9; border-radius: 14px; padding: 14px 18px; text-align: right; font-size: 44px; font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.display small { font-size: 18px; font-weight: 600; color: #6F655B; margin-left: 6px; }

/* Segmentos (kilos / pesos) */
.seg { display: flex; background: #F1EADD; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #6F655B; }
.seg button.on { background: #fff; color: var(--tinta); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
/* En celular el encabezado del cierre no cabía y las pestañas quedaban fuera de la pantalla (2026-09-29): ahora bajan a su propio renglón. */
@media (max-width: 560px) {
  .cierre-head { padding-left: 16px; padding-right: 16px; }
  .cierre-titulo h2 { font-size: 17px; }
  .cierre-seg { width: 100% !important; order: 3; }
  .cierre-seg button { font-size: 13px; padding: 9px 6px; }
}

/* Chips de estado */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-ok { background: #E4F0E6; color: #2F6B3F; }
.chip-warn { background: #FBEFD0; color: #8A6512; }
.chip-bad { background: #F8E1DC; color: #9A3423; }
.chip-open { background: #ECE6DA; color: #6B5F4F; }

/* Tabla simple */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #7A6E5F; padding: 8px 10px; border-bottom: 1px solid #E6DCCB; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #EFE7D9; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input.cell { width: 96px; text-align: right; border: 1px solid #C9B89E; border-radius: 8px; padding: 6px 8px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s; z-index: 90; pointer-events: none; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Cinta demo */
.demo-ribbon { position: fixed; bottom: 0; left: 0; z-index: 95; background: var(--amarillo); color: var(--tinta); font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 12px; border-top-right-radius: 10px; }

/* Ticket monoespaciado */
.ticket-pre { font-family: ui-monospace, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; line-height: 1.25; }

/* Punto de PIN */
.pin-dot { width: 16px; height: 16px; border-radius: 999px; border: 2px solid #C9B89E; }
.pin-dot.on { background: var(--rojo); border-color: var(--rojo); }

@media (max-width: 900px) {
  .display { font-size: 36px; }
}

/* Recogida: cabe en tablets de 800 px de alto */
#recogida-modal .sheet > div:nth-child(2) { overflow-y: auto; }
/* Registrar lo que llegó: con muchos artículos la hoja no cabe en pantallas bajas (PC, tablet acostada): el cuerpo se desplaza
   y el título y los botones Cancelar/Guardar quedan siempre a la vista. */
#recibir-modal .sheet > div:nth-child(2) { overflow-y: auto; min-height: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
#recibir-modal .sheet > div:first-child, #recibir-modal .sheet > div:last-child { flex: 0 0 auto; }
#recibir-modal .sheet > div:last-child { padding-top: 12px; border-top: 1px solid #EFE7D9; }
@media (max-height: 820px) {
  #recibir-modal .sheet > div:first-child p { display: none; }
  #recibir-modal .key { min-height: 46px; }
  #recibir-modal .display { padding-top: 8px; padding-bottom: 8px; }
}
#recogida-modal .recogida-key { min-height: 46px; font-size: 20px; }
#recogida-modal .display { font-size: 34px; padding: 10px 16px; }

/* ═══════ Celular (≤ 767 px): catálogo arriba, ticket como barra inferior desplegable ═══════ */
.hide-sm { display: inline; }
@media (max-width: 767px) {
  .hide-sm { display: none; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar-logo { height: 32px; }
  .topbar-title { font-size: 17px; }
  .topbar-sub { font-size: 11px; }
  .topbar .btn { padding: 8px 10px; font-size: 13px; }
  #net-status { display: none !important; }
  .topbar .btn, .topbar .btn b { white-space: nowrap; }
  .topbar .btn { padding: 8px 9px; }
  .topbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
  .col-imp { display: none; }
  .topbar .leading-tight { min-width: 0; }
  #toast { top: 66px; bottom: auto; transform: translateX(-50%) translateY(-10px); }
  #toast.show { transform: translateX(-50%) translateY(0); }
  .sheet > div:last-child .key { font-size: 15px; min-height: 48px; padding: 0 8px; }
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 8px 8px; }
  #cierre-modal .sheet > div:first-child > div:first-child { order: 1; flex: 1; min-width: 0; }
  #cierre-modal .sheet > div:first-child > #cierre-close { order: 2; margin-left: auto; }
  #cierre-modal .sheet > div:first-child > .seg { order: 3; }
  #cierre-modal h2, #cortes-modal h2, #recogida-modal h2 { font-size: 19px; }

  #app > .flex-1.flex { flex-direction: column; }
  #app section { padding: 12px 12px 150px; }
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .tile { min-height: 104px; padding: 12px; }
  .tile .tile-name { font-size: 15px; }
  .tile .tile-price { font-size: 22px; }
  .tab-btn { padding: 8px 14px; font-size: 14px; }

  .ticket-panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; border-left: 0; border-top: 1px solid #E6DCCB; border-radius: 18px 18px 0 0; box-shadow: 0 -16px 40px -24px rgba(30,27,24,.5); z-index: 30; max-height: 85vh; }
  .ticket-panel #ticket-head { cursor: pointer; }
  .ticket-panel #ticket-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 44px; height: 4px; border-radius: 999px; background: #E6DCCB; transform: translateX(-50%); }
  .ticket-panel { position: fixed; }
  .ticket-panel #ticket-head { position: relative; padding-top: 16px; }
  .ticket-items { display: none; max-height: 42vh; }
  .ticket-panel.open .ticket-items { display: block; }
  .ticket-footer { padding: 12px 16px 14px; flex-direction: row; align-items: center; gap: 14px; }
  .ticket-footer > div { flex: 1; flex-direction: column; align-items: flex-start !important; gap: 0; }
  .ticket-footer > div span:first-child { font-size: 12px; }
  .ticket-total { font-size: 28px; }
  .btn-pay { width: auto; flex: 1; padding: 14px 18px; font-size: 17px; }
  .demo-ribbon { display: none; }

  .modal { padding: 0; align-items: flex-end; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 96vh; }
  .sheet > div { overflow-y: auto; }
  .key { min-height: 50px; font-size: 22px; }
  .display { font-size: 34px; padding: 12px 14px; }
  .seg { width: auto !important; }
  .seg button { padding: 8px 6px; font-size: 12px; }

  .cobro-body { display: flex !important; flex-direction: column; overflow-y: auto; }
  .cobro-ticket { border-right: 0; border-bottom: 1px solid #E6DCCB; padding: 12px 16px; max-height: 32vh; }
  #cobro-modal .sheet > div:first-child { flex-wrap: wrap; gap: 10px; }
  #cobro-modal .grid-cols-5 > .key { font-size: 14px; }
  #cobro-modal .col-span-3.grid + div { flex-direction: row; }

  #cierre-modal .sheet > div:first-child { flex-wrap: wrap; gap: 10px; }
  #cierre-modal .seg { order: 3; width: 100% !important; }
  .cierre-ef { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  .gasto-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .gasto-form > label.col-span-2 { grid-column: span 2; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .tbl input.cell { width: 80px; }
  #cierre-modal .sheet > div:nth-child(2) { min-height: 0 !important; }
  #cierre-modal .sheet > div:last-child, #recogida-modal .sheet > div:last-child { flex-wrap: wrap; }
  #pin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #pin-screen .px-8 { padding-left: 18px; padding-right: 18px; }
}

/* ═══════ Entradas, cuadre y administración ═══════ */
.badge { display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--amarillo); color: var(--tinta); font-size: 11px; font-weight: 800; }
.btn-alert { border-color: var(--rojo) !important; color: var(--rojo) !important; box-shadow: 0 0 0 3px rgba(212,42,42,.12); }
.cuadre-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; background: #FBF7EF; border: 1px solid #EFE7D9; border-radius: 14px; padding: 14px 18px; }
.cq-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7A6E5F; }
.cq-val { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: 'Bricolage Grotesque', 'IBM Plex Sans', sans-serif; }
.cq-sub { font-size: 12px; color: #7A6E5F; margin-top: 2px; }
#device-screen.hidden { display: none !important; }
#admin { background: var(--crema); }
#admin.hidden { display: none !important; }
#admin:not(.hidden) { display: flex; }
.adm-input { border: 1.5px solid #E6DCCB; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--tinta); font-family: inherit; }
.adm-select { border: 1.5px solid #E6DCCB; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--tinta); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 0; background: #fff; border-bottom: 1px solid #E6DCCB; } /* wrap: en tableta la última pestaña (Configuración) quedaba fuera de la vista sin barra de scroll */
.adm-tab { white-space: nowrap; padding: 10px 16px; font-weight: 700; font-size: 14px; color: #7A6E5F; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.adm-tab.on { color: var(--tinta); border-bottom-color: var(--rojo); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid #E6DCCB; border-radius: 14px; padding: 12px 14px; }
.kpi .k-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7A6E5F; }
.kpi .k-val { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; font-family: 'Bricolage Grotesque', 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; margin-top: 2px; }
.kpi .k-sub { font-size: 12px; color: #7A6E5F; }
.card { background: #fff; border: 1px solid #E6DCCB; border-radius: 14px; overflow: hidden; }
.card-h { padding: 12px 16px; border-bottom: 1px solid #EFE7D9; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-h h3 { font-size: 16px; font-weight: 800; }
.card-h .sub { font-size: 12px; color: #7A6E5F; }
.card .tbl-wrap { overflow-x: auto; }
.card .tbl th { position: sticky; top: 0; background: #fff; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #FBF7EF; }
tr.row-sub td { background: #FBF7EF; font-size: 13px; }
tr.row-sub td:first-child { padding-left: 28px; color: #5F544A; }
.dif-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.heat { display: inline-block; min-width: 64px; text-align: right; padding: 4px 8px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat-ok { background: #E4F0E6; color: #2F6B3F; }
.heat-warn { background: #FBEFD0; color: #8A6512; }
.heat-bad { background: #F8E1DC; color: #9A3423; }
.heat-good { background: #DCE9F7; color: #1F4E82; }
.heat-none { background: #F1EADD; color: #9B8F7E; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid #E6DCCB; }
.backlink { color: var(--rojo); font-weight: 700; font-size: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; margin-left: 0 !important; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .topbar-actions .btn { justify-content: center; padding: 8px 4px; font-size: 12px; }
  .topbar-actions #btn-admin { grid-column: span 4; }
  .topbar-actions #btn-cajero b { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #admin .topbar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #admin .topbar-actions .seg { grid-column: span 2; width: 100% !important; }
  #admin .topbar-actions #adm-sucursal { grid-column: span 2; }
  .adm-tabs { padding: 6px 10px 0; }
  .adm-tab { padding: 8px 10px; font-size: 13px; }
  #adm-main { padding: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .k-val { font-size: 20px; }
  .cuadre-strip { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ent-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ent-form > label.col-span-2 { grid-column: span 2; }
  #app section { padding-top: 8px; }
  .badge { display: none; }
}
@media (max-width: 767px) { #admin .topbar-title { max-width: none; } }

/* ═══════ Configuración editable y reportes ═══════ */
.cfg-table input, .cfg-table select { border: 1px solid #C9B89E; border-radius: 8px; padding: 6px 8px; font-size: 14px; background: #fff; color: var(--tinta); width: 100%; min-width: 70px; }
.cfg-table input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.cfg-table input[type="checkbox"] { width: 18px; height: 18px; min-width: 0; }
.cfg-table td { padding: 6px 8px; }
.cfg-table tr.off td { opacity: .55; }
.cfg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-top: 1px solid #EFE7D9; background: #FBF7EF; }
.cfg-actions .msg { font-size: 13px; color: #7A6E5F; margin-left: auto; }
.rep-filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 12px 16px; border-bottom: 1px solid #EFE7D9; }
.rep-filtros label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #7A6E5F; display: flex; flex-direction: column; gap: 4px; }
.rep-filtros input, .rep-filtros select { border: 1.5px solid #E6DCCB; border-radius: 10px; padding: 8px 10px; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--tinta); background: #fff; }
tr.cancelado td { text-decoration: line-through; color: #9B8F7E; }
tr.cancelado td .motivo { text-decoration: none; display: block; font-size: 11px; color: #9A3423; }
.btn-sm { border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; border: 1.5px solid #E6DCCB; background: #fff; color: var(--tinta); white-space: nowrap; }
.btn-sm.danger { color: #9A3423; border-color: #F3CFCF; background: #FBEAEA; }
.btn-sm.primary { color: #fff; background: var(--rojo); border-color: var(--rojo-oscuro); }
@media (max-width: 767px) { .cfg-table { font-size: 12px; } .rep-filtros { padding: 10px 12px; } }

/* Cierre por dinero vs. por tickets */
.solo-dinero { display: none; }
body.modo-dinero .solo-dinero { display: block; }
body.modo-dinero .flex.solo-dinero { display: flex; }
body.modo-dinero .solo-tickets { display: none !important; }
.fila-tortilla td { background: #FBF7EF; }

/* ═══════ Rediseño: pantalla Hoy, formularios y modales más limpios ═══════ */
.home { background: var(--crema); }
.home-wrap { max-width: 880px; margin: 0 auto; padding: 36px 24px 60px; display: flex; flex-direction: column; gap: 28px; }
.home-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7A6E5F; }
.home-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 4px; }
.home-sub { font-size: 16px; color: #5F544A; }
.home-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-card { text-align: left; background: #fff; border: 1.5px solid #E6DCCB; border-radius: 22px; padding: 22px 24px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; transition: transform .06s, border-color .12s, box-shadow .12s; box-shadow: 0 10px 30px -24px rgba(30,27,24,.35); }
.home-card:active { transform: scale(.985); }
.home-card .hc-lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A6E5F; }
.home-card .hc-val { font-family: 'Bricolage Grotesque', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.home-card .hc-sub { font-size: 14px; color: #6F655B; }
.home-card.small { min-height: 96px; }
.home-card.small .hc-lbl { font-size: 15px; font-weight: 800; letter-spacing: 0; text-transform: none; color: var(--tinta); }
.home-card.alert { border-color: var(--rojo); background: #FFF6F5; }
.home-card.alert .hc-val { color: var(--rojo); }
.home-card.done { border-color: #C9DCC9; background: #F4F9F4; }
.hc-compara { margin: 8px 0 0; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1.5px solid #E6DCCB; font-size: 14px; }
.hc-compara .cmp { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F1EBE0; }
.hc-compara .cmp:last-child { border-bottom: 0; }
.hc-compara .ok { color: #2F6B3F; font-weight: 700; }
.hc-compara .mal { color: var(--rojo); font-weight: 700; }
.hc-compara .pend { color: #7A6E5F; }
.home-card.done .hc-val { color: #2F6B3F; }
#btn-cierre { background: var(--tinta); border-color: var(--tinta); color: #fff; }
#btn-cierre .hc-lbl, #btn-cierre .hc-sub { color: rgba(255,255,255,.7); }
#btn-cierre .hc-val { color: var(--amarillo); }
.home-list { background: #fff; border: 1.5px solid #E6DCCB; border-radius: 22px; overflow: hidden; }
.home-list-h { padding: 14px 22px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A6E5F; border-bottom: 1px solid #EFE7D9; }
.home-list ul { list-style: none; margin: 0; padding: 4px 0; }
.home-list li { display: grid; grid-template-columns: 76px 1fr auto auto; gap: 14px; align-items: baseline; padding: 11px 22px; border-bottom: 1px solid #F3EEE4; font-size: 15px; }
.home-list li:last-child { border-bottom: 0; }
.he-hora { color: #7A6E5F; font-size: 13px; }
.he-que { font-weight: 600; }
.he-cant { font-weight: 800; font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; }
.he-quien { color: #7A6E5F; font-size: 13px; min-width: 60px; text-align: right; }
.he-empty { display: block !important; color: #9B8F7E; text-align: center; padding: 22px !important; }

/* Formularios: etiqueta, número grande, chips */
.f-lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A6E5F; margin-bottom: 8px; }
.f-num { width: 100%; border: 1.5px solid #E6DCCB; border-radius: 14px; padding: 12px 16px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 34px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; background: #fff; color: var(--tinta); }
.f-num:focus { outline: none; border-color: var(--tinta); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid #E6DCCB; background: #fff; color: var(--tinta); border-radius: 999px; padding: 10px 16px; font-size: 15px; font-weight: 600; line-height: 1; transition: background .1s, border-color .1s; }
.chip-btn small { font-size: 11px; color: #7A6E5F; margin-left: 5px; font-weight: 600; }
.chip-btn.on { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip-btn.on small { color: rgba(255,255,255,.6); }
.chip-btn:active { transform: scale(.97); }

/* Modales y tablas más limpias */
.sheet { border-radius: 24px; }
.tile { box-shadow: none; }
.key { box-shadow: none; }
.tbl th { font-size: 10.5px; color: #9B8F7E; }
.tbl input.cell { border-color: #E6DCCB; border-radius: 10px; padding: 8px 10px; font-size: 16px; }
.tbl input.cell:focus { outline: none; border-color: var(--tinta); }
.cuadre-strip { border-radius: 18px; }
.btn-pay { box-shadow: none; }

@media (max-width: 767px) {
  .home-wrap { padding: 20px 16px 40px; gap: 18px; }
  .home-title { font-size: 30px; }
  .home-actions { grid-template-columns: 1fr; gap: 10px; }
  .home-card { min-height: 0; padding: 18px 20px; border-radius: 18px; }
  .home-card .hc-val { font-size: 24px; }
  .home-list li { grid-template-columns: 64px 1fr auto; }
  .he-quien { display: none; }
  .topbar-actions { display: flex !important; justify-content: flex-end; }
  .f-num { font-size: 28px; }
  #pos section { padding-bottom: 150px; }
}
/* ajustes finos celular y jerarquía de botones */
#ent-ok { background: var(--tinta); border-color: var(--tinta); color: #fff; }
@media (max-width: 767px) {
  .topbar { flex-wrap: nowrap; }
  .topbar-actions { width: auto !important; margin-left: auto !important; display: flex !important; grid-template-columns: none; }
  .topbar-actions .btn { padding: 8px 10px; font-size: 13px; }
  .ent-form .grid { grid-template-columns: 1fr !important; }
  .ent-form .grid > label { grid-column: span 1; }
  .ent-form .grid > div { display: flex; gap: 8px; }
  .ent-form .grid > div .chip-btn { flex: 1; text-align: center; }
  .home-list li { grid-template-columns: 82px 1fr auto; padding: 10px 16px; }
  .he-hora { white-space: nowrap; }
}

.home-card.info { cursor: default; }
.env-form { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px; align-items: start; }
.env-form .f-num { font-size: 30px; }
@media (max-width: 900px) { .env-form { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  #admin .topbar { flex-wrap: wrap; gap: 8px 10px; }
  #admin .topbar-sub { display: none; }
  #admin .topbar-actions { width: 100% !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  #admin .topbar-actions #adm-sucursal, #admin .topbar-actions .seg { grid-column: span 2; width: 100% !important; }
}

/* Cierre en dos pasos */
.sob-list { display: flex; flex-direction: column; gap: 8px; }
.sob-row { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; background: #fff; border: 1.5px solid #E6DCCB; border-radius: 16px; padding: 12px 16px; }
.sob-row.dos { grid-template-columns: 1fr 150px 150px; }
.sob-row.tres { grid-template-columns: 1fr 130px 130px 130px; }
.sob-row .sob-name { font-weight: 700; font-size: 16px; }
.sob-row .sob-sub { font-size: 12px; color: #7A6E5F; margin-top: 2px; }
.sob-row .sob-calc { font-size: 12px; color: #2F6B3F; font-weight: 600; margin-top: 2px; }
.sob-row label { display: flex; flex-direction: column; gap: 3px; }
.sob-row label span { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7A6E5F; }
.sob-row input.cell { width: 100%; font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; font-weight: 800; text-align: right; border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.sob-row input.cell:focus { outline: none; border-color: var(--tinta); }
.env-item input.alm-qty { width: 96px; text-align: right; border: 1px solid #C9B89E; border-radius: 8px; padding: 10px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.env-item input.alm-qty:focus { outline: none; border-color: var(--tinta); }
.sob-row input.cell-txt { width: 100%; font-size: 16px; font-weight: 600; border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 12px 10px; }
.sob-row input.cell-txt:focus { outline: none; border-color: var(--tinta); }
.sob-row input.cell.falta { border-color: #D42A2A; background: #FEF2F2; }
.sob-row.tortilla { background: #FBF7EF; border-color: #E3C22A; }
.resultado { background: var(--tinta); color: #fff; border-radius: 20px; padding: 18px 20px; }
.resultado .f-lbl { color: rgba(255,255,255,.7); }
.resultado .res-big { font-family: 'Bricolage Grotesque', sans-serif; font-size: 34px; font-weight: 800; color: var(--amarillo); font-variant-numeric: tabular-nums; }
.resultado .text-slate-600, .resultado .text-slate-500 { color: rgba(255,255,255,.75) !important; }
.resultado .text-green-700 { color: #9BE3A8 !important; } .resultado .text-red-600 { color: #FF8A80 !important; } .resultado .text-blue-700 { color: #9CC7FF !important; } .resultado .text-slate-400 { color: rgba(255,255,255,.5) !important; }
.resultado textarea { color: var(--tinta); }
#gasto-body li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; }
@media (max-width: 767px) {
  .sob-row, .sob-row.dos, .sob-row.tres { grid-template-columns: 1fr 120px; }
  .sob-row.dos label:last-child, .sob-row.tres label { grid-column: 2; }
  .gasto-form { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .gasto-form select, .gasto-form input[type="text"] { grid-column: span 2; }
  #cierre-modal .seg { width: 100% !important; order: 3; }
  #cierre-modal .sheet > div:first-child { flex-wrap: wrap; }
}

/* Hoja de envío */
.env-head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; padding: 16px; border-bottom: 1px solid #EFE7D9; align-items: start; }
.env-head label { display: flex; flex-direction: column; }
.env-list { display: flex; flex-direction: column; }
.env-item { display: grid; grid-template-columns: 1fr 140px auto; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #F3EEE4; }
.env-item:last-child { border-bottom: 0; }
.env-item.con { background: #FBF7EF; }
.env-item .env-name { font-weight: 700; font-size: 16px; }
.env-item .env-unit { font-size: 12px; color: #7A6E5F; }
.env-qty { width: 100%; font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; font-weight: 800; text-align: right; border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 8px 12px; font-variant-numeric: tabular-nums; background: #fff; color: var(--tinta); }
.env-qty:focus { outline: none; border-color: var(--tinta); }
.env-qks { display: flex; gap: 6px; }
.qk { border: 1.5px solid #E6DCCB; background: #fff; color: #5F544A; border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 700; line-height: 1; min-width: 52px; }
.qk:active { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.env-edit-qty { width: 96px; text-align: right; border: 1.5px solid #C9B89E; border-radius: 8px; padding: 6px 8px; font-weight: 700; }
tr.editando td { background: #FBF7EF; }
@media (max-width: 900px) { .env-head { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .env-item { grid-template-columns: 1fr 110px; row-gap: 8px; }
  .env-qks { grid-column: 1 / -1; }
  .qk { flex: 1; text-align: center; }
}

/* Salir siempre en rojo, en todas las vistas */
.btn-salir { background: var(--rojo); color: #fff; border: 1.5px solid var(--rojo-oscuro); font-weight: 800; }
.btn-salir:hover { background: var(--rojo-oscuro); }

/* Fiado por cliente (cierre) y ventas de la matriz */
.sob-row.fiado { grid-template-columns: 1fr; }
.fiado-row { display: grid; grid-template-columns: 1fr 130px auto; gap: 10px; align-items: end; margin-top: 8px; }
.fiado-row input.cell-fiado { width: 100%; font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; font-weight: 800; text-align: right; border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.fiado-row input.cell-fiado:focus, .fiado-row input.cell-txt:focus { outline: none; border-color: var(--tinta); }
.fiado-row .fiado-del { height: 48px; width: 44px; font-size: 20px; }
#fiado-add { margin-top: 10px; }
@media (max-width: 767px) { .fiado-row { grid-template-columns: 1fr 100px auto; } }
.vta-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; border-bottom: 1px solid #EFE7D9; }
.vta-form label { display: flex; flex-direction: column; gap: 4px; }
.vta-form input, .vta-form select { border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 10px 12px; font-size: 16px; font-weight: 600; background: #fff; color: var(--tinta); }
.vta-form input:focus, .vta-form select:focus { outline: none; border-color: var(--tinta); }
.vta-form .ancho { grid-column: 1 / -1; }
@media (max-width: 767px) { .vta-form { grid-template-columns: 1fr; } }

/* ═══════ Reparto · módulo 1 (2026-10-27): ruta del repartidor y Administración › Reparto ═══════ */
.rp-pin span { display: flex; width: 30px; height: 30px; border-radius: 999px; background: var(--rojo); color: #fff; font-weight: 800; font-size: 13px; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(30,27,24,.4); font-family: 'Bricolage Grotesque', sans-serif; }
.rp-pin.ok span { background: #2F6B3F; }
.rp-pin.pend span { background: #9B8F7E; }
.leaflet-container { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; }
.leaflet-popup-content { margin: 10px 14px; line-height: 1.4; }
.leaflet-popup-content a { color: var(--rojo); font-weight: 700; }
#ruta-mapa, #rpt-mapa { height: 260px; border-radius: 18px; border: 1.5px solid #E6DCCB; overflow: hidden; background: #EFE7D9; z-index: 0; }
#rpt-mapa { height: 420px; border-radius: 0; border: 0; border-top: 1px solid #EFE7D9; border-bottom: 1px solid #EFE7D9; }
.rt-barra { height: 8px; border-radius: 999px; background: #E6DCCB; margin-top: 12px; overflow: hidden; max-width: 420px; }
.rt-barra-fill { height: 100%; background: #2F6B3F; border-radius: 999px; transition: width .3s; }
.rt-card { background: #fff; border: 1.5px solid #E6DCCB; border-radius: 22px; overflow: hidden; }
.rt-card-h { padding: 12px 22px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7A6E5F; border-bottom: 1px solid #EFE7D9; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rt-card-h .btn { text-transform: none; letter-spacing: 0; font-size: 13px; padding: 7px 12px; }
.rt-list { list-style: none; margin: 0; padding: 0; }
.rt-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid #F3EEE4; }
.rt-item:last-child { border-bottom: 0; }
.rt-item.sig { background: #FBF7EF; }
.rt-item.ok .rt-name { color: #2F6B3F; }
.rt-num { width: 34px; height: 34px; border-radius: 999px; background: var(--rojo); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-family: 'Bricolage Grotesque', sans-serif; flex: none; }
.rt-num.small { width: 26px; height: 26px; font-size: 12px; background: var(--tinta); }
.rt-item.ok .rt-num { background: #2F6B3F; }
.rt-body { min-width: 0; cursor: pointer; }
.rt-name { font-weight: 700; font-size: 17px; }
.rt-sub { font-size: 13px; color: #7A6E5F; margin-top: 1px; }
.rt-estado { font-size: 13px; color: #7A6E5F; margin-top: 3px; }
.rt-ok { color: #2F6B3F; font-weight: 700; }
.rt-sig { color: var(--rojo); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.rt-aviso { color: #8A6512; }
.rt-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rt-acts .btn { padding: 11px 16px; font-size: 15px; }
.rt-empty { color: #9B8F7E; text-align: center; padding: 26px; }
@media (max-width: 767px) {
  #ruta-mapa { height: 220px; }
  .rt-item { grid-template-columns: 34px 1fr; padding: 12px 14px; }
  .rt-acts { grid-column: 1 / -1; }
  .rt-acts .btn, .rt-acts a { flex: 1; justify-content: center; padding: 13px 10px; }
}
.rpt-filtros { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 16px; align-items: start; }
.rpt-filtros label { display: flex; flex-direction: column; }
@media (max-width: 767px) { .rpt-filtros { grid-template-columns: 1fr; } #rpt-mapa { height: 300px; } }
.rpt-fila { cursor: pointer; }
.rpt-fila:hover td { background: #FBF7EF; }
.rp-ruta-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; }
.rp-ruta-form label { display: flex; flex-direction: column; }
.rp-ruta-form .ancho { grid-column: 1 / -1; }
.rp-ruta-list { list-style: none; margin: 0; padding: 0; }
.rp-ruta-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F3EEE4; }
.rp-ord { display: flex; gap: 4px; }
.rp-ord .btn-sm:disabled { opacity: .35; }
.rp-dia { min-width: 44px; text-align: center; padding: 10px 0; }
@media (max-width: 767px) { .rp-ruta-form { grid-template-columns: 1fr; } }
