/* Ricas Tortas — pedidos y caja. Identidad tomada del letrero (amarillo, café, crema, rojo, ámbar y lima);
   tipografía Inter, controles grandes para trabajar rápido en tablet, celular y computador. */
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  /* Paleta del letrero (medida del logo original) */
  --logo-yellow: #fedd04;
  --logo-brown: #4a1206;
  --logo-cream: #fbeab7;
  --logo-red: #d41316;
  --logo-wine: #8a100b;
  --logo-amber: #fdb604;
  --logo-lime: #a9d504;
  /* Fondos y textos (contraste AA verificado: texto 15,6:1 · secundario 9,3:1 · tenue 5,2:1) */
  --bg: #fff8e8;
  --bg-2: #fbefd2;
  --surface: #ffffff;
  --ink: #3a1208;
  --ink-2: #6b3324;
  --muted: #87604c;
  --line: #eedcb9;
  /* Acento de marca para bordes, íconos y enlaces (vinotinto); amarillo para acciones principales */
  --brand: #8a100b;
  --brand-dark: #4a1206;
  --brand-soft: #fff1c2;
  --accent: #fedd04;
  --accent-hover: #ffe53d;
  --accent-dark: #e2c000;
  --accent-ink: #3a1208;
  /* Estados (siempre acompañados de texto) */
  --green: #4a7a10;
  --green-dark: #365a08;
  --green-soft: #eef6d2;
  --lime: #a9d504;
  --blue: #8a100b;
  --blue-soft: #fbe6df;
  --yellow: #fdb604;
  --yellow-soft: #fff0c4;
  --orange: #d97706;
  --orange-soft: #ffead0;
  --red: #c8111a;
  --red-soft: #fde4e1;
  --gray-soft: #f4ead8;
  --focus: #b86e00;
  /* Gráficos: una serie en ámbar (validado), rejilla tenue */
  --chart: #d97706;
  --chart-hover: #f29a1f;
  --chart-track: #f6ead2;
  --chart-grid: #f1e4cc;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(74, 18, 6, .06), 0 4px 14px rgba(74, 18, 6, .07);
  --shadow-lg: 0 14px 40px rgba(74, 18, 6, .18);
  --tap: 52px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* Navegación café oscuro con texto crema */
  --side-bg: #4a1206;
  --side-bg-2: #5a1a0c;
  --side-ink: #fbeab7;
  --side-muted: #d9b98a;
  --side-active: #6e2412;
  --caramel: #fedd04;
  /* Franja de bloques del letrero, en el mismo orden de colores */
  --stripe: repeating-linear-gradient(90deg, #d41316 0 26px, #8a100b 26px 52px, #fbeab7 52px 78px, #fdb604 78px 104px,
    #a9d504 104px 130px, #611508 130px 156px, #f31115 156px 182px, #4a1206 182px 208px);
  --hdr-h: 78px;
  color-scheme: light;
}

*, *::before, *::after { 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: 16px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.45rem, 3.6vw, 1.85rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .5em; }
a { color: var(--brand-dark); font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.15rem; }
.spacer { flex: 1; }
.icon { flex: none; display: block; }
.boot, .loading { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 1.1rem; }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--side-bg); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--side-active); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--green-dark); }
.btn-warning { background: var(--yellow); color: var(--ink); }
.btn-info { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost-danger { background: transparent; color: var(--red); border-color: transparent; }
.btn-ghost-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-light { background: rgba(255, 255, 255, .95); color: var(--ink); }
.btn-sm { min-height: 42px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn-lg { min-height: 58px; font-size: 1.05rem; width: 100%; }
.btn-xl { min-height: 64px; font-size: 1.15rem; width: 100%; border-radius: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 14px; border: 0; background: transparent; color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: var(--bg-2); }
.icon-btn.danger { color: var(--red); }
.icon-btn:disabled { opacity: .4; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 2px dashed var(--line); background: var(--surface); font-weight: 600; font-size: .95rem;
}
.chip-btn.has-note { border-style: solid; border-color: var(--orange); background: var(--orange-soft); }

/* ---------------- Chips ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; white-space: nowrap; line-height: 1.3;
}
/* Marcas con texto libre (motivo de una corrección): pueden ocupar varias líneas sin salirse de su tarjeta. */
.chip-wrap { white-space: normal; border-radius: 10px; max-width: 100%; overflow-wrap: anywhere; }
.chip-yellow { background: var(--yellow-soft); color: #6e4100; }
.chip-blue { background: var(--blue-soft); color: #6b3324; }
.chip-green { background: var(--green-soft); color: #365a08; }
.chip-red { background: var(--red-soft); color: #8a100b; }
.chip-orange { background: var(--orange-soft); color: #8a3a00; }
.chip-gray { background: var(--gray-soft); color: var(--ink-2); }
.chip-brand { background: var(--brand-soft); color: var(--brand-dark); }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------------- Estructura ---------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: rgba(255, 246, 234, .96); border-bottom: 2px solid var(--line); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px; }
.brand-mark, .login-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 1.1rem; box-shadow: 0 3px 0 var(--brand-dark);
}
.brand-name { font-weight: 700; font-size: 1.3rem; color: var(--brand-dark); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-btn {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 600;
}
.usermenu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 250px; padding: 8px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 2px solid var(--line);
}
.dropdown-head { display: flex; flex-direction: column; padding: 8px 12px 12px; border-bottom: 2px solid var(--line); margin-bottom: 6px; }
.dropdown-head span { color: var(--muted); font-size: .9rem; }
.dropdown button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px;
  border: 0; background: none; border-radius: 12px; text-align: left; font-weight: 600;
}
.dropdown button:hover { background: var(--bg); }
.dropdown button.danger { color: var(--red); }
.conn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.conn-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.conn-ok { background: var(--green-soft); color: var(--green-dark); }
.conn-warn { background: var(--yellow-soft); color: #6e4100; }
.conn-warn .conn-dot { animation: blink 1s infinite; }
.conn-bad { background: var(--red-soft); color: #8a100b; }
@keyframes blink { 50% { opacity: .2; } }
.sound-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); font-weight: 600; position: relative;
}
.sound-btn.on { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.sound-btn.compact .sound-label { display: none; }
.sound-hint { font-size: .75rem; color: var(--orange); }
.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: var(--surface);
  border-bottom: 2px solid var(--line); scrollbar-width: none; position: sticky; top: 66px; z-index: 20;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; background: transparent;
  font-weight: 700; color: var(--ink-2);
}
.tab:hover { background: var(--bg); }
.tab.active { background: var(--ink); color: #fff; }
.main { flex: 1; }
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 120px; }
.page.narrow { max-width: 640px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 12px; }
.section-title { font-size: 1.4rem; margin: 0 0 12px; }
.section-head .section-title { margin: 0; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; display: grid; gap: 12px; }
.card.center { justify-items: center; text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------------- Alertas y avisos ---------------- */
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; margin: 0 0 12px; font-weight: 600; }
.alert-bad { background: var(--red-soft); color: #8a100b; border: 2px solid #f5b8b2; }
.alert-warn { background: var(--yellow-soft); color: #6e4100; border: 2px solid #f5d77a; }
.alert-info { background: var(--blue-soft); color: #6b3324; border: 2px solid #eccfb0; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); border: 2px solid #cde49a; }
.reset-username { margin: 0; font-size: 1.05rem; }
.banners { position: sticky; top: 66px; z-index: 25; display: grid; gap: 6px; padding: 6px 12px 0; }
.is-admin .banners { top: 130px; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 18px;
  color: #fff; font-weight: 700; font-size: 1.15rem; box-shadow: var(--shadow-lg); animation: drop .35s ease;
}
.banner-text { flex: 1; }
.banner .icon-btn { color: #fff; }
.banner-new { background: var(--brand); animation: drop .35s ease, flash 1s ease 3; }
.banner-ready { background: var(--green); animation: drop .35s ease, flash 1s ease 3; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes flash { 50% { filter: brightness(1.25); transform: scale(1.01); } }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toast { padding: 14px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); animation: drop .25s ease; }
.toast-ok { background: var(--green-dark); }
.toast-bad { background: var(--red); }

/* ---------------- Formularios ---------------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field.inline { margin: 0; }
.field-label { font-weight: 700; }
.field-hint { font-size: .85rem; color: var(--muted); }
.field-error { font-size: .9rem; color: var(--red); font-weight: 600; }
.input {
  width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; font-weight: 700;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.input-lg { min-height: 62px; font-size: 1.2rem; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-addon { flex: none; min-width: 90px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; font-weight: 700; }
.check input { width: 26px; height: 26px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch {
  position: relative; width: 64px; height: 38px; flex: none; border-radius: 999px; border: 0;
  background: #d8c3a3; transition: background .15s;
}
.switch.on { background: var(--green); }
.switch-knob { position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on .switch-knob { transform: translateX(26px); }
.switch-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.segmented { display: inline-flex; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 4px; gap: 4px; }
.segmented button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; font-weight: 700; color: var(--ink-2); }
.segmented button.active { background: var(--ink); color: #fff; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------------- Login ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.login-hero {
  display: grid; place-content: center; justify-items: center; gap: 10px; padding: 40px 20px 24px; text-align: center;
  background: radial-gradient(circle at 20% 20%, #ff8fb8 0, transparent 40%), radial-gradient(circle at 80% 70%, #ffb36b 0, transparent 45%), var(--brand);
  color: #fff;
}
.login-hero h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); }
.login-hero p { font-size: 1.2rem; opacity: .95; }
.login-mark { width: 84px; height: 84px; font-size: 2rem; border-radius: 26px; background: #fff; color: var(--brand); box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.login-card { width: min(460px, calc(100% - 32px)); margin: -12px auto 40px; background: var(--surface); padding: 24px; border-radius: 28px; box-shadow: var(--shadow-lg); display: grid; gap: 6px; }
.login-card h2 { margin-bottom: 8px; }
@media (min-width: 900px) {
  .login { grid-template-columns: 1fr 1fr; align-items: center; }
  .login-hero { min-height: 100vh; }
  .login-card { margin: 0 auto; }
}

/* ---------------- Mesero: mesas ---------------- */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
@media (min-width: 700px) { .table-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; } }
.table-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  aspect-ratio: 1; min-height: 104px; padding: 10px 6px; border-radius: var(--radius); border: 3px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); transition: transform .08s;
}
.table-tile:active { transform: scale(.96); }
.table-label { font-size: .9rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.table-number { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 700; line-height: 1; }
.table-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 22px; }
.table-chips .chip { font-size: .72rem; padding: 2px 7px; }
.table-tile.is-draft { border-color: var(--orange); background: #fff6dc; }
.table-tile.is-busy { border-color: var(--blue); }
.table-tile.is-ready { border-color: var(--green); background: var(--green-soft); }
.table-tile.is-failed { border-color: var(--red); background: var(--red-soft); }
.ready-strip { background: var(--green); color: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.ready-strip h2 { margin-bottom: 10px; }
.ready-list { display: flex; gap: 10px; overflow-x: auto; }
.ready-card { flex: none; display: grid; text-align: left; gap: 2px; padding: 12px 16px; border-radius: 16px; border: 0; background: #fff; color: var(--green-dark); }
.ready-table { font-size: 1.4rem; font-weight: 700; }

/* ---------------- Mesero: pedido ---------------- */
.order-layout { width: 100%; }
.order-layout.is-wide { display: grid; grid-template-columns: minmax(0, 1fr) 420px; max-width: 1400px; margin: 0 auto; align-items: start; }
.order-layout.is-wide .order-main { max-width: none; }
.order-side { position: sticky; top: 70px; max-height: calc(100vh - 70px); overflow-y: auto; padding: 16px 16px 24px 0; }
.is-admin .order-side { top: 136px; max-height: calc(100vh - 136px); }
.order-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.table-title { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--brand-dark); }
.category-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
.category-tile {
  position: relative; display: block; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .08s;
}
.category-tile:active { transform: scale(.98); }
.category-photo { aspect-ratio: 16 / 9; }
@media (min-width: 560px) { .category-photo { aspect-ratio: 4 / 3; } }
.category-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px; color: #fff;
  font-size: clamp(1.6rem, 5vw, 2rem); font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.tone-teal .category-name { background: linear-gradient(transparent, rgba(8, 92, 99, .95) 35%); }
.tone-coffee .category-name { background: linear-gradient(transparent, rgba(92, 50, 24, .95) 35%); }
.tone-amber .category-name { background: linear-gradient(transparent, rgba(160, 80, 0, .95) 35%); }
.tone-green .category-name { background: linear-gradient(transparent, rgba(22, 101, 52, .95) 35%); }
.tone-berry .category-name { background: linear-gradient(transparent, rgba(156, 17, 73, .95) 35%); }
.tone-blue .category-name { background: linear-gradient(transparent, rgba(21, 68, 168, .95) 35%); }
.tone-orange .category-name { background: linear-gradient(transparent, rgba(170, 66, 7, .95) 35%); }
.count-badge, .qty-badge {
  position: absolute; top: 10px; right: 10px; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 1.3rem;
  border: 3px solid #fff; box-shadow: var(--shadow);
}
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; }
.pill.active { color: #fff; border-color: transparent; background: var(--ink); }
.pill.tone-teal.active { background: #4a7a10; }
.pill.tone-coffee.active { background: #4a1206; }
.pill.tone-amber.active { background: #b45309; }
.pill.tone-green.active { background: #4f7a3a; }
.pill.tone-berry.active { background: var(--brand); }
.pill.is-off { opacity: .6; border-style: dashed; }

.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1300px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product {
  display: grid; grid-template-columns: 128px 1fr; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); border: 3px solid transparent;
}
.product.in-order { border-color: var(--brand); background: #fff6dc; }
.product.sold-out { opacity: .65; }
@media (min-width: 640px) { .product { grid-template-columns: 1fr; padding: 0; overflow: hidden; } }
.product-photo { position: relative; display: block; padding: 0; border: 0; background: none; border-radius: 16px; overflow: hidden; }
.product-photo .photo { aspect-ratio: 4 / 3; height: 100%; }
@media (min-width: 640px) { .product-photo { border-radius: 0; } .product-body { padding: 4px 14px 14px; } }
.product-body { display: grid; gap: 6px; align-content: start; }
.product-name { font-size: 1.15rem; font-weight: 700; }
.product-desc { color: var(--muted); font-size: .9rem; margin: 0; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); }
.soldout { position: absolute; inset: auto 0 0 0; padding: 6px; background: rgba(58,18,8,.85); color: #fff; text-align: center; font-weight: 700; }

/* Contador grande */
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.step {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.15); transition: transform .08s;
}
.step:active:not(:disabled) { transform: scale(.9); }
.step-minus { background: var(--bg-2); color: var(--ink); }
.step-plus { background: var(--brand); color: #fff; }
.step:disabled { opacity: .35; box-shadow: none; }
.step-value { min-width: 44px; text-align: center; font-size: 1.6rem; font-weight: 700; }
.stepper-lg .step { width: 72px; height: 72px; }
.stepper-lg .step-value { min-width: 96px; font-size: 3rem; }
.stepper-sm { gap: 4px; }
.stepper-sm .step { width: 46px; height: 46px; }
.stepper-sm .step-value { min-width: 36px; font-size: 1.35rem; }

/* Fotos */
.photo { position: relative; background: var(--bg-2); overflow: hidden; width: 100%; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, #fbefd2, #fbefd2 12px, #fff6e2 12px, #fff6e2 24px); color: var(--muted); font-size: .85rem; font-weight: 700; }
.photo-badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(58, 18, 8, .62); color: #fff; font-size: .68rem; font-weight: 600; }

/* Resumen */
.summary { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.summary-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary-empty { padding: 18px; text-align: center; color: var(--ink-2); background: var(--bg); border-radius: 16px; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.line { padding: 10px; border-radius: 18px; background: var(--bg); display: grid; gap: 8px; }
.line.is-missing { background: var(--red-soft); }
.line-top { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.line-photo { width: 56px; height: 56px; border-radius: 12px; }
.line-photo.photo-empty { aspect-ratio: 1; font-size: 0; }
.line-info { display: grid; }
.line-total { font-size: 1.1rem; }
.line-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-controls .chip-btn { margin-left: auto; padding: 0 12px; }
.line-note, .order-note { margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--orange-soft); color: #8a3a00; font-weight: 600; }
.item-note { display: block; font-style: normal; color: #b45309; font-size: .9rem; font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 4px; border-top: 3px dashed var(--line); font-size: 1.2rem; }
.summary-total strong { font-size: 1.8rem; font-weight: 700; }
.send-btn { font-size: 1.35rem; }
.send-failed { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--red-soft); border: 2px solid #f5b8b2; color: #8a100b; }
.summary-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.summary-bar-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 640px; margin: 0 auto; min-height: 72px; padding: 0 18px;
  border: 0; border-radius: 22px; background: var(--green); color: #fff; font-weight: 700; font-size: 1.2rem; box-shadow: 0 6px 0 var(--green-dark), var(--shadow-lg);
}
.summary-bar-btn.is-failed { background: var(--red); box-shadow: 0 6px 0 #8a100b, var(--shadow-lg); }
.summary-bar-count { display: grid; place-items: center; min-width: 44px; height: 44px; border-radius: 999px; background: #fff; color: var(--green-dark); }
.summary-bar-btn.is-failed .summary-bar-count { color: var(--red); }
.summary-bar-label { flex: 1; text-align: left; }
.sheet-page { max-width: 680px; }

/* Confirmación de envío */
.sent { display: grid; place-items: center; min-height: 70vh; }
.sent-card { width: min(560px, 100%); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 28px 22px; text-align: center; display: grid; gap: 12px; }
.sent-check { width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: pop .4s ease; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.1); } }
.sent-meta { font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); }
.sent-items { list-style: none; margin: 0; padding: 0; text-align: left; display: grid; gap: 4px; }
.sent-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* ---------------- Tarjetas de pedido (mesero) ---------------- */
.group { margin-bottom: 18px; }
.order-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.order-card { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border-left: 8px solid var(--line); display: grid; gap: 6px; }
.order-card.status-listo { border-left-color: var(--green); background: #f4f9e4; }
.order-card.status-preparacion { border-left-color: var(--blue); }
.order-card.status-nuevo { border-left-color: var(--yellow); }
.order-card.status-anulado { opacity: .7; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-table { font-size: 1.5rem; font-weight: 700; }
.order-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.order-card-foot { display: flex; justify-content: space-between; border-top: 2px dashed var(--line); padding-top: 8px; font-size: 1.1rem; }

/* ---------------- Caja: tablero ---------------- */
.board-page { max-width: 1500px; }
.board { display: grid; gap: 16px; }
.board-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.board-tab { flex: 1 0 auto; min-height: 56px; padding: 0 14px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface); font-weight: 700; }
.board-tab.active.tab-nuevo { border-color: var(--yellow); background: var(--yellow-soft); }
.board-tab.active.tab-preparacion { border-color: var(--blue); background: var(--blue-soft); }
.board-tab.active.tab-listo { border-color: var(--green); background: var(--green-soft); }
.badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .9rem; margin-left: 6px; }
.column { display: none; flex-direction: column; gap: 12px; }
.column.is-current { display: flex; }
.column-title { display: none; padding: 12px 16px; border-radius: 16px; font-size: 1.2rem; }
.column-nuevo .column-title { background: var(--yellow); color: var(--ink); }
.column-preparacion .column-title { background: var(--blue); color: #fff; }
.column-listo .column-title { background: var(--green); color: #fff; }
.column-empty { text-align: center; color: var(--muted); padding: 24px; border: 3px dashed var(--line); border-radius: 18px; }
@media (min-width: 1000px) {
  .board-tabs { display: none; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .column { display: flex; }
  .column-title { display: block; }
}
.ticket { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 8px; border: 3px solid transparent; }
.ticket.status-nuevo { border-color: var(--yellow); }
.ticket.is-fresh { animation: fresh 1.1s ease-in-out infinite; border-color: var(--brand); }
@keyframes fresh { 50% { box-shadow: 0 0 0 8px rgba(254, 221, 4, .5), var(--shadow); } }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-table { font-size: 1.8rem; font-weight: 700; }
.ticket-time { display: grid; text-align: right; }
.ticket-time small { color: var(--muted); font-weight: 600; }
.ticket-meta { margin: 0; color: var(--ink-2); font-weight: 600; }
.ticket-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ticket-items li { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ticket-qty { display: grid; place-items: center; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; font-size: 1.1rem; }
.ticket-name { font-weight: 600; font-size: 1.05rem; }
.ticket-line { color: var(--muted); }
.ticket-total { display: flex; justify-content: space-between; font-size: 1.15rem; }
.ticket-total strong { font-size: 1.4rem; }
.ticket-secondary { display: flex; justify-content: space-between; gap: 8px; }
.recent { margin-top: 20px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.recent summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.recent-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.recent-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recent-list li > span:first-child { flex: 1; }

/* ---------------- Historial ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: grid; border-top: 6px solid var(--line); }
.stat span { color: var(--muted); font-weight: 600; }
.stat strong { font-size: 1.6rem; }
.stat-green { border-top-color: var(--green); }
.stat-brand { border-top-color: var(--brand); }
.stat-red { border-top-color: var(--red); }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history-item { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.history-row { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 14px; border: 0; background: none; text-align: left; }
.history-table { font-weight: 700; font-size: 1.1rem; }
.history-who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-detail { padding: 4px 16px 14px; border-top: 2px dashed var(--line); display: grid; gap: 8px; }
@media (max-width: 640px) {
  .history-row { grid-template-columns: auto 1fr auto; }
  .history-who, .history-row .chip { display: none; }
}
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------------- Administración del menú ---------------- */
.cat-card { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.cat-card-photo { border-radius: 14px; aspect-ratio: 4 / 3; }
.cat-card-body { display: grid; gap: 10px; justify-items: start; }
.admin-products { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.admin-product { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.admin-product.is-off { opacity: .7; }
.admin-product-photo { border-radius: 12px; aspect-ratio: 4 / 3; }
.admin-product-info { display: grid; gap: 2px; justify-items: start; }
.admin-product-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .cat-card { grid-template-columns: 110px 1fr; }
  .admin-product { grid-template-columns: 80px 1fr; }
  .admin-product-actions { grid-column: 1 / -1; justify-content: space-between; }
}
.archived { margin-top: 16px; display: grid; gap: 10px; justify-items: start; }
.form-grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 320px; } }
.photo-picker { display: grid; gap: 10px; align-content: start; }
.photo-picker-preview .photo { border-radius: 16px; aspect-ratio: 4 / 3; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-meta { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--bg); }
.mini-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; width: 100%; margin-top: 8px; }
.mini-tables span { display: grid; place-items: center; height: 42px; border-radius: 10px; background: var(--bg); font-weight: 700; color: var(--ink-2); }

/* ---------------- Usuarios ---------------- */
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.user-card.is-off { opacity: .65; }
.user-card-info { display: grid; gap: 4px; }
.user-card-info .chip { margin-right: 6px; }
.user-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.role-card { display: grid; gap: 4px; padding: 14px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface); text-align: left; }
.role-card span { color: var(--muted); font-size: .9rem; }
.role-card.active { border-color: var(--brand); background: var(--brand-soft); }

/* ---------------- Créditos ---------------- */
.credits { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.credit { display: grid; grid-template-columns: 110px 1fr; gap: 12px; background: var(--surface); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.credit-photo { border-radius: 12px; aspect-ratio: 4 / 3; }
.credit-info { display: grid; gap: 3px; font-size: .9rem; justify-items: start; overflow-wrap: anywhere; }

/* ---------------- Diálogos ---------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(58, 18, 8, .55); display: grid; place-items: end center; padding: 0; }
@media (min-width: 700px) { .modal-backdrop { place-items: center; padding: 24px; } }
.modal { width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); animation: drop .2s ease; }
@media (min-width: 700px) { .modal { border-radius: 26px; } }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 16px 8px 22px; }
.modal-body { padding: 8px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px max(18px, env(safe-area-inset-bottom)); border-top: 2px solid var(--line); flex-wrap: wrap; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .user-name, .brand-name { display: none; }
  .conn { padding: 6px 10px; }
  .product { grid-template-columns: 112px 1fr; }
  .step { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= Caja y cobros ================= */
/* Los avisos no bloquean toques; en caja van arriba para no tapar el botón principal (Cobrar / Confirmar). */
.toasts { pointer-events: none; }
.is-cashier .toasts { top: 140px; bottom: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.role-select select { min-height: 44px; padding: 4px 10px; width: auto; }
.cj-page { padding-bottom: 160px; }
.cj-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.cj-session { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.cj-session-text { flex: 1; display: grid; min-width: 220px; }
.cj-session-open { background: var(--green-soft); color: #365a08; border: 2px solid #d6e9a0; }
.cj-session-closed { background: var(--yellow-soft); color: #6e4100; border: 2px solid #f5d77a; }

.cj-table-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cj-tile {
  display: grid; gap: 4px; align-content: start; text-align: left; min-height: 150px; padding: 14px 16px;
  border-radius: var(--radius); border: 3px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
button.cj-tile:active { transform: scale(.98); }
.cj-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cj-tile-table { font-size: 1.5rem; font-weight: 700; }
.cj-tile-sub { color: var(--ink-2); font-size: .95rem; }
.cj-tile-amount { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.cj-tile-foot { font-size: .9rem; color: var(--muted); font-weight: 600; }
.cj-tile-cta { color: var(--blue); }
.cj-tile-prep { font-size: .8rem; color: var(--muted); }
.cj-tile.is-open { border-color: var(--yellow); background: #fffbea; }
.cj-tile.is-open .cj-tile-amount { color: #6e4100; }
.cj-tile.is-open.is-settled { border-color: var(--green); background: #f4f9e4; }
.cj-tile.is-pending { border-color: var(--blue); border-style: dashed; }
.cj-tile.is-free { opacity: .72; box-shadow: none; }
.cj-attention { background: var(--orange-soft); border: 3px solid var(--orange); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.cj-attention h2 { display: flex; gap: 8px; align-items: center; color: #8a3a00; margin-bottom: 4px; }
.cj-attention-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cj-attention-card { display: grid; text-align: left; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--orange); background: #fff; font-weight: 600; }
.cj-legacy-link { display: flex; align-items: center; gap: 12px; width: 100%; margin: 18px 0; padding: 14px 16px; border-radius: 18px; border: 2px solid #eccfb0; background: var(--blue-soft); color: #6b3324; text-align: left; font-weight: 700; }
.cj-legacy-link .icon:last-child { transform: rotate(180deg); }
.cj-recent { margin-top: 20px; }
.cj-recent-list, .cj-history, .cj-moves, .cj-legacy-list, .cj-pick-list, .cj-pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cj-recent-list button, .cj-history button {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 56px;
  padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: left; font-weight: 700;
}

/* Abrir cuenta: selección táctil de pedidos */
.cj-pick { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface); text-align: left; }
.cj-pick.is-on { border-color: var(--green); background: #f4f9e4; }
.cj-pick-box { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--ink-2); color: #fff; }
.cj-pick.is-on .cj-pick-box { background: var(--green); border-color: var(--green); }
.cj-pick-body { display: grid; gap: 2px; }
.cj-pick-total { font-size: 1.25rem; font-weight: 700; }

/* Barra inferior con la acción principal */
.cj-actionbar {
  position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end;
  margin: 18px -4px 0; padding: 12px 4px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18%);
}
.cj-actionbar .btn-xl { width: auto; min-width: min(100%, 360px); flex: 1 1 320px; }
.cj-actionbar-info { display: grid; text-align: right; }
.cj-actionbar-info strong { font-size: 1.6rem; }
.cj-note { color: var(--ink-2); font-weight: 700; }
.cj-paid-banner { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; font-size: 1.2rem; }

/* Cuenta */
.cj-check-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.cj-check-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cj-check-title h1 { font-size: clamp(2rem, 6vw, 2.8rem); color: var(--brand-dark); }
.cj-check-number { font-size: 1.3rem; font-weight: 700; color: var(--ink-2); }
.cj-changed .icon { display: inline-block; vertical-align: -5px; }
.cj-totals { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.cj-big { display: grid; gap: 2px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border: 3px solid transparent; }
.cj-big-label { font-weight: 700; color: var(--ink-2); font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }
.cj-big-value { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 700; line-height: 1.1; }
.cj-big-sub { font-weight: 700; }
.cj-big.tone-due { border-color: var(--yellow); background: var(--yellow-soft); color: #5c3a00; }
.cj-big.tone-ok { border-color: var(--green); background: var(--green-soft); color: #365a08; }
.cj-big.tone-warn { border-color: var(--orange); background: var(--orange-soft); color: #8a3a00; }
.cj-big.tone-change { border-color: var(--green-dark); background: var(--green); color: #fff; }
.cj-big.tone-change .cj-big-label { color: #fff; }
.cj-check-layout { display: grid; gap: 18px; }
@media (min-width: 980px) { .cj-check-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.cj-order { background: var(--surface); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px; display: grid; gap: 6px; }
.cj-order.is-void { opacity: .6; }
.cj-order.is-void .cj-items { text-decoration: line-through; }
.cj-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cj-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cj-items li { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: start; padding: 4px 0; border-bottom: 1px solid var(--line); }
.cj-qty { display: grid; place-items: center; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; }
.cj-item-name { font-weight: 600; }
.cj-item-total { font-weight: 700; }
.cj-order-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.1rem; }
.cj-order-foot strong { margin-right: auto; }
.cj-pay { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 6px; border-left: 8px solid var(--green); }
.cj-pay.is-void { border-left-color: var(--red); opacity: .75; }
.cj-pay.is-void .cj-pay-amount { text-decoration: line-through; }
.cj-pay.is-refund { border-left-color: var(--orange); }
.cj-pay-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cj-pay-amount { font-size: 1.4rem; }
.cj-pay-meta { display: grid; gap: 2px; font-size: .95rem; }
.cj-pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cj-method-tag { gap: 6px; }

/* Cobrar */
.cj-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.cj-method {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px;
  border-radius: 18px; border: 3px solid var(--line); background: var(--surface); font-weight: 700; font-size: 1.15rem;
}
.cj-method.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.cj-pay-grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .cj-pay-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.cj-pay-fields { display: grid; gap: 12px; align-content: start; }
.cj-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.cj-quick-btn { min-height: 56px; border-radius: 14px; border: 2px solid var(--green); background: #f4f9e4; color: #365a08; font-weight: 700; font-size: 1.05rem; }
.cj-quick-btn.is-exact { grid-column: 1 / -1; background: var(--green-soft); }
.cj-result { display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; }
.cj-result-label { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.cj-result-value { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 700; line-height: 1; }
.cj-result.is-change { background: var(--green); color: #fff; }
.cj-result.is-missing { background: var(--red-soft); color: #8a100b; border: 3px solid var(--red); }
.cj-confirm-check { padding: 12px 14px; border-radius: 16px; border: 3px solid var(--blue); background: var(--blue-soft); }
.cj-review { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-lg); border: 3px solid var(--ink); display: grid; gap: 12px; }
.cj-review-rows { display: grid; gap: 0; margin: 0; }
.cj-review-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cj-review-rows dt { color: var(--ink-2); }
.cj-review-rows dd { margin: 0; font-weight: 700; text-align: right; }
.cj-review-rows .is-strong dd, .cj-review-rows .is-strong dt { font-size: 1.25rem; color: var(--ink); }
.cj-review-rows .is-change { background: var(--green-soft); padding: 8px 10px; border-radius: 10px; }
.cj-review-rows .is-change dd { font-size: 1.5rem; color: #365a08; }
.cj-review-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cj-review-actions .btn-xl { flex: 2 1 260px; width: auto; }
.cj-review-actions .btn-lg { flex: 1 1 180px; width: auto; }
.cj-uncertain { background: var(--red-soft); border: 3px solid var(--red); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; color: #8a100b; }
.cj-uncertain h2 { display: flex; align-items: center; gap: 8px; }
.cj-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 24px 12px; }
.cj-done-icon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--green); color: #fff; }
.cj-done h1 { font-size: clamp(2.2rem, 7vw, 3rem); color: var(--green-dark); }
.cj-done-grid { display: grid; gap: 12px; width: min(900px, 100%); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cj-change-reminder { font-size: 1.4rem; font-weight: 700; color: #365a08; background: var(--green-soft); padding: 10px 18px; border-radius: 14px; }
.cj-done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; width: min(900px, 100%); }
.cj-done-actions .btn-xl, .cj-done-actions .btn-lg { width: auto; flex: 1 1 260px; }

/* Sesión de caja */
.cj-open { max-width: 980px; }
.cj-open h1, .cj-session-panel h1 { display: flex; align-items: center; gap: 10px; }
.cj-summary { display: grid; gap: 14px; margin-bottom: 16px; }
@media (min-width: 900px) { .cj-summary { grid-template-columns: 1.3fr 1fr; } }
.cj-summary-cash, .cj-summary-other { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.cj-session-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.cj-session-actions .btn-lg { width: auto; flex: 1 1 240px; }
.cj-moves li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.cj-moves li.is-void { opacity: .6; text-decoration: line-through; }

/* Recibo: vista previa e impresión (58 / 80 mm). Sin estilos en línea: compatible con la CSP. */
.cj-receipt-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.cj-receipt-toolbar .btn-lg { width: auto; }
.cj-print-help { max-width: 760px; }
.receipt-sheet {
  margin: 16px auto; padding: 4mm 3mm; background: #fff; color: #000; box-shadow: var(--shadow-lg);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 600; line-height: 1.3;
}
.receipt-sheet.fmt-58 { width: 48mm; font-size: 8.5pt; }
.receipt-sheet.fmt-80 { width: 72mm; font-size: 10pt; }
.rc-head { display: grid; text-align: center; gap: 1mm; padding-bottom: 2mm; border-bottom: 1px dashed #000; }
.rc-business { font-size: 1.5em; font-weight: 700; letter-spacing: .02em; }
.rc-copy { font-weight: 700; border: 1px solid #000; padding: .5mm; }
.rc-meta, .rc-totals { margin: 2mm 0; display: grid; gap: .5mm; }
.rc-meta div, .rc-totals div { display: flex; justify-content: space-between; gap: 2mm; }
.rc-meta dd, .rc-totals dd { margin: 0; text-align: right; font-weight: 600; }
.rc-totals dd { white-space: nowrap; }
.rc-items { width: 100%; border-collapse: collapse; margin: 2mm 0; border-top: 1px dashed #000; border-bottom: 1px dashed #000; }
.rc-items th { text-align: left; font-weight: 700; padding: 1mm 0; border-bottom: 1px solid #000; }
.rc-items td { vertical-align: top; padding: .7mm 0; }
.rc-items th:last-child, .rc-items td:last-child { text-align: right; white-space: nowrap; padding-left: 1mm; }
.rc-items td:first-child, .rc-items th:first-child { width: 2.4em; }
.rc-items small { display: block; font-size: .85em; }
.rc-strong { font-weight: 700; font-size: 1.08em; }
.rc-status { text-align: center; font-weight: 700; font-size: 1.5em; margin: 2mm 0; padding: 1mm 0; border-top: 2px solid #000; border-bottom: 2px solid #000; }
.rc-partial { font-size: 1.05em; }
.rc-notice, .rc-thanks { text-align: center; font-size: .85em; margin: 1mm 0; }

@media print {
  @page { margin: 2mm; }
  body { background: #fff; }
  .topbar, .tabs, .banners, .toasts, .no-print, .cj-session { display: none !important; }
  .main .page { padding: 0; max-width: none; }
  .receipt-sheet { margin: 0; box-shadow: none; }
}
.cj-filters .field { min-width: 160px; margin: 0; }
.cj-hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cj-hist { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 6px; border-left: 8px solid var(--green); }
.cj-hist.is-void { border-left-color: var(--red); opacity: .75; }
.cj-hist.is-void .cj-hist-amount { text-decoration: line-through; }
.cj-hist-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cj-hist-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cj-hist-amount { margin-left: auto; font-size: 1.4rem; }
.cj-hist-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; color: var(--ink-2); }
.cj-movements section { margin-bottom: 14px; }

/* ================= Diseño profesional: menú lateral, encabezado y tarjetas ================= */
.shell.layout { flex-direction: row; align-items: stretch; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none; z-index: 50;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 18px; overflow-y: auto;
  background: var(--side-bg); color: var(--side-ink);
}
.side-brand {
  display: grid; justify-items: center; gap: 2px; padding: 4px 0 18px; border: 0; background: none;
  color: var(--side-ink); border-bottom: 1px solid rgba(255, 255, 255, .08); border-radius: 0;
}
.side-brand .icon { color: var(--caramel); margin-bottom: 4px; }
.side-brand-sub { font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: var(--side-muted); }
.side-nav { display: grid; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
  border: 0; border-radius: 12px; background: transparent; color: var(--side-ink); font-weight: 500; font-size: .98rem; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.side-link .icon { color: var(--side-muted); }
.side-link:hover { background: rgba(255, 255, 255, .06); }
.side-link.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--caramel); }
.side-link.active .icon { color: var(--caramel); }
.side-shift {
  margin-top: auto; display: grid; gap: 10px; padding: 16px; border-radius: 14px;
  background: var(--side-bg-2); border: 1px solid rgba(255, 255, 255, .07);
}
.side-shift-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--side-muted); font-weight: 600; }
.side-shift-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #ffb4a8; }
.side-shift-state.is-open { color: #c8ec6a; }
.side-shift-state .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.side-shift dl { margin: 0; display: grid; gap: 2px; font-size: .86rem; }
.side-shift dt { color: var(--side-muted); font-size: .78rem; }
.side-shift dd { margin: 0 0 6px; color: #fff8e8; font-weight: 600; overflow-wrap: anywhere; }
.side-shift-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: #fff8e8; font-weight: 600;
}
.side-shift-btn:hover { background: rgba(255, 255, 255, .08); }
.drawer-scrim { display: none; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hdr {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: var(--hdr-h);
  padding: 12px max(24px, env(safe-area-inset-right)) 12px 28px;
  background: rgba(255, 248, 232, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.hdr-menu { display: none; color: var(--ink); }
.hdr-title { flex: 1; min-width: 0; }
.hdr-h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-sub { margin: 2px 0 0; color: var(--muted); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-clock {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.hdr-clock .icon { color: var(--brand); }
.hdr-clock span { display: grid; line-height: 1.25; }
.hdr-clock strong { font-size: .88rem; font-weight: 600; color: var(--ink); }
.hdr-clock small { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.layout .user-btn { gap: 10px; min-height: 52px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.avatar {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--side-bg)); color: #fff; font-weight: 700; font-size: 1rem;
}
.user-text { display: grid; text-align: left; line-height: 1.2; }
.user-text strong { font-size: .92rem; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text small { font-size: .78rem; color: var(--muted); }
.layout .main { flex: 1; }
.layout .page { padding: 24px max(24px, env(safe-area-inset-right)) 120px 28px; }
.layout .banners { top: var(--hdr-h); padding: 8px 24px 0; }
.layout .order-side { top: calc(var(--hdr-h) + 4px); max-height: calc(100vh - var(--hdr-h) - 4px); }
.is-cashier .toasts { top: calc(var(--hdr-h) + 12px); }

@media (max-width: 1279px) {
  .hdr-clock strong { display: none; }
  .user-text { display: none; }
  .layout .order-layout.is-wide { grid-template-columns: minmax(0, 1fr) 360px; }
}
/* Tablet en vertical y celular: el menú se abre como cajón con el botón ☰. */
@media (max-width: 1023px) {
  :root { --hdr-h: 64px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); height: auto;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
    padding-top: max(22px, env(safe-area-inset-top));
  }
  .drawer-open .sidebar { transform: none; }
  .drawer-open .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 45; border: 0; background: rgba(40, 10, 4, .55); }
  .hdr-menu { display: inline-grid; }
  .hdr { gap: 10px; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); }
  .hdr-h1 { font-size: 1.2rem; }
  .layout .page { padding: 16px max(14px, env(safe-area-inset-right)) 120px max(14px, env(safe-area-inset-left)); }
  .layout .banners { padding: 6px 12px 0; }
}
@media (max-width: 700px) {
  .hdr-sub, .hdr-clock { display: none; }
  .layout .user-btn { padding: 4px; border: 0; background: none; min-height: 48px; }
  .layout .user-btn > .icon { display: none; }
  .conn { padding: 6px 10px; font-size: .8rem; }
}

/* Paneles y tarjetas */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.panel-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 2px; color: var(--ink); }
.card { border: 1px solid var(--line); border-radius: 16px; }

/* Indicadores del día */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis-loading { min-height: 92px; }
.kpi {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 16px 18px; min-height: 92px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); text-align: left; color: var(--ink); font: inherit;
}
.kpi-link { cursor: pointer; transition: border-color .15s ease, transform .08s ease; }
.kpi-link:hover { border-color: var(--brand); }
.kpi-link:active { transform: scale(.99); }
.kpi-icon { grid-row: span 2; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); }
.kpi-body { display: grid; min-width: 0; }
.kpi-label { color: var(--muted); font-size: .86rem; font-weight: 500; }
.kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta, .kpi-note { grid-column: 2; font-size: .8rem; font-weight: 600; }
.kpi-delta { display: inline-flex; align-items: baseline; gap: 6px; }
.kpi-delta small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-note { color: var(--muted); font-weight: 500; }

/* Campos de dinero: teclado numérico del sistema en celular y tablet; teclado físico en computador. */
.money-field { display: grid; gap: 6px; }
.money-label { font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.money-control {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 16px; cursor: text;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.money-control:hover { border-color: #e6cfa6; }
.money-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.money-prefix { color: var(--muted); font-weight: 600; font-size: 1.15rem; }
.money-input {
  flex: 1; min-width: 0; width: 100%; padding: 10px 0; border: 0; outline: none; background: transparent;
  font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink);
}
.money-input::placeholder { color: #c9ab86; }
.money-lg .money-control { min-height: 68px; }
.money-lg .money-prefix { font-size: 1.5rem; }
.money-lg .money-input { font-size: 1.9rem; font-weight: 700; }
.money-hint { font-size: .85rem; color: var(--muted); }
.money-error { font-size: .88rem; color: var(--red); font-weight: 600; }
.money-field.has-error .money-control { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* Ajustes del tema en piezas existentes */
.chip { font-weight: 600; padding: 3px 10px; }
.input { border-width: 1.5px; border-radius: 12px; font-weight: 500; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.segmented { border-width: 1px; border-radius: 12px; }
.segmented button { border-radius: 9px; font-weight: 600; }
.segmented button.active { background: var(--side-bg); }
.cj-method { border-width: 1.5px; border-radius: 14px; font-weight: 600; }
.cj-method.is-on { background: var(--side-bg); border-color: var(--side-bg); }
.cj-quick-btn { border-width: 1.5px; border-radius: 12px; font-weight: 600; }
.cj-session { border-radius: 14px; }
.cj-session-open, .cj-session-closed { border-width: 1px; }
.cj-review { border: 1px solid var(--line); border-radius: 16px; }
.cj-pay-summary { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 12px; }
.cj-pay-summary .btn-xl { margin-top: 4px; }
.stat { border: 1px solid var(--line); border-top-width: 4px; border-radius: 16px; }
.stat span { font-weight: 500; font-size: .9rem; }
.stat strong { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-blue { border-top-color: var(--blue); }
.stat-yellow { border-top-color: var(--yellow); }
.dropdown { border-width: 1px; border-radius: 14px; }
.dropdown button { font-weight: 500; border-radius: 10px; }
.modal { border-radius: 20px 20px 0 0; }
@media (min-width: 700px) { .modal { border-radius: 20px; } }
.table-title { color: var(--ink); }

/* Ingreso */
.login-hero {
  background: radial-gradient(circle at 18% 18%, rgba(212, 163, 115, .35) 0, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(139, 90, 43, .55) 0, transparent 48%), var(--side-bg);
  color: #fff8e8;
}
.login-card { border: 1px solid var(--line); border-radius: 20px; }

@media print {
  .shell.layout { display: block; }
  .sidebar, .hdr, .drawer-scrim { display: none !important; }
  .layout .page { padding: 0; }
}

/* Historial de pedidos: estado de preparación y de cobro */
.history-item { border: 1px solid var(--line); }
.history-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.history-total { font-variant-numeric: tabular-nums; }
.history-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.history-detail .btn { justify-self: start; }
.history-charge-line { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.history-items { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.history-charge { flex: none; background: var(--accent); color: var(--accent-ink); font-weight: 800; border-radius: 10px; padding: 8px 16px; }
.history-item.is-chargeable .history-row:hover:not(:disabled) .history-charge { background: var(--accent-dark); }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.history-conflict { display: grid; gap: 10px; }
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { flex: none; }
.hist-note { margin: -4px 0 14px; }
@media (max-width: 640px) {
  .history-row .history-chips { grid-column: 1 / -1; justify-content: flex-start; }
  .history-row .history-chips .chip { display: inline-flex; }
  .history-row .history-total { grid-row: 1; grid-column: 3; text-align: right; }
}

/* Montos siempre dentro de su recuadro: el tamaño se ajusta al ancho del recuadro, no al de la pantalla
   (con el menú lateral el contenido es más angosto que la ventana). La primera línea es para navegadores viejos. */
.cj-big, .cj-result, .stat, .kpi-body, .cj-tile { container-type: inline-size; min-width: 0; }
.cj-big-value, .cj-result-value, .stat strong, .kpi-value, .cj-tile-amount {
  display: block; max-width: 100%; white-space: nowrap; overflow: visible; text-overflow: clip;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.cj-big { align-content: space-between; padding: 14px 16px 16px; }
.cj-big-label { font-size: .78rem; letter-spacing: .05em; }
.cj-big-value { font-size: 1.5rem; font-size: clamp(1.1rem, 15cqi, 2.4rem); }
.cj-result-value { font-size: 1.9rem; font-size: clamp(1.3rem, 15cqi, 3rem); }
.stat strong { font-size: 1.2rem; font-size: clamp(1rem, 15cqi, 1.5rem); }
.kpi-value { font-size: 1.2rem; font-size: clamp(1rem, 15cqi, 1.5rem); }
.cj-tile-amount { font-size: 1.5rem; font-size: clamp(1.15rem, 15cqi, 2rem); }

/* Avisos: en computador y tablet horizontal van a la esquina derecha para no tapar títulos ni montos. */
.toast { font-size: .95rem; font-weight: 600; border-radius: 12px; }
@media (min-width: 1024px) {
  .is-cashier .toasts { left: auto; right: 24px; transform: none; width: min(380px, calc(100% - 48px)); }
}

/* Aviso: el dinero registrado no se anula ni se borra */
.cj-novoid { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink-2); font-size: .92rem; }
.cj-novoid .icon { color: var(--brand-dark); margin-top: 2px; }
.linklike { border: 0; background: none; padding: 0; color: var(--brand-dark); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Mesero: pedir un toque para habilitar el sonido de los avisos */
.alerts-bar {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); margin: 10px 12px 0; padding: 12px 16px; text-align: left;
  border: 1.5px solid var(--yellow); border-radius: 14px; background: var(--yellow-soft); color: #5c3a00; cursor: pointer;
  animation: drop .3s ease;
}
.alerts-bar .icon { flex: none; color: #8a5a00; }
.alerts-bar span { display: grid; gap: 2px; }
.alerts-bar strong { font-size: 1rem; }
.alerts-bar small { font-size: .85rem; color: #6e4100; }
@media (min-width: 1024px) { .alerts-bar { width: calc(100% - 48px); margin: 12px 24px 0; } }
.dropdown-note { margin: 4px 0 0; padding: 8px 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

/* ===== Ajustes responsive (auditoría en 12 tamaños, de 320 px a 1920 px) ===== */
/* Botones con texto largo: hacen salto de línea en vez de salirse de la pantalla. */
.btn { white-space: normal; text-align: center; max-width: 100%; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
.stepper { max-width: 100%; }
/* Productos: columnas según el espacio disponible (con o sin menú lateral y resumen del pedido). */
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
@media (max-width: 400px) {
  .product { grid-template-columns: 88px 1fr; gap: 10px; padding: 8px; }
  .product .step { width: 44px; height: 44px; }
  .product .step-value { min-width: 32px; font-size: 1.35rem; }
  .cat-card { grid-template-columns: 84px 1fr; gap: 12px; }
}
/* Cobro en celular: métodos de pago uno debajo del otro. */
@media (max-width: 520px) {
  .cj-methods { grid-template-columns: 1fr; gap: 8px; }
  .cj-method { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 56px; padding: 0 16px; font-size: 1.05rem; }
  .panel { padding: 14px; }
}
/* Tablero: con el menú lateral, entre 1024 y 1149 px no caben 3 columnas legibles → pestañas, como en tablet vertical. */
@media (min-width: 1024px) and (max-width: 1149px) {
  .board-tabs { display: flex; }
  .board { grid-template-columns: 1fr; }
  .column { display: none; }
  .column.is-current { display: flex; }
  .column-title { display: none; }
}
/* Categorías en tonos cálidos, coherentes con el panel café (antes turquesa, verde frío, fucsia y azul). */
.tone-teal .category-name { background: linear-gradient(transparent, rgba(74, 98, 66, .95) 35%); }
.tone-green .category-name { background: linear-gradient(transparent, rgba(79, 122, 58, .95) 35%); }
.tone-berry .category-name { background: linear-gradient(transparent, rgba(128, 52, 46, .95) 35%); }
.tone-blue .category-name { background: linear-gradient(transparent, rgba(106, 67, 41, .95) 35%); }
.pill.tone-teal.active { background: #4a7a10; }
.pill.tone-berry.active { background: #8a100b; }
.pill.tone-blue.active { background: #6e2412; }
.pill.active { color: #fff; }

/* ================= Dueño: análisis del negocio (solo lectura) ================= */
.ow-page { max-width: 1400px; }
.ow-filters { display: grid; gap: 12px; margin-bottom: 18px; min-width: 0; }
.ow-presets { justify-self: start; }
.ow-custom, .ow-subfilters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.ow-custom .field, .ow-subfilters .field { margin: 0; }
.ow-custom .field { min-width: 150px; }
.ow-mesa select { min-width: 120px; }
.ow-search { flex: 1 1 220px; min-width: 0; }
.ow-range-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ow-range-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.ow-range-label .icon { color: var(--brand); }
.ow-downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.ow-download { text-decoration: none; }
.is-stale { opacity: .55; transition: opacity .2s; }

.ow-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ow-stats-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ow-stat {
  container-type: inline-size; display: grid; gap: 4px; align-content: start; min-width: 0;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.ow-stat.is-hero { background: linear-gradient(135deg, #fffbea, #fff0c2); border-color: #f5d77a; }
@media (min-width: 640px) { .ow-stat.is-hero { grid-column: span 2; } }
.ow-stat-label { font-size: .86rem; color: var(--muted); font-weight: 500; }
.ow-stat-value { font-size: 1.4rem; font-size: clamp(1.1rem, 13cqi, 1.75rem); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.ow-stat.is-hero .ow-stat-value { font-size: 2rem; font-size: clamp(1.5rem, 11cqi, 3rem); }
.ow-stat-delta { font-size: .82rem; font-weight: 600; color: var(--muted); }
.ow-stat-delta.up { color: var(--green-dark); }
.ow-stat-delta.down { color: var(--red); }
.ow-stat-note { font-size: .8rem; color: var(--muted); }
.ow-cash-note { color: var(--muted); font-size: .9rem; margin: -4px 0 14px; }

.ow-grid-2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
@media (min-width: 1100px) { .ow-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ow-span-2 { grid-column: 1 / -1; } }
.ow-page > .panel { margin-bottom: 14px; }
.ow-card { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ow-card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.ow-card-head, .ow-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0; }

/* Gráfico de columnas: una serie, barras delgadas, rejilla tenue, tooltip al pasar o con flechas. */
.ow-chart { margin: 0; display: grid; gap: 8px; min-width: 0; }
.ow-plot { position: relative; width: 100%; min-width: 0; border-radius: 10px; }
.ow-plot:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.ow-plot svg { display: block; overflow: visible; }
.ow-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ow-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ow-maxlabel { fill: var(--ink); font-size: 12px; font-weight: 600; }
.ow-bar { fill: var(--chart); transition: fill .12s; }
.ow-bar.is-active { fill: var(--chart-hover); }
.ow-tooltip {
  position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); display: grid; gap: 2px; padding: 8px 12px;
  background: var(--side-bg); color: #fff8e8; border-radius: 10px; font-size: .82rem; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lg);
}
.ow-tooltip strong { font-size: 1rem; }
.ow-tooltip .muted { color: var(--side-muted); }

/* Barras horizontales con el valor escrito. */
.ow-barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ow-barlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: end; }
.ow-barlist-label { display: grid; min-width: 0; font-weight: 600; }
.ow-barlist-label span { overflow-wrap: anywhere; }
.ow-barlist-label small, .ow-barlist-value small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.ow-barlist-value { display: grid; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ow-barlist-track { grid-column: 1 / -1; height: 10px; background: var(--chart-track); border-radius: 4px; overflow: hidden; }
.ow-barlist-bar { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }

/* Órdenes con sus productos. */
.ow-count { color: var(--muted); margin: 0 0 10px; }
.ow-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ow-order { display: grid; gap: 10px; min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.ow-order.is-cancelled { opacity: .72; }
.ow-order-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title total" "chips chips"; gap: 6px 12px; align-items: center; }
.ow-order-title { grid-area: title; display: grid; min-width: 0; }
.ow-order-chips { grid-area: chips; display: flex; gap: 6px; flex-wrap: wrap; }
.ow-order-total { grid-area: total; font-size: 1.2rem; text-align: right; white-space: nowrap; }
.ow-items, .ow-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ow-items th, .ow-table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ow-items td, .ow-table td { padding: 7px 8px; border-bottom: 1px solid #f3e6cd; vertical-align: top; }
.ow-items tfoot td { border-bottom: 0; color: var(--ink-2); }
.ow-table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 700; }
.ow-items .num, .ow-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ow-qty { font-weight: 700; width: 3em; }
.ow-item-name { font-weight: 600; overflow-wrap: anywhere; }
.ow-timeline { margin: 0; }
@media (max-width: 520px) {
  .ow-items th:nth-child(3), .ow-items td:nth-child(3) { display: none; }
  .ow-items td, .ow-items th { padding: 6px 4px; }
}

/* Tablas de productos y días: en celular cada fila se vuelve una tarjeta con etiquetas. */
.ow-table-wrap { overflow-x: auto; }
.ow-products td:first-child small { display: block; }
.ow-mini-track { display: block; height: 6px; margin-top: 6px; background: var(--chart-track); border-radius: 3px; overflow: hidden; max-width: 240px; }
.ow-mini-bar { display: block; height: 100%; background: var(--chart); border-radius: 0 3px 3px 0; }
@media (max-width: 700px) {
  .ow-products thead, .ow-days thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ow-products tr, .ow-days tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ow-products td, .ow-days td { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border: 0; text-align: right; }
  .ow-products td::before, .ow-days td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; font-weight: 500; }
  .ow-products td:first-child, .ow-days td:first-child { grid-column: 1 / -1; display: block; text-align: left; font-weight: 600; }
  .ow-products td:first-child::before, .ow-days td:first-child::before { content: none; }
  .ow-table tfoot td { border-top: 0; }
}

/* Listas de cobros, devoluciones, movimientos y turnos. */
.ow-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.ow-rows li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid #f3e6cd; min-width: 0; }
.ow-rows li:last-child { border-bottom: 0; }
.ow-rows li.is-void .ow-row-main strong { text-decoration: line-through; }
.ow-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ow-row-meta { font-size: .88rem; overflow-wrap: anywhere; }
.ow-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.user-card-owner { margin: 0; max-width: 320px; }

/* Dueño en celular: los filtros nunca ensanchan la página (los grupos de botones se desplazan dentro de su fila). */
.ow-filters { grid-template-columns: minmax(0, 1fr); }
.ow-subfilters > .segmented, .ow-card-head > .segmented { min-width: 0; max-width: 100%; }
.ow-subfilters > .segmented { flex: 1 1 100%; }
@media (max-width: 700px) { .ow-products td.num, .ow-days td.num { white-space: normal; } }
@media (max-width: 420px) { .ow-products tr, .ow-days tr { grid-template-columns: minmax(0, 1fr); } }
.ow-card { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 700px) { .ow-products, .ow-products tbody, .ow-days, .ow-days tbody, .ow-days tfoot { display: block; width: 100%; } }

/* ================= Identidad Ricas Tortas (letrero original) ================= */
/* Logo: el letrero original sin el fondo negro; nunca se deforma (ancho fijo, alto automático). */
.brand-logo { display: block; line-height: 0; }
.brand-logo img { display: block; width: 100%; height: auto; border-radius: 6px; }
/* Franja de bloques del letrero, discreta. */
.brand-stripe { display: block; height: 6px; background: var(--stripe); border-radius: 3px; }

/* Botones: amarillo de la marca para las acciones principales, con texto café (12:1). */
.btn-primary, .btn-success { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-dark); box-shadow: 0 2px 0 var(--accent-dark); }
.btn-primary:hover:not(:disabled), .btn-success:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-dark); }
.btn-primary .icon, .btn-success .icon { color: var(--accent-ink); }
.btn-warning { background: var(--yellow); color: var(--ink); border-color: #e09e00; }
.btn-info { background: var(--brand); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn-primary:disabled, .btn-success:disabled { background: #efe2bd; border-color: #e6d4a6; color: #7a5a48; opacity: 1; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.input:focus, .money-control:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px rgba(254, 221, 4, .35); }
.linklike, a { color: var(--brand); }

/* Etiquetas de estado: color de la marca + texto. */
.chip { font-weight: 600; }
.chip-yellow { background: #fff3a8; color: #5c3a00; }
.chip-orange { background: #ffe5b3; color: #7a3d00; }
.chip-green { background: #eaf5c8; color: #365a08; }
.chip-red { background: #fde4e1; color: #8a100b; }
.chip-blue { background: #f6e8cf; color: #6b3324; }
.chip-gray { background: #f1e6d6; color: #6b3324; }
.chip-brand { background: var(--accent); color: var(--accent-ink); }

/* Menú lateral: café oscuro, texto crema, opción activa en amarillo. */
.sidebar { background: linear-gradient(180deg, #4a1206 0%, #3c0e05 100%); }
.side-brand { display: grid; justify-items: center; gap: 8px; padding: 2px 4px 16px; border-bottom: 1px solid rgba(251, 234, 183, .14); }
.side-brand .brand-logo { width: 100%; max-width: 216px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.side-brand-sub { font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--side-muted); }
.side-link { color: var(--side-ink); }
.side-link .icon { color: var(--side-muted); }
.side-link:hover { background: rgba(254, 221, 4, .1); }
.side-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
.side-link.active .icon { color: var(--accent-ink); }
.side-shift { background: rgba(251, 234, 183, .07); border-color: rgba(251, 234, 183, .14); }
.side-shift dd { color: var(--side-ink); }
.side-shift-btn { color: var(--side-ink); border-color: rgba(251, 234, 183, .3); }
.side-shift-btn:hover { background: rgba(254, 221, 4, .12); }

/* Encabezado claro con la franja del letrero debajo. */
.hdr { background: rgba(255, 248, 232, .95); border-bottom: 0; }
.hdr::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--stripe); opacity: .9; }
.hdr-clock .icon { color: var(--brand); }
.avatar { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent-dark); }
.layout .user-btn { border-color: var(--line); }

/* Tablero de pedidos: Nuevos (amarillo) → En preparación (ámbar) → Listos (lima). Texto café siempre. */
.column-nuevo .column-title { background: var(--accent); color: var(--ink); }
.column-preparacion .column-title { background: var(--yellow); color: var(--ink); }
.column-listo .column-title { background: var(--lime); color: var(--ink); }
.column-title .badge { background: var(--ink); color: #fff; }
.ticket { border: 2px solid var(--line); }
.ticket.status-nuevo { border-color: var(--accent-dark); }
.ticket.status-preparacion { border-color: var(--yellow); }
.ticket.status-listo { border-color: #8fb803; }
.column-nuevo .ticket-action { background: var(--accent); color: var(--ink); border-color: var(--accent-dark); }
.column-preparacion .ticket-action { background: var(--yellow); color: var(--ink); border-color: #e09e00; }
.column-listo .ticket-action { background: var(--lime); color: var(--ink); border-color: #8fb803; }
.ticket-qty { background: var(--ink); }
.board-tab.active.tab-nuevo { border-color: var(--accent-dark); background: #fff7c2; }
.board-tab.active.tab-preparacion { border-color: var(--yellow); background: #ffefcc; }
.board-tab.active.tab-listo { border-color: #8fb803; background: #f1f8d8; }
.order-card.status-nuevo { border-left-color: var(--accent-dark); }
.order-card.status-preparacion { border-left-color: var(--yellow); }
.order-card.status-listo { border-left-color: #8fb803; background: #f6fbe6; }

/* Mesas (mesero) y cuentas por mesa (caja). */
.table-tile { border-color: var(--line); }
.table-tile.is-draft { border-color: var(--accent-dark); border-style: dashed; background: #fffbe0; }
.table-tile.is-busy { border-color: var(--yellow); }
.table-tile.is-ready { border-color: #8fb803; background: #f1f8d8; }
.cj-tile.is-open { border-color: var(--yellow); background: #fffbea; }
.cj-tile.is-open .cj-tile-amount { color: #6e4100; }
.cj-tile.is-open.is-settled { border-color: #8fb803; background: #f4f9e4; }
.cj-tile.is-pending { border-color: var(--brand); border-style: dashed; }

/* Productos: botón «+» amarillo; producto agregado resaltado. */
.step-plus { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 var(--accent-dark); }
.step-minus { background: var(--bg-2); color: var(--ink); }
.product.in-order { border-color: var(--accent-dark); background: #fffbe0; }
.pill.active { background: var(--ink); color: #fff; }
.count-badge, .qty-badge { background: var(--accent); color: var(--accent-ink); }
.summary-bar-btn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-dark), var(--shadow-lg); }
.summary-bar-count { background: var(--ink); color: #fff; }

/* Caja: total, pagado, recibido, cambio y saldo se distinguen por color Y por su etiqueta. */
.cj-big { border: 2px solid var(--line); background: var(--surface); }
.cj-big.tone-total { border-color: var(--ink); }
.cj-big.tone-paid { background: var(--green-soft); border-color: #cde49a; color: var(--green-dark); }
.cj-big.tone-received { background: #fff7d1; border-color: var(--accent-dark); color: var(--ink); }
.cj-big.tone-change { background: var(--green); border-color: var(--green-dark); color: #fff; }
.cj-big.tone-change .cj-big-label { color: #fff; }
.cj-big.tone-due { background: var(--yellow-soft); border-color: var(--yellow); color: #5c3a00; }
.cj-big.tone-ok { background: var(--green-soft); border-color: #8fb803; color: var(--green-dark); }
.cj-big.tone-warn { background: var(--orange-soft); border-color: var(--orange); color: #7a3d00; }
.cj-big.tone-short { background: var(--red-soft); border-color: var(--red); color: #8a100b; }
.cj-big-label { color: inherit; opacity: .9; }
.cj-result.is-change { background: var(--green); color: #fff; }
.cj-result.is-missing { background: var(--red-soft); color: #8a100b; border-color: var(--red); }
.cj-method.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cj-quick-btn { border-color: var(--accent-dark); background: #fffbe0; color: var(--ink); }
.cj-quick-btn.is-exact { background: #fff3a8; }
.cj-session-open { background: var(--green-soft); color: var(--green-dark); border-color: #cde49a; }
.cj-session-closed { background: var(--yellow-soft); color: #6e4100; border-color: #f5d77a; }
.cj-done-icon { background: var(--green); }
.cj-done h1 { color: var(--green-dark); }
.cj-check-title h1, .table-title { color: var(--ink); }

/* Indicadores y análisis. */
.kpi-icon { background: #fff3a8; color: var(--brand); }
.ow-stat.is-hero { background: linear-gradient(135deg, #fffbea, #fff1b8); border-color: #f2d36a; }
.ow-stat.is-hero::before { content: ''; display: block; height: 4px; margin: -16px -18px 10px; border-radius: 16px 16px 0 0; background: var(--stripe); }
.stat-green { border-top-color: #8fb803; }
.stat-brand { border-top-color: var(--accent-dark); }
.stat-yellow { border-top-color: var(--yellow); }
.stat-blue { border-top-color: var(--brand); }

/* Ingreso: el letrero en grande sobre café, la franja arriba del formulario. */
.login-hero {
  background: radial-gradient(circle at 15% 12%, rgba(254, 221, 4, .16) 0, transparent 45%),
    radial-gradient(circle at 85% 88%, rgba(212, 19, 22, .2) 0, transparent 50%), var(--side-bg);
  color: var(--side-ink); gap: 18px;
}
.login-logo { width: min(560px, calc(100vw - 48px)); }
.login-logo img { filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .45)); }
.login-hero p { color: var(--side-ink); font-size: 1.15rem; }
.login-card { position: relative; overflow: hidden; padding-top: 30px; border: 1px solid var(--line); }
.login-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--stripe); }

/* Avisos y pantallas vacías. */
.banner-new { background: var(--brand); }
.banner-ready { background: var(--green); }
.toast { background: var(--ink); }
.toast-ok { background: var(--green-dark); }
.empty { border: 2px dashed var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .55); }
.alerts-bar { border-color: var(--accent-dark); background: #fff7c2; color: var(--ink); }
.alerts-bar .icon { color: var(--brand); }

/* Recibo: logo a color en pantalla; en la impresora térmica, las letras en negro (58 y 80 mm). */
.rc-logo { display: block; width: 78%; max-width: 300px; height: auto; margin: 0 auto 2mm; }
.rc-logo-print { display: none; }
@media print {
  .rc-logo { display: none; }
  .rc-logo-print { display: block; width: 80%; height: auto; margin: 0 auto 1.5mm; image-rendering: crisp-edges; }
  .hdr::after { display: none; }
}

/* Recibo: las filas nunca ensanchan el papel (58 mm): el concepto y el texto largo se parten; los montos no (espacio duro). */
.rc-meta, .rc-totals { grid-template-columns: minmax(0, 1fr); }
.rc-meta dt, .rc-totals dt { min-width: 0; }
.rc-totals dd { white-space: normal; }
.rc-totals dd.rc-amount { white-space: nowrap; }

/* Campo de dinero: un solo marco (el del recuadro); el campo interno no dibuja su propio contorno. */
.money-field { gap: 8px; }
.money-label { font-weight: 700; font-size: .95rem; color: var(--ink); }
.money-control {
  gap: 10px; padding: 0 20px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: inset 0 1px 2px rgba(74, 18, 6, .04);
}
.money-control:hover { border-color: #e6cfa6; }
.money-control:focus-within { border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(254, 221, 4, .4); }
.money-input, .money-input:focus, .money-input:focus-visible { outline: none; box-shadow: none; border: 0; border-radius: 0; }
.money-prefix { flex: none; color: var(--ink-2); font-weight: 700; font-size: 1.25rem; line-height: 1; }
.money-input { color: var(--ink); font-weight: 700; }
.money-input::placeholder { color: #b9a08a; font-weight: 600; }
.money-lg .money-control { min-height: 72px; }
.money-lg .money-prefix { font-size: 1.7rem; }
.money-lg .money-input { font-size: 2rem; }
.money-hint { font-size: .86rem; }
.money-field.has-error .money-control { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* Créditos de fotos referenciales: discreto, solo donde se ven esas fotos (lo exige su licencia). */
.photo-credits-link { margin: 16px 0 0; text-align: center; font-size: .82rem; }
.photo-credits-link .linklike { color: var(--muted); font-weight: 500; }
/* Dueño: cuándo y cómo se cobró cada orden, con su recibo. */
.ow-paid { padding: 10px 12px; border-radius: 12px; background: var(--green-soft); border: 1px solid #cde49a; display: grid; gap: 4px; font-size: .9rem; }
.ow-paid strong { color: var(--green-dark); }
.ow-paid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ow-paid li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; }
.ow-paid li.is-void b { text-decoration: line-through; }
.ow-row-link { justify-self: start; font-size: .88rem; }
/* Reporte de cierre de caja (mismo papel que el recibo: 58 y 80 mm). */
.rc-section { margin: 3mm 0 1mm; font-weight: 700; text-align: center; letter-spacing: .04em; border-bottom: 1px dashed #000; padding-bottom: .8mm; }
.closing-items .closing-table td { font-weight: 700; padding-top: 1.6mm; border-bottom: 1px solid #000; }
.closing-items .closing-subtotal td { font-weight: 700; border-top: 1px dotted #000; }
.closing-items td small { display: block; font-size: .8em; }
.closing-items td:first-child { white-space: nowrap; }
.rc-sign { margin: 6mm 0 2mm; }
.cj-whatsapp { text-decoration: none; }
.wa-glyph { width: 24px; height: 24px; flex: none; }
.closing-items .closing-table td { text-align: left !important; letter-spacing: .03em; }
.closing-items td:first-child { white-space: normal; width: auto; }
.closing-items th:first-child { width: auto; }

/* Dueño · Órdenes: tocar la orden despliega su recibo dentro de la misma tarjeta. */
.ow-order.is-clickable { cursor: pointer; }
.ow-order.is-clickable:hover { border-color: var(--caramel); }
.ow-order-toggle {
  order: 99; justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--ink); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.ow-order-toggle:hover { background: var(--yellow-soft); }
.ow-order.is-open .ow-order-toggle { background: var(--yellow-soft); border-color: var(--accent); }
.ow-receipts {
  order: 98; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; min-width: 0;
  padding: 12px; border-radius: 12px; background: var(--bg-2); cursor: auto;
}
.ow-receipt { display: grid; gap: 8px; justify-items: start; max-width: 100%; min-width: 0; }
.ow-receipts .receipt-sheet { margin: 0; max-width: 100%; box-shadow: var(--shadow); }

/* ---- Pulido responsive (2026-10-20) ---- */
/* Aviso del correo: compacto, con «Ahora no». */
.email-nudge { padding: 10px 14px; font-size: .95rem; }
.email-nudge-actions { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.email-nudge-later { font-size: .9rem; white-space: nowrap; }
@media (max-width: 640px) {
  /* Texto a la izquierda y acciones apiladas a la derecha: el aviso ocupa unas dos líneas. */
  .email-nudge { flex-wrap: nowrap; gap: 10px; padding: 8px 10px 8px 12px; font-size: .85rem; line-height: 1.3; }
  .email-nudge-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .email-nudge-actions .btn { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
  .email-nudge-later { font-size: .8rem; text-align: center; }
}
/* En celulares el estado «En línea» queda solo como punto verde (el texto sigue para lectores de pantalla). */
@media (max-width: 480px) {
  .conn-ok { padding: 8px; }
  .conn-ok .conn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Botón «Volver» + título: si el título no cabe al lado, pasa debajo en vez de apretarse. */
.order-head { flex-wrap: wrap; row-gap: 8px; }
.order-head > h1, .order-head > .table-title { flex: 1 1 auto; min-width: 0; }
/* Montos grandes: el valor siempre justo debajo de su etiqueta (alineados aunque una tarjeta tenga una línea más). */
.cj-big { align-content: start; }
/* Tarjeta de ingreso/recuperación: sin espacios de más cuando tiene poco contenido. */
.login-card { align-content: start; }
/* El encabezado se queda con el espacio sobrante; la tarjeta mide lo que su contenido (sin blancos dentro ni debajo). */
.login { grid-template-rows: 1fr auto; }
@media (min-width: 900px) { .login { grid-template-rows: auto; } }
/* Abrir cuenta en celular: el total del pedido pasa debajo y el texto usa todo el ancho. */
@media (max-width: 480px) {
  .cj-pick { grid-template-columns: 40px 1fr; row-gap: 4px; }
  .cj-pick-total { grid-column: 2; justify-self: end; font-size: 1.15rem; }
}
/* Celulares muy pequeños (≤ 359 px): título del encabezado algo menor para que no se corte. */
@media (max-width: 359px) {
  .hdr-h1 { font-size: 1.12rem; letter-spacing: -0.01em; }
}
/* Filas de categorías que se desplazan a lo ancho: flechas «‹ ›» cuando hay más opciones hacia ese lado. */
.scroll-row { position: relative; min-width: 0; }
.scroll-row > .pills { position: relative; scroll-behavior: smooth; }
.scroll-row.can-left::before, .scroll-row.can-right::after {
  content: ''; position: absolute; top: 0; bottom: 10px; width: 64px; pointer-events: none; z-index: 1;
}
.scroll-row.can-left::before { left: 0; background: linear-gradient(to right, var(--bg) 35%, rgba(255, 248, 232, 0)); }
.scroll-row.can-right::after { right: 0; background: linear-gradient(to left, var(--bg) 35%, rgba(255, 248, 232, 0)); }
.scroll-row-arrow {
  position: absolute; top: calc(50% - 5px); transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
}
.scroll-row-arrow:hover { background: var(--accent); border-color: var(--accent-dark); }
.scroll-row-arrow.is-left { left: 0; }
.scroll-row-arrow.is-right { right: 0; }
.pill.pill-ghost { border-style: dashed; color: var(--muted); background: transparent; font-weight: 600; }

/* Comanda de cocina (58 / 80 mm): número del día grande para el orden de entrega; sin precios. */
.comanda-sheet { text-align: left; }
.cm-title { text-align: center; font-weight: 700; letter-spacing: .2em; font-size: 1.1em; }
.cm-number { text-align: center; font-weight: 800; font-size: 3.2em; line-height: 1.05; margin: 1mm 0; }
.cm-table { text-align: center; font-weight: 800; font-size: 1.9em; border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 1mm 0; margin: 1mm 0 2mm; }
.cm-meta { text-align: center; font-size: .9em; }
.cm-items { list-style: none; margin: 2mm 0; padding: 2mm 0 0; border-top: 1px dashed #000; display: grid; gap: 1.5mm; }
.cm-items li { display: grid; grid-template-columns: 2.2em 1fr; gap: 1.5mm; font-size: 1.25em; font-weight: 700; line-height: 1.2; }
.cm-qty { text-align: right; }
.cm-name { min-width: 0; overflow-wrap: anywhere; }
.cm-item-note { display: block; font-size: .8em; font-weight: 600; }
.cm-note { border: 2px solid #000; padding: 1mm; font-weight: 700; margin: 2mm 0; overflow-wrap: anywhere; }
.cm-foot { text-align: center; font-size: .8em; margin-top: 2mm; border-top: 1px dashed #000; padding-top: 1mm; }
.cm-format { margin: 8px 0; }
.ticket-comanda { background: var(--ink); color: #fff; font-weight: 800; border-radius: 8px; padding: 2px 8px; font-size: .85rem; white-space: nowrap; }
#print-root { display: none; }
@media print {
  body.printing-comanda > *:not(#print-root) { display: none !important; }
  body.printing-comanda #print-root { display: block; }
  body.printing-comanda .comanda-sheet { margin: 0; box-shadow: none; }
}
/* Pregunta de cuenta al enviar un pedido en una mesa que ya tiene cuenta. */
.acct-lead { margin: 0 0 8px; font-weight: 600; }
.acct-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; }
.acct-orders > li { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.acct-order-head { font-size: .9rem; color: var(--ink-2); margin-bottom: 4px; }
.acct-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.acct-total { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 4px; font-size: 1.05rem; }
.acct-question { font-size: 1.05rem; margin: 6px 0 0; }
.acct-actions { display: grid; gap: 8px; width: 100%; }
.acct-actions .btn { width: 100%; }
/* Tablero: con la insignia de comanda y el botón «Comanda», el encabezado y los botones bajan de línea si no caben. */
.board .column, .board .ticket { min-width: 0; }
.ticket-head { flex-wrap: wrap; row-gap: 4px; }
.ticket-secondary { flex-wrap: wrap; }
.ticket-head .ticket-time { margin-left: auto; }

/* Tomar pedido: buscador de productos con resultados debajo. */
.psearch { margin: 0 0 14px; }
.psearch-field { position: relative; display: block; }
.psearch-field > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.psearch-input { width: 100%; min-height: 52px; padding-left: 46px; padding-right: 48px; font-size: 1.05rem; border-radius: 14px; }
.psearch-input::-webkit-search-cancel-button { display: none; }
.psearch-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.psearch-results { margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.psearch-results ul { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; }
.psearch-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-bottom: 1px solid var(--line); }
.psearch-item:last-child { border-bottom: 0; }
.psearch-item.in-order { background: #f4f9e4; }
.psearch-item.sold-out { opacity: .55; }
.psearch-pick { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: transparent; text-align: left; cursor: pointer; position: relative; border-radius: 12px; }
.psearch-pick:disabled { cursor: default; }
.psearch-photo { width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; }
.psearch-photo img { width: 100%; height: 100%; object-fit: cover; }
.psearch-text { display: grid; min-width: 0; }
.psearch-text strong { overflow-wrap: anywhere; }
.psearch-text small { color: var(--muted); }
.psearch-pick .qty-badge { position: static; flex: none; }
.psearch-empty { margin: 0; padding: 14px; color: var(--muted); }
@media (max-width: 420px) { .psearch-item .stepper { display: none; } }
.psearch-pick .qty-badge { min-width: 34px; height: 34px; font-size: 1rem; border-width: 2px; box-shadow: none; }
.menu-credits { text-align: center; margin: 20px 0 4px; font-size: .85rem; color: var(--muted); }

/* Quitar productos (caja y mesero) */
.rm-lines { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.rm-lines li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rm-lines li.is-on { border-color: var(--red); background: var(--red-soft); }
.rm-name { min-width: 0; overflow-wrap: anywhere; }
.rm-ctrl { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.rm-ctrl small { color: var(--muted); }
.rm-amount { margin: 4px 0 8px; }
.rm-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cj-order-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
/* Mesero: cuenta de la mesa */
.table-account { margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.table-account-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; min-height: 52px; }
.table-account-head > span { flex: 1 1 auto; min-width: 0; }
.table-account-head[aria-expanded="true"] .icon { transform: rotate(180deg); }
.table-account-orders { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.table-account-orders > li { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 6px; }
.table-account-orders .btn { justify-self: start; }

/* ===== 2026-10-22 · Entrega del mesero e indicador «Listo para servir» ===== */
/* Pulso suave (brillo verde, sin saltos). Con «reducir movimiento» la regla global quita la animación: queda verde fijo y el texto. */
@keyframes ready-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(122, 170, 20, .0), var(--shadow); } 50% { box-shadow: 0 0 0 6px rgba(122, 170, 20, .45), var(--shadow); } }
.table-tile.is-ready { border-color: #6f9a06; background: #eaf5c8; animation: ready-glow 2.4s ease-in-out infinite; }
.chip-ready { background: var(--green); color: #fff; font-weight: 700; }
.table-chips .chip-ready { font-size: .72rem; white-space: normal; max-width: 100%; line-height: 1.15; padding: 3px 8px; text-align: center; }
.cj-tile.has-ready { border-color: #6f9a06; animation: ready-glow 2.4s ease-in-out infinite; }
.cj-tile.is-free.has-ready { opacity: 1; background: #f1f8d8; }
.cj-tile-ready { display: inline-flex; align-items: center; gap: 6px; align-self: start; padding: 3px 10px; border-radius: 999px;
  background: var(--green); color: #fff; font-weight: 700; font-size: .85rem; }
.ready-card { align-content: start; }
.ready-card .btn { margin-top: 6px; }
.ticket-table small { font-size: .55em; font-weight: 600; color: var(--muted); margin-right: 2px; }
.ticket-meta .ticket-mesa { font-size: 1.15rem; color: var(--ink); }
.ticket-waiting { margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.ticket-modified { margin: 0; display: flex; align-items: flex-start; gap: 6px; padding: 6px 10px; border-radius: 12px;
  background: var(--yellow-soft); color: #6e4100; font-size: .9rem; font-weight: 600; }
.comanda-sheet .cm-number { font-size: 2.1em; line-height: 1.05; text-align: center; }
.cm-modified { text-align: center; font-weight: 700; border: 2px dashed #000; padding: 2px 4px; margin: 4px 0; }
.banner-removed { background: #b3401b; animation: drop .35s ease, flash 1s ease 3; }
.acct-order-head .chip { margin-left: 4px; vertical-align: middle; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }

/* ===== 2026-10-22 · Mesas especiales (VIP 1, VIP 2) ===== */
.table-number.is-name { font-size: clamp(1.5rem, 6.5vw, 2.2rem); white-space: nowrap; }

/* ===== 2026-10-22 · Cobro en un solo panel, cliente y cuenta separada ===== */
.cj-pay-main-col { display: grid; gap: 14px; min-width: 0; align-content: start; }
.cj-mode, .cj-doc { display: flex; flex-wrap: wrap; width: 100%; }
.cj-mode button, .cj-doc button { flex: 1 1 180px; }
.cj-pay-buttons { display: grid; gap: 10px; }
.cj-pay-buttons .btn { width: 100%; }
.cj-invoice-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 14px;
  background: var(--yellow-soft); color: #6e4100; font-size: .92rem; }
.cj-customer-grid { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 12px; }
.cj-customer-grid .field { margin: 0; }
.cj-privacy { grid-column: 1 / -1; margin: 0; }
.cj-split { display: grid; gap: 10px; margin-top: 12px; }
.cj-split-people { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cj-person { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line, #eadfca);
  background: #fff; min-width: 130px; cursor: pointer; }
.cj-person span { font-size: .85rem; color: var(--muted); }
.cj-person.is-on { border-color: var(--brand); background: var(--yellow-soft); }
.cj-person.is-paid span { color: var(--green-dark); font-weight: 700; }
.cj-person-new { display: flex; gap: 6px; align-items: center; }
.cj-person-new .input { width: 160px; }
.cj-split-items h3 { margin: 4px 0 8px; }
.cj-split-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.cj-split-summary ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.cj-split-summary li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #fff; }
.rc-invoice { text-align: center; font-weight: 700; border: 1px dashed #000; padding: 3px; margin: 6px 0; }
.cj-invoice-note .icon { flex: none; margin-top: 2px; }
.cj-split-items .rm-lines li.is-on { background: var(--yellow-soft); border-color: #f5d77a; }

/* ===== 2026-10-22 · Mostrador y encargos ===== */
.ms-search { margin-bottom: 12px; }
.ms-tabs { display: flex; }
.ms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ms-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line, #eadfca); background: #fff; cursor: pointer; }
.ms-card.is-listos { border-color: #6f9a06; background: #f1f8d8; }
.ms-card.is-atrasados { border-color: var(--red); background: var(--red-soft); }
.ms-code { font-size: 1.5rem; font-weight: 800; letter-spacing: .02em; }
.ms-main { display: grid; gap: 2px; min-width: 0; }
.ms-items { font-size: .9rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
@media (max-width: 640px) {
  .ms-card { grid-template-columns: 1fr; }
  .ms-chips { flex-direction: row; flex-wrap: wrap; align-items: center; }
}
.ms-pick-filters { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); margin-bottom: 10px; }
@media (max-width: 640px) { .ms-pick-filters { grid-template-columns: 1fr; } }
.ms-products { max-height: 460px; overflow-y: auto; }
.ms-products li.is-on { background: var(--yellow-soft); border-color: #f5d77a; }
.ms-minutes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.ms-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-summary { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.ms-summary li { display: flex; justify-content: space-between; gap: 10px; }
.ms-states { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 14px; }
.ms-states > div { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; background: #fff; justify-items: start; }
.ms-states .chip { white-space: normal; text-align: left; }

/* ===== 2026-10-22 · Período del dueño con fechas y horas ===== */
.ow-custom { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: #fff; border: 2px solid var(--line, #eadfca); }
.ow-custom-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ow-custom-fields .field { margin: 0; display: grid; gap: 4px; }
.ow-custom-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ow-partial-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--yellow-soft); color: #6e4100; font-size: .9rem; }

/* ===== 2026-10-22 · Ronda 2 ===== */
.table-cell { display: grid; gap: 6px; align-content: start; min-width: 0; }
.table-deliver { min-height: 44px; width: 100%; font-weight: 700; border-radius: 14px; }
.rm-keep-label { font-size: .72rem; color: var(--muted); }
.rm-lines li.is-on .rm-name s { color: var(--muted); }
.ms-pay { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--yellow-soft); }
.ms-pay-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.ms-done { display: grid; gap: 10px; }
.cj-embedded-pay { margin: 14px 0; }
.cj-embedded-done { padding: 16px; border-radius: 18px; background: var(--green-soft); display: grid; gap: 10px; }
.ow-presets .ow-custom-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cj-actionbar:empty { display: none; }

/* ===== 2026-10-23 · Cobro con menos scroll ===== */
@media (min-width: 900px) {
  .cj-pay-summary { position: sticky; top: 84px; align-self: start; }
}
.cj-pay-page .cj-method { min-height: 56px; padding: 6px 12px; flex-direction: row; gap: 8px; }
.cj-pay-page .panel { padding-top: 12px; padding-bottom: 12px; }
.cj-pay-page .cj-quick { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.cj-pay-sticky { display: none; }
@media (max-width: 899px) {
  .cj-pay-sticky { display: flex; position: sticky; bottom: 8px; z-index: 6; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border-radius: 18px; background: #fff; box-shadow: 0 6px 24px rgba(60, 20, 0, .18); border: 2px solid var(--line, #eadfca); }
  .cj-pay-sticky > span { font-weight: 800; font-size: 1.15rem; }
  .cj-pay-sticky small { font-weight: 600; font-size: .85rem; color: var(--green-dark); }
  .cj-pay-summary .cj-pay-buttons { display: none; }
}

.cj-paid-items { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; padding: 6px 10px; border-radius: 12px;
  background: var(--green-soft); color: var(--green-dark); font-size: .88rem; font-weight: 600; }
.cj-pay-items { font-weight: 600; }

/* ===== 2026-10-24 · Pendientes de pago ===== */
.send-pending { width: 100%; margin-top: 8px; }
.ticket-credit { margin: 0; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 12px;
  background: #fde8d8; color: #8a3a00; font-weight: 700; font-size: .9rem; }
.pd-summary { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.pd-summary > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--line, #eadfca); }
.pd-summary span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.pd-summary strong { font-size: 1.4rem; }
.pd-summary .is-late, .ms-states .is-late { border-color: var(--red); background: var(--red-soft); }
.pd-card .pd-due { font-weight: 800; min-width: 7.5em; }
.pd-card.is-vencido { border-color: var(--red); background: var(--red-soft); }
.pd-card.is-pagado { opacity: .8; }
.pd-person { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 12px 14px;
  border-radius: 16px; background: #fff; border: 2px solid var(--line, #eadfca); }
.pd-results { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.pd-result { width: 100%; display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line, #eadfca); background: #fff; cursor: pointer; }
.pd-picked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: var(--green-soft); }
.pd-new { display: grid; gap: 8px; margin-bottom: 8px; }
@media (max-width: 640px) { .pd-card { grid-template-columns: 1fr; } }
.ms-tabs .board-tab.active, .ms-tabs .board-tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ms-add { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 4px; font: inherit; color: inherit; cursor: pointer; align-self: stretch; }
/* «¿Quién queda debiendo?»: buscador y «Crear persona o empresa nueva» con aire entre ellos. */
.pd-picker { display: grid; gap: 14px; margin-top: 10px; }
.pd-card .ms-main strong { font-size: 1.15rem; }
.pd-card .ms-chips strong { font-size: 1.3rem; }
.pd-person-link { cursor: pointer; border: 0; font: inherit; }
.pd-accounts { display: grid; gap: 12px; }
.pd-account { padding: 12px 14px; border-radius: 14px; background: #fff; border: 2px solid var(--line, #eadfca); }
.pd-account.is-late { border-color: var(--red); }
.pd-account-head { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pd-account .ms-summary { margin-bottom: 4px; }
.pd-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--line, #eadfca); }
.pd-total strong { font-size: 1.4rem; }
.pd-picker > .btn { justify-self: start; }
.pd-picker .pd-results { margin: 0; }
.pd-picker .field { margin: 0; }

/* ===== 2026-10-27 · Un solo panel de cobro en todas partes: formulario → cambio → confirmar → consumo ===== */
.cj-pay-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
/* Sin resumen repetido ni barra fija: el botón queda justo después del formulario (también en celular). */
.cj-pay-summary { position: static; gap: 10px; }
.cj-pay-summary .cj-pay-buttons { display: grid; }
.cj-pay-sticky { display: none !important; }
/* Celular y tablet: una sola columna (identificación → formulario → cambio → confirmar → consumo); computador: dos. */
@media (max-width: 1199px) { .cj-pay-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1200px) { .cj-pay-grid { grid-template-columns: minmax(0, 1fr) 420px; } }
/* Más compacto, con botones grandes y textos legibles. */
.cj-page .cj-check-head { margin-bottom: 8px; gap: 10px; }
.cj-check-title h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
.cj-embedded-pay { margin: 8px 0; }
.cj-pay-grid { gap: 12px; }
.cj-pay-main-col { gap: 10px; }
.cj-pay-fields { gap: 10px; }
.cj-pay-page .cj-methods { margin-bottom: 4px; }
.cj-result { padding: 12px 14px; }
.cj-pay-side .cj-orders .section-title { margin: 2px 0 6px; }
.cj-pay-side .cj-order { padding: 10px 12px; margin-bottom: 8px; }
.cj-check-after { margin-top: 12px; }

/* ===== 2026-10-27 (b) · Cobrar sin desplazarse: mismos apartados, menos altura ===== */
/* «Exacto» del mismo tamaño que los billetes: los cinco en una sola fila. */
.cj-quick, .cj-pay-page .cj-quick { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cj-quick-btn { min-height: 48px; padding: 0 6px; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cj-quick-btn.is-exact { grid-column: auto; }
/* Pantallas angostas: menos montos sugeridos para que «Exacto» y los billetes sigan en UNA fila y se lean completos. */
@media (max-width: 430px) {
  .cj-quick, .cj-pay-page .cj-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cj-quick-btn { font-size: .88rem; padding: 0 2px; }
  .cj-quick-btn:nth-child(n+5) { display: none; }
}
@media (max-width: 400px) {
  .cj-quick, .cj-pay-page .cj-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cj-quick-btn:nth-child(n+4) { display: none; }
  /* «Efectivo» y «Transferencia» sin ícono para que el texto quepa entero. */
  .cj-pay-page .cj-method svg { display: none; }
  .cj-pay-page .cj-method { padding: 4px 6px; font-size: .95rem; }
}
/* Importe y dinero recibido (o referencia) lado a lado. */
.cj-amounts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start; }
.cj-amounts .field { margin: 0; }
.cj-amounts .money-control, .cj-amounts .input { min-height: 54px; }
/* Métodos de pago en una fila y más bajos; paneles y selectores compactos. */
.cj-pay-page .cj-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.cj-pay-page .cj-method { min-height: 48px; }
.cj-pay-page .panel { padding: 10px 14px; }
.cj-pay-page .segmented button { min-height: 40px; }
.cj-doc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cj-doc-row .panel-title { margin: 0; }
.cj-pay-summary .cj-result-value { font-size: clamp(2rem, 5vw, 2.6rem); }
.cj-pay-summary .btn-xl { min-height: 58px; margin-top: 0; }
.page.cj-page { padding-top: 8px; }
/* Computador: si el consumo es largo se desplaza dentro de su columna y el cobro sigue a la vista. */
@media (min-width: 1200px) {
  .cj-pay-side .cj-orders { max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 4px; }
}
/* Celular: encabezado en una línea y selectores en una fila, para cobrar casi sin bajar. */
@media (max-width: 600px) {
  .cj-page .cj-check-head { flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 6px; }
  .cj-page .cj-check-head > .btn { min-height: 40px; padding: 0 10px; flex: 0 0 auto; }
  .cj-check-title { gap: 0 8px; align-items: center; min-width: 0; }
  .cj-check-title h1 { font-size: 1.45rem; line-height: 1.1; }
  .cj-check-title .cj-check-number { font-size: .82rem; }
  .cj-check-title .chip { font-size: .75rem; padding: 2px 8px; }
  .cj-pay-page .segmented { display: flex; width: 100%; }
  .cj-pay-page .segmented button { flex: 1 1 0; min-width: 0; min-height: 40px; white-space: normal; line-height: 1.15; font-size: .86rem; padding: 4px 6px; }
  .cj-doc-row .panel-title { display: none; }
  .cj-pay-page .cj-method, .cj-pay-page .cj-quick-btn { min-height: 44px; }
  .cj-amounts .money-control, .cj-amounts .input { min-height: 48px; }
  .cj-pay-summary .cj-result { padding: 8px 12px; gap: 2px; }
  .cj-pay-summary .cj-result-value { font-size: 1.85rem; }
  .cj-pay-main-col, .cj-pay-side, .cj-pay-grid { gap: 8px; }
}
@media (max-width: 600px) {
  /* «Cambio por devolver» en una línea: rótulo a la izquierda, monto grande a la derecha. */
  .cj-pay-summary .cj-result.is-change { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .cj-pay-summary .cj-result.is-change .cj-result-label { font-size: .85rem; }
  .cj-pay-page .cj-pay-summary { padding: 8px 10px; gap: 8px; }
}
@media (max-width: 600px) {
  .cj-pay-page .panel { padding: 8px 10px; }
  .cj-amounts .money-field { gap: 4px; }
  .cj-pay-fields { gap: 8px; }
}

/* ===== 2026-10-27 (c) · Cuenta completa: el importe es el total y no se edita ===== */
.money-readonly .money-control { background: #fbf4e2; cursor: default; }
.money-readonly .money-total { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ===== Llamadas de mesa (botones físicos): violeta + mano + texto, distinto del verde de «listo para servir» ===== */
:root { --call: #5b2a86; --call-soft: #f1e8fa; }
.calls-strip { background: var(--call); color: #fff; padding: 4px 12px; display: grid; gap: 4px; }
.calls-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.calls-strip li { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .12); border: 2px dashed rgba(255, 255, 255, .7);
  border-radius: 10px; padding: 3px 4px 3px 8px; flex: 0 1 300px; min-width: 0; }
.calls-strip li.is-done { background: var(--green-dark); border-style: solid; border-color: #fff; min-height: 46px; }
.calls-strip-text { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
.calls-strip-text strong { font-size: .95rem; }
.calls-strip .btn { min-height: 38px; padding: 4px 12px; font-size: .9rem; }
.calls-strip-text small { opacity: .9; font-size: .78rem; }
.calls-strip .linklike { color: #fff; justify-self: start; }
.chip-call { background: var(--call); color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.table-chips .chip-call { font-size: .72rem; white-space: normal; line-height: 1.15; padding: 3px 8px; }
.table-tile.is-calling { outline: 3px dashed var(--call); outline-offset: 2px; }
.cj-tile-call { display: inline-flex; align-items: center; gap: 6px; align-self: start; padding: 3px 10px; border-radius: 999px;
  background: var(--call); color: #fff; font-weight: 700; font-size: .85rem; }
.cj-tile.has-call { outline: 3px dashed var(--call); outline-offset: 2px; }
.call-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.call-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); }
.call-card.is-pending { border: 3px dashed var(--call); background: var(--call-soft); }
.call-card.is-focus { box-shadow: 0 0 0 4px var(--focus); }
.call-card.is-done { opacity: .85; }
.call-icon { color: var(--call); flex: none; }
.call-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.call-main strong { font-size: 1.15rem; }
.call-meta { color: var(--ink-2); font-size: .92rem; }
.call-late { color: var(--orange); font-weight: 600; }
.push-panel { margin-top: 16px; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.feature-panel { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-left: 6px solid var(--line); }
.feature-panel.is-on { border-left-color: var(--call); }
.bridge-list, .button-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.button-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.bridge-card, .button-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.bridge-card .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.bridge-card.is-online .dot { background: var(--green); }
.button-card.is-off { opacity: .7; border-style: dashed; }
.button-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.1rem; }
.button-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; font-size: .9rem; }
.button-facts dt { color: var(--muted); }
.button-facts dd { margin: 0; overflow-wrap: anywhere; }
.button-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.field-inline select { min-height: 44px; border-radius: 10px; border: 2px solid var(--line); padding: 0 10px; font: inherit; background: var(--surface); }
@media (max-width: 640px) { .calls-strip li { flex-basis: 100%; } .call-card { flex-wrap: wrap; } .call-card .btn { width: 100%; } }
.events-wrap { overflow-x: auto; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); }
.events-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.events-table th, .events-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.events-table th { color: var(--muted); font-weight: 600; }
/* Con llamadas en la franja, los avisos flotantes de caja bajan al pie: nunca tapan el botón «Atendida». */
.shell:has(.calls-strip) .toasts { top: auto; bottom: 24px; }
