/* Panel Luxol — sistema "Luxol / Voy" en modo trabajo (Operate).
   Tokens compartidos con la app de mediciones y la web (DESIGN.md). */
:root {
  --ink: #19301E;
  --ink-2: #2B4B32;
  --ink-3: #5B6A5E;
  --k: #122215;
  --paper: #F4F1E7;
  --stone: #E4E1D8;
  --line: #D9DACD;
  --white: #FFFFFF;
  --peach: #FFA87C;
  --sage: #BECFAF;
  --lime: #BED86B;
  --sky: #ADBEC4;
  --lav: #DAD8FA;

  --red: #A8261D;    --red-bg: #FBE7E4;
  --amber: #8A4B00;  --amber-bg: #FFEFD6;
  --blue: #2F5D8A;   --blue-bg: #E4EDF5;
  --ok: #2E6B3A;     --ok-bg: #E2EFDA;

  --inst-eloy: #BECFAF;
  --inst-guillermo: #DAD8FA;
  --inst-otro: #ADBEC4;

  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-lg: 32px; --r-md: 24px; --r-sm: 16px; --r-xs: 10px;
  --e: cubic-bezier(0.22, 1, 0.36, 1);
  --side: 232px;
  --shadow: 0 1px 2px rgba(18, 34, 21, .06), 0 8px 24px -12px rgba(18, 34, 21, .18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #B9BCAD transparent; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/22px var(--sans); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--lime); color: var(--k); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9CBBE; border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i--s { width: 16px; height: 16px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 100px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .18s var(--e), color .18s var(--e), transform .12s var(--e);
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--light { background: var(--paper); color: var(--k); border-color: var(--paper); }
.btn--light:hover { background: var(--white); border-color: var(--white); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-width: 1.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.round {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--stone); color: var(--ink);
  display: inline-grid; place-items: center; transition: background .18s var(--e), transform .12s var(--e);
}
.round:hover { background: #D6D3C8; }
.round:active { transform: scale(.94); }

/* ---------- Entrada ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 80% at 10% 0%, #2B4B32 0%, transparent 60%), radial-gradient(90% 70% at 100% 100%, rgba(255,168,124,.22), transparent 60%), var(--k); }
.login__card { width: min(400px, 100%); color: var(--paper); }
.login__logo { height: 40px; margin: 0 0 40px -12px; display: block; }
.login h1 { font-weight: 300; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; }
.login__sub { color: rgba(244,241,231,.72); margin: 12px 0 32px; font-size: 16px; line-height: 24px; }
.login form { display: grid; gap: 16px; }
.login .field span { color: rgba(244,241,231,.75); }
.login .field select, .login .field input { background-color: rgba(244,241,231,.08); border-color: rgba(244,241,231,.22); color: var(--paper); }
.login .field select option { color: var(--ink); }
.login .btn { margin-top: 8px; min-height: 48px; }
.form-error { margin: 0; color: #FFB4A8; font-size: 14px; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.field input, .field select, .inp {
  width: 100%; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--white); transition: border-color .15s var(--e), box-shadow .15s var(--e);
}
.field input:focus, .field select:focus, .inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25,48,30,.12); }
.inp::placeholder { color: #8A958C; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 8px;
  background: var(--k); color: var(--paper); padding: 20px 12px 16px;
}
.side__brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 20px; text-decoration: none; font-weight: 300; }
.side__brand img { height: 30px; margin-left: -10px; }
.side__brand span { padding-left: 10px; border-left: 1px solid rgba(244,241,231,.3); opacity: .8; line-height: 18px; }
.side__nav { display: grid; gap: 2px; }
.nav-a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px;
  color: rgba(244,241,231,.78); text-decoration: none; font-weight: 500; transition: background .15s var(--e), color .15s var(--e);
}
.nav-a:hover { background: rgba(244,241,231,.07); color: var(--paper); }
.nav-a[aria-current="page"] { background: rgba(190,216,107,.16); color: var(--paper); }
.nav-a[aria-current="page"] .i { color: var(--lime); }
.nav-a .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 20px; background: rgba(244,241,231,.12); font-size: 12px; display: grid; place-items: center; }
.nav-a .count.hot { background: var(--peach); color: var(--k); font-weight: 600; }
.side__foot { margin-top: auto; display: grid; gap: 6px; }
.side__sync, .side__user {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 12px;
  background: transparent; color: rgba(244,241,231,.7); font-size: 13px; text-align: left;
}
.side__sync:hover, .side__user:hover { background: rgba(244,241,231,.07); color: var(--paper); }
.side__user .i { margin-left: auto; width: 18px; height: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }
.dot.warn { background: var(--peach); }
.dot.spin { animation: pulse 1s var(--e) infinite alternate; }
@keyframes pulse { to { opacity: .25; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; padding: 14px 32px 12px; background: linear-gradient(var(--paper) 70%, rgba(244,241,231,0)); }
.search-trigger {
  width: min(640px, 100%); display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 8px 0 16px;
  border: 1.5px solid var(--line); border-radius: 100px; background: var(--white); color: var(--ink-3); text-align: left;
  transition: border-color .15s var(--e), box-shadow .15s var(--e);
}
.search-trigger:hover { border-color: #BFC2B3; box-shadow: var(--shadow); }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: 500 12px var(--sans); padding: 4px 9px; border-radius: 100px; background: var(--paper); color: var(--ink-3); }
.banner { margin: 0 32px 8px; padding: 10px 16px; border-radius: var(--r-sm); background: var(--amber-bg); color: var(--amber); font-size: 14px; }
.view { padding: 8px 32px 64px; outline: none; }
.tabbar { display: none; }

/* ---------- Cabecera de vista ---------- */
.vh { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin: 12px 0 24px; }
.vh h1 { font-weight: 300; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; }
.vh p { margin: 6px 0 0; color: var(--ink-3); }
.vh__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Paneles ---------- */
.panel { background: var(--white); border-radius: var(--r-md); padding: 20px 20px 8px; box-shadow: var(--shadow); min-width: 0; }
.panel--flat { box-shadow: none; border: 1.5px solid var(--line); }
.panel__h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel__h h2 { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.panel__h .n { color: var(--ink-3); font-weight: 400; }
.panel__h a.more { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink-2); }
.panel__h a.more:hover { text-decoration: underline; }
.panel__empty { padding: 16px 0 20px; color: var(--ink-3); }

.grid-dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-12 { grid-column: span 12; } .col-7 { grid-column: span 7; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }

/* Resumen: cifras que enlazan a su lista */
.pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--k); color: var(--paper); border-radius: var(--r-md); overflow: hidden; }
.pulse a { padding: 20px 22px 18px; text-decoration: none; border-right: 1px solid rgba(244,241,231,.1); transition: background .18s var(--e); display: grid; gap: 2px; }
.pulse a:last-child { border-right: 0; }
.pulse a:hover { background: rgba(244,241,231,.05); }
.pulse b { font-weight: 300; font-size: 40px; line-height: 44px; letter-spacing: -0.02em; }
.pulse span { color: rgba(244,241,231,.7); font-size: 14px; }
.pulse em { font-style: normal; font-size: 13px; color: var(--peach); }
.pulse em.calm { color: var(--sage); }

/* Filas de lista */
.rows { display: grid; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  padding: 12px 8px; margin: 0 -8px; border-top: 1px solid #EEEDE6; border-radius: 12px; text-decoration: none;
  transition: background .15s var(--e);
}
.rows .row:first-child { border-top-color: transparent; }
.row:hover { background: var(--paper); }
.row__t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__s { grid-column: 2; color: var(--ink-3); font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__m { grid-row: 1 / span 2; grid-column: 3; text-align: right; display: grid; justify-items: end; gap: 4px; font-size: 13px; color: var(--ink-3); }
.row__lead { grid-row: 1 / span 2; }
.row--noLead { grid-template-columns: 1fr auto; }
.row--noLead .row__s { grid-column: 1; }
.row--noLead .row__m { grid-column: 2; }

/* Días como dato principal */
.days { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; align-content: center; background: var(--paper); line-height: 1; }
.days b { font-size: 20px; font-weight: 500; }
.days small { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.days.rojo { background: var(--red-bg); color: var(--red); }
.days.rojo small, .days.ambar small { color: inherit; opacity: .8; }
.days.ambar { background: var(--amber-bg); color: var(--amber); }
.days.ok { background: var(--ok-bg); color: var(--ok); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 100px; font-size: 12px; font-weight: 500; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.chip--rojo { background: var(--red-bg); color: var(--red); }
.chip--ambar { background: var(--amber-bg); color: var(--amber); }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--azul { background: var(--blue-bg); color: var(--blue); }
.chip--dark { background: var(--ink); color: var(--paper); }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }

/* Alertas agrupadas */
.alert-g { padding: 4px 0 8px; border-top: 1px solid #EEEDE6; }
.alert-g:first-of-type { border-top: 0; }
.alert-g summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; font-weight: 500; }
.alert-g summary::-webkit-details-marker { display: none; }
.alert-g summary .c { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 400; font-size: 13px; }
.alert-g summary .chev { transition: transform .2s var(--e); }
.alert-g[open] summary .chev { transform: rotate(90deg); }
.sev { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sev.rojo { background: var(--red); } .sev.ambar { background: #D88A2A; } .sev.azul { background: var(--blue); }

/* ---------- Tablero de pedidos ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 100px; background: var(--stone); }
.seg button { border: 0; background: transparent; min-height: 32px; padding: 0 14px; border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .15s var(--e), color .15s var(--e); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(18,34,21,.12); }
.toolbar .inp { width: 240px; min-height: 38px; border-radius: 100px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.lane { background: var(--stone); border-radius: var(--r-md); padding: 12px; min-height: 200px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.lane__h { display: flex; align-items: baseline; gap: 8px; padding: 4px 6px 6px; font-weight: 500; font-size: 14px; }
.lane__h span { color: var(--ink-3); font-weight: 400; }
.lane__h .chip { margin-left: auto; }
.card { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--white); text-decoration: none; box-shadow: 0 1px 2px rgba(18,34,21,.06);
  transition: transform .15s var(--e), box-shadow .15s var(--e); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card__t { font-weight: 500; line-height: 20px; }
.card__s { font-size: 13px; color: var(--ink-3); line-height: 18px; }
.card__f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card__f .age { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.card__f .age.late { color: var(--red); font-weight: 600; }

/* ---------- Tabla ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid #EEEDE6; vertical-align: middle; }
.table tr:hover td { background: #FAF9F4; }
.table .num { text-align: right; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.cal-head h2 { font-weight: 300; font-size: 28px; letter-spacing: -0.015em; min-width: 220px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend button { border: 1.5px solid var(--line); background: var(--white); border-radius: 100px; min-height: 32px; padding: 0 12px 0 8px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; transition: opacity .15s var(--e); }
.legend button[aria-pressed="false"] { opacity: .45; }
.legend .sw { width: 14px; height: 14px; border-radius: 50%; }
.week { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; }
.day { background: var(--white); border-radius: var(--r-sm); padding: 10px; min-height: 280px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(18,34,21,.05); }
.day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.day.past { background: #FBFAF6; }
.day__h { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 6px; }
.day__h b { font-size: 22px; font-weight: 300; }
.day__h span { color: var(--ink-3); font-size: 13px; text-transform: capitalize; }
.day__h .k { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.ev { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--paper); text-decoration: none; font-size: 13px; line-height: 17px; position: relative; transition: transform .15s var(--e); }
.ev:hover { transform: translateY(-1px); }
.ev b { font-weight: 600; font-size: 12px; }
.ev .who { font-weight: 500; }
.ev .what { color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev.done { opacity: .55; }
.ev.inc { box-shadow: inset 0 0 0 1.5px var(--red); }
.ev .flag { position: absolute; top: 8px; right: 8px; }
.ev .cobrar { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .dow { font-size: 12px; color: var(--ink-3); padding: 0 6px; text-transform: capitalize; }
.mday { background: var(--white); border-radius: 12px; min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.mday.other { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.mday.today { box-shadow: inset 0 0 0 2px var(--ink); }
.mday > span { font-size: 12px; color: var(--ink-3); padding: 0 4px 2px; }
.mev { font-size: 12px; line-height: 16px; padding: 3px 6px; border-radius: 6px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unsched { margin-top: 24px; }

/* ---------- Ficha ---------- */
.ficha-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin: 12px 0 24px; }
.ficha-head h1 { font-weight: 300; font-size: 40px; line-height: 1.1; letter-spacing: -0.015em; }
.contact-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.contact-line a, .contact-line button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 100px; background: var(--white); border: 1.5px solid var(--line); text-decoration: none; font-size: 14px; }
.contact-line a:hover, .contact-line button:hover { border-color: var(--ink); }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #EEEDE6; }
.tl:first-child { border-top: 0; }
.tl time { color: var(--ink-3); font-size: 13px; padding-top: 2px; }

/* ---------- Calculadora ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.cline { display: grid; grid-template-columns: 1.2fr 1.6fr .8fr .8fr .55fr; gap: 10px; align-items: end; padding: 16px 0; border-top: 1px solid #EEEDE6; }
.cline:first-of-type { border-top: 0; }
.cline .field > span { font-size: 12px; }
.cline__more { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.cline__more .field { flex: 1 1 150px; min-width: 0; }
.cline select.inp { padding-right: 28px; text-overflow: ellipsis; }
.cline__more .field--wide { flex: 2 1 260px; }
.cline > [data-gama] { grid-column: 1 / -1; justify-self: start; }
.cline > .field:first-child select { font-weight: 500; }
.cline__x { margin-left: auto; }
.cline__out { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cline__out .price { margin-left: auto; font-size: 18px; font-weight: 500; }
.cline.err .cline__out .price { color: var(--red); }
.calc-add { margin: 8px 0 16px; }
.ticket { position: sticky; top: 84px; max-height: calc(100dvh - 100px); overflow-y: auto; scrollbar-color: rgba(244,241,231,.25) transparent; background: var(--k); color: var(--paper); border-radius: var(--r-md); padding: 24px; display: grid; gap: 16px; }
.ticket h2 { font-size: 15px; font-weight: 500; color: rgba(244,241,231,.7); }
.ticket .big { font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.ticket .big small { font-size: 16px; color: rgba(244,241,231,.6); letter-spacing: 0; margin-left: 6px; }
.ticket dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 14px; }
.ticket dt { color: rgba(244,241,231,.7); }
.ticket dd { margin: 0; text-align: right; }
.ticket hr { border: 0; border-top: 1px solid rgba(244,241,231,.14); margin: 0; }
.ticket .toggles { display: grid; gap: 10px; }
.tgl { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.tgl input { appearance: none; width: 36px; height: 22px; border-radius: 20px; background: rgba(244,241,231,.2); position: relative; transition: background .18s var(--e); flex: none; }
.tgl input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: transform .18s var(--e); }
.tgl input:checked { background: var(--lime); }
.tgl input:checked::after { transform: translateX(14px); background: var(--k); }
.ticket .seg { background: rgba(244,241,231,.1); }
.ticket .seg button { color: rgba(244,241,231,.8); }
.ticket .seg button[aria-pressed="true"] { background: var(--paper); color: var(--k); }
.ticket .detail { font-size: 13px; color: rgba(244,241,231,.75); display: grid; gap: 4px; }
.ticket .detail div { display: flex; justify-content: space-between; gap: 12px; }
.ticket .note { font-size: 12px; color: rgba(244,241,231,.55); line-height: 17px; }
.avisos { display: grid; gap: 6px; }
.aviso { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 18px; padding: 8px 10px; border-radius: 10px; }
.aviso.rojo { background: var(--red-bg); color: var(--red); }
.aviso.ambar { background: var(--amber-bg); color: var(--amber); }
.aviso.azul { background: var(--blue-bg); color: var(--blue); }
.calc-mini { display: none; }
@media (max-width: 1180px) {
  .calc-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 16px; z-index: 25;
    width: 100%; margin-top: 16px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 100px; background: var(--lime); color: var(--k); font-size: 14px; box-shadow: var(--shadow); }
  .calc-mini b { font-size: 20px; font-weight: 500; }
}
@media (max-width: 900px) { .calc-mini { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } }
.breakdown { font-size: 13px; color: var(--ink-3); display: grid; gap: 2px; width: 100%; }
.breakdown div { display: flex; gap: 12px; justify-content: space-between; }

/* ---------- Buscador ---------- */
.search { width: min(720px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 64px)); margin: 8vh auto auto; padding: 0; border: 0; border-radius: var(--r-md);
  background: var(--white); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(18,34,21,.45); display: none; flex-direction: column; overflow: hidden; }
.search[open] { display: flex; animation: pop .2s var(--e); }
.search::backdrop { background: rgba(18,34,21,.38); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.search__box { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #EEEDE6; }
.search__box input { flex: 1; border: 0; outline: 0; font-size: 18px; background: transparent; min-width: 0; }
.search__box input::-webkit-search-cancel-button { display: none; }
.search__close { border: 0; background: var(--paper); border-radius: 100px; font-size: 12px; padding: 4px 10px; color: var(--ink-3); }
.search__filters { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; border-bottom: 1px solid #EEEDE6; }
.search__filters button { border: 1.5px solid var(--line); background: var(--white); border-radius: 100px; min-height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.search__filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search__results { overflow-y: auto; padding: 8px; }
.sr { display: grid; grid-template-columns: 36px 1fr auto; gap: 2px 12px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; cursor: pointer; }
.sr[aria-selected="true"], .sr:hover { background: var(--paper); }
.sr__ico { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--stone); }
.sr__t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr__s { grid-column: 2; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr__k { grid-row: 1 / span 2; grid-column: 3; font-size: 12px; color: var(--ink-3); }
.sr-group { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 12px 10px 4px; }
.search__hint { padding: 20px; color: var(--ink-3); font-size: 14px; line-height: 21px; }
mark { background: rgba(190,216,107,.55); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Carga */
.skel { border-radius: var(--r-md); background: linear-gradient(90deg, #ECEADF 0%, #F6F4EC 50%, #ECEADF 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .col-7, .col-5 { grid-column: span 12; }
  .calc { grid-template-columns: 1fr; }
  .ticket { position: static; }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 10px 16px 8px; }
  .view { padding: 4px 16px 96px; }
  .banner { margin: 0 16px 8px; }
  .vh h1, .ficha-head h1 { font-size: 32px; }
  .pulse { grid-template-columns: repeat(2, 1fr); }
  .pulse a:nth-child(2) { border-right: 0; }
  .pulse a:nth-child(-n+2) { border-bottom: 1px solid rgba(244,241,231,.1); }
  .pulse b { font-size: 32px; line-height: 36px; }
  .cline { grid-template-columns: 1fr 1fr 64px; }
  .cline > .field:nth-child(1), .cline > .field:nth-child(2) { grid-column: 1 / -1; }
  .cline__more .field { flex-basis: 40%; }
  .cline__more .field--wide { flex-basis: 100%; }
  .ficha-head { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(6, minmax(220px, 1fr)); scroll-snap-type: x mandatory; }
  .day { scroll-snap-align: start; }
  .month .dow { display: none; }
  .month { grid-template-columns: 1fr; }
  .mday.other, .mday.empty { display: none; }
  .mday { min-height: 0; }
  .search-trigger kbd { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 30;
    background: var(--k); border-radius: 22px; padding: 6px; box-shadow: 0 12px 30px -10px rgba(18,34,21,.5);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; color: rgba(244,241,231,.65); text-decoration: none; font-size: 11px; font-weight: 500; position: relative; }
  .tabbar a[aria-current="page"] { background: rgba(190,216,107,.16); color: var(--paper); }
  .tabbar a[aria-current="page"] .i { color: var(--lime); }
  .tabbar .count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; border-radius: 10px; background: var(--peach); color: var(--k); font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
}
@media (max-width: 560px) {
  .row__m .chip { display: none; }
  .table .hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v4 · Pulido de diseño (espaciado, cabecera aurora, cristal, tablas)
   ===================================================================== */
:root { --gap: 20px; --pad: 24px; }
.view { padding: 4px 40px 72px; }
.topbar { padding: 14px 40px 12px; }
.banner { margin: 0 40px 8px; }
.grid-dash { gap: var(--gap); }
.panel { padding: var(--pad) var(--pad) 12px; border-radius: var(--r-md); }
.panel__h { margin-bottom: 8px; min-height: 32px; }
.panel__h h2 { font-size: 19px; }
.vh { margin: 16px 0 28px; }
.vh p { max-width: 72ch; }
.toolbar { gap: 10px; margin-bottom: 20px; }
.toolbar__n { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* Barra superior y barra de pestañas: cristal sobre el contenido que pasa por debajo */
.topbar { background: rgba(244, 241, 231, .62); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid rgba(25, 48, 30, .06); }
.search-trigger { background: rgba(255, 255, 255, .78); }
@media (max-width: 900px) {
  .tabbar { background: rgba(18, 34, 21, .78); -webkit-backdrop-filter: saturate(1.4) blur(20px); backdrop-filter: saturate(1.4) blur(20px);
    box-shadow: 0 12px 30px -10px rgba(18,34,21,.5), inset 0 1px 0 rgba(255,255,255,.08); }
}

/* Cabecera de Inicio: panel aurora (DESIGN.md) con el resumen en tarjetas de cristal */
.hero { position: relative; overflow: hidden; margin: 12px 0 var(--gap); padding: 32px 32px 28px; border-radius: var(--r-lg);
  background:
    radial-gradient(60% 90% at 0% 0%, rgba(190, 216, 107, .55), transparent 60%),
    radial-gradient(50% 80% at 55% 0%, rgba(218, 216, 250, .75), transparent 62%),
    radial-gradient(55% 90% at 100% 100%, rgba(255, 168, 124, .55), transparent 60%),
    linear-gradient(104deg, #EEF0DD 0%, #F4F1E7 55%, #F7EBDF 100%);
  display: grid; gap: 24px; }
.hero__txt h1 { font-weight: 300; font-size: 44px; line-height: 1.08; letter-spacing: -0.02em; }
.hero__txt p { margin: 6px 0 0; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { display: grid; gap: 2px; padding: 16px 18px; border-radius: 20px; text-decoration: none;
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 10px 24px -16px rgba(18, 34, 21, .35);
  transition: transform .18s var(--e), background .18s var(--e), box-shadow .18s var(--e); }
.kpi:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .72); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 16px 30px -18px rgba(18, 34, 21, .45); }
.kpi b { font-weight: 300; font-size: 40px; line-height: 44px; letter-spacing: -0.02em; }
.kpi span { font-size: 14px; color: var(--ink-2); }
.kpi em { font-style: normal; font-size: 13px; color: var(--ink-3); }
.kpi--hot em { color: var(--red); font-weight: 500; }

/* Tablero de pedidos: color por fase (de salvia a lima), tarjetas con retraso marcadas */
.board { grid-auto-columns: minmax(250px, 1fr); gap: 14px; }
.lane { background: rgba(228, 225, 216, .7); padding: 10px; }
.lane__h { padding: 6px 6px 8px; }
.lane__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; align-self: center; }
.f1 .lane__dot { background: var(--sky); } .f2 .lane__dot { background: var(--lav); } .f3 .lane__dot { background: var(--peach); }
.f4 .lane__dot { background: var(--sage); } .f5 .lane__dot { background: var(--lime); } .f6 .lane__dot { background: var(--ink-3); }
.lane__empty { margin: 8px 6px; font-size: 13px; color: var(--ink-3); }
.card { border: 1px solid transparent; }

/* Campos en píldora para barras de filtros */
.search-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 100px;
  background: var(--white); border: 1.5px solid var(--line); color: var(--ink-3); transition: border-color .15s var(--e), box-shadow .15s var(--e); }
.search-inline:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25,48,30,.1); }
.search-inline input { border: 0; outline: 0; background: transparent; width: 190px; color: var(--ink); }
.inp--pill { width: auto; min-height: 38px; border-radius: 100px; padding: 0 34px 0 14px; }
.tgl--light { color: var(--ink-2); }
.tgl--light input { background: var(--line); }
.tgl--light input:checked { background: var(--ink); }
.tgl--light input:checked::after { background: var(--paper); }

/* Tablas: cabeceras ordenables, filas destacadas, sin cortes feos */
.panel--table { padding: 8px var(--pad) 8px; }
.table th { padding: 12px 10px; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 6px; margin: -4px -6px;
  border-radius: 8px; font: inherit; font-weight: 500; color: inherit; white-space: nowrap; }
.th-sort:hover { background: var(--paper); color: var(--ink); }
.th-sort .arr { font-size: 11px; opacity: .45; }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--ink); }
th[aria-sort="ascending"] .arr, th[aria-sort="descending"] .arr { opacity: 1; }
.table td { padding: 14px 10px; }
.table .td-main { min-width: 240px; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 4px; justify-items: start; }
.stack .card__s { white-space: nowrap; }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .view { padding: 4px 16px 104px; }
  .topbar { padding: 10px 16px 8px; }
  .banner { margin: 0 16px 8px; }
  .hero { padding: 22px 18px 18px; border-radius: var(--r-md); }
  .hero__txt h1 { font-size: 32px; }
  .kpi b { font-size: 32px; line-height: 36px; }
  .search-inline { flex: 1 1 100%; }
  .search-inline input { width: 100%; }
  .toolbar__n { margin-left: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar, .kpi { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar { background: var(--paper); } .kpi { background: rgba(255,255,255,.85); }
}

/* =====================================================================
   v7 · Entrada: foto a pantalla completa + tarjeta de cristal mate (estilo Apple)
   ===================================================================== */
.login {
  position: relative; isolation: isolate; overflow: hidden; padding: 24px 16px;
  background: #1a1612 url("login-bg.jpg") center 40% / cover no-repeat;
}
@media (max-width: 760px) { .login { background-image: url("login-bg-m.jpg"); background-position: 12% 40%; } }
/* velo suave para que el cristal y el texto lean bien sobre cualquier zona de la foto */
.login::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 70% at 50% 50%, rgba(18, 16, 12, .18), rgba(18, 16, 12, .5)); }
.login__card {
  width: min(420px, 100%); padding: 36px 32px 32px; border-radius: 32px; color: #fff;
  /* cristal mate ahumado: difumina la foto y mantiene el texto blanco legible sobre zonas claras */
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 60%), rgba(24, 21, 18, .38);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(255, 255, 255, .08), 0 30px 80px -24px rgba(0, 0, 0, .55);
  animation: glassIn .6s var(--e) both;
}
@keyframes glassIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.login__logo { height: 36px; margin: 0 0 28px -10px; }
.login h1 { font-size: 36px; text-shadow: 0 1px 12px rgba(0, 0, 0, .18); }
.login__sub { color: rgba(255, 255, 255, .82); margin: 10px 0 28px; }
.login .field span { color: rgba(255, 255, 255, .85); }
.login .field select, .login .field input {
  min-height: 48px; border-radius: 14px; color: #fff;
  background-color: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.login .field select:focus, .login .field input:focus { border-color: rgba(255, 255, 255, .7); box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); background-color: rgba(255, 255, 255, .18); }
.login .btn--light { background: rgba(255, 255, 255, .92); border-color: transparent; color: var(--k); }
.login .btn--light:hover { background: #fff; }
.form-error { color: #FFD3CC; }
@media (prefers-reduced-transparency: reduce) {
  .login__card { background: rgba(28, 24, 20, .82); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) { .login__card { animation: none; } }

/* =====================================================================
   v8 · Desplegables con flecha propia (la nativa queda pegada al borde y cambia según navegador)
   ===================================================================== */
select.inp, .field select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 40px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2319301E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
select.inp:disabled, .field select:disabled { cursor: default; opacity: .55; }
.inp--pill { padding-right: 40px; }
.cline select.inp { padding-right: 36px; background-position: right 13px center; }
.login .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}

/* =====================================================================
   v10 · Cabecera de Inicio sobria: verde bosque, luz tenue monocroma,
   resumen en columnas con separadores finos (sin cajas ni pastel)
   ===================================================================== */
.hero {
  padding: 30px 32px 6px; gap: 26px; color: var(--paper);
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(190, 207, 175, .16), transparent 55%),
    radial-gradient(70% 120% at 0% 100%, rgba(255, 255, 255, .05), transparent 60%),
    linear-gradient(180deg, #1C3522 0%, #142719 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -28px rgba(18, 34, 21, .7);
}
.hero__txt h1 { color: var(--paper); font-size: 40px; }
.hero__txt p { color: rgba(244, 241, 231, .6); font-size: 15px; }
.kpis { gap: 0; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(244, 241, 231, .12); margin: 0 -32px; }
.kpi {
  position: relative; padding: 22px 32px 26px; border-radius: 0; border: 0; background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--paper);
}
.kpi + .kpi { border-left: 1px solid rgba(244, 241, 231, .12); }
.kpi:hover { transform: none; background: rgba(244, 241, 231, .04); box-shadow: none; }
.kpi b { font-size: 44px; line-height: 48px; font-weight: 300; color: var(--paper); font-variant-numeric: tabular-nums; }
.kpi span { color: rgba(244, 241, 231, .78); font-size: 14px; margin-top: 4px; }
.kpi em { color: rgba(244, 241, 231, .5); display: inline-flex; align-items: center; gap: 7px; }
.kpi--hot em { color: #FFC2A6; font-weight: 500; }
.kpi--hot em::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--peach); box-shadow: 0 0 0 3px rgba(255, 168, 124, .18); }
.kpi::after { content: ""; position: absolute; right: 24px; top: 26px; width: 18px; height: 18px; opacity: 0; transform: translateX(-4px);
  transition: opacity .18s var(--e), transform .18s var(--e);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4F1E7' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.kpi:hover::after { opacity: .7; transform: none; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid rgba(244, 241, 231, .12); }
}
@media (max-width: 900px) {
  .hero { padding: 22px 18px 0; }
  .hero__txt h1 { font-size: 30px; }
  .kpis { margin: 0 -18px; }
  .kpi { padding: 16px 18px 18px; }
  .kpi b { font-size: 34px; line-height: 38px; }
  .kpi::after { display: none; }
}

/* =====================================================================
   v11 · Las 4 tarjetas del resumen en cristal oscuro sobre el verde bosque
   ===================================================================== */
.hero { padding: 30px 32px 32px; isolation: isolate; }
/* luces suaves que el cristal difumina (monocromas, muy tenues) */
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); pointer-events: none; }
.hero::before { width: 46%; height: 160%; right: 6%; top: -40%; background: radial-gradient(closest-side, rgba(190, 207, 175, .30), transparent); }
.hero::after { width: 34%; height: 120%; left: 18%; bottom: -70%; background: radial-gradient(closest-side, rgba(255, 168, 124, .14), transparent); }
.kpis { gap: 12px; border-top: 0; margin: 0; }
.kpi, .kpi + .kpi {
  padding: 18px 20px 20px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .10);
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 14px 30px -22px rgba(0, 0, 0, .6);
  transition: transform .18s var(--e), background .18s var(--e), border-color .18s var(--e);
}
.kpi:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05)); border-color: rgba(255, 255, 255, .16); }
.kpi b { font-size: 40px; line-height: 44px; }
.kpi::after { right: 18px; top: 20px; }
@media (max-width: 1180px) { .kpi:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .10); } }
@media (max-width: 900px) {
  .hero { padding: 22px 16px 16px; }
  .kpis { margin: 0; gap: 10px; }
  .kpi { padding: 14px 14px 16px; }
}
@media (prefers-reduced-transparency: reduce) { .kpi { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .08); } }

/* =====================================================================
   v12 · Mediciones
   ===================================================================== */
.row__chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.med-text { margin: 0 0 12px; padding: 16px 18px; border-radius: var(--r-sm); background: var(--paper); font: 400 14px/22px var(--sans);
  white-space: pre-wrap; word-break: break-word; max-height: 560px; overflow: auto; }
.med-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.med-foto { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--stone); display: grid; place-items: center; font-size: 12px; color: var(--ink-3); }
.med-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s var(--e); }
.med-foto:hover img { transform: scale(1.04); }
@media (max-width: 900px) {
  .tabbar { grid-template-columns: repeat(6, 1fr); }
  .tabbar a { font-size: 10px; }
}

/* =====================================================================
   v14 · Gestionar tareas de Asana (ventana de acciones) + aviso flotante
   ===================================================================== */
.act { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: var(--r-md);
  background: var(--white); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(18,34,21,.45); overflow: auto; }
.act[open] { animation: pop .2s var(--e); }
.act::backdrop { background: rgba(18,34,21,.38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.act__h { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 22px 24px 14px; border-bottom: 1px solid #EEEDE6; }
.act__h h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 2px 0; }
.act__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.act__sec { padding: 16px 24px; border-bottom: 1px solid #EEEDE6; display: grid; gap: 10px; align-content: start; }
.act__sec:nth-child(odd):not(.act__sec--wide) { border-right: 1px solid #EEEDE6; }
.act__sec--wide { grid-column: 1 / -1; border-right: 0 !important; }
.act__sec h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.act__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.act__row .inp { flex: 1 1 140px; min-height: 38px; }
.act__hora { flex: 0 0 110px !important; }
.act__txt { min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 21px; }
.act__f { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 24px 18px; }
.btn--danger { color: var(--red); border-color: rgba(168,38,29,.35); }
.btn--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.act-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); color: var(--ink-2); margin-left: 6px; cursor: pointer;
  transition: background .15s var(--e), color .15s var(--e); }
.act-btn:hover, .act-btn:focus-visible { background: var(--ink); color: var(--paper); }
.card .act-btn { opacity: 0; transition: opacity .15s var(--e), background .15s var(--e), color .15s var(--e); }
.card:hover .act-btn, .card:focus-within .act-btn { opacity: 1; }
.act-btn--ev { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; background: rgba(255,255,255,.65); opacity: 0; }
.ev:hover .act-btn--ev { opacity: 1; }
@media (hover: none) { .card .act-btn, .act-btn--ev { opacity: 1; } }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 100px; background: var(--k); color: var(--paper); font-size: 14px; box-shadow: 0 16px 36px -14px rgba(0,0,0,.5);
  transition: opacity .2s var(--e), transform .2s var(--e); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast--ok::before { content: "✓ "; color: var(--lime); }
.toast--err { background: var(--red); }
@media (max-width: 900px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } .act__grid { grid-template-columns: 1fr; } .act__sec { border-right: 0 !important; } }

/* =====================================================================
   v15 · Logros (Inicio)
   ===================================================================== */
.logros { margin-bottom: var(--gap); padding-bottom: 20px; }
.seg--sm button { min-height: 28px; padding: 0 12px; font-size: 12px; }
.lg { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-areas: "stats stats stats" "rank chart hitos"; gap: 16px 28px; }
.lg h3 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.lg__stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lg__stat { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r-sm); background: var(--paper); text-decoration: none; transition: background .15s var(--e); }
.lg__stat:hover { background: #EEEADF; }
.lg__k { font-size: 13px; color: var(--ink-3); }
.lg__stat b { font-size: 34px; line-height: 40px; font-weight: 300; letter-spacing: -0.02em; }
.lg__s { font-size: 13px; color: var(--ink-2); }
.delta { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--ink-3); }
.lg__rank { grid-area: rank; }
.rk { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.rk__av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--stone); color: var(--ink-2); }
.rk__av.lead { background: var(--ink); color: var(--lime); }
.rk__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rk__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rk__top b { font-weight: 500; }
.rk__n { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.rk__bar { height: 8px; border-radius: 8px; background: var(--paper); overflow: hidden; }
.rk__bar span { display: block; width: 100%; height: 100%; border-radius: 8px; background: var(--ink); transform-origin: left center; transition: transform .5s var(--e); }
.lg__chart { grid-area: chart; }
.lg__svg { position: relative; }
.lg__svg svg { width: 100%; height: auto; display: block; overflow: visible; }
.lg__svg .bar path { fill: var(--ink-3); transition: fill .15s var(--e); }
.lg__svg .bar.today path { fill: var(--ink); }
.lg__svg .bar .zero { fill: var(--line); }
.lg__svg .bar .hit { fill: transparent; }
.lg__svg .bar:hover path { fill: var(--ink-2); }
.lg__svg .bar text { font: 500 9px var(--sans); fill: var(--ink-3); text-anchor: middle; text-transform: uppercase; }
.lg__svg .bar.today text { fill: var(--ink); font-weight: 600; }
.lg__tip { position: absolute; top: -8px; transform: translate(-50%, -100%); padding: 8px 10px; border-radius: 10px; background: var(--k); color: var(--paper);
  font-size: 12px; line-height: 17px; white-space: nowrap; pointer-events: none; box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); z-index: 3; }
.lg__hitos { grid-area: hitos; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; }
.lg__hitos li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #EEEDE6; }
.lg__hitos li:first-child { border-top: 0; padding-top: 0; }
.lg__hitos b { display: block; font-weight: 500; font-size: 14px; }
.lg__hitos span:not(.lg__ic) { font-size: 13px; color: var(--ink-3); }
.lg__ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--ink-2); }
@media (max-width: 1180px) { .lg { grid-template-columns: 1fr 1fr; grid-template-areas: "stats stats" "rank chart" "hitos hitos"; } }
@media (max-width: 760px) {
  .lg { grid-template-columns: 1fr; grid-template-areas: "stats" "rank" "chart" "hitos"; }
  .lg__stats { grid-template-columns: 1fr; }
  .lg__stat b { font-size: 28px; line-height: 34px; }
}

/* =====================================================================
   v17 · Logros en resumen: foto + tarjetas de cristal con mancha de color y mini gráficos
   ===================================================================== */
.logros-x { position: relative; isolation: isolate; overflow: hidden; margin-bottom: var(--gap); padding: 22px 22px 24px; border-radius: var(--r-lg);
  background: #2a241d url("logros-bg.jpg") center 30% / cover no-repeat; color: #fff; }
.logros-x::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(20, 18, 14, .35), rgba(20, 18, 14, .55)); }
.lgx__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lgx__h h2 { font-size: 22px; font-weight: 300; letter-spacing: -0.01em; text-shadow: 0 1px 10px rgba(0,0,0,.25); }
.seg--glass { background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.22); }
.seg--glass button { color: rgba(255,255,255,.85); }
.seg--glass button[aria-pressed="true"] { background: rgba(255,255,255,.92); color: var(--k); }
.lgx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gt { position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; min-height: 196px; padding: 16px 16px 14px;
  border-radius: 26px; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 18px 36px -24px rgba(0,0,0,.6);
  transition: transform .2s var(--e), background .2s var(--e); }
a.gt:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .17); }
/* mancha de color difusa (referencia 1), una por tarjeta */
.gt::before { content: ""; position: absolute; z-index: -1; width: 150px; height: 150px; right: -40px; bottom: -50px; border-radius: 50%; filter: blur(28px); opacity: .55; }
.gt--peach::before { background: radial-gradient(circle, #FFA87C, transparent 70%); }
.gt--lime::before { background: radial-gradient(circle, #BED86B, transparent 70%); }
.gt--lav::before { background: radial-gradient(circle, #DAD8FA, transparent 70%); }
.gt--sage::before { background: radial-gradient(circle, #BECFAF, transparent 70%); }
.gt__top { display: flex; gap: 10px; align-items: center; }
.gt__ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); }
.gt__ic--av { background: rgba(255,255,255,.9); color: var(--k); font-size: 12px; font-weight: 600; border: 0; }
.gt__k { font-size: 14px; line-height: 18px; }
.gt__k small { font-size: 12px; opacity: .7; }
.gt__bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.gt__bot b { font-size: 40px; line-height: 40px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gt__bot b i { font-style: normal; font-size: 18px; opacity: .7; margin-left: 2px; }
.mini { width: 84px; height: 30px; flex: none; }
.mini rect { fill: rgba(255,255,255,.45); } .mini rect.on { fill: #fff; }
.mini polyline { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.mini circle { fill: #fff; }
.mini--dots { display: grid; grid-template-columns: repeat(7, 8px); gap: 4px; align-content: end; width: auto; }
.mini--dots span { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255,255,255,.55); }
.mini--dots span.on { background: #fff; border-color: #fff; }
.gt__bot--rank { display: grid; gap: 6px; align-items: center; }
.rkx { display: grid; grid-template-columns: 62px 1fr 18px; gap: 8px; align-items: center; font-size: 12px; }
.rkx span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.rkx__bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.2); overflow: hidden; }
.rkx__bar i { display: block; height: 100%; width: 100%; border-radius: 5px; background: #fff; transform-origin: left center; transition: transform .5s var(--e); }
.rkx b { font-weight: 500; text-align: right; }
.gt__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 100px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); color: #fff; white-space: nowrap; }
.gchip--up { background: rgba(190, 216, 107, .9); border-color: transparent; color: var(--k); }
.dotc { width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 1180px) { .lgx { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .logros-x { padding: 16px 12px 14px; border-radius: var(--r-md); }
  .lgx { gap: 8px; }
  .gt { min-height: 172px; padding: 12px; border-radius: 20px; gap: 10px; }
  .gt__bot b { font-size: 30px; line-height: 32px; }
  .gt__k { font-size: 13px; }
  .mini { width: 60px; }
  .gt__ic { width: 30px; height: 30px; }
}
@media (prefers-reduced-transparency: reduce) { .gt, .seg--glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28,24,20,.72); } }
.gt__bot--rank .rkx b { font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: 0; }
.rkx__bar { display: block; }
.gt::before { opacity: .75; width: 170px; height: 170px; }
.gt__bot--rank { grid-template-columns: 1fr; justify-content: stretch; align-items: center; }
@media (max-width: 560px) {
  .gt { min-width: 0; }
  .gt__bot:not(.gt__bot--rank) { flex-direction: column; align-items: flex-start; gap: 6px; }
  .gt__bot b { font-size: 26px; line-height: 30px; }
  .gchip { white-space: normal; height: auto; min-height: 22px; padding: 3px 8px; line-height: 15px; }
  .rkx { grid-template-columns: 52px 1fr 14px; }
}

/* =====================================================================
   v18 · Página Logros + acceso destacado en la barra lateral
   ===================================================================== */
/* Botón de la barra lateral: píldora con brillo suave y contador */
.nav-logros { position: relative; display: flex; align-items: center; gap: 10px; margin: 14px 4px 0; padding: 10px 12px; border-radius: 16px; text-decoration: none; color: var(--paper);
  background: linear-gradient(104deg, rgba(190, 216, 107, .22), rgba(255, 168, 124, .16) 60%, rgba(218, 216, 250, .14));
  border: 1px solid rgba(244, 241, 231, .14); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); overflow: hidden; transition: transform .18s var(--e), border-color .18s var(--e); }
.nav-logros::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 45%, transparent 60%); transform: translateX(-100%); transition: transform .8s var(--e); }
.nav-logros:hover { transform: translateY(-1px); border-color: rgba(244, 241, 231, .28); }
.nav-logros:hover::after { transform: translateX(100%); }
.nav-logros[aria-current="page"] { border-color: rgba(190, 216, 107, .6); }
.nav-logros__ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(190, 216, 107, .9); color: var(--k); flex: none; }
.nav-logros__ic .i { width: 18px; height: 18px; }
.nav-logros__t { display: grid; font-weight: 500; line-height: 17px; }
.nav-logros__t small { font-weight: 400; font-size: 11px; opacity: .65; }
.nav-logros__n { margin-left: auto; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 20px; display: grid; place-items: center; background: var(--paper); color: var(--k); font-size: 12px; font-weight: 600; }
.btn-glass { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 100px; font-size: 13px; font-weight: 500; text-decoration: none; color: #fff;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .18s var(--e); }
.btn-glass:hover { background: rgba(255,255,255,.28); }
.lgx__h { justify-content: flex-start; }

/* Cabecera con foto */
.lx-hero { position: relative; isolation: isolate; overflow: hidden; margin: 12px 0 var(--gap); padding: 30px 28px 26px; border-radius: var(--r-lg); color: #fff;
  background: #2b241c url("login-bg.jpg") center 45% / cover no-repeat; }
.lx-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(18,16,12,.72) 0%, rgba(18,16,12,.35) 55%, rgba(18,16,12,.55) 100%); }
.lx-hero__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.lx-hero__kicker { margin: 0 0 6px; font-size: 13px; opacity: .75; }
.lx-hero h1 { font-weight: 300; font-size: 42px; line-height: 1.08; letter-spacing: -0.02em; }
.lx-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lx-kpis .gt { min-height: 150px; }

/* Récords: tarjetas pastel con degradado diagonal (Voy) */
.lx-records { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: var(--gap); }
.rec { display: grid; gap: 6px; align-content: start; padding: 20px 20px 18px; border-radius: var(--r-md); color: var(--ink); min-height: 180px; }
.rec--peach { background: linear-gradient(104deg, #FFD9C4 0%, #FCEFE4 100%); }
.rec--lime { background: linear-gradient(104deg, #DCEBA6 0%, #EEF4DA 100%); }
.rec--lav { background: linear-gradient(104deg, #DAD8FA 0%, #F1EFFD 100%); }
.rec--sky { background: linear-gradient(104deg, #C9D7DC 0%, #ECF1F2 100%); }
.rec__k { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.rec b { font-size: 38px; line-height: 44px; font-weight: 300; letter-spacing: -0.02em; }
.rec b small { font-size: 15px; letter-spacing: 0; color: var(--ink-2); }
.rec__s { font-size: 13px; color: var(--ink-2); }
.rec__bar { height: 6px; border-radius: 6px; background: rgba(25,48,30,.12); overflow: hidden; margin-top: 6px; }
.rec__bar i { display: block; width: 100%; height: 100%; background: var(--ink); border-radius: 6px; transform-origin: left; }

/* Comerciales */
.lx-sec { margin-bottom: var(--gap); }
.lx-sec > .panel__h { padding: 0 4px; }
.lx-coms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.com { position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 12px; padding: 18px; border-radius: var(--r-md); background: var(--white); box-shadow: var(--shadow); }
.com::before { content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%; filter: blur(30px); opacity: .7; }
.com--peach::before { background: #FFD3BC; } .com--lime::before { background: #DDEBA8; } .com--lav::before { background: #DAD8FA; } .com--sky::before { background: #CCDADF; }
.com__h { display: flex; gap: 10px; align-items: center; }
.com__h b { display: block; font-weight: 500; font-size: 17px; }
.com__h span:not(.com__av):not(.chip) { font-size: 13px; color: var(--ink-3); }
.com__h .chip { margin-left: auto; }
.com__av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--lime); font-weight: 600; font-size: 13px; }
.com__av--sm { width: 34px; height: 34px; font-size: 12px; }
.com__big b { display: block; font-size: 30px; line-height: 34px; font-weight: 300; letter-spacing: -0.02em; }
.com__big span { font-size: 13px; color: var(--ink-3); }
.com__chips .chip { background: rgba(25,48,30,.06); }

/* Gráficos de barras (una serie, sin ejes; semana actual resaltada) */
.lx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.lx-grid--2 { grid-template-columns: 1.2fr 1fr; }
.bars { width: 100%; height: auto; display: block; overflow: visible; }
.bars .b path { fill: color-mix(in oklab, var(--ink) 35%, var(--paper)); transition: fill .15s var(--e); }
.bars .b.now path { fill: var(--ink); }
.bars--lime .b path { fill: color-mix(in oklab, #8FAE3A 45%, var(--paper)); } .bars--lime .b.now path { fill: #6E8C25; }
.bars--peach .b path { fill: color-mix(in oklab, #E07B48 40%, var(--paper)); } .bars--peach .b.now path { fill: #C8602C; }
.bars .b:hover path { filter: brightness(.9); }
.bars .hit { fill: transparent; }
.bars .z { fill: var(--line); }
.bars text { font: 500 10px var(--sans); text-anchor: middle; fill: var(--ink-3); }
.bars text.v { fill: var(--ink); font-weight: 600; }
.bars--mini text.l { display: none; }
.lx-chart { padding-bottom: 18px; }

/* Mapa de calor */
.heat { display: grid; grid-template-columns: 56px repeat(6, 1fr); gap: 5px; align-items: center; }
.heat__d { font-size: 11px; color: var(--ink-3); text-align: center; }
.heat__w { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.heat__c { height: 24px; border-radius: 7px; background: var(--paper); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--paper); }
.heat__leg { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin: 12px 0 10px; font-size: 11px; color: var(--ink-3); }
.heat__leg .heat__c { width: 18px; height: 12px; border-radius: 4px; }

/* Qué se vende */
.prod { display: grid; gap: 12px; padding-bottom: 12px; }
.prod__r { display: grid; grid-template-columns: 140px 1fr 48px; gap: 12px; align-items: center; font-size: 14px; }
.prod__bar { height: 10px; border-radius: 10px; background: var(--paper); overflow: hidden; }
.prod__bar i { display: block; width: 100%; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #BECFAF, var(--ink)); transform-origin: left; }
.prod__r b { text-align: right; font-weight: 500; }
.lx-feed { margin-bottom: var(--gap); }

@media (max-width: 1180px) {
  .lx-kpis, .lx-records { grid-template-columns: repeat(2, 1fr); }
  .lx-grid, .lx-grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lx-hero { padding: 20px 14px 14px; border-radius: var(--r-md); }
  .lx-hero h1 { font-size: 28px; }
  .rec { min-height: 0; padding: 16px; }
  .rec b { font-size: 28px; line-height: 32px; }
  .prod__r { grid-template-columns: 110px 1fr 40px; font-size: 13px; }
  .heat { grid-template-columns: 44px repeat(6, 1fr); gap: 4px; }
}
