/* SupremoPOS · tema "espresso y dorado" */
:root {
  --ink: #17140F; --ink2: #4A443B; --muted: #6E675C; --muted2: #A39A8C;
  --bg: #F6F3EE; --bg2: #FAF8F4; --surface: #FFFFFF; --line: #EAE5DC; --line2: #F2EEE7; --input: #D8D1C5;
  --nav: #14110D; --gold: #B88A44; --gold2: #E6C68C; --goldbg: rgba(214,178,112,0.16);
  --ok: #2F7D5B; --okbg: #E3F2EA; --oktxt: #17573F;
  --warn: #7A3D0A; --warnbg: #FBEBDD; --warn2: #7A4E12; --warnbg2: #F7E9D2;
  --bad: #B42318; --badbg: #FDECEC; --badtxt: #A61B1B;
  --lila: #5B21B6; --lilabg: #EFE9FC;
  --sombra: 0 1px 2px rgba(23,20,15,0.04), 0 8px 24px rgba(23,20,15,0.05);
  --sombra2: 0 18px 50px rgba(23,20,15,0.18);
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; font-size: 15px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 18px; font-weight: 700; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #EBDCC0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.oculto { display: none !important; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.nav { flex: 0 0 76px; background: var(--nav); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; position: sticky; top: 0; height: 100vh; z-index: 60; }
.nav .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #E2C083, #B88A44); color: #14110D; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; box-shadow: 0 4px 14px rgba(184,138,68,0.35); margin: 2px 0 10px; text-decoration: none; }
.nav-item { width: 62px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px; border-radius: 12px; border: 0; background: transparent; color: var(--muted2); text-decoration: none; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #F4EEE3; }
.nav-item.activo { background: var(--goldbg); color: var(--gold2); }
.nav-item svg { width: 22px; height: 22px; }
.nav-grupo { position: relative; }
.nav-flyout { display: none; position: absolute; left: 66px; top: -6px; padding-left: 8px; z-index: 80; }
.nav-grupo:hover .nav-flyout, .nav-grupo:focus-within .nav-flyout { display: block; }
.nav-menu { width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sombra2); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-menu .titulo { padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.nav-menu a { display: flex; flex-direction: column; gap: 1px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.nav-menu a:hover, .nav-menu a.activo { background: var(--bg); }
.nav-menu a b { font-size: 14px; font-weight: 600; }
.nav-menu a span { font-size: 12px; color: var(--muted); }
.nav .abajo { margin-top: auto; }
.columna { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; height: 56px; background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; }
.topbar .centro { flex: 1 1 auto; text-align: center; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .punto { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill.ok { background: #EEF6F1; color: var(--ok); }
.pill.off { background: var(--bg); color: var(--muted); }
.usuario { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: linear-gradient(145deg, #E2C083, #B88A44); color: #14110D; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.menu-usuario { position: absolute; right: 0; top: 46px; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sombra2); padding: 8px; display: flex; flex-direction: column; gap: 2px; z-index: 90; }
.menu-usuario button, .menu-usuario a { text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-decoration: none; font-size: 14px; }
.menu-usuario button:hover, .menu-usuario a:hover { background: var(--bg); }
.pagina { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.encabezado { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.encabezado .kicker { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.encabezado .sub { font-size: 15px; color: var(--muted); line-height: 1.45; max-width: 760px; }
.encabezado > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.fila { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.entre { justify-content: space-between; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* ---------- Piezas ---------- */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sombra); }
.tarjeta.pad { padding: 20px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi .lab { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .det { font-size: 13px; color: var(--muted); }
.kpi.oscuro { background: linear-gradient(150deg, #2A241C, #14110D); color: #F4EEE3; border: 0; box-shadow: 0 14px 40px rgba(20,17,13,0.22); }
.kpi.oscuro .lab { color: #CDBFA7; } .kpi.oscuro .val { color: var(--gold2); } .kpi.oscuro .det { color: var(--muted2); }

.btn { height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; transition: filter .12s, background .12s, box-shadow .12s; }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--ink); color: #fff; box-shadow: 0 8px 20px rgba(23,20,15,0.16); }
.btn.secundario { background: var(--surface); color: var(--ink); border-color: #E2DCD1; }
.btn.exito { background: var(--ok); color: #fff; }
.btn.peligro { background: var(--surface); color: var(--bad); border-color: #F3C2C2; }
.btn.peligro.lleno { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.dorado { background: linear-gradient(180deg, #D2AA66, #B88A44); color: #14110D; }
.btn.chico { height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.grande { height: 58px; font-size: 17px; border-radius: 16px; }
.btn.ancho { width: 100%; }
.btn-icono { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icono.peligro { color: var(--bad); border-color: #F3C2C2; }
.btn-icono svg { width: 17px; height: 17px; }

.chip { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .punto { width: 8px; height: 8px; border-radius: 999px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.segmento { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: #EDE8DF; }
.segmento button { height: 40px; padding: 0 16px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.segmento button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,20,15,0.12); }

.campo { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.campo .ayuda { font-weight: 500; font-size: 12px; color: var(--muted); }
.input { height: 50px; padding: 0 14px; border: 1px solid var(--input); border-radius: 14px; background: var(--surface); font-size: 16px; font-weight: 500; color: var(--ink); width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,138,68,0.18); }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input.grande { height: 60px; font-size: 24px; font-weight: 700; }
.buscador { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-width: 220px; }
.buscador input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: var(--okbg); color: var(--oktxt); }
.tag.warn { background: var(--warnbg); color: var(--warn); }
.tag.bad { background: var(--badbg); color: var(--badtxt); }
.tag.neutro { background: var(--bg); color: var(--ink2); }
.tag.lila { background: var(--lilabg); color: var(--lila); }
.tag.oscuro { background: var(--ink); color: #F4EEE3; }

.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; padding: 12px 16px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.tabla td { padding: 12px 16px; border-bottom: 1px solid var(--line2); font-size: 14px; vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .der { text-align: right; }
.tabla tr.clic { cursor: pointer; } .tabla tr.clic:hover td { background: var(--bg2); }
.scroll-x { overflow-x: auto; }

.vacio { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; }
.error { color: var(--bad); font-weight: 600; font-size: 14px; }
.nota { padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 14px; color: var(--ink2); line-height: 1.5; }
.nota.warn { background: var(--warnbg); color: var(--warn); }
.nota.ok { background: var(--okbg); color: var(--oktxt); }
.nota.bad { background: var(--badbg); color: var(--badtxt); }

/* Ventanas */
.fondo-modal { position: fixed; inset: 0; z-index: 100; background: rgba(20,17,13,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: aparece .15s ease-out; }
.modal { width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,0.3); padding: 24px; display: flex; flex-direction: column; gap: 16px; animation: sube .2s ease-out; }
.modal.ancho { max-width: 760px; }
.modal .cabeza { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal .cabeza h2 { font-size: 22px; }
.cerrar { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.panel-lateral { position: fixed; inset: 0; z-index: 100; background: rgba(20,17,13,0.45); display: flex; justify-content: flex-end; }
.panel-lateral > div { width: 100%; max-width: 480px; height: 100%; overflow-y: auto; background: #FBF9F5; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: -20px 0 60px rgba(0,0,0,0.2); }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,0.25); max-width: calc(100% - 32px); animation: sube .2s ease-out; }
.toast.bad { background: var(--bad); }

.switch { flex: 0 0 52px; width: 52px; height: 30px; border-radius: 999px; border: 0; padding: 3px; cursor: pointer; display: flex; background: #D8D1C5; justify-content: flex-start; transition: background .15s; }
.switch.on { background: var(--ink); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }

.cargando { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--muted); gap: 10px; }
.spinner { width: 20px; height: 20px; border-radius: 999px; border: 2.5px solid var(--line); border-top-color: var(--gold); animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Ingreso / registro ---------- */
.acceso { display: flex; flex-wrap: wrap; min-height: 100vh; }
.acceso aside { flex: 1 1 380px; max-width: 480px; background: radial-gradient(120% 80% at 0% 0%, #2A241C 0%, #14110D 60%); color: #F4EEE3; padding: 44px; display: flex; flex-direction: column; gap: 36px; }
.acceso aside h1 { font-size: 38px; line-height: 1.1; }
.acceso aside p { margin: 0; font-size: 16px; line-height: 1.6; color: #B5AC9E; }
.marca { display: flex; align-items: center; gap: 12px; color: #F4EEE3; text-decoration: none; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.marca .logo { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(145deg, #E2C083, #B88A44); color: #14110D; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.marca em { font-style: normal; color: var(--gold2); }
.acceso main { flex: 999 1 520px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.acceso form { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- POS ---------- */
.pos { display: flex; min-height: calc(100vh - 56px); }
.pos-izq { flex: 1 1 auto; min-width: 0; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.pos-der { flex: 0 0 360px; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 56px; height: calc(100vh - 56px); }
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.prod { position: relative; min-height: 112px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sombra); text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: transform .08s, box-shadow .15s; }
.prod:active { transform: scale(.97); }
.prod.en { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink), 0 8px 24px rgba(23,20,15,0.1); }
.prod.agotado { opacity: .55; }
.prod .cat { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.prod .cat i { width: 7px; height: 7px; border-radius: 999px; }
.prod .nom { font-size: 16px; font-weight: 600; line-height: 1.2; }
.prod .pre { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod .cant { position: absolute; top: 10px; right: 10px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.prod img { width: 100%; height: 86px; object-fit: cover; border-radius: 12px; }
.ticket-items { flex: 1 1 auto; overflow-y: auto; padding: 4px 18px; }
.linea { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.linea .info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.linea .info b { font-weight: 600; font-size: 15px; }
.linea .info span { font-size: 12px; color: var(--muted); }
.paso { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); }
.paso button { width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.paso b { min-width: 22px; text-align: center; font-weight: 700; }
.totales { padding: 16px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.totales .fila-t { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.totales .total-fila { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 16px; color: var(--ink); }
.totales .total-fila span:last-child { font-size: 28px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.metodos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metodo { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.metodo.on { border: 2px solid var(--ink); }

/* ---------- Mesas ---------- */
.mesas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mesa { position: relative; min-height: 120px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sombra); text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.mesa.pide { background: #FBF4E8; border-color: #E4C9A0; }
.mesa.sel { box-shadow: 0 0 0 2px var(--ink), 0 10px 30px rgba(23,20,15,0.12); }
.mesa .t { font-size: 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mesa .t i { width: 10px; height: 10px; border-radius: 999px; margin-top: 5px; flex: 0 0 auto; }

/* ---------- Cocina ---------- */
.kds { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.kds-col { background: #EFEBE3; border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 300px; }
.kds-col h2 { font-size: 16px; display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; }
.comanda { background: var(--surface); border-radius: 16px; border-top: 6px solid var(--ink); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sombra); }
.comanda ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comanda li { display: flex; gap: 10px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.comanda li b { flex: 0 0 34px; color: var(--gold); }

/* ---------- Teléfono ---------- */
@media (max-width: 760px) {
  .app { flex-direction: column-reverse; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .nav .logo, .nav .solo-pc { display: none; }
  .nav-item { width: 58px; flex: 0 0 auto; }
  .nav .abajo { margin-top: 0; }
  .nav-flyout { left: auto; right: 0; top: auto; bottom: 64px; padding: 0 0 8px; }
  .columna { padding-bottom: 76px; }
  .pagina { padding: 18px 16px 40px; }
  .topbar .solo-pc { display: none; }
  .pos { flex-direction: column; }
  .pos-der { position: static; height: auto; flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--line); }
  .productos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mesas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kds { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .acceso aside { display: none; }
}
@media print {
  .nav, .topbar, .no-imprimir { display: none !important; }
  body { background: #fff; }
}

/* Recibo para imprimir (impresora térmica de 80 mm o normal) */
.recibo-print { display: none; }
@media print {
  body * { visibility: hidden; }
  .recibo-print, .recibo-print * { visibility: visible; }
  .recibo-print { display: block; position: absolute; left: 0; top: 0; width: 72mm; padding: 2mm; font-family: 'Courier New', monospace; font-size: 12px; color: #000; }
  @page { margin: 0; }
}
.recibo-print .c { text-align: center; } .recibo-print .f { display: flex; justify-content: space-between; gap: 8px; }
.recibo-print hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
