/* Back office (spec-backoffice, BO-0/BO-1). Sobre los tokens y componentes de la app (/app/styles.css): acá va solo
   el armado propio del back office. En escritorio, claro salvo que se elija otro tema; en el celular (spec-bo-mobile),
   el armado de abajo de todo y el tema sigue al sistema. */
:root {
  --bo-info-bg: #e8f1fb; --bo-info-text: #2b5d97; --bo-row-hover: #fafbfe; --bo-glass: rgba(255,255,255,.95);
  --bo-scrim: rgba(18,26,46,.28); --bo-shade: rgba(11,21,38,.4); --bo-frame: #eef0f5; --bo-knob: #ffffff;
}
:root[data-theme="dark"] {
  --bo-info-bg: #1f2f47; --bo-info-text: #9cc2ef; --bo-row-hover: #313a52; --bo-glass: rgba(42,49,70,.95);
  --bo-scrim: rgba(0,0,0,.45); --bo-shade: rgba(0,0,0,.55); --bo-frame: #394159;
  color-scheme: dark;
}
html, body { background: var(--bg); }
.bo { display: flex; min-height: 100vh; }
.bo-side { width: 236px; flex: none; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: auto; }
.bo-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; padding: 0 10px 6px; }
.bo-brand small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.bo-ng { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; }
.bo-nav button { display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 14px; background: none;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; text-align: left; }
.bo-nav button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.bo-nav button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-card); }
.bo-nav button:disabled { opacity: .45; cursor: default; }
.bo-nav button em { margin-left: auto; font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.bo-nav button small { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.bo-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid var(--divider); }
.bo-me b { display: block; font-size: 13.5px; }
.bo-me small { display: block; font-size: 11.5px; color: var(--muted); }
.bo-me .icon-btn { margin-left: auto; }
.bo-main { flex: 1; min-width: 0; padding: 22px 32px 64px; }
.bo-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.bo-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.bo-head h1 { margin: 0; font-size: 28px; letter-spacing: -.6px; }
.bo-head .sub { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.bo-head .tools { display: flex; gap: 10px; align-items: center; }
.bo-mode { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--chip); color: var(--text); font-size: 12.5px; font-weight: 600; }
.bo-mode.live { background: var(--ok-bg); color: var(--ok-text); }
.bo-mode i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font-size: 28px; font-weight: 600; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi small.up { color: var(--ok-text); }
.kpi small.down { color: var(--err-text); }
.kpi.warn { box-shadow: inset 3px 0 0 var(--gold), var(--shadow-card); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.panel { padding: 20px 22px; min-width: 0; }
.panel-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; }
.panel-hd h3 { margin: 0; font-size: 16px; }
.panel-hd .muted { font-size: 13px; }
.chart svg { width: 100%; height: 190px; display: block; }
.chart .axis { font-size: 10px; fill: var(--muted-2); }
.watch { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--divider); font-size: 13.5px; }
.watch:first-of-type { border-top: 0; }
.watch .ic { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--chip); }
.watch .ic.err { background: var(--err-bg); color: var(--err-text); }
.watch .ic.warn { background: var(--warn-bg); color: var(--warn-text); }
.watch .ic.ok { background: var(--ok-bg); color: var(--ok-text); }
.watch .tx { flex: 1; min-width: 0; }
.watch .link { flex: none; font-size: 13px; }
.bars .row { display: grid; grid-template-columns: 220px 1fr 80px; gap: 14px; align-items: center; padding: 8px 0; font-size: 13.5px; }
.bars .bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.bars .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.li2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--divider); }
.li2:first-of-type { border-top: 0; }
.li2 b { display: block; font-size: 14px; font-weight: 600; }
.li2 small { display: block; font-size: 12px; color: var(--muted); }
.li2 .r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pill.info { background: var(--bo-info-bg); color: var(--bo-info-text); }
.pill.ok2 { background: var(--ok-bg); color: var(--ok-text); }
.pill.test { background: var(--warn-bg); color: var(--warn-text); }
.pill.mute { background: var(--chip); color: var(--muted); }

/* Tablas */
.btable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.btable th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; padding: 14px 16px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.btable td { padding: 13px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.btable tr:last-child td { border-bottom: 0; }
.btable tbody tr { cursor: pointer; }
.btable tbody tr:hover td { background: var(--bo-row-hover); }
.btable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.btable .mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.btable .who { display: flex; align-items: center; gap: 10px; }
.btable .who .av { width: 34px; height: 34px; font-size: 15px; }
.btable .who b { display: block; font-weight: 600; }
.btable .who small { display: block; color: var(--muted); font-size: 12px; }
.tcard { overflow-x: auto; }
.bo-foot-note { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted-2); }

/* Drawer */
.scrim { position: fixed; inset: 0; background: var(--bo-scrim); z-index: 40; animation: fade .2s both; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(580px, 100%); background: var(--surface); box-shadow: -30px 0 60px -30px rgba(18,26,46,.35);
  z-index: 41; overflow: auto; padding: 24px 26px 0; animation: drawerIn .3s cubic-bezier(.2,.7,.2,1) both; display: flex; flex-direction: column; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dhd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dhd .who { display: flex; align-items: center; gap: 12px; }
.dhd h2 { margin: 0; font-size: 20px; }
.dhd small { color: var(--muted); font-size: 12.5px; }
.dkpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.dkpi div { background: var(--chip); border-radius: 14px; padding: 12px 14px; }
.dkpi span { display: block; font-size: 12px; color: var(--muted); }
.dkpi b { display: block; font-size: 18px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dkpi small { display: block; font-size: 11.5px; color: var(--muted); }
.dsec { margin-top: 24px; }
.dsec h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 600; }
.dsec textarea { width: 100%; min-height: 90px; height: auto; padding: 12px 14px; font-weight: 500; font-size: 13.5px; resize: vertical; line-height: 1.5; }
.dfoot { position: sticky; bottom: 0; margin: auto -26px 0; background: var(--bo-glass); backdrop-filter: blur(12px); padding: 14px 26px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--divider); }
.dfoot .btn { height: 42px; font-size: 13.5px; }

/* Perillas */
.knob { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--divider); }
.knob:first-of-type { border-top: 0; }
.knob b { display: block; font-size: 14px; font-weight: 600; }
.knob small { display: block; font-size: 12px; color: var(--muted); }
.knob .amt { display: flex; align-items: center; gap: 6px; }
.knob .amt input { width: 120px; height: 38px; font-size: 14px; text-align: right; }
.switch { position: relative; width: 44px; height: 26px; flex: none; border: 0; padding: 0; border-radius: 13px; background: var(--line-2); cursor: pointer; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--bo-knob); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.mini th { text-align: left; font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; padding: 6px 0; font-weight: 600; }
.mini td { padding: 8px 0; border-top: 1px solid var(--divider); }
.mini .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Confirmación en la pantalla (sin confirm() del navegador) */
.confirm { margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-text); font-size: 13px; line-height: 1.45; }
.confirm.danger { background: var(--err-bg); color: var(--err-text); }
.confirm b { display: block; margin-bottom: 4px; }
.confirm .diff { margin: 6px 0; font-family: var(--font-mono); font-size: 12px; }
.confirm .row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.confirm input { height: 38px; font-size: 13px; margin-top: 8px; width: 100%; background: var(--surface); }
.bo-toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: 13px; z-index: 60; box-shadow: 0 18px 40px -16px rgba(18,26,46,.55); animation: toastIn .3s cubic-bezier(.2,.7,.2,1) both; }
.bo-toast.err { background: var(--err-text); color: var(--on-primary); }
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }

/* Login */
.bo-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.bo-login .card { width: 100%; max-width: 400px; padding: 34px; }
.bo-login h1 { margin: 18px 0 4px; font-size: 22px; }
.bo-login p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.bo-login .field { margin-top: 14px; display: block; }
.bo-login .field .lab { display: block; margin-bottom: 6px; }
.bo-login input { width: 100%; }
.bo-login .btn { width: 100%; justify-content: center; margin-top: 22px; }
.bo-login .hint { margin-top: 16px; font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.5; }
.bo-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.soon { padding: 60px 20px; text-align: center; }
.soon h2 { margin: 0 0 6px; }
.soon p { margin: 0; color: var(--muted); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid2.even { grid-template-columns: 1fr; }
}

/* Banderas en línea con el texto (el sprite es el de la app). */
.bo svg.flag { display: inline-block; width: 18px; height: 13px; border-radius: 3px; vertical-align: -2px; }
.cor { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.btable .mono { white-space: nowrap; }
.bars .row .cor { overflow: hidden; text-overflow: ellipsis; }

/* Recuperación de acceso (paso 6, solo owner) */
.recov { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.recov-step { margin: 4px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted-2); letter-spacing: .04em; text-transform: uppercase; }
.recov .li2 { padding: 7px 0; }
.recov .li2 .r b { font-weight: 500; font-size: 13px; text-align: right; }
.bo-field { display: block; margin-top: 12px; }
.bo-field > span { display: block; margin-bottom: 5px; font-size: 12.5px; color: var(--muted); }
.recov select, .recov input[type=email], .recov textarea { width: 100%; }
.recov textarea { min-height: 70px; }
.recov-opt { display: flex; gap: 8px; align-items: center; margin: 10px 0 6px; font-size: 13.5px; cursor: pointer; }
.recov-opt input { width: auto; height: auto; }
.recov .row-btns { display: flex; gap: 8px; justify-content: flex-end; }
.recov .alert.ok { background: var(--surface); margin-bottom: 10px; }

/* BO-4 Crecimiento: embudo, contador de mensajes y calendario (como el prototipo) */
.meter { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); box-shadow: var(--shadow-card); border-radius: 12px; height: 40px; padding: 0 14px; font-size: 13px; }
.meter b { font-variant-numeric: tabular-nums; }
.meter i { display: block; width: 80px; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.meter em { display: block; height: 100%; background: var(--gold); }
.meter.full em { background: var(--err-text); }
.meter.full b { color: var(--err-text); }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { background: var(--surface-2); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kh { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-size: 13px; }
.kh span { color: var(--muted); font-weight: 600; }
.kempty { margin: 0; padding: 6px 4px; color: var(--muted-2); font-size: 13px; }
.kc { text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 2px; }
.kc:hover { box-shadow: inset 0 0 0 1px var(--gold-line), var(--shadow-card); }
.kc b { font-weight: 600; font-size: 14px; }
.kc small { color: var(--muted); font-size: 12px; }
.kc.late { box-shadow: inset 3px 0 0 var(--err-text), var(--shadow-card); }
.kf { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kf span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf .late { color: var(--err-text); font-weight: 600; white-space: nowrap; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cd { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 90px; }
.cd > b { font-size: 13px; }
.cd.today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.cp { text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; background: var(--surface); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cp small { color: var(--muted); font-size: 11.5px; }
.cp .ct { font-weight: 600; font-size: 13px; }
.msg-text { white-space: pre-wrap; max-width: 52ch; }
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(5, minmax(200px, 1fr)); overflow-x: auto; }
  .cal { grid-template-columns: repeat(7, minmax(140px, 1fr)); overflow-x: auto; }
}

/* Comunicaciones → Plantillas */
.tpl-grid { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.tpl-item { text-align: left; font: inherit; font-size: 13.5px; border: 0; background: none; padding: 9px 10px; border-radius: 10px; color: var(--text); cursor: pointer; }
.tpl-item:hover { background: var(--chip); }
.tpl-item.on { background: var(--chip); font-weight: 600; }
.tpl-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.tpl-frame { width: 100%; height: 760px; border: 0; border-radius: 12px; background: var(--bo-frame); }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }

/* Listas (Registro en escritorio y todo el celular): filas con hairline, sin cortar textos. */
.m-list { padding: 4px 16px; }
.m-list.flat { padding: 0; }
.m-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--divider); background: none;
  font: inherit; color: inherit; text-align: left; }
.m-item:first-child { border-top: 0; }
button.m-item { cursor: pointer; }
button.m-item:disabled { cursor: default; opacity: 1; }
.m-item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.m-item .t b { display: block; font-size: 14px; line-height: 1.3; }
.m-item .t span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.m-item .amt { flex: none; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.m-item .amt > span:not(.pill) { font-size: 12px; color: var(--muted); }
.m-item .amt.neg { color: var(--err-text); }
.m-item.total { border-top: 1px solid var(--text); }
.m-item .sev { width: 4px; align-self: stretch; border-radius: 2px; flex: none; background: var(--warn-text); }
.m-item .sev.bad { background: var(--err-text); }
.m-item .sev.ok { background: var(--ok-text); }
.m-item .go { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--primary); color: var(--on-primary); font: inherit; font-size: 13px; cursor: pointer; }
.m-flag { width: 38px; height: 38px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; flex: none; }
.m-flag svg.flag { width: 20px; height: 15px; border-radius: 3px; display: block; }
.m-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; flex: none; }
.drawer .grab { display: none; }

/* ============ Celular (spec-bo-mobile, M1): ≤ 760 px ============
   Pestañas abajo, título grande, listas en vez de tablas, fichas y confirmaciones que suben desde abajo.
   Pesos más livianos que el escritorio: títulos y números en 560, nombres y etiquetas en 480. Nada se corta con "…". */
@media (max-width: 760px) {
  html.bo-lock, html.bo-lock body { overflow: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  .bo.m { display: block; min-height: 100vh; min-height: 100dvh; font-size: 15px; }
  .bo.m b, .bo.m strong, .bo.m h4, .m-confirm b { font-weight: 480; }
  .bo.m h1, .bo.m h2, .bo.m h3 { font-weight: 560; }

  /* Arriba: título grande estilo iOS y la campanita */
  .m-top { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: calc(env(safe-area-inset-top) + 8px) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
  .m-title { display: flex; align-items: center; gap: 10px; min-height: 44px; }
  .m-title h1 { flex: 1; margin: 0; font-size: 30px; letter-spacing: -.6px; line-height: 1.1; }
  .m-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -8px; padding: 0 8px 0 0; border: 0; background: none; color: var(--gold-ink); font: inherit; font-size: 16px; cursor: pointer; }
  .m-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
  .m-ic .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--err-text); border: 2px solid var(--surface); }
  .m-main { padding: 4px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 12px; }
  .m-main > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

  /* Abajo: cinco pestañas fijas, con safe area */
  .m-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
  .m-tabs button { flex: 1; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
  .m-tabs button.on { color: var(--text); font-weight: 480; }
  .m-tabs button.on svg { stroke: var(--gold); }

  /* Hoy */
  .m-date { margin: -4px 2px 0; font-size: 13px; color: var(--muted); }
  .m-date::first-letter { text-transform: uppercase; }
  .m-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .m-kpi { padding: 13px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .m-kpi span { font-size: 12px; color: var(--muted); }
  .bo.m .m-kpi b { font-size: 22px; font-weight: 560; letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .m-kpi small { font-size: 12px; color: var(--muted); line-height: 1.35; }
  .m-kpi small.up { color: var(--ok-text); }
  .m-kpi small.down { color: var(--err-text); }
  .m-kpi small.warn { color: var(--warn-text); }
  .bo.m .m-sec { margin: 6px 2px -4px; font-size: 12.5px; font-weight: 480; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .m-list { border-radius: 18px; }
  .m-item { min-height: 56px; }
  .m-item .t b { font-size: 15px; }
  .m-item .t span { font-size: 13px; }
  .bo.m .m-item .amt { font-size: 15px; font-weight: 560; }
  .m-item .go { min-height: 40px; font-weight: 480; }
  .m-item.out { color: var(--err-text); }
  .m-item.nav > svg { color: var(--muted-2); flex: none; }

  /* Buscador y chips de filtro */
  .m-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted-2); }
  .m-search input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 400; color: var(--text); }
  .m-search input:focus { outline: none; }
  .m-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .m-chips::-webkit-scrollbar { display: none; }
  .m-chips button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 480; cursor: pointer; white-space: nowrap; }
  .m-chips button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

  /* Plata */
  .m-row-end { display: flex; justify-content: flex-end; margin-top: -4px; }
  .m-month select { height: 40px; width: auto; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; font-weight: 480; color: var(--text); }
  .m-hero { padding: 16px 16px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 3px; }
  .m-hero span { font-size: 13px; color: var(--muted); }
  .bo.m .m-hero b { font-size: 34px; font-weight: 560; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
  .m-hero small { font-size: 13px; color: var(--muted); line-height: 1.4; }
  .m-mode { margin: 0; text-align: center; }

  /* Fichas como hoja que sube desde abajo. La app deja su .drawer abajo de base y lo sube con forwards; acá la base es
     arriba (transform: none) y la animación es backwards, así el arrastre con el dedo puede mover la hoja. */
  .bo.m .scrim { background: var(--bo-shade); }
  .bo.m .drawer { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; max-height: calc(100dvh - env(safe-area-inset-top) - 36px);
    border-radius: 26px 26px 0 0; padding: 6px 18px 0; box-shadow: 0 -10px 30px rgba(18,26,46,.22); overscroll-behavior: contain; transform: none;
    animation: sheetUp .3s cubic-bezier(.2,.8,.2,1) backwards; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
  .bo.m .drawer .grab { display: block; flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 10px; padding: 0; }
  .bo.m .drawer .grab::before { content: ''; display: block; height: 28px; margin: -12px -60px 0; }
  .bo.m .dhd h2 { font-size: 19px; line-height: 1.25; }
  .bo.m .dhd .icon-btn { width: 44px; height: 44px; }
  .bo.m .dkpi { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  .bo.m .dkpi div:nth-child(3) { grid-column: span 2; }
  .bo.m .dkpi b { font-weight: 560; }
  .bo.m .drawer > * { flex-shrink: 0; } /* la hoja es flex en columna: sin esto, las pestañas (overflow-x) se achican a 0 */
  .m-subtabs { margin: 14px -18px 0; padding: 0 18px; }
  .bo.m .dsec { margin-top: 18px; }
  .bo.m .dfoot { margin: auto -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
  .bo.m .dfoot .btn { flex: 1; height: 50px; font-size: 15px; }
  .bo.m .drawer > :last-child:not(.dfoot) { margin-bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* Perillas para el dedo */
  .bo.m .knob { min-height: 56px; flex-wrap: wrap; }
  .bo.m .knob > span:first-child { flex: 1 1 180px; min-width: 0; }
  .bo.m .knob b { font-size: 15px; }
  .bo.m .knob small { font-size: 12.5px; }
  .bo.m .switch { width: 51px; height: 31px; border-radius: 16px; }
  .bo.m .switch::after { width: 27px; height: 27px; top: 2px; left: 2px; }
  .bo.m .switch.on::after { transform: translateX(20px); }
  .bo.m .knob .amt input { width: 130px; height: 44px; }
  .bo.m .btn.sm, .bo.m .btn { min-height: 44px; }
  .bo.m .link { min-height: 44px; display: inline-flex; align-items: center; }
  .bo.m .mini td { padding: 10px 0; }
  .bo.m .li2 { flex-wrap: wrap; }
  .bo.m .li2 > div:first-child { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }

  /* Inputs: 16 px para que iOS no haga zoom; el teclado correcto lo pide cada input (inputMode). */
  .bo.m input, .bo.m select, .bo.m textarea, .m-confirm input { font-size: 16px; }
  .bo.m input, .bo.m select { min-height: 44px; }
  .bo.m .row2 { grid-template-columns: 1fr; gap: 10px; }

  /* Confirmación en hoja propia */
  .m-shade { position: fixed; inset: 0; z-index: 70; background: var(--bo-shade); animation: fade .2s both; }
  .m-confirm { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 90dvh; overflow: auto; animation: sheetUp .26s cubic-bezier(.2,.8,.2,1) backwards; }
  .m-confirm .confirm { margin: 0; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--text); font-size: 15px; line-height: 1.5;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(18,26,46,.22); }
  .m-confirm .confirm::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 14px; }
  .m-confirm .confirm > b { font-size: 18px; font-weight: 560; margin-bottom: 6px; line-height: 1.3; }
  .m-confirm .confirm.danger > b { color: var(--err-text); }
  .m-confirm .confirm > div:not(.row-btns) { color: var(--muted); }
  .m-confirm .confirm input { height: 48px; margin-top: 10px; background: var(--chip); }
  .m-confirm .confirm .diff { color: var(--text); }
  .m-confirm .row-btns { margin-top: 18px; gap: 10px; }
  .m-confirm .row-btns .btn { flex: 1; height: 50px; font-size: 15px; border-radius: 14px; }

  /* Modales (alta manual, prospecto, publicación) como hoja */
  .bo.m .modal { padding-bottom: env(safe-area-inset-bottom); }

  /* Pantallas de Más: el título lo pone el armado */
  .bo.m .bo-head { margin-bottom: 0; }
  .bo.m .bo-head h1 { display: none; }
  .bo.m .bo-head .sub { margin: 0; }
  .bo.m .bo-head .tools { width: 100%; flex-wrap: wrap; }
  .bo.m .bo-head .tools .btn { flex: 1; }
  .bo.m .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bo.m .kpi { padding: 13px 14px; }
  .bo.m .kpi b { font-size: 21px; font-weight: 560; overflow-wrap: anywhere; }
  .bo.m .grid2, .bo.m .grid2.even { grid-template-columns: 1fr; margin-top: 0; }
  .bo.m .panel { padding: 14px 16px; }
  .bo.m .panel-hd h3 { font-size: 16px; }
  .bo.m .kanban { display: flex; flex-direction: column; align-items: stretch; overflow: visible; }
  .bo.m .kpi small, .bo.m .kpi .link { font-weight: 480; }
  .bo.m .kpi .pill, .bo.m .m-item .pill { white-space: normal; height: auto; min-height: 22px; padding-block: 3px; line-height: 1.3; }
  .bo.m .m-item .amt > span:not(.pill) { font-weight: 400; }
  .bo.m .kf span:first-child { white-space: normal; overflow: visible; text-overflow: clip; }
  .bo.m .cal { grid-template-columns: 1fr; overflow: visible; }
  .bo.m .cd { min-height: 0; }
  .bo.m .tpl-grid { grid-template-columns: 1fr; }
  .bo.m .tpl-list { flex-direction: row; overflow-x: auto; }
  .bo.m .tpl-item { flex: none; white-space: nowrap; min-height: 44px; }
  .bo.m .tpl-frame { height: 560px; }
  .bo.m .meter { width: 100%; justify-content: space-between; }
  .bo.m .cor { white-space: normal; }
  .bo.m .bars .row { grid-template-columns: 1fr 80px; }
  .bo.m .bars .row .bar { grid-column: 1 / -1; grid-row: 2; }
  .bo.m .bars .row .cor { overflow: visible; text-overflow: clip; }

  .bo-toast { top: calc(env(safe-area-inset-top) + 10px); max-width: calc(100vw - 32px); text-align: center; z-index: 80; }
  .bo-login { padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 24px); }
  .bo-login .card { padding: 26px 22px; }
  .bo-login input { font-size: 16px; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* Llaves de acceso y re-autenticación (spec-bo-mobile, M3): en escritorio y en el celular. */
.face-login { text-align: center; display: flex; flex-direction: column; align-items: center; }
.face-login .bo-brand { justify-content: center; }
.face-ic { width: 84px; height: 84px; border-radius: 24px; border: 2.5px solid var(--gold); display: grid; place-items: center; margin: 26px 0 4px; }
.face-login h1 { margin-top: 16px; }
.face-login p { max-width: 300px; line-height: 1.5; }
.face-login .btn { width: 100%; justify-content: center; }
.face-alt { margin-top: 14px; min-height: 44px; }
.btn.wide { width: 100%; justify-content: center; }
.m-item .go.ghost { background: var(--chip); color: var(--err-text); }
.m-form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.m-form b { font-size: 15px; }
.m-form p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.m-form .field .lab { display: block; margin-bottom: 6px; }
.m-form .row-btns, .reauth .row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.reauth { display: flex; flex-direction: column; gap: 12px; }
.reauth > b { font-size: 18px; }
.reauth > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.reauth .alert { margin: 0; }
.reauth-code { display: flex; gap: 8px; }
.reauth-code input { flex: 1; min-width: 0; }
.reauth > .link { align-self: center; min-height: 44px; }
.m-shade.top { z-index: 94; }
.m-confirm.top { z-index: 95; }
.m-confirm .reauth { background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(18,26,46,.22); }
.m-confirm .reauth::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 4px; }
@media (max-width: 760px) {
  .m-confirm .reauth > b { font-weight: 560; }
  .m-confirm .reauth input { font-size: 16px; height: 48px; }
  .m-confirm .reauth .btn { min-height: 50px; }
  .face-login h1 { font-weight: 560; }
  .bo.m .m-form b { font-weight: 480; }
}
.bo-login .btn.face-btn { margin-top: 10px; }
.alert.push-ok { background: var(--ok-bg); color: var(--ok-text); }
.bo-head + .alert { margin: 0; }
