/* Identidad de maribu.es: fondo marfil, gris carbón, dorado; Playfair Display + Montserrat + Open Sans */
:root {
  --bg: #f9f9f7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #6f6f6f;
  --line: #ebe5da;
  --accent: #333333;
  --gold: #c5a059;
  --gold-deep: #8f6d2c;     /* dorado oscuro para texto legible */
  --cream: #fffaf2;
  --sand: #f1e2c9;
  --cash: #8f6d2c;
  --cash-bg: #f7eedd;
  --card: #333333;
  --card-bg: #efefec;
  --danger: #a3392c;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --label: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --shadow: 0 1px 2px rgba(26, 26, 26, .04), 0 6px 20px rgba(26, 26, 26, .045);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; }
body { min-height: 100vh; padding-bottom: calc(70px + var(--safe-b)); -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 1.6rem 0 .4rem; }
h2::after { content: ""; display: block; width: 44px; height: 2px; background: var(--gold); margin-top: 6px; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 5px; }
.muted { color: var(--ink-2); font-size: .92rem; line-height: 1.45; margin: .3rem 0 .8rem; }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 18px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--cream);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { height: 46px; width: auto; display: block; }
.brand-sub { font-family: var(--label); font-weight: 500; font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-deep); padding-left: 10px; border-left: 1px solid var(--gold); line-height: 1.6; }
.pill { font-family: var(--label); font-weight: 500; font-size: .72rem; letter-spacing: .02em; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.pill.ok::before, .pill.warn::before, .pill.off::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pill.ok::before { background: #6c9a5b; }
.pill.warn::before { background: #d39b2a; }
.pill.off::before { background: var(--ink-2); }

/* Layout / panes */
main { padding: 14px 16px 20px; max-width: 1200px; margin: 0 auto; }
.pane { display: none; }
main[data-view="apuntar"] .pane-apuntar,
main[data-view="resumen"] .pane-resumen,
main[data-view="gastos"] .pane-gastos,
main[data-view="ajustes"] .pane-ajustes { display: block; }
.pane-ajustes { max-width: 560px; }

@media (min-width: 820px) {
  main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; padding: 20px 28px; }
  main[data-view="apuntar"] .pane-resumen,
  main[data-view="gastos"] .pane-resumen,
  main[data-view="resumen"] .pane-apuntar { display: block; }
  main[data-view="ajustes"] { display: block; }
  .tab-resumen { display: none !important; }
  .pane-resumen { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 160px); overflow: auto; }
  .today-strip { display: none !important; }
  .tabs button[data-v="apuntar"] .lbl-wide { display: inline; }
}

/* Today strip */
.today-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 14px;
  border-top: 2px solid var(--gold);
  box-shadow: var(--shadow);
}
.today-strip.flash { animation: flash .9s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(197, 160, 89, .55), var(--shadow); background: var(--cream); } 100% { box-shadow: 0 0 0 14px rgba(197, 160, 89, 0), var(--shadow); } }
.today-strip .t-label { font-family: var(--label); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.today-strip .t-total { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; }
.today-strip .t-split { text-align: right; font-size: .9rem; line-height: 1.5; }
.c-cash { color: var(--cash); }
.c-card { color: var(--card); }

/* Services */
.cat { margin: 10px 0 18px; }
.cat-title { font-family: var(--label); font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin: 0 4px 8px; display: flex; justify-content: space-between; }
.cat-title small { font-family: var(--sans); font-weight: 400; color: var(--gold-deep); letter-spacing: .04em; text-transform: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.svc {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 12px 11px; min-height: 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  transition: transform .12s var(--ease), border-color .15s, box-shadow .2s;
}
@media (hover: hover) { .svc:hover { border-color: var(--sand); box-shadow: var(--shadow); } }
.svc:active { transform: scale(.97); border-color: var(--gold); background: var(--cream); }
.svc-name { font-size: .95rem; line-height: 1.25; }
.svc-price { font-family: var(--label); font-weight: 500; font-size: .82rem; color: var(--gold-deep); }
.other-btn { width: 100%; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--ink-2); margin-top: 4px; }

/* Segmented */
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 9px; font-family: var(--label); font-weight: 500; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.seg button { transition: background .2s, color .2s; }
.seg button.on { background: var(--accent); color: #fff; }
.seg.small { margin: 4px 0 12px; }

.period-nav { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-deep); background: var(--surface); font-size: 1.4rem; line-height: 1; }
.period-label { flex: 1; text-align: center; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; padding: 6px; }

/* Summary */
.kpi { background: linear-gradient(180deg, var(--cream), var(--surface) 70%); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.kpi-total-label { font-family: var(--label); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.kpi-total { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.1; margin: 2px 0 2px; }
.kpi-count { color: var(--ink-2); font-size: .88rem; }
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 14px 0 12px; }
.bar i { display: block; height: 100%; }
.bar .b-cash { background: var(--gold); }
.bar .b-card { background: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.split > div { border-radius: 10px; padding: 10px 12px; }
.split .s-cash { background: var(--cash-bg); }
.split .s-card { background: var(--card-bg); }
.split .s-l { font-family: var(--label); font-weight: 500; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.split .s-v { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-top: 2px; color: var(--ink); }
.split .s-n { font-size: .78rem; color: var(--ink-2); }

.block-title { font-family: var(--label); font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin: 18px 4px 8px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.li:first-child { border-top: 0; }
.li-main { flex: 1; min-width: 0; }
.li-t { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-s { font-size: .8rem; color: var(--ink-2); margin-top: 1px; }
.li-v { font-weight: 600; white-space: nowrap; }
.tag { font-family: var(--label); font-weight: 500; font-size: .66rem; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; margin-left: 4px; }
.tag.cash { background: var(--cash-bg); color: var(--cash); }
.tag.card { background: var(--card-bg); color: var(--card); }
.tag.transf { background: #eef0f2; color: #3d4652; }
.tag.domic { background: #f1ece4; color: #6b5a3e; }
.tag.fijo { background: transparent; color: var(--gold-deep); border: 1px solid var(--sand); }
.tag.pend { background: var(--cream); color: var(--gold-deep); border: 1px solid var(--sand); }
.del { width: 34px; height: 34px; border-radius: 50%; color: var(--ink-2); font-size: 1rem; flex: none; }
.del:active { background: var(--line); color: var(--danger); }
.empty { text-align: center; color: var(--ink-2); padding: 26px 10px; font-size: .92rem; }
.chev { color: var(--ink-2); }

/* Fields & buttons */
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: .8rem; color: var(--ink-2); margin: 0 2px 5px; }
.field input { width: 100%; font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.field input:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 13px 18px; border-radius: 4px; border: 1px solid var(--accent); background: var(--surface); font-family: var(--label); font-weight: 500; font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; }
.btn.primary { background: var(--accent); color: #fff; }
.status-box { font-size: .88rem; color: var(--ink-2); min-height: 1.2em; }
.status-box.err { color: var(--danger); }
.status-box.ok { color: #557d47; }

/* Tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 10px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; font-family: var(--label); font-weight: 500; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border-radius: 10px; }
.tabs button.on { color: var(--gold-deep); font-weight: 600; }
.tabs .ti { width: 24px; height: 24px; }

/* Bottom sheet */
.backdrop { position: fixed; inset: 0; background: rgba(26,26,26,.32); z-index: 10; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease-out; }
.backdrop.closing { animation: fade .18s ease-in reverse forwards; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 8px 18px calc(18px + var(--safe-b));
  max-height: 92vh; overflow: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  animation: up .32s var(--ease);
}
.sheet.closing { animation: down .18s ease-in forwards; }
@media (min-width: 820px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 460px; border-radius: 20px; animation: pop .26s var(--ease); }
  .sheet.closing { animation: pop .16s ease-in reverse forwards; }
  .sheet-grip { display: none; }
}
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.96); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.sheet-grip { width: 38px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.sheet-cat { font-family: var(--label); font-weight: 500; color: var(--gold-deep) !important; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.sheet h3 { font-family: var(--serif); font-weight: 600; font-size: 1.55rem; margin: 2px 0 0; }
.x { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); flex: none; }
.price-wrap { display: flex; align-items: center; gap: 8px; }
.price-wrap input { font-size: 1.6rem !important; font-weight: 600; padding: 10px 12px; }
.price-wrap span { font-size: 1.4rem; color: var(--ink-2); }
.more { margin: 2px 0 6px; }
.more summary { color: var(--ink-2); font-size: .88rem; padding: 6px 2px 10px; }
.pay-q { margin: 8px 2px 8px; font-size: .85rem; color: var(--ink-2); }
.pay-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay, .gpay { padding: 18px 10px; border-radius: 14px; font-family: var(--label); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pay-ic { width: 34px; height: 34px; }
.pay.cash, .gpay.cash { background: var(--cash-bg); color: var(--cash); border: 1px solid var(--sand); }
.pay.card, .gpay.card { background: var(--accent); color: #fff; }
.gpay.transf { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.gpay.domic { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.pay, .gpay { transition: transform .12s var(--ease), filter .15s; }
.pay:active, .gpay:active { transform: scale(.96); filter: brightness(.96); }
.pay-btns.four .gpay { padding: 13px 8px; font-size: .74rem; }
.pay-btns.four .pay-ic { width: 28px; height: 28px; }

/* Toast */
.toast {
  position: fixed; left: 15px; right: 15px; margin: 0 auto; width: fit-content; bottom: calc(82px + var(--safe-b)); z-index: 20;
  background: var(--accent); color: #fff; border-radius: 10px; padding: 11px 14px; border-left: 3px solid var(--gold);
  display: flex; gap: 14px; align-items: center; font-size: .92rem; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: calc(100vw - 30px);
  animation: toast-in .28s var(--ease);
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast button { color: var(--sand); font-weight: 700; text-decoration: underline; }

/* ---------- Gastos ---------- */
.month-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.month-strip > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.month-strip .ms-l { font-family: var(--label); font-weight: 500; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.month-strip .ms-v { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin-top: 2px; }
.month-strip .ms-profit { border-top: 2px solid var(--gold); }
.pos { color: #4f7a43; }
.neg { color: var(--danger); }
.btn.wide { width: 100%; padding: 16px; font-size: .84rem; }
.block-title small { font-family: var(--sans); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--gold-deep); margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .84rem; color: var(--ink-2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.check { display: flex; gap: 10px; align-items: center; padding: 12px; margin: 0 0 12px; border-radius: 10px; border: 1px solid var(--sand); background: var(--cream); font-size: .9rem; }
.check input { width: 22px; height: 22px; accent-color: var(--gold-deep); flex: none; }
.hint { margin: -4px 2px 12px; font-size: .82rem; color: var(--gold-deep); }
.fijo-ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--gold-deep); margin-right: 4px; }

/* Tarjeta de gastos y beneficio en Resumen */
.kpi-g .g-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi-g .g-v { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; line-height: 1.15; }
.kpi-g .g-sub { font-size: .8rem; color: var(--ink-2); margin-top: 10px; line-height: 1.6; }
.kpi-g .cashbox { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--cash-bg); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .86rem; }
.kpi-g .cashbox b { font-family: var(--serif); font-size: 1.15rem; }


/* ---------- Números animados ---------- */
number-flow { --number-flow-char-height: 1em; font-variant-numeric: tabular-nums; }

/* ---------- Comparativa con el periodo anterior ---------- */
.cmp { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-top: 8px; font-size: .8rem; color: var(--ink-2); }
.cmp b { font-family: var(--label); font-weight: 600; font-size: .74rem; letter-spacing: .02em; padding: 2px 8px; border-radius: 99px; background: var(--card-bg); color: var(--ink); }
.cmp.up b { background: #e8f0e3; color: #3f6b34; }
.cmp.down b { background: #f6e3df; color: var(--danger); }

/* ---------- Gráfico ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 8px; margin-bottom: 12px; box-shadow: var(--shadow); }
.chart-box { position: relative; height: 170px; }
.chart-box canvas { cursor: pointer; }
.chart-legend { display: flex; gap: 14px; margin: 0 2px 8px; font-family: var(--label); font-size: .64rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.lg::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg.cash::before { background: var(--gold); }
.lg.card::before { background: var(--accent); }
.lg.gas::before { background: #e3b9b1; }

/* Barra de proporción bajo cada servicio */
.li-meter { position: relative; }
.li-meter::after { content: ""; position: absolute; left: 14px; bottom: 0; height: 2px; width: calc((100% - 28px) * var(--w, 0)); background: linear-gradient(90deg, var(--gold), var(--sand)); border-radius: 2px; opacity: .8; }

.bar i { transition: width .5s var(--ease); }
.li { transition: background .15s; }
@media (hover: hover) { button.li:hover { background: var(--cream); } }

/* ---------- Confirmación propia ---------- */
.ask { border: 0; padding: 0; border-radius: 18px; background: var(--bg); color: var(--ink); width: min(380px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.ask[open] { animation: ask-in .24s var(--ease); }
.ask::backdrop { background: rgba(26,26,26,.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes ask-in { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.ask form { padding: 20px 20px 16px; }
.ask h3 { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 0 0 6px; }
.ask p { margin: 0 0 18px; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Transición entre pestañas (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
.top { view-transition-name: top; }
.tabs { view-transition-name: tabs; }

/* =====================================================================
   Pantallas nuevas: entrada, clientas, productos, caja, objetivo, mapa de horas
   ===================================================================== */
main[data-view="clientas"] .pane-clientas { display: block; }
@media (min-width: 820px) { main[data-view="clientas"] .pane-resumen { display: block; } }
.tabs button { min-width: 0; }
.tabs { gap: 0; }

/* Entrada */
.login { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 18px; padding: 26px 22px; box-shadow: var(--shadow); }
.login-logo { display: block; height: 70px; width: auto; margin: 0 auto 6px; }
.center { text-align: center; }
.brand-sub.center { border: 0; padding: 0; margin: 0 0 18px; display: block; }
.btn .ic { vertical-align: -0.2em; }

/* Campos extra */
.opt { color: var(--ink-2); font-size: .72rem; margin-left: 4px; }
.field select, .field textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.field textarea { resize: vertical; }
.price-wrap.small input { font-size: 1.1rem !important; font-weight: 500; }
.price-wrap.small span { font-size: 1rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn { display: block; width: 100%; text-align: center; padding: 12px 6px 4px; color: var(--gold-deep); font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--danger); margin-top: 8px; }
.btn.danger-outline { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .45; }
.form-btns { display: grid; gap: 8px; margin-top: 14px; }
.form-btns.n2 { grid-template-columns: 1fr 1.4fr; }
.hint.neg, small.neg { color: var(--danger); }

/* Cantidad de producto */
.qty { display: flex; align-items: center; gap: 12px; margin: 0 2px 12px; font-size: .85rem; color: var(--ink-2); }
.q-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold-deep); background: var(--surface); font-size: 1.3rem; }
.qty b { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); min-width: 1.5em; text-align: center; }
.qty small { margin-left: auto; }

/* Pago mixto */
.mix-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Productos en Apuntar */
.svc-price em { font-style: normal; display: block; font-family: var(--sans); font-weight: 400; font-size: .72rem; color: var(--ink-2); letter-spacing: 0; }
.stock.low { color: #b07415; font-weight: 600; }
.stock.out { color: var(--danger); font-weight: 600; }
.svc.prod { border-style: dashed; }

/* Listas que se pueden tocar */
.li.tap { cursor: pointer; }
@media (hover: hover) { .li.tap:hover { background: var(--cream); } }
.li-v small { font-weight: 400; color: var(--ink-2); }
.tag.warn { background: #fbecd3; color: #8a5a0b; }
button.li-main { text-align: left; padding: 0; }

/* Clientas */
.search input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.search { margin-bottom: 4px; }
.wa { display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 8px 11px; border-radius: 99px; background: #e7f4ea; color: #1f6b38; font-family: var(--label); font-weight: 600; font-size: .7rem; letter-spacing: .04em; text-decoration: none; }
.wa.off { background: var(--card-bg); color: var(--ink-2); font-weight: 500; }
.cli-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; }
.cli-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.cli-stats b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.cli-stats span { font-size: .68rem; color: var(--ink-2); }
#fBody .list { margin-bottom: 6px; }

/* Caja del día */
.kpi.caja { background: linear-gradient(180deg, var(--cash-bg), var(--surface) 75%); }
.caja-lines { margin: 10px 0 6px; font-size: .88rem; }
.caja-lines > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-2); }
.caja-lines b { color: var(--ink); font-weight: 600; }
.caja-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--sand); padding-top: 10px; margin-top: 4px; }
.caja-total span { font-family: var(--label); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cash); }
.caja-total b { font-family: var(--serif); font-size: 1.6rem; }
.cierre { margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-size: .84rem; background: var(--card-bg); }
.cierre.ok { background: #e8f0e3; color: #3f6b34; }
.cierre.mas { background: #fbecd3; color: #8a5a0b; }
.cierre.menos { background: #f6e3df; color: var(--danger); }
.caja-btns { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; }
.movs { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mov { text-align: left; font-size: .8rem; color: var(--ink-2); padding: 4px 2px; }
.mov span { color: var(--ink-2); margin-left: 6px; }
.denoms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 12px; }
.denom { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.denom.bill { border-color: var(--sand); background: var(--cream); }
.denom span { font-family: var(--label); font-size: .7rem; font-weight: 600; color: var(--gold-deep); }
.denom input { width: 100%; border: 0; background: transparent; font: inherit; font-size: 1.1rem; font-weight: 600; padding: 2px 0; text-align: center; }
.denom input:focus { outline: 2px solid var(--gold); border-radius: 6px; }
.count-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px; }
.count-total span { font-family: var(--label); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.count-total b { font-family: var(--serif); font-size: 1.7rem; }
.count-diff { text-align: center; padding: 9px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.count-diff.ok { background: #e8f0e3; color: #3f6b34; }
.count-diff.mas { background: #fbecd3; color: #8a5a0b; }
.count-diff.menos { background: #f6e3df; color: var(--danger); }

/* Objetivo y previsión */
.obj-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.obj-head b { font-family: var(--serif); font-size: 1.2rem; }
.obj-head small { font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--ink-2); }
.progress { position: relative; height: 10px; border-radius: 99px; background: var(--line); margin: 10px 0 8px; overflow: visible; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .6s var(--ease); }
.progress em { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.obj-sub { font-size: .84rem; color: var(--ink-2); line-height: 1.5; }
.forecast { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.forecast span { font-family: var(--label); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.forecast b { font-family: var(--serif); font-size: 1.35rem; }
.forecast small { grid-column: 1 / -1; color: var(--ink-2); font-size: .78rem; }
.kpi-text p { margin: 8px 0 0; line-height: 1.6; font-size: .93rem; }
.kpi-text a { color: var(--gold-deep); }

/* Mapa de horas */
.heat-grid { display: grid; gap: 3px; margin-top: 10px; }
.heat-grid .hh, .heat-grid .hd { font-family: var(--label); font-size: .6rem; color: var(--ink-2); text-align: center; align-self: center; }
.heat-grid i { aspect-ratio: 1; border-radius: 4px; background: rgba(197, 160, 89, var(--a)); outline: 1px solid rgba(0, 0, 0, .03); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: .7rem; color: var(--ink-2); }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; background: rgba(197, 160, 89, var(--a)); }

/* =====================================================================
   Agenda, ficha técnica, gestoría y bloqueo
   ===================================================================== */
main[data-view="agenda"] .pane-agenda { display: block; }
@media (min-width: 820px) { main[data-view="agenda"] .pane-resumen { display: block; } }
.tabs button { letter-spacing: .04em; padding: 6px 2px; }
@media (max-width: 380px) { .tabs button { font-size: .6rem; } }

/* Semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 12px; }
.week .wd { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-family: var(--label); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; }
.week .wd b { font-size: 1rem; color: var(--ink); font-weight: 600; letter-spacing: 0; }
.week .wd i { font-style: normal; color: var(--gold-deep); font-size: .6rem; line-height: 1; min-height: .6rem; letter-spacing: 0; }
.week .wd.today { border-color: var(--gold); }
.week .wd.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.week .wd.on b, .week .wd.on i { color: #fff; }
#agHoy { padding: 0 6px 10px; }
#newCita { margin-bottom: 4px; }

/* Citas */
.cita-h { flex: none; width: 50px; font-weight: 600; font-size: .98rem; line-height: 1.15; }
.cita-h small { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-2); }
.li.cita .li-t { white-space: normal; }
.li.cita.hecha, .li.cita.no_vino, .li.cita.anulada { opacity: .62; }
.li.cita.anulada .li-t { text-decoration: line-through; }
.tag.est-hecha { background: var(--cash-bg); color: var(--cash); }
.tag.est-no_vino { background: #fbe3e1; color: var(--danger); }
.tag.est-anulada { background: #eef0f2; color: #3d4652; }
.btn-mini { flex: none; padding: 8px 12px; border-radius: 99px; background: var(--accent); color: #fff; font-family: var(--label); font-weight: 600; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.wa.done { background: transparent; border: 1px solid #b9dcc3; }
#citasHoy .list { margin-bottom: 14px; }
.rec-box { background: var(--cream); border: 1px solid var(--sand); border-radius: var(--r); padding: 12px 14px; margin: 12px 0 4px; }
.rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.rec-head span { font-size: .8rem; color: var(--gold-deep); }
.rec-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--sand); }
.rec-row:first-of-type { border-top: 0; }
.rec-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prox { background: var(--cream); border: 1px solid var(--sand); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.prox > div { flex: 1; }

/* Ficha técnica */
.tec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.tec-grid .wide { grid-column: 1 / -1; }
.tec-grid .field { margin-bottom: 10px; }
.tec-grid .field input { padding: 10px; }
.more.tec summary span { color: var(--gold-deep); font-size: .8rem; }
.tec-line { font-size: .78rem; color: var(--gold-deep); margin-top: 2px; }

/* Gestoría */
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 8px 0 10px; box-shadow: var(--shadow); }
.q-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: .92rem; }
.q-row.sub { padding-left: 12px; color: var(--ink-2); font-size: .84rem; }
.q-row.tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 600; }

/* Bloqueo */
.lock { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.lock-card { width: min(320px, 100%); text-align: center; }
.lock-card .login-logo { margin-bottom: 18px; }
.lock-msg { min-height: 1.4em; font-size: .9rem; color: var(--ink-2); margin: 0 0 10px; }
.lock-msg.err { color: var(--danger); }
.lock-dots { display: flex; justify-content: center; gap: 14px; margin: 0 0 22px; }
.lock-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--gold-deep); }
.lock-dots i.on { background: var(--gold-deep); }
.lock-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; justify-content: center; }
.keypad button { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 1.6rem; font-weight: 500; color: var(--ink); }
.keypad button:active { background: var(--cream); }
.keypad button.k-txt { background: transparent; border: 0; font-size: .78rem; font-family: var(--label); text-transform: uppercase; letter-spacing: .06em; color: var(--gold-deep); }
.keypad button:disabled { opacity: .35; }
.lock-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.lock-btn .ic { width: 20px; height: 20px; }
.top-r { display: flex; align-items: center; gap: 6px; }
.lock .forgot { margin-top: 14px; text-align: left; }
.lock .forgot .muted { font-size: .86rem; }

/* Reservas online */
.ti-wrap { position: relative; display: inline-flex; }
.badge { position: absolute; top: -4px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--gold); color: #fff; font-family: var(--label); font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center; letter-spacing: 0; box-shadow: 0 0 0 2px var(--bg); }
.sol-aviso { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--r); background: var(--cream); border: 1px solid var(--gold); color: var(--ink); font-size: .92rem; }
.sol-aviso b { font-weight: 600; color: var(--gold-deep); }
.sol-aviso .chev { margin-left: auto; color: var(--gold-deep); font-size: 1.2rem; line-height: 1; }
.sol-box { border-color: var(--gold); }
.sol-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--sand); }
.sol-row:first-of-type { border-top: 0; }
.sol-info { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 1px; }
.sol-info b { font-weight: 600; font-size: .92rem; }
.sol-info span { font-size: .9rem; }
.sol-info small { font-size: .78rem; color: var(--ink-2); }
.sol-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.sol-btns .wa, .sol-btns .btn-mini { justify-content: center; }
.li.cita.solicitada { background: var(--cream); box-shadow: inset 3px 0 0 var(--gold); }
.tag.est-solicitada { background: #fbecd3; color: #8a5a0b; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.res-card.on { border-color: #b9dcc3; }
.res-est { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.res-est .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); flex: none; }
.res-card.on .res-est .dot { background: #6c9a5b; }
.res-det { font-size: .84rem; color: var(--ink-2); margin: 6px 0 0; line-height: 1.5; }
.res-link { display: inline-block; margin-top: 8px; color: var(--gold-deep); font-weight: 600; font-size: .9rem; word-break: break-all; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.hor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hor-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.hor-row:first-child { border-top: 0; }
.hor-t { display: flex; align-items: center; gap: 3px; }
.hor-t span { color: var(--ink-2); font-size: .8rem; }
.field .hor-t input { padding: 8px 4px; font-size: 15px; min-width: 0; text-align: center; }
.hor-row.cerrado .hor-t { opacity: .3; pointer-events: none; }
.field .hor-t input { flex: 1 1 0; width: 0; }
@media (max-width: 620px) { .hor-row { grid-template-columns: 1fr; gap: 6px; } }
.res-svcs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.res-svc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
.res-svc:first-child { border-top: 0; }
.res-svc .chk { flex: 1; min-width: 0; }
.field .res-svc select { width: auto; padding: 7px 8px; font-size: 15px; }
.cer-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.field .cer-row input { flex: 1; min-width: 0; padding: 9px 6px; }
.cer-row span { color: var(--ink-2); font-size: .85rem; }
.cer-row .x { flex: none; width: 34px; height: 34px; border-radius: 50%; color: var(--danger); }
