@font-face { font-family: 'Caladea'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/caladea-400.woff2') format('woff2'); }
@font-face { font-family: 'Caladea'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/caladea-700.woff2') format('woff2'); }

:root {
  --berry: #A61E4D; --berry-ink: #7E1239; --berry-soft: #F8E7ED;
  --cocoa: #3B2A25; --muted: #6B5B55; --paper: #F5F1EE; --surface: #FFFFFF; --line: #E6D9D0;
  --leaf: #3F6B4E; --leaf-soft: #E4EFE7; --yolk: #E8A33D; --yolk-soft: #FCEFD6; --yolk-ink: #7A4B05;
  --alert: #B42318; --alert-soft: #FDECEA; --wa: #1F7A4D;
  --serif: 'Caladea', Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r: 14px; --tab-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--cocoa); background: var(--paper); }
a { color: var(--berry); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */
.frame { min-height: 100vh; }
.page { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(245, 241, 238, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .titles { flex: 1; min-width: 0; }
.top .biz { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1 { font-family: var(--serif); font-size: 26px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.top .back + .titles h1 { font-size: 23px; }
main { padding: 16px; max-width: 760px; margin: 0 auto; outline: none; }
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs .brand { display: none; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); font-size: 11.5px; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--berry); font-weight: 600; }
.tabs a.on svg { stroke-width: 2.2; }

@media (min-width: 900px) {
  .frame { display: grid; grid-template-columns: 220px 1fr; }
  .tabs { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.1; color: var(--cocoa); }
  .tabs a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .tabs a.on { background: var(--berry-soft); }
  .page { padding-bottom: 40px; }
  .top { padding-left: 32px; padding-right: 32px; }
  main { padding: 24px 32px; }
}
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--berry); position: relative; flex: none; }
.brand-mark::after { content: ''; position: absolute; inset: 8px 6px 9px; border: 2px solid #fff; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom: 0; }

.demo-banner { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--yolk-soft); color: var(--yolk-ink); font-size: 14px; border-bottom: 1px solid #F1D9A8; }
.demo-actions { display: flex; gap: 14px; }
.demo-banner a, .linkish { color: var(--yolk-ink); background: none; border: 0; padding: 0; min-height: 38px; display: inline-flex; align-items: center; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- Bloques ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-title { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.sec-title { font-family: var(--serif); font-size: 19px; margin: 6px 0 10px; }
.lead { font-size: 17px; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.err, .alert-text { color: var(--alert); }
.note { background: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 15px; white-space: pre-wrap; }
.date-line { color: var(--muted); }
.date-line::first-letter { text-transform: uppercase; }
.notice { background: var(--yolk-soft); color: #5B3A06; border-radius: 12px; padding: 12px 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.notice.card { display: flex; }
.notice.alert { background: var(--alert-soft); color: #7A1A12; }
.notice.ok { background: var(--leaf-soft); color: #234531; }
.notice.link { text-decoration: none; }
.notice svg { flex: none; margin-top: 2px; }
.form-error { background: var(--alert-soft); color: #7A1A12; border-left: 4px solid var(--alert); border-radius: 8px; padding: 12px 14px; font-weight: 500; }
.empty { text-align: center; padding: 36px 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty h2 { font-family: var(--serif); font-size: 21px; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.hero-card h2 { font-family: var(--serif); font-size: 24px; }
.hero-card .empty-actions { justify-content: flex-start; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; background: var(--surface); color: var(--cocoa); }
.btn.primary { background: var(--berry); color: #fff; }
.btn.primary:hover { background: var(--berry-ink); }
.btn.soft { background: var(--berry-soft); color: var(--berry-ink); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--alert); color: #fff; }
.btn.danger-text { color: var(--alert); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--cocoa); cursor: pointer; flex: none; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn:hover { background: var(--berry-soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions.end { justify-content: flex-end; }
.fab { position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px; border-radius: 26px; background: var(--berry); color: #fff; font-weight: 600; text-decoration: none; box-shadow: 0 6px 18px rgba(126, 18, 57, .28); }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }
.savebar { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 10px; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { .savebar { bottom: 0; } }

/* ---------- Formularios ---------- */
.form .card { gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .line-grid label > span, .bulk-inputs label > span { font-size: 14px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=tel], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--cocoa); background: var(--surface); border: 1px solid #D7C8BE; border-radius: 10px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px rgba(166, 30, 77, .18); }
[aria-invalid=true] { border-color: var(--alert) !important; box-shadow: 0 0 0 3px rgba(180, 35, 24, .15) !important; }
.hint { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check input, .pick input { width: 22px; height: 22px; accent-color: var(--berry); flex: none; }
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid #D7C8BE; border-radius: 12px; padding: 0 12px; color: var(--muted); }
.searchbar input { border: 0; padding-left: 0; min-height: 44px; background: transparent; }
.searchbar input:focus { box-shadow: none; }
.qty-unit { display: grid; grid-template-columns: 1fr 86px; gap: 6px; }

/* ---------- Segmentos y chips ---------- */
.seg { display: flex; gap: 4px; background: #EBE3DD; padding: 4px; border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.seg a { flex: 1 0 auto; text-align: center; padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--cocoa); box-shadow: 0 1px 2px rgba(59, 42, 37, .12); }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pill { flex: none; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--cocoa); text-decoration: none; font-size: 14px; }
.pill.on { background: var(--cocoa); color: #fff; border-color: var(--cocoa); }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: #EFE8E3; color: var(--muted); white-space: nowrap; text-decoration: none; }
.chip.alert { background: var(--alert-soft); color: var(--alert); }
.chip.st-wait { background: var(--yolk-soft); color: var(--yolk-ink); }
.chip.st-work { background: #EAE6F5; color: #4A3A86; }
.chip.st-ready { background: var(--berry-soft); color: var(--berry-ink); }
.chip.st-done { background: var(--leaf-soft); color: var(--leaf); }
.chip.st-off { background: #EEE; color: #666; }
.chip.k-dulce { background: var(--berry-soft); color: var(--berry-ink); }
.chip.k-salado { background: #E6EEF4; color: #2E536C; }

/* ---------- Tickets de pedido ---------- */
.tickets { display: flex; flex-direction: column; gap: 10px; }
.ticket { --notch: 76px; display: grid; grid-template-columns: var(--notch) 1fr auto; align-items: stretch; background: var(--surface); border-radius: 12px; text-decoration: none; color: inherit; min-height: 84px; filter: drop-shadow(0 1px 1px rgba(59, 42, 37, .14));
  -webkit-mask: radial-gradient(circle 8px at var(--notch) 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 8px at var(--notch) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle 8px at var(--notch) 0, #0000 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 8px at var(--notch) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat; }
.ticket .stub { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--berry); color: #fff; border-right: 2px dashed rgba(255, 255, 255, .55); line-height: 1; }
.ticket .stub .wd, .ticket .stub .mm { font-size: 12px; letter-spacing: .02em; opacity: .9; }
.ticket .stub .dd { font-family: var(--serif); font-size: 32px; font-weight: 700; margin: 3px 0; }
.ticket.late .stub { background: var(--alert); }
.ticket.cancel { opacity: .72; }
.ticket.cancel .stub { background: #8A7E79; }
.tk-body { padding: 11px 6px 11px 14px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-who { font-weight: 700; font-size: 16.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tk-what { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 3px; }
.tk-amt { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 10px 14px 10px 4px; gap: 3px; text-align: right; }
.tk-total { font-family: var(--serif); font-weight: 700; font-size: 17px; white-space: nowrap; }
.tk-due { font-size: 12.5px; font-weight: 600; color: var(--yolk-ink); background: var(--yolk-soft); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.tk-due.alert { color: var(--alert); background: var(--alert-soft); }
.tk-paid { font-size: 12.5px; font-weight: 600; color: var(--leaf); }
@media (max-width: 380px) { .ticket { --notch: 64px; } .ticket .stub .dd { font-size: 27px; } .tk-amt { padding-right: 10px; } }

.ticket-head .eyebrow-date { font-weight: 600; color: var(--berry); }
.ticket-head .eyebrow-date::first-letter { text-transform: uppercase; }
.ticket-head .client { font-family: var(--serif); font-size: 26px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.status-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.more-status summary { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.more-status summary::-webkit-details-marker { display: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Dinero ---------- */
.money3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.money3 > div { background: var(--paper); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.money3 span { font-size: 13px; color: var(--muted); }
.money3 strong { font-family: var(--serif); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money3 strong.ok { color: var(--leaf); }
.money3 strong.due { color: var(--yolk-ink); }
.money3 strong.alert { color: var(--alert); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 0; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--cocoa); }
.totals dd { margin: 0; padding-left: 12px; text-align: right; white-space: nowrap; }
.totals .big { font-family: var(--serif); font-size: 19px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.totals .accent { color: var(--berry); font-weight: 700; font-size: 17px; }
.totals .muted { color: var(--muted); font-size: 14px; }
.totals .neg { color: var(--alert); }
.totals.compact { font-size: 14px; }
.sum-line { font-size: 15px; }
.num { font-family: var(--serif); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Listas ---------- */
.rows, .menu, .items, .ing-list, .pays, .recipes, .book-list, .bulk { list-style: none; margin: 0; padding: 0; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card .rows { border: 0; border-radius: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; min-height: 56px; }
.row > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.row small, .rr-main small, .menu-item small, .pick small, .bulk-name small { color: var(--muted); font-size: 13.5px; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; flex: none; }
.shop li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.shop li > div:first-child { display: flex; flex-direction: column; }
.recipes { display: flex; flex-direction: column; gap: 8px; }
.recipe-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none; }
.thumb { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 700; background-size: cover; background-position: center; }
.thumb.k-dulce { background-color: var(--berry-soft); color: var(--berry); }
.thumb.k-salado { background-color: #E6EEF4; color: #2E536C; }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-end { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.rr-end small { color: var(--muted); font-size: 12.5px; }
.menu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--cocoa); text-decoration: none; }
.menu-item svg { color: var(--berry); flex: none; }
.menu-item span { display: flex; flex-direction: column; }
.items li { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.items .it-d { display: flex; flex-direction: column; }
.items .it-t { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.items small { color: var(--muted); font-size: 14px; }
.ing-list li { display: grid; grid-template-columns: 88px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.ing-list li.warn { background: var(--yolk-soft); }
.ing-list .iq { font-weight: 700; font-variant-numeric: tabular-nums; }
.ing-list .ic { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing-list small { color: var(--muted); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li::marker { font-family: var(--serif); font-weight: 700; color: var(--berry); }
.pays li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pays li > div { flex: 1; display: flex; flex-direction: column; }
.pays small { color: var(--muted); font-size: 13px; }
.pays .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pays .amt.neg { color: var(--alert); }
.pays li.void { opacity: .55; }
.pays li.void .amt { text-decoration: line-through; }
.pick { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.pick > span { display: flex; flex-direction: column; }
.pick.done { opacity: .6; cursor: default; }
.book-list li + li { border-top: 1px solid var(--line); }
.order-pick summary { font-weight: 600; cursor: pointer; min-height: 32px; }
.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.history summary { font-weight: 600; cursor: pointer; }
.history ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.history time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Recetas ---------- */
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 92px; }
.facts span { font-size: 12.5px; color: var(--muted); }
.facts strong { font-family: var(--serif); font-size: 17px; }
.facts small { font-size: 12.5px; color: var(--muted); }
.photo-box { position: relative; border-radius: var(--r); overflow: hidden; }
.photo-box img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-box.has-photo .photo-actions { position: absolute; left: 10px; bottom: 10px; }
.photo-box.has-photo .photo-actions .btn { background: rgba(255, 255, 255, .92); }
.photo-actions { display: flex; gap: 8px; }
.scale { border-top: 1px solid var(--line); padding-top: 10px; }
.scale summary { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--berry); cursor: pointer; min-height: 40px; }
.scale-row { display: grid; grid-template-columns: 110px auto 1fr; gap: 8px; align-items: center; margin: 8px 0; }
.scale-row .btn { justify-self: start; }
.scaled { display: flex; flex-direction: column; gap: 8px; }
.ing-rows { display: flex; flex-direction: column; gap: 10px; }
.ing-row { display: grid; grid-template-columns: 1fr 40px; gap: 6px; padding: 10px; background: var(--paper); border-radius: 12px; }
.ing-row > select { grid-column: 1; }
.ing-row > .qty-unit { grid-column: 1; }
.ing-row .ing-note { grid-column: 1; min-height: 40px; font-size: 15px; }
.ing-row > .icon-btn { grid-column: 2; grid-row: 1; }
@media (min-width: 640px) { .ing-row { grid-template-columns: 1.4fr 1fr 1fr 40px; } .ing-row > * { grid-row: 1 !important; } .ing-row > select { grid-column: 1; } .ing-row > .qty-unit { grid-column: 2; } .ing-row > .ing-note { grid-column: 3; } .ing-row > .icon-btn { grid-column: 4; } }
.live-cost { background: var(--cocoa); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.live-cost .accent { color: #FFC9DA; }
.live-cost .muted { color: #E6D9D0; }
.cost .notice { margin-bottom: 4px; }

/* ---------- Líneas de cotización/pedido ---------- */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { background: var(--paper); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.line-top { display: flex; gap: 6px; align-items: center; }
.line-top > :first-child { flex: 1; }
.line-name { font-weight: 600; }
.line-name small { color: var(--muted); font-weight: 400; }
.line-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; align-items: end; }
.line-grid label { display: flex; flex-direction: column; gap: 3px; }
.line-sum { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.line-sum span { font-size: 14px; font-weight: 600; color: var(--muted); }
.line-total { font-weight: 700; font-variant-numeric: tabular-nums; min-height: 46px; display: flex; align-items: center; }
.bulk { display: flex; flex-direction: column; gap: 8px; }
.bulk-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bulk-name { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bulk-inputs { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.bulk-inputs label { display: flex; flex-direction: column; gap: 3px; }

/* ---------- Hoy ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--cocoa); text-decoration: none; font-weight: 600; font-size: 14px; text-align: center; }
.quick svg { color: var(--berry); }
.guide .toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.guide .toc li { margin: 0; break-inside: avoid; }
.guide .toc a { display: inline-block; padding: 9px 0; }
@media (max-width: 520px) { .guide .toc ul { columns: 1; } }

/* ---------- Cotización imprimible ---------- */
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 1px 0 var(--line), 0 6px 0 -3px #fff, 0 7px 0 -3px var(--line); }
.paper header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 3px solid var(--berry); padding-bottom: 12px; }
.paper-biz { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--berry); }
.paper-no { text-align: right; }
.paper-no p { font-size: 13px; color: var(--muted); }
.paper-no strong { font-family: var(--serif); font-size: 18px; }
.paper-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 15px; }
.paper-meta dt { color: var(--muted); }
.paper-meta dd { margin: 0; }
.paper-meta dd::first-letter { text-transform: uppercase; }

/* ---------- Hojas emergentes ---------- */
dialog.sheet { border: 0; padding: 0; width: min(560px, 100%); max-height: 92vh; border-radius: 20px; background: var(--surface); color: var(--cocoa); display: flex; flex-direction: column; }
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(43, 28, 24, .45); }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 6px 18px; }
.sheet-head h2 { font-family: var(--serif); font-size: 21px; }
.sheet-body { padding: 6px 18px 12px; overflow-y: auto; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; border-top: 1px solid var(--line); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; z-index: 100; left: 0; right: 0; top: calc(68px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 520px; background: var(--cocoa); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 15px; box-shadow: 0 8px 24px rgba(43, 28, 24, .25); animation: toast-in .18s ease-out; transition: opacity .3s, transform .3s; }
.toast.error { background: #7A1A12; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Impresión ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .tabs, .top, .toasts, .demo-banner, .fab, .no-print, .history, .notice, .row-actions { display: none !important; }
  .page { padding: 0; }
  main { padding: 0; max-width: none; }
  .frame { display: block; }
  .paper { border: 0; box-shadow: none; padding: 0; }
}
