:root {
  --bg: #0B0A09;
  --surface: #141210;
  --surface-2: #1C1916;
  --surface-3: #25211D;
  --line: #2C2722;
  --line-strong: #3D362F;
  --text: #F4EEE4;
  --muted: #ABA193;
  --faint: #756C60;
  --gold: #D9B86C;
  --gold-2: #F0D9A0;
  --gold-ink: #1E1606;
  --free: #5C544A;
  --busy: #D9B86C;
  --bill: #8FA8FF;
  --alert: #FF6B5E;
  --ok: #7FD1A0;
  --warn: #FFC15E;
  --info: #7FC8E8;
  --wa: #3DDC84;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Jost', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
h1, h2, h3 { font-weight: 500; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; font: 600 20px/1 var(--serif); color: var(--gold); font-style: italic; flex: none; }
.brand-name { font: 500 21px/1 var(--serif); letter-spacing: -.2px; }
.brand-sub { display: block; font: 400 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: radial-gradient(120% 40% at 0 0, rgba(217, 184, 108, .09), transparent 60%), var(--surface); display: flex; flex-direction: column; gap: 24px; overflow-y: auto; }
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--muted); text-decoration: none; position: relative; white-space: nowrap; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--surface-3); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.me-chip .who { font-weight: 500; line-height: 1.2; }
.me-chip .role { font-size: 12px; color: var(--faint); }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--line); background: rgba(11, 10, 9, .86); backdrop-filter: blur(12px); }
.topbar .clock { font: 500 17px/1 var(--sans); font-variant-numeric: tabular-nums; }
.topbar .date { color: var(--faint); font-size: 13px; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 36px) 90px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 500 clamp(28px, 3.2vw, 38px)/1.1 var(--serif); margin: 0; letter-spacing: -.5px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mobile-nav { display: none; }

/* ---------- Componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s; text-decoration: none !important; }
.btn:hover { background: var(--surface-3); border-color: #51483F; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--alert); border-color: rgba(255, 107, 94, .35); background: rgba(255, 107, 94, .06); }
.btn.ok { color: var(--ok); border-color: rgba(127, 209, 160, .35); background: rgba(127, 209, 160, .07); }
.btn.wa { color: var(--wa); border-color: rgba(61, 220, 132, .35); background: rgba(61, 220, 132, .07); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13.5px; border-radius: 9px; }
.btn.lg { min-height: 52px; padding: 12px 22px; font-size: 16.5px; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; padding: 0; }
.btn.sm.icon-btn { width: 32px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.badge.alert { background: var(--alert); color: #2A0703; }
.badge.gold { background: var(--gold); color: var(--gold-ink); }
.badge.ok { background: var(--ok); color: #06200F; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.gold { color: var(--gold); border-color: rgba(217, 184, 108, .4); }
.pill.ok { color: var(--ok); border-color: rgba(127, 209, 160, .35); }
.pill.warn { color: var(--warn); border-color: rgba(255, 193, 94, .35); }
.pill.alert { color: var(--alert); border-color: rgba(255, 107, 94, .4); }
.pill.info { color: var(--info); border-color: rgba(127, 200, 232, .35); }
.pill.bill { color: var(--bill); border-color: rgba(143, 168, 255, .4); }
.pill.wa { color: var(--wa); border-color: rgba(61, 220, 132, .35); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #120F0B; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h2 { font: 500 19px/1.25 var(--serif); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.card h2 .spacer { flex: 1; }
.card h2 small { font: 400 13px var(--sans); color: var(--faint); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.kpi .value { font: 500 28px/1.15 var(--serif); margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi.hl { border-color: rgba(217, 184, 108, .45); background: linear-gradient(160deg, rgba(217, 184, 108, .13), transparent 60%), var(--surface); }
.kpi.bad .value { color: var(--alert); }
.up { color: var(--ok); } .down { color: var(--alert); }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row.link { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.row.link:hover { background: var(--surface-2); }
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 28px 12px; text-align: center; color: var(--faint); }
.note { padding: 12px 14px; border-radius: 12px; background: rgba(217, 184, 108, .08); border: 1px solid rgba(217, 184, 108, .25); color: var(--gold-2); font-size: 14px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { color: var(--text); border-color: #51483F; }
.chip.on { background: var(--text); color: #0B0A09; border-color: var(--text); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 13px; border-radius: 9px; font-size: 13.5px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.bar-track { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: rgba(127, 209, 160, .25); border-color: var(--ok); }
.switch input:checked + span::before { transform: translateX(17px); background: var(--ok); }

/* ---------- Formularios ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full, .check.full { grid-column: 1 / -1; }
.field > span { font-size: 13px; color: var(--muted); }
.field small { color: var(--faint); font-size: 12.5px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 184, 108, .15); }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches input { display: none; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatches input:checked + span { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--surface-2); font-size: 20px; }
.stepper button:hover { background: var(--surface-3); }
.stepper b { min-width: 52px; text-align: center; font: 500 20px var(--sans); font-variant-numeric: tabular-nums; }

/* ---------- Modales y avisos ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(5, 4, 3, .72); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s; }
.modal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal-head h2 { flex: 1; margin: 0; font: 500 22px/1.2 var(--serif); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; padding: 12px 18px; border-radius: 12px; background: var(--text); color: #0B0A09; font-weight: 500; box-shadow: var(--shadow); animation: pop .2s; max-width: calc(100% - 32px); }
.toast.err { background: var(--alert); color: #2A0703; }

/* ---------- Ingreso con PIN ---------- */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(70% 50% at 50% 0, rgba(217, 184, 108, .12), transparent 70%), var(--bg); }
.lock-box { width: min(380px, 100%); text-align: center; }
.lock-box .brand { justify-content: center; margin-bottom: 8px; }
.lock-box .brand-mark { width: 60px; height: 60px; font-size: 32px; }
.lock-title { font: 500 34px/1.1 var(--serif); margin: 18px 0 4px; }
.lock-sub { color: var(--muted); margin: 0 0 26px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 26px; height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 68px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font: 400 26px var(--sans); transition: background .1s; }
.keypad button:hover { background: var(--surface-2); }
.keypad button:active { background: var(--surface-3); }
.keypad button.fn { font-size: 15px; color: var(--muted); background: transparent; border-color: transparent; }
.demo-pins { margin-top: 26px; font-size: 13px; color: var(--faint); line-height: 1.8; }
.demo-pins b { color: var(--muted); font-weight: 500; }

/* ---------- Salón ---------- */
.floor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.floor { position: relative; background: var(--surface) repeating-linear-gradient(0deg, transparent 0 calc(var(--cell) - 1px), rgba(255, 255, 255, .025) calc(var(--cell) - 1px) var(--cell)), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.floor-grid { position: relative; width: 100%; aspect-ratio: 12 / 8; }
.tbl-el { position: absolute; padding: 4px; }
.tbl-el .t { width: 100%; height: 100%; border-radius: 18px; border: 1.5px solid var(--line-strong); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; cursor: pointer; position: relative; transition: transform .12s, border-color .15s, box-shadow .15s; padding: 6px; }
.tbl-el .t:hover { transform: translateY(-2px); }
.tbl-el.round .t { border-radius: 50%; }
.tbl-el.stool .t { border-radius: 50%; }
.tbl-el .t .n { font: 500 clamp(15px, 1.7vw, 22px)/1 var(--serif); }
.tbl-el .t .i { font-size: 11.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.tbl-el .t .w { position: absolute; top: -7px; right: -7px; }
.tbl-el .t .w .avatar { box-shadow: 0 0 0 2px var(--surface); }
.tbl-el.round .t .w, .tbl-el.stool .t .w { top: 4%; right: 4%; }
.tbl-el.s-busy .t { border-color: var(--busy); background: linear-gradient(160deg, rgba(217, 184, 108, .2), rgba(217, 184, 108, .05)); }
.tbl-el.s-bill .t { border-color: var(--bill); background: linear-gradient(160deg, rgba(143, 168, 255, .22), rgba(143, 168, 255, .05)); }
.tbl-el.s-res .t { border-style: dashed; border-color: var(--info); }
.tbl-el.s-alert .t { border-color: var(--alert); background: linear-gradient(160deg, rgba(255, 107, 94, .25), rgba(255, 107, 94, .06)); animation: pulse 1.6s infinite; }
.tbl-el.dim { opacity: .28; }
.tbl-el .flag { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); display: flex; gap: 3px; }
.tbl-el .flag span { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--alert); color: #2A0703; font-weight: 600; white-space: nowrap; }
.tbl-el .flag span.r { background: var(--ok); color: #06200F; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 107, 94, .18); } }
.floor.editing .tbl-el { cursor: grab; }
.floor.editing .tbl-el .t { border-style: dashed; }
.floor.editing .tbl-el.drag { z-index: 5; opacity: .85; cursor: grabbing; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; border: 1.5px solid; }
.waiter-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 11px; cursor: pointer; }
.waiter-row:hover, .waiter-row.on { background: var(--surface-2); }
.waiter-row .stats { font-size: 12.5px; color: var(--muted); }

/* ---------- Comanda ---------- */
.order-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.menu-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { text-align: left; padding: 12px 13px; min-height: 92px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, background .15s, transform .08s; position: relative; }
.tile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tile:active { transform: scale(.97); }
.tile .nm { font-weight: 500; line-height: 1.25; font-size: 14.5px; }
.tile .pr { margin-top: auto; color: var(--gold); font-variant-numeric: tabular-nums; font-size: 14px; }
.tile.off { opacity: .4; pointer-events: none; }
.tile .off-tag { position: absolute; top: 8px; right: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--alert); }
.tile .cnt { position: absolute; top: 8px; right: 8px; }
.ticket { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.ticket-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ticket-head h2 { margin: 0; font: 500 24px/1.1 var(--serif); display: flex; align-items: center; gap: 10px; }
.ticket-head .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13.5px; margin-top: 8px; align-items: center; }
.ticket-body { padding: 6px 18px; overflow-y: auto; flex: 1; }
.ticket-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin: 14px 0 4px; display: flex; align-items: center; gap: 8px; }
.ticket-sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.line { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.line .q { min-width: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.line .nm { font-weight: 450; line-height: 1.3; }
.line .nt { font-size: 12.5px; color: var(--warn); }
.line .st { font-size: 12px; margin-top: 3px; }
.line .pr { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.void .nm, .line.void .pr { text-decoration: line-through; color: var(--faint); }
.line .acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.ticket-foot { border-top: 1px solid var(--line); padding: 14px 18px 16px; }
.tot { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 2px 0; font-variant-numeric: tabular-nums; }
.tot.big { font: 500 24px/1.3 var(--serif); color: var(--text); margin-top: 6px; }
.tot.due { color: var(--gold); font-weight: 500; }
.ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ticket-actions .full { grid-column: 1 / -1; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Cocina ---------- */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-top: 5px solid var(--ok); }
.kt.mid { border-top-color: var(--warn); }
.kt.late { border-top-color: var(--alert); }
.kt-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 8px; }
.kt-head .where { font: 500 22px/1.1 var(--serif); }
.kt-head .who { font-size: 12.5px; color: var(--muted); }
.kt-head .time { margin-left: auto; font: 600 20px/1 var(--sans); font-variant-numeric: tabular-nums; }
.kt.late .time { color: var(--alert); }
.kt.mid .time { color: var(--warn); }
.kt-items { padding: 0 8px 8px; }
.kt-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 8px; border-radius: 10px; cursor: pointer; width: 100%; text-align: left; border: 0; background: transparent; }
.kt-item:hover { background: var(--surface-2); }
.kt-item .q { font: 600 17px/1.2 var(--sans); min-width: 24px; }
.kt-item .nm { font-size: 16px; line-height: 1.3; }
.kt-item .nt { font-size: 13px; color: var(--warn); }
.kt-item.done { opacity: .45; }
.kt-item.done .nm { text-decoration: line-through; }
.kt-item .ck { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.kt-item.done .ck { background: var(--ok); border-color: var(--ok); color: #06200F; }
.kt-course { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 8px 8px 2px; }
.kt-foot { padding: 0 14px 14px; }
.ready-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.ready-card { flex: none; min-width: 200px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(127, 209, 160, .4); background: rgba(127, 209, 160, .07); }
body.fullscreen-kds .side, body.fullscreen-kds .topbar, body.fullscreen-kds .mobile-nav { display: none; }
body.fullscreen-kds .shell { grid-template-columns: 1fr; }

/* ---------- Pedidos (tablero) ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.col h3 { margin: 2px 4px 12px; font: 500 16px var(--sans); display: flex; align-items: center; gap: 8px; }
.oc { background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.oc:hover { border-color: var(--line-strong); }
.oc .top { display: flex; align-items: center; gap: 8px; }
.oc .top b { font: 500 17px var(--serif); }
.oc .items { font-size: 13px; color: var(--muted); margin: 6px 0 8px; line-height: 1.45; }
.oc .bottom { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- WhatsApp ---------- */
.wa-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 210px); min-height: 480px; background: var(--surface); }
.wa-list { border-right: 1px solid var(--line); overflow-y: auto; }
.wa-conv { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wa-conv:hover, .wa-conv.on { background: var(--surface-2); }
.wa-conv .nm { font-weight: 500; }
.wa-conv .pv { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conv .tm { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.wa-chat { display: flex; flex-direction: column; min-width: 0; }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(circle at 20% 10%, rgba(61, 220, 132, .04), transparent 40%), var(--bg); }
.bubble { max-width: 74%; padding: 9px 13px 6px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.bubble.in { background: var(--surface-2); align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { background: #17392A; align-self: flex-end; border-top-right-radius: 4px; }
.bubble .tm { display: block; font-size: 11px; color: var(--faint); text-align: right; margin-top: 3px; }
.wa-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.wa-compose textarea { min-height: 44px; max-height: 140px; }
.wa-quick { display: flex; gap: 6px; padding: 10px 12px 0; flex-wrap: wrap; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--gold); }
.chart .bar.dim { fill: var(--gold); opacity: .38; }
.chart .grid-l { stroke: var(--line); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 14px; }
.hbar .bar-track { grid-column: 1 / -1; margin-bottom: 8px; }

/* ---------- Impresión ---------- */
#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; background: #fff; font: 12px/1.4 'Courier New', monospace; width: 72mm; margin: 0 auto; }
  #print h1 { font: 700 16px/1.2 'Courier New', monospace; text-align: center; margin: 0; }
  #print .c { text-align: center; }
  #print hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #print .l { display: flex; justify-content: space-between; gap: 8px; }
  #print .b { font-weight: 700; }
  #print .qr-sheet { width: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10mm; }
  #print.sheet { width: auto; font-family: Georgia, serif; }
  #print .qr-card { border: 1px solid #000; border-radius: 4mm; padding: 6mm; text-align: center; break-inside: avoid; }
  #print .qr-card img, #print .qr-card svg { width: 40mm; height: 40mm; }
  body { background: #fff; }
  @page { margin: 6mm; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .order-wrap { grid-template-columns: minmax(0, 1fr) 350px; }
  .floor-wrap { grid-template-columns: 1fr; }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(20, 18, 16, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); overflow-x: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .mobile-nav a { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 10px; color: var(--muted); font-size: 11px; text-decoration: none; position: relative; white-space: nowrap; }
  .mobile-nav a.on { color: var(--gold); background: var(--surface-2); }
  .mobile-nav a svg { width: 21px; height: 21px; }
  .mobile-nav .badge { position: absolute; top: 1px; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .order-wrap { grid-template-columns: 1fr; }
  .ticket { position: static; max-height: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .wa-wrap { grid-template-columns: 1fr; height: auto; }
  .wa-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wa-msgs { min-height: 360px; }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
  .form { grid-template-columns: 1fr; }
  .topbar .date { display: none; }
}
@media (max-width: 560px) {
  .main { padding-top: 18px; }
  .floor { padding: 6px; }
  .tbl-el { padding: 2px; }
  .tbl-el .t .i { display: none; }
  .tbl-el .t { border-radius: 12px; }
  .kpi .value { font-size: 23px; }
  .menu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.oc .top b { white-space: nowrap; }
.wa-chat-head > .grow { min-width: 150px; }
.wa-chat-head b { white-space: nowrap; }
