/* © 2026-2027 Santiago Rafael Pérez Pérez · Ágora Digital App (Agora New App). Todos los derechos reservados. Software propietario: ver LICENSE.txt. */
/* =====================================================================================
   Agora Digital App · Sistema de diseño · TOKENS
   Copia fiel de la capa v10/v11 (assets/css/ecosistema.css + app.css, sección 1 "Tokens").
   Única fuente de verdad: Tailwind (@theme inline, abajo) y los componentes leen ESTAS variables.
   Tema:   <html data-theme="light|dark">  (lo fija /src/theme/boot.ts antes de pintar, sin parpadeo)
   Acento: <html data-accent="vino|azul|oro|apple|grafito">  (vino = marca, predeterminado)
   Menú:   <html class="nav-side side-closed">  (barra lateral opcional; arriba es el predeterminado)
   ===================================================================================== */

:root {
  /* ---------- Tipografía (familias del sistema Apple con respaldo Windows/Android) ---------- */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI Variable Display", "Segoe UI", Roboto, "Noto Sans", system-ui, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Escala tipográfica (medidas de v11) */
  --text-body: 14.5px;      --leading-body: 1.45;  --tracking-body: -.006em;
  --text-sm: 13px;          --text-xs: 12px;       --text-2xs: 11.5px;
  --text-crumb: 15px;       /* nombre del módulo en la barra superior */
  --text-panel: 19px;       /* .pn-h h2 */
  --text-modal: 21px;       /* .modal-body h2 */
  --text-module: 34px;      /* .mod-h h1 (30px en tableta) */
  --text-login: 32px;       /* .lg2-card h1 (28px en celular) */
  --text-metric: 30px;      /* .mm-v (cifra de las tarjetas, redondeada) */
  --text-hero: clamp(40px, 4.4vw, 64px); /* .hero-v */
  --tracking-display: -.022em;

  /* ---------- Superficies y texto (claro) ---------- */
  --bg: #F5F5F7; --surface: #FFFFFF; --surface-2: #F5F5F7; --surface-3: #E8E8ED;
  --ink: #1D1D1F; --ink-2: #1D1D1F; --muted: #6E6E73; --muted-2: #86868B;
  --line: #E5E5EA; --line-2: #D2D2D7; --hair: rgba(0,0,0,.08);
  --fill: rgba(120,120,128,.12); --fill-2: rgba(120,120,128,.18); --fill-3: rgba(118,118,128,.08);

  /* ---------- Marca ---------- */
  --brand: #AD103C; --brand-ink: #FFFFFF;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --gold: #FABD4B; --gold-ink: #1D1D1F; --gold-text: #A86F0C;   /* oro: solo resaltes */
  --deep: #282E49;                                              /* azul profundo corporativo */
  --cream: #EFEFEF;                                             /* blanco de marca */
  --focus: color-mix(in srgb, var(--brand) 70%, #0071E3);
  --iso: var(--brand);                                          /* color del isotipo del logo */

  /* ---------- Estados ---------- */
  --ok: #248A3D;   --ok-bg: rgba(52,199,89,.14);  --ok-solid: #34C759;
  --warn: #B25000; --warn-bg: rgba(255,149,0,.15); --warn-solid: #FF9500;
  --bad: #D70015;  --bad-bg: rgba(255,59,48,.11);  --bad-solid: #FF3B30;
  --info: #0066CC; --info-bg: rgba(0,113,227,.11);
  --violet: #8944AB; --violet-bg: rgba(175,82,222,.13);
  --teal: #0E7C86;   --teal-bg: rgba(48,176,199,.14);

  /* ---------- Planes y líneas de negocio ---------- */
  --plan-bronce: #B8763E; --plan-plata: #8E8E93; --plan-oro: #E0A11B; --plan-diamante: #AD103C;
  --line-serv: #30B0C7; --line-non: #AF52DE;

  /* ---------- Colores de grupo de módulo (MODULES[].color) ---------- */
  --mod-vino: #AD103C; --mod-oro: #C9971F; --mod-azul: #4B5788; --mod-seguridad: #282E49;

  /* ---------- Tarjeta principal ---------- */
  --hero-1: #FFFFFF; --hero-2: #FFFFFF; --hero-ink: var(--ink); --hero-muted: var(--muted);

  /* ---------- Formas ---------- */
  --r-xs: 7px;  --r-ctl: 9px;  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px;
  --r-card: 20px; --r-hero: 26px; --r-modal: 24px; --r-login: 28px; --r-pill: 99px;

  /* ---------- Elevación ---------- */
  --shadow: 0 1px 1px rgba(0,0,0,.02), 0 2px 10px -6px rgba(0,0,0,.08);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.04), 0 16px 34px -18px rgba(0,0,0,.22);
  --shadow-pop: 0 0 0 .5px rgba(0,0,0,.08), 0 24px 64px -14px rgba(0,0,0,.28);
  --shadow-thumb: 0 .5px 0 rgba(0,0,0,.04), 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04);

  /* ---------- Vidrio esmerilado (barra, menús, paleta, Athena) ---------- */
  --glass: color-mix(in srgb, #F5F5F7 78%, transparent);
  --glass-strong: color-mix(in srgb, #FFFFFF 82%, transparent);
  --glass-side: color-mix(in srgb, #ECECF0 80%, transparent);
  --glass-brd: rgba(0,0,0,.08);
  --hover-tint: rgba(0,0,0,.045);
  --blur-bar: saturate(180%) blur(24px);
  --blur-side: saturate(180%) blur(30px);
  --blur-pop: saturate(180%) blur(40px);
  --seg-thumb: var(--surface);

  /* ---------- Movimiento (curvas de Apple; el resorte usa linear() con respaldo) ---------- */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-in: cubic-bezier(.55,0,.75,.2);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --ease-spring: cubic-bezier(.32,1.28,.6,1);
  --dur-1: .16s; --dur-2: .28s; --dur-3: .46s;

  /* ---------- Medidas del armazón ---------- */
  --side-w: 264px; --top-h: 56px; --tab-h: 58px;
  --content-max: 1440px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);

  color-scheme: light;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  }
}

/* ---------- Tema oscuro ---------- */
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --surface-3: #3A3A3C;
  --ink: #F5F5F7; --ink-2: #F5F5F7; --muted: #98989D; --muted-2: #8E8E93;
  --line: #2C2C2E; --line-2: #3A3A3C; --hair: rgba(255,255,255,.1);
  --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.32); --fill-3: rgba(118,118,128,.18);
  --brand: #F0477A; --brand-ink: #FFFFFF;
  --gold-ink: #1D1D1F; --gold-text: #FABD4B;
  --ok: #30D158; --ok-bg: rgba(48,209,88,.16); --ok-solid: #30D158;
  --warn: #FF9F0A; --warn-bg: rgba(255,159,10,.16); --warn-solid: #FF9F0A;
  --bad: #FF453A; --bad-bg: rgba(255,69,58,.16); --bad-solid: #FF453A;
  --info: #0A84FF; --info-bg: rgba(10,132,255,.16);
  --violet: #BF5AF2; --violet-bg: rgba(191,90,242,.16);
  --teal: #64D2FF; --teal-bg: rgba(100,210,255,.14);
  --plan-plata: #AEAEB2; --plan-diamante: #F0477A;
  --hero-1: #1C1C1E; --hero-2: #1C1C1E;
  --shadow: none;
  --shadow-lift: 0 0 0 .5px rgba(255,255,255,.06), 0 18px 40px -18px rgba(0,0,0,.8);
  --shadow-pop: 0 0 0 .5px rgba(255,255,255,.12), 0 28px 80px -16px rgba(0,0,0,.85);
  --shadow-thumb: 0 3px 8px rgba(0,0,0,.4);
  --glass: color-mix(in srgb, #000000 72%, transparent);
  --glass-strong: color-mix(in srgb, #1C1C1E 80%, transparent);
  --glass-side: color-mix(in srgb, #161618 82%, transparent);
  --glass-brd: rgba(255,255,255,.1);
  --hover-tint: rgba(255,255,255,.07);
  --seg-thumb: #636366;
  color-scheme: dark;
}

/* ---------- Color de acento (Ajustes → Apariencia → Color de acento) ---------- */
:root[data-accent="azul"] { --brand: #282E49; }
:root[data-theme="dark"][data-accent="azul"] { --brand: #8C97D6; }
:root[data-accent="oro"] { --brand: #B07A10; --brand-ink: #FFFFFF; }
:root[data-theme="dark"][data-accent="oro"] { --brand: #FABD4B; --brand-ink: #1D1D1F; }
:root[data-accent="apple"] { --brand: #0071E3; }
:root[data-theme="dark"][data-accent="apple"] { --brand: #0A84FF; }
:root[data-accent="grafito"] { --brand: #5A5A5F; }
:root[data-theme="dark"][data-accent="grafito"] { --brand: #AEAEB2; --brand-ink: #1D1D1F; }

/* Tableta y celular: medidas de v11 */
@media (max-width: 1100px) { :root { --text-module: 30px; } }
@media (max-width: 760px)  { :root { --top-h: 50px; --text-login: 28px; } }

/* =====================================================================================
   Tablero Comercial · capa de componentes sobre los tokens de Agora Web Fase 1
   (design/tokens.css se inserta antes de este archivo en el build).
   Primitivas tomadas de base.css de Fase 1: .btn, .seg, .panel, .micro, .hero, .fld, .sc, .mdm.
   ===================================================================================== */

/* Colores propios de los gráficos (salen de los tokens; el azul profundo se aclara en oscuro) */
:root { --c-now: var(--brand); --c-prev: var(--muted-2); --c-deep: var(--deep); --ring: color-mix(in srgb, var(--brand) 16%, transparent); }
:root[data-theme="dark"] { --c-deep: #8C97D6; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-family: var(--font-text); scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0; font-family: var(--font-text); font-size: var(--text-body); line-height: var(--leading-body);
  letter-spacing: var(--tracking-body); background: var(--bg); color: var(--ink);
  overscroll-behavior-x: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: var(--tracking-display); margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
kbd { font: 600 11px/1 var(--font-text); padding: 3px 6px; border-radius: 6px; background: var(--fill); color: var(--muted); white-space: nowrap; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; z-index: 90; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Títulos (Fase 1) ---------- */
.t-module { font: 700 var(--text-module)/1.12 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.t-panel { font: 700 var(--text-panel)/1.25 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.t-metric { font: 700 var(--text-metric)/1.1 var(--font-rounded); letter-spacing: -.025em; color: var(--ink); }
.t-hero { font: 700 var(--text-hero)/1 var(--font-rounded); letter-spacing: -.035em; color: var(--ink); }
.t-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.t-sec { font: 700 24px/1.2 var(--font-display); letter-spacing: -.025em; color: var(--ink); margin: 40px 0 14px; }

/* ---------- Botones (Fase 1) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 16px;
  border: 0; border-radius: var(--r-pill); background: var(--fill); color: var(--ink); font: 600 13.5px/1.2 var(--font-text);
  cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background-color var(--dur-1) ease, transform .25s var(--ease-spring), opacity var(--dur-1) ease;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-cta { background: var(--brand); color: var(--brand-ink); }
.btn-cta:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-tint { background: var(--brand-soft); color: var(--brand); }
.btn-sm { min-height: 30px; padding: 5px 12px; font-size: 12.5px; }
.tb-ic {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; flex: 0 0 auto;
  transition: background-color .14s ease, color .14s ease, transform .25s var(--ease-spring);
}
.tb-ic:hover, .tb-ic[aria-expanded="true"] { background: var(--hover-tint); color: var(--ink); }
.tb-ic:active { transform: scale(.94); }

/* ---------- Control segmentado (Fase 1; la píldora se desliza con transform) ---------- */
.seg { position: relative; display: inline-flex; background: var(--fill-3); border-radius: var(--r-ctl); padding: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-b {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px;
  padding: 4px 14px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--ink); font: 500 13px/1.2 var(--font-text);
  cursor: pointer; white-space: nowrap;
}
.seg-b.is-on { font-weight: 600; }
.seg-b .n { color: var(--muted); font-weight: 500; font-size: 12px; }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 0; z-index: 0; border-radius: var(--r-xs); background: var(--seg-thumb); box-shadow: var(--shadow-thumb); transition: transform .42s var(--ease-spring), width .42s var(--ease-spring); }
:root[data-theme="dark"] .seg-b.is-on { color: #fff; }

/* ---------- Superficies (Fase 1) ---------- */
.panel { background: var(--surface); border-radius: var(--r-xl); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.panel-h p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.micro { display: flex; flex-direction: column; gap: 6px; border-radius: var(--r-card); padding: 16px 18px 14px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.micro h3 { font: 600 13px/1.3 var(--font-text); letter-spacing: 0; color: var(--muted); }
.micro .t-metric { overflow-wrap: anywhere; }
.micro .f { font-size: 12.5px; color: var(--muted); }
.micro[data-what] { cursor: default; }
.micro-red { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 40%, transparent), var(--shadow); }
.hero { background: var(--surface); color: var(--ink); border-radius: var(--r-hero); box-shadow: var(--shadow); padding: 28px 30px; min-width: 0; }
.hero .f { color: var(--muted); margin: 10px 0 0; }
.note-gold { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border-radius: 16px; padding: 12px 14px; font-size: 13.5px; margin-top: 16px; color: var(--ink); }
.note-gold a { color: var(--brand); font-weight: 600; }
.src { font-size: 12px; color: var(--muted-2); margin: 12px 0 0; }

/* ---------- Etiquetas de estado (Fase 1) ---------- */
.sc { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; white-space: nowrap; }
.sc-ok { background: var(--ok-bg); color: var(--ok); }
.sc-warn { background: var(--warn-bg); color: var(--warn); }
.sc-bad { background: var(--bad-bg); color: var(--bad); }
.sc-gray { background: var(--fill); color: var(--muted); }
.nav-b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--bad-solid); color: #fff; font: 700 11px/1 var(--font-rounded); }
.up { color: var(--ok); font-weight: 600; } .down { color: var(--bad); font-weight: 600; }
.strong { color: var(--ink); font-weight: 600; } .muted { color: var(--muted); }

/* =====================================================================================
   Armazón: barra superior (menú arriba por defecto), barra lateral opcional, pestañas en celular
   ===================================================================================== */
.tb {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  min-height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 20px 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: var(--blur-bar); backdrop-filter: var(--blur-bar);
  border-bottom: 1px solid var(--line-2);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tb { background: var(--bg); } }
.brand { display: inline-flex; align-items: flex-end; gap: 6px; color: var(--ink); text-decoration: none; flex: 0 0 auto; border-radius: 8px; }
.brand svg { display: block; }
.brand small { margin-bottom: 1px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.crumb-sep { color: var(--muted-2); }
.crumb {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px 4px 4px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--ink); font: 650 var(--text-crumb)/1.2 var(--font-text); cursor: pointer; min-width: 0;
}
.crumb:hover, .crumb[aria-expanded="true"] { background: var(--hover-tint); }
.crumb > span:not([class]) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb .chev { color: var(--muted); width: 14px; height: 14px; transition: transform var(--dur-2) var(--ease-spring); }
.crumb[aria-expanded="true"] .chev { transform: rotate(180deg); }
.mdm-ic { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: var(--c, var(--brand)); color: #fff; }
.mdm-ic .ic { width: 16px; height: 16px; }
.crumb .mdm-ic { width: 24px; height: 24px; border-radius: 7px; }
.crumb .mdm-ic .ic { width: 14px; height: 14px; }
.tb-cut { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tb-cut b { color: var(--ink); font-weight: 600; }
.tb-r { display: flex; align-items: center; gap: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink); font: 700 12px/1 var(--font-rounded); cursor: pointer; margin-left: 4px; }
.avatar:hover, .avatar[aria-expanded="true"] { background: var(--fill-2); }

/* Barra lateral (opcional: Apariencia → Menú → Barra lateral, o ⌘\) */
.side { display: none; }
:root.nav-side .side {
  display: flex; flex-direction: column; gap: 14px; position: fixed; z-index: 25; left: 0; top: calc(var(--top-h) + var(--safe-t)); bottom: 0;
  width: var(--side-w); padding: 16px 12px 20px; overflow-y: auto; background: var(--glass-side);
  -webkit-backdrop-filter: var(--blur-side); backdrop-filter: var(--blur-side); border-right: 1px solid var(--line-2);
  transition: transform var(--dur-3) var(--ease-out);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root.nav-side .side { background: var(--surface-2); } }
:root.nav-side.side-closed .side { transform: translateX(-100%); }
:root.nav-side:not(.side-closed) .ct, :root.nav-side:not(.side-closed) .ft { margin-left: var(--side-w); }
.side .mdm-gt { margin: 0 0 4px; }
:root.nav-side .crumb .chev { display: none; }

/* Elementos del menú (compartidos por el menú de módulos y la barra lateral) */
.mdm-gt { margin: 0 0 4px; padding: 0 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.mdm-i {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; outline: none; transition: background-color var(--dur-1) ease;
}
.mdm-i:hover, .mdm-i:focus-visible, .mdm-i.is-kb { background: var(--hover-tint); }
.mdm-i.is-on { background: var(--brand-soft); }
.mdm-i b { display: block; font-size: 14px; font-weight: 600; }
.mdm-i small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdm-i .tx { min-width: 0; flex: 1; }
.mdm-i .k { margin-left: auto; }
.mdm-i .ok { color: var(--brand); width: 16px; height: 16px; }

/* Contenido */
.ct { max-width: var(--content-max); margin: 0 auto; padding: 28px 28px 72px; transition: margin-left var(--dur-3) var(--ease-out); }
.ct:focus { outline: none; }
.mod-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.mod-h .lede { margin: 8px 0 0; color: var(--muted); max-width: 70ch; }
.mod-h .t-label { margin-bottom: 4px; }
.mod-h .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ft {
  max-width: var(--content-max); margin: 0 auto; padding: 18px 28px calc(28px + var(--safe-b)); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
}
.ft b { color: var(--brand); font-weight: 600; }

/* Pestañas en celular (cinco destinos; "Más" abre el menú de módulos) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    min-height: calc(var(--tab-h) + var(--safe-b)); padding: 4px 4px var(--safe-b); background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: var(--blur-bar); backdrop-filter: var(--blur-bar); border-top: 1px solid var(--line-2);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tabbar { background: var(--bg); } }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
    color: var(--muted-2); font: 600 10.5px/1.1 var(--font-text); text-decoration: none; cursor: pointer; border-radius: 10px;
  }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--brand); }
  .ft { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 20px); }
  .crumb-sep { display: none; }
  .brand small { display: none; }
  .tb { padding-left: 16px; padding-right: 10px; gap: 6px; }
  :root.nav-side .side { display: none; }
  :root.nav-side:not(.side-closed) .ct, :root.nav-side:not(.side-closed) .ft { margin-left: 0; }
}
@media (max-width: 1100px) { .brand small { display: none; } }


/* =====================================================================================
   Rejillas, métricas y gráficos
   ===================================================================================== */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.goal { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.goal .f { margin: 0; font-size: 13px; }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { font-weight: 600; min-width: 84px; text-align: right; }
.track { position: relative; height: 10px; background: var(--fill-3); border-radius: var(--r-pill); }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--c-now); border-radius: var(--r-pill); min-width: 3px; transform-origin: left; }
.fill.alt { background: var(--c-deep); }
.target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.stack { display: flex; height: 18px; border-radius: var(--r-pill); overflow: hidden; gap: 2px; }
.stack span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.ln { height: 2px; width: 14px; border-radius: 1px; vertical-align: 3px; }
.legend i.dash { height: 0; width: 14px; border-top: 2px dashed var(--c-prev); background: none; vertical-align: 3px; }
.view-enter .fill { animation: grow .7s var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }

svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 12px var(--font-text); fill: var(--muted); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: var(--ink); fill-opacity: .04; }
.chart .dl { font-weight: 650; fill: var(--ink); }
.chart-wrap { cursor: zoom-in; border-radius: 10px; }
.chart-big svg.chart { max-height: 70vh; }

/* Tooltip: superficie opaca con borde */
#tip {
  position: fixed; z-index: 80; pointer-events: none; max-width: 280px; padding: 8px 11px; border-radius: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  font-size: 12.5px; line-height: 1.45; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
#tip.on { opacity: 1; transform: none; }
#tip b { font-weight: 650; }

/* =====================================================================================
   Filtros y tablas
   ===================================================================================== */
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fld select, .fld input {
  min-height: 38px; min-width: 160px; padding: 7px 12px; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--fill-3);
  color: var(--ink); font: 400 14px/1.3 var(--font-text); transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease, background-color var(--dur-1) ease;
}
.fld select:focus, .fld input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 0 0 4px var(--ring); }
.fld.grow { flex: 1; }
.fld.grow input { min-width: 240px; width: 100%; }
.search-in { position: relative; display: block; }
.search-in .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-in input { padding-left: 34px; }
.tools .clear { align-self: flex-end; }

.tw { overflow: auto; border-radius: var(--r-md); border: 1px solid var(--line); max-height: 640px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th button { all: unset; cursor: pointer; border-radius: 4px; }
th button:focus-visible { outline: 2px solid var(--focus); }
th button:hover { color: var(--ink); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 220px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover-tint); }
tbody tr[data-row] { cursor: default; }
td.n, th.n { text-align: right; }
tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 0; position: sticky; bottom: 0; }
td small { display: block; color: var(--muted-2); font-size: 12px; }
.heat td.c { text-align: center; font-weight: 650; min-width: 46px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager div { display: flex; gap: 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); white-space: normal; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
dl.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; text-align: right; font-weight: 600; }
.issue { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.issue:first-child { padding-top: 0; } .issue:last-child { border-bottom: 0; padding-bottom: 0; }
.issue h3 { font: 650 14.5px/1.35 var(--font-text); letter-spacing: 0; }
.issue p { margin: 4px 0 6px; font-size: 14px; }
.issue code, code { font: 12px var(--font-mono); color: var(--muted-2); }
.issue .sc { justify-self: start; align-self: start; }

/* =====================================================================================
   Capas: menús, paleta ⌘K, modales y hojas, Athena, avisos
   Superficies opacas con borde de 1 px (sin desenfoque en capas flotantes).
   ===================================================================================== */
.pop {
  position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
  transform-origin: var(--ox, 32px) -8px; animation: mdmIn .42s var(--ease-spring) both;
}
.pop.out { animation: mdmOut .18s var(--ease-in) both; }
.pop .mdm-i { animation: mdmItem .5s var(--ease-out) both; }
.mdm { width: min(640px, calc(100vw - 24px)); max-height: min(72vh, 640px); overflow: auto; padding: 12px; }
.mdm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.mdm-ft { margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 10px 0; font-size: 12px; color: var(--muted); }
.acct { width: 300px; padding: 14px; display: grid; gap: 14px; }
.acct .who { display: flex; gap: 10px; align-items: center; }
.acct .who .avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin: 0; }
.acct .who b { display: block; font-size: 14px; } .acct .who small { color: var(--muted); font-size: 12px; }
.acct h4 { margin: 0 0 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.ctx { min-width: 240px; padding: 6px; }
.ctx button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; }
.ctx button:hover, .ctx button:focus-visible { background: var(--hover-tint); outline: none; }
.ctx .ic { width: 16px; height: 16px; color: var(--muted); }
.whatpop { width: min(320px, calc(100vw - 24px)); padding: 14px 16px; font-size: 13.5px; }
.whatpop b { display: block; margin-bottom: 4px; }
.whatpop p { margin: 0; color: var(--muted); }

.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; animation: fadeIn var(--dur-2) ease both; }
.scrim.out { animation: fadeOut var(--dur-1) ease both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 80vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-modal); box-shadow: var(--shadow-pop); padding: 24px 24px 20px; animation: modalIn .42s var(--ease-spring) both; }
.modal.wide { width: min(1080px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-h h2 { font: 700 var(--text-modal)/1.2 var(--font-display); letter-spacing: -.02em; }
.modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill-3); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.x:hover { background: var(--fill); color: var(--ink); }
.x .ic { width: 15px; height: 15px; transform: rotate(45deg); }
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@media (max-width: 760px) {
  .scrim { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 88vh; border-radius: var(--r-modal) var(--r-modal) 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: ecoSheetUp .45s var(--ease-out) both; }
}
@keyframes ecoSheetUp { from { transform: translateY(100%); } }

/* Paleta "Buscar o ir a…" (⌘K) */
.cmdk { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-pop); overflow: hidden; animation: modalIn .42s var(--ease-spring) both; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-in .ic { color: var(--muted); }
.cmdk-in input { flex: 1; min-height: 54px; border: 0; background: none; font-size: 16px; outline: none; color: var(--ink); }
.cmdk-list { max-height: min(56vh, 460px); overflow: auto; padding: 8px; }
.cmdk-list .mdm-gt { margin-top: 8px; }
.cmdk-list .mdm-i { min-height: 40px; cursor: pointer; }
.cmdk-ft { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .cmdk { border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); animation: ecoSheetUp .45s var(--ease-out) both; } .cmdk-ft { display: none; } }

/* Atajos y gestos ("?") */
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.keys h3 { font: 650 13px/1.3 var(--font-text); color: var(--muted); margin-bottom: 8px; letter-spacing: 0; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; align-items: baseline; }
.keys dd { margin: 0; }
.keys .gest { grid-column: 1 / -1; }
.keys .gest li { margin-bottom: 10px; font-size: 13.5px; } .keys .gest b { display: block; }
.keys .gest span { color: var(--muted); }
.keys ul { list-style: none; padding: 0; margin: 0; }

/* Athena: panel a la derecha (hoja desde abajo en celular). Solo lee el tablero, sin internet. */
.ath {
  position: fixed; z-index: 65; right: 16px; bottom: 16px; top: calc(var(--top-h) + var(--safe-t) + 12px); width: min(400px, calc(100vw - 32px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); animation: athIn .42s var(--ease-spring) both;
}
.ath.out { animation: athOut .2s var(--ease-in) both; }
@keyframes athIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes athOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.ath-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.ath-h img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.ath-h b { display: block; font-size: 15px; } .ath-h small { color: var(--muted); font-size: 12px; }
.ath-h .x { margin-left: auto; }
.ath-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.bot p { margin: 0 0 6px; } .msg.bot p:last-child { margin: 0; }
.msg.bot ul { margin: 4px 0; padding-left: 18px; }
.msg .go { margin-top: 8px; }
.msg.typing { display: inline-flex; gap: 4px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: athDot 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes athDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.ath-sug { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 10px; }
.ath-f { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ath-f input { flex: 1; min-height: 40px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--fill-3); outline: none; }
.ath-f input:focus { border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.ath-f .btn { width: 40px; padding: 0; }
@media (max-width: 760px) {
  .ath { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 82vh; border-radius: var(--r-modal) var(--r-modal) 0 0; padding-bottom: var(--safe-b); animation: ecoSheetUp .45s var(--ease-out) both; }
}

/* Aviso breve */
#toast {
  position: fixed; z-index: 85; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-pop); transition: opacity var(--dur-2) ease, transform var(--dur-3) var(--ease-spring); max-width: calc(100vw - 32px);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { #toast { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); } }

/* Animaciones de Fase 1 */
@keyframes mdmIn { from { opacity: 0; transform: translateY(-8px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes mdmOut { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes mdmItem { from { opacity: 0; transform: translateY(6px); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.view-enter > * { animation: viewIn .56s var(--ease-out) both; }
.view-enter > *:nth-child(2) { animation-delay: .04s; } .view-enter > *:nth-child(3) { animation-delay: .08s; }
.view-enter > *:nth-child(4) { animation-delay: .12s; } .view-enter > *:nth-child(n+5) { animation-delay: .16s; }
.flash { animation: flash 1.2s var(--ease-out); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--ring), var(--shadow); } }

/* =====================================================================================
   Responsive y otros contextos
   ===================================================================================== */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-hero { grid-template-columns: 1fr; }
  :root.nav-side:not(.side-closed) .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ct { padding: 20px 16px 40px; } .ft { padding-left: 16px; padding-right: 16px; }
  .t-sec { font-size: 21px; margin-top: 32px; }
  .g2, .g3 { grid-template-columns: 1fr; } .g4, .g-hero .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .panel { padding: 18px 16px; border-radius: var(--r-lg); } .hero { padding: 22px 20px; }
  .micro { padding: 14px; border-radius: var(--r-lg); } .micro .t-metric { font-size: 21px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; } .bar-row .track { grid-column: 1 / -1; grid-row: 2; }
  .fld, .fld select, .fld input, .fld.grow input { min-width: 0; width: 100%; } .tools .fld { flex: 1 1 140px; }
  .issue { grid-template-columns: 1fr; }
  .mdm-grid, .keys { grid-template-columns: minmax(0, 1fr); }
  .mdm { left: 12px !important; right: 12px; width: auto; }
}
@media (pointer: coarse) { .tb-ic { width: 40px; height: 40px; } .seg-b { min-height: 34px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .tb, .side, .tabbar, .tools, .pager, .ft, #tip, #toast, .ath, .pop, .scrim, .mod-h .acts { display: none !important; }
  body { background: #fff; } .ct { margin: 0 !important; padding: 0; max-width: none; }
  .panel, .micro, .hero { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .tw { max-height: none; overflow: visible; } .view-enter > * { animation: none !important; }
}

/* =====================================================================================
   v2 · Barra superior igual a la app, acceso, usuarios, auditoría y ajustes
   ===================================================================================== */
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--fill-3); color: var(--muted); cursor: pointer; transition: background-color .14s ease, color .14s ease; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--ink); background: var(--fill); }

/* Barra: marca · módulo · meses (centro) · historial · buscar · Athena · Inicio/Ajustes/Auditoría · candado · tema · cuenta */
.tb { gap: 8px; padding-left: 24px; padding-right: 16px; }
.brand svg { width: auto; height: 26px; }
.tb-mid { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; padding: 0 8px; }
.tb-r { margin-left: 0; gap: 4px; flex: 0 0 auto; }
.crumb .nav-b { margin-left: 2px; }
.seg-tb .seg-b { min-height: 30px; padding: 4px 16px; font-size: 14px; }
.dot-now, .dot-proj { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: 2px; }
.dot-now { background: var(--ok-solid); }
.dot-proj { width: 7px; height: 7px; box-shadow: inset 0 0 0 1.5px var(--gold); }
.tb-search { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px; border: 0; border-radius: 10px; background: var(--fill-3); color: var(--muted); cursor: pointer; margin: 0 2px; }
.tb-search:hover { background: var(--fill); color: var(--ink); }
.tb-search .ic { width: 16px; height: 16px; }
.tb-search kbd { background: var(--fill); }
.tb-ath { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 3px 14px 3px 3px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font-text); cursor: pointer; box-shadow: 0 0 0 1px var(--line), var(--shadow); transition: box-shadow var(--dur-1) ease, transform .25s var(--ease-spring); margin-right: 4px; }
.tb-ath:hover, .tb-ath[aria-expanded="true"] { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lift); }
.tb-ath:active { transform: scale(.97); }
.tb-ath img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.tb-sc { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--muted); font: 500 14.5px/1 var(--font-text); text-decoration: none; white-space: nowrap; transition: background-color .14s ease, color .14s ease; }
.tb-sc:hover { background: var(--hover-tint); color: var(--ink); }
.tb-sc[aria-current="page"] { color: var(--ink); background: var(--hover-tint); }
.tb-sc .ic { width: 18px; height: 18px; }
.tb-ic.is-open { color: var(--brand); background: var(--brand-soft); }
.tb-ic[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.mseg { display: none; }
@media (max-width: 1440px) { .tb-sc span { display: none; } .tb-sc { padding: 0 8px; } }
@media (max-width: 1180px) { .tb-ath span { display: none; } .tb-ath { padding: 3px; } .brand small { display: none; } }
@media (max-width: 1000px) { .tb-mid { display: none; } .tb-r { margin-left: auto; } .mseg { display: flex; margin-bottom: 18px; } .tb-search kbd { display: none; } }
@media (max-width: 760px) { .tb-sc, #b-hist, #b-theme { display: none; } .tb-search { padding: 0 9px; background: transparent; } .mseg .seg { width: 100%; } .mseg .seg-b { flex: 1; } }

/* Avisos de fila: texto + acción */
.note-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.note-row.top { margin: 0 0 18px; }
.tw.full { max-height: none; }

/* Pantalla de acceso (lg2): tarjeta, Athena flotando con halo, sacudida y giro de carga */
:root.is-auth .tb, :root.is-auth .side, :root.is-auth .ct, :root.is-auth .ft, :root.is-auth .tabbar, :root.is-auth #layer > .ath { display: none !important; }
.lg { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 72px 16px 28px; background: var(--bg); }
.lg-card { position: relative; width: min(420px, 100%); background: var(--surface); border-radius: var(--r-login); box-shadow: var(--shadow-pop); padding: 76px 32px 28px; border: 1px solid var(--line); animation: modalIn .5s var(--ease-spring) both; }
.lg-art { position: absolute; left: 50%; top: -58px; width: 116px; height: 116px; transform: translateX(-50%); }
.lg-art img { position: relative; z-index: 1; width: 116px; height: 116px; object-fit: contain; animation: lgFloat 3.2s var(--ease-in-out) infinite alternate; }
.lg-halo { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent) 0, transparent 70%); transform: translate(-50%, -50%); animation: lgHalo 3.2s var(--ease-in-out) infinite alternate; }
@keyframes lgFloat { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes lgHalo { from { transform: translate(-50%, -50%) scale(.96); } to { transform: translate(-50%, -50%) scale(1.06); } }
.lg-brand { display: flex; align-items: flex-end; justify-content: center; gap: 6px; color: var(--ink); margin-bottom: 18px; }
.lg-brand small { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.lg-card h1 { font: 700 var(--text-login)/1.1 var(--font-display); letter-spacing: -.03em; text-align: center; }
.lg-sub { margin: 8px 0 22px; text-align: center; color: var(--muted); font-size: 14px; }
.lg-card form { display: grid; gap: 14px; }
.lg-card .fld input { min-width: 0; width: 100%; min-height: 44px; font-size: 15px; }
.lg-go { width: 100%; min-height: 46px; font-size: 15px; margin-top: 4px; }
.lg-help { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.lg-link { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.lg-foot { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.lg-foot .ic { width: 14px; height: 14px; }
.fld-err { margin: 0; min-height: 1px; color: var(--bad); font-weight: 600; font-size: 12.5px; }
.fld-err:empty { display: none; }
.fld-feedback { display: block; font-size: 11px; margin-top: 4px; line-height: 1.35; }
.fld-feedback.err { color: #ef4444; font-weight: 500; }
.fld-feedback.ok { color: #10b981; font-weight: 500; }
.fld input.is-invalid, .fld select.is-invalid, .fld textarea.is-invalid {
  border-color: #ef4444 !important;
  background-color: color-mix(in srgb, #ef4444 4%, var(--surface-2, #fff)) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.fld input.is-valid, .fld select.is-valid, .fld textarea.is-valid {
  border-color: #10b981 !important;
  background-color: color-mix(in srgb, #10b981 3%, var(--surface-2, #fff)) !important;
}
.fld-hint { font-size: 11px; color: var(--muted, #64748b); margin-top: 3px; display: block; }
.pw-in { position: relative; display: block; }
.pw-in input { width: 100%; padding-right: 84px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 600 12.5px/1 var(--font-text); cursor: pointer; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--brand); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules .ic { width: 14px; height: 14px; }
.pw-rules li.ok { color: var(--ok); }
.shake { animation: lgShake .5s both !important; }
@keyframes lgShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: lgSpin .7s linear infinite; display: inline-block; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .lg-card { padding: 72px 20px 24px; } .pw-rules { grid-template-columns: 1fr; } }

/* Formularios en paneles y modales */
.form { display: grid; gap: 14px; }
.form .fld input, .form .fld select, .modal .fld input, .modal .fld select { min-width: 0; width: 100%; }
.fld input:disabled { opacity: .7; }
.form-ft { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.form .form-ft { margin-top: 4px; }
.h4, .ap h4, .acct h4 { margin: 18px 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ap { display: grid; gap: 4px; } .ap h4 { margin-top: 10px; } .ap > div:first-child h4 { margin-top: 0; }
.secs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.secs li { display: flex; gap: 8px; align-items: flex-start; }
.secs .ic { width: 16px; height: 16px; color: var(--ok); margin-top: 1px; }
.role-help { list-style: none; margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.role-help li { display: flex; gap: 8px; align-items: flex-start; } .role-help .ic { width: 15px; height: 15px; margin-top: 1px; flex: 0 0 auto; }
.secret { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.secret code { font: 700 20px/1.2 var(--font-mono); color: var(--ink); letter-spacing: .04em; user-select: all; }
.acct { width: 320px; }
.acct .who small { display: block; }
.acct-ft { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Matriz de permisos */
table.perm td.c, table.perm th.c { text-align: center; }
table.perm .yes { display: inline-flex; color: var(--ok); }
table.perm .yes .ic { width: 18px; height: 18px; }
table.perm tr.grp td { background: var(--surface-2); font-weight: 650; color: var(--muted); font-size: 12.5px; }
table.perm code { font-size: 11.5px; }

/* Observaciones resueltas */
.issue.is-done h3, .issue.is-done p:not(.src) { color: var(--muted); }
.issue-act { margin-top: 10px; }

/* Actividad reciente */
.histpop { width: min(360px, calc(100vw - 24px)); padding: 10px; max-height: min(70vh, 520px); overflow: auto; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; }
.hist li { padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist li:last-child { border-bottom: 0; }
.hist b { display: block; font-weight: 600; } .hist span { color: var(--muted); font-size: 12px; } .hist small { display: block; color: var(--muted-2); font-size: 12px; margin-top: 2px; }
@media (max-width: 760px) { .tb .brand, .tb .crumb-sep { display: none; } .crumb { flex: 1 1 auto; } }
:root[data-theme="dark"] .mdm-ic { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }

/* =====================================================================================
   Gestión Comercial (reporte) y Configuración mensual
   Jerarquía del encabezado: H1 24–28 px/700 · metadatos 14 px/400 en gris · escala de 8 pt
   ===================================================================================== */
.rep-h { margin-bottom: 8px; }
.rep-h .t-module { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; }
.rep-meta { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 8px 0 0; font-size: 14px; font-weight: 400; color: var(--muted); }
.rep-meta div { display: flex; gap: 6px; }
.rep-meta dt { font-weight: 400; }
.rep-meta dt::after { content: ":"; }
.rep-meta dd { margin: 0; color: var(--ink-2); font-weight: 400; }
.t-sub { font: 600 14px/1.3 var(--font-text); color: var(--muted); margin: 24px 0 8px; display: flex; align-items: center; gap: 8px; }
.t-sec + .t-sub { margin-top: 0; }
.hero-col { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.hero-col .goal { margin-top: 0; }
.f-note { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Semáforo: punto + texto, nunca solo color */
.lt { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.lt i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lt-ok { color: var(--ok); } .lt-ok i { background: var(--ok-solid); }
.lt-warn { color: var(--warn); } .lt-warn i { background: var(--warn-solid); }
.lt-bad { color: var(--bad); } .lt-bad i { background: var(--bad-solid); }

/* Formulario de configuración mensual */
.cfg .fld .hint { font-weight: 400; font-size: 12px; color: var(--muted-2); }
.cfg .fld input, .cfg-t input { width: 100%; min-width: 0; }
.cfg-t { min-width: 640px; }
.cfg-t td, .cfg-t th { vertical-align: middle; }
.cfg-t td.n input { text-align: right; max-width: 150px; margin-left: auto; display: block; font-variant-numeric: tabular-nums; }
.cfg-t input { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: 500 14px/1 var(--font-text); }
.cfg-t input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 0 0 4px var(--ring); }
.cfg input:disabled { opacity: .7; cursor: not-allowed; }
.cfg-ft { margin-top: 16px; position: sticky; bottom: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow); }
@media (max-width: 760px) { .cfg-ft { bottom: calc(var(--tab-h) + var(--safe-b) + 8px); } .cfg-ft .btn { flex: 1 1 100%; } }
.cfg > .fld-err { margin-top: 12px; }

/* Menú de sistema (cabecera) */
.sysm { min-width: 260px; }
.ctx a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.ctx a:hover, .ctx a:focus-visible, .ctx a[aria-current="page"] { background: var(--hover-tint); outline: none; }
.ctx a .ic { width: 16px; height: 16px; color: var(--muted); }
.sysm small { margin-left: auto; color: var(--muted-2); font-size: 12px; }
.sysm hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.tb-ic[aria-expanded="true"], .tb-ic.is-open { background: var(--hover-tint); }
.tb-ic.is-open { color: var(--brand); background: var(--brand-soft); }

.span2 { grid-column: 1 / -1; }
.f-note a { color: var(--brand); font-weight: 600; }

/* =====================================================================================
   Contratos · ASOCIM — lo propio del panel sobre el sistema del Tablero Comercial v3
   ===================================================================================== */

/* Módulos arriba: pestañas en el centro de la barra (como los meses del v3) */
.tb-mid .seg-tb .seg-b .n { margin-left: 2px; }
.tb-new { margin-right: 4px; }
.mseg { display: none; }
@media (max-width: 1000px) { .mseg { display: flex; margin-bottom: 18px; } .mseg .seg { width: 100%; } .mseg .seg-b { flex: 1; } }
@media (max-width: 760px) { .mseg { display: none; } .tb-new span { display: none; } .tb-new { width: 36px; padding: 0; } .tb .brand { display: inline-flex !important; } }
.tabbar { grid-template-columns: repeat(var(--tabs, 4), 1fr) !important; }

/* Estado de convenio en azul (enviado, por firmar) */
.sc-info { background: var(--info-bg); color: var(--info); }

/* Tarjetas que filtran */
button.micro { border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: box-shadow var(--dur-1) ease, transform .25s var(--ease-spring); }
button.micro:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lift); }
button.micro:active { transform: scale(.985); }
button.micro.is-on { box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow); }
:root[data-theme="dark"] .micro, :root[data-theme="dark"] .panel, :root[data-theme="dark"] .hero { box-shadow: 0 0 0 1px var(--line); }

/* Tablas con fila que se abre */
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href] td:last-child .ic { color: var(--muted-2); }
td .who-cell b { display: block; font-weight: 600; color: var(--ink); }
td .who-cell small { display: block; color: var(--muted); font-size: 12.5px; }
td.act { width: 1%; text-align: right; }
td.act .btn + .btn { margin-left: 6px; }
.tools .seg { align-self: flex-end; }

/* Esqueleto de carga */
.sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--fill-3) 0, var(--fill) 50%, var(--fill-3) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
.sk + .sk { margin-top: 12px; }
.sk.w40 { width: 40%; } .sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.big { height: 30px; width: 50%; margin-top: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Ficha de contacto y elección en Nuevo convenio */
.pick { display: grid; gap: 8px; margin-top: 14px; }
.pick button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease; }
.pick button:hover, .pick button:focus-visible { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); outline: none; }
.pick .tx { min-width: 0; flex: 1; }
.pick b { display: block; font-weight: 600; }
.pick small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .ic { color: var(--muted-2); }
.ini { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font: 700 13px/1 var(--font-rounded); }
.chosen { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.chosen .tx { flex: 1; min-width: 0; }
.chosen b { display: block; font-weight: 650; }
.chosen small { display: block; color: var(--muted); font-size: 12.5px; }
.search-row { display: flex; gap: 10px; align-items: flex-end; }
.search-row .fld { flex: 1; }
.search-row .fld input { min-width: 0; width: 100%; }
.panel.is-off { opacity: .55; pointer-events: none; }
.step { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; background: var(--brand); color: var(--brand-ink); font: 700 12.5px/1 var(--font-rounded); margin-right: 8px; vertical-align: 2px; }
.step.done { background: var(--ok-solid); }
.g-side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.sticky { position: sticky; top: calc(var(--top-h) + var(--safe-t) + 16px); }
.form .grid { gap: 14px; }
.fld .hint { font-weight: 400; color: var(--muted-2); font-size: 12px; }
.seg-fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-fld .seg { align-self: flex-start; }

/* Resumen del cálculo */
dl.kv.sum { gap: 12px 16px; }
dl.kv.sum dt.tot, dl.kv.sum dd.tot { font-weight: 700; color: var(--ink); padding-top: 12px; border-top: 1px solid var(--line); }
.hero dl.kv { margin-top: 0; }

/* Enlace de firma */
.secret.link { display: grid; gap: 10px; }
.secret.link code { font: 600 13px/1.4 var(--font-mono); letter-spacing: 0; word-break: break-all; user-select: all; }
.secret.link .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.secret.link small { color: var(--muted); font-size: 12.5px; }
.state-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.state-line .ic { margin-top: 2px; }
.state-line.ok .ic { color: var(--ok); } .state-line.info .ic { color: var(--info); } .state-line.bad .ic { color: var(--bad); } .state-line.gray .ic { color: var(--muted); }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); margin-top: 14px; }

/* Botones de peligro y retorno */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.back .ic { width: 15px; height: 15px; }

/* Lista de convenios dentro de la ficha */
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.mini-list li:last-child a { border-bottom: 0; }
.mini-list a:hover { background: var(--hover-tint); }
.mini-list small { color: var(--muted); display: block; font-size: 12.5px; }

/* Acceso */
.lg-card { padding-top: 34px; }
.lg-logo { display: flex; justify-content: center; align-items: flex-end; gap: 6px; color: var(--ink); margin-bottom: 18px; }
.lg-logo svg { height: 40px; width: auto; }
.lg-logo small { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }

/* Barra de pruebas del archivo independiente (no existe en el servidor) */
#demo-bar { position: fixed; z-index: 200; left: 12px; bottom: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; max-width: calc(100vw - 24px); background: #1d1f2b; color: #f5f5f7; border-radius: 12px; font: 12.5px/1.2 system-ui, sans-serif; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
#demo-bar label { display: flex; gap: 6px; align-items: center; }
#demo-bar select { background: #2b2f40; color: #f5f5f7; border: 1px solid #454a60; border-radius: 8px; padding: 5px 8px; font: inherit; }
#demo-bar b { font-weight: 650; }
#demo-bar button { background: none; border: 0; color: #a1a4b0; cursor: pointer; font: inherit; }
#demo-bar.min label { display: none; }
@media (max-width: 760px) { #demo-bar { bottom: calc(var(--tab-h) + var(--safe-b) + 10px); } }

@media (max-width: 1100px) { .g-side { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 760px) {
  .search-row { flex-direction: column; align-items: stretch; }
  td.act .btn span { display: none; }
  .g4 .micro .t-metric { font-size: 21px; }
}
.lnk-btn { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
td a { color: var(--brand); font-weight: 600; text-decoration: none; } td a:hover { text-decoration: underline; }


/* v1.3.6: pantalla de agencia */
.agency-shell{max-width:1320px;margin:0 auto;padding:clamp(14px,3vw,36px) 0 80px}
.agency-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;background:linear-gradient(115deg,#fff5f7,#f7f8fc);border:1px solid #e8e8ee;border-radius:26px;padding:clamp(22px,4vw,42px)}
.agency-hero h1{font-size:clamp(27px,3vw,42px);margin:6px 0 12px;color:#24242c}.agency-hero p{max-width:680px;line-height:1.6;color:#626370}
.agency-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:22px}.agency-kpis>div{border:1px solid #e7e7eb;background:var(--surface,#fff);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:10px}.agency-kpis small{color:#767781}.agency-kpis strong{font-size:23px;color:var(--text,#272733)}
.agency-section{margin:30px 0 15px}.agency-section h2{font-size:23px}.agency-section p{color:#71717b;margin-top:6px}
.agency-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.agency-card{border:1px solid #e7e7eb;border-radius:22px;background:var(--surface,#fff);padding:23px;min-width:0;box-shadow:0 3px 14px #18182608}.agency-card-top{display:flex;justify-content:space-between;align-items:center}.agency-initial{display:grid;place-items:center;background:#f5dfe5;color:#a51144;border-radius:14px;width:48px;height:48px;font-size:20px;font-weight:800}.agency-status{color:#137c45;background:#e1f7e9;border-radius:30px;padding:5px 12px;font-size:12px}.agency-card h2{font-size:21px;margin:20px 0 5px}.agency-card p{color:#777782}.agency-meta{display:flex;gap:13px;flex-wrap:wrap;font-size:12px;color:#71717d;border-top:1px solid #eee;padding-top:16px;margin-top:18px}.agency-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:19px}.agency-actions button{flex:1}.agency-empty{padding:25px;border:1px dashed #c9c9d0;border-radius:16px}
/* Alertas de Agencia en vivo */
.agency-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 0 0 14px;
  background: color-mix(in srgb, #f59e0b 10%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--line, #e2e8f0));
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink, #1e293b);
  animation: launch-in .35s ease-out both;
}
.agency-alert-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.agency-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px #f59e0b35;
  flex-shrink: 0;
  animation: agora-skeleton-pulse 1.5s infinite;
}
.agency-alert-banner .btn {
  font-size: 11px;
  padding: 5px 10px;
  min-height: 28px;
}
[data-theme="dark"] .agency-alert-banner {
  background: #2b2317;
  border-color: #5c4217;
  color: #fde68a;
}
[data-theme="dark"] .agency-alert-dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px #fbbf2440;
}

/* Filtros rápidos y buscador de subcuentas en Agencia */
.agency-filter-bar {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px;padding:10px 14px;background:var(--surface,#fff);border:1px solid var(--line);border-radius:14px;box-shadow:0 2px 8px -4px #10182810}
.agency-search-wrap {position:relative;flex:1;min-width:240px;max-width:380px}
.agency-search-wrap .search-in input {width:100%;height:38px;padding:0 12px 0 34px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;font:500 12.5px/1 var(--font-text);color:var(--ink);transition:border-color .2s,background .2s}
.agency-search-wrap .search-in input:focus {outline:none;border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 3px var(--ring)}
.agency-status-filters {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.agency-status-btn {display:inline-flex;align-items:center;gap:6px;padding:6px 12px;min-height:32px;font:600 11.5px/1 var(--font-text);background:var(--surface-2);color:var(--muted);border:1px solid var(--line);border-radius:20px;cursor:pointer;transition:all .2s;user-select:none}
.agency-status-btn:hover {background:color-mix(in srgb,var(--brand) 10%,var(--surface));color:var(--ink);border-color:color-mix(in srgb,var(--brand) 30%,var(--line))}
.agency-status-btn.is-active {background:var(--brand);color:#fff;border-color:var(--brand);box-shadow:0 2px 8px -2px var(--brand)}
.agency-status-btn .agency-filter-count {font-size:10px;padding:2px 6px;border-radius:10px;background:#00000014;color:inherit}
.agency-status-btn.is-active .agency-filter-count {background:#ffffff30;color:#fff}
.agency-filter-empty {padding:32px 20px;text-align:center;color:var(--muted);font-size:13px;border:1px dashed var(--line);border-radius:16px;background:var(--surface);margin:10px 0}
.agency-status-inactiva {color:#64748b;background:#f1f5f9}
.agency-status-pendiente {color:#b45309;background:#fef3c7}

/* Skeleton Screen para filtrado de subcuentas en Agencia */
.agency-card-skeleton {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  background: var(--surface, #ffffff);
  padding: 20px;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  user-select: none;
  animation: agora-skeleton-pulse 1.2s ease-in-out infinite;
}
.agency-skeleton-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.agency-skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 75%, transparent);
}
.agency-skeleton-badge {
  width: 62px;
  height: 22px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 60%, transparent);
}
.agency-skeleton-title {
  width: 74%;
  height: 20px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 80%, transparent);
  margin-bottom: 8px;
}
.agency-skeleton-subtitle {
  width: 50%;
  height: 13px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 55%, transparent);
  margin-bottom: 8px;
}
.agency-skeleton-desc {
  width: 65%;
  height: 12px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 45%, transparent);
  margin-bottom: 12px;
}
.agency-skeleton-meta {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}
.agency-skeleton-meta-pill {
  width: 78px;
  height: 20px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 50%, transparent);
}
.agency-skeleton-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.agency-skeleton-btn {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--line, #cbd5e1) 70%, transparent);
}

@keyframes agora-skeleton-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.995);
  }
  50% {
    opacity: 0.92;
    transform: scale(1);
  }
}

[data-theme="dark"] .agency-card-skeleton {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .agency-skeleton-avatar,
[data-theme="dark"] .agency-skeleton-badge,
[data-theme="dark"] .agency-skeleton-title,
[data-theme="dark"] .agency-skeleton-subtitle,
[data-theme="dark"] .agency-skeleton-desc,
[data-theme="dark"] .agency-skeleton-meta-pill,
[data-theme="dark"] .agency-skeleton-btn {
  background: #334155;
}

@media(max-width:650px){.agency-kpis{grid-template-columns:1fr}.agency-hero{align-items:stretch}.agency-hero>.btn{width:100%}}
[data-theme="dark"] .agency-hero{background:linear-gradient(115deg,#30222b,#242630);border-color:#4a414b}[data-theme="dark"] .agency-hero h1{color:#f9f7f9}[data-theme="dark"] .agency-card,[data-theme="dark"] .agency-kpis>div{background:#26262d;border-color:#44444d}

/* 1.3.7: identidad corporativa por subcuenta */
.agency-initial{overflow:hidden;flex:none}.agency-logo-img{display:block;width:100%;height:100%;object-fit:contain;background:#fff;border-radius:12px;padding:3px}
.agency-logo-preview{height:90px;width:120px;display:flex;align-items:center;justify-content:center;border:1px dashed #b9b9c0;border-radius:14px;background:#fff;overflow:hidden}
.agency-logo-preview>.agency-logo-img{height:100%;width:100%}.agency-industry{font-size:12px;color:#777;margin-top:5px}

.agency-data-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media(max-width:500px){.agency-data-inputs{grid-template-columns:1fr}}

.agency-data-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media(max-width:500px){.agency-data-inputs{grid-template-columns:1fr}}

/* v1.4.0 — logo de subcuenta en una franja independiente del área de datos */
.chart-brand-strip { display:flex; justify-content:center; align-items:center; height:48px; margin:0 auto 8px; padding:6px 14px; box-sizing:border-box; pointer-events:none; }
.chart-brand-strip img { display:block; width:auto; height:auto; max-height:34px; max-width:min(34%, 155px); object-fit:contain; opacity:.80; filter:none; }
.chart-brand-wrap > svg.chart { display:block; width:100%; }
.chart-big > .chart-brand-strip { margin-bottom:12px; }
.settings-branding .hx-ident { margin-top:0; }
@media(max-width:620px) { .chart-brand-strip { height:42px; } .chart-brand-strip img { max-height:28px; max-width:120px; } }

/* 1.4.1 · Firma corporativa no invasiva en gráficas */
.chart-brand-strip {justify-content:flex-end; height:44px; padding:4px 8px; margin:0 0 6px auto;}
.chart-brand-strip img {width:auto; height:auto; max-width:min(34%, 142px); max-height:32px; object-fit:contain; object-position:right center; opacity:1; filter:none;}
.chart-big > .chart-brand-strip { margin-bottom:10px; }
@media(max-width:620px){.chart-brand-strip{height:36px;padding-right:4px}.chart-brand-strip img{max-height:26px;max-width:105px}}

/* Menú y centro de operaciones · noviembre 2026 */
.grouped-menu {width:min(1180px,calc(100vw - 32px));padding:0;display:flex;flex-direction:column;overflow:hidden;border-radius:22px}
.grouped-menu .module-sections {overflow:auto;padding:8px 18px;overscroll-behavior:contain}
.module-section {padding:18px 0;border-bottom:1px solid var(--line)}
.module-section:last-child {border-bottom:0}
.grouped-menu .mdm-gt {font-size:14px;margin:0 0 10px;font-weight:700}
.module-row {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.grouped-menu .mdm-i {min-height:70px;padding:12px;gap:14px;border-radius:14px}
.grouped-menu .mdm-ic {width:38px;height:38px;border-radius:11px}
.grouped-menu .mdm-ic .ic {width:21px;height:21px}
.grouped-menu .mdm-ft {flex-shrink:0;margin:0;padding:14px 24px;background:var(--surface)}
.operations-home {max-width:1280px;margin:24px auto 80px}
.operations-heading {padding:20px 0 30px}
.operations-eyebrow {display:flex;align-items:center;gap:16px;text-transform:uppercase;letter-spacing:.28em;color:var(--brand);font-size:11px;font-weight:750}
.operations-eyebrow span {height:3px;width:46px;background:var(--brand);border-radius:9px}
.operations-account {margin-top:26px;color:var(--muted);font-size:14px;font-weight:650}
.operations-heading h1 {font-size:clamp(36px,5vw,60px);letter-spacing:-.055em;line-height:1.15;margin:10px 0 14px}
.operations-heading h1 em {color:var(--brand);font-style:normal}
.operations-lede {color:var(--muted);font-size:18px;line-height:1.5}
.operations-lede strong {color:var(--ink)}
.operations-group {margin:20px 0 34px}
.operations-group>h2 {font-size:16px;display:flex;align-items:center;gap:10px;margin:0 0 16px}
.operations-group>h2>span {font-size:11px;color:var(--muted);background:var(--surface-2);padding:4px 8px;border-radius:8px}
.operations-grid {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:20px}
.operation-card {position:relative;display:flex;flex-direction:column;align-items:flex-start;min-height:218px;padding:24px;border-radius:30px;background:var(--surface);color:var(--ink);text-decoration:none;border:1px solid var(--line);box-shadow:0 10px 28px -20px rgba(20,30,55,.22);transition:transform .2s,box-shadow .2s,border-color .2s}
.operation-icon {display:grid;place-items:center;width:56px;height:56px;border-radius:19px;background:linear-gradient(135deg,color-mix(in srgb,var(--module-color) 75%,white),var(--module-color));color:white;box-shadow:0 10px 16px -8px color-mix(in srgb,var(--module-color) 65%,transparent);margin-bottom:24px}
.operation-icon .ic {width:28px;height:28px}
.operation-card h3 {font-size:15px;text-transform:uppercase;line-height:1.35;margin:0 0 8px;letter-spacing:-.025em}
.operation-card p {font-size:12px;line-height:1.5;color:var(--muted);margin:0 0 18px}
.operation-open {display:flex;align-items:center;gap:6px;margin-top:auto;font-size:11px;font-weight:650;color:var(--module-color)}
.operation-open .ic {width:14px;height:14px}
.operation-badge {position:absolute;right:20px;top:22px;background:var(--brand);color:white;padding:3px 8px;border-radius:20px;font-size:11px;font-weight:700}
.operation-card:hover {transform:translateY(-5px);border-color:var(--module-color);box-shadow:0 18px 32px -22px var(--module-color)}
.operation-card:focus-visible,.grouped-menu a:focus-visible {outline:3px solid var(--brand);outline-offset:2px}
@media(max-width:1100px){.operations-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.module-row{grid-template-columns:repeat(2,minmax(0,1fr))}.operations-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.operation-card{padding:20px;border-radius:24px}.operations-home{margin-top:0}.operations-heading{padding-top:12px}}
@media(max-width:480px){.module-row{grid-template-columns:minmax(0,1fr)}.operations-lede{font-size:15px}.operation-card{padding:17px;min-height:210px}.operation-card h3{font-size:13px}.grouped-menu .mdm-ft{font-size:10px;padding:12px}}
@media(prefers-reduced-motion:reduce){.operation-card{transition:none}.operation-card:hover{transform:none}}

/* Navegación visible y contexto inequívoco de subcuenta. */
#navigation-context {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:12px max(24px,calc((100vw - 1440px)/2));border-bottom:1px solid var(--line);background:var(--surface);color:var(--ink);font-size:13px}
.nav-location,.nav-actions {display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.nav-location strong {overflow-wrap:anywhere}
#navigation-context button {display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--ink);padding:9px 12px;cursor:pointer;font:inherit;min-height:40px}
#navigation-context .ic {width:16px;height:16px}
#navigation-context label {display:flex;align-items:center;gap:8px;font-weight:600}
#navigation-context select {max-width:240px;min-height:40px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:8px;font:inherit}
.module-access {font-size:10px;color:var(--muted);display:block;margin-top:4px}
.grouped-menu .mdm-i small {white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tabbar button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:44px;border:0;border-radius:10px;color:var(--muted);background:transparent;font:600 11px var(--font-text);cursor:pointer}
.tabbar button .ic {width:22px;height:22px}
.tabbar button:focus-visible,#navigation-context :focus-visible {outline:3px solid var(--brand);outline-offset:2px}
.is-auth #navigation-context {display:none}
@media(max-width:760px){#navigation-context{padding:12px 16px}.nav-actions{width:100%}#navigation-context label{flex:1}#navigation-context select{width:100%;max-width:none}.nav-location{font-size:12px}.operations-lede{max-width:620px}}
@media print{#navigation-context{display:none}}

/* Perfil personal y navegación agrupada dentro de la cuenta. */
.personal-profile {max-width:1000px;margin:28px auto 80px}
.personal-avatar {width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.avatar:has(.personal-avatar) {padding:0;overflow:hidden}
.profile-identity {display:flex;align-items:flex-start;gap:28px;padding:30px}
.profile-identity h2 {margin:0 0 8px;font-size:25px}
.profile-identity p {overflow-wrap:anywhere}
.profile-photo-large {flex:0 0 112px;width:112px;height:112px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand);border-radius:50%;box-shadow:0 10px 25px -15px var(--brand)}
.profile-photo-large>.ic {width:48px;height:48px}
.profile-photo-actions {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:20px}
.profile-file {max-width:240px;font:inherit;font-size:12px}
.profile-navigation {padding:28px}
.profile-navigation h2 {margin-top:0}
#profile-navigation {display:grid;gap:20px;padding:18px 0}
#profile-navigation button {display:inline-flex;align-items:center;gap:8px;padding:10px 14px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--ink);font:inherit;cursor:pointer}
#profile-navigation label {display:flex;align-items:center;gap:10px;font-weight:600}
#profile-navigation select {background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:10px;max-width:280px;font:inherit}
#profile-navigation .ic {width:18px;height:18px}
#profile-photo-status {font-size:13px;color:var(--brand)}
@media(max-width:600px){.profile-identity{flex-direction:column;padding:22px;gap:20px}.profile-navigation{padding:22px}.profile-photo-large{flex-basis:96px;width:96px;height:96px}#profile-navigation .nav-actions{align-items:stretch}#profile-navigation label{width:100%;flex-wrap:wrap}#profile-navigation select{max-width:100%;flex:1}.profile-file{max-width:100%}}

/* Ágora · estructura compartida de selección, inspirada en la propuesta clara. */
.launch-layout {display:grid;grid-template-columns:240px minmax(0,1fr);gap:0;align-items:start;min-height:calc(100vh - 130px);border:1px solid var(--line);border-radius:24px;overflow:clip;background:var(--surface-2);margin:12px 0 32px}
.launch-rail {position:sticky;top:80px;background:#111c30;color:#c3ccda;min-height:calc(100vh - 160px);display:flex;flex-direction:column;padding:20px 14px;border-radius:22px 0 0 22px;box-shadow:8px 0 25px -20px #000}
.launch-brand {display:flex;align-items:center;gap:12px;padding:0 6px 18px;color:white;border-bottom:1px solid #ffffff18;font-size:20px;font-weight:750}
.launch-brand>.ic {background:var(--brand);padding:8px;width:36px;height:36px;border-radius:10px;box-shadow:0 6px 20px -10px var(--brand)}
.launch-brand small {font-size:11px;font-weight:500;color:#b6c1d2;display:block;margin-top:2px}
.launch-rail-label {font-size:10px;line-height:1.4;text-transform:uppercase;letter-spacing:.12em;color:#9caac0;padding:0 10px;margin:16px 0 6px;overflow-wrap:anywhere}
.launch-primary,.launch-system {display:flex;flex-direction:column;gap:3px}
.launch-primary a,.launch-primary button,.launch-system>a {display:flex;align-items:center;gap:9px;text-align:left;font:500 12px/1.35 var(--font-text);padding:9px 11px;border-radius:9px;color:#c3ccda;background:transparent;border:0;text-decoration:none;cursor:pointer;transition:background .2s,color .2s}
.launch-rail .ic {flex-shrink:0}
.launch-primary .ic,.launch-system .ic {width:17px;height:17px}
.launch-primary .is-current {background:#ffffff13;color:#fff;box-shadow:inset 3px 0 var(--brand)}
.launch-primary a:hover,.launch-primary button:hover,.launch-system>a:hover {background:#ffffff0e;color:#fff}
.launch-person {display:flex;align-items:center;gap:10px;color:#fff;padding:12px 10px;margin-top:auto;border-top:1px solid #ffffff18;text-decoration:none;border-radius:10px;transition:background .2s}
.launch-person:hover {background:#ffffff0e}
.launch-person>span:nth-child(2){min-width:0;flex:1}.launch-person b{display:block;font-size:12px;overflow-wrap:anywhere}.launch-person small{font-size:10px;color:#acb9ce;display:block;margin-top:2px}.launch-person>.ic{width:14px;height:14px}
.launch-avatar {width:34px;height:34px;display:grid;place-items:center;flex-shrink:0;border-radius:50%;background:#ffffff15;overflow:hidden}
.launch-avatar>.ic {width:19px;height:19px}
.launch-content {min-width:0;padding:24px clamp(18px,2.5vw,36px) 36px}
.launch-content .operations-home,.launch-content .agency-shell {max-width:none;margin:0;padding:0}
.launch-content .operations-heading {padding:0 0 16px}
.launch-content .operations-heading h1 {font-size:clamp(24px,2.6vw,34px);letter-spacing:-.03em;margin:10px 0 6px}
.launch-content .operations-heading h1 em {color:var(--ink);font-style:normal}
.launch-content .operations-lede {font-size:14px;margin:0 0 8px;color:var(--ink-2)}
.launch-summary {font-size:12px;line-height:1.5;color:var(--muted);margin:0}
.launch-recent {margin:0 0 22px}.launch-recent h2,.launch-content .operations-group>h2,.launch-section-heading h2 {text-transform:uppercase;letter-spacing:.1em;font-size:11px;font-weight:700;color:var(--muted);scroll-margin-top:95px}
.launch-chips {display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.launch-chip {display:inline-flex;align-items:center;gap:8px;font:600 12px/1.3 var(--font-text);text-decoration:none;cursor:pointer;background:var(--surface);color:var(--ink);padding:8px 14px;border:1px solid var(--line);border-radius:24px;box-shadow:0 2px 4px #00000004;transition:background .2s,border-color .2s,transform .2s}
.launch-chip>.ic {width:15px;height:15px;color:var(--module-color,var(--brand))}.launch-chip>.ic:last-child{width:13px;height:13px}.launch-chip:hover{background:var(--brand-soft);border-color:var(--brand);transform:translateY(-2px)}
.launch-empty {font-size:12px;color:var(--muted);margin:0;border:1px dashed var(--line);padding:10px 14px;border-radius:12px;line-height:1.45}
.launch-content .operations-grid,.launch-content .agency-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.launch-content .operation-card,.launch-content .agency-card {position:relative;display:flex;flex-direction:column;min-width:0;min-height:205px;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:0 3px 10px -7px #10182830;transition:transform .3s cubic-bezier(.4,0,.2,1),box-shadow .3s,border-color .3s;animation:launch-in .45s ease-out both;animation-delay:calc(min(var(--card-order,0),6)*45ms)}
.launch-content .operation-card:hover,.launch-content .agency-card:hover {transform:translateY(-3px);box-shadow:0 14px 24px -10px #10182828;border-color:color-mix(in srgb,var(--module-color,var(--brand)) 35%,var(--line))}
.launch-content .operation-icon {width:44px;height:44px;min-height:44px;margin-bottom:14px;border-radius:11px;box-shadow:none;background:color-mix(in srgb,var(--module-color) 10%,var(--surface));color:var(--module-color);transition:background .3s,color .3s,transform .3s}
.launch-content .operation-icon .ic {width:22px;height:22px}
.launch-content .operation-card:hover .operation-icon {background:var(--module-color);color:white;transform:scale(1.08)}
.launch-content .operation-card h3 {font-size:16px;font-weight:700;text-transform:none;letter-spacing:-.02em;margin-bottom:8px}
.launch-content .operation-card p {font-size:12px;line-height:1.55;margin-bottom:16px}
.launch-content .operation-open {font-size:12px}.operation-open .ic {transition:transform .3s}.operation-card:hover .operation-open .ic{transform:translateX(4px)}
.launch-section-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 14px}
.launch-content .agency-card h2 {font-size:18px;margin:12px 0 4px}.launch-content .agency-card>p{font-size:12px;line-height:1.5}.launch-content .agency-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.launch-content .agency-initial{display:grid;place-items:center;width:44px;height:44px;background:var(--brand-soft);color:var(--brand);border-radius:12px;font-weight:750;overflow:hidden;transition:transform .3s}.launch-content .agency-initial img{width:100%;height:100%;object-fit:contain}.launch-content .agency-card:hover .agency-initial{transform:scale(1.06)}
.launch-content .agency-meta {display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 16px}.launch-content .agency-meta span{font-size:10px;background:var(--surface-2);padding:4px 7px;border-radius:6px;color:var(--muted)}
.launch-content .agency-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto}.launch-content .agency-actions .btn{font-size:11px;min-height:36px;padding:8px 12px}
.launch-rail :focus-visible,.launch-chip:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
@keyframes launch-in {from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
@media(min-width:1500px){.launch-layout{grid-template-columns:250px minmax(0,1fr)}}
@media(max-width:1150px){.launch-layout{grid-template-columns:205px minmax(0,1fr)}.launch-content{padding:28px 22px}.launch-content .operations-grid,.launch-content .agency-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.launch-rail{padding:22px 12px}}
@media(max-width:760px){.launch-layout{grid-template-columns:minmax(0,1fr);border-radius:18px}.launch-rail{position:static;min-height:0;border-radius:17px 17px 0 0;padding:18px}.launch-brand{padding-bottom:14px}.launch-primary,.launch-system{flex-direction:row;flex-wrap:wrap}.launch-system .launch-rail-label{width:100%;margin:12px 0 4px}.launch-primary a,.launch-primary button,.launch-system>a{font-size:11px;padding:9px}.launch-rail-label{margin:14px 0 6px}.launch-person{margin-top:16px;padding-top:14px}.launch-content{padding:26px 18px}.launch-content .operation-card,.launch-content .agency-card{padding:20px}.launch-content .operation-card h3{font-size:16px}}
@media(max-width:480px){.launch-content .operations-grid,.launch-content .agency-grid{grid-template-columns:minmax(0,1fr)}.launch-content .operation-card{min-height:215px}.launch-content .operations-heading h1{font-size:30px}}
@media(prefers-reduced-motion:reduce){.launch-content .operation-card,.launch-content .agency-card{animation:none}.launch-layout *, .launch-layout *::before{transition:none!important}.launch-content .operation-card:hover,.launch-content .agency-card:hover,.launch-chip:hover,.launch-content .operation-card:hover .operation-icon,.launch-content .agency-card:hover .agency-initial,.operation-card:hover .operation-open .ic{transform:none}}
@media print{.launch-layout{display:block}.launch-rail{display:none}.launch-content{padding:0}}

/* Lateral exclusivo de Agencia; inicio de subcuenta con menú superior. */
.launch-layout.launch-no-rail {display:block}
.launch-brand-logo {justify-content:center;color:#fff;--iso:#fff;padding:0 8px 24px}
.launch-brand-logo>svg {display:block;width:180px;max-width:100%;height:auto;flex-shrink:0}

/* Agencia fija al viewport; el contenido se desplaza de forma independiente. */
@media(min-width:761px){
 .launch-layout:has(.launch-rail){overflow:visible;min-height:calc(100vh - 140px)}
 .launch-layout:has(.launch-rail)>.launch-content{grid-column:2}
 .launch-rail{position:fixed;left:var(--agency-rail-left,40px);top:var(--agency-rail-top,88px);width:var(--agency-rail-width,240px);bottom:16px;min-height:0;height:auto;overflow-y:auto;overscroll-behavior:contain;border-radius:22px;z-index:15;scrollbar-width:thin}
 .view-enter:has(.launch-rail){animation:none;transform:none}
 .launch-person{margin-top:auto;padding-top:18px}
}
.launch-system>a[aria-current="page"]{background:#ffffff15;color:white;box-shadow:inset 3px 0 var(--brand)}
.tenant-choices{display:grid;gap:10px;padding:16px;border:1px solid var(--line);border-radius:12px;margin:16px 0}
.tenant-choices label{display:flex;align-items:center;gap:10px;font-size:13px}
.tenant-choices input{width:18px;height:18px}
.profile-details{padding:24px}.studio-job{padding:18px 0;border-bottom:1px solid var(--line)}.studio-job>span{margin-left:12px}.studio-job p{white-space:pre-wrap;overflow-wrap:anywhere}.integration-notice{padding:14px;border-radius:12px;background:var(--brand-soft);color:var(--ink);line-height:1.5}
@media(max-width:760px){.launch-rail{position:static;width:auto;max-height:none}.launch-layout:has(.launch-rail)>.launch-content{grid-column:1}}
@media print{.launch-rail{display:none!important}.launch-layout:has(.launch-rail)>.launch-content{grid-column:auto}}
/* Estudio unificado */
.studio-toolbar,.studio-tabs{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:22px}.studio-toolbar .fld{min-width:240px;flex:1}.studio-files{display:grid;grid-template-columns:minmax(180px,240px) minmax(0,1fr);gap:28px}.studio-file-list{display:grid;gap:8px;margin-top:20px}.studio-file-list .btn{justify-content:flex-start;overflow-wrap:anywhere;white-space:normal;text-align:left}.studio-code,#studio-data-editor{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;line-height:1.6;tab-size:2}.studio-tabs .btn{flex:1}.studio-files form{min-width:0}#studio-message:not(:empty){padding:12px;border:1px solid var(--line);border-radius:12px}@media(max-width:900px){.studio-files{grid-template-columns:1fr}.studio-file-list{max-height:200px;overflow:auto}}
