
/* Layout: sticky brand bar + month stepper, tab strip, one working panel per tab (summary first, detail below) */
:root {
  --bg: #F4F2EC; --surface: #FFFFFF; --surface2: #ECE9E1; --fg: #0E1512; --muted: #4B5550; --line: #D6D2C6;
  --lime: #C8F25A; --on-lime: #0E1512; --lime-text: #2F5A10; --bar-own: #1B2520; --bar-fr: #8DBE24; --icon-handle: #C8F25A;
  --ok: #2F7A3B; --ok-bg: #DFF0DA; --warn: #8A5A00; --warn-bg: #FBEBC5; --bad: #A8321F; --bad-bg: #F8DDD6;
  --display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1512; --surface: #1B2520; --surface2: #26332C; --fg: #F4F2EC; --muted: #A9B3AD; --line: #34423A;
  --lime: #C8F25A; --on-lime: #0E1512; --lime-text: #C8F25A; --bar-own: #DCE3DE; --bar-fr: #C8F25A; --icon-handle: #0E1512;
  --ok: #8FD99A; --ok-bg: #1E3A25; --warn: #F2C66B; --warn-bg: #3D3117; --bad: #FF9B86; --bad-bg: #432019; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0E1512; --surface: #1B2520; --surface2: #26332C; --fg: #F4F2EC; --muted: #A9B3AD; --line: #34423A;
  --lime: #C8F25A; --on-lime: #0E1512; --lime-text: #C8F25A; --bar-own: #DCE3DE; --bar-fr: #C8F25A; --icon-handle: #0E1512;
  --ok: #8FD99A; --ok-bg: #1E3A25; --warn: #F2C66B; --warn-bg: #3D3117; --bad: #FF9B86; --bad-bg: #432019; color-scheme: dark }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 14px; line-height: 1.45; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 0 48px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topin { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.brand b { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; }
.brand span { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime-text); }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--fg); cursor: pointer; font-size: 16px; }
.stepper button:hover { background: var(--surface2); }
.stepper strong { min-width: 128px; text-align: center; font-weight: 700; text-transform: capitalize; }
nav.tabs { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; }
nav.tabs button { border: 0; background: none; color: var(--muted); font: 600 14px var(--body); padding: 10px 12px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--lime); }

/* surfaces */
.panel { display: grid; gap: 18px; padding-top: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.kpi .lab { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 5vw, 26px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.hero { background: var(--fg); color: var(--bg); border-color: var(--fg); position: relative; overflow: hidden; }
.kpi.hero .lab, .kpi.hero .sub { color: color-mix(in srgb, var(--bg) 72%, var(--fg)); }
.kpi.hero::after { content: ""; position: absolute; top: 0; right: 0; width: 34px; height: 28px; background: var(--lime); border-radius: 0 var(--r) 0 0; }

/* tables */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 800; border-top: 2px solid var(--fg); }
.aporte { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.aporte i { flex: 1; max-width: 110px; height: 6px; border-radius: 3px; background: var(--surface2); position: relative; overflow: hidden; }
.aporte i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 3px; background: var(--bar-fr); }
.aporte b { min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.code { font-weight: 800; font-family: var(--display); letter-spacing: -0.01em; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface2); color: var(--fg); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.lime { background: var(--lime); color: var(--on-lime); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* forms */
label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; }
input, select, textarea { font: 500 14px var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime-text); outline-offset: 2px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.btn { font: 700 13px var(--body); border-radius: 10px; padding: 9px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.btn.primary:hover { filter: brightness(0.96); }
.btn.dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
td input.money { width: 140px; text-align: right; font-variant-numeric: tabular-nums; }
td select { width: auto; padding: 5px 8px; font-size: 13px; }

/* banners and states */
.banner { border-radius: var(--r); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.banner .btn { margin-left: auto; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty h3 { color: var(--fg); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart .cv { overflow-x: auto; }
.chart svg { width: 100%; min-width: 520px; height: auto; display: block; }
.chart text { fill: var(--muted); font: 600 11px var(--body); }
.chart .tot { fill: var(--fg); font: 800 11px var(--body); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 700; font-size: 13px; z-index: 20; }
.note { font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--lime-text); font-weight: 700; }
.sect-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) { .btn, nav.tabs button { transition: background .15s, border-color .15s; } }

/* ---- PWA: barra superior siempre oscura (bajo la barra de estado del iPhone) ---- */
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.top { background: #0E1512; color: #F4F2EC; border-bottom: 0; top: 0; padding-top: env(safe-area-inset-top, 0px); }
.top .brand b { color: #F4F2EC; }
.top .brand span { color: #C8F25A; }
.top .stepper { background: #1B2520; border-color: #34423A; }
.top .stepper button, .top .stepper strong { color: #F4F2EC; }
.top .stepper button:hover { background: #26332C; }
.top nav.tabs button { color: #A9B3AD; }
.top nav.tabs button[aria-selected="true"] { color: #F4F2EC; border-bottom-color: #C8F25A; }
.userbtn { background: transparent; border: 1px solid #34423A; color: #F4F2EC; border-radius: 99px; padding: 7px 12px; font: 700 12px var(--body); cursor: pointer; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbtn:hover { background: #1B2520; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px; background: #0E1512; }
.auth .box { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 26px 22px 22px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.auth .box::after { content: ""; position: absolute; top: 0; right: 0; width: 64px; height: 52px; background: #C8F25A; border-radius: 0 20px 0 0; }
.auth h1 { font-size: 26px; line-height: 1.05; }
.auth .lockup { display: flex; align-items: center; gap: 9px; }
.auth .lockup b { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.linkbtn { background: none; border: 0; color: var(--lime-text); font: 700 13px var(--body); cursor: pointer; padding: 4px 0; text-align: left; }
.err { color: var(--bad); font-size: 13px; font-weight: 600; }
.kpi.hero .lab { padding-right: 34px; }

/* Indicadores que se pueden tocar para cambiar el gráfico */
.kpi.kpi-sel { cursor: pointer; text-align: left; -webkit-user-select: none; user-select: none; }
.kpi.kpi-sel:not(.hero):hover { border-color: var(--fg); }
.kpi.kpi-sel:focus-visible { outline: 2px solid var(--lime-text); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .kpi.kpi-sel { transition: background .18s, color .18s, border-color .18s; } }

/* Que se sienta como app: sin zoom por doble toque, sin zoom al escribir, sin destello gris al tocar */
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (max-width: 860px) { input, select, textarea { font-size: 16px; } }
button, nav.tabs, .kpi, .stepper { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Como app nativa: la barra de arriba queda fija y solo se desplaza el contenido (sin el "rebote" de toda la página) */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; padding-bottom: 0; }
.top { position: relative; top: auto; flex: none; }
#auth { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.auth { min-height: 100%; }
main#main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  max-width: none; width: 100%; margin: 0; padding-inline: max(16px, calc((100% - 1148px) / 2)); padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }

/* Fondo blanco (modo claro) */
:root:not([data-theme="dark"]) { --bg: #FFFFFF; --surface: #FFFFFF; --surface2: #F2F2EF; --line: #E5E3DD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1512; --surface: #1B2520; --surface2: #26332C; --line: #34423A; } }
html { background: var(--bg); }

/* iPhone (app web): la pantalla ocupa todo el alto, sin franja vacía abajo */
body { position: fixed; top: 0; left: 0; right: 0; bottom: auto; height: var(--app-h, 100dvh); }

/* Alto completo en iPhone: nada recorta la pantalla (sin overflow hidden en la raíz) */
html, body { overflow: visible; }
@media (display-mode: standalone) { body { height: var(--app-h, 100vh); } }

/* Ajustes · Mi cuenta */
.acc { gap: 14px; display: grid; }
.acc-head { display: flex; gap: 14px; align-items: center; }
.acc-av { width: 56px; height: 56px; flex: none; border-radius: 16px; background: #0E1512; color: #F4F2EC; display: grid; place-items: center; font: 800 20px var(--display); letter-spacing: -0.02em; position: relative; overflow: hidden; }
.acc-av::after { content: ""; position: absolute; top: 0; right: 0; width: 18px; height: 15px; background: #C8F25A; }
.acc-list { display: grid; }
.acc-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.acc-row b { text-align: right; font-weight: 700; }
.btn.block { width: 100%; }
.btn.logout { color: var(--bad); border-color: var(--line); font-weight: 800; }

/* iOS 26: las capas "fixed" se recortan a un alto más corto que la pantalla.
   El cuerpo va en flujo normal (no fixed) con el alto real de la pantalla. */
html { height: auto; overflow: visible; overscroll-behavior: none; }
body { position: relative; top: auto; left: auto; right: auto; bottom: auto; width: 100%; overflow: visible; height: var(--app-h, 100dvh); }
@media (display-mode: standalone) { body { height: var(--app-h, 100vh); } }

/* Selector de período (como Bsale) */
.perwrap { position: relative; }
.perbtn { display: flex; align-items: center; gap: 10px; background: #1B2520; border: 1px solid #34423A; color: #F4F2EC; border-radius: 14px; padding: 7px 12px; cursor: pointer; font: 600 13px var(--body); text-align: left; }
.perbtn span { display: grid; line-height: 1.2; }
.perbtn b { font-weight: 800; font-size: 14px; }
.perbtn small { color: #A9B3AD; font-size: 12px; }
.perbtn i { font-style: normal; color: #C8F25A; margin-left: 2px; }
.perpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(14,21,18,.18); padding: 8px; display: grid; gap: 2px; }
.perpop > button { text-align: left; background: none; border: 0; border-radius: 10px; padding: 11px 12px; font: 600 15px var(--body); color: var(--fg); cursor: pointer; }
.perpop > button:hover { background: var(--surface2); }
.perpop > button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.percustom { border-top: 1px solid var(--line); margin-top: 6px; padding: 10px 4px 4px; display: grid; gap: 8px; }
.percustom input { min-width: 0; }
@media (max-width: 560px) { .perwrap { flex: 1 1 100%; } .perbtn { width: 100%; } .perbtn i { margin-left: auto; } .perpop { left: 0; right: 0; width: auto; } }
.perhead { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.perhead .note { font-size: 13px; }

/* Indicadores: variación vs período anterior y margen en % + $ */
.dchip { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); margin-right: 4px; white-space: nowrap; }
.dchip.up { background: var(--ok-bg); color: var(--ok); }
.dchip.down { background: var(--bad-bg); color: var(--bad); }
.kpi.hero .dchip { background: rgba(255,255,255,.12); color: #F4F2EC; }
.kpi.hero .dchip.up { color: #C8F25A; } .kpi.hero .dchip.down { color: #FF9B86; }
.val2 { display: block; font-size: 15px; letter-spacing: -0.01em; margin-top: 2px; opacity: .85; }

/* Gráficos al tamaño real de la pantalla: valores en el eje izquierdo */
.cv2 { overflow: hidden; }
.chart .cv2 svg { width: 100%; min-width: 0; height: auto; display: block; }
.loading { display: flex; align-items: center; gap: 12px; padding: 22px 16px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--lime-text); animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

/* =====================================================================
   Teléfono vs computador
   Teléfono: barra de arriba con logo y tu cuenta, períodos en chips, navegación abajo, tablas como tarjetas.
   Computador: menú lateral, título y período arriba, tablas completas.
   ===================================================================== */
.app { flex: 1; min-height: 0; display: flex; }
.col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.side { display: none; }
.toptitle { display: none; margin: 0; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 12px; background: #1B2520; border: 1px solid #34423A; color: #F4F2EC; font: 800 14px var(--display); letter-spacing: -0.02em; display: inline-grid; place-items: center; position: relative; overflow: hidden; cursor: pointer; padding: 0; }
.avatar::after { content: ""; position: absolute; top: 0; right: 0; width: 11px; height: 9px; background: #C8F25A; }
.chip.empresa { font-size: 12px; vertical-align: middle; margin-left: 4px; font-family: var(--body); letter-spacing: 0; }

/* chips de período (teléfono) */
.perchips { padding: 0 0 12px; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chiprow::-webkit-scrollbar { display: none; }
.pchip { flex: none; border: 1px solid #34423A; background: #1B2520; color: #DCE3DE; border-radius: 99px; padding: 8px 14px; font: 700 14px var(--body); cursor: pointer; white-space: nowrap; }
.pchip[aria-pressed="true"] { background: #C8F25A; border-color: #C8F25A; color: #0E1512; }
.perpop.chipspop { position: static; width: auto; margin: 10px 16px 0; box-shadow: none; }

/* barra de navegación inferior (teléfono) */
.bnav { flex: none; display: grid; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 6; }
.bnav button { background: none; border: 0; display: grid; justify-items: center; gap: 3px; padding: 4px 2px; color: var(--muted); font: 700 11px var(--body); cursor: pointer; -webkit-user-select: none; user-select: none; }
.bnav button svg { width: 44px; height: 30px; padding: 3px 10px; border-radius: 99px; box-sizing: border-box; transition: background .15s; }
.bnav button[aria-current="page"] { color: var(--fg); }
.bnav button[aria-current="page"] svg { background: #C8F25A; color: #0E1512; }

/* hoja "Más" */
.sheet-bg { position: absolute; top: 0; left: 0; right: 0; height: 100%; background: rgba(14,21,18,.5); z-index: 40; display: grid; align-items: end; }
.sheet { background: var(--surface); border-radius: 24px 24px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); justify-self: center; }
.morelist { display: grid; }
.morelist button { display: flex; align-items: center; gap: 14px; background: none; border: 0; border-top: 1px solid var(--line); padding: 14px 4px; font: 700 16px var(--body); color: var(--fg); cursor: pointer; text-align: left; }
.morelist button span { flex: 1; }
.morelist button i { font-style: normal; color: var(--muted); font-size: 20px; }
.morelist button[aria-current="page"] svg { color: var(--lime-text); }

/* formularios plegables */
details.addbox > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; font: 800 16px var(--display); letter-spacing: -0.01em; -webkit-user-select: none; user-select: none; }
details.addbox > summary::-webkit-details-marker { display: none; }
details.addbox .plus { width: 28px; height: 28px; flex: none; border-radius: 9px; background: #C8F25A; color: #0E1512; display: grid; place-items: center; font: 800 20px/1 var(--body); transition: transform .15s; }
details.addbox[open] .plus { transform: rotate(45deg); }

@media (max-width: 899px) {
  .perwrap { display: none !important; }
  .topin { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .topin .brand { margin-right: auto; }
  .topin .stepper { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpi .val { font-size: 22px; }
  .panel { gap: 14px; padding-top: 16px; }
  .perhead h2 { font-size: 24px; }
  /* tablas como tarjetas */
  .tbl { overflow: visible; }
  .tbl table, .tbl tbody, .tbl tfoot, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { border-top: 1px solid var(--line); padding: 12px 0; }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl tfoot tr { background: var(--surface2); border-radius: 12px; padding: 10px 12px; margin-top: 6px; border: 0; }
  .tbl td { position: relative; border: 0; padding: 4px 0 4px 46%; text-align: right; min-height: 24px; white-space: normal; }
  .tbl td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 44%; text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
  .tbl td:first-child { padding-left: 0; text-align: left; font-size: 15px; font-weight: 800; padding-bottom: 6px; }
  .tbl td:first-child::before { display: none; }
  .tbl td:first-child .small, .tbl td:first-child .muted { font-weight: 500; }
  .tbl td[data-label=""] { padding-left: 0; }
  /* fila de total: solo las cifras, en grilla de 2 */
  .tbl tfoot tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; padding: 16px; }
  .tbl tfoot td { padding: 0; text-align: left; min-height: 0; font-size: 17px; font-variant-numeric: tabular-nums; }
  .tbl tfoot td:empty { display: none; }
  .tbl tfoot td::before { position: static; display: block; width: auto; margin-bottom: 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
  .tbl tfoot td:first-child { grid-column: 1 / -1; order: -2; padding: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .tbl tfoot td .small { font-size: 12px; font-weight: 600; }
  .tbl tfoot #tf-b { grid-column: 1 / -1; order: -1; font-family: var(--display); font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .tbl tfoot #tf-b::before { font-family: var(--body); letter-spacing: 0.06em; }
  .tbl tfoot #tf-pd::before { content: "Prom. diario"; }
  .tbl tfoot tr:has(#tf-b) td:first-child { display: none; }
  .tbl tfoot #tf-b::before { content: "Ventas totales"; }
  .tbl tfoot #tf-d { display: none; }
  .tbl td select, .tbl td input { max-width: 100%; }
  .tbl td .row { justify-content: flex-end; }
}

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; gap: 6px; width: 248px; flex: none; background: #0E1512; color: #F4F2EC; padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px; overflow-y: auto; overscroll-behavior: contain; }
  .side-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 18px; }
  .side-brand b { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; }
  .side-brand span { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: #C8F25A; }
  .side-nav { display: grid; gap: 2px; }
  .side-nav button { display: flex; align-items: center; gap: 12px; background: none; border: 0; border-radius: 12px; padding: 10px 12px; color: #A9B3AD; font: 700 14px var(--body); cursor: pointer; text-align: left; }
  .side-nav button:hover { background: #1B2520; color: #F4F2EC; }
  .side-nav button[aria-current="page"] { background: #1B2520; color: #F4F2EC; }
  .side-nav button[aria-current="page"] svg { color: #C8F25A; }
  .side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; background: none; border: 1px solid #26332C; border-radius: 14px; padding: 10px; color: #F4F2EC; cursor: pointer; text-align: left; }
  .side-user:hover { background: #1B2520; }
  .side-user span:last-child { display: grid; min-width: 0; }
  .side-user b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user small { color: #A9B3AD; font-size: 12px; }
  .side-user .avatar { pointer-events: none; }
  .bnav, .perchips, .top .brand, #avatarBtn { display: none !important; }
  .top { background: var(--surface); color: var(--fg); border-bottom: 1px solid var(--line); padding-top: 0; }
  .topin { max-width: none; padding: 14px max(24px, calc((100% - 1148px) / 2)); }
  .toptitle { display: block; margin-right: auto; font-size: 22px; }
  .top .stepper { background: var(--surface); border-color: var(--line); }
  .top .stepper button, .top .stepper strong { color: var(--fg); }
  .top .stepper button:hover { background: var(--surface2); }
  .perbtn { background: var(--surface); border-color: var(--line); color: var(--fg); }
  .perbtn small { color: var(--muted); }
  .perbtn i { color: var(--lime-text); }
}

/* Mejores máquinas */
.top3 { display: grid; gap: 8px; margin-top: 10px; }
.t3 { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--fg); font: inherit; }
.t3:hover { border-color: var(--fg); }
.t3n { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font: 800 15px var(--display); }
.t3:first-child .t3n { background: #C8F25A; color: #0E1512; }
.t3i { flex: 1; min-width: 0; display: grid; gap: 2px; }
.t3i b { font-family: var(--mono, inherit); }
.t3i > .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t3i small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.t3v { display: grid; justify-items: end; gap: 4px; }
.t3v .dchip { margin: 0; }
.dot.ok, .dot.warn, .dot.bad { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: #D9A521; } .dot.bad { background: var(--bad); }

/* Filtros de máquinas */
.filtros { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 12px 0 6px; align-items: end; }
.filtros .search input { padding-left: 36px; background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234B5550' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; border-color: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 899px) { .filtros { grid-template-columns: 1fr 1fr; } .filtros .search { grid-column: 1 / -1; } }
.tbl tr[hidden], .tbl tfoot[hidden] { display: none !important; }

/* Selector barras / línea */
.seg { display: inline-flex; background: var(--surface2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; border-radius: 8px; padding: 5px 9px; font: 700 12px var(--body); color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(14,21,18,.12); }
.legend .ln { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--fg); vertical-align: middle; margin-right: 6px; border-radius: 0; background: none; }
.legend .ln.dash { border-top: 2px dashed var(--muted); }
.legend .ln.dash.lime { border-top-color: var(--lime-text); }
.chart .seg svg { width: 16px; min-width: 0; height: 16px; display: inline-block; }

/* Productos con foto, precios con margen al tiro, recepción y stock */
.thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface2); display: inline-grid; place-items: center; font: 800 13px var(--display); color: var(--muted); border: 1px solid var(--line); }
.prodcell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.prodcell b { display: block; }
input.pin { width: 110px; text-align: right; font-weight: 800; }
tr.inactivo td { opacity: .55; }
.btn.icon { padding: 6px 9px; line-height: 1; }
.filtros.one { grid-template-columns: 1fr; }
.reclines { display: grid; gap: 10px; }
.recline { position: relative; display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1.2fr); gap: 10px; align-items: end; background: var(--surface2); border-radius: 14px; padding: 12px 40px 12px 12px; }
.rl-prod { display: flex; gap: 10px; align-items: end; min-width: 0; }
.rl-prod .f { flex: 1; min-width: 0; }
.rl-foto { position: relative; cursor: pointer; flex: none; }
.rl-foto i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 12px; background: var(--surface); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); }
.rl-tot { display: grid; justify-items: end; gap: 2px; padding-bottom: 6px; }
.rl-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; }
.rectot { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; padding: 12px 14px; background: var(--fg); color: var(--bg); border-radius: 14px; font-size: 14px; }
.rectot b { font-family: var(--display); font-size: 17px; margin-left: 6px; }
.rectot span:last-child b { color: #C8F25A; }
.stk { display: inline-grid; place-items: center; min-width: 40px; padding: 3px 10px; border-radius: 99px; font-weight: 800; }
.stk.ok { background: var(--ok-bg); color: var(--ok); } .stk.warn { background: var(--warn-bg); color: var(--warn); } .stk.bad { background: var(--bad-bg); color: var(--bad); }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 899px) {
  .split2 { grid-template-columns: 1fr; }
  .recline { grid-template-columns: 1fr 1fr; padding: 12px; }
  .recline .rl-prod { grid-column: 1 / -1; padding-right: 30px; }
  .rl-tot { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; padding: 0; }
  .rectot { justify-content: space-between; }
  .tbl td:first-child .prodcell { min-width: 0; }
  input.pin { width: 120px; }
}

/* Stock por ubicación y archivos */
.locchips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin-top: 8px; scrollbar-width: none; }
.locchips::-webkit-scrollbar { display: none; }
.locchip { flex: none; display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; cursor: pointer; color: var(--fg); font: inherit; }
.locchip b { font-size: 13px; } .locchip small { color: var(--muted); font-size: 12px; font-weight: 700; }
.locchip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.locchip[aria-pressed="true"] small { color: #C8F25A; }
input[type="file"] { font: 600 13px var(--body); color: var(--muted); padding: 6px; }
input[type="file"]::file-selector-button { border: 0; background: var(--fg); color: var(--bg); border-radius: 8px; padding: 8px 12px; margin-right: 10px; font: 700 13px var(--body); cursor: pointer; }
@media (min-width: 900px) { .solo-tel { display: none; } }

/* Actualizar datos */
.refbtn { width: 38px; height: 38px; flex: none; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; background: #1B2520; border: 1px solid #34423A; color: #F4F2EC; padding: 0; }
.refbtn.girando svg { animation: rot .8s linear infinite; }
.refhora { display: none; }

/* Computador: barra superior compacta (título + fechas en una sola línea) y menú plegable */
@media (min-width: 900px) {
  .perhead { display: none !important; }
  .topin { padding: 10px max(24px, calc((100% - 1148px) / 2)); gap: 12px; flex-wrap: nowrap; align-items: center; }
  .toptitle { display: grid; gap: 1px; margin-right: auto; min-width: 0; }
  .toptitle h1 { font-size: 20px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toptitle h1 .chip { font-size: 12px; }
  #topSub { font-size: 12.5px; }
  .refbtn { background: var(--surface); border-color: var(--line); color: var(--fg); }
  .refbtn:hover { background: var(--surface2); }
  .refhora { display: inline; font-size: 12px; color: var(--muted); white-space: nowrap; }
  .perbtn { padding: 6px 12px; }
  .side { transition: width .2s ease, padding .2s ease; }
  .side-brand { position: relative; }
  .side-min-btn { margin-left: auto; width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: #A9B3AD; display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
  .side-min-btn:hover { background: #1B2520; color: #F4F2EC; }
  body.side-min .side { width: 76px; padding-left: 12px; padding-right: 12px; }
  body.side-min .side-brand { flex-direction: column; gap: 10px; padding: 4px 0 14px; }
  body.side-min .side-brand b, body.side-min .side-brand .brandtag, body.side-min .side-nav button span, body.side-min .side-user span:last-child { display: none; }
  body.side-min .side-min-btn { margin: 0; transform: rotate(180deg); }
  body.side-min .side-nav button { justify-content: center; padding: 11px 0; }
  body.side-min .side-user { justify-content: center; padding: 8px 0; border-color: transparent; }
}
/* v25: máquina elegida desde "Mejores máquinas" */
.solo-maq{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin:10px 0 12px;padding:10px 14px;border-radius:12px;background:#F4FBE3;border:1px solid #D9EFA5}
.solo-maq b{font-size:15px}
.t3{cursor:pointer}
/* v27: ubicación de edificios (aviso al llegar) */
.geo-row{display:grid;grid-template-columns:minmax(180px,1fr) 96px 170px;gap:8px;align-items:center;padding:8px 10px}
.geo-row input,.geo-row select{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:inherit;min-width:0}
.geo-row .geo-n{text-align:right;font-variant-numeric:tabular-nums}
@media (max-width:899px){.geo-row{grid-template-columns:1fr 92px;padding:4px 0 0}.geo-row>.row{grid-column:1/-1}}
.geo-td{padding:0!important;width:62%}
@media (max-width:899px){.tbl td.geo-td{display:block;width:100%}.geo-td .geo-row{width:100%}}
/* v29: en iPhone (iOS 26) el borde superior toma el color de fondo de la página: oscuro, como la barra de arriba */
@media (max-width: 899px) { html { background: #0E1512; } }
/* v34: pantalla del reponedor */
.auth.rep { place-items: start center; grid-template-columns: minmax(0, 560px); justify-content: center; }
.auth.rep .box { max-width: 560px; min-width: 0; padding-bottom: 0; }
.auth.rep .repmaq .chip { background: var(--surface); }
.rephead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 56px; }
.rephead h1 { margin: 0; }
.repmaq { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface2); border-radius: 14px; padding: 12px 14px; }
.replist { display: grid; }
.reprow { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.reprow.falta .rpn > b { color: var(--fg); }
.rpn { display: grid; gap: 2px; }
.rpn b { font-size: 15px; }
.rpi { display: flex; gap: 10px; flex-wrap: wrap; }
.rstep { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.rstep span { min-width: 46px; }
.rstep button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 800 18px var(--body); cursor: pointer; }
.rstep input { width: 48px; height: 36px; text-align: center; font: 800 16px var(--body); border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.repfoot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 6px; border-top: 1px solid var(--line); }
.repfoot .btn { padding: 14px; font-size: 15px; }
.repchk { display: grid; gap: 6px; margin-top: 4px; font-weight: 600; color: var(--fg); }
.repchk label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.auth.rep .box { grid-template-columns: minmax(0, 1fr); }
.auth.rep .box > * { min-width: 0; }
.grid-form .repchk label { display: flex !important; flex-direction: row; align-items: center; gap: 8px; width: auto; }
.grid-form .repchk input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin: 0; }
/* v35: pantalla de la máquina */
.pthumb { width: 54px; height: 72px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: #0E1512; color: #C8F25A; font: 800 16px var(--display); }
.pthumb.m { background: #1B2520; }
.pt-td { width: 64px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
/* Reponer desde Stock (operador / HQ) */
.opsrep { display: grid; gap: 10px; }
.opsrep .repfoot { margin: 0 -16px -16px; padding-left: 16px; padding-right: 16px; border-radius: 0 0 var(--r) var(--r); }
@media (min-width: 700px) { .opsrep .reprow { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
@media (max-width: 899px) {
  .rpi { gap: 8px; flex-wrap: nowrap; justify-content: space-between; }
  .rstep { gap: 3px; font-size: 11px; }
  .rstep span { min-width: 0; margin-right: 2px; }
  .rstep button { width: 32px; height: 34px; font-size: 16px; }
  .rstep input { width: 38px; height: 34px; font-size: 15px; }
}

/* Pedidos de stock */
.pedgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pedgrid > div { display: grid; gap: 16px; min-width: 0; }
.pedcat { margin: 16px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pedrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pedrow:last-child { border-bottom: 0; }
.pedinfo { flex: 1; min-width: 0; }
.pedinfo b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pedcart { position: sticky; top: 12px; }
.pedcart .f { display: grid; gap: 4px; margin-top: 8px; }
.pedtot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.pedcard { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pedcard:last-child { border-bottom: 0; }
@media (max-width: 899px) {
  .pedgrid { grid-template-columns: 1fr; }
  .pedcart { position: static; }
}
.btn.sm[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.neg { color: var(--bad); }
.pedrow.agotado .pedinfo b { opacity: .55; }

/* Alertas: lo que hay que atender hoy */
.alertas.ok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alertas.ok .dot, .al.media .dot { background: var(--warn); }
.alertas.ok .dot { background: var(--ok); }
.allist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.al { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.al:last-child { border-bottom: 0; }
.al .dot, .alertas.ok .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.al.alta .dot { background: var(--bad); }

/* Ubicaciones: nota de 1 a 5 */
.stars { display: inline-flex; gap: 3px; }
.stars .st { width: 14px; height: 14px; border-radius: 4px; background: var(--surface2); overflow: hidden; display: block; }
.stars .st span { display: block; height: 100%; background: var(--lime); }
button.lnk { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
button.lnk:hover b { text-decoration: underline; }
tr.sel td { background: var(--surface2); }
/* Ubicaciones */
.ubi-wrap { display: grid; gap: 14px; margin-top: 12px; }
@media (min-width: 900px) { .ubi-wrap { grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); align-items: start; margin-top: 0; } .ubi-der { position: sticky; top: 12px; } }
.ubi-izq { display: grid; gap: 14px; min-width: 0; }
.ubi-der { min-width: 0; }
.ubi-form fieldset { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; display: grid; gap: 12px; }
.ubi-seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.ubi-seg button { justify-content: center; padding: 8px 6px; font-size: 13px; }
.ubi-campos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.ubi-campos label:first-child { grid-column: 1 / -1; }
.ubi-mas summary, .ubi-how summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); list-style: none; }
.ubi-mas summary::-webkit-details-marker, .ubi-how summary::-webkit-details-marker { display: none; }
.ubi-mas summary::before, .ubi-how summary::before { content: "+"; display: inline-block; width: 14px; color: var(--lime-text); font-weight: 800; }
.ubi-mas[open] summary::before, .ubi-how[open] summary::before { content: "–"; }
.ubi-mas .f { margin-top: 8px; max-width: 220px; }
.ubi-go { width: 100%; padding: 12px; font-size: 14px; }
.ubi-how { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.ubi-how p { margin: 8px 0 0; }
.ubi-res { display: grid; gap: 14px; }
.ubi-top { display: flex; gap: 14px; align-items: center; }
.ubi-tt { display: grid; gap: 2px; min-width: 0; justify-items: start; }
.ubi-tt h3 { font-size: 20px; margin-top: 4px; }
.ubi-ring { position: relative; width: 84px; height: 84px; flex: none; }
.ubi-ring svg { width: 100%; height: 100%; display: block; }
.ubi-ring circle { fill: none; stroke-width: 8; }
.ubi-ring .bg { stroke: var(--surface2); }
.ubi-ring .fg { stroke-linecap: round; }
.ubi-ring.ok .fg, .ubi-bar .ok { stroke: #8DBE24; background: #8DBE24; }
.ubi-ring.warn .fg, .ubi-bar .warn { stroke: #E3A21A; background: #E3A21A; }
.ubi-ring.bad .fg, .ubi-bar .bad { stroke: #D0452E; background: #D0452E; }
.ubi-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ubi-ring b { font-family: var(--display); font-size: 26px; letter-spacing: -.03em; }
.ubi-ring small { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.ubi-map { position: relative; isolation: isolate; z-index: 0; height: 220px; border-radius: 12px; overflow: hidden; background: var(--surface2); border: 1px solid var(--line); }
@media (min-width: 900px) { .ubi-map { height: 280px; } }
.ubi-map .leaflet-tile-pane { filter: grayscale(1) brightness(1.03) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ubi-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); } }
:root[data-theme="dark"] .ubi-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); }
.ubi-map .leaflet-control-attribution { font-size: 9px; background: rgba(255,255,255,.7); }
.ubi-map.sinmapa { display: grid; place-content: center; color: var(--muted); font-size: 12px; }
.ubi-pin span { display: block; width: 26px; height: 26px; border-radius: 50%; background: #C8F25A; border: 4px solid #0E1512; box-shadow: 0 2px 10px rgba(14,21,18,.35); }
.ubi-maprow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: -6px; }
.ubi-maprow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubi-maprow a { color: var(--fg); font-weight: 700; white-space: nowrap; }
.ubi-ojo { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; }
.ubi-ojo p { margin: 0; } .ubi-ojo p + p { margin-top: 6px; }
.ubi-fs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .ubi-fs { grid-template-columns: 1fr; gap: 10px; } }
.ubi-fh { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.ubi-fh em { font-style: normal; color: var(--muted); font-weight: 600; font-size: 11px; margin-left: 5px; }
.ubi-bar { height: 7px; border-radius: 6px; background: var(--surface2); margin: 6px 0 4px; overflow: hidden; }
.ubi-bar span { display: block; height: 100%; border-radius: 6px; }
.ubi-sub { font-weight: 800; font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: -8px; }
.ubi-com { list-style: none; margin: 0; padding: 0; display: grid; }
.ubi-com li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ubi-com li:last-child { border-bottom: 0; }
.ubi-com .dot { width: 10px; height: 10px; border-radius: 50%; background: #D0452E; flex: none; }
.ubi-com span { flex: 1; min-width: 0; display: grid; }
.ubi-com b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ubi-com small { color: var(--muted); font-size: 11.5px; }
.ubi-com em { font-style: normal; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.ubi-gest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 560px) { .ubi-gest { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ubi-gest .btn { grid-column: 1 / -1; } }
.ubi-acts { display: flex; gap: 8px; }
.ubi-acts .btn { flex: 1; padding: 11px; }
.ubi-vacio { justify-items: center; text-align: center; padding: 40px 20px; color: var(--muted); gap: 8px; }
.ubi-vacio b { color: var(--fg); font-size: 15px; }
.ubi-vacio p { margin: 0; max-width: 300px; }
.ubi-steps { list-style: none; margin: 2px 0 0; padding: 0 0 0 2px; display: grid; gap: 12px; }
.ubi-steps li { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.ubi-steps i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-content: center; }
.ubi-steps li.ahora { color: var(--fg); font-weight: 700; }
.ubi-steps li.ahora i { border-color: var(--lime-text); border-top-color: transparent; animation: rot .8s linear infinite; }
.ubi-steps li.hecho { color: var(--fg); }
.ubi-steps li.hecho i { background: var(--lime); border-color: var(--lime); }
.ubi-steps li.hecho i::after { content: ""; width: 7px; height: 4px; border: 2px solid var(--on-lime); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ubi-rows { display: grid; margin-top: 4px; }
.ubi-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer; width: calc(100% + 16px); }
.ubi-row:first-child { border-top: 0; }
.ubi-row:hover, .ubi-row[aria-current="true"] { background: var(--surface2); border-radius: 10px; border-top-color: transparent; }
.ubi-row[aria-current="true"] + .ubi-row, .ubi-row:hover + .ubi-row { border-top-color: transparent; }
.ubi-pill { width: 42px; height: 42px; border-radius: 12px; display: grid; place-content: center; font-family: var(--display); font-weight: 800; font-size: 15px; flex: none; }
.ubi-pill.ok { background: var(--ok-bg); color: var(--ok); }
.ubi-pill.warn { background: var(--warn-bg); color: var(--warn); }
.ubi-pill.bad { background: var(--bad-bg); color: var(--bad); }
.ubi-rt { flex: 1; min-width: 0; display: grid; }
.ubi-rt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubi-rt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubi-rr { display: grid; justify-items: end; gap: 2px; flex: none; }
.ubi-rr small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 420px) { .ubi-rr { display: none; } }
@media (max-width: 899px) { .ubi-izq { display: contents; } .ubi-form { order: 1; } .ubi-der { order: 2; } .ubi-list { order: 3; } }

/* Atrás y hoja "Más" */
.backbtn[hidden] { display: none !important; }
.backbtn svg { margin-left: -2px; }
@keyframes hojaSube { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fondoEntra { from { background-color: rgba(14,21,18,0); } }
.sheet-bg:not([hidden]) { animation: fondoEntra .22s ease; }
.sheet { animation: hojaSube .28s cubic-bezier(.2,.8,.2,1); max-height: calc(100% - 48px); overflow-y: auto; overscroll-behavior: contain; will-change: transform; }
.sheet .grab { width: 44px; height: 5px; margin: -4px auto 2px; box-shadow: 0 0 0 14px transparent; }
.sheet h3 { display: flex; justify-content: space-between; align-items: center; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg:not([hidden]) { animation: none; } }
.ubi-gest-op { display: flex; grid-template-columns: none; justify-content: space-between; align-items: center; gap: 12px; }
.ubi-gest-op .btn { flex: none; }
@media (max-width: 560px) { .ubi-gest-op .btn { grid-column: auto; } }
/* Ubicaciones: nada puede ser más ancho que la pantalla */
.ubi-wrap { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ubi-wrap { grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); } }
.ubi-res { grid-template-columns: minmax(0, 1fr); }
.ubi-res > *, .ubi-form, .ubi-list { min-width: 0; max-width: 100%; }
.ubi-maprow { flex-wrap: wrap; }
.ubi-maprow span { white-space: normal; overflow: visible; flex: 1 1 200px; }
.ubi-tt h3, .ubi-tt div { overflow-wrap: anywhere; }
/* Mapa de ubicaciones: botón Ampliar y pantalla completa */
.ubi-mapwrap { position: relative; }
.ubi-amp { position: absolute; right: 8px; bottom: 22px; z-index: 2; font: 700 12px var(--body); background: #0E1512; color: #F4F2EC; border: 0; border-radius: 99px; padding: 7px 12px; cursor: pointer; box-shadow: 0 2px 8px rgba(14,21,18,.3); }
.ubi-full { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fondoEntra .18s ease; }
.ubi-full-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: #0E1512; color: #F4F2EC; }
.ubi-full-top div { display: grid; min-width: 0; }
.ubi-full-top b { font-family: var(--display); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubi-full-top small { color: #C9D1CC; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubi-full-map { position: relative; isolation: isolate; z-index: 0; min-height: 0; background: var(--surface2); }
.ubi-full-map .leaflet-tile-pane { filter: grayscale(1) brightness(1.03) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ubi-full-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); } }
:root[data-theme="dark"] .ubi-full-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); }
.ubi-full-map .ubi-pin { cursor: grab; }
.ubi-full-map .ubi-pin span { width: 30px; height: 30px; margin: -2px; }
.ubi-full-bar { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; }
.ubi-full-bar p { margin: 0; font-size: 13px; color: var(--muted); }
.ubi-full-bar p b { color: var(--fg); }
@media (min-width: 900px) { .ubi-full { inset: 24px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 100vmax rgba(14,21,18,.55), 0 20px 60px rgba(14,21,18,.35); } .ubi-full-bar { padding-bottom: 14px; } }
/* Ruta de reposición */
.ruta-ctl-in { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.ruta-ctl-in > div { display: grid; gap: 4px; }
.ruta-ctl-in .btn { margin-left: auto; }
.ruta-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ruta-kpis div { background: var(--surface2); border-radius: 12px; padding: 10px 12px; display: grid; min-width: 0; }
.ruta-kpis b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; white-space: nowrap; }
.ruta-kpis span { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .ruta-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ruta-kpis div:last-child { grid-column: 1 / -1; } }
.ruta-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ruta-acts .btn { flex: 1 1 200px; text-align: center; text-decoration: none; padding: 11px 14px; }
.ruta-grid { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .ruta-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.ruta-map { position: relative; isolation: isolate; z-index: 0; height: 260px; border-radius: 12px; overflow: hidden; background: var(--surface2); border: 1px solid var(--line); margin: 10px 0 4px; }
.ruta-map .leaflet-tile-pane { filter: grayscale(1) brightness(1.03) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ruta-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); } }
:root[data-theme="dark"] .ruta-map .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.85) contrast(.9); }
.ruta-map.sinmapa { display: grid; place-content: center; color: var(--muted); font-size: 12px; }
.ruta-pin span { display: grid; place-content: center; width: 28px; height: 28px; border-radius: 50%; background: #C8F25A; color: #0E1512; border: 3px solid #0E1512; font: 800 12px var(--body); box-shadow: 0 2px 8px rgba(14,21,18,.3); }
.ruta-pin.urg span { background: #D0452E; color: #fff; }
.ruta-pin.bod span { width: 30px; height: 30px; border-radius: 9px; background: #0E1512; color: #C8F25A; border-color: #0E1512; }
.ruta-list { display: grid; margin-top: 6px; }
.ruta-parada { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ruta-parada:first-child { border-top: 0; }
.ruta-n { width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--on-lime); display: grid; place-content: center; font-weight: 800; flex: none; }
.ruta-n.urg { background: #D0452E; color: #fff; }
.ruta-pc { flex: 1; min-width: 0; display: grid; gap: 8px; }
.ruta-ph { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ruta-ph > div:first-child { min-width: 0; }
.ruta-nav { display: flex; gap: 6px; flex: none; }
.ruta-nav .btn { text-decoration: none; }
.ruta-maq { background: var(--surface2); border-radius: 10px; padding: 9px 11px; display: grid; gap: 4px; }
.ruta-mh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ruta-lv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ruta-lv span { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; font-size: 12px; }
.ruta-pick { display: grid; margin-top: 6px; }
.ruta-pick div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ruta-pick div:first-child { border-top: 0; }
.ruta-pick span { font-weight: 600; font-size: 13px; }
.ruta-pick b { font-family: var(--display); font-size: 17px; text-align: right; }
.ruta-pick small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.ruta-pick .falta small { color: var(--bad); font-weight: 700; }
.ruta-esp { margin-top: 14px; }
.ruta-esp summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; list-style: none; }
.ruta-esp summary::-webkit-details-marker { display: none; }
.ruta-esp-l { display: grid; margin-top: 8px; }
.ruta-esp-l div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rep-vistas { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 4px 0 12px; }
.rep-vistas button { justify-content: center; padding: 9px; font-size: 14px; }

/* =====================================================================
   v-club (oct 2026): misma estética que la app Cornerbox de los vecinos.
   Modo claro: todo blanco, barra y menú blancos, logo negro. Modo oscuro: negro total (como X), grises neutros.
   ===================================================================== */
:root { --ch-bg: #FFFFFF; --ch-fg: #0E1512; --ch-2: #F2F2EF; --ch-line: #E5E3DD; --ch-muted: #4B5550; --logo-box: #0E1512; --logo-handle: #C8F25A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #16181C; --surface2: #202327; --fg: #F5F5F5; --muted: #8B9095; --line: #2F3336;
  --ok-bg: #12261A; --warn-bg: #2E2610; --bad-bg: #3A1714; --bar-own: #E7E9EA;
  --ch-bg: #000000; --ch-fg: #F5F5F5; --ch-2: #16181C; --ch-line: #2F3336; --ch-muted: #8B9095; --logo-box: #F4F2EC; --logo-handle: #0E1512; } }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #16181C; --surface2: #202327; --fg: #F5F5F5; --muted: #8B9095; --line: #2F3336;
  --ok-bg: #12261A; --warn-bg: #2E2610; --bad-bg: #3A1714; --bar-own: #E7E9EA;
  --ch-bg: #000000; --ch-fg: #F5F5F5; --ch-2: #16181C; --ch-line: #2F3336; --ch-muted: #8B9095; --logo-box: #F4F2EC; --logo-handle: #0E1512; }
.lg-box { fill: var(--logo-box); } .lg-handle { fill: var(--logo-handle); }
html { background: var(--bg); }
@media (max-width: 899px) { html { background: var(--ch-bg); } }

/* barra de arriba (teléfono) */
.top { background: var(--ch-bg); color: var(--ch-fg); border-bottom: 1px solid var(--ch-line); }
.top .brand b { color: var(--ch-fg); }
.top .brand span { color: var(--lime-text); }
.top .stepper { background: var(--ch-2); border-color: var(--ch-line); }
.top .stepper button, .top .stepper strong { color: var(--ch-fg); }
.top .stepper button:hover { background: var(--ch-line); }
.top nav.tabs button { color: var(--ch-muted); }
.top nav.tabs button[aria-selected="true"] { color: var(--ch-fg); border-bottom-color: var(--lime); }
.userbtn { border-color: var(--ch-line); color: var(--ch-fg); }
.userbtn:hover { background: var(--ch-2); }
.perbtn { background: var(--ch-2); border-color: var(--ch-line); color: var(--ch-fg); }
.perbtn small { color: var(--ch-muted); }
.perbtn i { color: var(--lime-text); }
.avatar { background: var(--ch-2); border-color: var(--ch-line); color: var(--ch-fg); }
.refbtn { background: var(--ch-2); border-color: var(--ch-line); color: var(--ch-fg); }
.pchip { border-color: var(--ch-line); background: var(--ch-2); color: var(--ch-fg); }
.pchip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* navegación de abajo como en la app de vecinos: ícono de color, sin pastilla */
.bnav { background: var(--ch-bg); border-top-color: var(--ch-line); }
.bnav button svg { width: 24px; height: 24px; padding: 0; border-radius: 0; }
.bnav button[aria-current="page"] svg { background: none; color: var(--lime-text); }

/* entrar: fondo de la app, sin esquina de color */
.auth { background: var(--bg); }
.auth .box { border: 1px solid var(--line); }
.auth .box::after { display: none; }
.auth.rep .box { border: 0; }

/* indicador principal: tarjeta oscura con la esquina lima */
.kpi.hero { background: #0E1512; color: #F5F5F5; border-color: #0E1512; }
.kpi.hero::after { display: block; }
.kpi.hero .lab, .kpi.hero .sub { color: rgba(245, 245, 245, .66); }
.kpi.hero .dchip { background: rgba(255, 255, 255, .12); color: #F5F5F5; }
.kpi.hero .dchip.up { color: #C8F25A; } .kpi.hero .dchip.down { color: #FF9B86; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi.hero { background: var(--surface); border-color: var(--line); } }
:root[data-theme="dark"] .kpi.hero { background: var(--surface); border-color: var(--line); }

.solo-maq { background: color-mix(in srgb, var(--lime) 16%, var(--surface)); border-color: color-mix(in srgb, var(--lime) 45%, var(--line)); }
.ubi-full-top { background: var(--ch-bg); color: var(--ch-fg); border-bottom: 1px solid var(--ch-line); }

/* computador: menú lateral blanco (negro en modo oscuro) */
@media (min-width: 900px) {
  .side { background: var(--ch-bg); color: var(--ch-fg); border-right: 1px solid var(--ch-line); }
  .side-brand span { color: var(--lime-text); }
  .side-nav button { color: var(--ch-muted); }
  .side-nav button:hover { background: var(--ch-2); color: var(--ch-fg); }
  .side-nav button[aria-current="page"] { background: var(--ch-2); color: var(--ch-fg); }
  .side-nav button[aria-current="page"] svg { color: var(--lime-text); }
  .side-user { border-color: var(--ch-line); color: var(--ch-fg); }
  .side-user:hover { background: var(--ch-2); }
  .side-user small { color: var(--ch-muted); }
  .side-min-btn { color: var(--ch-muted); }
  .side-min-btn:hover { background: var(--ch-2); color: var(--ch-fg); }
  .top { background: var(--ch-bg); }
  .refbtn { background: var(--ch-bg); }
}
.vermas { margin-top: 10px; }
/* destacado de marca: lima como trazo de plumón (igual que en la app de vecinos) */
.mk { color: #0E1512; font-weight: 800; padding: .16em .22em .06em; margin: 0 -.06em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cpath d='M5 12.5 C 48 7.5, 104 9.8, 162 7.2 S 262 5.4, 296 8.6 C 298.6 12.2, 297.2 18.4, 293.8 22.6 C 238 24.8, 170 27.6, 104 25.4 S 30 27.8, 7.4 28.2 C 2.6 24.4, 2.2 16.8, 5 12.5 Z' fill='%23C8F25A'/%3E%3C/svg%3E") no-repeat center / 100% 100%; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---- Teléfono: barra de arriba con el logo al centro (como la app de vecinos) ---- */
@media (max-width: 899px) {
  .topin { display: grid; grid-template-columns: 40px 40px 1fr 40px 40px; align-items: center; gap: 6px; padding: 8px 14px; }
  .topin > * { grid-row: 1; }
  .topin .backbtn { grid-column: 1; justify-self: start; }
  .topin .brand { grid-column: 3; justify-self: center; margin: 0; }
  .topin .refbtn:not(.backbtn) { grid-column: 4; justify-self: end; width: 38px; height: 38px; }
  .topin #avatarBtn { grid-column: 5; justify-self: end; }
  .topin .perwrap, .topin .stepper, .topin .refhora, .topin .toptitle { display: none !important; }
  .top .brand b { font-size: 20px; }
  /* períodos dentro del contenido, bajo el título */
  #view .perchips { padding: 0; margin: -4px -16px 0; }
  #view .perchips .chiprow { padding: 0 16px; }
  #view .perchips .perpop.chipspop { margin: 10px 16px 0; }
  .pchip { padding: 7px 13px; font-size: 13px; }
  .panel { gap: 16px; padding-top: 16px; }
  .perhead h2 { font-size: 26px; }
}
/* la barra de mes (Tarifa, Operadores, Pagos) también va en el contenido en el teléfono */
@media (max-width: 899px) { .top .stepper { display: none !important; } }

/* Para hoy */
.hoylink { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--fg); }
.hoylink > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.hoylink .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hoylink i { font-style: normal; font-size: 22px; color: var(--muted); }
.hoyn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 800 17px var(--display); background: var(--warn-bg); color: var(--warn); }
.hoyn.alta { background: var(--bad-bg); color: var(--bad); }
.blk { display: grid; gap: 8px; }
.blkh { font-size: 15px; color: var(--muted); font-family: var(--body); font-weight: 800; letter-spacing: 0; }
.nico { position: relative; display: inline-grid; }
.nbadge { position: absolute; top: -4px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font: 800 10px/17px var(--body); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--ch-bg); }
.mesbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface2); border-radius: 14px; padding: 6px; }
.mesbar b { font: 800 16px var(--display); text-transform: capitalize; }
.mesbar .refbtn { background: var(--surface); font-size: 20px; }
@media (min-width: 900px) { .mesbar { display: none; } }
.panel { grid-template-columns: minmax(0, 1fr); }
#view .perchips, #view .perchips .chiprow { min-width: 0; }

/* barra de abajo: la pestaña elegida va en un recuadro lima (como en las apps de punto de venta) */
.bnav button { gap: 4px; }
.bnav button .nico { width: 54px; height: 36px; border-radius: 12px; place-items: center; transition: background .15s; }
.bnav button[aria-current="page"] .nico { background: var(--lime); }
.bnav button[aria-current="page"] svg { color: #0E1512; stroke-width: 2.3; }
.bnav button[aria-current="page"] > span:last-child { color: var(--fg); font-weight: 800; }
.bnav button[data-act="more"] svg { width: 24px; height: 24px; }

/* =====================================================================
   Estilo iOS (oct 2026), igual que Rendi y la app Cornerbox: letra del sistema, fondo gris
   (negro en modo oscuro), bloques rellenos sin borde, líneas finas y botones más suaves.
   La marca sigue en el logo (Bricolage) y el lima.
   ===================================================================== */
:root {
  --display: -apple-system, "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --body: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
}
:root:not([data-theme="dark"]) { --bg: #F2F2F7; --surface: #FFFFFF; --surface2: #EEEEF3; --fg: #000000; --muted: #6C6C70; --line: #E2E2E7;
  --ch-bg: #F9F9FB; --ch-fg: #000000; --ch-2: #EEEEF3; --ch-line: #E2E2E7; --ch-muted: #6C6C70; --logo-box: #000000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #1C1C1E; --surface2: #2C2C2E; --fg: #FFFFFF; --muted: #8E8E93; --line: #38383A;
  --ch-bg: #0B0B0C; --ch-fg: #FFFFFF; --ch-2: #1C1C1E; --ch-line: #38383A; --ch-muted: #8E8E93; --logo-box: #F4F2EC; } }
:root[data-theme="dark"] { --bg: #000000; --surface: #1C1C1E; --surface2: #2C2C2E; --fg: #FFFFFF; --muted: #8E8E93; --line: #38383A;
  --ch-bg: #0B0B0C; --ch-fg: #FFFFFF; --ch-2: #1C1C1E; --ch-line: #38383A; --ch-muted: #8E8E93; --logo-box: #F4F2EC; }
body { font-size: 15px; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
.perhead h2 { font-weight: 700; }
.brand b, .side-brand b, .auth .lockup b { font-family: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif; }
/* barras con línea fina */
.top { border-bottom: .5px solid var(--ch-line); }
.bnav { border-top: .5px solid var(--ch-line); }
@media (min-width: 900px) { .side { border-right: .5px solid var(--ch-line); } }
/* bloques rellenos, sin borde */
.card, .kpi { border: 0; border-radius: 16px; }
.kpi .lab { font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 13px; }
.kpi .val { font-weight: 700; }
.kpi.hero { background: #000000; border: 0; }
.auth .box { border: 0; }
th { font-weight: 600; letter-spacing: .02em; }
td, th { border-bottom-width: .5px; }
tfoot td { font-weight: 700; border-top: .5px solid var(--line); }
.code { font-weight: 700; }
.blkh { font-weight: 600; }
/* botones, chips y campos */
.btn { font-weight: 600; font-size: 14px; border: 0; background: var(--surface2); border-radius: 12px; }
.btn:hover { background: var(--line); }
.btn.primary, .btn.dark { border: 0; }
.btn.sm { border-radius: 99px; }
.btn.logout { font-weight: 600; }
.linkbtn { font-weight: 600; }
.chip { font-weight: 600; }
.pchip { border: 0; font-weight: 600; }
.userbtn, .perbtn, .avatar, .refbtn, .stepper { border: 0; }
.perbtn b, .mesbar b { font-weight: 700; }
input, select, textarea { border: 0; background: var(--surface2); }
.bnav button { font-weight: 600; }
.bnav button[aria-current="page"] > span:last-child { font-weight: 700; }
.side-nav button { font-weight: 600; }
.hoyn { font-weight: 700; }
