/* =====================================================================
   Café · Control — hoja de estilos única
   1 tokens · 2 base · 3 shell · 4 componentes · 5 pantallas · 6 avatares · 7 movimiento
   ===================================================================== */

/* ---------- 1 · tokens ---------- */
:root {
  --bg: #f6f2ec; --bg-2: #efe8df;
  --surface: #fffdfa; --surface-2: #f8f3ec; --surface-3: #f0e8dd;
  --text: #1e1612; --muted: #7c6c60; --faint: #a99b8e;
  --border: #ebe2d6; --border-2: #ddd0c0;
  --brand: #5b3a26; --brand-2: #8a5a3c; --brand-ink: #fff; --brand-soft: #f3e7da;
  --accent: #c0843e; --accent-soft: #f7ead8;
  --ok: #2f7a52; --ok-soft: #e3f1e8;
  --warn: #a8660a; --warn-soft: #fbf0db;
  --err: #b4372b; --err-soft: #fbe8e5;
  --info: #2d6a9c; --info-soft: #e5eef7;
  --amber: #f2b230;
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(48, 30, 16, .05), 0 3px 10px rgba(48, 30, 16, .035);
  --sh-2: 0 14px 34px -14px rgba(48, 30, 16, .28), 0 2px 6px rgba(48, 30, 16, .06);
  --sh-3: 0 30px 70px -20px rgba(30, 18, 8, .45);
  --ring: color-mix(in srgb, var(--brand) 28%, transparent);
  --glass: color-mix(in srgb, var(--bg) 78%, transparent);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --side: 252px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120e0b; --bg-2: #0d0a08; --surface: #1b1512; --surface-2: #221a16; --surface-3: #2a211b;
    --text: #f3ebe3; --muted: #b3a394; --faint: #85776b; --border: #2e251f; --border-2: #3c3029;
    --brand: #d9a273; --brand-2: #e8b98d; --brand-ink: #1a120d; --brand-soft: #33251b;
    --accent: #e3a95f; --accent-soft: #3a2a17;
    --ok: #74d19c; --ok-soft: #15291e; --warn: #f1bd62; --warn-soft: #33270f;
    --err: #f2897e; --err-soft: #3a1c19; --info: #8fbde9; --info-soft: #16273a;
    --sh-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 2px 10px rgba(0, 0, 0, .25);
    --sh-2: 0 18px 40px -16px rgba(0, 0, 0, .7); --sh-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #120e0b; --bg-2: #0d0a08; --surface: #1b1512; --surface-2: #221a16; --surface-3: #2a211b;
  --text: #f3ebe3; --muted: #b3a394; --faint: #85776b; --border: #2e251f; --border-2: #3c3029;
  --brand: #d9a273; --brand-2: #e8b98d; --brand-ink: #1a120d; --brand-soft: #33251b;
  --accent: #e3a95f; --accent-soft: #3a2a17;
  --ok: #74d19c; --ok-soft: #15291e; --warn: #f1bd62; --warn-soft: #33270f;
  --err: #f2897e; --err-soft: #3a1c19; --info: #8fbde9; --info-soft: #16273a;
  --sh-1: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 2px 10px rgba(0, 0, 0, .25);
  --sh-2: 0 18px 40px -16px rgba(0, 0, 0, .7); --sh-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- 2 · base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
  transition: background .4s var(--ease), color .4s var(--ease);
}
h1 { font: 600 30px/1.1 var(--serif); margin: 0; letter-spacing: -.02em; font-variation-settings: "opsz" 96; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 8px; }
a { color: var(--brand); }
::selection { background: var(--brand-soft); color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.brand-t { color: var(--brand); }
.warn-t { color: var(--warn); }
.neg-t { color: var(--err); }
.ava-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 3 · shell: menú lateral (escritorio) · barra inferior (celular) ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 20;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 18px;
  background: var(--bg-2); border-right: 1px solid var(--border);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side-brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.side-brand small, .side-user small { display: block; color: var(--muted); font-size: 12px; }
.brand-dot {
  width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--brand-2), var(--brand));
  box-shadow: 0 6px 14px -6px var(--brand), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nav-side { display: grid; gap: 2px; }
.nav a {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--muted);
  font-weight: 550; font-size: 14px; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background .25s var(--ease), color .25s var(--ease), transform .2s var(--ease);
}
.nav a svg { flex: none; opacity: .8; transition: transform .35s var(--spring), opacity .2s; }
.nav-side a:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
.nav-side a:hover svg { transform: translateX(2px); }
.nav-side a.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.nav-side a.on svg { color: var(--brand); opacity: 1; }
.nav-side a.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); animation: barra .35s var(--ease); }
@keyframes barra { from { transform: scaleY(0); } }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side-user b { font-size: 14px; }
.side-ava { width: 42px; height: 42px; flex: none; }
.side-tools { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.side-tools .btn { margin-left: auto; }
.icon-btn {
  position: relative; overflow: hidden; border: 1px solid var(--border); background: var(--surface);
  border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 14px; color: var(--text);
  display: grid; place-items: center; transition: transform .2s var(--spring), border-color .2s;
}
.icon-btn:hover { border-color: var(--border-2); transform: rotate(-8deg); }

.top { display: none; }
.tabbar { display: none; }
main { margin-left: var(--side); padding: 34px 44px 90px; max-width: calc(1320px + var(--side)); }
@media (min-width: 1024px) and (max-width: 1240px) { main { padding-left: 28px; padding-right: 28px; } }

@media (max-width: 1023px) {
  .side { display: none; }
  .top {
    position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
  .brand .brand-dot { width: 30px; height: 30px; border-radius: 10px; }
  .who { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  .who-ava { width: 32px; height: 32px; display: inline-block; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 2px;
    padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar a { flex: 1 0 auto; min-width: 68px; flex-direction: column; gap: 3px; padding: 7px 8px; font-size: 11px; border-radius: 12px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--brand); background: var(--brand-soft); }
  .tabbar a.on svg { transform: translateY(-1px) scale(1.08); }
  main { margin-left: 0; padding: 20px 16px 110px; }
}
@media (max-width: 420px) { .brand > span:last-child { display: none; } .who { gap: 6px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; justify-content: space-between; margin-bottom: 22px; }
.page-head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.vivo { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: vivo 2.2s ease-out infinite; }
@keyframes vivo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.sec-t { font-weight: 650; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; display: flex; align-items: baseline; gap: 8px; }
.ana-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 52px 0 16px; padding-top: 30px; border-top: 1px solid var(--border); }

/* ---------- 4 · componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; box-shadow: var(--sh-1); margin-bottom: 16px;
  transition: box-shadow .3s var(--ease), border-color .3s, background .4s var(--ease);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 16px; }
.grid2 > .card { margin-bottom: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis-g3, .kpis-g4 { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.kpi {
  position: relative; display: flex; flex-direction: column; text-align: left; color: inherit; text-decoration: none; font: inherit; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1);
}
.kpi .lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .val { font-size: 25px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi .det { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; }
.kpi.click { cursor: pointer; }
.kpi .go { position: absolute; right: 14px; top: 12px; font-size: 20px; opacity: .3; transition: transform .25s var(--ease), opacity .25s; }
.kpi.click:hover { border-color: var(--border-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.kpi.click:hover .go { opacity: .8; transform: translateX(3px); }
.kpi.hl { background: radial-gradient(120% 140% at 0% 0%, var(--brand-2), var(--brand)); color: var(--brand-ink); border-color: transparent; }
.kpi.hl .lbl, .kpi.hl .sub, .kpi.hl .bar2-l { color: inherit; opacity: .82; }
.kpi.hl .det { border-color: rgba(255, 255, 255, .22); }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 72%); }
.kpi.ok .val { color: var(--ok); }
.kpi.bad { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
.kpi.bad .val { color: var(--err); }
.info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-size: 10px; cursor: help; text-transform: none; vertical-align: 1px; }

/* Héroe: los 4 números del día */
.hero { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 1180px) { .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; } }
.hero-k {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); color: inherit; text-decoration: none; min-width: 0;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
a.hero-k:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--border-2); }
.hero-k .hk-l { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.hero-k > b { font-size: 32px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-k .hk-s { font-size: 12.5px; color: var(--muted); }
.hero-k .bar2 { margin-top: 10px; }
.hero-k .desg { margin-top: 10px; }
.hero-k.hl {
  color: var(--brand-ink); border-color: transparent; overflow: hidden;
  background: radial-gradient(140% 120% at 0% 0%, var(--brand-2) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 80%, #000) 100%);
  box-shadow: 0 20px 40px -18px var(--brand);
}
.hero-k.hl::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.hero-k.hl .hk-l, .hero-k.hl .hk-s, .hero-k.hl .bar2-l { color: inherit; opacity: .8; }
.hero-k.bad b { color: var(--err); }

/* Pendientes */
.pend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.pend-i {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 10px 34px 10px 12px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); text-decoration: none; font-size: 13.5px; font-weight: 550;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); transition: transform .25s var(--spring), box-shadow .25s;
}
.pend-i:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -12px var(--warn); }
.pend-i b { color: var(--text); font-variant-numeric: tabular-nums; }
.pend-i .go { position: absolute; right: 14px; font-size: 18px; opacity: .6; }
.pend-e { font-size: 15px; }
.pend-ok { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13.5px; font-weight: 550; }

/* Pestañas con indicador que se desliza */
.tabs {
  position: relative; display: flex; gap: 2px; margin: 0 0 18px; padding: 4px; width: max-content; max-width: 100%;
  background: var(--surface-3); border-radius: 14px; overflow-x: auto; scrollbar-width: none; isolation: isolate;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; z-index: 1; overflow: hidden; font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; cursor: pointer;
  padding: 8px 16px; border-radius: 10px; color: var(--muted); white-space: nowrap; transition: color .25s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs-ind {
  position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 10px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(48, 30, 16, .1), 0 4px 12px -4px rgba(48, 30, 16, .12);
  transition: transform .45s var(--spring), width .45s var(--spring);
}
.tab-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; }

/* Tablas */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 700; border-top: 1.5px solid var(--border-2); border-bottom: 0; }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl tr.anul { opacity: .5; }
.tbl.ped td { vertical-align: top; }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.field > .seg, .field > .chips { justify-self: start; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 44px;
  transition: border-color .2s, box-shadow .25s var(--ease), background .3s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--border-2)); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
input[type=number] { font-variant-numeric: tabular-nums; }
.input-big { font-size: 24px; font-weight: 650; min-height: 56px; letter-spacing: -.02em; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); box-shadow: none; }

/* Botones */
.btn, .tile, .chip, .seg button, .ava-pick, .kpi.click, .pick, .stk, .stk-c {
  position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), border-color .2s, background .25s, color .2s, opacity .2s;
}
.btn {
  font: inherit; font-weight: 600; font-size: 14px; border-radius: 12px; padding: 9px 15px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border-2)); box-shadow: var(--sh-1); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: var(--brand-ink); border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 18px -10px var(--brand);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 12px 24px -10px var(--brand); border-color: transparent; }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-sm { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 12px 24px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:active:not(:disabled), .tile:active:not(:disabled), .chip:active:not(:disabled), .pick:active:not(:disabled), .ava-pick:active, .kpi.click:active, .stk-c:active:not(:disabled) { transform: scale(.96); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); }
.seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(48, 30, 16, .12); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.seg-sm button { padding: 5px 11px; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.chip-static { cursor: default; }

/* Tiles (opciones grandes) */
.tiles { display: grid; gap: 10px; }
.tiles-2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tiles-3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tiles-prod { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.tile {
  font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px;
  padding: 15px 12px; cursor: pointer; display: grid; justify-items: center; text-align: center; gap: 3px;
}
.tile:hover:not(:disabled) { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--sh-2); }
.tile.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px var(--ring); }
.tile.on .tile-e { animation: bump .45s var(--spring); }
.tile:disabled { opacity: .45; cursor: not-allowed; }
.tile-e { font-size: 26px; line-height: 1.1; }
.tile-t { font-weight: 650; font-size: 15px; }
.tile-s { font-size: 12px; color: var(--muted); }
.tile-sm { padding: 10px; border-radius: 14px; }
.tile-sm .tile-e { font-size: 20px; }
.tile-sm .tile-t { font-size: 13.5px; }
.acciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin-bottom: 22px; }
.acciones .tile { background: var(--surface); }
.acciones .tile-s { font-size: 11px; }

/* Insignias y avisos */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.b-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.b-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.b-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.b-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-err { background: var(--err-soft); color: var(--err); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--info-soft); color: var(--info); }
.promo-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; color: #fff; border-radius: var(--r);
  padding: 14px 18px; margin-bottom: 18px; font-weight: 550; background: linear-gradient(100deg, var(--accent), #9c5b2a 60%, var(--brand));
  box-shadow: 0 14px 30px -18px var(--accent);
}
.promo-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-100%); animation: brillo 4.5s ease-in-out infinite; }
@keyframes brillo { 60%, 100% { transform: translateX(100%); } }
.promo-tag { background: #fff; color: #7a4520; font-weight: 800; border-radius: 10px; padding: 4px 10px; font-size: 18px; animation: bump 2.4s var(--spring) infinite; }

/* Barras */
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; transform-origin: left; animation: crecex 1s var(--ease) both; }
.bar-lg { height: 10px; margin: 8px 0 5px; }
.bar2 { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--info); }
.bar2 i { background: var(--ok); transform-origin: left; animation: crecex 1s var(--ease) both; }
.hl .bar2 { background: rgba(255, 255, 255, .25); }
.hl .bar2 i { background: rgba(255, 255, 255, .85); }
.bar2-l { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-a { background: var(--ok); } .dot-b { background: var(--info); }
.hl .dot-a { background: rgba(255, 255, 255, .9); } .hl .dot-b { background: rgba(255, 255, 255, .35); }
@keyframes crecex { from { transform: scaleX(0); } }
@keyframes creceY { from { transform: scaleY(0); } }

/* Desglose por vendedor */
.desg { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.desg-i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.mini-ava { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; vertical-align: middle; }
.mini-of { background: var(--surface-3); font-size: 14px; }
.pv-i { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.pv-i .mini-ava { width: 20px; height: 20px; margin-right: 6px; display: inline-block; }
.foco { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; flex: none; }
.foco-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft), 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent); }
.foco-am { background: var(--amber); box-shadow: 0 0 0 3px var(--warn-soft), 0 0 8px var(--amber); animation: latir 1.6s ease-in-out infinite; }
@keyframes latir { 50% { box-shadow: 0 0 0 6px var(--warn-soft), 0 0 16px var(--amber); } }

/* Ranking */
.rank { display: grid; gap: 12px; }
.rank-i { display: flex; gap: 12px; align-items: flex-start; }
.rank-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.rank-i:first-child .rank-n { background: linear-gradient(135deg, var(--accent), var(--brand-2)); color: #fff; }
.rank-b { flex: 1; min-width: 0; }
.rank-t { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 4px; }

/* Cascada de utilidad */
.wf { display: grid; gap: 2px; }
.wf-r { display: grid; grid-template-columns: minmax(160px, 1.2fr) 2fr auto; gap: 14px; align-items: center; padding: 8px 0; }
.wf-l { font-size: 14px; }
.wf-ex { font-size: 12px; color: var(--muted); }
.wf-bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.wf-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transform-origin: left; animation: crecex 1.1s var(--ease) both; }
.wf-r:nth-child(2) .wf-bar i { animation-delay: .06s; } .wf-r:nth-child(3) .wf-bar i { animation-delay: .12s; } .wf-r:nth-child(4) .wf-bar i { animation-delay: .18s; }
.wf-r:nth-child(5) .wf-bar i { animation-delay: .24s; } .wf-r:nth-child(6) .wf-bar i { animation-delay: .3s; } .wf-r:nth-child(n+7) .wf-bar i { animation-delay: .36s; }
.wf-neg .wf-bar i { background: var(--err); opacity: .65; }
.wf-pos .wf-bar i { background: var(--ok); opacity: .75; }
.wf-n { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 92px; }
.wf-neg .wf-n { color: var(--err); }
.wf-sub { border-top: 1px dashed var(--border); }
.wf-sub .wf-l, .wf-tot .wf-l { font-weight: 700; }
.wf-tot { border-top: 1.5px solid var(--border-2); margin-top: 4px; }
.wf-tot .wf-n { font-size: 22px; color: var(--ok); letter-spacing: -.02em; }
.wf-tot .wf-bar i { background: var(--ok); }
@media (max-width: 560px) { .wf-r { grid-template-columns: 1fr auto; } .wf-bar { grid-column: 1 / -1; order: 3; } }

/* Gastos */
.gcat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.gcat-h { display: flex; justify-content: space-between; margin-bottom: 6px; }
.gcat-i { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; border-top: 1px dashed var(--border); }
.gbars { display: grid; gap: 12px; }
.gbar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.gtot { display: flex; justify-content: space-between; border-top: 1.5px solid var(--border-2); margin-top: 14px; padding-top: 10px; }

/* Selector de opciones (personas, cuentas) */
.pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { font: inherit; display: grid; justify-items: center; gap: 3px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; min-width: 104px; color: var(--text); font-weight: 600; }
.pick:hover:not(:disabled) { border-color: var(--border-2); transform: translateY(-1px); }
.pick small { font-weight: 400; color: var(--muted); }
.pick .mini-ava { width: 38px; height: 38px; }
.pick.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px var(--ring); }
.pick:disabled { opacity: .45; cursor: not-allowed; }

/* Interruptor */
.sw { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; min-height: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .3s var(--ease); }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .4s var(--spring), width .2s; }
.sw input:active + i::after { width: 24px; }
.sw input:checked + i { background: var(--ok); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:checked:active + i::after { transform: translateX(14px); }
.sw input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Modal */
dialog#modal {
  border: 1px solid var(--border); border-radius: 22px; padding: 0; width: min(540px, calc(100vw - 28px));
  background: var(--surface); color: var(--text); box-shadow: var(--sh-3);
}
dialog#modal.wide { width: min(780px, calc(100vw - 28px)); }
dialog#modal::backdrop { background: rgba(24, 15, 9, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog#modal[open] { animation: modalIn .38s var(--spring); }
dialog#modal[open]::backdrop { animation: fundido .3s ease; }
dialog#modal.cerrando { animation: modalOut .18s ease-in forwards; }
dialog#modal.cerrando::backdrop { animation: fundido .18s ease-in reverse forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fundido { from { opacity: 0; } }
.modal-body { position: relative; padding: 26px; max-height: calc(100vh - 60px); overflow-y: auto; }
.modal-body h2 { margin-bottom: 4px; font-size: 19px; padding-right: 30px; }
.modal-body form { display: grid; gap: 15px; margin-top: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.modal-x { position: absolute; top: 16px; right: 16px; border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--muted); transition: transform .3s var(--spring), background .2s; }
.modal-x:hover { transform: rotate(90deg); background: var(--surface-3); color: var(--text); }

/* Avisos (toasts) */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
@media (max-width: 1023px) { #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.toast {
  display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg);
  padding: 11px 16px 11px 11px; border-radius: 14px; font-size: 14px; box-shadow: var(--sh-3); cursor: pointer;
  backdrop-filter: blur(10px); animation: toastIn .45s var(--spring);
}
.toast-i { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--ok); color: #fff; }
.toast.err { background: var(--err); color: #fff; }
.toast.err .toast-i { background: rgba(255, 255, 255, .25); }
.toast.out { animation: toastOut .26s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* Desplegables */
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .3s var(--spring); font-weight: 700; color: var(--brand); }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold[open] > summary { margin-bottom: 12px; }
details.ajuste { margin-top: 12px; }
details.ajuste summary, details.mas summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
details.mas { margin-top: 10px; }
details.mas summary { font-size: 13px; color: var(--muted); }
details[open] > :not(summary) { animation: panelIn .35s var(--ease); }

/* ---------- 5 · pantallas ---------- */

/* Login */
.login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.login-fondo { position: absolute; inset: 0; pointer-events: none; }
.login-fondo i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: flota 16s ease-in-out infinite; }
.login-fondo i:nth-child(1) { width: 420px; height: 420px; left: -80px; top: -60px; background: var(--accent-soft); }
.login-fondo i:nth-child(2) { width: 360px; height: 360px; right: -60px; bottom: -40px; background: var(--brand-soft); animation-delay: -5s; }
.login-fondo i:nth-child(3) { width: 260px; height: 260px; left: 45%; top: 55%; background: color-mix(in srgb, var(--accent) 22%, transparent); animation-delay: -10s; }
@keyframes flota { 50% { transform: translate(40px, -30px) scale(1.12); } }
.login-card { position: relative; width: 100%; max-width: 390px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 26px; padding: 32px; box-shadow: var(--sh-3); }
.login-logo { width: 56px; height: 56px; border-radius: 18px; background: radial-gradient(circle at 30% 25%, var(--brand-2), var(--brand)); display: grid; place-items: center; margin-bottom: 18px; box-shadow: 0 12px 24px -10px var(--brand); animation: bump 3s var(--spring) infinite; }
.login-card h1 { margin-bottom: 6px; }
.login-card form { margin-top: 22px; display: grid; gap: 14px; }

/* Ventas */
.ventas-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.ventas-grid > .card, #lado .card { margin-bottom: 16px; }
#lado { position: sticky; top: 24px; }
@media (max-width: 1100px) { .ventas-grid { grid-template-columns: 1fr; } #lado { position: static; } }
.paso { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--border); }
.paso:last-of-type { border-bottom: 0; }
.paso-n { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; box-shadow: 0 6px 12px -6px var(--brand); }
.paso-b { min-width: 0; }
.paso-t { font-weight: 650; margin: 4px 0 12px; }
.cobrar {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 8px -20px -20px; padding: 16px 20px; z-index: 2; border-radius: 0 0 var(--r) var(--r);
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border);
}
@media (max-width: 1023px) { .cobrar { bottom: calc(70px + env(safe-area-inset-bottom)); } }
.cobrar .big { font-size: 32px; font-weight: 750; font-variant-numeric: tabular-nums; display: inline-block; letter-spacing: -.03em; }
.seg-alert { text-align: center; }
.seg-alert ul { text-align: left; margin: 10px 0; }
.seg-ico { font-size: 46px; animation: bump 1.4s var(--spring) infinite; }
.big-chk { justify-content: center; padding: 13px; margin-top: 10px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-weight: 700; width: 100%; }
.cart { margin-top: 10px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.cart-l { display: grid; grid-template-columns: 1fr auto 84px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px dashed var(--border); }
.cart-l:last-child { border: 0; }
.cart-s { text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 99px; overflow: hidden; background: var(--surface); }
.qty button { border: 0; background: var(--surface-2); width: 32px; height: 32px; font-size: 18px; cursor: pointer; color: var(--text); transition: background .2s; }
.qty button:hover { background: var(--brand-soft); }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.lado-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.lado-ava { width: 54px; height: 54px; flex: none; display: inline-block; }
.hero-n { font-size: 38px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mk { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 11px; display: grid; gap: 1px; }
.mk.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.mk-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.mk.warn .mk-l, .mk.warn .mk-s { color: inherit; }
.mk b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mk-s { font-size: 11px; color: var(--muted); }
.top-p { margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--brand-soft); font-size: 14px; }
.ue { margin-top: 14px; }
.ped-tot { margin-bottom: 10px; }
.venta { border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; margin-bottom: 10px; background: var(--surface); }
.venta.anulada { opacity: .55; }
.venta.anulada .total { text-decoration: line-through; }
.venta.pend { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.venta-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.venta-top .total { margin-left: auto; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.venta ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.venta-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.cmp { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cmp-i { position: relative; border: 1px solid var(--border); border-radius: 20px; padding: 18px 16px 14px; display: grid; justify-items: center; text-align: center; gap: 4px; background: var(--surface); }
.cmp-i.lider { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 60%); }
.cmp-i .bar2, .cmp-i .bar2-l { width: 100%; }
.corona { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 26px; animation: corona 2.6s ease-in-out infinite; }
@keyframes corona { 50% { transform: translateX(-50%) translateY(-4px) rotate(-6deg); } }
.cmp-ava { width: 72px; height: 72px; margin-top: 8px; display: inline-block; }
.cmp-n { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.cmp-r { display: flex; justify-content: space-between; width: 100%; font-size: 13px; padding: 5px 0; border-top: 1px dashed var(--border); gap: 8px; }
.cmp-r span { color: var(--muted); }
.cmp-r b { text-align: right; }
.hola { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), var(--surface) 60%); }
.hola > div { flex: 1; min-width: 180px; }
.hola-ava { width: 86px; height: 86px; display: inline-block; flex: none; }
.pp-vend { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 80%); }

/* Cuadritos de stock que se arrastran */
.stks { display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 12px; align-items: end; }
.stk-w { display: grid; gap: 6px; align-content: end; }
.stk-cs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.stk-c {
  font: inherit; display: grid; justify-items: center; gap: 0; padding: 6px 4px; border-radius: 12px; line-height: 1.15;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: grab; user-select: none;
}
.stk-c b { font-size: 12px; }
.stk-c span { font-size: 10px; font-weight: 500; color: var(--muted); }
.stk-c.promo:not(:disabled) { background: linear-gradient(135deg, var(--accent), var(--brand)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.stk-c.promo:not(:disabled) span { color: inherit; opacity: .85; }
.stk-c:disabled { opacity: .45; cursor: not-allowed; }
.stk {
  display: grid; justify-items: start; gap: 1px; padding: 13px 13px 11px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--surface), var(--surface-2)); cursor: grab; user-select: none; touch-action: manipulation;
  box-shadow: 0 1px 0 var(--border), var(--sh-1);
}
@media (hover: hover) {
  .stk:hover { transform: translateY(-4px) rotate(-1.2deg); box-shadow: var(--sh-2); border-color: var(--border-2); }
  .stk-c:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--sh-2); }
}
.stk:active { cursor: grabbing; transform: scale(.96); }
.stk:focus-visible { outline: 3px solid var(--ring); }
.stk::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--cat, #8a5a3c); }
.stk-cafe, .mstk-i.stk-cafe { --cat: #8a5a3c; }
.stk-premium, .mstk-i.stk-premium { --cat: #c0843e; }
.stk-capsula, .mstk-i.stk-capsula { --cat: #b06a3b; }
.stk-filtro, .mstk-i.stk-filtro { --cat: #c9b79c; }
.stk-otro, .mstk-i.stk-otro { --cat: #7c8a8f; }
.stk-ico { position: absolute; top: 11px; right: 11px; font-size: 22px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15)); transition: transform .35s var(--spring); }
@media (hover: hover) { .stk:hover .stk-ico { transform: rotate(-12deg) scale(1.15); } }
.stk-n { font-size: 32px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; color: var(--brand); letter-spacing: -.03em; }
.stk-sku { font-weight: 700; font-size: 14px; margin-top: 5px; }
.stk-p { font-size: 12px; color: var(--muted); }
.stk-pr { font-size: 13px; font-weight: 600; }
.stk.agotado { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.6); }
.stk.agotado .stk-n { color: var(--muted); }
.stk.levantado { opacity: .3; transform: scale(.94); }
.stk.niega { animation: niega .4s ease; }
@keyframes niega { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.stk-menos { position: absolute; top: 6px; left: 50%; font-weight: 800; color: var(--err); pointer-events: none; animation: subir .8s var(--ease) forwards; }
@keyframes subir { from { opacity: 1; transform: translate(-50%, 0) scale(1.2); } to { opacity: 0; transform: translate(-50%, -30px) scale(.9); } }
.stk-ghost, .stk-fly {
  position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 0;
  padding: 10px 15px; border-radius: 15px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: var(--brand-ink);
  box-shadow: 0 18px 36px -10px rgba(0, 0, 0, .45); font-size: 13px;
}
.stk-ghost { transform: translate(-50%, -50%) rotate(-6deg) scale(1.06); }
.stk-ghost span, .stk-fly span { font-size: 11px; opacity: .85; }
body.arrastrando, body.arrastrando * { cursor: grabbing !important; user-select: none; }
.cesta { margin-top: 14px; border: 1.5px dashed var(--border-2); border-radius: 18px; padding: 13px; transition: border-color .25s, background .25s, transform .3s var(--spring), box-shadow .3s; }
.cesta.llena { border-style: solid; border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: var(--surface-2); }
body.arrastrando .cesta { border-color: var(--accent); background: var(--accent-soft); }
.cesta.sobre { transform: scale(1.025); border-color: var(--brand) !important; box-shadow: 0 0 0 6px var(--ring); }
.cesta-h { display: flex; align-items: center; gap: 12px; }
.cesta-ico { position: relative; font-size: 30px; line-height: 1; display: inline-block; }
.cesta-ico i { position: absolute; top: -6px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; animation: pop .35s var(--spring); }
.cesta-ico.trago { animation: trago .55s var(--spring); }
@keyframes trago { 30% { transform: scale(1.35) rotate(-10deg); } 60% { transform: scale(.9) rotate(6deg); } }

/* Tablero del vendedor */
.dash { margin-bottom: 16px; }
.dash .card-head h2 { display: flex; align-items: center; gap: 10px; }
.dash-ava { width: 36px; height: 36px; display: inline-block; flex: none; }
.dk { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1280px) { .dk { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dk-i { display: grid; gap: 2px; padding: 13px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.dk-i.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: linear-gradient(180deg, var(--warn-soft), var(--surface-2)); }
.dk-ef { background: radial-gradient(130% 130% at 0% 0%, var(--brand-2), var(--brand)); color: var(--brand-ink); border-color: transparent; }
.dk-ef .dk-l, .dk-ef .dk-s { color: inherit; opacity: .8; }
.dk-e { font-size: 20px; }
.dk-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.dk-i b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dk-s { font-size: 12px; color: var(--muted); }
.dash-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .dash-g { grid-template-columns: 1fr; } }
.dash-b { padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.dash-t { font-weight: 650; font-size: 14px; margin-bottom: 10px; }
.mstk { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.mstk-i { position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center; padding: 10px 6px 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.mstk-i::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--cat, #8a5a3c); }
.mstk-e { font-size: 18px; }
.mstk-i b { font-size: 22px; color: var(--brand); line-height: 1.1; }
.mstk-s { font-size: 12px; font-weight: 700; }
.mstk-p, .mstk-v { font-size: 11px; color: var(--muted); }
.rec { display: grid; gap: 5px; }
.rec-i { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); }
.rec-f { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pico { font-size: 14px; margin-bottom: 10px; }
.hbars, .sbars { display: flex; align-items: flex-end; gap: 3px; height: 92px; }
.hb, .sb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.hb i, .sb i { display: block; width: 100%; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--brand-soft); transform-origin: bottom; animation: creceY .9s var(--ease) both; }
.hb:nth-child(odd) i, .sb:nth-child(odd) i { animation-delay: .05s; }
.hb.top i { background: linear-gradient(180deg, var(--accent), var(--brand-2)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.hb span { position: absolute; bottom: -17px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.hbars { margin-bottom: 20px; }
.sbars { height: 58px; }
.sb i { background: var(--brand); opacity: .45; }
.sb.hoy i { opacity: 1; background: linear-gradient(180deg, var(--accent), var(--brand-2)); }
.trl { display: grid; gap: 6px; }
.tr-i { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); transition: border-color .3s, background .3s; }
.tr-i.pend { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }

/* Caja y banco */
.saldo-card { position: relative; }
.saldo-l { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.saldo { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.035em; margin: 2px 0; }
.holders { display: grid; gap: 6px; margin-top: 14px; }
.holder { display: grid; grid-template-columns: 28px 1fr auto 92px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.holder .mini-ava { width: 28px; height: 28px; }
.holder > :last-child { justify-self: end; }
.pv-link { display: block; margin-top: 12px; padding: 11px 13px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); text-decoration: none; border: 0; font: inherit; font-weight: 600; width: 100%; text-align: left; cursor: pointer; transition: transform .25s var(--spring); }
.pv-link:hover { transform: translateX(3px); }
.pv-link.deuda { background: var(--brand-soft); color: var(--brand); }
.pv-ok { margin-top: 12px; color: var(--ok); font-weight: 600; font-size: 14px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 16px; }
.vgrid > .card { margin: 0; }
.vcard-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.vrow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.vrow.sub { font-size: 12px; color: var(--muted); padding-left: 22px; }
.vrow.warn { color: var(--warn); }
.vrow.tot { border: 0; margin-top: 6px; padding: 10px 12px; background: var(--brand-soft); border-radius: 12px; color: var(--brand); }
.vrow.tot.debe { background: var(--warn-soft); color: var(--warn); }
.deuda { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.deuda:last-child { border: 0; }
.deuda.pagada { opacity: .6; }
.deuda-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bk { margin-top: 14px; display: grid; gap: 5px; font-size: 14px; }
.bk-h, .bk-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(76px, auto) minmax(76px, auto); gap: 8px; align-items: center; }
.bk-h { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 10px; }
.bk-h span:not(:first-child), .bk-r b { text-align: right; }
.bk-r { padding: 7px 10px; border-radius: 12px; background: var(--surface-2); }
.bk-r > span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-r .mini-ava { width: 24px; height: 24px; }
.bk-r b small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.bq { display: grid; gap: 2px; font-size: 13.5px; }
.bq-r { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.bq-r i { font-style: normal; color: var(--muted); font-size: 11px; }
.bq-r.pos b { color: var(--ok); }
.bq-r.neg b { color: var(--err); }
.bq-r.ini { color: var(--muted); }
.bq-r.fin { border-top: 1.5px solid var(--border-2); margin-top: 4px; padding-top: 7px; font-weight: 700; }
.bq-wrap { margin-top: 14px; }
.leyenda { display: grid; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.porpagar.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.pp-list { display: grid; gap: 8px; }
.pp { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 14px; background: var(--surface-2); }
.pp .mini-ava { width: 36px; height: 36px; }
.pp.ok { opacity: .62; }
.pp-m { font-size: 19px; font-variant-numeric: tabular-nums; }
.pp:not(.ok) .pp-m { color: var(--warn); }
.pp-b { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pp-hecho { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.pp-hecho b { color: var(--text); }
@media (max-width: 640px) {
  .pp { grid-template-columns: 36px 1fr auto; }
  .pp-b { grid-column: 1 / -1; justify-content: stretch; }
  .pp-b .btn { flex: 1; }
  .holder { grid-template-columns: 28px 1fr auto auto; }
}

/* Gráfica de ventas */
.gser { display: flex; align-items: flex-end; gap: 5px; height: 180px; padding-bottom: 22px; overflow-x: auto; }
.gs { flex: 1 0 18px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 18px; }
.gs b { font-size: 9px; color: var(--muted); font-weight: 600; margin-bottom: 3px; white-space: nowrap; }
.gs i { position: relative; display: block; width: 100%; max-width: 34px; min-height: 2px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); overflow: hidden; transform-origin: bottom; animation: creceY 1s var(--ease) both; transition: filter .2s; }
.gs:hover i { filter: brightness(1.15); }
.gs i u { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); opacity: .9; }
.gs.top i { box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 60%, transparent); }
.gs span { position: absolute; bottom: -19px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.ley-c { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

/* Almacén */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--sh-1); display: grid; gap: 6px; transition: transform .3s var(--ease), box-shadow .3s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.pcard.bajo { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.pcard.bajo .bar i { background: var(--warn); }
.pcard-h { display: flex; gap: 10px; align-items: flex-start; }
.pcard-h > div { flex: 1; min-width: 0; }
.pcard-e { font-size: 21px; width: 40px; height: 40px; border-radius: 13px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.pcard-n { font-size: 27px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.pcard-s { min-height: 1.4em; }
.pcard-a { display: flex; gap: 6px; margin-top: 6px; }
.pcard-a .btn { flex: 1; }
.pres-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pres { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); display: grid; gap: 6px; transition: border-color .25s, background .25s; }
.pres.on { border-color: var(--brand); background: var(--brand-soft); }
.pres .t { font-weight: 700; }
.pres .s { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.calc > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.calc .l { font-size: 12px; color: var(--muted); }
.calc .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.sol-card { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.sols { display: grid; gap: 8px; }
.sol { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; transition: background .25s, box-shadow .25s; }
.sol.on { background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.sol .mini-ava { width: 36px; height: 36px; }
.sol-b { flex: 1; min-width: 180px; font-size: 14px; }
.emp-list { display: grid; gap: 8px; }
.emp-i { display: flex; gap: 10px; align-items: center; padding: 11px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.emp-i > div { flex: 1; min-width: 140px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: var(--surface-2); min-width: 40px; font: inherit; font-weight: 700; cursor: pointer; color: var(--text); transition: background .2s; }
.stepper button:hover { background: var(--brand-soft); }
.stepper input { border: 0; border-radius: 0; width: 80px; text-align: center; font-weight: 700; font-size: 17px; box-shadow: none; }
.stepper-sm input { width: 60px; min-height: 36px; font-size: 15px; }
.stepper-sm button { min-width: 34px; }
.gauge { height: 14px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 14px; }
.gauge i { display: block; height: 100%; background: var(--warn); transition: width .5s var(--spring), background .3s; }
.gauge.full i { background: var(--ok); }
.gauge.over i { background: var(--err); }

/* Precios y usuarios */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cfg { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 15px; box-shadow: var(--sh-1); }
.cfg-e { font-size: 24px; }
.cfg-t { font-weight: 700; }
.cfg-d { font-size: 12px; color: var(--muted); min-height: 2.6em; }
.money-in { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); padding-left: 10px; transition: box-shadow .3s, border-color .3s; }
.money-in > span { color: var(--muted); font-weight: 600; }
.money-in input { border: 0; width: 110px; font-weight: 700; text-align: right; min-height: 38px; box-shadow: none !important; }
.money-in:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.ok.money-in, .cfg.ok .money-in, .chk.ok { animation: okflash 1s ease; }
@keyframes okflash { 0% { box-shadow: 0 0 0 0 var(--ok); border-color: var(--ok); } 30% { box-shadow: 0 0 0 5px var(--ok-soft); border-color: var(--ok); } }
.precios { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.precios > .card { margin: 0; }
.pr-card.inactivo { opacity: .6; }
.pr-h { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pr-rows { display: grid; }
.pr-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pr-row:last-child { border: 0; }
.pr-row.off { opacity: .45; }
.mas-pr { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ugrid > .card { margin: 0; display: grid; gap: 10px; }
.ugrid .btn { justify-self: start; }

/* Rango de fechas */
.rango { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rango select, .rango input { width: auto; min-height: 34px; padding: 5px 10px; font-size: 13px; border-radius: 10px; }

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .card { padding: 16px; border-radius: 14px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .kpi .val { font-size: 20px; }
  .hero-k > b { font-size: 28px; }
  .saldo { font-size: 30px; }
  .cobrar { margin: 8px -16px -16px; padding: 14px 16px; }
  .cobrar .big { font-size: 26px; }
  .hero-n { font-size: 32px; }
  .ava-wrap { width: 72px !important; height: 72px !important; }
  .ava-pick { padding: 12px 8px 10px; }
}

@media (max-width: 560px) {
  .tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tiles-3 .tile { padding: 10px 4px; border-radius: 14px; }
  .tiles-3 .tile-e { font-size: 21px; }
  .tiles-3 .tile-t { font-size: 12.5px; line-height: 1.2; }
  .tiles-3 .tile-s { font-size: 10.5px; line-height: 1.2; }
  .paso { grid-template-columns: 26px 1fr; gap: 10px; }
  .stks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stk { padding: 11px 10px 9px; border-radius: 16px; }
  .stk-n { font-size: 26px; }
  .stk-ico { font-size: 18px; top: 9px; right: 9px; }
  .stk-cs { gap: 4px; }
  .stk-c { padding: 5px 2px; border-radius: 10px; }
  .stk-c b { font-size: 10.5px; }
  .stk-c span { font-size: 9px; }
  .paso-n { width: 26px; height: 26px; font-size: 13px; }
}

/* ---------- 6 · avatares vivos (3D) ---------- */
.ava { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.ava-row { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.ava-pick {
  font: inherit; color: var(--text); flex: 1 1 170px; max-width: 270px; display: grid; justify-items: center; gap: 4px;
  padding: 18px 12px 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); cursor: pointer; box-shadow: var(--sh-1);
}
.ava-pick:hover { border-color: var(--border-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.ava-pick.on { border-color: var(--brand); background: radial-gradient(120% 100% at 50% 0%, var(--brand-soft), var(--surface) 75%); box-shadow: 0 0 0 4px var(--ring), var(--sh-2); }
.ava-wrap { width: 92px; height: 92px; display: block; transition: transform .4s var(--spring); }
.ava-pick.on .ava-wrap { transform: scale(1.06); }
.ava-name { font-weight: 700; font-size: 17px; }
.ava-sub { font-size: 12px; color: var(--muted); min-height: 1em; }
.ava-row-sm .ava-pick { flex: 0 1 140px; padding: 12px; border-radius: 18px; }
.ava-row-sm .ava-wrap { width: 60px; height: 60px; }
.ava-row-sm .ava-name { font-size: 14px; }

/* capas: todo gira y se desplaza alrededor de la vista del SVG */
.ava-rig, .ava-head, .ava-hidle, .ava-face, .ava-pupil, .ava-gloss, .ava-cup, .ava-burger, .ava-cejas { transform-box: view-box; }
.ava-ojo { transform-box: fill-box; transform-origin: center; animation: parpadeo 5.2s infinite; }
.ava-eyes .ava-ojo:last-of-type { animation-delay: .03s; }
@keyframes parpadeo { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }
.ava-risa { opacity: 0; transition: opacity .25s; }
.ava-boca { transition: opacity .25s; }

:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) { --px: 0; --py: 0; perspective: 520px; cursor: pointer; }
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) > .ava {
  transform: rotateY(calc(var(--px) * 16deg)) rotateX(calc(var(--py) * -12deg));
  transition: transform .6s var(--ease), box-shadow .4s;
  box-shadow: 0 10px 22px -10px rgba(40, 25, 12, .5), inset 0 0 0 1px rgba(255, 255, 255, .35);
}
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava):hover > .ava { box-shadow: 0 16px 30px -12px rgba(40, 25, 12, .55), inset 0 0 0 1px rgba(255, 255, 255, .45); }
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-head {
  transform-origin: 60px 92px; transform: translate(calc(var(--px) * 2.4px), calc(var(--py) * 1.8px)) rotate(calc(var(--px) * 6deg));
  transition: transform .5s var(--ease);
}
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-face { transform: translate(calc(var(--px) * 2.8px), calc(var(--py) * 2.4px)); transition: transform .45s var(--ease); }
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-pupil { transform: translate(calc(var(--px) * 1.6px), calc(var(--py) * 1.5px)); transition: transform .3s var(--ease); }
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-gloss { transform: translate(calc(var(--px) * -7px), calc(var(--py) * -7px)); transition: transform .6s var(--ease); }
/* respiración, cabeceo y gestos (solo en los avatares grandes) */
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-rig { transform-origin: 60px 120px; animation: respira 4.6s ease-in-out infinite; }
:is(.ava-wrap, .hola-ava, .lado-ava, .cmp-ava, .who-ava, .side-ava, .dash-ava) .ava-hidle { transform-origin: 60px 92px; animation: cabeceo 7.5s ease-in-out infinite; }
@keyframes respira { 50% { transform: scale(1.022, 1.012) translateY(-.6px); } }
@keyframes cabeceo { 0%, 100% { transform: rotate(0); } 22% { transform: rotate(-2.4deg) translateY(.4px); } 55% { transform: rotate(2deg); } 78% { transform: rotate(-.8deg); } }
.ava-v .ava-cup { transform-origin: 88px 112px; animation: sorbo 11s var(--ease) infinite; }
@keyframes sorbo { 0%, 60%, 100% { transform: none; } 67%, 79% { transform: translate(-17px, -15px) rotate(-30deg); } 86% { transform: translate(1px, -1px) rotate(3deg); } }
.ava-burbujas circle { transform-box: fill-box; animation: burbuja 2.6s ease-out infinite; }
.ava-burbujas circle:nth-child(2) { animation-delay: .9s; } .ava-burbujas circle:nth-child(3) { animation-delay: 1.7s; }
@keyframes burbuja { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: .95; } 100% { opacity: 0; transform: translateY(-11px) translateX(1px); } }
.ava-r .ava-burger { transform-origin: 32px 112px; animation: mordida 9s var(--ease) infinite 2s; }
@keyframes mordida { 0%, 58%, 100% { transform: none; } 65%, 74% { transform: translate(15px, -16px) rotate(18deg); } 70% { transform: translate(16px, -15px) rotate(16deg) scale(.97); } 82% { transform: translate(-1px, -1px) rotate(-3deg); } }
.cejas .ava-cejas { transform: translateY(-3px); transition: transform .2s var(--spring); }
.ava-cejas { transition: transform .35s var(--ease); }
.guino .ava-eyes .ava-ojo:last-of-type { animation: guino .9s ease; }
@keyframes guino { 30%, 70% { transform: scaleY(.08); } }
:is(.sonrie, .salta, :hover) > .ava .ava-risa, .ava-pick:hover .ava-risa, .ava-pick.on .ava-risa { opacity: 1; }
:is(.sonrie, .salta, :hover) > .ava .ava-boca, .ava-pick:hover .ava-boca, .ava-pick.on .ava-boca { opacity: 0; }
.salta > .ava { animation: salta .85s var(--spring); }
@keyframes salta { 0% { transform: none; } 25% { transform: translateY(-14%) scale(1.06, .95) rotate(-6deg); } 55% { transform: translateY(2%) scale(.97, 1.04) rotate(4deg); } 100% { transform: none; } }
.salta .ava-cup { animation: brindis .85s var(--spring); }
.salta .ava-burger { animation: brindisR .85s var(--spring); }
@keyframes brindis { 40% { transform: translate(-6px, -18px) rotate(-14deg); } }
@keyframes brindisR { 40% { transform: translate(6px, -18px) rotate(14deg); } }

/* ---------- 7 · movimiento: cambio de vista, aparición, esqueleto ---------- */
#view { transition: opacity .18s ease, transform .18s ease, filter .18s ease; }
#view.saliendo { opacity: 0; transform: translateY(6px); filter: blur(3px); }
.vista.entra { animation: vistaIn .55s var(--ease); }
@keyframes vistaIn { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }
.rv { opacity: 0; transform: translateY(14px) scale(.985); }
.rv.rv-in { opacity: 1; transform: none; transition: opacity .6s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms); }
.panel-in { animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } }
.fade-in { animation: panelIn .3s var(--ease); }
.pop { animation: pop .35s var(--spring); }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }
.bump { animation: bump .4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.1); } }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .16; transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.spin { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { display: grid; gap: 14px; animation: panelIn .3s ease; }
.sk { border-radius: 14px; background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%); background-size: 300% 100%; animation: brilloSk 1.4s ease-in-out infinite; }
.sk-h { height: 34px; width: 220px; }
.sk-s { height: 14px; width: 160px; margin-top: -6px; }
.sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.sk-c { height: 110px; border-radius: 20px; }
.sk-b { height: 220px; border-radius: 20px; }
.sk-b2 { height: 160px; border-radius: 20px; }
@keyframes brilloSk { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}
