/* Prexia POS · sistema de diseño "SaaS moderno cálido" */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #f8fafc;
  --bg-soft: #eef2ff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --brand: #6366f1;
  --brand-2: #4f46e5;
  --brand-soft: #eef2ff;
  --accent: #8b5cf6;
  --accent-soft: #f5f3ff;
  --ok: #10b981;
  --ok-soft: #ecfdf5;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --danger: #f43f5e;
  --danger-soft: #fff1f2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(99, 102, 241, .05), 0 10px 30px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, .16);
  --font: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { display: none; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 100% -10%, #eef2ff 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #f5f3ff 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, table { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-family: "Outfit", var(--font); font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.hint { color: var(--muted); font-size: 12px; text-align: center; }
.spacer { flex: 1; }
.mobile-only { display: none !important; }
.shift-short { display: none; }
.side-foot form .btn { width: 100%; justify-content: flex-start; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px 16px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-right: 1px solid var(--border); backdrop-filter: blur(10px); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, #6366f1, #4338ca); color: #fff; font-weight: 800;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 3px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; padding: 2px; }
.tab {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  color: var(--ink-2); padding: 10px 12px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.tab:hover { background: var(--bg-soft); color: var(--ink); }
.tab.selected { background: var(--brand-soft); color: var(--brand-2); font-weight: 700; }
.tab.selected .ico { stroke-width: 2; }
.side-foot { margin-top: auto; padding-top: 14px; display: grid; gap: 8px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; text-transform: uppercase; }
.who-wrap { display: flex; flex-direction: column; min-width: 0; }
.who-wrap b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-wrap small { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.tablink { color: var(--muted); font-size: 12px; text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.tablink:hover { color: var(--brand-2); background: var(--bg-soft); }
.side-foot .btn { min-height: 38px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 26px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(12px);
}
.page-head { display: flex; flex-direction: column; min-width: 0; }
.page-head h1 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .badge { white-space: nowrap; }
.who { color: var(--muted); font-size: 12px; }
.views { padding: 24px 26px 40px; flex: 1; }
.views > main { max-width: 1280px; margin: 0 auto; width: 100%; }
.views > main[hidden] { display: none !important; }
.views > main:not([hidden]) { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(99, 102, 241, .22); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.big { min-height: 50px; font-size: 15px; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.chip {
  min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer;
}
.chip.selected { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, white); color: var(--brand-2); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .received input, .pin {
  min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 12px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500;
  width: 100%; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .received input:focus, .pin:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; accent-color: var(--brand); }
select { background-image: none; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap;
}
.badge.ok, .badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }

/* ---------- dashboard ---------- */
.dashboard { display: flex; flex-direction: column; gap: 18px; }
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #4338ca 0%, #6366f1 55%, #8b5cf6 100%);
  color: #fff; border-radius: calc(var(--radius) + 6px); padding: 26px 28px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h2 { font-size: 26px; margin: 2px 0 4px; letter-spacing: -.03em; }
.hero .muted { color: rgba(255,255,255,.78); }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 700; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.hero .btn.primary { background: #fff; color: var(--brand-2); border-color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow);
}
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 22px; letter-spacing: -.03em; }
.kpi small { color: var(--muted); font-size: 11.5px; }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 8px; }
.chart.empty { display: block; height: auto; padding: 10px 0 4px; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar {
  width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; min-height: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); transition: height .3s;
}
.chart .bar.zero { background: var(--bg-soft); }
.chart .bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart .bar-value { font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-list .empty { padding: 10px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.mini-row:last-child { border-bottom: 0; }
.mini-row .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .meta { color: var(--muted); font-size: 11.5px; }
.mini-row .val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- vender ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.catalog, .ticket, .credit-view, .tables-view { min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.item {
  border: 1px solid var(--border); background: var(--surface); border-radius: 13px; padding: 12px;
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 92px;
  transition: border-color .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(35,32,28,.03);
}
.item:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); box-shadow: var(--shadow); }
.item:active { transform: scale(.99); }
.item .name { font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.item .meta { color: var(--muted); font-size: 11px; }
.item .price { color: var(--brand-2); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: auto; }
.ticket { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: sticky; top: 78px; }
.lines { display: flex; flex-direction: column; gap: 8px; min-height: 80px; margin-bottom: 12px; }
.line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.line .icon-btn { width: 30px; height: 30px; flex: 0 0 auto; }
.line .icon-btn .ico { width: 14px; height: 14px; }
#dashMethods:empty { display: none; }
.line .lname { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.line .lmeta { color: var(--muted); font-size: 11.5px; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.totals { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; }
.totals .grand { font-size: 16px; font-weight: 700; color: var(--ink-2); padding-top: 6px; }
.totals .grand b { font-size: 27px; color: var(--ink); letter-spacing: -.03em; }
.pay { display: flex; flex-direction: column; gap: 10px; }
.methods { display: flex; gap: 6px; flex-wrap: wrap; }
.methods .chip { flex: 1 1 44%; }
.received { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.customer-pick { display: flex; gap: 8px; align-items: flex-end; }
.customer-pick label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.customer-pick select { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.report { margin-top: 12px; color: var(--muted); font-size: 11.5px; text-align: center; }

/* ---------- listas y tablas ---------- */
.credit-summary { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.credit-list { display: flex; flex-direction: column; gap: 8px; }
.credit-row { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 1px 2px rgba(35,32,28,.03); }
.cinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cname { font-weight: 700; font-size: 13.5px; }
.cmeta { color: var(--muted); font-size: 12px; }
.cphone { color: var(--muted); font-size: 11.5px; }
.cbar { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; max-width: 260px; }
.cbar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.acts, .aactions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.credit-row .btn { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.inv-wrap { overflow-x: auto; max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.inv-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.inv-table th, .inv-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.inv-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-table td.r, .r { text-align: right; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.rep-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.rep-card h4 { margin-bottom: 10px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.rep-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.rep-row:last-child { border-bottom: 0; }
.rep-big { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.rep-card .field { margin-top: 8px; }

/* ---------- mesas / habitaciones ---------- */
.tables-view { display: flex; flex-direction: column; gap: 14px; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.table-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; box-shadow: var(--shadow); min-height: 118px;
}
.table-card:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.table-card.occupied { background: linear-gradient(180deg, #fff7ed, #fffdf9); border-color: #f3d3b3; }
.tname { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.tseats, .tstate { color: var(--muted); font-size: 12px; }
.ttotal { margin-top: auto; font-weight: 800; color: var(--brand-2); }

/* ---------- diálogos ---------- */
dialog {
  border: 0; border-radius: 20px; padding: 22px; width: min(560px, 92vw);
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink);
  margin: auto;
}
dialog::backdrop { background: rgba(28, 25, 22, .45); backdrop-filter: blur(2px); }
dialog h3 { margin-bottom: 14px; }
dialog .field + .field, dialog .row2 + .row2, dialog .row2 + .field, dialog .field + .row2 { margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.receipt-dialog { width: min(420px, 94vw); }
.receipt { font-family: "SFMono-Regular", ui-monospace, Consolas, monospace; font-size: 12.5px; }
.receipt h3 { text-align: center; margin: 0 0 4px; }
.receipt table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt td { padding: 4px 0; }
.receipt .r { text-align: right; }
.receipt .grand td { font-weight: 800; border-top: 1px dashed var(--border-strong); padding-top: 8px; }

/* ---------- avisos ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #23201c; color: #fff; padding: 11px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 100; max-width: min(440px, 90vw); font-size: 13px;
}
.toast.error { background: var(--danger); }
.offline-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 26px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px;
  border-bottom: 1px solid #f3d3a8;
}
.offline-bar .btn { min-height: 34px; padding: 5px 10px; font-size: 12px; }

/* ---------- onboarding ---------- */
.setup-body { padding-bottom: 40px; }
.setup { max-width: 1080px; margin: 0 auto; padding: 34px 22px; }
.setup h1 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.035em; margin-bottom: 8px; }
.setup > .muted { max-width: 640px; margin-bottom: 22px; }
.verticals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.vertical { cursor: pointer; position: relative; }
.vertical input { position: absolute; opacity: 0; pointer-events: none; }
.vbody {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px; height: 100%; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.vertical:hover .vbody { border-color: var(--border-strong); }
.vertical input:checked + .vbody { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.vname { font-weight: 800; font-size: 16px; }
.vtag { color: var(--muted); font-size: 12.5px; }
.vmods { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.setup-actions { display: flex; align-items: flex-end; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.setup-actions .field { flex: 1; min-width: 240px; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 560px at 10% 5%, #e0e7ff 0%, transparent 55%),
    radial-gradient(700px 500px at 92% 92%, #f5f3ff 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%); background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: 24px; padding: 30px 26px;
  box-shadow: var(--shadow-lg); text-align: center; backdrop-filter: blur(12px);
}
.logo { font-size: 26px; font-weight: 900; letter-spacing: -.04em; margin-bottom: 6px; }
.logo::before { content: "P"; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, #6366f1, #4338ca); color: #fff; font-size: 18px; margin-right: 8px; vertical-align: -7px; }
.login-card .muted { font-size: 13px; margin-bottom: 18px; }
.login-form { display: grid; gap: 10px; }
.login-form .pin { text-align: center; font-size: 26px; letter-spacing: .35em; padding-left: .35em; height: 58px; }
.login-form .btn { min-height: 48px; }
.login-card .hint { margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    border-right: 0; border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 95%, transparent); z-index: 60;
  }
  .sidebar .brand, .side-foot { display: none; }
  .tabs { flex-direction: row; overflow-x: auto; gap: 2px; padding: 0; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; flex-direction: column; gap: 3px; width: auto; min-width: 62px; padding: 7px 9px; font-size: 10px; border-radius: 10px; text-align: center; }
  .tab .ico { width: 21px; height: 21px; }
  .main-col { padding-bottom: 72px; }
  .topbar { padding: 10px 14px; }
  .page-head h1 { font-size: 17px; }
  .topbar .badge { display: none; }
  .topbar form.mobile-only { display: none !important; }
  .shift-long { display: none; }
  .shift-short { display: inline; }
  .topbar #btnShift { min-height: 38px; padding: 6px 10px; font-size: 12px; }
  .mobile-only { display: inline-flex !important; }
  .topbar .brand.mobile-only { display: none !important; }
  .page-head p { max-width: 46vw; }
  .views { padding: 16px 14px 30px; }
  .layout { grid-template-columns: 1fr; }
  .ticket { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero h2 { font-size: 23px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; }
  .kpi strong { font-size: 18px; }
  .chart { height: 160px; gap: 6px; }
  .chart .bar-value { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .credit-row { flex-wrap: wrap; }
  .acts { width: 100%; justify-content: flex-start; }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .section-head { align-items: flex-start; }
  .section-head .agenda-tools { width: 100%; justify-content: stretch; }
  .section-head .agenda-tools input { flex: 1; max-width: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .methods .chip { flex: 1 1 45%; }
  .topbar .who { display: none; }
  .hero-actions .btn { flex: 1; }
}

/* ---------- impresión y utilidades ---------- */
@media print {
  .sidebar, .topbar, .tabs, .offline-bar, .toast, .no-print, .pay, .section-head .btn { display: none !important; }
  .shell, .main-col { display: block; }
  .views { padding: 0; }
  body { background: #fff; }
  dialog[open] { position: static; box-shadow: none; width: 100%; }
}

/* ---------- agenda ---------- */
.agenda-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.agenda-tools input { min-width: 0; max-width: 260px; }
.agenda-tools input[type="date"] {
  min-height: 42px; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 10px; background: var(--surface); font-weight: 600;
}
.agenda-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.agenda-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.agenda-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.agenda-head b { display: block; font-size: 14px; }
.agenda-head small { display: block; color: var(--muted); font-size: 11.5px; }
.appt { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.appt.done { opacity: .6; }
.ahead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atime { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.aname { font-weight: 700; font-size: 13.5px; }
.aservice { color: var(--muted); font-size: 12px; }
.aactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.aactions .btn { min-height: 38px; padding: 6px 10px; font-size: 12px; }
.slots { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 6px; }
.slots-label { width: 100%; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.slot-free { min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--brand-2); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.slot-free .ico { width: 14px; height: 14px; }
.slot-free span { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.slot-free:hover { background: var(--brand-soft); border-color: var(--brand); }

/* ---------- mesas: badges ---------- */
.thead { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; }
.tbadge { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.tbadge.free { background: var(--ok-soft); color: var(--ok); }
.tbadge.busy { background: var(--warn-soft); color: var(--warn); }
.thint { margin-top: auto; color: var(--brand-2); font-size: 11.5px; font-weight: 700; }

/* ---------- iconografía y densidad v5 ---------- */
.kpis .kpi { flex-direction: row; align-items: flex-start; gap: 12px; padding: 18px; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.kpi-icon .ico { width: 21px; height: 21px; }
.tint-teal { background: var(--brand-soft); color: var(--brand-2); }
.tint-amber { background: var(--warn-soft); color: var(--warn); }
.tint-blue { background: #eef2ff; color: #4338ca; }
.tint-rose { background: var(--danger-soft); color: var(--danger); }
.kpi > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi strong { font-size: 21px; }
.span2 { grid-column: span 2; }
.card-head h3 { display: inline-flex; align-items: center; gap: 7px; }
.card-head h3 .ico { width: 17px; height: 17px; color: var(--brand-2); }
.card-head .btn { min-height: 36px; padding: 5px 10px; font-size: 12px; gap: 5px; }
.method-strip { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; margin-top: 14px; border-top: 1px dashed var(--border); }
.method-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--ink-2); }
.method-pill b { font-variant-numeric: tabular-nums; }
.method-pill .ico { width: 15px; height: 15px; color: var(--brand-2); }
.recent-table { display: flex; flex-direction: column; }
.recent-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.2fr; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.recent-row:last-child { border-bottom: 0; }
.recent-row .rc-ticket { font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-row .muted { font-size: 12px; }
.recent-row .total { text-align: right; font-weight: 800; }
.recent-row .pill { justify-self: start; }

.catalog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 11px; padding: 0 10px; min-height: 44px; flex: 1 1 220px; max-width: 340px; }
.search .ico { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search input { border: 0; background: transparent; outline: none; min-height: 42px; padding: 0; flex: 1; font-size: 13.5px; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.select { min-height: 44px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); padding: 8px 10px; font-weight: 600; font-size: 13px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip { min-height: 38px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cat-chip.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chip .count { opacity: .7; font-size: 11px; }

.item { padding: 14px; gap: 8px; position: relative; }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.item .name { font-size: 13.5px; font-weight: 700; }
.item .meta { font-size: 11px; color: var(--muted); }
.item .price { font-size: 15px; }
.item .add { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--brand-2); opacity: .85; }
.item:hover .add { background: var(--brand); color: #fff; border-color: var(--brand); }
.item .add .ico { width: 15px; height: 15px; }
.stock-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.stock-badge.ok { background: var(--ok-soft); color: var(--ok); }
.stock-badge.low { background: var(--warn-soft); color: var(--warn); }
.stock-badge.out { background: var(--danger-soft); color: var(--danger); }

.prod-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.prod-avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.prod-meta { font-size: 11px; color: var(--muted); }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); display: inline-grid; place-items: center; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-2); }
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #23201c; color: #fff; padding: 4px 7px; border-radius: 6px; font-size: 10.5px; white-space: nowrap; z-index: 5; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.margin-badge { font-size: 11px; font-weight: 700; color: var(--muted); }
.inv-table tbody tr:hover { background: var(--surface-2); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 12px; text-align: center; }
.empty-state .empty-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.empty-state .empty-ico .ico { width: 21px; height: 21px; }
.empty-state b { font-size: 13.5px; }
.empty-state span { color: var(--muted); font-size: 12px; max-width: 280px; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.settings-grid .rep-card h4 { display: flex; align-items: center; gap: 7px; }
.settings-grid .rep-card h4 .ico { width: 16px; height: 16px; color: var(--brand-2); }

.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.rep-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.rep-kpi .kpi-icon { width: 38px; height: 38px; }
.rep-kpi small { color: var(--muted); font-size: 11px; display: block; }
.rep-kpi b { font-size: 19px; letter-spacing: -.02em; }
.rep-card.span2 { grid-column: span 2; }
.bar-line { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin: 2px 0 8px; }
.bar-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }
.chart.card { padding-bottom: 12px; }
.chart-grid { position: relative; }
.chart-grid::before { content: ""; position: absolute; inset: 0 0 26px; background: repeating-linear-gradient(to top, var(--border) 0 1px, transparent 1px 25%); pointer-events: none; opacity: .5; }

@media (max-width: 960px) {
  .span2 { grid-column: span 1; }
  .recent-row { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .recent-row .muted { display: none; }
  .kpi strong { font-size: 18px; }
  .kpi-icon { width: 36px; height: 36px; }
  .catalog-tools { gap: 6px; }
  .search { flex: 1 1 100%; max-width: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .rep-card.span2 { grid-column: span 1; }
  .prod-cell { min-width: 150px; }
}

/* ---------- inventario móvil y KDS ---------- */
.inv-cards { display: none; flex-direction: column; gap: 8px; }
.inv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.inv-card .top { display: flex; align-items: center; gap: 10px; }
.inv-card .name { font-weight: 700; font-size: 13.5px; }
.inv-card .meta { color: var(--muted); font-size: 11.5px; }
.inv-card .stats { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.inv-card .stats b { font-variant-numeric: tabular-nums; }
.inv-card .row-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 2px; }
.methods .chip .ico { width: 15px; height: 15px; }
#cartCount { vertical-align: middle; font-size: 11px; }

.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kds-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 13px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.kds-card.late { border-left-color: var(--danger); background: linear-gradient(180deg, #fff8f7, var(--surface)); }
.kds-card .khead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kds-card .ktable { font-weight: 800; font-size: 15px; }
.kds-card .kname { font-size: 13px; color: var(--ink-2); }
.kds-card .kfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.kds-card .btn { min-height: 38px; padding: 6px 10px; font-size: 12px; }
.kds-card .kmeta { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.kds-card.late .kmeta { color: var(--danger); font-weight: 700; }

@media (max-width: 960px) {
  .inv-wrap { display: none; }
  .inv-cards { display: flex; }
}

.dash-grid .card.span2 .empty-state { flex-direction: row; justify-content: center; align-items: center; gap: 12px; padding: 20px; text-align: left; }
.dash-grid .card.span2 .empty-state span { max-width: 420px; }

.credit-row.risky { border-color: #f2c7c2; background: linear-gradient(180deg, #fff8f7, var(--surface)); }
.credit-summary .rep-kpis { margin-bottom: 12px; }
.credit-summary .chips-row { margin-bottom: 12px; }
.room-card { min-height: 132px; }
.room-card .room-guest { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.room-card .room-guest .ico, .room-card .tbadge .ico { width: 14px; height: 14px; }
.tbadge.soon { background: var(--warn-soft); color: var(--warn); }
#roomsSummary .chips-row { margin-top: 10px; }
#patientsSummary .catalog-tools { margin-top: 10px; }
.credit-row .row-actions { align-items: center; }
.credit-row .row-actions b { font-variant-numeric: tabular-nums; }

/* ---------- layout de módulos con panel lateral ---------- */
.module-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; position: sticky; top: 78px; }
.side-card h4 { display: flex; align-items: center; gap: 7px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-card h4 .ico { width: 15px; height: 15px; color: var(--brand-2); }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.side-row:last-child { border-bottom: 0; }
.side-row .muted { font-size: 11px; }
.side-cta { margin-top: 4px; width: 100%; }
.big-total { font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.pay-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.btn.primary.big { min-height: 56px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.mobile-only-sm { display: none; }
@media (max-width: 960px) {
  .module-split { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .inv-card .icon-btn { width: 44px; height: 44px; }
}

/* ---------- mobile-first y densidad v7 ---------- */
.mobile-cart-bar { display: none; }
@media (max-width: 960px) {
  .mobile-cart-bar { position: fixed; left: 10px; right: 10px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--brand-2); color: #fff; padding: 10px 12px; border-radius: 14px; box-shadow: 0 14px 30px rgba(11,93,86,.35); }
  .mobile-cart-bar[hidden] { display: none; }
  .mobile-cart-bar small { display: block; color: rgba(255,255,255,.75); font-size: 11px; }
  .mobile-cart-bar b { font-size: 15px; }
  .mobile-cart-bar .btn { background: #fff; color: var(--brand-2); border-color: #fff; min-height: 44px; font-weight: 800; }
  .icon-btn.labeled { min-width: 44px; min-height: 44px; }
}
.icon-btn.labeled { width: auto; padding: 0 8px; gap: 5px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; }
.icon-btn.labeled .ico { width: 15px; height: 15px; }
.room-card.free { border-top: 3px solid var(--ok); }
.room-card.occupied { border-top: 3px solid var(--warn); background: linear-gradient(180deg, #fff7ed, var(--surface)); }
.room-card.cleaning { border-top: 3px solid var(--danger); background: linear-gradient(180deg, #fdf2f2, var(--surface)); }
.kds-card .kbar { height: 5px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.kds-card .kbar span { display: block; height: 100%; background: var(--ok); }
.kds-card.warm .kbar span { background: var(--warn); }
.kds-card.late .kbar span { background: var(--danger); }
.kds-card .kname { font-weight: 600; }
.kds-card .prio { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.kds-card.warm .prio { color: var(--warn); }
.kds-card.late .prio { color: var(--danger); }
.settings-nav { margin-bottom: 12px; }
.settings-nav .cat-chip { min-height: 36px; }
.credit-row .stock-badge { margin-left: 6px; }
.topbar #btnShift { background: var(--surface); border-color: var(--border-strong); font-weight: 700; }
.topbar #btnShift .ico { width: 16px; height: 16px; color: var(--brand-2); }
.dash-grid .card.span2 .empty-state .row-actions { margin-left: auto; flex-wrap: wrap; }

/* ---------- v8: ajustes en acordeón, móvil compacto ---------- */
.set-sec summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set-sec summary::-webkit-details-marker { display: none; }
.set-sec summary::after { content: "▾"; color: var(--muted); font-size: 13px; transition: transform .15s; }
.set-sec[open] summary::after { transform: rotate(180deg); }
.set-sec summary h4 { margin: 0; flex: 1; }
.set-body { padding-top: 10px; }
.kds-card.late { background: linear-gradient(180deg, #fdecea, #fffdf9); }
.kds-card.warm { background: linear-gradient(180deg, #fdf5e6, #fffdf9); }
.kds-card .khead .stock-badge.out { background: var(--danger); color: #fff; }
@media (max-width: 960px) {
  .grid { gap: 8px; }
  .item { min-height: 76px; padding: 10px; gap: 3px; }
  .item-avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
  .item .meta { display: none; }
  .item .price { font-size: 13.5px; }
  .item .add { width: 28px; height: 28px; right: 8px; bottom: 8px; }
  .item .stock-badge { font-size: 9.5px; padding: 1px 5px; }
}

/* ---------- panel de plataforma ---------- */
.admin-body { background: var(--bg); }
.admin-head { display: flex; align-items: center; gap: 12px; padding: 14px 26px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-brand b { display: block; font-size: 16px; }
.admin-brand small { display: block; color: var(--muted); font-size: 11px; }
.admin-wrap { max-width: 1280px; margin: 0 auto; padding: 26px 22px 50px; display: flex; flex-direction: column; gap: 16px; }
.admin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-hero h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; margin: 2px 0 4px; }
.admin-hero .eyebrow { color: var(--brand-2); }
.admin-hero .muted { color: var(--muted); }
.admin-chart .chart { height: 210px; }
.admin-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; align-items: start; }
.admin-grid .card.span2 { grid-column: span 2; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th, .admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.admin-table th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-table td.r, .admin-table th.r { text-align: right; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .btn { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.log-row:last-child { border-bottom: 0; }
.log-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: 0 0 auto; }
.log-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.log-main span { color: var(--muted); font-size: 11.5px; }
.log-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.kpi-icon { font-size: 19px; }
@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .card.span2 { grid-column: span 1; }
  .admin-head { padding: 10px 14px; flex-wrap: wrap; }
  .admin-wrap { padding: 16px 14px 40px; }
}
.imp-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; background: #fff4e5; color: #7a3d00; border-bottom: 1px solid #f0d2a6; font-size: 12.5px; }
.imp-bar b { color: #5a2d00; }
.imp-bar .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; background: #fff; }

/* ---------- v9: jerarquía de catálogo y ajustes por sección ---------- */
.item-groups { display: flex; flex-direction: column; gap: 16px; }
.item-group .group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.item-group .group-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-grid { grid-template-columns: minmax(0, 720px); }
.settings-grid .rep-card[hidden] { display: none; }
.inv-card { padding: 10px; gap: 5px; }
.inv-card .stats { gap: 10px; font-size: 11.5px; }
.inv-card .row-actions .icon-btn { width: 40px; height: 40px; }
@media (max-width: 960px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- v10: KDS por urgencia y cabecera de ajustes ---------- */
.kds-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kds-col { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface-2); min-height: 120px; }
.kds-colhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.kds-colhead b { font-size: 13px; }
.kds-colhead span { color: var(--muted); font-size: 11px; }
.kds-col.late { border-color: #f0c2bd; background: #fff8f7; }
.kds-col.warm { border-color: #f0d9b5; background: #fffaf2; }
.kds-col.ok { border-color: #cfe6dc; background: #f8fcfa; }
.settings-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, #ffffff, #eef2ff); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.settings-hero h3 { font-size: 20px; letter-spacing: -.02em; margin: 2px 0 2px; }
.settings-hero .eyebrow { color: var(--brand-2); }
.settings-hero .chips-row { justify-content: flex-end; }
.set-desc { font-size: 12px; margin: 4px 0 10px; }
@media (max-width: 860px) {
  .kds-columns { grid-template-columns: 1fr; }
  .settings-hero { align-items: flex-start; }
  .settings-hero .chips-row { justify-content: flex-start; }
}
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin: 14px 0 8px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pin-box summary { cursor: pointer; color: var(--brand-2); font-size: 12.5px; font-weight: 600; text-align: center; }
.pin-box[open] summary { margin-bottom: 8px; }
.pin-box .login-form { margin-top: 6px; }
.register-card { text-align: left; max-height: 92vh; overflow-y: auto; }
.register-card .logo { text-align: center; }
.login-card .hint a { color: var(--brand-2); font-weight: 700; }
.demo-hint { font-size: 11px; line-height: 1.6; }
.invite-title { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.invite-result { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.invite-result .field { flex: 1; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.invite-row:last-child { border-bottom: 0; }
.invite-row .btn { min-height: 34px; padding: 4px 10px; font-size: 11.5px; }

/* ---------- autenticación Prexia ---------- */
.auth-body { margin: 0; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr 1fr; background: var(--bg); }
.auth-aside {
  position: relative; overflow: hidden; color: #fff; padding: 44px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #312e81 0%, #4f46e5 52%, #6366f1 100%);
}
.auth-aside::before, .auth-aside::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-aside::before { width: 420px; height: 420px; right: -160px; top: -120px; }
.auth-aside::after { width: 280px; height: 280px; left: -80px; bottom: -100px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 19px; position: relative; z-index: 1; }
.auth-logo .brand-mark { background: rgba(255,255,255,.16); box-shadow: none; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-copy .eyebrow { color: rgba(255,255,255,.72); }
.auth-copy h1 { color: #fff; font-size: clamp(32px, 4vw, 46px); line-height: 1.03; letter-spacing: -.04em; margin: 10px 0 14px; }
.auth-lead { color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.55; max-width: 430px; }
.auth-bullets { display: grid; gap: 12px; margin: 24px 0; }
.auth-bullet { display: flex; gap: 11px; align-items: flex-start; color: rgba(255,255,255,.85); font-size: 13px; line-height: 1.45; }
.auth-bullet span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.16); font-weight: 800; flex: 0 0 auto; }
.auth-bullet b { color: #fff; font-size: 13.5px; }
.auth-preview { margin-top: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 14px 16px; backdrop-filter: blur(8px); max-width: 400px; }
.ap-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: rgba(255,255,255,.8); padding: 5px 0; }
.ap-row b { color: #fff; font-size: 17px; letter-spacing: -.02em; }
.ap-bars { display: flex; align-items: flex-end; gap: 8px; height: 58px; padding: 10px 0; }
.ap-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.45)); }
.auth-foot { color: rgba(255,255,255,.62); font-size: 11.5px; position: relative; z-index: 1; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 34px 28px; }
.auth-card { width: min(430px, 100%); }
.auth-card-wide { width: min(520px, 100%); }
.auth-card h2 { font-size: 30px; letter-spacing: -.035em; margin: 4px 0 6px; }
.auth-card .eyebrow { color: var(--brand-2); }
.auth-sub { font-size: 13px; margin-bottom: 18px; }
.auth-fields { display: grid; gap: 11px; }
.auth-fields .btn.primary { min-height: 50px; font-size: 15px; margin-top: 4px; }
.auth-switch { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--brand-2); font-weight: 700; }
.auth-demo { margin-top: 14px; text-align: center; font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; line-height: 1.6; }
.auth-card .error { margin-bottom: 10px; }
.auth-card .pin { height: 52px; }
.invite-preview { max-width: 320px; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 22px 20px; min-height: auto; }
  .auth-copy h1 { font-size: 27px; margin: 6px 0 8px; }
  .auth-lead { font-size: 13px; }
  .auth-bullets, .auth-foot { display: none; }
  .auth-preview { display: block; max-width: none; margin-top: 12px; padding: 10px 12px; }
  .ap-bars { height: 40px; }
  .auth-main { padding: 22px 16px 40px; place-items: start center; }
  .auth-card { width: 100%; }
  .auth-card-wide { width: 100%; }
  .auth-card h2 { font-size: 24px; }
}

.auth-trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.auth-trust span { font-size: 10.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 8px; border-radius: 999px; }
.auth-quote { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; font-size: 12.5px; color: var(--ink-2); }
.auth-quote cite { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-style: normal; }
.kds-columns.cols-1 { grid-template-columns: minmax(0, 1fr); }
.kds-columns.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-map { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.room-map .rm { flex: 1 1 80px; min-width: 64px; height: 38px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.room-map .rm.free { background: var(--ok); }
.room-map .rm.occupied { background: var(--warn); }
.room-map .rm.cleaning { background: var(--danger); }

.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-cash .chip { flex: 1 1 22%; min-height: 38px; padding: 6px 8px; font-size: 11.5px; }
.settings-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.quick-tile { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); cursor: pointer; }
.quick-tile:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick-tile .qico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); font-size: 16px; flex: 0 0 auto; }
.quick-tile b { display: block; font-size: 12.5px; }
.quick-tile small { display: block; color: var(--muted); font-size: 10.5px; }

/* ---------- ajustes maestros-detalle y acciones móviles ---------- */
.settings-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-layout .settings-nav { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.set-group { display: flex; flex-direction: column; gap: 2px; }
.set-group > span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; }
.set-link { text-align: left; border: 0; background: transparent; padding: 10px 10px; min-height: 42px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.set-link:hover { background: var(--surface-2); }
.set-link.selected { background: var(--brand-soft); color: var(--brand-2); }
.settings-layout .settings-grid { grid-template-columns: minmax(0, 720px); }
.inv-card .row-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.inv-card .row-actions .icon-btn { width: 100%; height: 44px; }
.auth-watermark { position: absolute; right: -20px; bottom: -70px; font-family: "Outfit", sans-serif; font-size: 320px; font-weight: 800; color: rgba(255,255,255,.05); line-height: 1; pointer-events: none; z-index: 0; }
@media (max-width: 960px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-layout .settings-nav { position: static; }
  .inv-card .row-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- ficha de tienda (plataforma) ---------- */
.store-modal { width: min(920px, 94vw); padding: 22px; }
.sm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sm-head h2 { font-size: 24px; letter-spacing: -.03em; }
.sm-head .eyebrow { color: var(--brand-2); }
.sm-head .btn { font-size: 20px; line-height: 1; }
.sm-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 16px; }
.sm-grid h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.sm-grid .chart { height: 170px; }
.sm-gap { margin-top: 14px; }
.store-modal .rep-kpis { margin-bottom: 4px; }
.store-modal .rep-kpi { padding: 10px 12px; gap: 0; }
.store-modal .rep-kpi b { font-size: 17px; }
@media (max-width: 760px) {
  .sm-grid { grid-template-columns: 1fr; }
}

/* ---------- consola de plataforma en secciones ---------- */
.admin-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.admin-nav { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); display: flex; flex-direction: column; gap: 4px; padding: 20px 12px; background: var(--surface); border-right: 1px solid var(--border); }
.admin-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.admin-link span { width: 18px; text-align: center; color: var(--muted); }
.admin-link b { margin-left: auto; font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; color: var(--muted); }
.admin-link:hover { background: var(--surface-2); }
.admin-link.selected { background: var(--brand-soft); color: var(--brand-2); }
.admin-link.selected span { color: var(--brand-2); }
.admin-navfoot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.admin-navfoot .muted { font-size: 11px; line-height: 1.5; }
.admin-main { min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 26px 50px; }
.admin-section { display: flex; flex-direction: column; gap: 16px; }
.admin-section[hidden] { display: none; }
.admin-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-title h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
.admin-title .eyebrow { color: var(--brand-2); }
.admin-title .muted { color: var(--muted); }
.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-toolbar .search { flex: 1 1 300px; max-width: 430px; }
.admin-toolbar .select { min-width: 170px; }
.admin-grid { grid-template-columns: 1fr 1fr; }
.admin-table .btn + .btn { margin-left: 6px; }
.admin-chart .chart { height: 200px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 10px; gap: 2px; }
  .admin-link { width: auto; flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
  .admin-link b, .admin-navfoot { display: none; }
  .admin-main { padding: 16px 14px 40px; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* ---------- v11: acciones compactas, alertas y carrito vacío ---------- */
.more-actions { position: relative; }
.more-actions summary { list-style: none; }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions .more-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); }
.alert-row + .alert-row { margin-top: 6px; }
.alert-row.warn { border-color: #f0d9b5; background: #fffaf2; }
.alert-row.danger { border-color: #f3c9ce; background: #fff7f8; }
.alert-row .alert-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--warn-soft); color: var(--warn); }
.alert-row.danger .alert-ico { background: var(--danger-soft); color: var(--danger); }
.alert-main { flex: 1; min-width: 0; display: grid; }
.alert-main b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-main small { color: var(--muted); font-size: 10.5px; }
.empty-state.compact { padding: 14px; }
.empty-steps { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; justify-content: center; }
.empty-steps span { font-size: 11px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 9px; border-radius: 999px; }
.empty-steps b { color: var(--brand-2); }
.suggest-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.suggest-row small { width: 100%; color: var(--muted); font-size: 10.5px; }
.suggest-row .chip { font-size: 11px; min-height: 40px; }

/* ---------- v12: densidad de inventario y estados vacíos ---------- */
#invTable th, #invTable td { padding: 7px 9px; font-size: 12.5px; }
#invTable .prod-avatar { width: 26px; height: 26px; font-size: 11px; }
#invTable .prod-meta { font-size: 10.5px; }
.empty-state { padding: 26px 20px; border: 1px dashed var(--border-strong); border-radius: 16px; background: radial-gradient(circle at 50% 0%, var(--brand-soft), transparent 65%); }
.empty-state .empty-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; place-items: center; }
.empty-state b { font-size: 14px; }
.empty-state .row-actions { justify-content: center; }
.auth-note { margin: 4px 0 0; text-align: center; font-size: 10.5px; color: var(--muted); }

/* ---------- v13: lotes por vencer y huéspedes ---------- */
.lot-alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid #f3d6b0; background: #fffaf2; }
.lot-alert[hidden] { display: none; }
.lot-alert-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: 0 0 auto; }
.lot-alert div { flex: 1; display: grid; }
.lot-alert b { font-size: 12.5px; }
.lot-alert span { font-size: 11px; color: var(--muted); }
.room-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); font-size: 10px; font-weight: 800; margin-right: 4px; }

/* ---------- v14: cuenta móvil como hoja y reportes interactivos ---------- */
.only-mobile { display: none; }
.mc-actions { display: flex; gap: 6px; }
.chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; margin-top: 8px; flex-wrap: wrap; }
.chart-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 5px; }
.bar-click { cursor: pointer; border-radius: 8px; }
.bar-click:hover .bar, .bar-click:focus .bar { filter: brightness(1.08); }
.report-day { font-size: 11.5px; margin-top: 6px; }
.settings-grid .rep-card { padding: 20px; border-top: 3px solid var(--brand-soft); }
.settings-grid .rep-card h4 { font-size: 16px; }
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  #viewSell .ticket {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, .28);
    transform: translateY(105%); transition: transform .25s ease;
    margin: 0; padding-bottom: 18px;
  }
  #viewSell .ticket.sheet-open { transform: translateY(0); }
  .mobile-cart-bar { z-index: 80; }
}

/* ---------- v15: acciones etiquetadas, checklist y KDS vacío ---------- */
.inv-card .row-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.btn.mini { min-height: 42px; padding: 6px 8px; font-size: 11.5px; gap: 6px; border: 1px solid var(--border); background: var(--surface); }
.btn.mini span { white-space: nowrap; }
.more-actions .more-list .btn.mini { min-width: 130px; justify-content: flex-start; }
.kds-empty { display: grid; place-items: center; gap: 2px; padding: 18px 10px; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.kds-empty .ico { width: 22px; height: 22px; color: var(--ok); }
.kds-empty b { font-size: 12px; color: var(--ink-2); }
.kds-empty span { font-size: 10.5px; }
.setup-progress { padding: 10px 12px; background: var(--brand-soft); border-radius: 12px; margin-bottom: 12px; }
.setup-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.setup-head b { font-size: 15px; color: var(--brand-2); }
.setup-head span { font-size: 10.5px; color: var(--muted); }
.setup-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.setup-check { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.setup-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.setup-check.ok .setup-dot { background: var(--ok-soft); color: var(--ok); }
.setup-check b { display: block; font-size: 11.5px; }
.setup-check small { color: var(--muted); font-size: 10px; }
.setup-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setup-facts div { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; display: grid; }
.setup-facts small { color: var(--muted); font-size: 10px; }
.setup-facts b { font-size: 12px; }
@media (max-width: 480px) { .setup-checks { grid-template-columns: 1fr; } }

/* ---------- topbar móvil: sucursal dentro del viewport ---------- */
@media (max-width: 900px) {
  .topbar { gap: 6px; }
  .topbar .page-head { min-width: 0; }
  .topbar .page-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.more-actions:not([open]) .more-list { display: none; }

/* ---------- v16: densidad móvil, mesas y reportes ---------- */
.inv-card { padding: 12px; }
.inv-card .row-actions { gap: 10px; }
.inv-card .row-actions .btn.mini { min-height: 48px; font-size: 12px; }
.inv-card .row-actions .icon-btn { height: 44px; }
.tmins { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.tmins .ico { width: 13px; height: 13px; }
#tablesGrid .table-card { min-height: 118px; padding: 12px; }
.mini-table { margin-top: 12px; max-height: 210px; overflow: auto; }
.mini-table table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.mini-table td { padding: 6px 8px; border-bottom: 1px dashed var(--border); }
@media (max-width: 900px) {
  .dashboard .chart { height: 150px; }
  .auth-fields { gap: 9px; }
  .auth-card h2 { margin-bottom: 2px; }
}

/* ---------- feedback e IA ---------- */
.wide-dialog { width: min(820px, 94vw); }
textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; background: var(--surface); color: var(--ink); }
.ai-previews { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ai-previews img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.ai-rows { display: grid; gap: 8px; max-height: 42vh; overflow: auto; margin-top: 8px; }
.ai-row { display: grid; grid-template-columns: 26px 1.5fr 1fr .8fr .8fr .8fr .8fr 30px; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.ai-row input, .ai-row select { min-height: 34px; padding: 4px 6px; font-size: 11.5px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); width: 100%; }
.ai-row .ai-name { font-weight: 700; }
.ai-row .rm { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 16px; }
.ai-row-head { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 8px; display: grid; grid-template-columns: 26px 1.5fr 1fr .8fr .8fr .8fr .8fr 30px; gap: 6px; }
@media (max-width: 720px) {
  .ai-row, .ai-row-head { grid-template-columns: 26px 1.4fr 1fr .8fr; }
  .ai-row .ai-hide-sm { display: none; }
}

/* ---------- feedback en plataforma ---------- */
.feedback-list { display: grid; gap: 10px; }
.feedback-card { padding: 14px; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.feedback-card.bug { border-left-color: var(--danger); }
.feedback-card.request { border-left-color: var(--warn); }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.fb-head b { font-size: 13px; }
.feedback-card p { margin: 10px 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.fb-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-foot .btn { min-height: 34px; padding: 4px 10px; font-size: 11px; }
.help-fab { display: none; }
@media (max-width: 900px) {
  .help-fab { display: grid; place-items: center; position: fixed; right: 14px; bottom: 78px; z-index: 75; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--brand-2); font-weight: 800; box-shadow: var(--shadow-lg); cursor: pointer; }
}
.side-foot .tablink { min-height: 38px; display: inline-flex; align-items: center; }

/* ---------- asistente IA ---------- */
.assistant-fab { position: fixed; right: 18px; bottom: 18px; z-index: 82; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--brand); background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; font-size: 12.5px; box-shadow: 0 10px 26px rgba(99, 102, 241, .32); cursor: pointer; }
.assistant-panel { position: fixed; right: 18px; bottom: 74px; z-index: 90; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 23, 42, .3); overflow: hidden; }
.assistant-panel[hidden] { display: none; }
.assistant-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: linear-gradient(135deg, #4338ca, #6366f1); color: #fff; }
.assistant-head b { display: block; font-size: 14px; }
.assistant-head small { opacity: .8; font-size: 10.5px; }
.assistant-head .btn { color: #fff; font-size: 20px; line-height: 1; }
.assistant-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 88%; padding: 9px 11px; border-radius: 13px; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: var(--warn-soft); color: var(--ink-2); font-size: 11px; }
.msg .pending-card { margin-top: 8px; padding: 10px; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand-soft); }
.msg .pending-card b { display: block; font-size: 11.5px; color: var(--brand-2); margin-bottom: 4px; }
.msg .pending-card .row-actions { margin-top: 8px; }
.assistant-suggest { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; border-top: 1px solid var(--border); }
.assistant-suggest button { flex: 0 0 auto; font-size: 10.5px; padding: 5px 9px; min-height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.assistant-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.assistant-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 110px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 11px; font: inherit; font-size: 12.5px; }
.assistant-form .btn { min-height: 42px; }
.assistant-note { margin: 0; padding: 0 12px 10px; font-size: 10px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .assistant-fab { bottom: 78px; right: 14px; padding: 0 12px; }
  .assistant-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 84vh; border-radius: 18px 18px 0 0; }
  .help-fab { bottom: 132px; }
}

/* ---------- diseñador de salón / mesas ---------- */
.table-editor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 12px; font-size: 12px; }
.table-editor-bar label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.table-editor-bar select, .table-editor-bar input[type=range] { min-height: 34px; }
.floor-plan { position: relative; width: 100%; min-height: 360px; height: min(58vh, 560px); background: repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(99,102,241,.06) 40px), repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(99,102,241,.06) 40px), var(--surface-2); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.floor-plan.design { border-style: dashed; border-color: var(--brand); cursor: crosshair; }
.floor-table { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 2px solid var(--border-strong); background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); padding: 4px; z-index: 2; }
.floor-table.shape-round { border-radius: 50%; }
.floor-table.shape-square { border-radius: 12px; }
.floor-table.shape-rect { border-radius: 12px; }
.floor-table.shape-bar { border-radius: 10px; background: #f5f3ff; border-color: var(--accent); }
.floor-table.occupied { background: #fff7ed; border-color: var(--warn); }
.floor-table.free { background: #ecfdf5; border-color: var(--ok); }
.floor-table.selected { outline: 3px solid var(--brand); outline-offset: 3px; z-index: 5; }
.floor-table small { font-size: 9px; font-weight: 600; color: var(--muted); }
.floor-table .ft-total { font-size: 10px; color: var(--brand-2); }
.floor-plan-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }
@media (max-width: 900px) {
  .floor-plan { min-height: 300px; height: 52vh; }
  .table-editor-bar { gap: 6px; }
}

/* ---------- habitaciones: tablero ordenado ---------- */
.rooms-summary { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.rooms-summary .rep-kpis { margin: 0; }
.rooms-summary .room-map { margin-top: 4px; }
.room-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.room-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.room-legend .dot.free { background: var(--ok); }
.room-legend .dot.occupied { background: var(--warn); }
.room-legend .dot.cleaning { background: var(--danger); }
.room-card { min-height: 168px; padding: 14px; justify-content: flex-start; gap: 6px; border-width: 1px; }
.room-card.free { border-color: #bfe8d7; }
.room-card.occupied { border-color: #f1d3a8; }
.room-card.cleaning { border-color: #f2c4c9; }
.room-top { display: flex; align-items: center; gap: 7px; width: 100%; }
.room-top b { font-size: 16px; letter-spacing: -.02em; }
.room-top .tbadge { margin-left: auto; }
.room-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.room-card.occupied .room-dot { background: var(--warn); }
.room-card.cleaning .room-dot { background: var(--danger); }
.room-type { font-size: 11px; color: var(--muted); }
.room-guest { display: flex; align-items: center; gap: 8px; width: 100%; margin: 4px 0; }
.room-guest b { display: block; font-size: 12.5px; text-align: left; }
.room-guest small { display: block; font-size: 10px; color: var(--muted); text-align: left; }
.room-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.room-card .ttotal { margin-top: auto; align-self: flex-start; }
.room-card .thint { margin-top: 2px; }

/* ---------- mesas con sillas y habitaciones parejas ---------- */
.floor-table { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible; }
.floor-table .table-surface { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 100%; height: 100%; padding: 4px; border: 2px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); }
.floor-table.shape-round .table-surface { border-radius: 50%; }
.floor-table.shape-square .table-surface, .floor-table.shape-rect .table-surface { border-radius: 12px; }
.floor-table.shape-bar .table-surface { border-radius: 10px; background: #f5f3ff; border-color: var(--accent); }
.floor-table.occupied .table-surface { background: #fff7ed; border-color: var(--warn); }
.floor-table.free .table-surface { background: #ecfdf5; border-color: var(--ok); }
.floor-table.selected .table-surface { outline: 3px solid var(--brand); outline-offset: 3px; }
.floor-table .chairs { position: absolute; inset: -10px; z-index: 1; pointer-events: none; }
.floor-table .chairs i { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; border: 2px solid var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.15); }
.floor-table .chairs.c4 i:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.floor-table .chairs.c4 i:nth-child(2) { bottom: 0; left: 50%; transform: translateX(-50%); }
.floor-table .chairs.c4 i:nth-child(3) { left: 0; top: 50%; transform: translateY(-50%); }
.floor-table .chairs.c4 i:nth-child(4) { right: 0; top: 50%; transform: translateY(-50%); }
.floor-table .chairs.c6 i:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.floor-table .chairs.c6 i:nth-child(2) { bottom: 0; left: 50%; transform: translateX(-50%); }
.floor-table .chairs.c6 i:nth-child(3) { left: 0; top: 25%; }
.floor-table .chairs.c6 i:nth-child(4) { left: 0; top: 65%; }
.floor-table .chairs.c6 i:nth-child(5) { right: 0; top: 25%; }
.floor-table .chairs.c6 i:nth-child(6) { right: 0; top: 65%; }
.floor-table.shape-bar .chairs i:nth-child(1), .floor-table.shape-bar .chairs i:nth-child(2) { display: none; }
.room-card { min-height: 185px; }
.room-card.free .thint { margin-top: auto; }
.room-card .room-type { margin-bottom: 4px; }
.floor-table.free, .floor-table.occupied, .floor-table.shape-bar { background: transparent; border-color: transparent; }
.floor-table .chairs i { width: 14px; height: 14px; background: #94a3b8; border-color: #fff; }

/* ---------- v17: auditoría UX ---------- */
.agenda-summary { margin-bottom: 12px; }
.agenda-summary .rep-kpis { margin: 0; }
.kline { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--border); font-size: 12px; }
.kline:first-of-type { border-top: 0; }
.kline .btn { min-height: 40px; padding: 4px 10px; font-size: 11px; }
.korder { font-size: 10.5px; color: var(--muted); margin: 4px 0; }
.kds-columns.cols-1, .kds-columns.cols-2 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) {
  .kds-columns.cols-1, .kds-columns.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .kds-card .kline .btn { min-height: 44px; }
  .floor-plan.design { min-width: 720px; }
  .tables-view { overflow-x: auto; }
  .floor-plan.design .floor-table { touch-action: none; }
}
.rooms-summary .rep-kpi b { font-variant-numeric: tabular-nums; }
:root { --ok-ink: #0f766e; --warn-ink: #b45309; --danger-ink: #be123c; }
.stock-badge.ok { color: var(--ok-ink); }
.stock-badge.low { color: var(--warn-ink); }
.stock-badge.out { color: var(--danger-ink); }
.room-map .rm { color: #0f172a; }
@media (min-width: 861px) {
  .kds-columns.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.room-top .stock-badge.out { margin-left: 2px; }
.room-card.maintenance { border-color: var(--border-strong); background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 8px, #eef2f7 8px, #eef2f7 16px); }
.room-card.maintenance .room-dot { background: var(--muted); }
.lot-badge { display: inline-flex; align-self: flex-start; font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); }
.lot-badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.lot-badge.soon { background: #eef2ff; color: #4338ca; }
.lot-badge.out { background: var(--danger-soft); color: var(--danger-ink); }
.item.expired { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.item.expired .add { display: none; }

/* ---------- FAB del asistente siempre visible ---------- */
.assistant-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 130;
  display: inline-flex !important; visibility: visible !important; opacity: 1 !important;
  align-items: center; gap: 8px; min-height: 56px; padding: 0 20px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #6366f1);
  color: #fff; font-weight: 800; font-size: 13.5px; letter-spacing: -.01em;
  box-shadow: 0 14px 34px rgba(79, 70, 229, .42), 0 0 0 6px rgba(99,102,241,.12);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.assistant-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(79,70,229,.5); }
.assistant-fab .ico { width: 22px; height: 22px; }
.assistant-fab::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
@media (max-width: 900px) {
  .assistant-fab { right: 14px; bottom: 86px; min-height: 54px; padding: 0 15px; font-size: 12px; }
  .assistant-fab .ico { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .assistant-fab { padding: 0 13px; font-size: 0; gap: 0; }
  .assistant-fab .ico { width: 24px; height: 24px; }
  .assistant-fab::after { display: none; }
}

#sec-ai .admin-table th, #sec-ai .admin-table td { white-space: nowrap; }
#sec-ai .admin-grid { grid-template-columns: 1.15fr .85fr; }

/* ---------- selector de sucursal (topbar) ---------- */
.branch-switch { min-width: 0; display: flex; }
.branch-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 5px 10px 5px 11px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: border-color .15s, background .15s, box-shadow .15s;
}
.branch-btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong)); background: var(--surface-2); }
.branch-btn:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.branch-btn > .ico { width: 17px; height: 17px; color: var(--brand-2); }
.branch-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.branch-cap { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.branch-txt b { font-size: 12.5px; font-weight: 700; max-width: 138px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.branch-btn[aria-expanded="true"] .branch-chev { transform: rotate(180deg); }
.branch-btn[aria-disabled="true"] { cursor: default; background: var(--surface-2); }
.branch-btn[aria-disabled="true"]:hover { border-color: var(--border-strong); background: var(--surface-2); }
.branch-btn.is-fixed .branch-chev { display: none; }
.branch-btn.is-fixed > .ico { color: var(--muted); }
.branch-dialog { width: min(440px, 94vw); }
.branch-help { margin-bottom: 14px; font-size: 12.5px; }
.branch-options { display: grid; gap: 8px; }
.branch-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 56px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.branch-opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.branch-opt:focus-visible { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.branch-opt[aria-current="true"] { border-color: color-mix(in srgb, var(--brand) 45%, white); background: var(--brand-soft); }
.branch-opt .bo-ico { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--bg-soft); color: var(--brand-2); }
.branch-opt[aria-current="true"] .bo-ico { background: var(--surface); }
.branch-opt .bo-ico .ico { width: 17px; height: 17px; }
.branch-opt .bo-txt { display: flex; flex-direction: column; min-width: 0; }
.branch-opt .bo-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-opt .bo-txt small { font-size: 11px; color: var(--muted); }
.branch-opt .bo-check { margin-left: auto; width: 20px; height: 20px; color: var(--brand-2); opacity: 0; }
.branch-opt[aria-current="true"] .bo-check { opacity: 1; }
.branch-cart-note { margin-top: 12px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); font-size: 12px; }
@media (max-width: 960px) {
  .branch-btn { min-height: 44px; padding: 5px 9px; gap: 7px; max-width: 46vw; }
  .branch-cap { display: none; }
  .branch-txt { min-width: 0; overflow: hidden; }
  .branch-txt b { max-width: 100%; font-size: 12px; }
  .branch-chev { width: 13px; height: 13px; flex: 0 0 auto; }
}
@media (max-width: 400px) {
  .branch-btn { max-width: 44vw; gap: 6px; }
}

/* El título de la vista vive en el topbar sticky: no se repite en el contenido. */
.dup-title { display: none !important; }
.rep-row span small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.rep-row .diff { font-size: 12px; }
.rep-row .diff.ok { color: var(--ok); }
.rep-row .diff.warn { color: var(--warn); }
.rep-row .diff.danger { color: var(--danger); }

/* Cualquier select fuera de .field/.select hereda el control del sistema. */
select {
  min-height: 44px; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; outline: none;
}
select:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- v19: salón con datos y comandas de cocina ---------- */
.mod-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.mod-stat {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow);
}
.mod-stat div { display: flex; flex-direction: column; min-width: 0; }
.mod-stat small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.mod-stat b { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mod-stat div > span { font-size: 11px; color: var(--muted); }

.module-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.seg-btn {
  min-height: 36px; padding: 6px 13px; border: 0; background: transparent; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.seg-btn.selected { background: var(--surface); color: var(--brand-2); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.floor-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.floor-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.floor-legend .dot.free { background: var(--ok); }
.floor-legend .dot.busy { background: var(--warn); }
.floor-legend .dot.billing { background: var(--danger); }

.tables-list { display: flex; flex-direction: column; gap: 16px; }
.zone-block { display: flex; flex-direction: column; gap: 9px; }
.zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px; }
.zone-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.zone-head span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.table-card { position: relative; gap: 5px; min-height: 132px; border-width: 1px; }
.table-card.free { background: var(--surface); border-color: #d5e9e1; }
.table-card.busy { background: linear-gradient(180deg, #fff7ed, #fffdf9); border-color: #f3d3b3; }
.table-card.billing {
  background: linear-gradient(180deg, #fff1f2, #fffdfd); border-color: #f2c4c9;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, .08), var(--shadow);
}
.table-card:hover { transform: translateY(-1px); }
.tbadge.free { background: var(--ok-soft); color: var(--ok); }
.tbadge.busy { background: var(--warn-soft); color: var(--warn); }
.tbadge.billing { background: var(--danger-soft); color: var(--danger); }
.tprogress { display: block; width: 100%; height: 4px; border-radius: 999px; background: rgba(15, 23, 42, .07); overflow: hidden; }
.tprogress i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.table-card.billing .tprogress i { background: var(--danger); }
.tmeta { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tmeta .ico { width: 13px; height: 13px; }
.tmeta.warn { color: color-mix(in srgb, var(--warn) 78%, var(--ink)); font-weight: 600; }
.tempty { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.table-card .ttotal { margin-top: auto; }

.floor-table .table-surface { padding: 5px 6px; gap: 1px; }
.floor-table .ft-name { font-size: 11.5px; font-weight: 800; letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.floor-table small { font-size: 9.5px; font-weight: 700; color: var(--muted); }
.floor-table .ft-time {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  background: var(--surface); color: var(--warn); border: 1px solid #f3d3b3; white-space: nowrap;
}
.floor-table.busy .table-surface { background: #fff7ed; border-color: var(--warn); }
.floor-table.billing .table-surface { background: #fff1f2; border-color: var(--danger); box-shadow: 0 0 0 4px rgba(244, 63, 94, .1); }
.floor-table.billing .ft-time { color: var(--danger); border-color: #f2c4c9; }
.floor-table.free .table-surface { background: #f0fdf9; border-color: #a7e3cd; }
.floor-plan.design {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(99, 102, 241, .1) 24px),
    repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(99, 102, 241, .1) 24px),
    var(--surface-2);
}
.table-editor-bar input#tableZone { min-height: 34px; width: 120px; padding: 4px 8px; font-size: 12px; }
.table-editor-bar .btn.icon-label { min-height: 34px; padding: 4px 9px; font-size: 11px; }

.table-detail-dialog { width: min(480px, 94vw); }
.detail-head { display: flex; gap: 12px; align-items: center; }
.detail-head h3 { margin: 0; }
.detail-avatar {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; background: var(--brand-soft); color: var(--brand-2); flex: 0 0 auto;
}
.detail-avatar.busy { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 76%, var(--ink)); }
.detail-avatar.billing { background: var(--danger-soft); color: var(--danger); }
.detail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.detail-stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px; min-width: 0; }
.detail-stats small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detail-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.detail-note {
  display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 9px 11px;
  border-radius: 10px; background: var(--surface-2); color: var(--ink-2); margin-top: 8px;
}
.detail-note .ico { width: 16px; height: 16px; }
.detail-note.ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.table-detail-form { margin-top: 12px; display: grid; gap: 8px; }
.table-detail-form[hidden] { display: none; }

.kds-toolbar { margin-bottom: 10px; }
.kds-clock { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kds-allday {
  border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.allday-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.allday-head .ico { width: 16px; height: 16px; color: var(--brand-2); }
.allday-head span { color: var(--muted); font-size: 11px; }
.allday-items { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.allday-chip { padding: 4px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; }
.allday-chip b { color: var(--brand-2); }

.kds-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kds-col {
  border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface-2);
  min-height: 140px; display: flex; flex-direction: column; gap: 10px;
}
.kds-col.sent { background: #f8fafc; }
.kds-col.preparing { background: #fffbeb; border-color: #f2dfb8; }
.kds-col.ready { background: #f0fdf9; border-color: #bbe7d9; }
.kds-colhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kds-colhead b { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.kds-colhead span { font-size: 10.5px; color: var(--muted); }
.kds-empty { color: var(--muted); font-size: 11.5px; text-align: center; padding: 14px 6px; border: 1px dashed var(--border-strong); border-radius: 11px; }

.kds-card.ticket {
  background: #fffdf7; border: 1px solid #eadfc8; border-left: 0; border-radius: 13px;
  padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 0;
  box-shadow: 0 6px 16px rgba(120, 90, 40, .08);
}
.kds-card.ticket::before { content: ""; display: block; height: 4px; background: var(--ok); }
.kds-card.ticket.warm::before { background: var(--warn); }
.kds-card.ticket.late::before { background: var(--danger); }
.kds-card.ticket.ready::before { background: var(--brand); }
.ticket-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; }
.ticket-where b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.ticket-where span { font-size: 10.5px; color: var(--muted); }
.ticket-age {
  font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); height: fit-content; font-variant-numeric: tabular-nums;
}
.ticket-age.warm { background: var(--warn-soft); color: var(--warn); }
.ticket-age.late { background: var(--danger-soft); color: var(--danger); }
.ticket-progress { height: 4px; background: #f1e9da; margin: 0 12px 6px; border-radius: 999px; overflow: hidden; }
.ticket-progress i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.kds-card.ticket.warm .ticket-progress i { background: var(--warn); }
.kds-card.ticket.late .ticket-progress i { background: var(--danger); }
.ticket-lines { list-style: none; margin: 0; padding: 0 12px; display: flex; flex-direction: column; }
.tline { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed #e7dcc6; }
.tline:first-child { border-top: 0; }
.tqty { font-weight: 800; font-size: 12.5px; color: var(--brand-2); min-width: 26px; font-variant-numeric: tabular-nums; }
.tname { flex: 1; font-size: 12.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tname small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.tline-age { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tline .btn { min-height: 34px; padding: 4px 9px; font-size: 11px; white-space: nowrap; }
.tline.ready .tname { text-decoration: line-through; color: var(--muted); }
.ticket-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-top: 1px dashed #e7dcc6; background: #fdf8ee;
}
.ticket-foot span { font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.ticket-foot .ico { width: 13px; height: 13px; }
.ticket-foot .btn { min-height: 36px; padding: 4px 9px; font-size: 11px; }
.ticket-done { color: var(--ok) !important; font-weight: 700; }

@media (max-width: 960px) {
  .kds-columns { grid-template-columns: 1fr; }
  .mod-stats { grid-template-columns: 1fr 1fr; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .module-toolbar { align-items: flex-start; }
  .floor-legend { order: 3; }
}
@media (max-width: 520px) {
  .mod-stats { grid-template-columns: 1fr 1fr; }
  .mod-stat { padding: 10px; gap: 8px; }
  .mod-stat b { font-size: 17px; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; }
}

/* Ajustes del editor y del plano tras la revisión visual. */
.table-editor-bar .editor-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.floor-table .ft-min { font-size: 8.5px; font-weight: 700; color: var(--warn); letter-spacing: .02em; }
.floor-table.billing .ft-min { color: var(--danger); }
.tline .btn { min-height: 38px; }
@media (max-width: 960px) {
  .tline .btn { min-height: 42px; }
  .kds-list { padding-bottom: 96px; }
  .tables-view, .tables-list { padding-bottom: 90px; }
}

/* El plano en móvil se desplaza dentro de su contenedor: las mesas no se pisan. */
.plano-scroll { min-width: 0; }
@media (max-width: 960px) {
  .plano-scroll.is-plan { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .plano-scroll.is-plan .floor-plan { min-width: 640px; }
}

/* El tablero móvil deja aire al final para que la última comanda quede
   por encima de la navegación fija y del asistente. */
@media (max-width: 960px) {
  .kds-list { padding-bottom: 210px; }
}

/* ---------- v20: inventario granular por receta ---------- */
.recipe-summary {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.recipe-eval-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.recipe-eval-head b { display: block; font-size: 14px; letter-spacing: -.01em; }
.recipe-eval-head span { display: block; color: var(--muted); font-size: 11.5px; }
.recipe-eval-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.recipe-eval-stats b { font-variant-numeric: tabular-nums; }
.recipe-eval .bar-line { margin: 6px 0 4px; }
.recipe-eval p { font-size: 11.5px; margin: 6px 0 0; }
.recipe-dialog { width: min(560px, 94vw); }
.recipe-lines { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 46vh; overflow-y: auto; }
.recipe-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 68px 84px 38px; gap: 8px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
}
.recipe-line .rl-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-line .rl-unit { color: var(--muted); font-size: 11px; }
.recipe-line .rl-qty {
  min-height: 38px; width: 100%; text-align: right; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 4px 6px; font-variant-numeric: tabular-nums;
}
.recipe-line .rl-cost { text-align: right; font-variant-numeric: tabular-nums; color: var(--brand-2); font-weight: 700; }
.recipe-line .icon-btn { width: 34px; height: 34px; }
.recipe-add { display: grid; grid-template-columns: minmax(0, 1fr) 74px auto; gap: 8px; margin-bottom: 12px; }
.recipe-add select { min-width: 0; }
.recipe-add input {
  min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px;
  text-align: right; font-variant-numeric: tabular-nums;
}
.recipe-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.recipe-totals div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; }
.recipe-totals small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.recipe-totals b { font-size: 15px; font-variant-numeric: tabular-nums; }
.recipe-totals b.ok { color: var(--ok); }
.recipe-totals b.danger { color: var(--danger); }
@media (max-width: 560px) {
  .recipe-add { grid-template-columns: 1fr 64px; }
  .recipe-add .btn { grid-column: span 2; }
  .recipe-line { grid-template-columns: minmax(0, 1fr) 56px 72px 34px; }
  .recipe-line .rl-unit { display: none; }
}

@media (max-width: 560px) {
  .recipe-totals { grid-template-columns: 1fr 1fr; }
  .recipe-totals div { padding: 8px 9px; }
  .recipe-totals b { font-size: 13.5px; white-space: nowrap; }
  .recipe-totals div:nth-child(3) { grid-column: span 2; }
}

/* ---------- v21: agenda en rejilla por profesional ---------- */
.agenda-toolbar { margin-bottom: 10px; }
.agenda-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.agenda-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.agenda-legend .dot.scheduled { background: var(--brand); }
.agenda-legend .dot.done { background: var(--ok); }
.agenda-legend .dot.no_show { background: var(--danger); }
.agenda-legend .dot.cancelled { background: var(--border-strong); }
.agenda-cal { min-width: 0; }
.cal-scroll {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.cal {
  --gutter: 62px;
  min-width: calc(var(--gutter) + var(--cols) * 180px);
  font-size: 12px;
}
.cal-head, .cal-body {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols), minmax(180px, 1fr));
}
.cal-head {
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0; z-index: 4;
}
.cal-corner {
  padding: 9px 8px; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--border);
}
.cal-prof { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-right: 1px solid var(--border); min-width: 0; }
.cal-prof .avatar { width: 28px; height: 28px; font-size: 11px; flex: 0 0 auto; }
.cal-prof b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-prof small { display: block; color: var(--muted); font-size: 10.5px; }
.cal-gutter { border-right: 1px solid var(--border); background: var(--surface-2); }
.cal-slot { position: relative; border-top: 1px solid var(--border); }
.cal-slot:first-child { border-top: 0; }
.cal-slot span {
  position: absolute; top: -7px; right: 6px; font-size: 9.5px; color: var(--muted);
  background: var(--surface-2); padding: 0 3px; font-variant-numeric: tabular-nums;
}
.cal-slot:first-child span { top: 3px; }
.cal-col {
  position: relative; border-right: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, transparent 0 45px, var(--border) 45px 46px);
}
.cal-col:last-child { border-right: 0; }
.cal-free {
  position: absolute; left: 4px; right: 4px; border: 1px dashed transparent; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--brand-2); padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.cal-free span { opacity: .22; font-size: 9.5px; font-weight: 600; color: var(--muted); transition: opacity .12s; }
.cal-free:hover, .cal-free:focus-visible { background: var(--brand-soft); border-color: var(--brand); }
.cal-free:hover span, .cal-free:focus-visible span { opacity: 1; color: var(--brand-2); }
.cal-appt {
  position: absolute; left: 4px; right: 4px; z-index: 2; text-align: left;
  display: flex; flex-direction: column; gap: 0; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-left: 4px solid var(--brand); border-radius: 9px;
  background: linear-gradient(180deg, #eef2ff, #ffffff); padding: 3px 7px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .08);
}
.cal-appt:hover { box-shadow: 0 4px 12px rgba(79, 70, 229, .16); }
.cal-appt .ca-time { font-size: 9px; line-height: 1.15; font-weight: 800; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.cal-appt b { font-size: 11.5px; line-height: 1.15; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-appt small { font-size: 9.5px; line-height: 1.1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-appt .ca-status { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.cal-appt.done { border-color: #bfe8d7; border-left-color: var(--ok); background: linear-gradient(180deg, #ecfdf5, #fff); }
.cal-appt.done .ca-time { color: var(--ok); }
.cal-appt.done .ca-status { background: var(--ok); }
.cal-appt.no_show { border-color: #f2c4c9; border-left-color: var(--danger); background: linear-gradient(180deg, #fff1f2, #fff); opacity: .9; }
.cal-appt.no_show .ca-time { color: var(--danger); }
.cal-appt.no_show .ca-status { background: var(--danger); }
.cal-appt.cancelled { border-left-color: var(--border-strong); background: var(--surface-2); opacity: .7; }
.cal-appt.cancelled b, .cal-appt.cancelled small { text-decoration: line-through; }
.cal-appt.cancelled .ca-status { background: var(--border-strong); }
.cal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.cal-now i { position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.appt-detail-dialog { width: min(500px, 94vw); }
.appt-detail-dialog .detail-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .agenda-toolbar { align-items: flex-start; }
  .agenda-legend { order: 3; }
  .cal { min-width: calc(58px + var(--cols) * 172px); }
  .cal-head, .cal-body { grid-template-columns: 58px repeat(var(--cols), minmax(172px, 1fr)); }
  .agenda-cal { padding-bottom: 90px; }
  .appt-detail-dialog .detail-stats { grid-template-columns: 1fr 1fr; }
}

/* El opt-in de IA puede ocultar el asistente aunque el FAB sea "siempre visible". */
.assistant-fab[hidden] { display: none !important; visibility: hidden !important; opacity: 0 !important; }

/* ---------- v22: afordancia de scroll en tablas de Reportes (móvil) ---------- */
.table-wrap.scroll-hint { position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; }
.table-wrap.scroll-hint:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.table-wrap.scroll-hint::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 30px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 92%, transparent));
  pointer-events: none; opacity: 0; transition: opacity .15s;
}
.table-wrap.scroll-hint.can-scroll::after { opacity: 1; }
.table-wrap.scroll-hint.at-end::after { opacity: 0; }
.scroll-tip { display: none; margin: 0 0 6px; font-size: 11px; color: var(--muted); align-items: center; gap: 6px; }
.scroll-tip::before { content: "↔"; font-size: 13px; color: var(--brand-2); }
@media (max-width: 960px) {
  .scroll-tip.visible { display: inline-flex; }
  #reportsBody .mini-table table { min-width: 430px; }
}
