/* ── Metrics Lab · sistema de diseño v4 (dic 2026) ─────────────────────────────
   Capa que se carga ÚLTIMA (después de brand.css) y aplica el manual de marca de Metrics Lab al panel:
   lienzo gris cálido, tarjetas blancas planas en grilla «bento», tinta como acción principal (botón y pestaña
   activa), cifras grandes y livianas en Manrope, un solo acento vivo (violeta Lab) en lo destacado,
   gráficos propios en grises con una barra resaltada y una tarjeta oscura (Noche) para lo urgente.
   Marca blanca: app.js → brandPalette() reemplaza solo --primary (el acento) y sus derivados. La tinta,
   el lienzo y los estados (ok / warn / bad) no cambian nunca con la marca.                                    */

:root {
  --head: var(--ml-display, 'Manrope', system-ui, sans-serif);

  --bg: var(--ml-lienzo, #EFEEEA);  --card: var(--ml-papel, #fff);  --surface-2: var(--ml-arena, #F7F6F3);  --surface-3: var(--ml-neutro, #EDECE8);
  --line: var(--ml-linea, #E4E2DC); --line-2: var(--ml-linea-2, #D6D3CB); --line-3: #C2BEB4;
  --text: var(--ml-tinta, #16151D); --text-2: var(--ml-grafito, #4A4856); --text-3: var(--ml-niebla, #66646F);

  /* Acento (slot de marca blanca) */
  --primary: var(--ml-acento, #5B3CF0); --primary-d: color-mix(in oklab, var(--primary) 82%, #000); --primary-l: color-mix(in oklab, var(--primary) 70%, #fff);
  --accent: var(--primary); --s1: var(--primary);
  --tint: color-mix(in oklab, var(--primary) 11%, #fff); --tint-2: color-mix(in oklab, var(--primary) 19%, #fff);
  --deep: color-mix(in oklab, var(--primary) 72%, #000); --ring: color-mix(in srgb, var(--primary) 30%, transparent);
  --on-primary: #ffffff;

  /* Tinta: acción principal y pestaña activa (no cambia con la marca) */
  --ink: var(--ml-tinta, #16151D); --on-ink: #ffffff;
  --acc: var(--ink); --on-acc: var(--on-ink);
  --noche: var(--ml-noche, #1D1A3F); --lila: var(--ml-lila, #A98BFF);
  --barra: var(--ml-barra, #DCDAD3);
  --lime: var(--ml-ok, #D6F36A); --on-lime: var(--ml-on-ok, #24340A);

  /* Estados fijos del manual */
  --ok: #3B5A0C;  --ok-bg: #E9F7B8;
  --warn: var(--ml-on-warn, #7A4D00); --warn-bg: var(--ml-warn, #FFE2A8);
  --bad: var(--ml-on-bad, #C4321F);   --bad-bg: var(--ml-bad-tinte, #FFE4DF);
  --coral: var(--ml-bad, #FF5B45);

  --r: var(--ml-r, 22px); --r-md: var(--ml-r-in, 14px); --r-sm: 12px; --r-xs: 8px; --r-pill: 999px; --gap: var(--ml-gap, 12px);
  --shadow-xs: none; --shadow: none;
  --shadow-md: var(--ml-sombra-flotante, 0 12px 32px rgba(22, 21, 29, .10));
  --shadow-lg: 0 24px 60px rgba(22, 21, 29, .16);
}
:root[data-theme="dark"] {
  --bg: #121118;  --card: #1C1B24;  --surface-2: #22212B;  --surface-3: #2A2933;
  --line: #2E2D37; --line-2: #3B3A45; --line-3: #4C4A57;
  --text: #F4F3F0; --text-2: #BDBBC4; --text-3: #A3A1AC;
  --tint: color-mix(in oklab, var(--primary) 24%, #1C1B24); --tint-2: color-mix(in oklab, var(--primary) 34%, #1C1B24);
  --deep: color-mix(in oklab, var(--primary) 45%, #fff);
  --ink: #F4F3F0; --on-ink: #16151D;
  --noche: #26224F; --barra: #3A3944;
  --ok: #C9EC5A; --ok-bg: #2B3514; --warn: #FFD27A; --warn-bg: #3A2C10; --bad: #FF8A78; --bad-bg: #3E1E1A;
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .45); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}
body { background: var(--bg); }

/* Tipografía: títulos y cifras en Manrope liviana, apretada y tabular */
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -.02em; font-weight: 600; }
.page-head h2 { font-size: 40px; font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
.page-head p { color: var(--text-2); font-size: 14.5px; }
.kpi .v, .big-num { font-family: var(--head); font-weight: 400; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.card-h h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.card-h .sub { color: var(--text-3); }

/* Superficies planas: tarjeta blanca sobre lienzo, sin sombras ni bordes; dentro de otra tarjeta, borde fino */
.card { border-color: transparent; box-shadow: none; border-radius: var(--r); }
.card .card, .modal-box .card { border-color: var(--line); border-radius: var(--r-md); }
.grid { gap: var(--gap); }
.g-kpi { margin-bottom: var(--gap); }
.kpi:hover { box-shadow: none; border-color: transparent; }
.kpi .lb { font-weight: 500; color: var(--text-2); font-size: 13px; }
.kpi .v { font-size: 34px; line-height: 1.1; margin-top: 6px; }
.modal-box { border-radius: 26px; border: 0; box-shadow: var(--shadow-lg); }

/* Botones píldora. Primario = tinta con texto blanco. Secundario = blanco con borde fino. */
.btn { border-radius: var(--r-pill); height: 40px; padding: 0 18px; font-weight: 600; background: var(--card); border-color: var(--line-2); color: var(--text); box-shadow: none; }
.btn:hover { border-color: var(--text-3); background: var(--card); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: none; }
.btn.primary:hover { background: color-mix(in oklab, var(--ink) 84%, var(--bg)); border-color: transparent; }
.btn.primary:disabled { opacity: .5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 32px; padding: 0 14px; }
.icon-btn { border-radius: var(--r-pill); }

/* Campos */
.input { border-radius: var(--r-md); height: 40px; border-color: var(--line-2); background: var(--card); box-shadow: none; }
textarea.input { height: auto; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* Chips, etiquetas y selector segmentado: lo elegido va en tinta */
.chip { border-radius: var(--r-pill); height: 34px; padding: 0 14px; font-weight: 600; border-color: var(--line-2); background: var(--card); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tag { border-radius: var(--r-pill); font-weight: 600; }
.tag.ok, .tag.positive { background: var(--lime); color: var(--on-lime); }
.tag.obj { background: var(--tint); color: var(--deep); }
.seg { border-radius: var(--r-pill); padding: 4px; background: var(--surface-3); border: 0; }
.seg button { border-radius: var(--r-pill); height: 32px; padding: 0 14px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--ink); color: var(--on-ink); box-shadow: none; }
code { background: var(--tint); color: var(--deep); }

/* Consejos, avisos y tablas */
.hint { background: var(--card); border-color: transparent; border-radius: var(--r-md); }
.hint button { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.notice { border-radius: var(--r-md); }
table th { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-3); }
.cs-btn, .srch { border-radius: var(--r-pill); }
.srch { background: var(--card); border-color: var(--line-2); height: 40px; }
.picker-panel, .cr-menu, .pal { border-radius: 20px; border-color: var(--line); box-shadow: var(--shadow-md); }
.cs-row.on, .pal-i.on { background: var(--surface-3); }
.cs-row em, .cs-foot button { color: var(--text); }
.cr-menu span, .pal-i .ic { background: var(--surface-3); color: var(--text); border-radius: 50%; }

/* Ingreso */
#login { background: var(--bg); }
.login-card { border: 0; box-shadow: none; border-radius: 28px; }
.login-card h1 { font-size: 34px; font-weight: 400; letter-spacing: -.035em; }

/* ── Escritorio: barra superior con logo, secciones en píldoras y utilidades en círculos ──────────────── */
.nav .pill { background: var(--coral); color: var(--ml-tinta, #16151D); font-weight: 700; }
.sidebar { background: var(--bg); border-right: 0; }
@media (min-width: 901px) {
  #app { flex-direction: column; }
  .sidebar, body.rp-full .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: 72px; flex-direction: row; align-items: center; gap: 14px; padding: 0 24px; border: 0; z-index: 40; }
  main, body.rp-full main { margin-left: 0; }
  .brand, body.rp-full .sidebar .brand { padding: 0; gap: 10px; flex: none; justify-content: flex-start; }
  .brand img { width: 38px; height: 38px; border-radius: 12px; box-shadow: none; }
  .brand b, body.rp-full .sidebar .brand div { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: -.025em; }
  body.rp-full .sidebar .brand div { display: block; }
  .brand span { display: none; }

  .nav { flex: 0 1 auto; flex-direction: row; align-items: center; gap: 2px; margin: 0 auto; padding: 4px; min-width: 0; background: var(--card); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button, body.rp-full .sidebar .nav button { flex: none; height: 40px; padding: 0 18px; gap: 8px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; color: var(--text-2); justify-content: center; }
  .nav button:hover { background: var(--surface-3); color: var(--text); }
  .nav button.active, .nav button.active:hover { background: var(--ink); color: var(--on-ink); font-weight: 600; }
  .nav .ni { display: contents; font-style: normal; }
  .nav .ni svg { display: none; }
  .nav .lbl, body.rp-full .sidebar .lbl { display: inline; order: -1; font-size: inherit; }
  .nav .pill, body.rp-full .sidebar .pill { display: inline-block; position: static; margin: 0; min-width: 20px; line-height: 20px; padding: 0 6px; font-size: 11px; border-radius: var(--r-pill); box-shadow: none; }
  .nav .more { display: none; }

  .side-foot, body.rp-full .side-foot { margin: 0; border: 0; padding: 0; flex: none; flex-direction: row; align-items: center; gap: 8px; }
  .side-foot .who { display: none; }
  .side-foot .avatar { width: 40px; height: 40px; font-size: 14px; }
  .side-foot .icon-btn { width: 40px; height: 40px; background: var(--card); border: 0; color: var(--text); }
  .side-foot .icon-btn:hover { background: var(--surface-3); }

  #obChrome { margin: 0; padding: 0; border: 0; width: auto; display: flex; align-items: center; gap: 8px; flex: none; }
  .ob-mode { grid-template-columns: 1fr 1fr; background: var(--card); border-radius: var(--r-pill); padding: 4px; }
  .ob-mode button { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-pill); color: var(--text-2); }
  .ob-mode button.on { background: var(--surface-3); color: var(--text); box-shadow: none; }
  .ob-help { width: auto; height: 40px; margin: 0; padding: 0 14px; border-radius: var(--r-pill); background: var(--card); color: var(--text-2); }

  /* Fila de herramientas (cliente, período, crear, buscar) y pestañas de la sección, centradas con el contenido */
  .topbar { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; padding: 8px 32px 0; gap: 8px; }
  .hubbar { position: static; background: transparent; backdrop-filter: none; border: 0; padding: 14px 32px 0; }
  .topbar, .hubbar, .content, #hintbar { max-width: 1504px; margin-left: auto; margin-right: auto; }
  #hintbar { padding: 0 32px !important; }
  .content { padding: 24px 32px 72px; }
}
@media (min-width: 901px) and (max-width: 1360px) {
  .brand > div { display: none; }
  .nav button, body.rp-full .sidebar .nav button { padding: 0 14px; }
  .ob-help { display: none; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .sidebar { gap: 8px; padding: 0 14px; }
  .nav button, body.rp-full .sidebar .nav button { padding: 0 11px; font-size: 13.5px; }
  .side-foot .avatar { display: none; }
  .topbar, .hubbar { padding-left: 20px; padding-right: 20px; }
  #hintbar { padding: 0 20px !important; }
  .content { padding: 20px 20px 64px; }
}

/* Pestañas de la sección: píldoras; la elegida en blanco */
.hb-tabs { gap: 4px; }
.hb-tabs button { height: 36px; padding: 0 16px; margin: 0; border: 0; border-radius: var(--r-pill); font-weight: 500; color: var(--text-2); }
.hb-tabs button:hover { background: var(--surface-3); }
.hb-tabs button.on { background: var(--card); color: var(--text); font-weight: 600; border: 0; }
.hb-tabs em { background: var(--coral); color: var(--ml-tinta, #16151D); }
.topbar { gap: 8px; }
#runBtn svg { width: 15px; height: 15px; }

/* ── Celular: barra inferior con 4 secciones y «Más»; la elegida en tinta ───────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { height: 68px; padding: 0 4px; background: color-mix(in srgb, var(--card) 96%, transparent); border-top: 1px solid var(--line); }
  main { padding-bottom: 76px; }
  .side-foot { display: none; }
  .nav { overflow: visible; justify-content: space-around; gap: 0; }
  .nav button { flex: 1 1 0; width: auto; height: 64px; flex-direction: column; gap: 4px; background: none !important; border-radius: 0; min-width: 0; color: var(--text-2); }
  .nav button.ovf { display: none; }
  .nav .ni { position: relative; display: grid; place-items: center; font-style: normal; width: 56px; height: 30px; border-radius: var(--r-pill); }
  .nav button.active .ni { background: var(--ink); color: var(--on-ink); }
  .nav button.active { color: var(--text); }
  .nav .lbl { display: block; font-size: 11.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .pill { display: block; position: absolute; top: -2px; right: 8px; margin: 0; min-width: 16px; line-height: 16px; padding: 0 4px; font-size: 10px; }
  .topbar { background: var(--bg); border-bottom: 0; }
  .cr-btn { padding: 0; }
  #runBtn { font-size: 0; width: 40px; padding: 0; justify-content: center; gap: 0; }
  #runBtn .spin { margin: 0; }
  .page-head h2 { font-size: 30px; }
  .hubbar { background: var(--bg); border-bottom: 0; padding: 4px 12px 0; }
}
.more-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(22, 21, 29, .32); display: flex; align-items: flex-end; }
.ms-box { width: 100%; background: var(--card); border-radius: 28px 28px 0 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-lg); }
.ms-box button { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; border: 0; background: none; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; color: var(--text); text-align: left; }
.ms-box button svg { width: 20px; height: 20px; color: var(--text-2); }
.ms-box button.on { background: var(--ink); color: var(--on-ink); }
.ms-box button.on svg { color: inherit; }
.ms-box button:hover:not(.on) { background: var(--surface-3); }
.ms-box hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ── Inicio en grilla bento: inversión, gráfico diario, «para hoy» en tarjeta oscura y cifras ───────────── */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.bento > .hero { grid-column: span 5; order: 1; }
.bento > .b-chart { grid-column: span 4; order: 2; }
.bento #homeTodo { display: contents; }
.bento #homeTodo > :first-child { grid-column: span 3; order: 3; margin: 0; }
.bento #homeTodo > :not(:first-child) { grid-column: 1 / -1; order: 5; margin: 0; }
.bento > .g-kpi { grid-column: 1 / -1; order: 4; margin: 0; }
@media (max-width: 1240px) {
  .bento > .hero { grid-column: span 7; }
  .bento > .b-chart { grid-column: span 5; }
  .bento #homeTodo > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) { .bento > *, .bento #homeTodo > * { grid-column: 1 / -1 !important; } }

.hero { display: flex; flex-direction: column; gap: 18px; padding: 24px 26px; margin: 0; }
.hero-main { min-width: 0; }
.hero .lb { font-size: 14px; font-weight: 500; color: var(--text-2); }
.hero .big-num { font-size: 60px; line-height: 1; margin: 10px 0 14px; color: var(--text); }
.hero .s { font-size: 13.5px; color: var(--text-2); }
.hero .s b { color: var(--text); font-weight: 600; }
.meter { display: flex; gap: 4px; height: 40px; margin: 0 0 12px; }
.meter i { flex: 1; border-radius: var(--r-pill); background: var(--barra); }
.meter i.on { background: var(--primary); }
.meter.over i.on { background: var(--coral); }
.meter i.exp { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.hero-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.qa { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; height: 40px; width: auto; padding: 0 16px 0 6px; border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.qa:hover { background: var(--line); }
.qa-i, .qa:nth-child(n+2) .qa-i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--text); }
.qa-i svg { width: 16px; height: 16px; }
.qa:first-child { background: var(--ink); color: var(--on-ink); }
.qa:first-child .qa-i { background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: var(--on-ink); }

.b-chart { display: flex; flex-direction: column; }
.b-chart .card-b { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.b-chart .peak { font-family: var(--head); font-size: 28px; font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.b-chart .peak small { font-family: var(--font); font-size: 12.5px; color: var(--text-3); letter-spacing: 0; margin-left: 6px; }
.caps { flex: 1; min-height: 150px; display: flex; align-items: flex-end; gap: 4px; }
.caps span { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.caps i { width: 100%; min-height: 6px; border-radius: var(--r-pill); background: var(--barra); transition: background var(--t-fast); }
.caps span:hover i { background: var(--line-3); }
.caps i.hi, .caps span:hover i.hi { background: var(--primary); }
.caps-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }

.g-kpi4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g-kpi4 .kpi { padding: 20px 22px; }
.g-kpi4 .kpi .v { font-size: 36px; }
.kpi .s { color: var(--text-3); }
.dchip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--lime); color: var(--on-lime); }
.dchip.bad { background: var(--bad-bg); color: var(--bad); }

/* «Para hoy»: la primera lista va en la tarjeta oscura (Noche); las demás, blancas */
.todo { border-color: transparent; box-shadow: none; border-radius: var(--r); background: var(--card); }
.todo-h { border-bottom: 0; padding: 20px 22px 8px; }
.todo-h h3 { font-size: 17px; }
.todo-r { border-bottom: 0; padding: 10px 14px; margin: 0 8px; border-radius: var(--r-md); }
.todo-r:last-child { margin-bottom: 10px; }
.todo-r:hover { background: var(--surface-2); }
.todo-r .ti { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); font-size: 18px; }
.todo-r b { font-size: 14.5px; font-weight: 600; }
.todo-r small { font-size: 12.5px; }
.todo-r .n { font-family: var(--head); font-weight: 500; font-size: 15px; background: var(--surface-3); color: var(--text); padding: 2px 10px; }
.todo-r .go { color: var(--text-3); font-weight: 600; }
.todo-ok { padding: 8px 22px 22px; text-align: left; } .todo-ok b { font-size: 15px; }
#homeTodo > .todo:first-child { background: var(--noche); color: #fff; }
#homeTodo > .todo:first-child h3, #homeTodo > .todo:first-child b, #homeTodo > .todo:first-child .todo-ok b { color: #fff; }
#homeTodo > .todo:first-child .sub, #homeTodo > .todo:first-child small, #homeTodo > .todo:first-child .todo-ok { color: #C9C5EA; }
#homeTodo > .todo:first-child .todo-r:hover { background: rgba(255, 255, 255, .07); }
#homeTodo > .todo:first-child .ti { background: rgba(255, 255, 255, .1); }
#homeTodo > .todo:first-child .n { background: var(--lime); color: var(--on-lime); }
#homeTodo > .todo:first-child .go { display: none; }
.bento #homeTodo > .todo:first-child .todo-r { padding: 10px; margin: 0 6px; }

/* Recomendaciones: tarjeta con un velo suave del acento y la primera alerta resaltada */
.b-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.b-row > .card { margin: 0; }
@media (max-width: 1000px) { .b-row { grid-template-columns: 1fr; } }
.b-rec { background: linear-gradient(180deg, var(--tint) 0, var(--card) 220px); }
.b-rec .card-h h3 { display: inline-flex; align-items: center; gap: 8px; }
.b-rec .card-h h3 svg { color: var(--primary); }
.hbars .bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); }
.hbars .bar i { border-radius: var(--r-pill); }

@media (max-width: 900px) {
  .hero { padding: 22px 20px; }
  .hero .big-num { font-size: 44px; }
  .meter { height: 30px; gap: 3px; }
  .todo-r { padding: 10px; margin: 0 4px; }
  .todo-r .go { display: none; }
  .g-kpi4 .kpi .v { font-size: 28px; }
}

/* ── Clientes: lista + panel lateral con el detalle y el catálogo de fuentes ─────────────────────────────── */
.cl-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.cl-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 16px; border: 0; background: none; border-radius: var(--r-md); text-align: left; color: var(--text); cursor: pointer; }
.cl-row:hover { background: var(--surface-2); }
.cl-row.on { background: var(--surface-3); }
.cl-row > svg { color: var(--text-3); flex: none; }
.cl-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 600; font-size: 18px; flex: none; }
.cl-name { flex: 1; min-width: 0; }
.cl-name b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-name small, .cl-meta small { color: var(--text-3); font-size: 12.5px; }
.cl-meta { width: 76px; text-align: right; flex: none; }
.cl-meta b { display: block; font-family: var(--head); font-weight: 500; font-size: 18px; letter-spacing: -.02em; }
.cl-drawer { position: fixed; inset: 0; z-index: 65; }
body:not([data-hub="admin"]) .cl-drawer { display: none; }
.cl-scrim { position: absolute; inset: 0; background: rgba(22, 21, 29, .28); }
.cl-sheet { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100% - 24px)); background: var(--card); border-radius: 28px; box-shadow: var(--shadow-lg); overflow: auto; padding: 12px 8px 20px; animation: clIn .18s ease-out; }
@keyframes clIn { from { transform: translateX(24px); opacity: 0; } }
.cl-x { position: absolute; top: 16px; right: 16px; z-index: 1; }
.cl-detail .card-h { flex-wrap: wrap; padding-right: 56px; }
.cl-detail .card-h > span[style*="margin-left:auto"] { margin-left: 0 !important; width: 100%; order: 9; }
.cl-detail .card-b[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
.src-on { display: flex; flex-direction: column; gap: 2px; }
.src-li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.src-li > span:not(.plat) { flex: 1; min-width: 0; }
.src-li b { display: block; font-size: 14px; font-weight: 600; }
.src-li small { color: var(--text-3); font-size: 12.5px; }
.plat.src-cal { background: var(--tint-2); color: var(--deep); display: inline-grid; place-items: center; }
.src-more { margin-top: 10px; }
.src-more summary { cursor: pointer; font-weight: 600; color: var(--text); padding: 8px 4px; list-style: none; }
.src-more summary::-webkit-details-marker { display: none; }
.src-more summary::before { content: '+ '; }
.src-more summary em { font-style: normal; color: var(--text-3); font-weight: 500; margin-left: 6px; font-size: 13px; }
.src-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.src-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.src-tile b { font-size: 13.5px; font-weight: 600; }
.src-tile small { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.src-tile .btn { margin-top: auto; }
.src-tile.soon { border-style: dashed; background: var(--surface-2); }
@media (max-width: 900px) {
  .cl-meta { display: none; }
  .cl-row { padding: 12px 10px; gap: 12px; }
  .cl-sheet { inset: auto 0 0 0; top: 6vh; width: 100%; border-radius: 28px 28px 0 0; }
}
.drawer-bg { z-index: 66; } .drawer { z-index: 67; }

/* Configuración de la empresa */
.cp-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.cp-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.cp-row b { display: block; font-size: 14.5px; }
.cp-row small { display: block; color: var(--text-2); font-size: 13px; line-height: 1.45; margin-top: 2px; max-width: 70ch; }
#homeTodo > .todo:first-child .todo-h { flex-wrap: wrap; row-gap: 2px; }
#homeTodo > .todo:first-child .todo-h .sub { width: 100%; }

/* ── Pantallas internas (campañas, presupuestos, clientes, reportes, alertas) con el mismo lenguaje ──────── */
/* Tablas: encabezado sin fondo, filas aireadas con separador fino y hover en arena */
th { background: transparent; border-bottom-color: var(--line); padding-top: 14px; padding-bottom: 12px; }
td { border-bottom-color: var(--line); }
tbody tr:hover td { background: var(--surface-2); }
.tbl-wrap { border-radius: 0 0 var(--r) var(--r); }
/* Barras de ritmo y de uso: cápsula gruesa sobre gris del manual */
.pace .bar, .hbars .bar { height: 8px; border-radius: var(--r-pill); background: var(--barra); }
.pace .bar i { border-radius: var(--r-pill); }
/* Alertas e ideas: la gravedad ya la dice la etiqueta; sin franja lateral, tarjeta plana */
.ins { border-color: transparent; box-shadow: none; }
.card .ins, .b-rec .ins { border-color: var(--line); }
.ins:hover { box-shadow: none; border-color: var(--line-2); }
.ins .sev { display: none; }
.ins-b { padding: 18px 22px; }
.ins h4 { font-family: var(--head); font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.rec { border-radius: var(--r-md); background: var(--tint); }
.ins + .ins { margin-top: var(--gap); }
/* Vacío: tarjeta blanca con el ícono en un círculo */
.content > .empty, .content > div > .empty:only-child { background: var(--card); border-radius: var(--r); padding: 56px 24px; }
.empty svg { width: 28px; height: 28px; padding: 16px; box-sizing: content-box; border-radius: 50%; background: var(--tint); color: var(--primary); opacity: 1; }
.empty b { font-family: var(--head); font-weight: 500; font-size: 20px; letter-spacing: -.02em; }
