/* Tribite — diseño "Frozen mist": superficies neutras, acento naranja y color
   semántico estricto. Tipografía Barlow / Barlow Condensed auto-hospedada. */

/* ---- Tipografía ---- */
@font-face { font-family: Barlow; src: url('../fonts/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('../fonts/Barlow-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Barlow; src: url('../fonts/Barlow-SemiBold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../fonts/BarlowCondensed-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('../fonts/BricolageGrotesque-Variable.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }

/* ---- Tokens ---- */
:root {
  --fog: #D9DADF; --stone: #7C7D75; --ash: #ADACA7; --cream: #FCF8D8; --orange: #DD700B;

  --bg: #F4F4F2;
  --surface: #FFFFFF;
  --secondary: #EEEEEB;
  --border: #DEDFD9;
  --border-strong: #ADACA7;

  --ink: #252622;
  --ink-2: #464740;
  --muted: #66675F;

  --primary: #DD700B;
  --primary-dark: #934704;
  --primary-soft: #FCF8D8;
  --primary-tint: #FCF8D8;

  --green: #2E7D32;   --green-soft: #E8F5E9;  --green-border: #A5D6A7;
  --red: #B3261E;     --red-soft: #FDECEA;    --red-border: #F2B8B2;
  --amber: #B45309;   --amber-soft: #FEF3C7;  --amber-border: #F5D98A;
  --blue: #1D4ED8;    --blue-soft: #E7EFFE;   --blue-border: #B3C7F7;
  --teal: #0F766E;    --teal-soft: #E0F2F1;   --teal-border: #99D5CF;
  --purple: #6D28D9;  --purple-soft: #F1EAFE; --purple-border: #CDB8F5;
  --slate: #5B6B7C;   --slate-soft: #F1F4F7;  --slate-border: #CBD5E1;

  --radius: 5px;
  --radius-sm: 4px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { font-size: 14px; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Barlow, sans-serif; font-size: 14px; line-height: 1.5;
  letter-spacing: 0; font-variant-numeric: tabular-nums;
}
a { color: var(--primary); }
h1, h2, h3 { letter-spacing: -0.2px; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mono, .num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -4px; }
.ic.lg { width: 22px; height: 22px; }
.ic.sm { width: 15px; height: 15px; }
.spacer { flex: 1; }
button, input, select, textarea { font-family: inherit; }

/* ---- Shell: rail lateral ---- */
.app-shell { padding-left: 96px; }
.topbar { position: fixed; inset: 0 auto 0 0; width: 96px; background: var(--fog); border-right: 1px solid #CACBCB; z-index: 40; }
.topbar-in.wrap { width: 100%; height: 100dvh; min-height: 0; max-width: none; margin: 0; padding: 24px 10px 18px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 14px; }
.brand { display: block; margin-bottom: 28px; text-decoration: none; color: var(--ink); }
.brand b { font: 600 29px/1 'Barlow Condensed', sans-serif; letter-spacing: -1px; }
.brand .brand-stop { display: inline; font: inherit; color: #A34E00; }
.topnav { display: flex; flex-direction: column; width: 100%; flex-wrap: nowrap; gap: 9px; }
.topnav a { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 62px; padding: 7px 0; border: 0; border-radius: 5px; color: #52544D; font-size: 12px; font-weight: 500; text-decoration: none; text-align: center; align-items: center; }
.topnav a .ic { width: 20px; height: 20px; }
.topnav a:hover { background: #E9E9E7; color: var(--ink); }
.topnav a.active { background: var(--cream); color: var(--ink); box-shadow: inset 3px 0 var(--orange); }
.topnav a.active .ic { color: #985000; }
.topbar .iconbtn { background: transparent; border: 0; }
.topbar-in > .spacer { display: none; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.iconbtn:hover { background: #E9E9E7; color: var(--ink); }
.iconbtn .badge-dot { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff; background: var(--red); }
.backlink { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); text-decoration: none; }
.backlink:hover { background: var(--cream); color: var(--ink); }
.workspace-bar { min-height: 58px; padding: 0 34px; display: flex; align-items: center; gap: 20px; background: #FFF; border-bottom: 1px solid var(--border); }
.workspace-context { font-size: 13px; font-weight: 500; }
.workspace-account { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--muted); }
.livebar { background: var(--amber-soft); border-bottom: 1px solid var(--amber-border); text-align: center; padding: 8px; font-size: 12.5px; color: var(--ink-2); }
.wrap { max-width: 1600px; margin: 0 auto; padding: 0 34px; }
.container { padding-top: 32px; padding-bottom: 48px; }
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 16px 0; color: var(--muted); font-size: 11px; }
.subnav { margin: 0; padding: 14px 0; flex-wrap: nowrap; overflow-x: auto; }
.subnav .chip { flex-shrink: 0; }

/* ---- Encabezado de pantalla ---- */
.pagehead { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.pagehead h1 { margin: 0; font: 600 38px/1.05 'Barlow Condensed', sans-serif; letter-spacing: -.7px; }
.pagehead .sub { margin: 8px 0 0; max-width: 600px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { margin: 0 0 10px; font-size: 10px; letter-spacing: .06em; color: var(--muted); font-weight: 500; text-transform: uppercase; }
.sectiontitle { display: flex; align-items: center; gap: 8px; margin: 26px 0 14px; }
.sectiontitle h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sectiontitle .n { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---- Tarjetas / paneles ---- */
.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.card + .card, .panel + .panel { margin-top: 16px; }
.panel h2, .card h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.panel h3, .card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.grid { display: grid; gap: 16px; }
.grid > *, .stats > *, .kpis > * { min-width: 0; }
.grid > .card + .card, .grid > .panel + .panel { margin-top: 0; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.side-r { grid-template-columns: 1.45fr .8fr; }
.grid.side-l { grid-template-columns: .8fr 1.45fr; }
.section { margin-top: 26px; }
.section > h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.empty { text-align: left; padding: 22px 4px; }
.empty h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* ---- Cajas tintadas ---- */
.tint { border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid transparent; font-size: 13.5px; }
.tint.t-green  { background: var(--green-soft);  border-color: var(--green-border);  color: var(--green); }
.tint.t-red    { background: var(--red-soft);    border-color: var(--red-border);    color: var(--red); }
.tint.t-amber  { background: var(--amber-soft);  border-color: var(--amber-border);  color: #92400E; }
.tint.t-blue   { background: var(--blue-soft);   border-color: var(--blue-border);   color: var(--blue); }
.tint.t-teal   { background: var(--teal-soft);   border-color: var(--teal-border);   color: var(--teal); }
.tint.t-purple { background: var(--purple-soft); border-color: var(--purple-border); color: var(--purple); }
.tint.t-slate  { background: var(--slate-soft);  border-color: var(--slate-border);  color: var(--slate); }
.tint.t-primary{ background: var(--primary-soft); border-color: #E3D79B;            color: var(--primary-dark); }
.tint b { font-weight: 700; }
.tint .cap { font-size: 11.5px; opacity: .85; display: block; }

/* ---- KPIs (barra única con divisores) ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #FFF; border: 1px solid var(--border); border-radius: 5px; margin-bottom: 26px; overflow: hidden; }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpi { border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 20px 16px; background: transparent; }
.kpi:last-child { border-right: 0; }
.kpi .k { font-size: 12px; text-transform: none; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.kpi .v { font-size: 25px; font-weight: 700; line-height: 1.25; margin-top: 3px; }
.kpi .v[class] { color: var(--ink); font: 600 32px/1.1 'Barlow Condensed', sans-serif; letter-spacing: -.5px; margin-top: 12px; }
.kpi .v.t-red { color: var(--red); }
.kpi .d { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.kpi.kpi-total { background: var(--cream); }
.kpi.k-purple .k { color: var(--purple); }
.kpi .khead { display: flex; align-items: center; justify-content: space-between; }
.kpi .khead .ic { color: var(--purple); }

/* ---- Mini estadísticas ---- */
.stats { display: grid; gap: 12px; margin-bottom: 18px; }
.stats.s3 { grid-template-columns: repeat(3, 1fr); }
.stats.s4 { grid-template-columns: repeat(4, 1fr); }
.stats.s5 { grid-template-columns: repeat(5, 1fr); }
.stat { display: block; text-decoration: none; border-radius: 4px; padding: 15px 17px; }
.stat[class] { background: #FFF; border: 1px solid var(--border); border-left: 3px solid currentColor; }
.stat .s-v { color: var(--ink); font: 600 30px/1.1 'Barlow Condensed', sans-serif; overflow-wrap: anywhere; }
.stat .s-k { font-size: 12px; font-weight: 400; margin-top: 3px; }
.stat.s-green  { color: var(--green); }
.stat.s-red    { color: var(--red); }
.stat.s-amber  { color: #92400E; }
.stat.s-blue   { color: var(--blue); }
.stat.s-purple { color: var(--purple); }
.stat.s-slate  { color: var(--slate); }
.stat.s-teal   { color: var(--teal); }
.stat.s-primary{ color: var(--primary-dark); }
.stat:hover { border-color: currentColor; }
a.stat { cursor: pointer; }
.stat.s-active { outline: 1px solid currentColor; outline-offset: 1px; }

/* ---- Acciones rápidas y panel admin ---- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; }
.quick-actions .btn { justify-content: flex-start; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0 8px; font-weight: 400; font-size: 13px; height: 46px; }
.admin-dash { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.admin-dash .tbl tbody td { height: 56px; }
.admin-dash .tbl thead th, .admin-dash .tbl tbody td { padding-left: 12px; padding-right: 12px; }
.admin-dash .tbl thead th:first-child, .admin-dash .tbl tbody td:first-child { padding-left: 16px; }
.dash-analysis { margin-top: 24px; }
.dash-analysis .grid.c2 { gap: 22px; }
.dashboard-empty { padding: 36px 12px; }
.dashboard-empty b { display: block; margin-bottom: 6px; color: var(--ink-2); font-weight: 500; }

/* ---- Insignias / chips ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; border-radius: 3px; padding: 3px 9px; background: var(--slate-soft); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.b-green { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.badge.b-amber { background: var(--amber-soft); color: #92400E; border-color: var(--amber-border); }
.badge.b-red { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.badge.b-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-border); }
.badge.b-orange { background: var(--primary-soft); color: var(--primary-dark); border-color: #E3D79B; }
.badge.b-purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-border); }
.badge.b-teal { background: var(--teal-soft); color: var(--teal); border-color: var(--teal-border); }
.badge.b-slate { background: var(--slate-soft); color: var(--slate); border-color: var(--slate-border); }
.badge.solid-red { background: var(--red); color: #fff; border-color: var(--red); }
.badge.solid-blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.badge.solid-green { background: var(--green); color: #fff; border-color: var(--green); }
.badge.solid-orange { background: var(--orange); color: #231C12; border-color: var(--orange); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--ink-2); text-decoration: none; font-size: 12.5px; font-weight: 400; cursor: pointer; }
.chip:hover { color: var(--ink); }
.chip.active { color: var(--ink); background: var(--cream); border-color: #E3D79B; font-weight: 500; }
.chip .n { opacity: .85; }
.chip.big { height: 38px; }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 17px; border-radius: 4px; font-size: 13px; font-weight: 500; white-space: nowrap; font-family: inherit; cursor: pointer; text-decoration: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); transition: background-color 120ms; }
.btn:hover { background: var(--cream); color: var(--ink); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #231C12; font-weight: 600; }
.btn.primary:hover { background: #C65F00; border-color: #C65F00; color: #17120B; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: #256628; border-color: #256628; color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: #1a44bd; color: #fff; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.teal:hover { background: #0b5d57; color: #fff; }
.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.purple:hover { background: #5b21b6; color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.amber:hover { background: #92400E; color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red-border); background: var(--surface); }
.btn.danger:hover { background: var(--red-soft); color: var(--red); }
.btn.solid-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.solid-danger:hover { background: #8f1e17; color: #fff; }
.btn.sm { font-size: 12px; height: 32px; padding: 0 12px; border-radius: 4px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---- Tablas ---- */
/* Botones de acción en una sola línea: en la tabla de extras son 4 y se
   partían en dos renglones, dejando las filas altísimas. */
.tbl td.acciones, .tbl th.acciones { white-space: nowrap; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; overflow: auto; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { position: sticky; top: 0; background: var(--secondary); text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tbody td { padding: 12px 16px; height: 50px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #F7F7F3; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.mono { white-space: nowrap; }
.tbl td.kbd { white-space: nowrap; }
.tbl td:last-child > .btn, .tbl td:last-child > form.inline { margin: 3px 2px; }
.kbd { font-size: 12px; color: var(--muted); }

/* Revisión de turnos: celda ordenada en dos filas */
.review-cell { display: grid; gap: 8px; min-width: 250px; }
.review-actions, .review-secondary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.review-cell input[name="comentario"] { height: 32px; font-size: 12.5px; }
.review-secondary { font-size: 12px; }

/* ---- Formularios ---- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.field .help { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
input, select, textarea { width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; height: 38px; font-size: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
textarea { height: auto; padding: 9px 12px; }
.searchrow { position: relative; margin-bottom: 12px; }
.searchrow .ic { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.searchrow input { padding-left: 36px; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow > * { flex: 1; min-width: 0; }
.frow > .field { flex: 1 1 150px; }
form.inline { display: inline; white-space: normal; }
form.inline input, form.inline select { width: auto; max-width: 100%; }
.chips > form { flex-wrap: wrap; }
.form-submit { align-self: end; padding-top: 20px; }
.flash { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid; background: var(--surface); }
.flash.ok { border-color: var(--green-border); background: var(--green-soft); color: var(--green); }
.flash.error { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }
.flash.warn { border-color: var(--amber-border); background: var(--amber-soft); color: #92400E; }
.form-sheet > form { margin-top: 22px; }
.form-sheet .grid.c2 { grid-template-columns: 1fr; }
.form-sheet .panel { border: 0; border-top: 1px solid var(--border); padding: 20px 0; background: transparent; }
.form-sheet .panel h3 { margin-bottom: 18px; }
.form-sheet label { font-size: 12px; }
.form-sheet label input, .form-sheet label select { margin-top: 6px; }
.form-divider { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 20px; }
.form-divider .hint { margin-bottom: 14px; }
.recipe-form, .movement-form { display: grid; gap: 14px; }
.reference-block { border-top: 1px solid var(--border-strong); margin: 28px 0; padding: 18px 0; }
.reference-block summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.reference-body { padding-top: 24px; }

/* ---- Shell de administración ---- */
.shell2 { max-width: none; display: grid; grid-template-columns: 178px minmax(0, 1fr); gap: 0; padding-left: 0; }
.admin-navigation { padding: 25px 14px; position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow-y: auto; }
.sidenav { position: static; background: transparent; border: 0; padding: 0; border-radius: 0; }
.sidenav .sgroup { display: flex; align-items: center; gap: 6px; padding: 15px 9px 9px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.sgroup span { display: none; }
/* Lateral con aire propio: Bricolage Grotesque (ancho normal, semibold) en vez
   de la Condensed apretada. Con más tamaño y respiro no necesita ir en bold. */
.sidenav a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; font-family: 'Bricolage Grotesque', Barlow, sans-serif; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; border-radius: 4px; color: var(--ink-2); text-decoration: none; }
.sidenav .ic { width: 16px; height: 16px; color: var(--stone); flex: 0 0 auto; }
.sidenav a:hover { background: #E9E9E7; color: var(--ink); }
.sidenav a.active { background: #E3E3DF; color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 var(--orange); }
.sidenav a.active .ic { color: var(--ink); }
.sidenav .nbadge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
.main-col { min-width: 0; width: 100%; padding-left: 30px; padding-top: 32px; padding-bottom: 48px; border-left: 1px solid var(--border); min-height: calc(100dvh - 108px); }
.nav-toggle { display: none; }

/* ---- Registro (mesas por área) ---- */
.register-summary { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 0 0 22px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.register-summary b { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 600; color: var(--ink); margin-right: 5px; }
.register-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; }
.register-search { display: flex; align-items: center; gap: 10px; width: min(340px, 75%); border-bottom: 1px solid var(--border-strong); }
.register-search input { border: 0; border-radius: 0; background: transparent; padding-left: 0; height: 38px; }
.register-search .ic { color: var(--muted); }
.register-area { margin-bottom: 28px; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: #FFF; }
.register-area-head { display: flex; align-items: baseline; gap: 14px; margin: 0; padding: 14px 20px; background: #E9E9E4; }
.register-area-head h2 { margin: 0; font: 600 15px/1.2 Barlow, sans-serif; letter-spacing: 0; }
.register-area-head > span { margin-left: auto; font-size: 12px; color: var(--muted); }
.register-list { border-top: 1px solid var(--border); }
.register-row { display: grid; grid-template-columns: 34px minmax(100px, 1fr) 84px 115px auto; gap: 18px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.register-row:last-child { border-bottom: 0; }
.register-row:hover { background: #F4F4F1; }
.table-emblem svg { width: 32px; height: 32px; fill: none; stroke: #7C7D75; stroke-width: 1.4; }
.register-identity h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.4px; }
.register-identity p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.register-capacity { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--muted); }
.register-capacity b { font-size: 17px; color: var(--ink-2); font-weight: 400; }
.status-text { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.status-text i { width: 6px; height: 6px; border-radius: 50%; background: var(--slate); }
.status-libre i { background: var(--green); }
.status-ocupada i { background: var(--red); }
.status-reservada i { background: var(--amber); }
.status-inactiva { color: var(--muted); }
.is-inactive .table-emblem { opacity: .45; }
.register-row > .btn { background: transparent; border-color: transparent; color: var(--ink-2); }
.register-row > .btn:hover { background: var(--cream); border-color: #E3D79B; }
.register-note { font-size: 11px; color: var(--muted); margin-top: 24px; }
.search-empty { padding: 26px 12px; }

/* ---- Piso: plano de mesas ---- */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mesa-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--radius); background: #FFF; overflow: hidden; }
.mesa-card .m-link { display: block; padding: 20px 16px; text-decoration: none; color: inherit; flex: 1; }
.mesa-card .m-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.mesa-card .m-top > .ic { display: none; }
.mesa-card .m-num { font: 600 27px 'Barlow Condensed', sans-serif; color: var(--ink) !important; }
.mesa-card .m-flag { margin-left: auto; }
.mesa-card .m-info { font-size: 12.5px; color: var(--ink-2); }
.mesa-card .m-live { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.mesa-card .m-total { font-size: 16px; font-weight: 700; }
.mesa-card .m-time { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.mesa-card .m-foot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: #F7F7F4; }
.mesa-card .m-foot select { height: 31px; font-size: 12px; padding: 0 8px; border-radius: 4px; }
.mesa-card .m-foot .btn { flex-shrink: 0; }
.mesa-card.st-libre { border-top-color: var(--green); }
.mesa-card.st-ocupada { border-top-color: var(--red); }
.mesa-card.st-reservada { border-top-color: var(--amber); }
.mesa-card.st-en_limpieza { border-top-color: var(--slate); }
.mesa-card.st-cuenta { border-top-color: var(--orange); }
.takeaway-card { display: flex; align-items: center; gap: 14px; background: var(--cream); border: 1px solid #DEDABB; border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
.takeaway-card:hover { border-color: var(--orange); }
.takeaway-card .t-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.takeaway-card b { font-size: 15.5px; display: block; }
.takeaway-card .t-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.takeaway-card .t-count { background: var(--red); color: #fff; font-weight: 700; font-size: 13px; border-radius: 999px; min-width: 26px; height: 26px; display: grid; place-items: center; padding: 0 8px; }

/* ---- KDS (cocina) ---- */
.filters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.ticket-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ticket-card.st-pendiente { border-top-color: var(--amber); }
.ticket-card.st-en_preparacion { border-top-color: var(--orange); }
.ticket-card.st-listo { border-top-color: var(--green); }
.ticket-card.urgente { border-color: var(--red-border); background: #FFFAF9; }
.ticket-card .t-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ticket-card .t-title { font-size: 15.5px; font-weight: 700; }
.ticket-card h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.ticket-card .t-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticket-card .items { display: flex; flex-direction: column; gap: 7px; border-top: 1px dashed var(--border-strong); border-bottom: 1px dashed var(--border-strong); padding: 10px 0; margin: 2px 0; }
.item-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.item-row .q-badge { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #E3D79B; border-radius: 6px; font-weight: 700; font-size: 12px; padding: 1px 7px; white-space: nowrap; }
.item-row .i-name { font-weight: 600; }
.item-row .est { margin-left: auto; }
.nota-critica { background: var(--red-soft); border: 1px solid var(--red-border); border-radius: 7px; padding: 5px 9px; font-size: 12px; font-weight: 700; color: var(--red); margin: 3px 0; display: flex; gap: 6px; align-items: center; }
.nota-normal { background: var(--amber-soft); border: 1px solid var(--amber-border); border-radius: 7px; padding: 4px 9px; font-size: 12px; color: #92400E; margin: 3px 0; }
.elapsed { font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--slate-soft); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.elapsed.late { color: var(--red); border-color: var(--red-border); background: var(--red-soft); }
.ticket-card .t-foot { display: flex; gap: 8px; margin-top: auto; }
.ticket-card .t-foot .btn { flex: 1; }
.chip-tiempo { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--blue-border); background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* ---- Alertas de cocina/capitán ---- */
.alerts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.alert-card { min-width: 0; border: 1px solid var(--amber-border); background: #FFFDF6; border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.alert-card.urgente { border-color: var(--red-border); background: #FFFAF9; }
.alert-card + .alert-card { margin-top: 10px; }
.alert-card .a-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--amber-soft); color: #92400E; flex-shrink: 0; }
.alert-card.urgente .a-icon { background: var(--red-soft); color: var(--red); }
.alert-card b { font-size: 14px; }
.alert-card .a-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-card .a-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.alert-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Caja: cuentas estilo ticket ---- */
.bill { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 5px; overflow: hidden; margin-bottom: 20px; }
.bill-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--secondary); padding: 12px 18px; }
.bill-head .bill-loc { font-size: 12px; font-weight: 700; color: #fff; padding: 4px 11px; border-radius: 7px; background: var(--red); }
.bill-head .bill-loc.llevar { background: var(--blue); }
.bill-head .bill-id { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.bill-head .bill-total { margin-left: auto; text-align: right; }
.bill-head .bill-total b { color: var(--primary-dark); font-size: 16px; display: block; }
.bill-head .bill-total span { font-size: 11.5px; color: var(--muted); }
.dotted { border: 0; border-top: 2px dashed var(--border-strong); margin: 0; }
.bill-body { padding: 14px 18px; }
.bill-sum { background: var(--slate-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; }
.bill-sum .rowline { display: flex; justify-content: space-between; padding: 2.5px 0; }
.bill-sum .rowline.total { border-top: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); margin-top: 6px; padding: 6px 0; font-weight: 700; }
.bill-sum .rowline.total b { color: var(--primary-dark); font-size: 15.5px; }
.bill-prods { background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.bill-prods .rowline { display: flex; justify-content: space-between; padding: 2.5px 0; }
.bill-foot { display: flex; gap: 10px; flex-wrap: wrap; background: var(--secondary); padding: 14px 18px; }
.bill-foot .btn { min-width: 158px; flex: 1 1 158px; }
.mchips { display: flex; gap: 8px; flex-wrap: wrap; }
.mchip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700; border: 1px solid; text-decoration: none; }
.mchip.m-green { color: var(--green); border-color: var(--green-border); background: var(--green-soft); }
.mchip.m-purple { color: var(--purple); border-color: var(--purple-border); background: var(--purple-soft); }
.mchip.m-blue { color: var(--blue); border-color: var(--blue-border); background: var(--blue-soft); }
.mchip.m-orange { color: var(--primary-dark); border-color: #E3D79B; background: var(--primary-soft); }

/* ---- Capitán: mini-mesas ---- */
.mesas-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mesa-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; text-decoration: none; color: inherit; }
.mesa-mini:hover { border-color: var(--primary); }
.mesa-mini b { display: block; font-size: 14.5px; }
.mesa-mini .est { font-size: 12px; font-weight: 600; }
.mesa-mini .pers { font-size: 11.5px; color: var(--muted); }
.mesa-mini.mm-libre .est { color: var(--green); }
.mesa-mini.mm-ocupada .est { color: var(--red); }
.mesa-mini.mm-cuenta .est { color: var(--primary-dark); }
.mesa-mini.mm-reservada .est { color: var(--blue); }
.mesa-mini.mm-en_limpieza .est { color: var(--slate); }

/* ---- Comanda / ticket ---- */
.receipt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 19px; }
.receipt hr { border: 0; border-top: 1px dashed var(--border-strong); margin: 11px 0; }
.receipt .rowline { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13.5px; }
.receipt .total { font-size: 17px; font-weight: 700; }
.itemline { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.itemline:last-child { border-bottom: 0; }
.itemline .i-name { font-weight: 600; }
.itemline .i-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.itemline .i-price { margin-left: auto; font-weight: 700; white-space: nowrap; }

/* ---- Menú ---- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; }
/* Rejilla de casillas para elegir a qué aplica un grupo de extras. */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 4px 2px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.check:hover { border-color: var(--primary); background: var(--secondary); }
.check input { margin: 0; flex: 0 0 auto; }
/* Menú por secciones: cada categoría es un bloque con su propio grid. */
.menu-secciones { display: block; }
.menu-seccion { margin-bottom: 26px; }
.menu-seccion:last-child { margin-bottom: 0; }
.menu-seccion-titulo { display: flex; align-items: baseline; gap: 9px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.menu-seccion-n { font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--secondary); border-radius: 99px; padding: 1px 7px; }
.menu-seccion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
.prod-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink); }
.prod-card:hover { border-color: var(--primary); }
.prod-card .p-name { font-size: 14.5px; font-weight: 700; }
.prod-card .p-desc { font-size: 12px; color: var(--muted); margin: 3px 0 8px; min-height: 28px; }
.prod-card .p-price { font-size: 15px; font-weight: 700; color: var(--primary-dark); }
.prod-card .p-old { font-size: 12px; color: var(--muted); text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.prod-card .p-tags { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }

/* ---- Cuenta dividida ---- */
.person-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.persona-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink-2); }
.persona-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.persona-chip.cerrada { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }

/* ---- Login / acceso ---- */
.login-wrap { max-width: 940px; min-height: 70vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 96px; margin: 24px auto; }
.login-intro .wordmark { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 42px; letter-spacing: -1.5px; margin-bottom: 64px; }
.wordmark span { color: var(--orange); }
.login-intro h2 { font: 600 60px/1 "Barlow Condensed", sans-serif; letter-spacing: -1.5px; margin: 0 0 24px; }
.login-intro p { color: var(--muted); max-width: 320px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 36px; }
.login-card h1 { margin: 0 0 4px; font: 600 30px Barlow, sans-serif; }
.login-card .field { margin-bottom: 20px; }
.login-card input, .login-card .btn { height: 44px; }
.login-demo { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; color: var(--muted); font-size: 12px; }
/* Selector de restaurante: el mismo usuario existe en varios comercios. */
.comercio-choices { display: grid; gap: 9px; }
.comercio-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; height: 48px; padding: 0 16px; font: 500 15px Barlow, sans-serif; color: var(--ink); text-align: left; cursor: pointer; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; transition: border-color .15s, background .15s, transform .15s; }
.comercio-choice:hover { border-color: var(--orange); background: var(--primary-soft); transform: translateX(2px); }
.comercio-choice svg { width: 17px; height: 17px; color: var(--orange); flex: none; }
.login-demo summary { cursor: pointer; }

/* ---- Modal (diálogos) ---- */
.overlay { position: fixed; inset: 0; background: rgba(42, 29, 22, .5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.overlay.on { display: flex; }
.modal-open { overflow: hidden; }
.modal { position: relative; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 36px; width: 100%; max-width: 580px; max-height: 92vh; overflow: auto; }
.modal h2 { margin: 0 0 14px; font: 600 28px/1.2 Barlow, sans-serif; padding-right: 22px; }
.modal .msub { font-size: 12.5px; color: var(--muted); margin: 0 0 24px; line-height: 1.6; }
.modal .mfoot { display: flex; gap: 10px; margin-top: 18px; }
.modal .mfoot .btn { flex: 1; }
.modal-close { position: absolute; right: 12px; top: 10px; border: 0; background: transparent; color: var(--muted); font-size: 26px; width: 32px; height: 32px; cursor: pointer; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--surface); font-size: 18px; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--primary-soft); }
.stepper .qty { width: 48px; text-align: center; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.radios label, .checks label { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 7px; font-size: 13.5px; cursor: pointer; }
.radios label:hover, .checks label:hover { border-color: var(--primary); }
.radios input, .checks input { width: auto; height: auto; }
.radios .price, .checks .price { margin-left: auto; font-weight: 700; color: var(--green); }
.quicktimes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.quicktimes .qt { height: 34px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.quicktimes .qt.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* ---- Caja móvil: registros en tarjetas ---- */
.cash-mobile { display: none; }

/* ================= Responsive ================= */
@media (max-width: 1200px) {
  .shell2 { grid-template-columns: 160px minmax(0, 1fr); }
  .wrap { padding-right: 24px; }
  .main-col { padding-left: 24px; }
  .admin-dash { grid-template-columns: 1fr; }
  .pagehead { flex-wrap: wrap; }
  .pagehead .actions { margin-left: 0; }
  .register-row { gap: 12px; grid-template-columns: 30px minmax(100px, 1fr) 66px 100px auto; }
}
@media (max-width: 1000px) {
  .kpis, .kpis.k5 { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-bottom: 1px solid var(--border); }
  .grid.c4, .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .stats.s5 { grid-template-columns: repeat(3, 1fr); }
  .login-wrap { gap: 36px; }
}
@media (max-width: 900px) {
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .alerts-grid { grid-template-columns: minmax(0, 1fr); }
  .shell2 { grid-template-columns: minmax(0, 1fr); padding: 0 24px; }
  .main-col { border-left: 0; padding-left: 0; }
  .admin-navigation { position: static; padding: 12px 0 0; overflow: visible; max-height: none; }
  .nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; color: var(--ink-2); border: 0; border-bottom: 1px solid var(--border); padding: 12px 0; text-align: left; font: 400 12px Barlow, sans-serif; cursor: pointer; }
  .nav-toggle > span { margin-left: auto; }
  .nav-toggle[aria-expanded='false'] + .sidenav { display: none; }
  .sidenav { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 0; gap: 2px 12px; border-bottom: 1px solid var(--border); }
  .sidenav .sgroup { display: none; }
  .container { padding-top: 24px; }
}
@media (max-width: 860px) {
  .wrap { padding: 0 14px; }
  .stats.s3, .stats.s4, .stats.s5 { grid-template-columns: repeat(2, 1fr); }
  .grid.c2, .grid.c3, .grid.c4, .grid.side-r, .grid.side-l { grid-template-columns: 1fr; }
  .floor { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 700px) {
  .app-shell { padding-left: 0; padding-bottom: 68px; }
  .topbar { position: static; width: 100%; border: 0; background: #FFF; }
  .topbar-in.wrap { height: 62px; padding: 0 18px; flex-direction: row; gap: 12px; }
  .brand { margin: 0; }
  .brand b { font-size: 31px; }
  .topnav { position: fixed; bottom: 0; left: 0; right: 0; order: initial; width: 100%; height: 65px; flex-direction: row; background: var(--fog); padding: 4px 8px max(4px, env(safe-area-inset-bottom)); gap: 4px; overflow: visible; z-index: 40; }
  .topnav a { flex: 1; height: 56px; font-size: 11px; gap: 4px; }
  .topnav a .ic { width: 18px; height: 18px; }
  .topnav a.active { box-shadow: inset 0 2px var(--orange); }
  .workspace-bar { min-height: 40px; padding: 0 18px; border-top: 1px solid var(--border); background: #ECECE8; }
  .workspace-context, .workspace-account { font-size: 11px; }
  .wrap, .shell2 { padding-left: 18px; padding-right: 18px; }
  .pagehead h1 { font-size: 36px; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1 1 auto; }
  .register-summary { gap: 10px 18px; }
  .register-summary span:last-child { width: 100%; }
  .register-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; padding: 14px 12px; }
  .table-emblem { grid-row: 1 / 3; }
  .table-emblem svg { width: 25px; }
  .register-identity { grid-column: 2; }
  .register-row > .btn { grid-column: 3; grid-row: 1; padding: 0 6px; }
  .register-capacity { grid-column: 2; grid-row: 2; }
  .register-capacity b { font-size: 12px; }
  .status-text { grid-column: 3; grid-row: 2; justify-self: end; font-size: 11px; }
  .register-identity p { overflow-wrap: anywhere; }
  .register-note { line-height: 1.6; }
  .kpi { padding: 16px 12px; }
  .kpis.k5 .kpi:last-child { grid-column: 1 / -1; }
  .stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stats.s3 .stat { padding: 12px 8px; }
  .stats.s3 .s-v { font-size: 25px; }
  .stats.s3 .s-k { font-size: 11px; }
  .panel, .card { padding: 18px 16px; }
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mesa-card .m-top { flex-wrap: wrap; }
  .mesa-card .m-flag { margin-left: 0; }
  .mesa-card .m-link { padding: 14px 12px; }
  .kds { grid-template-columns: minmax(0, 1fr); }
  .frow > .field { flex-basis: 100%; }
  input, select, textarea { font-size: 16px; }
  .modal { padding: 28px 22px; max-height: 90dvh; }
  .overlay { padding: 12px; }
  .alert-card .a-icon { display: none; }
  .login-wrap { grid-template-columns: 1fr; max-width: 420px; gap: 28px; }
  .login-intro .wordmark { margin-bottom: 24px; }
  .login-intro h2 { font-size: 46px; }
  .login-intro p { display: none; }
  .login-card { padding: 26px; }
  .form-submit { padding-top: 0; margin-bottom: 0; }
  .form-submit .btn { width: 100%; }

  /* Caja: registros verticales en teléfono, tabla en escritorio */
  .cash-subnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 12px 0 0; overflow: visible; }
  .cash-subnav .chip { justify-content: center; padding: 0 4px; height: 40px; font-size: 13px; }
  .cash-desktop { display: none; }
  .cash-mobile { display: block; }
  .closing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 18px; margin-bottom: 14px; }
  .closing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .closing-head h3 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
  .closing-head time { font-size: 12px; color: var(--muted); }
  .closing-amount { margin: 20px 0 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .closing-amount span { font-size: 12px; color: var(--muted); }
  .closing-amount strong { font: 600 30px 'Barlow Condensed', sans-serif; }
  .closing-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .closing-totals dt { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
  .closing-totals dd { margin: 0; font-size: 16px; font-weight: 500; }
  .closing-review { padding: 12px; background: var(--cream); font-size: 13px; overflow-wrap: anywhere; }
  .closing-review b { display: block; margin-bottom: 4px; }
  .closing-detail summary { cursor: pointer; font-size: 12px; color: var(--ink-2); padding: 2px 0 12px; }
  .closing-detail dl { margin: 0 0 14px; }
  .closing-detail dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
  .closing-detail dd { margin: 0; }
  .closing-actions { display: flex; gap: 8px; padding-top: 4px; }
  .closing-actions .btn { flex: 1; height: 40px; }
  .table-wrap:has(> .cash-records) { overflow: visible; border: 0; background: transparent; }
  table.cash-records, .cash-records tbody { display: block; }
  .cash-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cash-records tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 16px 0; border-bottom: 1px solid var(--border-strong); }
  .cash-records tbody td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: auto; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .cash-records td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 400; color: var(--muted); }
  .cash-records td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .cash-records td[colspan] { grid-column: 1 / -1; padding: 16px 0; }
  .cash-records tbody tr:hover td { background: transparent; }
  .cash-kpis { display: block; border: 0; background: transparent; }
  .cash-kpis .kpi { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); }
  .cash-kpis .kpi .v { font-size: 25px; margin: 0; grid-column: 2; grid-row: 1 / 3; }
  .cash-kpis .kpi .d { margin: 0; grid-column: 1; }
  .cash-summary.stats { display: block; }
  .cash-summary .stat[class] { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
  .cash-summary .stat .s-v { font: 500 18px Barlow, sans-serif; }
  .cash-summary .stat .s-k { margin: 0; color: var(--muted); }
}
@media (max-width: 560px) {
  .mesa-card .m-num { white-space: nowrap; }
  .mesa-card .m-flag .badge { font-size: 10.5px; padding: 2px 7px; }
  .mesa-card .m-foot { flex-direction: column; align-items: stretch; }
  .mesa-card .m-foot .btn { width: 100%; }
  .bill-foot .btn { min-width: 100%; }
}
@media (max-width: 520px) {
  .quick-actions { grid-template-columns: 1fr; }
}
/* ---- Tablas como tarjetas en teléfono ----
   Un grid con scroll horizontal no sirve en el teléfono: cada fila se vuelve
   una tarjeta apilada (la primera celda suele ser el nombre en negritas y los
   botones de acción se estiran para el pulgar). */
@media (max-width: 700px) {
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.tbl { display: block; width: 100%; }
  .tbl tbody { display: block; }
  .tbl thead { display: none; }
  .tbl tbody tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
  .tbl tbody tr:last-child { margin-bottom: 0; }
  .tbl tbody td, .admin-dash .tbl tbody td { display: block; height: auto; border: 0; padding: 3px 0; text-align: left; }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl td.num, .tbl td.mono, .tbl td.kbd { text-align: left; white-space: normal; }
  .tbl td.acciones { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; white-space: normal; }
  .tbl td.acciones .btn, .tbl td.acciones form.inline { flex: 1 1 auto; }
  .tbl td.acciones form.inline { display: flex; margin: 0; }
  .tbl td.acciones form.inline .btn { flex: 1; width: 100%; }
  /* Etiquetas de columna en la tarjeta: sólo donde el número solo no se
     entiende (Existencia, Mínimo...). Se ponen con data-th en el template. */
  .tbl td[data-th]::before { content: attr(data-th); display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 1px; }
  /* El cobro lo gobierna workspace.css (.bill-foot en 1 columna en teléfono). */
  /* La lista de mesas ya tiene su layout compacto de 3 columnas más arriba. */
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
