

:root {
  --wood: #251810;
  --wood-lift: #39251a;
  --fire: #c45120;
  --brasas: #e7ab55;
  --cream: #f5e6ce;
  --paper: #fbf6ed;
  --panel: #fffcf6;
  --ink: #2b1d14;
  --muted: #705b4c;
  --border: #e5d7c4;
  --accent: #9f3814;
  --green: #33583f;
  --shadow: 0 8px 26px #43280d0c;
}

@layer base {
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 Arial, "Helvetica Neue", sans-serif; }
  body:has(.overlay) { overflow: hidden; }
  h1, h2, h3, p, ul { margin: 0; }
  h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; line-height: 1.12; font-weight: 700; overflow-wrap: anywhere; }
  h1 { font-size: clamp(2.65rem, 7vw, 4.8rem); }
  h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
  h3 { font-size: 1.28rem; }
  a { color: inherit; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #a44823; outline-offset: 3px;
  }
  button:disabled { cursor: not-allowed; opacity: .58; }
  label { display: grid; gap: .35rem; font-weight: 700; }
  input, textarea, select { color: var(--ink); font: inherit; }
  input:not([type=checkbox]), textarea, select {
    width: 100%; min-height: 46px; padding: .6rem .75rem; border: 1px solid #ccbba6;
    border-radius: .55rem; background: #fffefa; font-weight: 400;
  }
  input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
  textarea { resize: vertical; }
  small { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; }
  img { display: block; max-width: 100%; }
}

.button, .icon-button, .chip, .admin-nav button {
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  border: 1px solid var(--border); border-radius: .6rem; background: var(--panel); color: var(--ink);
  font-weight: 700; min-height: 46px; padding: .62rem .95rem; cursor: pointer; text-align: center; line-height: 1.2;
}
.button svg, .icon-button svg, .chip svg, .admin-nav svg { flex: none; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled), .chip:hover:not(:disabled), .admin-nav button:hover { background: #f2e2cc; }
.button-primary { background: var(--accent); color: #fff9ee; border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: #80280c; }
.button-fire { background: var(--brasas); color: #29190f; border-color: var(--brasas); }
.button-fire:hover:not(:disabled) { background: #f0be75; }
.button-ghost { background: transparent; border-color: transparent; }
.button-outline { background: transparent; border-color: #cdb89d; }
.button-light { color: var(--cream); border-color: transparent; background: transparent; }
.button-light:hover:not(:disabled) { background: #fff4dd18; }
.button-small { font-size: .9rem; }
.icon-button { width: 46px; flex: 0 0 46px; padding: 0; }
.text-button { min-height: 44px; background: transparent; color: var(--muted); border: 0; text-align: start; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.danger { color: #90371e; }
.brand { display:inline-flex;align-items:center;gap:.75rem; white-space: nowrap; color: var(--cream); }
.brand-mark { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 14px; background: #522d1c; color: var(--brasas); border: 1px solid #885331; }
.brand-wordmark { font: 800 1.45rem/1 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.brand-wordmark strong { color: var(--brasas); }
.brand-compact .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
.brand-compact .brand-wordmark { font-size: 1.25rem; }
.eyebrow { display:flex;align-items:center;gap:.5rem; font-size: .76rem; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.subtle { color: var(--muted); font-size: .94rem; }
.stack { display:grid;gap:1rem; }
.split { display:flex;align-items:center;justify-content:space-between;gap:.75rem; }
.align-start { align-items: start; }
.break-any { overflow-wrap: anywhere; }
.with-icon, .actions { display:flex;align-items:center;gap:.5rem; flex-wrap: wrap; }
.notice { padding: .7rem .9rem; border: 1px solid #ddc69e; background: #f9ebd3; color: #593c24; border-radius: .55rem; overflow-wrap: anywhere; }
.notice-error { background: #fdebe2; color: #812d16; border-color: #e8b6a7; }
.notice-success { background: #eaf2e7; color: #284e33; border-color: #bacfb9; }
.card { background: var(--panel); padding: clamp(.9rem, 2.4vw, 1.3rem); border: 1px solid var(--border); border-radius: .88rem; box-shadow: var(--shadow); min-width: 0; }
.stack:empty, .menu-grid:empty, .operation-grid:empty { display: none; }
.empty { padding: clamp(1.5rem, 4vw, 2.5rem); min-height: 120px; border: 1px dashed #ddc8ac; border-radius: .85rem; text-align: center; background: #f8efdf; }
.empty h3 { margin: .45rem 0 .3rem; }
.empty p { color: var(--muted); }
.empty-icon { width: 53px; height: 53px; margin-inline: auto; display: grid; place-items: center; border-radius: 50%; color: #9d3d1a; background: #f3ddbd; }
.section-top { display:flex;align-items:flex-end;justify-content:space-between;gap:1rem; flex-wrap: wrap; }
.section-top p { color: var(--muted); margin-top: .2rem; }
.chip { border-radius: 999px; white-space: nowrap; }
.chip.selected { background: var(--wood); color: var(--cream); border-color: var(--wood); }
.chip.selected:hover:not(:disabled) { background: var(--wood-lift); }
.filters { display:flex;align-items:center;gap:.5rem; overflow-x: auto; padding: 4px 4px .4rem; margin-inline: -4px; }
.status-tag { display:inline-flex;align-items:center;gap:.25rem; padding: .3rem .6rem; border-radius: 999px; color: #534033; background: #eee2d1; font-size: .83rem; font-weight: 700; line-height: 1.25; }
.status-nuevo { color: #7a3517; background: #f9dfc7; }
.status-preparando { color: #744215; background: #f9e8c7; }
.status-listo, .status-entregado { color: var(--green); background: #e1ede1; }
.status-cancelado { color: #85351f; background: #f6dfd4; }

.home, .login, .customer-header {
  --grain: repeating-linear-gradient(94deg, #ffdfaa04 0 1px, transparent 1px 8px, #0000000c 8px 9px, transparent 9px 34px);
  background: var(--grain), radial-gradient(ellipse at 54% 97%, #61361e 0%, #352116 38%, #251810 76%);
  color: var(--cream);
}
.home { min-height: 100svh; }
.home-header, .customer-bar, .staff-header-inner { display:flex;align-items:center;justify-content:space-between;gap:.75rem; width: min(100% - 2rem, 1180px); margin-inline: auto; padding-block: .95rem; }
.home-header { border-bottom: 1px solid #f5e6ce28; }
.home-hero { min-height: calc(100svh - 80px); display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden; padding: 3rem 1rem 4rem; }
.embers { position: absolute; inset: 0; z-index: -1; opacity: .8; pointer-events: none;
  background:
    radial-gradient(circle at 21% 81%, #f8ac5d 0 1px, transparent 2px),
    radial-gradient(circle at 71% 84%, #ec7836 0 2px, transparent 3px),
    radial-gradient(circle at 25% 66%, #df9147 0 1px, transparent 2px),
    radial-gradient(circle at 84% 73%, #ffad69 0 1px, transparent 2px),
    radial-gradient(circle at 63% 59%, #b94a29 0 1px, transparent 2px),
    radial-gradient(circle at 15% 44%, #9e4426 0 1px, transparent 2px),
    radial-gradient(circle at 79% 35%, #b95936 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 103%, #b64c264d, transparent 58%);
}
.home-hero::before, .home-hero::after { content: ""; position: absolute; width: clamp(300px, 75vw, 850px); aspect-ratio: 1; border: 1px solid #e7ab5516; border-radius: 50%; z-index: -1; }
.home-hero::after { width: clamp(240px, 63vw, 700px); border-color: #e7ab551e; }
.home-content { display: grid; justify-items: center; text-align: center; gap: 1.35rem; max-width: 850px; }
.home-flame { display: grid; place-items: center; width: 80px; height: 80px; color: var(--brasas); border: 1px solid #e7ab5560; border-radius: 50%; background: #e7ab5512; }
.home .eyebrow, .customer-header .eyebrow { color: var(--brasas); }
.home h1 { font-size: clamp(3.45rem, 11vw, 8.4rem); line-height: .93; letter-spacing: -.085em; }
.home h1 em { font-style: normal; color: var(--brasas); }
.home-description { max-width: 440px; color: #f0d8b8; font-size: clamp(1rem, 2.6vw, 1.19rem); }
.home-qr { display:flex;align-items:center;gap:.5rem; color: var(--brasas); padding-top: .35rem; font-weight: 700; }
.login { min-height: 100svh; display: grid; place-items: center; padding: 1.25rem; }
.login-card { width: min(100%, 460px); display: grid; gap: 1.35rem; background: var(--panel); color: var(--ink); padding: clamp(1.4rem, 5vw, 2.25rem); border-radius: 1rem; box-shadow: 0 25px 95px #0005; }
.login-card .brand { color: var(--ink); }
.login-card .brand strong { color: var(--accent); }
.login-card h1 { font-size: clamp(2rem, 6vw, 3rem); margin-top: .45rem; }
.customer-bar { border-bottom: 1px solid #f5e6ce28; width: min(100% - 2rem, 1000px); }
.table-pill { border: 1px solid #e7ab5565; padding: .25rem .85rem; border-radius: 999px; color: var(--brasas); font-weight: 700; }
.customer-hero { width: min(100% - 2rem, 1000px); margin: auto; display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2.3rem 0 2.1rem; }
.customer-hero h1 { margin: .25rem 0 .5rem; }
.customer-hero p:not(.eyebrow) { color: #edd1ac; }
.customer-main { width: min(100% - 2rem, 1000px); margin: auto; padding: 1.3rem 0 7rem; display: grid; gap: 1rem; }
.menu-grid { display:grid;gap:1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.menu-section { display: grid; gap: .7rem; }
.menu-section > h3 { font-size: 1.45rem; }
.product-content h4 { margin: 0; font: 700 1.24rem/1.15 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.product-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: .85rem; background: var(--panel); box-shadow: var(--shadow); }
.product-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #e6d4bc; }
.product-content { display: grid; gap: .5rem; flex: 1; padding: .9rem 1rem 1rem; }
.product-content p { color: var(--muted); overflow-wrap: anywhere; }
.product-price { margin-top: auto; padding-top: .4rem; }
.product-price > strong { color: var(--accent); font-size: 1.12rem; }
.stepper { display: flex; align-items: center; gap: .32rem; }
.stepper span { min-width: 19px; text-align: center; font-weight: 700; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #debea0; border-radius: .55rem; background: #fae6c9; color: #803b22; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: #f4d9b2; }
.cart-dock { position: fixed; inset: auto 0 0; z-index: 2; display: grid; justify-content: center; padding: .85rem 1rem max(.85rem, env(safe-area-inset-bottom)); background: #251810f5; border-top: 1px solid #bf8c5a; }
.cart-dock button { justify-content: space-between; min-height: 52px; min-width: min(90vw, 420px); }
.callout { background: #eee4d1; border: 1px solid #d7c5a8; border-radius: .8rem; padding: .85rem; flex-wrap: wrap; }
.bill-total { background: #f7e8d1; border-radius: .65rem; padding: .85rem 1rem; flex-wrap: wrap; }
.bill-total strong { display: block; color: var(--accent); font-size: clamp(1.4rem, 5vw, 2.05rem); line-height: 1.2; }
.guest-order { display: grid; gap: .65rem; }

.staff-header { background: var(--wood); color: var(--cream); }
.header-actions { display:flex;align-items:center;justify-content:flex-end;gap:.5rem; min-width: 0; }
.live-pill { display:inline-flex;align-items:center;gap:.25rem; border-radius: 999px; font-size: .83rem; padding: .2rem .65rem; background: #473225; color: var(--cream); white-space: nowrap; }
.live-pill.live { background: #284937; color: #d8f0de; }
.staff-main { width: min(100% - 2rem, 1180px); margin: auto; display: grid; gap: 1.15rem; padding: 1.6rem 0 3rem; }
.dashboard-intro { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.dashboard-intro h1 { font-size: clamp(2.45rem, 7vw, 4.1rem); margin: .15rem 0 .3rem; }
.dashboard-intro p:not(.eyebrow) { color: var(--muted); }
.admin-nav { display:flex;align-items:center;gap:.5rem; padding: .35rem 0; border-block: 1px solid var(--border); overflow-x: auto; }
.admin-nav button { flex: 0 0 auto; background: transparent; border-color: transparent; }
.admin-nav button.active { background: #f0dec5; color: #843a1f; }
.table-grid, .operation-grid, .stats-grid { display:grid;gap:1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); align-items: start; }
.table-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-card h3 { font-size: 1.45rem; }
.table-card .split { flex-wrap: wrap; }
.table-total { font-size: 1.45rem; }
.code-box { display:flex;align-items:center;justify-content:space-between;gap:.5rem; padding: .55rem .65rem; background: #faefd9; border-radius: .5rem; }
.code-box strong { font: 700 1.04rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; }
.code-box .icon-button { background: transparent; border: 0; }
.order-card { border-top: 4px solid #ca8558; }
.order-note { padding: .55rem .65rem; background: #f8ebd8; border-radius: .55rem; overflow-wrap: anywhere; }
.item-list { padding: 0; list-style: none; display: grid; }
.item-list li { padding: .5rem 0; display: flex; align-items: center; justify-content: space-between; gap: .55rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.item-list li:last-child { border-bottom: 0; }
.form-grid, .report-columns, .qr-grid { display:grid;gap:1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-form { display:grid;gap:1rem;align-items:flex-end; grid-template-columns: minmax(0, 190px) minmax(0, 190px) auto; justify-content: start; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 44px; }
.check input { flex: 0 0 20px; }
.thumbnail { object-fit: cover; border-radius: .4rem; }
.stat p { color: var(--muted); }
.stat strong { font-size: 1.55rem; color: var(--accent); }
.report-list details + details { border-top: 1px solid var(--border); }
.report-list summary { cursor: pointer; min-height: 56px; padding: .55rem 0; }
.report-list details[open] { padding-bottom: .65rem; }

.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: .85rem; background: #21160fb8; }
.sheet { width: min(100%, 535px); padding: clamp(.9rem, 3vw, 1.4rem); max-height: 91svh; overflow: auto; background: var(--panel); border-radius: .9rem; box-shadow: 0 27px 75px #0006; }
.sheet.wide { width: min(100%, 760px); }
.cart-list li > span:first-child { margin-right: auto; }
.cart-total { border-top: 1px solid var(--border); padding-top: .7rem; }
.qr-card { padding: .75rem; display: grid; justify-items: center; background: white; color: #201710; border: 1px solid #d9c9b8; border-radius: .6rem; text-align: center; }
.qr-card img { width: min(100%, 220px); height: auto; }
.qr-card a { color: #80361b; text-decoration: underline; }

@media (max-width: 930px) { .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 550px) {
  .staff-header-inner { flex-wrap: wrap; }
  .header-actions { width: 100%; justify-content: space-between; }
  .header-actions .button span { overflow-wrap: anywhere; }
  .header-actions .button { min-width: 0; }
  .home-header { flex-wrap: wrap; }
  .home-header .button { padding-inline: .45rem; }
  .customer-hero { padding-block: 1.5rem; }
  .customer-hero .button { width: 100%; }
  .form-grid, .report-columns, .filter-form { grid-template-columns: 1fr; }
  .sheet { max-height: 92svh; }
}
@media (max-width: 430px) {
  .table-grid { grid-template-columns: 1fr; }
  .home h1 { letter-spacing: -.065em; }
}
@media print {
  body:has(.qr-overlay) * { visibility: hidden; }
  body:has(.qr-overlay), body:has(.qr-overlay) .staff-main { overflow: visible; }
  .qr-overlay, .qr-overlay .sheet, .qr-overlay .qr-grid, .qr-overlay .qr-grid * { visibility: visible; }
  .qr-overlay { display: block; position: absolute; inset: 0; background: white; padding: 0; }
  .qr-overlay .sheet { width: 100%; max-height: none; border: 0; box-shadow: none; background: white; overflow: visible; }
  .qr-overlay .print-hidden { display: none; }
  .qr-card { break-inside: avoid; }
}
a.button { text-decoration:none; }
[hidden] { display:none !important; }
.local-modal { padding:0; border:none; background:transparent; color:inherit; width:min(calc(100% - 24px),620px); max-width:unset; }
.local-modal::backdrop { background:#21160fb8; }
.local-modal .sheet { width:100%; }
.local-list { display:grid; gap:.8rem; }
.local-tabs .button { white-space:nowrap; }
.local-table-code { font-family:ui-monospace,monospace; font-size:1.2rem; letter-spacing:.12em; }
.local-price { padding:.4rem .7rem; border-radius:.55rem; background:#f5e6ce; font-weight:800; }
.local-order-actions { margin-top:.5rem; }
.balance-number { font-size:1.6rem; }
.local-modal [role="status"]:empty, .local-feedback:empty { display:none; }
.local-client-result { margin-block:.7rem; }
.local-checkout input[type="checkbox"] { width:20px; }
.qr-image { width:200px; height:200px; margin:0 auto; }
.local-report { overflow:auto; }
.local-report table { min-width:30rem; width:100%; border-collapse:collapse; text-align:left; }
.local-report td, .local-report th { border-bottom:1px solid var(--border); padding:.5rem .55rem; }
.product-card .product-photo { width:100%; height:160px; object-fit:cover; }
@media print {
  body:has(.local-modal[open] .qr-card) #app { display:none; }
  .local-modal[open] { display:block; position:absolute; width:100%; margin:0; overflow:visible; }
  .local-modal[open] .sheet { max-height:none; box-shadow:none; }
  .local-modal[open] .print-hidden { display:none; }
}
