/* LIMBO · Gestión — negro + amarillo limón de la marca */
:root {
  --lemon: #FDF483;
  --lemon-2: #F3E85C;
  --lemon-ink: #0B0B0B;
  --orange: #FF8A3D;
  --r: 18px;
  --r-sm: 12px;
  --display: 'Bebas Neue', 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 84px;
}
/* Modo claro (predeterminado) */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #F4F2EA;
  --bg-rgb: 244, 242, 234;
  --s1: #FFFFFF;
  --s2: #F1EFE7;
  --s3: #E6E3D8;
  --line: #E3E0D5;
  --text: #121212;
  --muted: #6B685F;
  --dim: #9C998F;
  --accent: #121212;        /* acentos de texto/iconos */
  --focus: #121212;
  --cash: #E8D530;          /* barras de efectivo */
  --heat: 232, 213, 48;     /* calendario */
  --soft: rgba(253, 244, 131, .55);
  --soft-line: #E2CF2A;
  --bar-bg: #121212; --bar-fg: #F6F4EA;
  --red: #D7381F;
  --green: #2F8F3E;
  --shadow: 0 10px 30px rgba(20, 18, 10, .12);
}
/* Modo oscuro */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0A0A;
  --bg-rgb: 10, 10, 10;
  --s1: #131313;
  --s2: #1B1B1B;
  --s3: #252525;
  --line: #2C2C2C;
  --text: #F6F4EA;
  --muted: #8E8B80;
  --dim: #5E5C56;
  --accent: #FDF483;
  --focus: #FDF483;
  --cash: #FDF483;
  --heat: 253, 244, 131;
  --soft: rgba(253, 244, 131, .1);
  --soft-line: rgba(253, 244, 131, .35);
  --bar-bg: #F6F4EA; --bar-fg: #0A0A0A;
  --red: #FF5A45;
  --green: #9BE38A;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 16px; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--lemon); color: var(--lemon-ink); }

/* ── motivo código de barras ── */
.barcode {
  height: 14px; width: 120px;
  background: repeating-linear-gradient(90deg,
    currentColor 0 3px, transparent 3px 6px, currentColor 6px 7px, transparent 7px 10px,
    currentColor 10px 15px, transparent 15px 18px, currentColor 18px 19px, transparent 19px 23px,
    currentColor 23px 25px, transparent 25px 29px);
  color: var(--accent);
}
.barcode.big { width: 180px; height: 46px; animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { from { opacity: .35; } to { opacity: 1; } }
.boot { min-height: 100dvh; display: grid; place-items: center; }

/* ── estructura ── */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.main, .grid > *, .stack > * { min-width: 0; }
.side { display: none; }
.main { padding: 18px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1180px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .logo { height: 22px; color: var(--text); }
.topbar .who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--lemon); color: var(--lemon-ink); display: grid; place-items: center; font-weight: 700; border: 0; cursor: pointer; }

@media (min-width: 900px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh;
    padding: 28px 18px; border-right: 1px solid var(--line); background: var(--s1);
  }
  .side .logo { height: 26px; color: var(--text); margin: 4px 8px 6px; }
  .side .barcode { margin: 0 8px 26px; }
  .side a {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    text-decoration: none; color: var(--muted); font-weight: 600;
  }
  .side a svg { width: 22px; height: 22px; }
  .side a:hover { background: var(--s2); color: var(--text); }
  .side a.on { background: var(--lemon); color: var(--lemon-ink); }
  .side .spacer { flex: 1; }
  .side .me { padding: 12px 14px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
  .appbar, .dock { display: none !important; }
  .side-bell { display: flex; }
  .main { padding: 34px 40px 60px; }
}

/* ── tipografía ── */
h1, h2, h3 { margin: 0; font-weight: 700; }
.h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 10vw, 56px); line-height: .9; letter-spacing: .01em; }
.h2 { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: .02em; line-height: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-family: var(--display); font-weight: 400; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.up { color: var(--green); }
.down { color: var(--red); }

/* ── tarjetas ── */
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g-dash { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); } }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; }
.card.tight { padding: 12px 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h .h2 { font-size: 24px; }

.hero {
  background: var(--lemon); color: var(--lemon-ink); border-radius: 24px; padding: 22px 22px 18px;
  position: relative; overflow: hidden; border: 0;
}
.hero .eyebrow { color: rgba(0,0,0,.6); }
.hero .big { font-family: var(--display); font-size: clamp(64px, 17vw, 112px); line-height: .82; margin: 10px 0 8px; letter-spacing: .005em; }
.hero .big small { font-size: .45em; margin-left: 4px; }
.hero .barcode { color: var(--lemon-ink); position: absolute; right: 22px; top: 24px; width: 86px; height: 22px; opacity: .9; }
.hero .split { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.hero .pill { background: rgba(0,0,0,.08); color: var(--lemon-ink); }
.hero .pill b { font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: .02em; }
.hero .cta { margin-top: 16px; }
.hero.nocash .big { opacity: .28; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--s2); font-size: 13px; font-weight: 600; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--s3); color: var(--muted); }
.tag.lemon { background: var(--lemon); color: var(--lemon-ink); }
.tag.red { background: rgba(255,90,69,.15); color: var(--red); }
.tag.orange { background: rgba(255,138,61,.15); color: var(--orange); }
.tag.green { background: rgba(155,227,138,.14); color: var(--green); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-family: var(--display); font-size: clamp(24px, 7vw, 34px); line-height: 1; }
.stat .d { font-size: 12.5px; font-weight: 600; }

/* ── botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--s2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--lemon); border-color: var(--lemon); color: var(--lemon-ink); }
.btn.primary:hover { background: var(--lemon-2); }
.btn.ink { background: var(--lemon-ink); border-color: var(--lemon-ink); color: var(--lemon); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.sm { height: 36px; padding: 0 12px; border-radius: 11px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 25;
  height: 52px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; background: var(--lemon); color: var(--lemon-ink);
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; box-shadow: 0 10px 28px rgba(0,0,0,.28); cursor: pointer;
  animation: pop .45s cubic-bezier(.34,1.56,.64,1) both .15s; transition: transform .15s;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }

/* ── segmentado ── */
.seg { display: inline-flex; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 9px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 14.5px; }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button .count { margin-left: 6px; font-size: 11px; background: var(--lemon); color: var(--lemon-ink); padding: 1px 6px; border-radius: 6px; }

/* ── formularios ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--s2); outline: none; transition: border-color .15s, background .15s; font-size: 16px;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--focus); background: var(--s1); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 18px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }

/* importe grande */
.money-in { position: relative; }
.money-in input {
  width: 100%; border: 1px solid var(--line); background: var(--s2); border-radius: 16px;
  height: 66px; padding: 0 46px 0 16px; font-family: var(--display); font-size: 40px; letter-spacing: .02em; outline: none;
  font-variant-numeric: tabular-nums;
}
.money-in input:focus { border-color: var(--focus); background: var(--s1); }
.money-in .eur { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 28px; color: var(--dim); pointer-events: none; }

/* ── caja ── */
.daybar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.daybar .d { text-align: center; flex: 1; cursor: pointer; position: relative; }
.daybar .d input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.daybar .d .h2 { font-size: 30px; }
.cash-grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .cash-grid { grid-template-columns: 1fr 1fr; } }
.tpv-line { display: grid; grid-template-columns: 1fr; gap: 6px; }
.tpv-line .lbl { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.tpv-line .lbl .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--orange); }
.total-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 10; margin-top: 16px;
  background: var(--bar-bg); color: var(--bar-fg); border-radius: 20px; padding: 12px 12px 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
.total-bar .num { font-size: 40px; line-height: 1; }
.total-bar .muted { color: inherit; opacity: .6; }
@media (min-width: 900px) { .total-bar { bottom: 20px; } }

/* calendario */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .wd { font-size: 11px; text-align: center; color: var(--dim); font-weight: 700; letter-spacing: .08em; }
.cal .c {
  aspect-ratio: 1 / 1.05; border-radius: 12px; background: var(--s2); border: 1px solid transparent; padding: 6px;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; min-width: 0; overflow: hidden;
}
.cal .c:hover { border-color: var(--line); }
.month-grid { display: grid; gap: 22px; margin-top: 6px; }
@media (min-width: 1000px) { .month-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.cal .c .n { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal .c .t { font-family: var(--display); font-size: 15px; text-align: right; line-height: 1; white-space: nowrap; overflow: hidden; }
.cal .c.out { visibility: hidden; }
.cal .c.today { border-color: var(--focus); }
.cal .c.future { opacity: .35; cursor: default; }
@media (min-width: 720px) { .cal .c .t { font-size: 18px; } .cal .c { aspect-ratio: 1.15 / 1; } }

/* barras */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; justify-content: flex-start; position: relative; cursor: default; min-width: 0; }
.bars .b i { display: block; border-radius: 4px; min-height: 0; }
.bars .b i.cash { background: var(--cash); }
.bars .b i.cardp { background: var(--orange); }
.bars .b.none::after { content: ''; position: absolute; bottom: 0; left: 25%; right: 25%; height: 3px; border-radius: 2px; background: var(--s3); }
.bars .b.today i { box-shadow: 0 0 0 2px var(--text); }
.bars .b:hover .tip { display: block; }
.bars .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 6px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 5; font-weight: 600; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.hbar { height: 10px; border-radius: 5px; background: var(--s3); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 5px; background: var(--cash); }

/* ── listas ── */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.li .amt { font-family: var(--display); font-size: 24px; white-space: nowrap; }
.li.click { cursor: pointer; }
.li.click:hover { background: linear-gradient(90deg, transparent, var(--s2), transparent); }
.group-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 6px; }
.group-h:first-child { margin-top: 4px; }

.chk {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--dim); background: transparent; flex: none;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.chk.on { background: var(--lemon); border-color: var(--lemon); color: var(--lemon-ink); }
.chk svg { width: 18px; height: 18px; }
.li.done .t { text-decoration: line-through; color: var(--dim); }

.supplier-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.supplier-card .badge { width: 44px; height: 44px; border-radius: 14px; background: var(--s3); display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--accent); flex: none; }

/* comparador */
.offer { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 12px; }
.offer.best { background: var(--soft); outline: 1px solid var(--soft-line); }
.offer .p { font-family: var(--display); font-size: 22px; text-align: right; }
.offer .meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.cmp { display: grid; gap: 12px; }
@media (min-width: 760px) { .cmp { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .cmp { grid-template-columns: repeat(3, 1fr); } }

/* revisión de presupuesto */
.review { display: flex; flex-direction: column; gap: 10px; }
.rline { background: var(--s2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; grid-template-columns: 1fr; }
.rline.skip { opacity: .4; }
.rline .raw { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.rline .ctrls { display: grid; grid-template-columns: 1fr 88px 104px; gap: 8px; }
.rline .ctrls .input { height: 42px; font-size: 15px; padding: 0 10px; border-radius: 11px; }
.rline .up-price { font-size: 12.5px; color: var(--accent); font-weight: 600; }
@media (min-width: 900px) {
  .rline { grid-template-columns: 1.1fr 1.6fr auto; align-items: center; }
  .rline .ctrls { grid-template-columns: 1fr 88px 104px; }
}
.drop {
  border: 2px dashed var(--line); border-radius: 18px; padding: 26px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; display: block;
}
.drop:hover, .drop.over { border-color: var(--focus); background: var(--soft); }
.drop input { display: none; }
.drop svg { width: 34px; height: 34px; color: var(--accent); }

/* ── hoja inferior / modal ── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; background: var(--s1);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + var(--safe-b));
  animation: rise .22s cubic-bezier(.2,.9,.3,1);
}
.sheet.wide { max-width: 980px; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--s3); margin: 4px auto 14px; }
.sheet .sh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--line); padding: 18px 24px 24px; }
  .sheet .grab { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }
@media (min-width: 900px) { #toast { bottom: 28px; } }

/* ── login ── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; }
.login .logo { width: 220px; color: var(--text); display: block; margin: 0 auto 14px; }
.login .barcode { margin: 0 auto 40px; width: 200px; height: 30px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .barcode { margin: 0 auto 14px; opacity: .5; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.mt { margin-top: 14px; } .mt-lg { margin-top: 24px; } .mb { margin-bottom: 14px; }
.hide { display: none !important; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--dim); }
.search .input { padding-left: 42px; }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--s2); border: 1px solid var(--line); border-radius: 14px; z-index: 20; max-height: 260px; overflow: auto; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.ac-list button { display: flex; width: 100%; text-align: left; padding: 12px 14px; border: 0; background: transparent; cursor: pointer; justify-content: space-between; gap: 8px; }
.ac-list button:hover, .ac-list button.on { background: var(--s3); }
.fade-in { animation: fade .25s; }

a.card > svg, .li > svg, .row > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
a.card { color: var(--text); }
.card-h.wrap { flex-wrap: wrap; }
.li.item { align-items: flex-start; gap: 10px; }
.li.item .chk { margin-top: 2px; }
.li.item .s { line-height: 1.35; }
.li.item .side-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.li.item .side-r .num { font-size: 20px; line-height: 1; }
.li.item .t { white-space: normal; }
@media (max-width: 560px) {
  .lbl-pay { display: none; }
  .li .amt { font-size: 21px; }
  .li .s .tag { white-space: nowrap; }
}

/* ajustes del modo claro */
:root:not([data-theme="dark"]) .card { box-shadow: 0 1px 2px rgba(20, 18, 10, .04); }
:root:not([data-theme="dark"]) .side { background: #FFFFFF; }
:root:not([data-theme="dark"]) .hero { box-shadow: 0 8px 24px rgba(200, 180, 20, .18); }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-pick button { border: 1px solid var(--line); background: var(--s2); border-radius: 14px; padding: 12px 8px; cursor: pointer; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.theme-pick button.on { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.theme-pick .sw { width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--line); }

/* ════════ v2 · barra superior, dock flotante, menú, splash, animaciones ════════ */
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes load { 0% { width: 0; } 60% { width: 72%; } 100% { width: 100%; } }

#splash { position: fixed; inset: 0; z-index: 200; background: #0B0B0B; display: grid; place-items: center; transition: opacity .5s ease, visibility .5s; }
#splash .in { display: flex; flex-direction: column; align-items: center; gap: 26px; animation: rise .6s ease both; }
#splash img { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 0 0 1px rgba(253,244,131,.15), 0 20px 60px rgba(253,244,131,.12); }
#splash .word { font-family: var(--display); color: #F6F4EA; font-size: 30px; letter-spacing: .32em; margin-right: -.32em; }
#splash .track { width: 150px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
#splash .track i { display: block; height: 100%; border-radius: 4px; background: var(--lemon); box-shadow: 0 0 12px rgba(253,244,131,.7); animation: load 1.1s cubic-bezier(.6,.05,.3,1) forwards; }
#splash.done { opacity: 0; visibility: hidden; }
#splash.done .in { transform: scale(1.06); transition: transform .5s ease; }

.appbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; background: #0B0B0B; color: #F6F4EA;
}
.ab-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; position: relative; cursor: pointer; transition: background .15s, transform .15s; }
.ab-btn:active { transform: scale(.9); background: rgba(255,255,255,.08); }
.ab-btn svg { width: 24px; height: 24px; }
.ab-logo .logo { height: 22px; color: #F6F4EA; display: block; }
.badge { position: absolute; top: 6px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lemon); color: #0B0B0B; font-size: 11px; font-weight: 700; display: grid; place-items: center; animation: pop .4s cubic-bezier(.34,1.56,.64,1); }
.badge.hide { display: none; }
.side-bell { display: none; position: relative; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; text-align: left; }
.side-bell svg { width: 22px; height: 22px; }
.side-bell:hover { background: var(--s2); color: var(--text); }
.side-bell .badge { position: static; margin-left: auto; }

.main-wrap { min-width: 0; }
.page-enter > * { animation: rise .42s cubic-bezier(.2,.8,.2,1) both; }
.page-enter > *:nth-child(2) { animation-delay: .05s; }
.page-enter > *:nth-child(3) { animation-delay: .1s; }
.page-enter > *:nth-child(n+4) { animation-delay: .15s; }
.page-enter .stack > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.page-enter .stack > *:nth-child(2) { animation-delay: .08s; }
.page-enter .stack > *:nth-child(3) { animation-delay: .14s; }
.page-enter .stack > *:nth-child(n+4) { animation-delay: .2s; }
.page-enter .fab { animation: pop .45s cubic-bezier(.34,1.56,.64,1) both .2s; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.desk-only { display: none; }
@media (min-width: 900px) { .desk-only { display: grid; } }

/* dock flotante */
.dock {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px);
  width: min(calc(100% - 24px), 440px); height: 64px; padding: 6px; border-radius: 999px;
  display: flex; background: #0B0B0B; box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
  animation: dockIn .6s cubic-bezier(.34,1.56,.64,1) both .1s;
}
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dock a {
  position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; color: rgba(246,244,234,.62); font-size: 13.5px; font-weight: 700; border-radius: 999px; transition: color .25s;
}
.dock a svg { width: 22px; height: 22px; flex: none; }
.dock a span { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .35s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.dock a.on { color: #0B0B0B; flex: 1.9; }
.dock a.on span { max-width: 90px; opacity: 1; }
.dock a:active svg { transform: scale(.88); }
.dock-ind {
  position: absolute; z-index: 0; top: 6px; left: 0; height: 52px; border-radius: 999px; background: var(--lemon);
  box-shadow: 0 4px 18px rgba(253,244,131,.35);
  transition: transform .45s cubic-bezier(.34,1.4,.64,1), width .45s cubic-bezier(.34,1.4,.64,1), opacity .2s;
}
.total-bar { bottom: calc(var(--nav-h) + var(--safe-b) + 6px); }

/* menú lateral */
.drawer-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .25s ease both; }
.drawer {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(86vw, 340px); background: var(--bg); display: flex; flex-direction: column;
  box-shadow: 20px 0 60px rgba(0,0,0,.35); animation: slideIn .38s cubic-bezier(.2,.9,.2,1) both; overflow: hidden;
}
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-scrim.closing { animation: fadeIn .22s ease reverse both; }
.drawer-scrim.closing .drawer { animation: slideIn .22s ease-in reverse both; }
.dr-head { background: #0B0B0B; color: #F6F4EA; padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 18px 20px; border-radius: 0 0 26px 26px; }
.dr-logo { height: 20px; color: #F6F4EA; }
.dr-me { display: flex; align-items: center; gap: 14px; margin-top: 16px; text-decoration: none; color: inherit; }
.dr-me > svg { width: 18px; height: 18px; opacity: .5; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; position: relative; flex: none; }
.avatar .online { position: absolute; right: 0; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: #5BD66B; border: 2px solid #0B0B0B; }
.dr-name { font-weight: 700; font-size: 18px; }
.dr-role { color: var(--lemon); font-size: 13px; font-weight: 600; margin-top: 2px; }
.dr-body { flex: 1; overflow-y: auto; padding: 6px 14px 14px; }
.dr-sec { margin: 18px 8px 8px; }
.dr-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; text-decoration: none; color: inherit; transition: background .15s; animation: rise .4s both; }
.dr-item:nth-child(3) { animation-delay: .04s; } .dr-item:nth-child(4) { animation-delay: .08s; } .dr-item:nth-child(5) { animation-delay: .12s; }
.dr-item:hover { background: var(--s2); }
.dr-item.on { background: var(--s1); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.dr-item.on .tile { background: var(--lemon); color: #0B0B0B; }
.dr-item .t { font-weight: 700; } .dr-item .s { color: var(--muted); font-size: 13px; }
.dr-item > svg:last-child { width: 20px; height: 20px; color: var(--text); }
.dr-list { background: var(--s1); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.dr-row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-decoration: none; color: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.dr-row:last-child { border-bottom: 0; }
.dr-row svg { width: 20px; height: 20px; color: var(--muted); }
.dr-row > svg:last-child { width: 16px; height: 16px; }
.dr-row.danger, .dr-row.danger svg { color: var(--red); }
.dr-row .badge { position: static; }
.dr-foot { display: flex; justify-content: space-between; padding: 14px 22px calc(14px + var(--safe-b)); color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.dr-foot span { display: flex; align-items: center; gap: 6px; } .dr-foot svg { width: 16px; height: 16px; color: var(--green); }

.tile { width: 44px; height: 44px; border-radius: 14px; background: var(--s2); color: var(--text); display: grid; place-items: center; flex: none; }
.tile svg { width: 22px; height: 22px; }
.tile.hl { background: var(--lemon); color: #0B0B0B; }

/* tarjeta "hoy" oscura con anillo */
.hero2 { background: #0B0B0B; color: #F6F4EA; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
[data-theme="dark"] .hero2 { background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.08); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--lemon); }
.chip.pend i { animation: blink 1.4s ease-in-out infinite; }
.chip.ok i { background: #5BD66B; }
@keyframes blink { 50% { opacity: .25; } }
.h-date { font-family: var(--display); font-size: 30px; letter-spacing: .02em; margin-top: 12px; line-height: 1; }
.hero2 .big { font-family: var(--display); font-size: clamp(60px, 18vw, 96px); line-height: .85; margin-top: -4px; color: var(--lemon); }
.h-sub { color: rgba(246,244,234,.62); font-size: 14px; margin-top: 4px; }
.h-sub b { color: #F6F4EA; }
.h-foot { font-size: 13px; color: rgba(246,244,234,.62); }
.hero2 .btn { height: 54px; border-radius: 18px; font-weight: 700; font-size: 16px; }
.btn.dark { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #F6F4EA; }
.btn.dark:hover { background: rgba(255,255,255,.12); }
.ring { position: relative; width: 78px; height: 78px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .rb { stroke: rgba(255,255,255,.1); }
.ring .rf { stroke: var(--lemon); stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 17px; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qa { background: var(--s1); border: 1px solid var(--line); border-radius: 20px; padding: 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; transition: transform .15s, box-shadow .2s; animation: rise .45s both; }
.qa:nth-child(2) { animation-delay: .05s; } .qa:nth-child(3) { animation-delay: .1s; } .qa:nth-child(4) { animation-delay: .15s; }
.qa:active { transform: scale(.96); }
.qa:hover { box-shadow: var(--shadow); }
.qa .tile { margin-bottom: 10px; }
.qa .t { font-weight: 700; } .qa .s { color: var(--muted); font-size: 13px; }
.bars .b i { transition: height .7s cubic-bezier(.2,.8,.2,1); }
.alert-warn .tile { background: var(--soft); }
.alert-bad .tile { background: rgba(215,56,31,.12); color: var(--red); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.dr-row .grow, .dr-item .grow, .dr-me .grow { flex: 1; min-width: 0; }
.dr-logo { width: auto; height: 22px; }
a.li { text-decoration: none; color: inherit; }
.dock a { transition: color .25s; }
.dr-head svg.dr-logo { width: 92px !important; height: auto !important; }
.total-bar > div { min-width: 0; }
.total-bar .btn { flex: none; padding: 0 16px; }
@media (max-width: 420px) { .total-bar .num { font-size: 32px; } }
.total-bar #split { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v5.1: filas del shell sin estirarse (el logo bajaba en pantallas vacías) y dock más abajo */
.shell { align-content: start; }
.dock { bottom: max(8px, calc(var(--safe-b) - 16px)); }
.fab { bottom: calc(max(8px, calc(var(--safe-b) - 16px)) + 76px); }
.total-bar { bottom: calc(max(8px, calc(var(--safe-b) - 16px)) + 72px); }
.main { padding-bottom: calc(var(--safe-b) + 110px); }
@media (min-width: 900px) { .fab { bottom: 28px; } .total-bar { bottom: 20px; } .main { padding-bottom: 60px; } }
