:root {
  --primary: #6a2c9e;      /* morado */
  --primary-d: #4a1a72;
  --accent: #ffc20e;       /* amarillo */
  --accent-d: #d99a00;
  --pink: #ff3d8b;
  --sky: #00a3e0;
  --bg: #fff7e6;
  --card: #ffffff;
  --text: #1f1d1b;
  --muted: #77716b;
  --line: #e4dfd9;
  --ok: #2a9d4f;
  --warn: #c98a00;
  --error: #c1121f;
  --radius: 18px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Fredoka", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.2rem; margin: .4em 0; }
h3 { font-size: 1.05rem; margin: 0 0 .6em; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.ok { color: var(--ok); }
.error { color: var(--error); }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; background: var(--primary); color: #fff; padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top)); }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; white-space: nowrap; }
.nav { display: flex; gap: .25rem; align-items: center; flex: 1; }
.nav a { color: #fff; text-decoration: none; padding: .4rem .7rem; border-radius: 8px; opacity: .9; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.18); opacity: 1; }
.nav .user { margin-left: auto; opacity: .9; font-size: .9em; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.grid-2.wide-left { grid-template-columns: 2fr 1fr; }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.page-head h1 { margin-bottom: .2em; }
.table-wrap { overflow-x: auto; }

/* ---------- Formularios ---------- */
label { display: block; margin-bottom: .8rem; font-weight: 500; font-size: .92em; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; font: inherit; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input[type=color] { padding: .15rem; height: 2.6rem; }
label.check { display: flex; align-items: center; gap: .5rem; }
label.check input { width: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 600; margin-bottom: .5rem; }
.radio-cards { display: grid; gap: .5rem; }
.radio-card { display: flex; align-items: center; gap: .6rem; border: 2px solid var(--line); border-radius: 10px; padding: .7rem .8rem; margin: 0; cursor: pointer; }
.radio-card input { width: auto; margin: 0; }
.radio-card:has(input:checked) { border-color: var(--primary); background: #fff3f3; }
.filters { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.filters label { margin: 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #faf8f6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { background: #fff; color: var(--error); border-color: #f0b8bc; }
.btn-sm { padding: .3rem .6rem; font-size: .85em; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.05em; }
.btn-block { width: 100%; margin-top: .4rem; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-size: .85em; }
form.inline { display: inline; }
.actions { white-space: nowrap; }
.switch { border: 0; border-radius: 99px; padding: .25rem .8rem; background: #ddd; color: #555; font-weight: 700; cursor: pointer; }
.switch.on { background: var(--ok); color: #fff; }

/* ---------- Alertas y badges ---------- */
.alert { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert-ok { background: #e6f6ec; color: #1d6b37; }
.alert-warn { background: #fff5dc; color: #7a5600; }
.alert-error { background: #fde8ea; color: #8f0d17; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .78em; font-weight: 600; background: #eee; }
.badge-con_boleta, .badge-ok { background: #e6f6ec; color: #1d6b37; }
.badge-sin_boleta { background: #eee; color: #555; }
.badge-mixto { background: #ede7f6; color: #5b3a8c; }
.badge-error { background: #fde8ea; color: #8f0d17; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .4em; }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92em; }
.table th, .table td { padding: .5rem .45rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { font-size: .8em; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.table tfoot th { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.anulada td { color: #aaa; text-decoration: line-through; }
tr.anulada td .badge, tr.anulada td .btn { text-decoration: none; }
tr.inactivo, li.inactivo { opacity: .5; }
.cat-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.cat-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.cat-list .link { float: right; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; }
.kpi span { display: block; color: var(--muted); font-size: .85em; }
.kpi strong { font-size: 1.4rem; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--confetti), radial-gradient(circle at 50% 30%, #8a3fc4, #3d0f63 75%); background-size: 180px 180px, cover; }
.login-page main { width: 100%; padding: 1rem; }
.login-card { max-width: 360px; margin: 0 auto; padding: 2rem 1.5rem; text-align: center; }
.login-card label { text-align: left; }
.login-logo { display: flex; justify-content: center; gap: .2rem; font-size: 2.6rem; width: 120px; height: 120px; margin: -4.2rem auto .6rem; border-radius: 50%; align-items: center; background: var(--accent); border: 6px solid #fff; box-shadow: 0 6px 0 var(--accent-d), 0 12px 30px rgba(0,0,0,.25); }

/* ---------- POS ---------- */
.pos-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.pos { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.pos > .alert { position: fixed; z-index: 50; left: 1rem; right: 1rem; top: 4rem; pointer-events: none; box-shadow: var(--shadow); animation: fadeout .4s 2.5s forwards; }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }
.pos-products { overflow-y: auto; padding: .8rem 1rem 6rem; }
.turno-bar { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; font-size: .88em; margin-bottom: .6rem; }
.cat-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .4rem; scrollbar-width: none; position: sticky; top: -.8rem; background: var(--bg); padding-top: .4rem; z-index: 2; }
.cat-tab { flex: none; border: 2px solid var(--c, #555); background: #fff; color: var(--c, #555); border-radius: 99px; padding: .45rem 1rem; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.cat-tab.active { background: var(--c, #333); color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.product { position: relative; display: flex; flex-direction: column; text-align: left; gap: .3rem; min-height: 118px; padding: .85rem .85rem .75rem; border: 0; border-top: 6px solid var(--c); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--text); touch-action: manipulation; user-select: none; }
.product:active { transform: scale(.97); }
.product.bump { animation: bump .25s; }
@keyframes bump { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent); } }
.p-name { font-weight: 700; line-height: 1.25; }
.p-desc { font-size: .78em; color: var(--muted); line-height: 1.25; }
.p-price { margin-top: auto; font-size: 1.15rem; font-weight: 800; color: var(--c); }

.pos-cart { display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); min-height: 0; }
.cart-head { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.cart-head h2 { flex: 1; margin: 0; }
.cart-close { display: none; }
.cart-items { list-style: none; margin: 0; padding: 0 1rem; overflow-y: auto; flex: 1; }
.cart-items li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.cart-items li.empty { display: block; text-align: center; color: var(--muted); padding: 2rem 0; border: 0; }
.ci-info { display: flex; flex-direction: column; align-items: flex-start; }
.ci-name { font-weight: 600; line-height: 1.25; }
.ci-nota { font-size: .8em; color: var(--muted); font-style: italic; }
.ci-qty { display: flex; align-items: center; gap: .35rem; }
.ci-qty span { min-width: 1.4em; text-align: center; font-weight: 700; }
.qty { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.15rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.ci-sub { font-weight: 700; min-width: 4.8em; text-align: right; }
.cart-foot { padding: .8rem 1rem; padding-bottom: max(.8rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.cart-total strong { font-size: 1.7rem; }
.cart-fab { display: none; }

/* ---------- Modales ---------- */
.modal { border: 0; border-radius: 16px; padding: 1.2rem; width: min(480px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(20,10,10,.55); }
.modal h2 { margin-top: 0; }
.label { font-weight: 600; margin: .8rem 0 .4rem; }
.boleta-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem; background: #faf8f6; border-radius: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg label { margin: 0; }
.seg input { display: none; }
.seg span { display: block; padding: .45rem .9rem; cursor: pointer; background: #fff; }
.seg input:checked + span { background: var(--primary); color: #fff; }
.medios { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.medio { margin: 0; }
.medio input { display: none; }
.medio span { display: block; text-align: center; padding: .8rem .2rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .9em; line-height: 1.6; }
.medio input:checked + span { border-color: var(--primary); background: #fff3f3; color: var(--primary); }
#efectivo-box { margin-top: 1rem; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.vuelto { font-size: 1.2rem; margin: .7rem 0 0; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; }
.modal-actions .btn { flex: 1; }
.ok-icon { width: 64px; height: 64px; margin: 0 auto .5rem; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2rem; display: grid; place-items: center; }
#modal-ok { text-align: center; }
#modal-ok .big { font-size: 1.6rem; color: var(--ok); }

/* ---------- Ticket ---------- */
.ticket-page { background: #fff; }
.ticket { width: 300px; margin: 0 auto; padding: 10px; font: 13px/1.35 "Courier New", monospace; color: #000; }
.ticket h2 { text-align: center; margin: 0 0 4px; }
.ticket p { margin: 4px 0; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { padding: 2px 0; vertical-align: top; }
.ticket hr { border: 0; border-top: 1px dashed #000; }
.ticket .center { text-align: center; }
.ticket .big td { font-size: 15px; }

/* ---------- Responsive / Mobile ---------- */
@media (max-width: 900px) {
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--primary-d); padding: .5rem; }
  .nav-open .nav { display: flex; }
  .nav .user { margin: .5rem .7rem; }

  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; inset: auto 0 0 0; height: 88dvh; z-index: 40; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .25s ease; }
  .cart-open .pos-cart { transform: none; }
  .cart-close { display: inline-flex; }
  .cart-fab { display: flex; align-items: center; gap: .4rem; position: fixed; left: .8rem; right: .8rem; bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 35; padding: .95rem 1.1rem; border: 0; border-radius: 14px; background: #9a9a9a; color: #fff; font: inherit; font-size: 1.05rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; }
  .has-items .cart-fab { background: var(--primary); }
  .fab-go { margin-left: auto; font-weight: 600; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
  .product { min-height: 108px; }
  .medios { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .container { padding: .7rem; }
  .row { flex-wrap: wrap; }
  .table { font-size: .85em; }
}

@media print {
  .no-print, .topbar, .filters { display: none !important; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  @page { margin: 12mm; }
}
@media print { .ticket-page .ticket { width: 100%; } }


/* =====================================================================
   Tema POS FoodTruck — estilo "centro de entretención familiar":
   morado + amarillo, confeti, botones tipo arcade y tipografía redondeada
   ===================================================================== */
:root {
  --confetti:
    radial-gradient(circle at 12% 20%, #ffc20e 0 4px, transparent 5px),
    radial-gradient(circle at 70% 15%, #ff3d8b 0 3px, transparent 4px),
    radial-gradient(circle at 40% 60%, #00d1ff 0 3px, transparent 4px),
    radial-gradient(circle at 85% 70%, #7dff6b 0 4px, transparent 5px),
    radial-gradient(circle at 25% 85%, #ff7a00 0 3px, transparent 4px);
}
h1, h2, h3, .kpi strong, .p-price, .cart-total strong { font-weight: 700; letter-spacing: .01em; }
h1 { color: var(--primary-d); }

.topbar { background: var(--confetti), linear-gradient(90deg, #4a1a72, #6a2c9e 55%, #8a3fc4); background-size: 140px 70px, cover; border-bottom: 5px solid var(--accent); box-shadow: 0 4px 0 var(--accent-d); }
.brand { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; }
.brand-icon { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--accent); border: 3px solid #fff; font-size: 1.15rem; transform: rotate(-8deg); }
.brand-text { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.brand-text b { color: var(--accent); }
.nav a { font-weight: 600; border-radius: 99px; }
.nav a.active { background: var(--accent); color: var(--primary-d); }

.btn { border-radius: 14px; border-width: 2px; box-shadow: 0 3px 0 var(--line); transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--primary-d); box-shadow: 0 4px 0 var(--accent-d); }
.btn-primary:hover { background: #ffcf3a; }
.btn-lg { font-size: 1.15em; letter-spacing: .02em; }
.btn-danger { box-shadow: 0 3px 0 #f0b8bc; }

.card, .kpi { border: 2px solid #f1e3c8; }
.kpi { border-top: 6px solid var(--k, var(--primary)); }
.kpi:nth-child(1) { --k: var(--primary); } .kpi:nth-child(2) { --k: var(--sky); }
.kpi:nth-child(3) { --k: var(--accent); } .kpi:nth-child(4) { --k: var(--pink); }
.kpi strong { color: var(--primary-d); }

.login-card { position: relative; margin-top: 4rem; border: 0; border-radius: 26px; padding-top: 1.2rem; box-shadow: 0 10px 0 #2b0a47, 0 20px 50px rgba(0,0,0,.35); }
.login-logo span:last-child { transform: rotate(14deg) translateY(4px); font-size: 2rem; }
.login-title { margin: 0; font-size: 2rem; color: var(--primary-d); }
.login-title b { color: var(--pink); }
.login-sub { margin: .2rem 0 1.2rem; color: var(--muted); }

.turno-bar { background: #fff; border: 2px dashed #e7c66e; border-radius: 14px; padding: .45rem .7rem; }
.cat-tab { border-width: 3px; box-shadow: 0 3px 0 color-mix(in srgb, var(--c, #555) 45%, transparent); }
.product { border: 3px solid color-mix(in srgb, var(--c) 25%, #fff); border-top: 8px solid var(--c); border-radius: 20px; }
.product::after { content: "★"; position: absolute; top: .45rem; right: .6rem; color: color-mix(in srgb, var(--c) 30%, #fff); font-size: 1.1rem; }
.p-price { align-self: flex-start; padding: .1rem .6rem; border-radius: 99px; background: var(--c); color: #fff; font-size: 1.1rem; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); }
.p-name { padding-right: 1rem; }

.pos-cart { background: #fff; border-left: 4px solid var(--accent); }
.cart-head { background: var(--confetti), var(--primary); background-size: 140px 70px, cover; color: #fff; }
.cart-head .btn { box-shadow: none; }
.cart-total strong { color: var(--primary-d); }
.qty { border: 2px solid var(--primary); color: var(--primary); }
.cart-fab { font-weight: 600; }
.has-items .cart-fab { background: var(--accent); color: var(--primary-d); box-shadow: 0 5px 0 var(--accent-d), 0 10px 24px rgba(0,0,0,.25); }

.modal { border: 4px solid var(--accent); border-radius: 24px; }
.modal h2 { color: var(--primary-d); }
.radio-card:has(input:checked), .medio input:checked + span { border-color: var(--primary); background: #f4ebff; color: var(--primary-d); }
.medio span { border-radius: 16px; box-shadow: 0 3px 0 var(--line); }
.ok-icon { background: var(--accent); color: var(--primary-d); border: 5px solid #fff; box-shadow: 0 5px 0 var(--accent-d); }
#modal-ok h2::before { content: "🎉 "; }
.badge-mixto { background: #f4ebff; color: var(--primary-d); }
.switch.on { box-shadow: 0 2px 0 #1d6b37; }
input:focus, select:focus, textarea:focus { outline-color: var(--primary); }

@media (max-width: 900px) {
  .nav { background: var(--primary-d); border-bottom: 4px solid var(--accent); }
  .pos-cart { border-left: 0; border-top: 5px solid var(--accent); }
}
@media print {
  .card, .kpi { border: 1px solid #ccc; }
}

/* =====================================================================
   Sello de marca: insignia circular con mascota + letras rojas gruesas
   ===================================================================== */
:root { --primary: #d6114f; --primary-d: #9e0b3a; --brand-font: "Luckiest Guy", "Fredoka", system-ui, sans-serif; }

.topbar { background: #fff; color: var(--primary); border-bottom: 5px solid var(--primary); box-shadow: 0 4px 0 var(--accent); min-height: 64px; }
.brand { gap: .6rem; }
.brand-badge { width: 58px; height: 58px; margin: -4px 0 -22px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); transition: transform .2s; position: relative; z-index: 2; }
.brand:hover .brand-badge { transform: rotate(-10deg) scale(1.05); }
.brand-text { font-family: var(--brand-font); font-size: 1.75rem; line-height: 1; color: var(--primary); text-transform: uppercase; letter-spacing: .02em; text-shadow: none; padding-top: .2rem; }
.brand-text small { font-size: .62em; color: #8a8580; margin-right: .1em; }
.nav a { color: var(--primary-d); opacity: 1; }
.nav a:hover { background: #fde6ee; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-d); }
.nav .user { color: #6b6560; }
.menu-btn { color: var(--primary); }

h1, .login-title { font-family: var(--brand-font); font-weight: 400; letter-spacing: .03em; color: var(--primary); }

.login-page { background: var(--confetti), radial-gradient(circle at 50% 30%, #f0306c, #8c0632 75%); background-size: 180px 180px, cover; }
.login-card { margin-top: 5rem; box-shadow: 0 10px 0 #5c0422, 0 20px 50px rgba(0,0,0,.35); }
.login-badge { display: block; width: 140px; height: 140px; margin: -5.5rem auto .4rem; filter: drop-shadow(0 6px 4px rgba(0,0,0,.3)); }
.login-title { font-size: 2.4rem; line-height: 1; text-transform: uppercase; }
.login-title small { display: block; font-size: .45em; color: #8a8580; }

.cart-head { background: var(--confetti), var(--primary); background-size: 140px 70px, cover; }
.radio-card:has(input:checked), .medio input:checked + span { background: #fde6ee; }
.seg input:checked + span { background: var(--primary); }

@media (max-width: 900px) {
  .brand-badge { width: 46px; height: 46px; margin: -2px 0 -14px; }
  .brand-text { font-size: 1.35rem; }
  .nav { background: #fff; border-bottom: 5px solid var(--primary); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
}

/* Logo oficial de la marca (assets/logo-marca.png) */
.brand-logo { height: 46px; width: auto; display: block; }
.brand-pos { font-family: var(--brand-font); font-size: .95rem; color: #fff; background: var(--primary); padding: .25rem .6rem .15rem; border-radius: 99px; letter-spacing: .04em; white-space: nowrap; }
.login-card { margin-top: 1rem; padding-top: 1.6rem; }
.login-logo-marca { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 1rem; }
.login-title { font-size: 1.6rem; }
@media (max-width: 900px) {
  .brand-logo { height: 36px; }
  .brand-pos { font-size: .75rem; }
}
@media (max-width: 420px) { .brand-pos { display: none; } }

.prov-box { border: 2px dashed var(--line); border-radius: 14px; padding: .8rem; margin: 0 0 1rem; }
.prov-box legend { padding: 0 .3rem; }

/* =====================================================================
   Número de atención, KDS (cocina) y pantalla de llamado
   ===================================================================== */
.ok-numero { display: block; margin: 0 auto .6rem; padding: .4rem 1rem; width: fit-content; border: 4px dashed var(--primary); border-radius: 18px;
  font-family: var(--brand-font); font-size: 3.4rem; line-height: 1; color: var(--primary); }
.ok-numero small { display: block; font-family: "Fredoka", system-ui, sans-serif; font-size: .9rem; color: var(--muted); }
.auto-print { justify-content: center; margin: .8rem 0 0; font-weight: 500; }

.ticket-numero { margin: 8px 0; padding: 6px; border: 3px solid #000; text-align: center; }
.ticket-numero span, .ticket-numero small { display: block; font-size: 12px; }
.ticket-numero strong { display: block; font-size: 54px; line-height: 1.05; letter-spacing: 2px; }
.ticket-corte { margin: 14px 0 8px; text-align: center; font-size: 11px; }
.ticket-comanda strong { font-size: 18px; }
.ticket-comanda div { margin-top: 4px; font-size: 14px; }

.kds-page { background: #2b1830; }
.kds { padding: .8rem; }
.kds-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.kds-bar h1 { margin: 0; color: #fff; }
.kds-evento select { margin: 0; min-width: 220px; }
.kds-reloj { color: #d9c9e3; font-size: .85em; margin-left: auto; }
.kds-reloj.error { color: #ffb3b3; }
.kds-tabs { display: none; }
.kds-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; align-items: start; }
.kds-col { background: rgba(255,255,255,.07); border-radius: 18px; padding: .7rem; min-height: 60vh; }
.kds-col h2 { color: #fff; margin: .1rem .2rem .7rem; font-size: 1.1rem; }
.kds-list { display: grid; gap: .7rem; }
.kds-vacio { color: #b9a6c6; text-align: center; padding: 2rem 0; }
.kds-card { background: #fff; border-radius: 16px; padding: .7rem .8rem; border-left: 10px solid var(--accent); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.kds-card.estado-preparando { border-left-color: #ff7a00; }
.kds-card.estado-listo { border-left-color: var(--ok); }
.kds-card header { display: flex; justify-content: space-between; align-items: center; }
.kds-num { font-family: var(--brand-font); font-size: 2.2rem; color: var(--primary); line-height: 1; }
.kds-tiempo { font-weight: 700; font-size: .85rem; border-radius: 99px; padding: .15rem .55rem; }
.t-ok { background: #e6f6ec; color: #1d6b37; } .t-medio { background: #fff5dc; color: #7a5600; }
.t-alto { background: #fde8ea; color: #8f0d17; animation: parpadeo 1s infinite alternate; }
@keyframes parpadeo { to { opacity: .55; } }
.kds-card ul { list-style: none; margin: .5rem 0; padding: 0; font-size: 1.05rem; }
.kds-card li { padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.kds-card li em { display: block; font-size: .85em; color: var(--primary-d); }
.kds-card footer { display: flex; gap: .4rem; justify-content: flex-end; }
.kds-card footer .btn-primary { flex: 1; }

.llamado-page { background: radial-gradient(circle at 50% 0%, #f0306c, #8c0632 80%); min-height: 100vh; color: #fff; }
.llamado { padding: 1rem 1.5rem; }
.llamado-head { display: flex; align-items: center; gap: 1rem; background: #fff; color: var(--primary); border-radius: 18px; padding: .6rem 1rem; margin-bottom: 1rem; }
.llamado-head img { height: 54px; }
.llamado-head div { flex: 1; }
.llamado-head strong { display: block; font-family: var(--brand-font); font-size: 1.6rem; font-weight: 400; }
.llamado-head span { color: var(--muted); font-size: .85rem; }
.llamado-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.2rem; }
.llamado-col { border-radius: 24px; padding: 1rem 1.2rem; min-height: 70vh; }
.llamado-col.preparando { background: rgba(0,0,0,.25); }
.llamado-col.listo { background: #fff; color: var(--primary-d); box-shadow: 0 10px 0 var(--accent-d); border: 6px solid var(--accent); }
.llamado-col h2 { font-family: var(--brand-font); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.6rem); margin: 0 0 1rem; text-align: center; }
.llamado-nums { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.llamado-nums span { font-family: var(--brand-font); font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1; padding: .3rem .8rem; border-radius: 16px; background: rgba(255,255,255,.15); }
.llamado-col.listo .llamado-nums span { background: #fde6ee; color: var(--primary); font-size: clamp(3rem, 7vw, 6.5rem); }
.llamado-col.listo .llamado-nums span.ultimo { background: var(--accent); color: var(--primary-d); animation: latido 1s ease-in-out 3; }
.llamado-nums em { opacity: .6; font-size: 2rem; }
@keyframes latido { 50% { transform: scale(1.12); } }
.llamado-flash { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: rgba(140,6,50,.94); font-family: var(--brand-font); text-align: center; animation: entra .35s ease-out; }
.llamado-flash span { font-size: clamp(1.6rem, 4vw, 3.5rem); }
.llamado-flash strong { font-size: clamp(6rem, 20vw, 16rem); font-weight: 400; color: var(--accent); line-height: 1; text-shadow: 0 10px 0 rgba(0,0,0,.25); }
@keyframes entra { from { opacity: 0; transform: scale(.9); } }

@media (max-width: 900px) {
  .kds-tabs { display: flex; gap: .4rem; margin-bottom: .6rem; }
  .kds-tabs button { flex: 1; padding: .6rem; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 700; }
  .kds-tabs button.active { background: var(--accent); color: var(--primary-d); }
  .kds-tabs button span:not(:empty)::before { content: " · "; }
  .kds-board { grid-template-columns: 1fr; }
  .kds-col { display: none; min-height: 0; }
  .kds-col.activa { display: block; }
  .llamado-grid { grid-template-columns: 1fr; }
  .llamado-col { min-height: 0; }
}

.kds-meta { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.kds-meta b { color: var(--text); }
.kds-listo-en { display: inline-block; margin-left: .3rem; padding: .05rem .45rem; border-radius: 99px; background: #f4ebff; color: #5b3a8c; font-weight: 600; }
.kds-auto { color: #e9dcf2; font-size: .85rem; margin: -.3rem 0 .7rem; }

/* =====================================================================
   Modificadores: selector de sabores / bebidas
   ===================================================================== */
.p-mods { font-size: .74rem; font-weight: 600; color: var(--muted); }
.ci-mods { font-size: .8em; color: var(--primary-d); font-weight: 600; line-height: 1.3; }
.mods-grupo { border: 2px solid var(--line); border-radius: 16px; padding: .6rem .7rem .8rem; margin: 0 0 .8rem; }
.mods-grupo.completo { border-color: var(--ok); }
.mods-grupo legend { font-weight: 700; padding: 0 .3rem; }
.mods-grupo legend span { display: inline-block; margin-left: .3rem; padding: 0 .5rem; border-radius: 99px; background: #fde8ea; color: var(--primary-d); font-size: .85em; }
.mods-grupo.completo legend span { background: #e6f6ec; color: #1d6b37; }
.mods-ops { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .45rem; }
.mod-op { display: flex; gap: .25rem; }
.mod-add { flex: 1; min-height: 3rem; padding: .45rem .6rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; text-align: left; cursor: pointer; touch-action: manipulation; }
.mod-op.on .mod-add { border-color: var(--primary); background: #fde6ee; color: var(--primary-d); }
.mod-add b { float: right; }
.mod-del { width: 2.4rem; border: 2px solid var(--primary); border-radius: 12px; background: #fff; color: var(--primary); font-size: 1.2rem; font-weight: 700; cursor: pointer; }
#modal-mods { width: min(560px, calc(100vw - 1.5rem)); }
.kds-mod { display: block; font-size: .9em; font-weight: 700; color: var(--primary-d); padding-left: .4rem; }
.control-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.grupo-head { align-items: flex-end; }
.cant-mod { max-width: 4.5rem; margin-left: auto; text-align: center; }
@media (max-width: 520px) { .mods-ops { grid-template-columns: 1fr 1fr; } }

/* Menú más compacto en pantallas medianas para que quepan todas las opciones */
@media (min-width: 901px) and (max-width: 1500px) {
  .nav { gap: .1rem; }
  .nav a { padding: .35rem .5rem; font-size: .92rem; }
  .nav .user { display: none; }
  .brand-pos { display: none; }
}

/* Neto / IVA / bruto */
.cart-neto { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.cart-total small { font-size: .7em; color: var(--muted); font-weight: 500; }
.pago-neto { margin: -.3rem 0 .6rem; color: var(--muted); font-size: .9rem; }
.kpi-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
