/* Fraylen POS · estilos (móvil primero, modo oscuro automático, impresión de recibos). */
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --line: #DCE3EB;
  --text: #0B1A2E;
  --text-2: #4A5A6E;
  --brand: #0E6178;
  --brand-2: #0A4A5C;
  --brand-soft: #E3F1F5;
  --accent: #FF7A59;
  --accent-2: #F2633F;
  --ok: #1F7A55;
  --ok-soft: #E6F4EE;
  --warn: #9A6200;
  --warn-soft: #FFF4DC;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --dark: #0B1A2E;
  --side: #0B1A2E;
  --side-text: #C9D5E3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 26, 46, .05), 0 6px 20px rgba(11, 26, 46, .06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --title: "Fraunces", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1422; --card: #111F33; --line: #22344D; --text: #E8EEF5; --text-2: #9DB0C6;
    --brand: #4FB3CC; --brand-2: #7CCBDD; --brand-soft: #13324A;
    --ok: #4CC28E; --ok-soft: #12302A; --warn: #E8B44C; --warn-soft: #33290F; --danger: #FF8A7A; --danger-soft: #3A1A1A;
    --side: #07101C; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
body.has-modal { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--title); font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 800; }
h3 { font-size: .98rem; font-weight: 800; }
p { margin: 0; }
a { color: var(--brand); }
img, svg { display: block; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.xs { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.ok-text { color: var(--ok); font-weight: 700; }
.warn-text { color: var(--warn); font-weight: 700; }
.danger-text { color: var(--danger) !important; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 1rem; }
.pad-top { padding-top: 1.9rem; }

/* ---------------- botones y campos ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; touch-action: manipulation; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #0B1A2E; }
.btn.accent:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { min-height: 34px; padding: .35rem .7rem; font-size: .86rem; }
.btn.lg { min-height: 52px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn.is-busy, .table-card.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after, .table-card.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 2px solid var(--text-2); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--brand-soft); }
.icon-btn.sm { width: 34px; height: 34px; }
.input { width: 100%; min-height: 44px; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; }
.input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.input.sm { min-height: 36px; padding: .35rem .6rem; font-size: .88rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.field { display: grid; gap: .3rem; }
.field label, .label { font-weight: 700; font-size: .88rem; }
.hint { color: var(--text-2); font-size: .82rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check input.switch { width: 44px; height: 26px; margin-top: 0; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(18px); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: .9rem; }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid2.top { align-items: start; margin-top: 1rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { min-height: 36px; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.chip[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #07101C; } .btn.primary:hover { background: #7CCBDD; } }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #07101C; } }
.chip.ghost { border-style: dashed; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand-2); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-block; padding: .08rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 800; }
.pill.ready { background: var(--ok); color: #fff; }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------- cargando / vacío ---------------- */
.loading { display: flex; gap: .7rem; align-items: center; justify-content: center; padding: 3rem 1rem; color: var(--text-2); font-weight: 600; }
.loading.full { min-height: 100vh; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: grid; gap: .8rem; justify-items: center; padding: 2.5rem 1rem; text-align: center; color: var(--text-2); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.boot-error { display: grid; gap: 1rem; place-items: center; min-height: 100vh; padding: 1rem; text-align: center; }

/* ---------------- avisos y ventanas ---------------- */
.toasts { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: grid; gap: .5rem; z-index: 300; width: min(440px, calc(100% - 32px)); }
.toast { padding: .8rem 1rem; border-radius: 12px; background: var(--dark); color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .2s ease-out; transition: opacity .4s, transform .4s; }
.toast-error { background: var(--danger); }
.toast-warn { background: #8A5A00; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.modal-back { position: fixed; inset: 0; z-index: 200; display: grid; place-items: end center; background: rgba(7, 16, 28, .55); animation: fade .15s; }
@media (min-width: 640px) { .modal-back { place-items: center; padding: 1rem; } }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-height: 92vh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: rise .2s ease-out; padding-bottom: var(--safe-b); }
@media (min-width: 640px) { .modal { width: min(520px, 100%); border-radius: 18px; } .modal.modal-wide { width: min(760px, 100%); } }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1rem .6rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.modal-body { padding: 1.1rem 1.2rem 1.3rem; }

/* ---------------- acceso ---------------- */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-hero { display: grid; align-content: center; gap: 1.4rem; padding: 2rem 1.4rem; background: radial-gradient(120% 90% at 0% 0%, #13435A 0%, #0B1A2E 60%); color: #F1F5F9; }
@media (min-width: 900px) { .auth-hero { padding: 3rem clamp(2rem, 6vw, 5rem); } }
.auth-hero h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); color: #fff; max-width: 15ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; gap: .6rem; align-items: center; font-weight: 600; color: #DCE6F1; }
.auth-points .icon { color: #FF7A59; }
.auth-foot { color: #A9B8CB; font-size: .9rem; }
@media (max-width: 899px) { .auth-points, .auth-foot { display: none; } }
.auth-main { display: grid; place-items: center; padding: 1.5rem 1rem 3rem; }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; margin-bottom: 1.2rem; border-radius: 12px; background: var(--bg); }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-weight: 800; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------------- estructura ---------------- */
.brand { display: flex; gap: .7rem; align-items: center; }
.brand strong { display: block; font-size: 1.02rem; line-height: 1.2; }
.brand span { display: block; font-size: .8rem; opacity: .75; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { border-radius: 10px; }
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; z-index: 100; width: 260px; display: flex; flex-direction: column; gap: 1.2rem; padding: 1.1rem .8rem calc(1rem + var(--safe-b)); background: var(--side); color: #fff; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
.nav-open .side { transform: none; box-shadow: 10px 0 40px rgba(0, 0, 0, .3); }
.scrim { display: none; }
.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(7, 16, 28, .5); }
.nav { display: grid; gap: .15rem; }
.nav a { display: flex; gap: .7rem; align-items: center; min-height: 44px; padding: .5rem .75rem; border-radius: 10px; color: var(--side-text); text-decoration: none; font-weight: 700; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current] { background: rgba(159, 212, 224, .14); color: #fff; }
.nav a[aria-current] .icon { color: #FF7A59; }
.side-foot { margin-top: auto; display: grid; gap: .6rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-foot .btn { color: var(--side-text); justify-content: flex-start; }
.side-foot .btn:hover { background: rgba(255, 255, 255, .06); }
.who strong { display: block; }
.who span { color: var(--side-text); font-size: .82rem; }
.content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .4rem; min-height: 56px; padding: .4rem .6rem; padding-top: max(.4rem, env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line); }
.top-title { font-weight: 800; }
.main { padding: 1rem 1rem calc(2rem + var(--safe-b)); max-width: 1280px; margin: 0 auto; outline: none; }
@media (min-width: 1024px) {
  .side { transform: none; }
  .content { margin-left: 260px; }
  .topbar { display: none; }
  .menu-btn { display: none; }
  .main { padding: 1.6rem 2rem 3rem; }
  .nav-open .scrim { display: none; }
}
.banner-slot:empty { display: none; }
.banner { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .65rem 1rem; font-weight: 600; font-size: .9rem; text-decoration: none; }
.banner a { font-weight: 800; }
.banner.info { background: var(--brand-soft); color: var(--brand-2); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner > span { flex: 1 1 14rem; }
.main .banner { border-radius: var(--radius-sm); margin-bottom: 1rem; }
.banner.link:hover { filter: brightness(.97); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .8rem; margin-bottom: 1.1rem; }
.page-head p { margin-top: .2rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin: 1rem 0; }
.toolbar .input[type="search"] { max-width: 360px; }
.toolbar.wrap { flex-wrap: wrap; }
.toolbar .row .input[type="date"] { width: auto; min-width: 150px; }

/* ---------------- tarjetas y datos ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 460px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1rem; }
.kpis { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1rem; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.three { grid-template-columns: repeat(3, 1fr); } }
.kpi { position: relative; display: grid; gap: .15rem; padding: .95rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-label { color: var(--text-2); font-size: .82rem; font-weight: 600; }
.kpi strong { font-size: 1.45rem; line-height: 1.15; }
.kpi-sub { color: var(--text-2); font-size: .78rem; }
.kpi-icon { position: absolute; top: .8rem; right: .8rem; color: var(--brand); opacity: .5; }
.quick { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick-card { display: grid; gap: .25rem; padding: 1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.quick-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.quick-card span:last-child { color: var(--text-2); font-size: .84rem; }
.quick-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: .3rem; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.card .table-wrap { border: 0; }
.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data th { text-align: left; padding: .65rem .8rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data tr:last-child td { border-bottom: 0; }
.data .actions { text-align: right; white-space: nowrap; }
.data .actions > * { margin-left: .3rem; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.tabs { display: flex; gap: .2rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button { min-height: 44px; padding: .5rem .9rem; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--text-2); font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.upsell { display: grid; gap: .7rem; justify-items: start; }
.upsell .icon { color: var(--accent); width: 28px; height: 28px; }
.upsell-inline { margin-top: .8rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: .86rem; }

/* ---------------- salón ---------------- */
.area { margin-bottom: 1.4rem; }
.area-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: .6rem; }
.tables { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.table-card { position: relative; display: grid; gap: .25rem; align-content: start; min-height: 112px; padding: .85rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s, border-color .15s; }
.table-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.table-card.free { border-style: dashed; background: transparent; box-shadow: none; }
.table-card.busy { border-color: var(--brand); background: var(--card); }
.table-name { display: flex; align-items: center; gap: .3rem; font-weight: 800; font-size: 1.02rem; }
.table-sub { color: var(--text-2); font-size: .86rem; }
.table-time { display: flex; align-items: center; gap: .25rem; color: var(--text-2); font-size: .8rem; }
.table-card strong { font-size: 1.15rem; }

/* ---------------- pedido ---------------- */
.order-layout { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .order-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; } }
@media (min-width: 1360px) { .order-layout { grid-template-columns: minmax(0, 1fr) 390px; } }
.picker-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.picker-tools { display: grid; gap: .6rem; margin-bottom: .9rem; position: sticky; top: 56px; z-index: 5; padding: .4rem 0; background: var(--bg); }
@media (min-width: 1024px) { .picker-tools { top: 0; } }
.products { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
.product { display: grid; gap: .3rem; align-content: space-between; min-height: 96px; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .08s, border-color .15s; touch-action: manipulation; }
.product:hover:not(:disabled) { border-color: var(--brand); }
.product:active:not(:disabled) { transform: scale(.97); }
.product-name { font-weight: 800; line-height: 1.25; }
.product-price { color: var(--brand); font-weight: 800; }
.product.soldout { opacity: .55; cursor: not-allowed; }
.ticket { display: grid; gap: .8rem; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 70px; }
@media (min-width: 1024px) { .ticket { position: sticky; top: 1.2rem; max-height: calc(100vh - 2.4rem); overflow-y: auto; } }
.ticket-head { display: flex; justify-content: space-between; align-items: center; }
.ticket-note { display: flex; gap: .4rem; align-items: center; padding: .45rem .6rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .86rem; font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.line { display: grid; gap: .4rem; padding: .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.line.draft { border-color: var(--accent); border-style: dashed; background: rgba(255, 122, 89, .05); }
.line.off { opacity: .55; text-decoration: line-through; }
.line-main { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: start; }
.line-qty { font-weight: 800; color: var(--brand); min-width: 2ch; }
.line-name { font-weight: 700; }
.line-note { display: block; color: var(--warn); font-size: .82rem; font-weight: 600; }
.line-price { font-weight: 800; }
.line-foot { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.status { font-size: .74rem; font-weight: 800; padding: .1rem .5rem; border-radius: 99px; background: var(--bg); color: var(--text-2); }
.status.s-pendiente { background: var(--warn-soft); color: var(--warn); }
.status.s-cocina { background: var(--brand-soft); color: var(--brand-2); }
.status.s-listo { background: var(--ok); color: #fff; }
.status.s-entregado { background: var(--ok-soft); color: var(--ok); }
.status.s-nuevo { background: var(--accent); color: #0B1A2E; }
.cancelled summary { cursor: pointer; color: var(--text-2); font-size: .86rem; }
.ticket-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .6rem; border-top: 2px solid var(--line); font-size: 1.05rem; }
.ticket-total strong { font-size: 1.5rem; }
.ticket-actions { display: grid; gap: .55rem; }
.ticket-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem calc(.7rem + var(--safe-b)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(11, 26, 46, .1); }
.ticket-bar strong { display: block; font-size: 1.15rem; }
@media (min-width: 1024px) { .ticket-bar { display: none; } }
@media (max-width: 1023px) { .order-layout { padding-bottom: 80px; } }

/* cobro */
.methods { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.method { min-height: 46px; padding: .5rem .95rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.method[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.pay-summary { display: grid; gap: .35rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--bg); }
.pay-row { display: flex; justify-content: space-between; gap: 1rem; }
.pay-row.hl { padding: .5rem .6rem; border-radius: 8px; background: var(--brand-soft); }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .4rem; border-top: 1px solid var(--line); font-weight: 800; }
.pay-total strong { font-size: 1.5rem; }
.pay-change { display: flex; justify-content: space-between; color: var(--ok); font-weight: 800; font-size: 1.1rem; }
.big-check { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--ok); color: #fff; }
.big-check .icon { width: 34px; height: 34px; stroke-width: 3; }
.change-big { font-size: 1.3rem; }

/* ---------------- cocina ---------------- */
.kds { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.kds > .empty, .kds-done { grid-column: 1 / -1; }
.kds-done h2 { margin: .6rem 0; color: var(--text-2); }
.kds-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kds-ticket { display: grid; gap: .6rem; padding: .9rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--ok); box-shadow: var(--shadow); }
.kds-ticket.slow { border-top-color: #E0A100; }
.kds-ticket.late { border-top-color: var(--danger); animation: pulse 1.6s ease-in-out infinite; }
.kds-ticket.done { opacity: .6; border-top-color: var(--line); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(180, 35, 24, .15); } }
.kds-ticket header { display: flex; justify-content: space-between; gap: .5rem; }
.kds-ticket header strong { display: block; font-size: 1.15rem; }
.kds-ticket header span { color: var(--text-2); font-size: .85rem; }
.kds-time { display: inline-flex; gap: .25rem; align-items: center; font-weight: 800; color: var(--text) !important; white-space: nowrap; }
.kds-ticket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.kds-ticket li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; background: var(--bg); }
.kds-ticket li.is-ready { opacity: .55; text-decoration: line-through; }
.kds-ticket li .icon { color: var(--ok); }
.kds-qty { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-right: .5rem; border-radius: 8px; background: var(--dark); color: #fff; font-weight: 800; }
.kds-name { font-weight: 800; font-size: 1.02rem; }
.kds-note { display: block; margin-top: .2rem; color: var(--danger); font-weight: 700; font-size: .85rem; }

/* ---------------- inventario / menú ---------------- */
.purchase-line, .recipe-line { display: grid; gap: .4rem; grid-template-columns: 1fr 100px 120px 34px; align-items: center; }
.recipe-line { grid-template-columns: 1fr 110px 34px; }
.purchase-line.head span { font-size: .78rem; font-weight: 800; color: var(--text-2); text-transform: uppercase; }
@media (max-width: 560px) { .purchase-line { grid-template-columns: 1fr 1fr 34px; } .purchase-line > :first-child { grid-column: 1 / -1; } .purchase-line.head { display: none; } }
.purchase summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.purchase[open] summary { margin-bottom: .6rem; }
.recipe-cost { display: grid; gap: .3rem; padding: .8rem; border-radius: var(--radius-sm); background: var(--bg); }
.recipe-cost > div { display: flex; justify-content: space-between; }
.person { display: flex; gap: .8rem; align-items: flex-start; }
.person.off { opacity: .6; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); font-weight: 800; flex: none; }
.diff { font-weight: 800; }
.diff.ok { color: var(--ok); } .diff.warn { color: var(--warn); } .diff.danger { color: var(--danger); }

/* ---------------- reportes ---------------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: .5rem; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25rem; min-width: 0; }
.chart .bar { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--brand); }
.chart .bar.peak { background: var(--accent); }
.chart .col-label { font-size: .7rem; color: var(--text-2); }
.chart.hours { gap: 2px; }
.meter-row { display: grid !important; gap: .3rem; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------------- ajustes / membresía ---------------- */
.qr-box { display: grid; place-items: center; padding: 1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); justify-self: start; }
.menu-link { word-break: break-all; font-weight: 700; }
.membership-now { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.membership-now h2 { font-family: var(--title); font-size: 1.6rem; margin: .2rem 0; }
.plans { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan-card { position: relative; display: grid; gap: .7rem; align-content: start; padding: 1.3rem 1.2rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.plan-card.featured { border: 2px solid var(--brand); }
.plan-card.current { outline: 3px solid var(--ok); }
.plan-flag { position: absolute; top: -12px; left: 1.2rem; padding: .15rem .7rem; border-radius: 99px; background: var(--accent); color: #0B1A2E; font-size: .76rem; font-weight: 800; }
.plan-price { font-size: 1.9rem; font-weight: 800; }
.plan-price span { font-size: .95rem; color: var(--text-2); font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .92rem; }
.checks li { display: flex; gap: .45rem; align-items: flex-start; }
.checks .icon { color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }
.steps-list { margin: .5rem 0 .8rem; padding-left: 1.2rem; display: grid; gap: .4rem; }
.noscript { padding: 2rem; text-align: center; }

/* ---------------- menú público ---------------- */
body.pm { background: var(--bg); }
.pm-head { padding: 1.6rem 1rem 0; background: var(--dark); color: #fff; text-align: center; }
.pm-head h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); color: #fff; }
.pm-head p { color: #A9B8CB; margin-top: .3rem; }
.pm-head { position: relative; }
.pm-cats { display: flex; gap: .4rem; overflow-x: auto; padding: .9rem 0; margin-top: .8rem; justify-content: safe center; }
.pm-cats a { flex: none; padding: .4rem .9rem; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem; }
.pm-main { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.pm-section { margin: 1.2rem 0; scroll-margin-top: 1rem; }
.pm-section h2 { font-family: var(--title); font-size: 1.35rem; margin-bottom: .6rem; }
.pm-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1rem; margin-bottom: .55rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.pm-item h3 { font-size: 1.02rem; }
.pm-item p { color: var(--text-2); font-size: .88rem; margin: .15rem 0 .3rem; }
.pm-item strong { color: var(--brand); }
.pm-add { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--accent); color: #0B1A2E; font-size: 1.6rem; font-weight: 800; line-height: 1; cursor: pointer; transition: transform .15s; }
.pm-add.added { transform: scale(1.18); background: var(--ok); color: #fff; }
.pm-note, .pm-foot { color: var(--text-2); text-align: center; font-size: .86rem; margin-top: 2rem; }
.pm-cart { position: fixed; left: 0; right: 0; bottom: 0; padding: .8rem 1rem calc(.8rem + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 35%); }
.pm-cart-btn { display: block; width: min(560px, 100%); margin: 0 auto; min-height: 54px; border: 0; border-radius: 99px; background: var(--dark); color: #fff; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.pm-dialog { width: min(520px, calc(100% - 24px)); border: 0; border-radius: 18px; padding: 0; background: var(--card); color: var(--text); }
.pm-dialog::backdrop { background: rgba(7, 16, 28, .55); }
.pm-dialog-body { display: grid; gap: .8rem; padding: 1.2rem; }
.pm-dialog-body label { display: grid; gap: .3rem; font-weight: 700; font-size: .9rem; }
.pm-dialog-body input, .pm-dialog-body select { min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--text); }
.pm-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.pm-lines li { display: grid; grid-template-columns: 34px 1fr auto; gap: .5rem; align-items: center; }
.pm-lines button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.pm-total { font-size: 1.1rem; text-align: right; }
.pm-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.pm-empty { display: grid; place-items: center; gap: .6rem; min-height: 80vh; padding: 1rem; text-align: center; }

/* ---------------- impresión (recibo 80 mm y QR) ---------------- */
.receipt, .qr-print { display: none; }
@media print {
  @page { margin: 6mm; }
  body * { visibility: hidden; }
  .receipt, .receipt *, .qr-print, .qr-print * { visibility: visible; }
  .receipt { display: block; position: absolute; left: 0; top: 0; width: 72mm; font: 11pt/1.35 "Courier New", monospace; color: #000; }
  .receipt h2 { font-size: 14pt; text-align: center; margin-bottom: 2mm; }
  .receipt p { margin: 0 0 1mm; text-align: center; }
  .receipt table { width: 100%; border-collapse: collapse; margin: 3mm 0; border-top: 1px dashed #000; border-bottom: 1px dashed #000; }
  .receipt td { padding: 1mm 0; vertical-align: top; }
  .receipt td:last-child { text-align: right; white-space: nowrap; }
  .receipt .r-row { display: flex; justify-content: space-between; text-align: left; }
  .receipt .r-total { font-weight: 700; font-size: 13pt; margin: 2mm 0; }
  .receipt .r-foot { font-size: 9pt; margin-top: 3mm; }
  .qr-print { display: grid; position: absolute; inset: 0; grid-template-columns: 1fr 1fr; gap: 8mm; padding: 4mm; }
  .qr-print-card { display: grid; justify-items: center; gap: 3mm; padding: 6mm; border: 1px dashed #999; border-radius: 4mm; font-family: Arial, sans-serif; color: #0B1A2E; text-align: center; break-inside: avoid; }
  .qr-print-card strong { font-size: 16pt; }
  .qr-print-card svg { width: 62mm; height: 62mm; }
  .qr-print-card span { font-size: 12pt; font-weight: 700; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- multinegocio ---------------- */
.biz-types { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: .4rem; }
.biz-type { display: grid; gap: .2rem; align-content: start; justify-items: start; padding: .7rem; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.biz-type .icon { color: var(--brand); }
.biz-type span { font-size: .76rem; color: var(--text-2); line-height: 1.35; }
.biz-type[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.module-row { align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.module-row span { display: grid; }
.modules .module-row:last-child { border-bottom: 0; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input.big-search { min-height: 52px; padding-left: 2.6rem; font-size: 1.05rem; font-weight: 600; }
.customer-row { display: flex; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.customer-row > .icon { color: var(--brand); }
.pick-list { max-height: 50vh; overflow-y: auto; }
.pick-list li { padding: 0; }
.pick { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .4rem; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.pick:hover { background: var(--brand-soft); }
.quick-customer { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; }
@media (max-width: 520px) { .quick-customer { grid-template-columns: 1fr; } }
.variant-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.variant { display: grid; gap: .15rem; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.variant:hover:not(:disabled) { border-color: var(--brand); }
.variant.soldout { opacity: .5; cursor: not-allowed; }
.variant-stock { display: grid; gap: .25rem; font-size: .85rem; font-weight: 700; }
.variant-stock .input { min-height: 38px; }
.day-label { text-transform: capitalize; margin-bottom: .8rem; font-weight: 700; }
.agenda { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.agenda-col { display: grid; gap: .6rem; }
.agenda-col h2 { display: flex; align-items: center; gap: .3rem; }
.appt { display: grid; grid-template-columns: 64px 1fr; gap: .2rem .8rem; padding: .8rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand); box-shadow: var(--shadow); }
.appt.s-confirmada { border-left-color: var(--ok); }
.appt.s-atendida { opacity: .65; border-left-color: var(--ok); }
.appt.s-cancelada, .appt.s-no_vino { opacity: .5; border-left-color: var(--danger); }
.appt-time { display: grid; align-content: start; }
.appt-time strong { font-size: 1.05rem; }
.appt-time span { color: var(--text-2); font-size: .8rem; }
.appt-body { display: grid; gap: .2rem; min-width: 0; }
.appt-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding-top: .4rem; border-top: 1px solid var(--line); margin-top: .3rem; }
.icon-btn.flip .icon { transform: rotate(180deg); }
