/* ============================================================
   ARROZEO — Sistema de diseño "Servicio" (Claude Code)
   Hostelería premium: navegación superior, paleta cálida y
   saturada, tipografía Plus Jakarta Sans, objetivos táctiles
   generosos, profundidad real. Sustituye a DESIGN.md.
   Todas las clases usadas por las vistas se conservan.
   ============================================================ */

[hidden] { display: none !important; }

/* Buscador + filtros de listados (list-filter.js) */
.list-filter { padding: 14px 20px 4px; }
.list-filter-search { position: relative; display: flex; align-items: center; gap: 10px; }
.list-filter-search input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line-strong); background: var(--surface);
  padding: 9px 13px; font-size: 14px; border-radius: var(--radius-sm); min-height: 40px; font-family: inherit; color: var(--ink);
}
.list-filter-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.list-filter-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.list-filter-facet-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-right: 2px; }
.lf-chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  padding: 5px 11px; font-size: 12px; font-weight: 600; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.lf-chip:hover { color: var(--ink); }
.lf-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.list-filter-noresult { padding: 18px 20px !important; color: var(--muted); text-align: center; }

@font-face {
  font-family: "Jakarta";
  src: url("/assets/fonts/jakarta/PlusJakartaSans.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Jakarta";
  src: url("/assets/fonts/jakarta/PlusJakartaSans-Italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "JB Mono";
  src: url("/assets/fonts/jbmono/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/roboto/Roboto-Variable.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;

  /* Neutros cálidos */
  --espresso: #241a14;
  --espresso-2: #30241b;
  --bg: #f8f3ea;
  --paper: #f8f3ea;
  --paper-2: #f1e9da;
  --surface: #ffffff;
  --surface-2: #fbf6ee;
  --surface-3: #f4ebdd;
  --ink: #2a2018;
  --ink-soft: #574737;
  --muted: #8b7962;
  --faint: #b6a48c;
  --line: #ece0cd;
  --line-strong: #ddccb2;

  /* Acento — tomate ARROZEO, saturado + ámbar de apoyo */
  --accent: #e5482a;
  --accent-ink: #bb3617;
  --accent-wash: #fce9e2;
  --accent-line: #f2c7b8;
  --amber: #e79a2e;
  --amber-ink: #b06f12;
  --amber-wash: #fbefd8;
  --brand: #e5482a;
  --brand-dark: #bb3617;
  --brand-soft: #fce9e2;
  --arrozeo: #e5482a;
  --arrozeo-dark: #bb3617;

  /* Semánticos cálidos */
  --pos: #2e8b55;   --pos-wash: #e4f2e9;
  --warn: #c07d16;  --warn-wash: #fbefd8;
  --neg: #d63a3a;   --neg-wash: #fceae9;
  --brand-info: #4353d6; --info-wash: #ebedfb;

  --saffron: var(--amber-ink);   --saffron-dark: var(--amber-ink);  --saffron-soft: var(--amber-wash);
  --success: var(--pos);         --success-soft: var(--pos-wash);
  --warning: var(--warn);        --warning-soft: var(--warn-wash);
  --danger: var(--neg);          --danger-soft: var(--neg-wash);
  --info: var(--brand-info);     --info-soft: var(--info-wash);
  --pine: var(--pos);            --pine-soft: var(--pos-wash);
  --aubergine: var(--brand-info); --aubergine-soft: var(--info-wash);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Sombra — cálida, con cuerpo */
  --shadow-xs: 0 1px 2px rgba(74, 45, 20, .06);
  --shadow-sm: 0 1px 2px rgba(74, 45, 20, .06), 0 3px 8px -3px rgba(74, 45, 20, .10);
  --shadow: 0 1px 2px rgba(74, 45, 20, .05), 0 8px 20px -8px rgba(74, 45, 20, .16), 0 24px 44px -22px rgba(74, 45, 20, .14);
  --shadow-lg: 0 2px 6px rgba(74, 45, 20, .08), 0 16px 36px -10px rgba(74, 45, 20, .22), 0 44px 80px -30px rgba(74, 45, 20, .24);

  --topnav-h: 60px;
  --test-banner-h: 36px;
  --sticky-offset: var(--topnav-h);

  --font: "Jakarta", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "JB Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --context-accent: var(--accent);
  --context-accent-soft: var(--accent-wash);
}
body[class*="context-"] { --context-accent: var(--accent); --context-accent-soft: var(--accent-wash); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.008em;
}

a { color: inherit; text-decoration: none; }
a:not([class]) { color: var(--accent-ink); font-weight: 600; }
a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.16; color: var(--ink); }
p { margin: 0 0 8px; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
small { font-size: 12px; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }
hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
::selection { background: var(--accent-wash); }

.icon { flex: 0 0 auto; display: inline-block; vertical-align: -0.18em; }

/* ============================================================
   Navegación superior
   ============================================================ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--espresso);
  color: #efe6da;
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 8px 24px -12px rgba(0,0,0,.35);
}
.test-mode-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--warn); color: #fff; text-align: center;
  font-size: 12.5px; font-weight: 700; padding: 7px 12px;
}
.test-mode-banner a { color: #fff; text-decoration: underline; margin-left: 8px; }
body.test-mode .topnav { top: var(--test-banner-h); }
body.test-mode { --sticky-offset: calc(var(--topnav-h) + var(--test-banner-h)); }
.topnav-inner {
  display: flex; align-items: center; gap: 6px;
  height: var(--topnav-h);
  max-width: 1640px; margin: 0 auto; padding: 0 22px;
}
.topnav-brand { flex: 0 0 auto; display: flex; align-items: center; padding-right: 14px; margin-right: 6px; }
.topnav-brand img { height: 20px; width: auto; }

.topnav-menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }

.nav-group { position: relative; }
.nav-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px;
  background: transparent; border: none; cursor: pointer;
  color: #c7b9a9; font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: -0.01em;
  transition: background .12s, color .12s;
}
.nav-trigger .icon { color: #9c8a77; transition: color .12s; }
.nav-trigger .chev { opacity: .5; transition: transform .14s; }
.nav-group:hover .nav-trigger, .nav-group.open .nav-trigger { background: rgba(255,255,255,.08); color: #fff; }
.nav-group:hover .nav-trigger .icon, .nav-group.open .nav-trigger .icon { color: #ffb59e; }
.nav-group.open .nav-trigger .chev { transform: rotate(180deg); }
.nav-group.active .nav-trigger { color: #fff; }
.nav-group.active .nav-trigger .icon { color: var(--accent); }
/* Ajustes se queda solo con el icono en la barra superior (a partir de cierto número de grupos
   visibles, "Empleados"/"Ajustes"/el botón TPV empiezan a pisarse) — el desplegable sigue
   mostrando el nombre completo de cada opción, y el title= del botón hace de tooltip. */
.nav-trigger-iconOnly span { display: none; }
.nav-trigger-iconOnly { padding: 8px 9px; gap: 0; }
.nav-group.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px;
  background: var(--accent); border-radius: 2px;
}

.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 244px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.nav-dropdown.align-right { left: auto; right: 0; }
[data-nav-group]:hover .nav-dropdown, [data-nav-group].open .nav-dropdown, [data-nav-group]:focus-within .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--ink-soft); font-weight: 550; font-size: 13px;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-wash); color: var(--accent-ink); }
.nav-item.active .icon { color: var(--accent); }
.nav-user-head { padding: 8px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nav-user-head strong { display: block; font-size: 13px; }
.nav-user-head span { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.nav-divider { border-top: 1px solid var(--line); margin: 4px 6px; }

.topnav-search {
  position: relative;
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  width: 190px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px;
  background: rgba(255,255,255,.06); padding: 0 10px 0 11px;
  transition: width .16s, background .14s, border-color .14s;
}
.topnav-tpv-wrap { position: relative; flex: 0 0 auto; }
.topnav-tpv-cta {
  display: flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 800; text-decoration: none;
  box-shadow: 0 2px 6px rgba(187, 54, 23, .35);
  transition: filter .12s, transform .12s;
}
.topnav-tpv-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.topnav-tpv-badge {
  position: absolute; top: -7px; right: -7px; z-index: 1;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--neg); color: #fff;
  border: 2px solid var(--espresso);
  font-family: var(--font); font-size: 10.5px; font-weight: 800; line-height: 15px; text-align: center;
  text-decoration: none;
  display: none;
}
.topnav-tpv-badge.is-visible { display: block; }
.topnav-tpv-badge.is-new { animation: topnav-tpv-badge-pop .35s ease-out; }
@keyframes topnav-tpv-badge-pop { 0% { transform: scale(.5); } 65% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .topnav-tpv-badge.is-new { animation: none; } }
.topnav-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-width: 80vw;
  max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 60;
}
.topnav-search-group { padding: 4px 0; }
.topnav-search-group + .topnav-search-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.topnav-search-group p { margin: 0 10px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 700; }
.topnav-search-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.topnav-search-item:hover, .topnav-search-item.is-active { background: var(--surface-2); }
.topnav-search-item strong { font-size: 13px; font-weight: 650; }
.topnav-search-item span { font-size: 11.5px; color: var(--muted); }
.topnav-search-empty { padding: 14px 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.topnav-search-more { display: block; text-align: center; padding: 9px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--accent-ink); text-decoration: none; }
.topnav-search-more:hover { background: var(--surface-2); }
.topnav-search .icon { color: #a08d79; }
.topnav-search:focus-within { width: 260px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.topnav-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  color: #fff; font-size: 13px; font-family: inherit; padding: 8px 0;
}
.topnav-search input::placeholder { color: #a08d79; }
.topnav-search kbd { font-family: var(--mono); font-size: 10px; color: #b7a693; border: 1px solid rgba(255,255,255,.16); border-radius: 5px; padding: 1px 5px; }

.topnav-clock {
  flex: 0 0 auto; font-family: var(--mono); font-size: 12.5px; color: #b7a693;
  padding: 0 12px; font-variant-numeric: tabular-nums;
}

.topnav-user { position: relative; flex: 0 0 auto; }
.topnav-avatar {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(150deg, #ff6a48, var(--accent)); color: #fff;
  font-family: var(--font); font-weight: 700; font-size: 14px;
}

.topnav-burger {
  display: none; width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  align-items: center; justify-content: center; cursor: pointer;
}
.topnav-burger span, .topnav-burger span::before, .topnav-burger span::after {
  content: ""; display: block; width: 16px; height: 2px; background: #efe6da; border-radius: 2px; position: relative;
}
.topnav-burger span::before { position: absolute; top: -5px; }
.topnav-burger span::after { position: absolute; top: 5px; }

.nav-scrim { display: none; position: fixed; inset: 0; background: rgba(36,26,20,.5); z-index: 45; backdrop-filter: blur(2px); }
.nav-drawer {
  display: none; position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 84vw); z-index: 46;
  background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  overflow-y: auto; padding: 18px 14px 40px;
  transform: translateX(100%); transition: transform .22s ease;
}
body.nav-open .nav-scrim { display: block; }
body.nav-open .nav-drawer { display: block; transform: translateX(0); }
.nav-drawer-group { margin-bottom: 12px; }
.nav-drawer-group p { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--faint); padding: 10px 11px 4px; margin: 0; }

/* ============================================================
   Contenido
   ============================================================ */
.content { max-width: 1500px; width: 100%; margin: 0 auto; padding: 34px 26px 96px; }
@media (min-width: 1200px) { .content { padding-inline: 44px; } }

/* ============================================================
   Cabecera de página
   ============================================================ */
.page-header {
  padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: end;
}
.page-header > .eyebrow, .page-header > h1, .page-header > p { grid-column: 1; }
.page-header .eyebrow {
  font-size: 11px; letter-spacing: .06em; font-weight: 700;
  color: var(--amber-ink); text-transform: uppercase;
}
.page-header h1 { font-size: clamp(24px, 2.6vw, 32px); margin: 9px 0 6px; font-weight: 800; letter-spacing: -0.035em; }
.page-header p { color: var(--muted); font-size: 14px; max-width: 680px; margin: 0; }
.page-header-actions { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; align-self: center; }
@media (max-width: 720px) {
  .page-header { grid-template-columns: 1fr; }
  .page-header-actions { grid-column: 1; grid-row: auto; margin-top: 4px; }
}

/* ============================================================
   Botones — táctiles
   ============================================================ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: 11px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-weight: 650; font-size: 13.5px; cursor: pointer;
  min-height: 42px; white-space: nowrap; letter-spacing: -0.01em;
  box-shadow: var(--shadow-xs);
  transition: transform .08s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease, filter .14s;
}
.button .icon { width: 17px; height: 17px; }
.button:hover { background: var(--surface-2); border-color: var(--muted); }
.button:active { transform: translateY(1px); }
.button-primary {
  background: var(--accent); border-color: transparent; color: #fff;
  box-shadow: 0 2px 4px rgba(187, 54, 23, .4), 0 6px 14px -4px rgba(187, 54, 23, .35);
}
.button-primary:hover { background: var(--accent); filter: brightness(.94); border-color: transparent; }
.button-secondary { background: var(--surface); }
.button-secondary:hover { background: var(--surface-2); }
.button-danger { background: var(--surface); border-color: var(--line-strong); color: var(--neg); }
.button-danger:hover { background: var(--neg); color: #fff; border-color: transparent; }
.button-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.button-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.sm { min-height: 32px; padding: 4px 11px; font-size: 12px; border-radius: 8px; border-width: 1px; }
.button.sm .icon { width: 14px; height: 14px; }

/* ============================================================
   Paneles
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: 18px; }
.panel-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-heading h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.025em; display: flex; align-items: center; gap: 9px; }
.panel-heading h2 .icon { color: var(--accent); width: 18px; height: 18px; }
.panel-heading .sub, .panel-heading > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.panel-heading > span a { color: var(--accent-ink); font-weight: 600; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 13px 20px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.printer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.printer-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.printer-card-head { display: flex; align-items: center; gap: 12px; }
.printer-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--accent-wash); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.printer-card-title { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.printer-card-title strong { font-size: 14px; }
.printer-card-title small { font-size: 12px; color: var(--muted); }
.printer-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.printer-meta > div { display: flex; flex-direction: column; gap: 2px; }
.printer-meta span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.printer-meta strong { font-size: 12.5px; overflow-wrap: anywhere; }
.printer-edit summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); list-style: none; }
.printer-edit summary::-webkit-details-marker { display: none; }
.printer-edit summary::before { content: "▸ "; }
.printer-edit[open] summary::before { content: "▾ "; }

/* ============================================================
   Tablas
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }
.directory-table { width: 100%; border-collapse: collapse; }
.directory-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-weight: 700;
  padding: 11px 20px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0;
}
.directory-table td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.directory-table th.num { text-align: right; }
.directory-table tfoot td { border-top: 2px solid var(--line-strong); border-bottom: none; font-weight: 700; background: var(--surface-2); }
.directory-table tbody tr { transition: background .1s ease; }
.directory-table tbody tr[data-href], .directory-table tbody tr[onclick] { cursor: pointer; }
.directory-table tbody tr:hover { background: var(--surface-2); }
.directory-table tbody tr:last-child td { border-bottom: none; }
.directory-table td strong { font-weight: 650; }
.directory-table td small { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--mono); font-size: 12px; letter-spacing: -0.02em; }

/* ============================================================
   Insignias
   ============================================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.ok { background: var(--pos-wash); color: var(--pos); }
.status-badge.warn { background: var(--warn-wash); color: var(--warn); }
.status-badge.danger { background: var(--neg-wash); color: var(--neg); }
.status-badge.info { background: var(--info-wash); color: var(--brand-info); }
.status-badge.neutral { background: var(--surface-3); color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 550;
  background: var(--surface-3); color: var(--ink-soft); border: 1px solid var(--line);
}

/* ============================================================
   Formularios
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }
.field > label .hint { font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea,
input.control, select.control {
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  padding: 10px 13px; font-size: 14px; border-radius: var(--radius-sm);
  font-family: inherit; color: var(--ink); min-height: 42px;
  transition: border-color .12s, box-shadow .12s;
}
.field textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 53%, calc(100% - 13px) 53%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}
form.panel .form-actions { margin: 0; padding: 16px 20px; background: var(--surface-2); }

/* Autocompletar (sustituye <select> grandes) */
.ac { position: relative; }
.ac .ac-native { display: none; }
.ac-input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  padding: 10px 34px 10px 13px; font-size: 14px; border-radius: var(--radius-sm);
  font-family: inherit; color: var(--ink); min-height: 42px;
  transition: border-color .12s, box-shadow .12s;
}
.ac::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform .14s;
}
.ac.is-open::after { transform: translateY(-30%) rotate(225deg); }
.ac-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.ac-input::placeholder { color: var(--faint); }
.ac-input.ac-invalid { border-color: var(--neg); box-shadow: 0 0 0 3px var(--neg-wash); }
/* position:fixed (no absolute) a propósito: el desplegable vive dentro de tantos `.panel` con
   `overflow:hidden` (para las esquinas redondeadas) que, en `absolute`, cualquier panel más bajo
   que la lista se la recortaba por debajo — con pocas opciones no se notaba, pero en cuanto una
   lista creció (p.ej. el selector de Rol, al añadir los roles de sala/limpieza/reparto) se veía
   cortada aunque tuviera sitio de sobra en la página. `fixed` escapa de ese overflow:hidden de
   los antepasados; su posición (top/left/width) la calcula JS a partir del input en cada apertura.
   Se cierra en vez de reposicionar si la página hace scroll o cambia de tamaño mientras está
   abierto — más simple que perseguir al input, y es un desplegable que rara vez sigue abierto
   mientras se hace scroll. */
.ac-list {
  position: fixed; z-index: 300;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  max-height: 320px; padding: 4px;
}
.ac-opt {
  padding: 8px 11px; border-radius: 7px; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-opt:hover, .ac-opt.is-active { background: var(--surface-2); }
.ac-opt.is-current { color: var(--accent-ink); font-weight: 650; }
.ac-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }

/* Receta — perfil APPCC + imagen */
.appcc-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.appcc-profile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.appcc-profile input { position: absolute; opacity: 0; pointer-events: none; }
.appcc-profile.is-active, .appcc-profile:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.appcc-profile strong { font-size: 13px; }
.appcc-profile small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.recipe-img-preview { width: 180px; height: 135px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.recipe-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.recipe-img-preview span { font-size: 12px; color: var(--muted); }
.recipe-img-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; margin-top: 8px; }
.recipe-img-thumb { aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; background-size: cover; background-position: center; cursor: pointer; }
.recipe-img-thumb.is-sel { border-color: var(--accent); }

/* Receta — ficha por pestañas + panel de rentabilidad */
.tabs .tab:disabled { color: var(--faint); cursor: not-allowed; }
.recipe-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.recipe-rentabilidad-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.recipe-stat-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; }
.recipe-stat-box .label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.recipe-stat-box .value { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.recipe-stat-box .value.pos { color: var(--pos); }
.recipe-stat-box .value.neg { color: var(--neg); }
.recipe-stat-box.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.recipe-stat-box.accent .label { color: rgba(255, 255, 255, .75); }

.recipe-cost-summary { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.recipe-cost-summary th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--faint); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.recipe-cost-summary td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.recipe-cost-summary th.num, .recipe-cost-summary td.num { text-align: right; }
.recipe-cost-summary tfoot td { font-weight: 800; font-size: 13.5px; border-bottom: none; padding-top: 12px; }

.recipe-margin-slider { position: relative; height: 6px; background: var(--line); border-radius: var(--radius-pill); margin: 8px 0 8px; overflow: hidden; }
.recipe-margin-slider .track-target { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--accent-wash); border-radius: var(--radius-pill); }
.recipe-margin-slider .track-real { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--pos); border-radius: var(--radius-pill); }
.recipe-margin-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; }

.recipe-allergen-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px; background: var(--accent-wash); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; margin: 0 8px 8px 0; }

.recipe-sidebar { position: sticky; top: 78px; background: var(--espresso); color: #fff; border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.recipe-sidebar .eyebrow { color: rgba(255, 255, 255, .55); }
.recipe-sidebar h2 { margin: 0 0 10px; font-size: 21px; color: #fff; }
.recipe-sidebar-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.recipe-sidebar-stat:first-of-type { border-top: none; }
.recipe-sidebar-stat span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.recipe-sidebar-stat strong { font-size: 16.5px; font-weight: 800; }
.recipe-sidebar-stat strong.pos { color: #7fd99a; }
.recipe-sidebar-stat strong.neg { color: #f29a94; }
.recipe-sidebar-appcc { background: rgba(255, 255, 255, .08); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0 4px; }
.recipe-sidebar-appcc span { display: block; font-size: 11px; color: rgba(255, 255, 255, .55); margin-bottom: 2px; }
.recipe-sidebar-note { font-size: 11px; color: rgba(255, 255, 255, .45); margin: 0 0 14px; line-height: 1.4; }
.recipe-sidebar .button-primary { background: var(--accent); box-shadow: none; }

@media (max-width: 900px) {
  .recipe-layout { grid-template-columns: 1fr; }
  .recipe-sidebar { position: static; order: -1; }
  .recipe-rentabilidad-stats { grid-template-columns: 1fr; }
}

/* Producción — tarjetas de elaboración */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding: 16px 20px; }
.prod-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; }
.prod-card.is-order { border-left: 3px solid var(--accent); }
.prod-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-card-top > a { text-decoration: none; color: var(--ink); }
.prod-card-order { font-size: 12px; color: var(--accent-ink); text-decoration: none; }
.prod-card-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.prod-card-customer { margin: 0; font-size: 13px; font-weight: 600; }
.prod-lines { display: flex; flex-direction: column; gap: 7px; }
.prod-line { display: flex; gap: 9px; align-items: flex-start; }
.prod-line-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #e79a2e); margin-top: 5px; flex: 0 0 8px; }
.prod-line-dot.ok { background: var(--pos); }
.prod-line-dot.off { background: var(--line-strong); }
.prod-line strong { font-size: 13px; font-weight: 650; display: block; }
.prod-line small { font-size: 11.5px; color: var(--muted); display: block; margin-top: 1px; }
.prod-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.prod-status-form select { min-height: 34px; padding: 4px 8px; font-size: 12.5px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.pill-order { background: var(--accent-wash); color: var(--accent-ink); }
.pill-internal { background: var(--surface-2); color: var(--muted); }
.sl-qty-form { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.sl-qty-form input { width: 62px; border: 1.5px solid var(--line-strong); border-radius: 6px; padding: 5px 6px; font-size: 12.5px; text-align: right; background: var(--surface); color: var(--ink); }
.sl-qty-form input[name="unit"] { width: 58px; text-align: left; }
.sl-qty-form select { width: 58px; border: 1.5px solid var(--line-strong); border-radius: 6px; padding: 5px 3px; font-size: 12.5px; background: var(--surface); color: var(--ink); }
.button-icon-sm { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex: 0 0 auto; }
.button-icon-sm:hover { color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 560px) { .prod-grid { grid-template-columns: 1fr; padding: 14px; } }

/* Compositor de etiquetas */
.label-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.label-main { min-width: 0; }
.label-aside {
  position: sticky; top: 78px; background: var(--espresso, #241a14); color: #f4ede2;
  border-radius: var(--radius); padding: 20px; font-size: 13px;
}
.label-aside h2 { color: #fff; font-size: 16px; margin: 0 0 12px; }
.label-aside h3 { color: #fff; font-size: 13px; margin: 16px 0 6px; }
.label-aside-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.label-aside-row strong { font-size: 20px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.label-aside-note { font-size: 11.5px; color: rgba(244,237,226,.7); margin: 12px 0 0; line-height: 1.5; }
.label-aside ul { margin: 0; padding-left: 18px; font-size: 11.5px; color: rgba(244,237,226,.82); line-height: 1.6; }
.label-card2 { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 16px; margin-bottom: 14px; }
.label-card2-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.label-card2-head > div:first-child strong { font-size: 15px; }
.label-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.label-card2 .field { margin-bottom: 12px; }
.label-card2 .field:last-child { margin-bottom: 0; }
.label-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label-card2 .cash-qty { max-width: 130px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pack-item { display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.pack-item span { font-size: 11px; color: var(--muted); font-weight: 600; }
.pack-item input { border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 7px; font-family: var(--mono); font-size: 13px; background: var(--surface); min-height: 32px; }
input[data-unenvased] { font-family: var(--mono); font-weight: 700; background: var(--surface-2); }
@media (max-width: 900px) { .label-layout { grid-template-columns: 1fr; } .label-aside { position: static; } }
@media (max-width: 560px) { .label-two { grid-template-columns: 1fr; } }

/* Precios de venta: bruto (IVA incl.) destacado + neto en gris */
.price-gross { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-net { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .01em; margin-top: 1px; }
td .price-gross, td .price-net { white-space: nowrap; }
.tax-hint { color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 4px; display: block; }
.tax-hint strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.autocomplete-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 290px; overflow-y: auto;
}
.autocomplete-results button {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left;
  padding: 10px 14px; border: none; background: transparent; cursor: pointer; border-bottom: 1px solid var(--line);
}
.autocomplete-results button:last-child { border-bottom: none; }
.autocomplete-results button:hover { background: var(--accent-wash); }
.autocomplete-results strong { font-size: 13.5px; font-weight: 650; }
.autocomplete-results span { font-size: 11.5px; color: var(--muted); }

.notice {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
}
.notice.info { background: var(--info-wash); color: var(--brand-info); border-color: #d7d9fa; }
.notice.warn { background: var(--warn-wash); color: var(--warn); border-color: #f2ddb4; }
.notice.danger { background: var(--neg-wash); color: var(--neg); border-color: #f4cdcc; }
.notice.ok { background: var(--pos-wash); color: var(--pos); border-color: #cbe7d6; }

/* ============================================================
   Login
   ============================================================ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1000px 560px at 15% -10%, rgba(231, 154, 46, .22), transparent 55%),
    radial-gradient(900px 620px at 100% 110%, rgba(229, 72, 42, .2), transparent 52%),
    linear-gradient(165deg, #2e2119, #1c130d 75%);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 40px 34px; border: 1px solid rgba(255,255,255,.25);
}
.login-card .brand { text-align: center; margin-bottom: 28px; }
.login-card .brand .brand-logo { display: block; height: 30px; width: auto; margin: 0 auto 14px; }
.login-card .brand span { font-size: 13px; color: var(--muted); font-weight: 500; }
.login-error { background: var(--neg-wash); color: var(--neg); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; margin-bottom: 16px; border: 1px solid #f4cdcc; }
/* Avisos que además son un enlace (p.ej. "debes iniciar tu jornada" → lleva directo a
   Inicio/Cierre jornada) — mismo aspecto que el aviso normal, pero clicable de un vistazo. */
.login-error.is-link { display: block; }
.login-error.is-link, .notice.is-link { text-decoration: none; cursor: pointer; }
.login-error.is-link:hover, .notice.is-link:hover { filter: brightness(0.97); text-decoration: underline; }

/* ============================================================
   KPI
   ============================================================ */
/* Tarjetas independientes con gap, no una tira con divisores internos: con un número variable de
   casillas (de 1 a 8+ según la pantalla), forzar todas en una sola fila con columnas a partes
   iguales las estrechaba demasiado — un valor como "2.106,87 €" no cabía y quedaba cortado por el
   "overflow:hidden" de la tira. auto-fit con un ancho mínimo hace que cada casilla tenga sitio de
   sobra, pasando a una fila nueva cuando ya no caben, en vez de aplastarse. */
.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
.stat-item {
  padding: 16px 18px; min-width: 0; text-decoration: none; color: inherit; display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
.stat-item .label { font-size: 11.5px; color: var(--muted); font-weight: 500; display: block; letter-spacing: -0.01em; }
.stat-item .value { font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -0.04em; display: block; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-item .value.accent { color: var(--accent-ink); }
.stat-item .delta { font-size: 11.5px; font-weight: 550; margin-top: 3px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.stat-item .delta.up { color: var(--pos); }
.stat-item .delta.down { color: var(--neg); }
a.stat-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
a.stat-item[aria-current="true"] { background: var(--accent-wash); border-color: var(--accent); }

/* ============================================================
   Estado vacío
   ============================================================ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.empty-state p { font-size: 13px; }

/* ============================================================
   Panel diario
   ============================================================ */
.dash-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }

.decision {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s;
}
.decision:hover { border-color: var(--accent-line); background: var(--accent-wash); box-shadow: var(--shadow-xs); }
.decision strong { display: block; font-size: 13px; font-weight: 650; }
.decision small { color: var(--muted); font-size: 12px; }
.decision-cta { font-size: 12px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
@media (max-width: 560px) { .decision { grid-template-columns: 1fr; } .decision-cta { justify-self: start; } }

.spark { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.spark-bar { width: 100%; max-width: 32px; background: linear-gradient(180deg, var(--accent), var(--amber)); border-radius: 6px 6px 0 0; }
.spark-col:hover .spark-bar { filter: brightness(1.06); }
.spark-col span { font-size: 10px; color: var(--faint); font-weight: 600; font-family: var(--mono); }

/* ============================================================
   Pestañas
   ============================================================ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs .tab {
  padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.tabs button.tab { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-family: inherit; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tabs.tabs-sub { border-bottom: none; margin-bottom: 0; gap: 2px; }
.tabs.tabs-sub .tab { padding: 5px 10px; font-size: 12px; border-bottom-width: 2px; }

/* ============================================================
   Calendario
   ============================================================ */
.calendar { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.calendar-head, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-head div { padding: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: center; }
.calendar-cell { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.dim { background: var(--surface-2); }
.calendar-cell.today { background: var(--accent-wash); }
.calendar-cell .daynum { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--faint); }
.calendar-cell.today .daynum { color: var(--accent-ink); }
.cal-event { display: block; padding: 3px 7px; border-radius: 7px; font-size: 11px; line-height: 1.28; background: var(--surface-2); border-left: 3px solid var(--faint); }
.cal-event:hover { background: var(--accent-wash); }
.cal-event.done { border-left-color: var(--pos); }
.cal-event.progress { border-left-color: var(--amber); }
.cal-event .t { font-weight: 700; font-family: var(--mono); font-size: 10px; }
.cal-event .r { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event .c { color: var(--muted); }
.cal-more { font-size: 10.5px; font-weight: 700; color: var(--accent-ink); padding: 2px 7px; }
@media (max-width: 720px) {
  .calendar-head { display: none; }
  .calendar-grid { grid-template-columns: 1fr; }
  .calendar-cell { min-height: 0; border-right: none; }
  .calendar-cell.dim:not(.has-events) { display: none; }
  .calendar-cell .daynum::after { content: attr(data-label); font-weight: 500; color: var(--ink); margin-left: 6px; font-family: var(--font); }
}

/* ============================================================
   TPV y caja
   ============================================================ */
.cash-denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 10px; }
.cash-denom { display: flex; flex-direction: column; gap: 6px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.cash-denom > span:first-child { font-weight: 650; font-size: 13px; }
.cash-qty { display: flex; align-items: center; gap: 4px; }
.cash-qty button { width: 30px; height: 32px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--ink); flex: 0 0 30px; }
.cash-qty button:disabled { opacity: .4; cursor: not-allowed; }
.cash-qty input { flex: 1; min-width: 0; text-align: center; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px; font-family: var(--mono); font-size: 13px; background: var(--surface); min-height: 32px; }
.cash-denom small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.cash-result, .cash-stage { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.cash-result strong { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cash-stage { flex-direction: column; align-items: flex-start; gap: 2px; }
.cash-stage strong { font-size: 14px; }
.cash-stage small { color: var(--muted); }
.cash-close-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.cash-close-grid > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.cash-close-grid span { display: block; font-size: 11px; color: var(--muted); }

/* Compras — progreso del proceso: borrador → confirmada → enviada → recibida */
.purchase-stepper { display: flex; align-items: flex-start; margin: 0 0 20px; }
.purchase-step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.purchase-step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.purchase-step.is-done:not(:last-child)::after { background: var(--pos); }
.purchase-step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--muted); position: relative; z-index: 1; margin-bottom: 6px; }
.purchase-step.is-done .purchase-step-dot { background: var(--pos); border-color: var(--pos); color: #fff; }
.purchase-step.is-current .purchase-step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.purchase-step-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.purchase-step.is-current .purchase-step-label, .purchase-step.is-done .purchase-step-label { color: var(--ink); }
.cash-close-grid strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pos-total { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--espresso); color: #fff; }
.pos-total span { font-size: 12px; opacity: .72; }
.pos-total strong { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pos-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pos-methods form { margin: 0; display: block; }
.pos-method {
  width: 100%; min-height: 104px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s, box-shadow .12s;
}
.pos-method .icon { width: 26px; height: 26px; color: var(--accent-ink); stroke-width: 1.7; }
.pos-method:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 2px 10px -4px var(--accent); }
.pos-method:active:not(:disabled) { transform: scale(.98); }
.pos-method:disabled { opacity: .4; cursor: not-allowed; }
.pos-method:disabled .icon { color: var(--muted); }
.pos-cash-calc, .pos-method-confirm { margin-top: 12px; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.pos-method-confirm p { margin: 0 0 4px; }
.pos-cash-calc .field { margin: 0; }
.pos-cash-calc input { font-size: 20px; font-weight: 700; text-align: right; }
.pos-cash-change { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); }
.pos-cash-change span { color: var(--muted); font-weight: 600; }
.pos-cash-change strong { font-size: 19px; font-weight: 800; color: var(--pos); }
.pos-cash-change.insufficient strong { color: var(--neg); }
.pos-cash-breakdown { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pos-cash-chip {
  display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 6px 10px; box-shadow: var(--shadow-xs);
}
.pos-cash-chip-count { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pos-cash-chip-value { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.pos-cash-tip-btn {
  display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--accent); background: var(--accent-wash); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: center;
}
.pos-cash-tip-btn:hover { border-style: solid; }
.pos-cash-calc-actions { display: flex; gap: 8px; margin-top: 12px; }
.pos-cash-calc-actions .button { flex: 1; }
.pos-pin-widget { font-size: 13px; }
.pos-pin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-soft); }
.pos-pin-row input { width: 74px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 14px; letter-spacing: .1em; text-align: center; }
.pos-pin-error { color: var(--neg); font-size: 12px; }
.pos-pin-ok { display: flex; align-items: center; gap: 6px; color: var(--pos); font-weight: 600; }
.pos-pin-ok button { background: none; border: none; color: var(--accent-ink); font-weight: 700; cursor: pointer; padding: 0; margin-left: 4px; text-decoration: underline; font-size: 12.5px; }
.pos-pin-hint { margin: 6px 0 0; font-size: 12px; }

/* Pantalla de autoservicio "Inicio/Cierre jornada" — kiosko compartido, un empleado detrás de otro. */
.button-lg { min-height: 56px; padding: 14px 30px; font-size: 16px; border-radius: 14px; }
.button-journey-end { background: var(--warn-wash); border-color: transparent; color: var(--warn); }
.button-journey-end:hover { background: var(--warn); color: #fff; }
.journey-panel .panel-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 36px 24px; max-width: 420px; margin: 0 auto; }
.journey-panel .pos-pin-widget { width: 100%; }
.journey-panel .pos-pin-row { justify-content: center; }
.journey-result { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.journey-greeting { font-size: 19px; margin: 0; }
.journey-status { color: var(--muted); margin: 0 0 6px; font-size: 14px; }
.journey-done { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.journey-done p { font-size: 16px; font-weight: 650; margin: 0; }
.pos-receipt { font-family: var(--mono); font-size: 12px; line-height: 1.5; color: #111; max-width: 320px; margin: 0 auto; background: #fff; }
.pos-receipt .receipt-logo { height: 26px; width: auto; display: block; margin: 0 auto 10px; }
.pos-receipt .receipt-fiscal { text-align: center; display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.pos-receipt .receipt-fiscal strong { font-size: 12px; }
.pos-receipt .receipt-fiscal span { font-size: 10.5px; color: #444; }
.pos-receipt h3 { font-family: var(--mono); font-size: 13px; text-align: center; margin: 8px 0 2px; }
.pos-receipt p { margin: 1px 0; font-size: 11px; }
.pos-receipt hr { border-top: 1px dashed #999; margin: 8px 0; }
.pos-receipt .receipt-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.pos-receipt .receipt-line span { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.pos-receipt .receipt-line strong { flex: 0 0 auto; white-space: nowrap; }
.pos-receipt .receipt-grand { font-size: 14px; font-weight: 700; border-top: 1px solid #000; padding-top: 4px; margin-top: 2px; }
.pos-receipt .receipt-status { text-align: center; font-weight: 700; margin-top: 6px; }
.pos-receipt .receipt-test-banner {
  text-align: center; font-weight: 800; font-size: 11px; letter-spacing: .02em;
  border: 1.5px dashed #000; border-radius: 4px; padding: 4px 6px; margin: 6px 0;
}
.pos-receipt .receipt-review-qr {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed #999;
  text-decoration: none; color: inherit; cursor: pointer;
}
.pos-receipt .receipt-review-qr svg { display: block; }
.pos-receipt .receipt-review-qr .receipt-review-text { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pos-receipt .receipt-review-qr .receipt-review-text span { font-size: 10.5px; white-space: nowrap; color: #444; }
.pos-receipt .receipt-service-type {
  text-align: center; font-size: 16px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .03em; margin-top: 4px;
}
.pos-receipt .receipt-items { margin: 2px 0; }
.pos-receipt .receipt-items-head {
  display: grid; grid-template-columns: 1fr 26px 44px 52px; gap: 5px;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #555;
  border-bottom: 1px solid #000; padding-bottom: 3px; margin-bottom: 3px;
}
.pos-receipt .receipt-items-head span:not(:first-child) { text-align: right; }
.pos-receipt .receipt-item-row {
  display: grid; grid-template-columns: 1fr 26px 44px 52px; gap: 5px;
  font-size: 11px; padding: 3px 0; border-bottom: 1px dashed #ccc; align-items: start;
}
.pos-receipt .receipt-item-row .ri-name { overflow-wrap: break-word; }
.pos-receipt .receipt-item-row .ri-qty,
.pos-receipt .receipt-item-row .ri-price,
.pos-receipt .receipt-item-row .ri-total { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-receipt .receipt-payment { text-align: center; margin-top: 6px; padding: 4px 4px; }
.pos-receipt .receipt-payment-row { display: flex; align-items: baseline; justify-content: center; gap: 5px; }
.pos-receipt .receipt-payment span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: #555; white-space: nowrap; }
.pos-receipt .receipt-payment strong { font-size: 13px; font-weight: 800; }
.pos-receipt .receipt-payment small { display: block; font-size: 10px; color: #444; margin-top: 1px; }
.pos-receipt .receipt-payment-pending { border: 1.5px dashed #000; border-radius: 4px; padding: 5px 4px; }
.pos-receipt .receipt-payment-pending strong { font-size: 14px; }
@media (max-width: 560px) { .pos-methods { grid-template-columns: 1fr; } }
.pos-defer { width: 100%; margin-top: 12px; color: var(--muted); }
.pos-partial-summary { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.pos-partial-summary strong { color: var(--ink); }
.pos-payment-history { border-top: 1px solid var(--line); padding-top: 10px; }
.pos-payment-history h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 0 0 8px; }
.pos-payment-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 4px 0; }
.pos-payment-row + .pos-payment-row { border-top: 1px dashed var(--line); }

.pos-ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pos-ticket-actions .button { width: 100%; white-space: normal; text-align: center; }
@media (max-width: 420px) { .pos-ticket-actions { grid-template-columns: 1fr; } }

/* ============================================================
   Utilidades
   ============================================================ */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--neg); }
.text-success { color: var(--pos); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* Compat: clases del layout anterior (ya no se usan) */
.app-shell { display: block; }
.sidebar, .sidebar-overlay { display: none; }

/* ============================================================
   Responsive
   ============================================================ */
/* Escritorio "no tan pequeño" (portátil con la ventana no maximizada, p.ej.): en vez de saltar
   directamente al menú móvil en cuanto los nombres no caben, un tramo intermedio deja el menú
   horizontal pero solo con los iconos — el desplegable de cada grupo sigue mostrando el nombre
   completo de cada opción, así que no se pierde nada, solo se ahorra sitio en la barra. */
@media (max-width: 1150px) and (min-width: 901px) {
  .nav-trigger span { display: none; }
  .nav-trigger { padding: 9px 10px; gap: 3px; }
  .topnav-menu { gap: 0; }
}
@media (max-width: 900px) {
  .topnav-menu { display: none; }
  .topnav-burger { display: flex; }
  .topnav-search { width: 150px; }
  .topnav-search:focus-within { width: 200px; }
  .topnav-tpv-cta span { display: none; }
  .topnav-tpv-cta { padding: 9px; }
}
@media (max-width: 720px) {
  .topnav-clock { display: none; }
  /* En vez de ocultar el buscador entero, se coloca justo tras el logo (con `order`, sin mover el
     HTML) y se deja crecer entre el logo y los iconos de la derecha — el resto (TPV/avatar/menú)
     mantiene su sitio, el menú hamburguesa siempre el último a la derecha. */
  .topnav-brand { order: 0; }
  .topnav-search { display: flex; order: 1; flex: 1 1 auto; width: auto; min-width: 0; margin: 0 8px; }
  .topnav-search kbd { display: none; }
  .topnav-tpv-wrap { order: 2; }
  .topnav-user { order: 3; }
  .topnav-burger { order: 4; }
  .content { padding: 22px 15px 70px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .stat-band { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

  .directory-table.mobile-card-table thead { display: none; }
  .directory-table.mobile-card-table, .directory-table.mobile-card-table tbody,
  .directory-table.mobile-card-table tr, .directory-table.mobile-card-table td { display: block; width: 100%; }
  .directory-table.mobile-card-table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px; background: var(--surface); }
  .directory-table.mobile-card-table tr:hover { background: var(--surface); }
  .directory-table.mobile-card-table td { border: none; padding: 7px 10px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .directory-table.mobile-card-table td::before { content: attr(data-label); font-size: 10px; text-transform: uppercase; color: var(--faint); font-weight: 700; letter-spacing: .04em; flex: 0 0 auto; }
  .directory-table.mobile-card-table td.num { text-align: right; }
  .directory-table.mobile-card-table td:empty { display: none; }

  /* Líneas de pedido: tarjeta tipo recibo (nombre+quitar arriba, cantidad/precio/total abajo)
     en vez del genérico "una fila = una línea" que dejaba cada dato apilado y suelto. */
  .directory-table.order-lines-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name remove" "qty price" "total total";
    row-gap: 4px; column-gap: 10px; align-items: center;
  }
  .directory-table.order-lines-table tbody td { display: block; padding: 0; }
  .directory-table.order-lines-table tbody td::before { display: block; margin-bottom: 1px; }
  .directory-table.order-lines-table tbody td[data-label="Receta"] { grid-area: name; font-weight: 700; font-size: 14px; }
  .directory-table.order-lines-table tbody td[data-label="Receta"]::before { display: none; }
  .directory-table.order-lines-table tbody td[data-label="Cantidad"] { grid-area: qty; text-align: left; }
  .directory-table.order-lines-table tbody td[data-label="Precio/ud"] { grid-area: price; text-align: right; }
  .directory-table.order-lines-table tbody td[data-label="Total"] { grid-area: total; text-align: right; font-weight: 800; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 2px; }
  .directory-table.order-lines-table tbody td:not([data-label]) { grid-area: remove; }
  .directory-table.order-lines-table tbody td:not([data-label]) form { margin: 0; }
  .directory-table.order-lines-table tfoot { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; margin-top: 4px; background: var(--surface); }
  .directory-table.order-lines-table tfoot tr { display: flex; justify-content: space-between; align-items: baseline; border: none; margin: 0; padding: 4px 0; background: transparent; }
  .directory-table.order-lines-table tfoot td { display: block; padding: 0; text-align: left; }
  .directory-table.order-lines-table tfoot td.num { text-align: right; }
  .directory-table.order-lines-table tfoot td:empty { display: none; }
}
@media (max-width: 560px) {
  .page-header h1 { font-size: 23px; }
}

/* ============================================================
   Impresión
   ============================================================ */
@media print {
  .topnav, .nav-scrim, .nav-drawer, .page-header-actions, .form-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; border-color: #ddd; break-inside: avoid; }

  /* Aísla el ticket: oculta todo y solo deja visible el recibo, sacándolo del
     flujo para que ningún contenedor oculto lo arrastre (evita tickets en blanco). */
  body * { visibility: hidden !important; }
  #ticket-print, #ticket-print * { visibility: visible !important; }
  /* Se reserva un margen de seguridad a cada lado (zona no imprimible del rollo)
     y se centra el recibo en el ancho del papel. */
  #ticket-print {
    position: absolute; left: 0; right: 0; top: 0; margin: 0 auto;
    width: calc(var(--ticket-w, 80mm) - 8mm);
    box-shadow: none; border: none; padding: 0; background: #fff;
  }
  /* Ticket térmico Epson: una sola página continua, sin cortes internos ni saltos. */
  #ticket-print, #ticket-print * { break-inside: avoid !important; page-break-inside: avoid !important; }
  #ticket-print .pos-receipt { max-width: none !important; width: 100%; margin: 0 auto; padding: 2mm 0; font-size: 10.5px; }
  #ticket-print .pos-receipt .receipt-line { font-size: 10px; gap: 6px; }
  #ticket-print .pos-receipt .receipt-grand { font-size: 12px; }
  #ticket-print .pos-receipt h3 { font-size: 11.5px; }
  #ticket-print .pos-receipt .receipt-items-head { font-size: 8.5px; }
  #ticket-print .pos-receipt .receipt-item-row { font-size: 9.5px; }
  #ticket-print .pos-receipt .receipt-payment strong { font-size: 12px; }
  #ticket-print .pos-receipt .receipt-payment-pending strong { font-size: 13px; }
  #ticket-print .pos-receipt .receipt-service-type { font-size: 13px; }
  #ticket-print .pos-receipt .receipt-review-qr svg { width: 90px; height: 90px; }
}
@page { margin: 6mm 4mm; }

/* ============================================================
   Comprobador de zona de reparto (/home, las 6 plantillas) —
   estilo neutro y autocontenido para encajar dentro de cualquier tema.
   ============================================================ */
.dz-widget { margin-top: 14px; }
.dz-widget:not(.is-ready) { display: none; }
.dz-widget.is-ready ~ .dz-fallback { display: none !important; }
.dz-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dz-input {
  flex: 1 1 220px; min-width: 0; border: 1.5px solid rgba(0,0,0,.14); border-radius: 10px;
  padding: 11px 14px; font-size: 13.5px; font-family: inherit; background: #fff; color: #17130f;
}
.dz-input:focus { outline: none; border-color: #D5482F; box-shadow: 0 0 0 3px rgba(213,72,47,.15); }
.dz-btn {
  flex: 0 0 auto; border: none; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: 13.5px;
  font-family: inherit; cursor: pointer; background: #D5482F; color: #fff; transition: filter .12s;
}
.dz-btn:hover { filter: brightness(.95); }
.dz-btn:disabled { opacity: .6; cursor: wait; }
.dz-result { font-size: 13px; margin-top: 10px; line-height: 1.5; }
.dz-result:empty { display: none; }
.dz-result.is-ok { color: #1e7a3d; font-weight: 700; }
.dz-result.is-no { color: #5c534a; }
.dz-result.is-warn { color: #a83821; }

/* ============================================================
   Tablero de pedidos (kanban) — compartido entre /board (tema claro,
   dentro del layout normal) y /board/kds (tema oscuro, página suelta
   sin chrome). Ambas páginas reutilizan literalmente la misma plantilla
   (board/_kds_columns.php) y este mismo JS de interacción (expandir/
   contraer pedido, contraer al pulsar fuera, ampliar columna, acciones
   por fetch sin navegar); cada página solo define sus propios valores
   de --kds-* / --st-* para su tema, y aquí vive la estructura común.
   ============================================================ */
#kdsCols { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; }
.kds-block { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
.kds-block-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--kds-text-dim); margin: 0 0 6px 2px; flex: 0 0 auto; cursor: pointer; border-radius: 8px; padding: 3px 4px; }
.kds-block-label:hover { color: var(--kds-text); background: var(--kds-chip-bg); }
.kds-block-count { background: var(--kds-chip-bg); border-radius: 999px; padding: 1px 9px; font-size: 11px; color: var(--kds-text-dim); }
.kds-block-toggle { margin-left: auto; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: none; background: var(--kds-chip-bg); color: var(--kds-text-dim); cursor: pointer; flex: 0 0 auto; }
.kds-block-toggle:hover { color: var(--kds-text); }
.kds-block-toggle .kds-chevron { display: block; font-size: 11px; line-height: 1; transition: transform .15s; opacity: .9; }
.kds-block-toggle.is-collapsed .kds-chevron { transform: rotate(-90deg); }
.kds-block.is-collapsed { flex: 0 0 auto; }
.kds-block.is-collapsed .kds-block-row { display: none; }
.kds-block-row { display: flex; gap: 9px; align-items: stretch; flex: 1 1 auto; min-height: 0; }
.kds-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 0; transition: flex-grow .18s;
  border-radius: 12px; padding: 0 0 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--kds-accent, var(--kds-text-faint)) 20%, var(--kds-col-bg)) 0%, var(--kds-col-bg) 90px);
  border: 1px solid color-mix(in srgb, var(--kds-accent, var(--kds-text-faint)) 40%, transparent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
}
.kds-col.is-zoomed { flex: 2.6 1 0; }
.kds-block-row.has-zoom .kds-col:not(.is-zoomed) { flex: .55 1 0; }
.kds-col.st-confirmed { --kds-accent: var(--st-confirmed); }
.kds-col.st-en_elaboracion { --kds-accent: var(--st-en_elaboracion); }
.kds-col.st-finalizada { --kds-accent: var(--st-finalizada); }
.kds-col.st-envasado { --kds-accent: var(--st-envasado); }
.kds-col.st-en_transporte { --kds-accent: var(--st-en_transporte); }
.kds-col.st-delivered { --kds-accent: var(--st-delivered); }
.kds-col-head {
  display: flex; align-items: center; gap: 6px; width: 100%; font-size: 12.5px; font-weight: 800;
  color: var(--kds-text); background: none; border: none; border-bottom: 2px solid color-mix(in srgb, var(--kds-accent) 55%, transparent);
  padding: 8px 9px 7px; margin-bottom: 6px; cursor: pointer; flex: 0 0 auto; white-space: nowrap; overflow: hidden;
}
.kds-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--kds-accent); box-shadow: 0 0 6px 0 var(--kds-accent); flex: 0 0 auto; }
.kds-col-head span:nth-child(2) { flex: 1; text-overflow: ellipsis; overflow: hidden; }
.kds-col-count { background: color-mix(in srgb, var(--kds-accent) 30%, var(--kds-chip-bg)); border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; color: var(--kds-text); flex: 0 0 auto; }
.kds-col-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 0 6px; }
.kds-empty { text-align: center; color: var(--kds-text-faint); font-size: 12px; padding: 8px 0; }

.kds-card {
  background: linear-gradient(100deg, color-mix(in srgb, var(--kds-accent) 13%, var(--kds-card-bg)) 0%, var(--kds-card-bg) 55%);
  border-radius: 9px; margin-bottom: 6px; border-left: 4px solid var(--kds-accent); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
}
.kds-card.is-high-priority { box-shadow: 0 0 0 1.5px #d64545 inset, 0 1px 3px rgba(0,0,0,.16); }
.kds-card.is-delivery { box-shadow: 0 0 0 1.5px var(--kds-delivery) inset, 0 1px 3px rgba(0,0,0,.16); }
.kds-card.is-delivery.is-high-priority { box-shadow: 0 0 0 1.5px var(--kds-delivery) inset, 0 0 0 3px rgba(214,69,69,.55) inset, 0 1px 3px rgba(0,0,0,.16); }
.kds-card-summary { display: flex; flex-direction: column; gap: 5px; width: 100%; background: none; border: none; padding: 8px 9px; cursor: pointer; color: var(--kds-text); text-align: left; }
.kds-card-summary-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; width: 100%; row-gap: 2px; }
.kds-card-ref { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.kds-card-ref-num { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kds-card-confirmed-mini { font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--kds-text-dim); white-space: nowrap; }
.kds-card-meta { display: flex; align-items: center; gap: 5px; opacity: .95; flex: 0 0 auto; }
.kds-card-meta .icon { color: var(--kds-accent); }
.kds-card-time { font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--kds-text-dim); }
.kds-card-svc-time { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--kds-accent); }
.kds-card-detail { padding: 0 9px 9px; border-top: 1px solid color-mix(in srgb, var(--kds-accent) 25%, transparent); padding-top: 7px; }
.kds-card-customer { font-size: 11.5px; color: var(--kds-text-dim); margin-bottom: 5px; line-height: 1.3; }
.kds-card-confirmed { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--kds-text); }
.kds-card form { margin: 6px 0 0; }
/* Prioridad: rojo intenso y RELLENO (no solo contorno) para que destaque de verdad frente al
   resto de iconos de la tarjeta — el mismo rojo que ya usa el aviso de "alta prioridad" del
   borde de la tarjeta, para que ambas señales lean como una sola idea. */
.kds-stars { display: flex; gap: 1px; }
.kds-stars form { display: inline; margin: 0; }
.kds-star, .kds-star-mini { color: var(--kds-border); line-height: 0; }
.kds-star svg, .kds-star-mini svg { fill: none; transition: fill .1s, color .1s; }
.kds-star.filled, .kds-star-mini.filled { color: #e6453c; }
.kds-star.filled svg, .kds-star-mini.filled svg { fill: #e6453c; filter: drop-shadow(0 0 3px rgba(230,69,60,.55)); }
.kds-star { border: none; background: none; padding: 4px 2px; cursor: pointer; }
.kds-star:hover { color: #e6453c; }
.kds-stars-preview { display: flex; gap: 1px; }
.kds-star-mini { display: inline-flex; }
.kds-btn { display: block; width: 100%; padding: 9px 8px; font-size: 12.5px; font-weight: 700; border: none; border-radius: 7px; cursor: pointer; text-align: center; }
.kds-btn-primary { background: var(--kds-accent); color: #0c1017; }
.kds-btn-ghost { background: var(--kds-chip-bg); color: var(--kds-text); }
.kds-status-select select { width: 100%; padding: 7px 6px; font-size: 11.5px; border-radius: 7px; border: 1px solid var(--kds-border); background: var(--kds-col-bg); color: var(--kds-text); }

.kds-lines-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--kds-col-bg); border: none; border-radius: 7px; padding: 7px 9px; margin-top: 6px; color: var(--kds-text-dim); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.kds-lines-toggle.is-open .kds-chevron { transform: rotate(180deg); }
.kds-chevron { transition: transform .15s; opacity: .7; }
.kds-lines { margin-top: 5px; padding-top: 2px; border-top: 1px dashed var(--kds-border); }
.kds-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 2px; border-bottom: 1px solid var(--kds-border); }
.kds-line:last-of-type { border-bottom: none; }
.kds-line-info { display: flex; flex-direction: column; min-width: 0; }
.kds-line-name { font-size: 11.5px; font-weight: 700; color: var(--kds-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kds-line-qty { font-size: 10px; color: var(--kds-text-faint); }
.kds-line.completed .kds-line-name { opacity: .55; text-decoration: line-through; }
.kds-line-btn { flex: 0 0 auto; background: var(--st-finalizada); color: #0c1f16; border: none; border-radius: 6px; padding: 7px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.kds-line-done { color: var(--st-finalizada); flex: 0 0 auto; }
.kds-line-pending { font-size: 10px; color: var(--kds-text-faint); flex: 0 0 auto; }

@media (max-width: 700px) {
  .kds-block-row { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .kds-col, .kds-col.is-zoomed, .kds-block-row.has-zoom .kds-col:not(.is-zoomed) {
    flex: 0 0 82vw; width: 82vw; max-width: 320px; scroll-snap-align: start;
  }
}
