:root {
  --red: #bc0219;
  --red-dark: #8f0113;
  --amber: #fba224;
  --amber-soft: #fff1db;
  --bg: #f2f2f4;
  --card: #ffffff;
  --ink: #1b1b1f;
  --ink-2: #55555e;
  --ink-3: #8a8a94;
  --line: #e2e2e7;
  --ok: #1f7a3a;
  --ok-bg: #e5f4e9;
  --warn: #8a5a00;
  --warn-bg: #fff1db;
  --crit: #a3001a;
  --crit-bg: #fde6e9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: "Noto Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 15px; line-height: 1.45; }
a { color: var(--red); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.brand-font { font-family: "Climate Crisis", "Noto Sans", Arial, sans-serif; letter-spacing: .5px; }
.boot { padding: 3rem; text-align: center; color: var(--ink-2); }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--red); color: #fff;
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top));
}
.topbar .logo { font-size: 1.05rem; color: #fff; text-decoration: none; white-space: nowrap; }
.topbar .logo small { font-family: "Noto Sans", Arial; font-weight: 600; color: var(--amber); font-size: .72rem; margin-left: .35rem; letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.topbar select { background: var(--red-dark); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: .35rem .5rem; font: inherit; font-size: .85rem; max-width: 46vw; }
.topbar .who { font-size: .8rem; opacity: .9; white-space: nowrap; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; padding: 0 .25rem; cursor: pointer; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 52px); }
.sidenav { background: #fff; border-right: 1px solid var(--line); padding: 1rem .6rem; }
.sidenav a {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 500; margin-bottom: 2px;
}
.sidenav a:hover { background: var(--bg); }
.sidenav a.active { background: var(--amber-soft); color: var(--red); font-weight: 700; }
.sidenav .sep { height: 1px; background: var(--line); margin: .6rem .4rem; }
.sidenav .logout { color: var(--ink-2); }
main { padding: 1.25rem; max-width: 1200px; width: 100%; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .sidenav { position: fixed; top: 52px; left: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); overflow-y: auto; }
  .sidenav.open { transform: none; }
  .topbar .who { display: none; }
  main { padding: .9rem; }
}

/* ---------- components ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; }
.kpi .label { color: var(--ink-2); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 1.5rem; font-weight: 700; margin-top: .2rem; }
.kpi .sub { color: var(--ink-3); font-size: .8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: .6rem 1rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn:hover { background: var(--red-dark); }
.btn.secondary { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn.secondary:hover { background: var(--amber-soft); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.amber { background: var(--amber); color: var(--ink); }
.btn.small { min-height: 32px; padding: .3rem .7rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }

label.f { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .7rem; }
label.f > span { display: block; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cfcfd6; border-radius: 9px; padding: .55rem .65rem; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 .9rem; }
.check { display: flex; align-items: center; gap: .45rem; font-size: .9rem; margin-bottom: .6rem; }
.check input { width: auto; min-height: 0; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); background: #fafafb; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf7ef; }
.table-wrap { overflow-x: auto; max-width: 100%; }
tfoot td { font-weight: 700; background: #fafafb; }

.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.crit { background: var(--crit-bg); color: var(--crit); }
.chip.neutral { background: #ececf0; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.right { text-align: right; }
.hidden { display: none !important; }

.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .8rem; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button.active { color: var(--red); border-bottom-color: var(--red); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.cat-tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem; text-decoration: none; color: var(--ink); border-left: 5px solid var(--line); display: block; }
.cat-tile.ok { border-left-color: var(--ok); }
.cat-tile.pendiente { border-left-color: var(--amber); }
.cat-tile.vencido { border-left-color: var(--crit); }
.cat-tile h3 { margin-bottom: .3rem; }

.count-list .count-row { display: grid; grid-template-columns: 1fr 130px; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.count-row .name { font-weight: 600; }
.count-row input { text-align: right; font-size: 1.1rem; }

.line-item { border: 1px solid var(--line); border-radius: 10px; padding: .7rem; margin-bottom: .6rem; background: #fcfcfd; }
.line-item .lt { display: grid; grid-template-columns: 2fr 1fr 1.3fr 0.8fr auto; gap: .5rem; align-items: end; }
.line-item .lb { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-top: .5rem; align-items: end; }
.line-item label.f { margin-bottom: 0; }
.line-item .rm { align-self: end; min-height: 42px; }
@media (max-width: 700px) { .line-item .rm { grid-column: 2; justify-self: end; } }
@media (max-width: 700px) {
  .line-item .lt { grid-template-columns: 1fr 1fr; }
  .line-item .lt .item-sel { grid-column: 1 / -1; }
  .line-item .lb { grid-template-columns: 1fr 1fr; }
}
.totals { display: flex; gap: 1.5rem; justify-content: flex-end; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.totals div { text-align: right; }
.totals b { display: block; font-size: 1.15rem; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--red); }
.login-card { background: #fff; border-radius: 16px; padding: 2rem 1.6rem; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-card .brand { color: var(--red); font-size: 1.6rem; text-align: center; margin-bottom: .2rem; }
.login-card .tag { text-align: center; color: var(--ink-2); margin-bottom: 1.4rem; font-size: .9rem; }
.error { background: var(--crit-bg); color: var(--crit); padding: .6rem .8rem; border-radius: 8px; margin-bottom: .8rem; font-size: .9rem; }
.notice { background: var(--amber-soft); padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }

.chart-box { position: relative; height: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--ink-2); margin-top: .5rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.pos-bar { position: relative; height: 8px; background: linear-gradient(90deg, #e5f4e9, #ececf0 50%, #fde6e9); border-radius: 4px; min-width: 90px; }
.pos-bar i { position: absolute; top: -3px; width: 4px; height: 14px; background: var(--ink); border-radius: 2px; transform: translateX(-2px); }

#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%) translateY(150%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; transition: transform .25s, opacity .25s; z-index: 100; max-width: 90vw; opacity: 0; pointer-events: none; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.err { background: var(--crit); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 1.2rem; }
.copybox { font-family: ui-monospace, monospace; background: var(--bg); padding: .7rem; border-radius: 8px; font-size: 1.05rem; user-select: all; word-break: break-all; }

/* details / FAQ */
details.tbl { margin-top: .8rem; }
details.tbl > summary { cursor: pointer; color: var(--red); font-weight: 600; font-size: .85rem; padding: .3rem 0; }
details.tbl[open] > summary { margin-bottom: .5rem; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq > summary { cursor: pointer; font-weight: 600; padding: .8rem .2rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; color: var(--red); font-size: 1.2rem; line-height: 1; }
details.faq[open] > summary::after { content: "−"; }
.faq-a { padding: 0 .2rem 1rem; color: var(--ink-2); }
i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .45rem; vertical-align: 0; }
a.chip { text-decoration: none; }

/* two-column count */
.count-list .count-row { grid-template-columns: 1fr 110px 110px; }
.count-row.count-head { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; text-align: center; padding: .2rem 0; position: sticky; top: 52px; background: #fff; z-index: 2; }
@media (max-width: 480px) { .count-list .count-row { grid-template-columns: 1fr 86px 86px; gap: .4rem; } }
.line-item .lb { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 700px) { .line-item .lb { grid-template-columns: 1fr 1fr; } }

/* recipes */
.recipe-tile { border-left-color: var(--amber); }
.recipe-tile.inactive { opacity: .6; }
.scale-card { border: 2px solid var(--amber); }
.scale-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.scale-row .factor { text-align: right; }
.scale-row .factor b { font-size: 1.4rem; color: var(--red); }
.recipe-table td.calc, .recipe-table th.calc-h { background: var(--amber-soft); }
.recipe-table td.calc b { font-size: 1.1rem; }
.recipe-table tfoot td { font-size: .85rem; }
.steps { line-height: 1.7; }
.ing-main { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .5rem; align-items: end; }
.ing-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; margin-top: .5rem; }
.ing-row label.f { margin-bottom: 0; }
.ing-actions { display: flex; gap: .25rem; }
@media (max-width: 700px) { .ing-main { grid-template-columns: 1fr 1fr; } .ing-main label:first-child { grid-column: 1 / -1; } .ing-extra { grid-template-columns: 1fr; } }
.print-only { display: none; }
@media print {
  .topbar, .sidenav, .no-print, #toast, .btn { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .print-only { display: block; }
  body { background: #fff; }
  input, select { border: 0; padding: 0; font-weight: 700; }
}

/* cash closing wizard */
.stepper { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .2rem; }
.stepper button { flex: 1 0 auto; display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem .35rem .35rem; font: inherit; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.stepper button span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); font-weight: 700; }
.stepper button.on { border-color: var(--red); color: var(--red); font-weight: 700; }
.stepper button.on span { background: var(--red); color: #fff; }
.stepper button.done span { background: var(--ok-bg); color: var(--ok); }
.stepper button:disabled { opacity: .5; cursor: default; }
.stepper em { font-style: normal; white-space: nowrap; }
@media (max-width: 700px) { .stepper button:not(.on) em { display: none; } }
.check.big { font-size: 1rem; align-items: flex-start; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; }
.check.big input { margin-top: .25rem; }
.big-total { font-size: 1.15rem; margin-top: .8rem; text-align: right; }
.big-total b { font-size: 1.4rem; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .4rem 1.4rem; }
.denom { display: grid; grid-template-columns: 82px 64px minmax(80px, 1fr) 96px; gap: .4rem; align-items: center; }
@media (max-width: 420px) { .denoms { grid-template-columns: 1fr; } .denom { grid-template-columns: 76px minmax(70px,1fr) 90px; } .denom .muted { display: none; } }
.denom .dv { font-weight: 700; }
.denom .dsub { text-align: right; color: var(--ink-2); }
.calc-box { margin-top: 1rem; background: #fafafb; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; max-width: 520px; margin-left: auto; }
.calc-box div { display: flex; justify-content: space-between; padding: .25rem 0; font-variant-numeric: tabular-nums; }
.calc-box .tot { border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .45rem; font-size: 1.05rem; }
.shell > main { min-width: 0; }

/* ---------- inventory visuals ---------- */
:root { --lv-crit: #d7263d; --lv-warn: #eda100; --lv-ok: #1f9a4a; --lv-over: #2a78d6; --lv-none: #b5b5bd; }
.lvbg-crit { background: var(--lv-crit) !important; color: #fff; }
.lvbg-warn { background: var(--lv-warn) !important; color: #1b1b1f; }
.lvbg-ok { background: var(--lv-ok) !important; color: #fff; }
.lvbg-over { background: var(--lv-over) !important; color: #fff; }
.lvbg-none { background: var(--lv-none) !important; color: #1b1b1f; }
.chip.lv-crit { background: var(--crit-bg); color: var(--crit); }
.chip.lv-warn { background: var(--warn-bg); color: var(--warn); }
.chip.lv-ok { background: var(--ok-bg); color: var(--ok); }
.chip.lv-over { background: #e3eefb; color: #1d5aa6; }
.chip.lv-none { background: #ececf0; color: var(--ink-2); }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: .4rem .7rem; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--red); color: #fff; }
.health { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; background: #fff; }
.health .hseg { border: 0; cursor: pointer; font: inherit; font-weight: 700; min-width: 28px; }
.health.mini { height: 12px; border-radius: 4px; flex: 1; }
.health.mini i { display: block; }
.cat-health { margin-top: 1rem; display: grid; gap: .35rem; }
.ch-row { display: grid; grid-template-columns: 170px 1fr minmax(150px, auto); gap: .6rem; align-items: center; cursor: pointer; padding: .15rem .25rem; border-radius: 6px; }
.ch-row:hover { background: var(--bg); }
.ch-name { font-size: .85rem; font-weight: 600; }
.legend i.lvbg-crit, .legend i.lvbg-warn, .legend i.lvbg-ok, .legend i.lvbg-over, .legend i.lvbg-none { display: inline-block; }
.click-kpi { cursor: pointer; }
.fill { position: relative; height: 12px; background: #ececf0; border-radius: 6px; overflow: visible; flex: 1; }
.fill.slim { height: 8px; }
.fill > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; display: block; }
.fill .mk { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; transform: translateX(-1px); }
.fill .mk-min { background: #8a8a94; }
.fill .mk-tgt { background: #1b1b1f; }
.fb-crit > i, .fb-crit > i.t { background: var(--lv-crit); }
.fb-warn > i, .fb-warn > i.t { background: var(--lv-warn); }
.fb-ok > i, .fb-ok > i.t { background: var(--lv-ok); }
.fb-over > i, .fb-over > i.t { background: var(--lv-over); }
.fb-none > i, .fb-none > i.t { background: var(--lv-none); }
.fill.two > i.t { border-radius: 6px 0 0 6px; }
.fill.two > i.b { opacity: .42; border-radius: 0 6px 6px 0; }
.fb-crit.two > i.b { background: var(--lv-crit); } .fb-warn.two > i.b { background: var(--lv-warn); } .fb-ok.two > i.b { background: var(--lv-ok); } .fb-over.two > i.b { background: var(--lv-over); } .fb-none.two > i.b { background: var(--lv-none); }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.inv-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; border-top: 5px solid var(--lv-none); cursor: pointer; }
.modal .inv-card { box-shadow: none; border: 1px solid var(--line); cursor: default; }
.lvb-crit { border-top-color: var(--lv-crit); } .lvb-warn { border-top-color: var(--lv-warn); } .lvb-ok { border-top-color: var(--lv-ok); } .lvb-over { border-top-color: var(--lv-over); }
.inv-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.inv-name { font-weight: 700; }
.inv-qty b { font-size: 1.5rem; }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: .5rem; gap: 2px; }
.split i { display: block; }
.sp-b { background: #8d6e63; } .sp-t { background: #fba224; } .sp-0 { background: #ececf0; }
.split-lbl { display: flex; justify-content: space-between; margin: .15rem 0 .4rem; }
.fb-row { display: grid; grid-template-columns: 82px 1fr 52px; gap: .45rem; align-items: center; margin-top: .4rem; }
.fb-lbl { font-size: .72rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; white-space: nowrap; }
.fb-val { font-size: .82rem; text-align: right; font-variant-numeric: tabular-nums; }
.bars-list { display: grid; gap: .1rem; }
.bl-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 2fr 130px minmax(150px, 1fr); gap: .8rem; align-items: center; padding: .55rem .3rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.bl-row:hover { background: #fbf7ef; }
.bl-row .fill { height: 16px; }
.bl-val { text-align: right; font-variant-numeric: tabular-nums; }
.bl-chips { display: flex; gap: .3rem; flex-wrap: wrap; }
@media (max-width: 760px) { .bl-row { grid-template-columns: 1fr 110px; } .bl-row .fill { grid-column: 1 / -1; grid-row: 2; } .bl-chips { grid-column: 1 / -1; } .ch-row { grid-template-columns: 1fr; gap: .2rem; } .ch-cnt { font-size: .75rem; } }
h3.grp { margin: 1rem 0 .5rem; color: var(--ink-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; }
.hcell { position: relative; border: 0; border-radius: 8px; padding: .55rem .5rem; min-height: 70px; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; }
.hcell .hn { font-size: .78rem; font-weight: 600; line-height: 1.2; }
.hcell .hv { font-size: 1.1rem; font-weight: 800; }
.hcell .hx { position: absolute; top: 4px; right: 6px; font-weight: 800; }
.hcell:hover { filter: brightness(1.08); outline: 2px solid var(--ink); }

/* ---------- date range picker ---------- */
.drp { position: relative; display: inline-block; }
.drp-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .45rem .8rem; border: 1px solid #cfcfd6; border-radius: 10px; background: #fff; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; white-space: nowrap; max-width: 100%; }
.drp-btn span { overflow: hidden; text-overflow: ellipsis; }
.drp-btn em { font-style: normal; color: var(--ink-3); }
.drp-btn:hover, .drp-btn[aria-expanded=true] { border-color: var(--amber); outline: 2px solid var(--amber-soft); }
.drp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 95; display: flex; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); border: 1px solid var(--line); overflow: hidden; }
.drp-presets { display: flex; flex-direction: column; padding: .5rem; border-right: 1px solid var(--line); background: #fafafb; min-width: 150px; }
.drp-presets button { text-align: left; border: 0; background: none; font: inherit; font-size: .86rem; padding: .5rem .65rem; border-radius: 8px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.drp-presets button:hover { background: var(--amber-soft); }
.drp-presets button.on { background: var(--red); color: #fff; font-weight: 700; }
.drp-main { padding: .7rem .9rem .8rem; }
.drp-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.drp-nav button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.2rem; cursor: pointer; }
.drp-nav button:disabled { opacity: .3; cursor: default; }
.drp-sel { font-size: .85rem; font-weight: 600; text-align: center; }
.drp-sel i { color: var(--ink-3); font-weight: 400; }
.drp-cals { display: flex; gap: 1.2rem; }
.cal { width: 252px; }
.cal-h { text-align: center; font-weight: 700; text-transform: capitalize; margin: .2rem 0 .4rem; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, 36px); }
.cal-w span { text-align: center; font-size: .72rem; color: var(--ink-3); font-weight: 700; padding-bottom: .2rem; }
.cal-g .d { height: 34px; border: 0; background: none; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); }
.cal-g .d:hover:not(:disabled) { background: var(--amber-soft); border-radius: 8px; }
.cal-g .d:disabled { color: #c9c9cf; cursor: default; }
.cal-g .d.today { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.cal-g .d.in { background: #ffe9c7; border-radius: 0; }
.cal-g .d.s, .cal-g .d.e, .cal-g .d.s:hover, .cal-g .d.e:hover { background: var(--red); color: #fff; font-weight: 700; }
.cal-g .d.s { border-radius: 8px 0 0 8px; } .cal-g .d.e { border-radius: 0 8px 8px 0; } .cal-g .d.s.e { border-radius: 8px; }
.drp-inputs { display: flex; gap: .6rem; margin-top: .6rem; }
.drp-inputs label { flex: 1; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.drp-inputs input { min-height: 38px; padding: .3rem .5rem; font-size: .9rem; margin-top: .15rem; }
.drp-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .7rem; }
@media (max-width: 720px) {
  .drp-pop { position: fixed !important; left: 8px; right: 8px; bottom: 8px; top: auto; flex-direction: column; max-height: calc(100vh - 70px); overflow-y: auto; }
  .drp-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); min-width: 0; }
  .drp-presets button { padding: .4rem .6rem; background: #fff; border: 1px solid var(--line); margin: 2px; }
  .drp-cals { justify-content: center; }
  .cal { width: 100%; max-width: 330px; } .cal-w, .cal-g { grid-template-columns: repeat(7, 1fr); } .cal-g .d { height: 40px; }
}

/* ---------- confirm dialog ---------- */
.cfm-bg { z-index: 120; }
.cfm { max-width: 560px; border-top: 6px solid var(--ok); }
.cfm-edit, .cfm-warn { border-top-color: var(--amber); }
.cfm-delete { border-top-color: var(--crit); }
.cfm-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem; }
.cfm-head h2 { margin: 0; }
.cfm-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--ok-bg); flex: none; }
.cfm-edit .cfm-ic, .cfm-warn .cfm-ic { background: var(--amber-soft); }
.cfm-delete .cfm-ic { background: var(--crit-bg); }
.cfm-kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.cfm-intro { color: var(--ink-2); margin: .2rem 0 .7rem; }
.cfm-rows { margin-bottom: .6rem; }
.cfm-rows th { width: 42%; text-transform: none; letter-spacing: 0; font-size: .85rem; background: #fafafb; position: static; }
.cfm-rows td { font-size: .92rem; }
.cfm-old { color: var(--ink-3); text-decoration: line-through; }
.cfm-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin: .4rem 0; }
.cfm-list th { position: sticky; top: 0; }
.cfm-total { text-align: right; font-size: .92rem; margin: .4rem 0; }
.cfm-warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: .55rem .75rem; margin: .5rem 0; font-size: .9rem; }
.cfm-danger { color: var(--crit); font-weight: 700; font-size: .88rem; margin: .6rem 0 0; }
.cfm-btns { margin-top: 1rem; }
.btn.danger { background: var(--crit); }
.btn.danger:hover { background: #7d0013; }

.ch-cnt { font-size: .8rem; }
.ch-cnt em { font-style: normal; font-weight: 700; }
.lvtx-crit { color: var(--crit); } .lvtx-warn { color: var(--warn); } .lvtx-ok { color: var(--ok); } .lvtx-over { color: #1d5aa6; } .lvtx-none { color: var(--ink-3); }

/* multi-category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.cat-chips button { display: inline-flex; align-items: center; gap: .1rem; min-height: 38px; padding: .3rem .75rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.cat-chips button small { color: var(--ink-3); font-weight: 600; margin-left: .3rem; }
.cat-chips button:hover { border-color: var(--amber); }
.cat-chips button.on { background: var(--red); border-color: var(--red); color: #fff; }
.cat-chips button.on small { color: #ffd9de; }
.cat-chips button.on .dot { box-shadow: 0 0 0 2px #fff; }
h3.grp { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); border-bottom: 2px solid var(--line); padding-bottom: .35rem; margin: 1.2rem 0 .7rem; }
h3.grp:first-child { margin-top: .2rem; }
.grp-n { font-size: .8rem; font-weight: 500; color: var(--ink-2); }
tr.grp-row td { background: #f4f4f7; font-weight: 700; display: table-cell; }
tr.grp-row td > span { margin-right: 1rem; }

/* recipe stock warnings */
.r-warn { border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; border-left: 6px solid; }
.r-warn.crit { background: var(--crit-bg); color: var(--crit); border-color: var(--crit); }
.r-warn.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--amber); }
.r-warn.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.r-warn.neutral { background: #ececf0; color: var(--ink-2); border-color: #b5b5bd; }
.r-warn div { margin-top: .25rem; color: var(--ink); }
.inv-cell { min-width: 190px; }
.inv-cell .small { margin-top: .2rem; }

/* shopping list */
table.lst tr.off td { opacity: .45; }
table.lst tr.off td:first-child { opacity: 1; }
table.lst select.sup { min-width: 170px; min-height: 36px; padding: .3rem .4rem; font-size: .85rem; }
table.lst input.buy { min-height: 36px; }
table.lst input.inc, .sel-all { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); }
.sup-card .card-head label.check { gap: .6rem; }
/* count scope: count only one location */
.count-list.only-bodega .count-row, .count-list.only-tienda .count-row { grid-template-columns: 1fr 130px; }
.count-list.only-bodega .count-row > :nth-child(3), .count-list.only-tienda .count-row > :nth-child(2) { display: none; }
.scope-seg button { font-size: .95rem; padding: .55rem .9rem; }
.found-card .card-head { gap: 1rem; flex-wrap: wrap; }
.dup-note { background: #fff4e0; border: 1px solid var(--amber); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; }
.adj-list { list-style: none; padding: 0; margin: .3rem 0 0; } .adj-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.count-row input.changed { background: #fff4e0; border-color: var(--amber); font-weight: 700; }
/* count repair */
.rp-cell { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .3rem .6rem; font: inherit; font-weight: 700; cursor: pointer; min-width: 64px; }
.rp-cell.off { background: #f2f2f4; color: var(--ink-2); font-weight: 400; font-size: .82rem; }
.rp-cell.zero { background: #fff4e0; border-color: var(--amber); }
.rp-cell[disabled] { cursor: default; border-style: dashed; }
.rp-zero-demo { background: #fff4e0; padding: 0 .3rem; border-radius: 4px; }
/* reconstruct */
.rc-step { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .18rem 0; }
.rc-t { display: inline-block; min-width: 62px; font-size: .78rem; color: var(--ink-2); }
.rc-v { display: inline-block; padding: .12rem .45rem; border-radius: 6px; font-size: .85rem; white-space: nowrap; }
.rc-btn { border: 1px solid var(--line); background: #fff; font: inherit; font-size: .85rem; cursor: pointer; }
.rc-btn.off { background: #f2f2f4; color: var(--ink-2); border-style: dashed; }
.rc-btn.why-revisar:not(.off) { background: #fff4e0; border-color: var(--amber); }
.rc-btn[disabled] { cursor: default; }
.rc-table tr.rc-ch td:last-child { background: #fff4e0; }
.rc-table td { vertical-align: top; }
.rc-notice { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.rc-mob { display: none; margin-top: .4rem; }
.rc-hl { background: #fff4e0; padding: 0 .25rem; border-radius: 4px; }
@media (max-width: 700px) {
  .rc-table th:nth-child(3), .rc-table th:nth-child(4), .rc-table td:nth-child(3), .rc-table td:nth-child(4) { display: none; }
  .rc-table, .rc-table tbody, .rc-table tr, .rc-table td { display: block; width: 100%; }
  .rc-table thead { display: none; }
  .rc-table tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .rc-table td { border: 0; padding: .15rem 0; }
  .rc-mob { display: block; }
  .rc-t { min-width: 56px; }
}

/* ================= Tiquetera: app del cliente ================= */
.tq-mode body { background: linear-gradient(180deg, var(--red) 0 210px, var(--bg) 210px); min-height: 100vh; }
.tq-wrap { max-width: 440px; margin: 0 auto; padding: 1.1rem 1rem 2.5rem; }
.tq-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tq-brand { color: #fff; margin: .4rem 0 1rem; }
.tq-brand .brand-font { font-size: 1.5rem; line-height: 1; }
.tq-brand small { display: block; color: var(--amber); font-weight: 700; margin-top: .3rem; }
.tq-link { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; font-size: 1.4rem; width: 44px; height: 40px; cursor: pointer; }
.tq-hello { color: #fff; margin: -.3rem 0 .8rem; font-size: 1.05rem; }
.tq-card { background: #fff; border-radius: 16px; padding: 1.1rem 1.1rem; box-shadow: 0 4px 18px rgba(27,27,31,.08); margin-bottom: 1rem; }
.tq-card h1 { font-size: 1.3rem; } .tq-card h2 { font-size: 1rem; }
.tq-big { width: 100%; min-height: 52px; font-size: 1.05rem; margin: .3rem 0; }
.tq-balance { text-align: center; }
.tq-label { font-size: .85rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tq-num { font-family: "Climate Crisis", "Noto Sans", sans-serif; font-size: 4.4rem; line-height: 1.05; color: var(--red); margin: .2rem 0 .5rem; }
.tq-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: .2rem 0 .45rem; }
.tq-bar i { display: block; height: 100%; background: var(--amber); border-radius: 99px; }
.tq-future { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .7rem; }
.tq-future span { background: var(--amber-soft); border-radius: 99px; padding: .2rem .65rem; font-size: .85rem; }
.tq-note { background: var(--amber-soft); border-left: 4px solid var(--amber); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; font-size: .92rem; }
.tq-pin-btn { min-height: 60px; font-size: 1.15rem; box-shadow: 0 6px 18px rgba(188,2,25,.3); }
.tq-hist { list-style: none; padding: 0; margin: 0; } .tq-hist li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.tq-how { padding-left: 1.2rem; margin: .3rem 0 0; } .tq-how li { margin: .25rem 0; }
.tq-slogan { text-align: center; color: var(--ink-3); font-size: .85rem; font-style: italic; }
.tq-overlay { position: fixed; inset: 0; background: rgba(27,27,31,.72); display: grid; place-items: center; z-index: 120; padding: 1rem; }
.tq-pin-card { background: #fff; border-radius: 20px; padding: 1.4rem 1.2rem 1rem; width: min(380px, 100%); text-align: center; position: relative; }
.tq-pin { font-family: "Noto Sans", monospace; font-weight: 800; font-size: 3.3rem; letter-spacing: .12em; color: var(--ink); margin: .3rem 0 .4rem; font-variant-numeric: tabular-nums; }
.tq-pin span { display: inline-block; width: .35em; }
.tq-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.tq-ring circle { fill: none; stroke-width: 9; } .tq-ring .bg { stroke: var(--bg); } .tq-ring .fg { stroke: var(--red); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.tq-overlay.ending .tq-ring .fg { stroke: var(--amber); }
.tq-secs { margin-top: -78px; margin-bottom: 44px; font-size: 1.1rem; color: var(--ink-2); } .tq-secs b { font-size: 1.6rem; color: var(--ink); }
.tq-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 3rem; display: grid; place-items: center; margin: .3rem auto .6rem; }
.tq-sheet { position: fixed; inset: 0; background: rgba(27,27,31,.5); z-index: 110; display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.tq-sheet .tq-card { width: min(440px, 100%); }

/* ================= Tiquetera: portal (personal) ================= */
.tq-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tq-tabs a { padding: .45rem .9rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.tq-tabs a.on { background: var(--red); color: #fff; border-color: var(--red); }
.tq-caja { max-width: 520px; }
.tq-pin-input { font-size: 2.6rem; letter-spacing: .3em; text-align: center; font-weight: 800; width: 100%; padding: .5rem; border: 2px solid var(--line); border-radius: 14px; font-variant-numeric: tabular-nums; }
.tq-pin-input:focus { border-color: var(--red); outline: none; }
.tq-result { border-radius: 14px; padding: 1rem; margin-top: 1rem; }
.tq-result.ok { background: var(--ok-bg); border: 2px solid var(--ok); }
.tq-result.prev { background: #fff; border: 2px solid var(--amber); }
.tq-result .who { font-size: 1.3rem; font-weight: 700; }
.tq-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.tq-pack { border: 2px solid var(--line); border-radius: 12px; padding: .7rem .8rem; cursor: pointer; background: #fff; text-align: left; font: inherit; }
.tq-pack.on { border-color: var(--red); background: var(--amber-soft); }
.tq-pack b { display: block; font-size: 1.05rem; } .tq-pack .p { font-size: 1.15rem; font-weight: 800; color: var(--red); }
.tq-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tq-kpi { background: #fff; border-radius: 12px; padding: .8rem; border: 1px solid var(--line); }
.tq-kpi .v { font-size: 1.35rem; font-weight: 800; } .tq-kpi .l { font-size: .8rem; color: var(--ink-2); }
.tq-days { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: .5rem; }
.tq-days div { flex: 1; background: var(--amber); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.tq-days div.off { background: var(--line); }
.tq-days-x { display: flex; gap: 3px; font-size: .62rem; color: var(--ink-3); } .tq-days-x span { flex: 1; text-align: center; }
.tq-cred { background: var(--amber-soft); border-radius: 12px; padding: .8rem 1rem; font-size: 1rem; }
.tq-cred b { font-size: 1.2rem; }
.login-client { display: block; margin: 1rem 0 0; text-align: center; background: #fff; border: 1.5px solid var(--amber); border-radius: 12px; padding: .75rem 1rem; color: var(--ink); text-decoration: none; }
.login-client b { color: var(--red); }
.tq-pager { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
