/* ============================================
   Teamlogix RH — Design System
   ============================================ */
:root {
  /* Palette - light (default) */
  --bg: #FBFAF7;
  --bg-alt: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #FAF9F5;
  --ink: #0F1419;
  --ink-2: #1F2630;
  --ink-3: #5C6370;
  --ink-4: #8A93A0;
  --line: rgba(15, 20, 25, 0.08);
  --line-strong: rgba(15, 20, 25, 0.14);

  /* Accent — emerald (default) */
  --accent: oklch(48% 0.12 162);
  --accent-ink: oklch(34% 0.10 162);
  --accent-soft: oklch(95% 0.04 162);
  --accent-line: oklch(82% 0.06 162);

  /* Status */
  --warn: oklch(72% 0.16 70);
  --warn-soft: oklch(95% 0.05 70);
  --warn-ink: oklch(45% 0.13 70);
  --danger: oklch(58% 0.18 25);
  --danger-soft: oklch(95% 0.04 25);
  --danger-ink: oklch(45% 0.16 25);
  --info: oklch(56% 0.13 245);
  --info-soft: oklch(95% 0.03 245);
  --info-ink: oklch(42% 0.12 245);
  --success: oklch(60% 0.14 152);
  --success-soft: oklch(95% 0.04 152);
  --success-ink: oklch(45% 0.13 152);

  /* Type */
  --font-sans: "Geist", "Söhne", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Spacing — radios redondeados estilo líderes HR SaaS (Gusto/BambooHR/HiBob) */
  --r-xs: 6px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* Escala de espaciado (múltiplos de 4) — usar en gap/padding/margin */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* Escala tipográfica — mínimo legible 11px, sin tamaños sueltos */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 17px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 28px;

  /* Profundidad — sombras en capas (soft + ambient) para dar relieve de SaaS premium */
  --shadow-sm: 0 1px 2px rgba(15,20,25,.045), 0 2px 8px -3px rgba(15,20,25,.06);
  --shadow: 0 2px 4px rgba(15,20,25,.05), 0 12px 30px -12px rgba(15,20,25,.16);
  --shadow-lg: 0 8px 16px rgba(15,20,25,.08), 0 32px 60px -20px rgba(15,20,25,.22);

  /* Motion */
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease: ease;

  /* Chips pastel (fondos de iconos en KPIs, módulos, celebraciones) — par bg/ink */
  --chip-navy-bg: #E9EAF7;  --chip-navy-ink: #1A1F6F;
  --chip-gold-bg: #FFF3CC;  --chip-gold-ink: #B8860B;
  --chip-teal-bg: #D6F5EF;  --chip-teal-ink: #0E9384;
  --chip-green-bg: #E3F6E9; --chip-green-ink: #16A34A;
  --chip-coral-bg: #FFE9E1; --chip-coral-ink: #EA6B43;
  --chip-violet-bg: #EFE9FF; --chip-violet-ink: #7C3AED;
}

[data-theme="dark"] {
  --bg: #0B0C0E;
  --bg-alt: #131418;
  --surface: #16181C;
  --surface-2: #1B1E23;
  --ink: #F4F4F2;
  --ink-2: #E1E2DE;
  --ink-3: #9AA0AB;
  --ink-4: #6C737F;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --accent: oklch(72% 0.14 162);
  --accent-ink: oklch(82% 0.10 162);
  --accent-soft: oklch(28% 0.06 162);
  --accent-line: oklch(38% 0.10 162);

  --warn-soft: oklch(28% 0.06 70);
  --warn-ink: oklch(80% 0.13 70);
  --danger-soft: oklch(28% 0.07 25);
  --danger-ink: oklch(78% 0.15 25);
  --info-soft: oklch(28% 0.06 245);
  --info-ink: oklch(80% 0.12 245);
  --success-soft: oklch(28% 0.06 152);
  --success-ink: oklch(80% 0.13 152);

  /* Chips pastel en dark: fondo profundo del mismo matiz + tinta clara */
  --chip-navy-bg: #262a52;  --chip-navy-ink: #b3b9f8;
  --chip-gold-bg: #3a2f14;  --chip-gold-ink: #e3b341;
  --chip-teal-bg: #11332e;  --chip-teal-ink: #4fd1bb;
  --chip-green-bg: #15301f; --chip-green-ink: #57cf82;
  --chip-coral-bg: #3a221a; --chip-coral-ink: #ff9b76;
  --chip-violet-bg: #2b2347; --chip-violet-ink: #c3aaf7;
}

/* ============================================
   Utilidades — skeleton shimmer y motion
   ============================================ */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: var(--r-sm);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: skel-shimmer 1.4s infinite;
}
[data-theme="dark"] .skel::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}
@keyframes skel-shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

/* Entrada escalonada de secciones (usar animation-delay inline para el stagger) */
.rise-in { animation: rise-in .45s var(--ease-out) both; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Transición de entrada al cambiar de pantalla (fade + slide sutil) */
.screen-fade {
  animation: screen-fade var(--dur) var(--ease-out) both;
  min-width: 0;
  max-width: 100%;
}
@keyframes screen-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Contenedor que escalona la entrada de sus hijos directos (dashboards) */
.stagger > * { animation: rise-in .45s var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }
.stagger > *:nth-child(n+9) { animation-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
  .rise-in { animation: none; }
  .stagger > * { animation: none; }
  .skel::after { animation: none; }
  .skeleton { animation: none; }
  .login-blob { animation: none; }
  .screen-fade { animation: none; }
}

[data-accent="indigo"] {
  --accent: oklch(52% 0.16 268);
  --accent-ink: oklch(38% 0.14 268);
  --accent-soft: oklch(95% 0.04 268);
  --accent-line: oklch(82% 0.07 268);
}
[data-accent="indigo"][data-theme="dark"] {
  --accent: oklch(74% 0.13 268);
  --accent-soft: oklch(28% 0.07 268);
  --accent-line: oklch(38% 0.10 268);
}

[data-accent="amber"] {
  --accent: oklch(56% 0.14 55);
  --accent-ink: oklch(40% 0.13 55);
  --accent-soft: oklch(95% 0.04 55);
  --accent-line: oklch(82% 0.07 55);
}
[data-accent="amber"][data-theme="dark"] {
  --accent: oklch(76% 0.14 70);
  --accent-soft: oklch(28% 0.07 55);
  --accent-line: oklch(38% 0.10 55);
}

[data-accent="rose"] {
  --accent: oklch(54% 0.16 12);
  --accent-ink: oklch(40% 0.14 12);
  --accent-soft: oklch(95% 0.04 12);
  --accent-line: oklch(82% 0.07 12);
}
[data-accent="rose"][data-theme="dark"] {
  --accent: oklch(72% 0.14 12);
  --accent-soft: oklch(28% 0.07 12);
  --accent-line: oklch(38% 0.10 12);
}

/* Comunicaciones del Caribe — premium: tinta neutra, navy de acción, oro de detalle.
   El texto vuelve a carbón neutro (no navy) para que la UI respire; el navy de
   marca pasa a ser el color de ACCIÓN (botones, focus, activo) y el dorado queda
   como firma puntual (indicadores, hero, avatar) — joyería, no pintura. */
[data-accent="caribe"] {
  --ink: #181C26;
  --ink-2: #2A2F3D;
  --ink-3: #5D6477;
  --ink-4: #8B91A3;
  --bg: #FAF9F5;
  --bg-alt: #F3F2EC;
  --surface: #FFFFFF;
  --surface-2: #F7F6F1;
  --line: rgba(24, 28, 38, 0.08);
  --line-strong: rgba(24, 28, 38, 0.16);

  --accent: #232A7C;
  --accent-ink: #161B59;
  --accent-soft: #EEF0FB;
  --accent-line: #C7CCEE;

  --gold: #F4C430;
  --gold-ink: #8A6D00;
  --gold-soft: #FFF4CC;

  /* Sombras tintadas con el navy de marca — profundidad cálida, no gris */
  --shadow-sm: 0 1px 2px rgba(22,27,89,.05), 0 2px 8px -3px rgba(22,27,89,.07);
  --shadow: 0 2px 4px rgba(22,27,89,.05), 0 12px 30px -12px rgba(22,27,89,.18);
  --shadow-lg: 0 8px 16px rgba(22,27,89,.08), 0 32px 60px -20px rgba(22,27,89,.25);
}
/* Caribe oscuro — near-black con tinte navy, oro como acción (firma invertida) */
[data-accent="caribe"][data-theme="dark"] {
  --ink: #F2F3FA;
  --ink-2: #DCDFF0;
  --ink-3: #9CA2C4;
  --ink-4: #6E7499;
  --bg: #0A0C22;
  --bg-alt: #0F1230;
  --surface: #12153A;
  --surface-2: #181C49;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);

  --accent: #F4C430;
  --accent-ink: #FFE89A;
  --accent-soft: rgba(244, 196, 48, 0.13);
  --accent-line: rgba(244, 196, 48, 0.36);

  --gold: #F4C430;
  --gold-ink: #FFE89A;
  --gold-soft: rgba(244, 196, 48, 0.13);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px -3px rgba(0,0,0,.45);
  --shadow: 0 2px 4px rgba(0,0,0,.35), 0 12px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 16px rgba(0,0,0,.4), 0 32px 60px -20px rgba(0,0,0,.7);
}
/* En oscuro el botón primario invierte la firma: oro con tinta navy */
[data-accent="caribe"][data-theme="dark"] .btn.primary {
  background: linear-gradient(180deg, #F8CD3F, #EDB91F);
  color: #1A1F6F;
  border-color: #C99F12;
  box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.35);
}
[data-accent="caribe"][data-theme="dark"] .btn.primary:hover {
  background: linear-gradient(180deg, #FFD957, #F4C430);
  border-color: #D9AC15;
}
/* Hero & login-right: navy de marca con un velo dorado sutil arriba */
[data-accent="caribe"] .hero,
[data-accent="caribe"] .login-right {
  background:
    radial-gradient(900px 360px at 80% -10%, rgba(244,196,48,.14), transparent 60%),
    linear-gradient(165deg, #1E2470 0%, #141852 100%);
  color: #FBFAF7;
  border-color: #161B59;
}
[data-accent="caribe"] .btn.primary {
  background: linear-gradient(180deg, #2A317F, #1E2470);
  color: #FBFAF7;
  border-color: #1A1F6F;
  box-shadow: 0 1px 2px rgba(22,27,89,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
[data-accent="caribe"][data-theme="dark"] .hero,
[data-accent="caribe"][data-theme="dark"] .login-right {
  background:
    radial-gradient(900px 360px at 80% -10%, rgba(244,196,48,.10), transparent 60%),
    #0E1147;
}
[data-accent="caribe"] .btn.primary:hover {
  background: linear-gradient(180deg, #333B96, #252C82);
  border-color: #252C82;
}
[data-accent="caribe"] .hero h2 .accent-word {
  color: var(--gold);
}
[data-accent="caribe"] .nav-item.active::before {
  background: var(--gold);
}
[data-accent="caribe"] .avatar { color: #1A1F6F; background: var(--gold); }

/* ── Caribe: sidebar rail carbon premium (solo modo claro) ──────
   El sidebar redefine sus tokens locales: los componentes internos
   (nav-items, brand, user-card, scrollbar) se adaptan solos.
   Nota: --saas-surface-hover/--saas-active-bg se resuelven en :root,
   por eso se redeclaran aquí con el oro local. */
[data-accent="caribe"]:not([data-theme="dark"]) .sidebar {
  --surface: #1E1E2E;
  --surface-2: rgba(255, 255, 255, 0.06);
  --ink: #F5F5F5;
  --ink-2: #E2E2E8;
  --ink-3: #A0A0B0;
  --ink-4: #7A7A8A;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: var(--gold);
  --accent-ink: #FFE89A;
  --accent-soft: rgba(244, 196, 48, 0.14);
  --accent-line: rgba(244, 196, 48, 0.38);
  --saas-surface-hover: rgba(255, 255, 255, 0.05);
  --saas-active-bg: rgba(244, 196, 48, 0.13);
  /* Fijar color aquí: los hijos sin color explícito heredan el computado del
     body (carbón) y no re-resuelven las variables locales del sidebar. */
  color: var(--ink);
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(244,196,48,.07), transparent 65%),
    linear-gradient(180deg, #1E1E2E 0%, #16161f 100%);
  border-right: 0;
  box-shadow: 1px 0 0 rgba(30, 30, 46, 0.65), inset -1px 0 0 rgba(255,255,255,.05);
}
[data-accent="caribe"]:not([data-theme="dark"]) .sidebar::before {
  opacity: 0.72;
}
[data-accent="caribe"]:not([data-theme="dark"]) .sidebar .brand {
  background: color-mix(in oklch, #1E1E2E 74%, var(--accent-soft));
  border-color: rgba(255, 255, 255, 0.18);
}
[data-accent="caribe"]:not([data-theme="dark"]) .sidebar .nav-item.active {
  color: #FFFFFF;
}
[data-accent="caribe"]:not([data-theme="dark"]) .sidebar .user-card {
  border-color: rgba(255, 255, 255, 0.10);
  background:
    linear-gradient(180deg, rgba(30, 30, 46, 0.88), rgba(22, 22, 31, 0.95)),
    radial-gradient(140px 74px at 18% 0%, rgba(244, 196, 48, 0.20), transparent 62%);
}

/* Atmósfera del lienzo principal: un respiro dorado casi imperceptible arriba */
[data-accent="caribe"]:not([data-theme="dark"]) .main {
  background:
    radial-gradient(1100px 380px at 88% -12%, rgba(244, 196, 48, 0.05), transparent 60%),
    var(--bg);
}

[data-density="compact"] {
  --row-h: 36px;
  --pad-card: 16px;
}
[data-density="comfortable"] {
  --row-h: 48px;
  --pad-card: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* Utility */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }

/* ============================================
   Shell — #88 SaaS redesign
   ============================================ */

/* Additional SaaS tokens */
:root {
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --saas-surface-hover: color-mix(in oklch, var(--accent) 6%, var(--surface));
  --saas-active-bg: color-mix(in oklch, var(--accent) 10%, var(--surface));
  --saas-nav-gap: 3px;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar — clean minimal SaaS left panel ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  --sidebar-edge: color-mix(in oklch, var(--line-strong) 52%, transparent);
  box-shadow: 1px 0 0 var(--sidebar-edge), var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--accent) 38%, transparent), transparent);
  pointer-events: none;
  opacity: 0.55;
}
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
.sidebar-nav > .nav-accordion { gap: 4px; }
.sidebar > .user-card { flex: 0 0 auto; }

/* Zone labels — sidebar 5 zonas */
.sidebar-zone-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
  padding: 12px 12px 3px;
  margin-top: 2px;
  pointer-events: none;
  user-select: none;
}
.sidebar-zone-label:first-child { padding-top: 4px; }

/* Nav primary — 2-column module tiles */
.nav-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px 0 8px;
}

.nav-search-wrap {
  grid-column: 1 / -1;
  padding: 2px 2px 4px;
}

.nav-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: calc(var(--r) - 2px);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11px;
  outline: none;
  transition: border-color 120ms;
}

.nav-search-input:focus { border-color: var(--accent); }
.nav-search-input::placeholder { color: var(--ink-4); }

.nav-primary-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
  opacity: 0.6;
}

.nav-primary-item {
  min-height: 60px;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--ink-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  background: transparent;
  text-align: center;
  line-height: 1.2;
  padding: 8px 4px;
  transition: background 140ms, color 140ms, border-color 140ms;
}

.nav-primary-item:hover {
  background: var(--saas-surface-hover);
  color: var(--ink-2);
  border-color: var(--line);
}

.nav-primary-item.active {
  background: var(--saas-active-bg);
  border-color: var(--accent-line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.nav-primary-item.active .icon {
  color: var(--accent);
}

.nav-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-accordion {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0 8px;
}

.nav-accordion-group {
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
}

.nav-accordion-group.active {
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 560;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 120ms, color 120ms;
}

.nav-accordion-header:hover {
  background: var(--saas-surface-hover);
  color: var(--ink-2);
}

.nav-accordion-header.active {
  color: var(--ink);
  background: var(--saas-active-bg);
}

.nav-accordion-group.active > .nav-accordion-header {
  border-left-color: var(--accent);
}

.nav-accordion-header .icon {
  flex-shrink: 0;
  color: var(--ink-3);
}

.nav-accordion-header.active .icon {
  color: var(--accent);
}

.nav-accordion-header > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chevron {
  flex-shrink: 0;
  color: var(--ink-4);
  transition: transform 180ms ease;
}

.nav-chevron.open {
  transform: rotate(180deg);
}

.nav-accordion-items {
  display: flex;
  flex-direction: column;
  gap: var(--saas-nav-gap);
  padding: 2px 0 6px 8px;
  margin-bottom: 2px;
}

/* Subgrupos dentro de un grupo del accordion */
.nav-subgroup {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-sm);
  margin: 2px 0;
}
.nav-subgroup.active {
  background: var(--surface-2);
}
.nav-subgroup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 450;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
  min-height: 34px;
  letter-spacing: -0.005em;
}
.nav-subgroup-header:hover {
  background: var(--saas-surface-hover);
  color: var(--ink-2);
}
.nav-subgroup-header.active {
  color: var(--ink);
  background: var(--saas-active-bg);
}
.nav-subgroup-header .icon {
  flex-shrink: 0;
  color: var(--ink-4);
}
.nav-subgroup-header.active .icon {
  color: var(--accent);
}
.nav-subgroup-header > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-subgroup-items {
  display: flex;
  flex-direction: column;
  gap: var(--saas-nav-gap);
  padding: 2px 0 2px 12px;
  border-left: 1px solid var(--line);
  margin-left: 8px;
}
/* 2nd-level items inside expanded subgroup — slightly smaller */
.nav-subgroup-items .nav-item {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 30px;
}

/* Brand / logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid color-mix(in oklch, var(--line) 88%, transparent);
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--surface-2) 72%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  margin-bottom: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1.5px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
}
.brand-mark span {
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.22;
}
.brand-mark span:nth-child(5) { opacity: 1; }
.brand-mark span:nth-child(9) { opacity: 0.82; }
.brand-mark span:nth-child(8) { opacity: 0.50; }
.brand-mark span:nth-child(6) { opacity: 0.38; }

.brand-text {
  display: flex; flex-direction: column;
  line-height: 1.1;
}
.brand-text .b1 { font-weight: 600; font-size: 13.5px; letter-spacing: -0.015em; }
.brand-text .b2 { color: var(--ink-4); font-size: 10px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }
.brand:hover { transform: translateY(-1px); }

.nav-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 10px 10px 4px;
  font-weight: 600;
}

/* Nav items — clean outline style */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 450;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
  min-height: 34px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--saas-surface-hover);
  color: var(--ink-2);
  border-color: var(--line);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--saas-active-bg);
  color: var(--ink);
  font-weight: 500;
  border-color: color-mix(in oklch, var(--accent) 38%, var(--line));
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-4); }
.nav-item:hover .icon { color: var(--ink-2); }
.nav-item.active .icon { color: var(--accent); }
.nav-item .badge {
  margin-left: auto;
  font-size: 9px;
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* User card — bottom of sidebar */
.user-card {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid color-mix(in oklch, var(--line) 88%, transparent);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface) 84%, transparent), var(--surface-2)),
    radial-gradient(160px 80px at 18% 0%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 62%);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 120ms;
}
.user-card:hover {
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface) 80%, transparent), var(--surface-2)),
    radial-gradient(160px 80px at 18% 0%, color-mix(in oklch, var(--accent) 20%, transparent), transparent 62%);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
[data-theme="dark"] .avatar { color: var(--ink); }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }

.user-card a {
  color: var(--ink-3) !important;
  border-radius: 6px;
  transition: color 120ms, background 120ms;
}

.user-card a:hover { color: var(--ink) !important; background: var(--surface-2); }

/* ============================================
   Main — #88 SaaS redesign
   ============================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
}

/* Topbar — clean, compact, sticky */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 90%, transparent);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.topbar h1 {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.08;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: none;
}
.topbar-titleblock {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: center;
  gap: 2px;
}
.topbar .crumbs {
  font-size: 10px;
  line-height: 1.1;
  color: var(--ink-4);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
}
/* Desktop shows full crumb strip; mobile version is hidden at this breakpoint */
.crumbs--mobile { display: none; }
.topbar-spacer { flex: 0 0 auto; min-width: 0; }

/* Topbar search pill */
.topbar-search {
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.topbar-search:hover {
  background: var(--surface-2) !important;
  border-color: var(--ink-3) !important;
}
.topbar-search:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent) !important;
  outline: none;
}

/* Back button in topbar */
.topbar-back-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-improvement {
  display: inline-flex;
  flex-shrink: 0;
}

.content {
  padding: 24px 28px 40px;
  max-width: 1480px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.content > * { min-width: 0; }

.footer {
  margin-top: auto;
  padding: 18px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================
   Components
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-out);
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--ink-2); }
.btn.accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.accent:hover {
  background: color-mix(in oklch, var(--accent) 88%, black);
  border-color: color-mix(in oklch, var(--accent) 88%, black);
}
[data-theme="dark"] .btn.accent { color: #0B0C0E; }
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.nav-item:focus-visible,
.input:focus-visible,
.select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}
.pill:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.pill.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: login-drift 18s var(--ease-out) alternate infinite;
}
.login-blob.b1 {
  right: -160px;
  bottom: -200px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
}
.login-blob.b2 {
  left: -140px;
  top: 10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--chip-gold-bg), transparent 70%);
  animation-delay: -6s;
}
.login-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.login-form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}
@keyframes login-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(24px, -18px, 0) scale(1.08); }
}

/* ── Theme toggle ───────────────────────────────────── */
.theme-toggle-btn {
  padding: 4px 6px !important;
  border-radius: var(--r-sm) !important;
}
.theme-toggle-track {
  display: flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background 200ms, border-color 200ms;
  cursor: pointer;
}
.theme-toggle-thumb {
  position: absolute;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: transform 200ms cubic-bezier(.4,0,.2,1), background 200ms, color 200ms;
}
[data-theme="dark"] .theme-toggle-track {
  background: var(--accent-soft);
  border-color: var(--accent);
}
[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(16px);
  background: var(--accent);
  color: #fff;
}

.input, .select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color 120ms;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  /* Relieve global: toda tarjeta gana profundidad sutil (antes era plana, solo borde). */
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* Utilidad: tarjetas clicables que "levantan" al hover (dashboards, accesos). */
.card.lift { cursor: pointer; }
.card.lift:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.card.flush { padding: 0; }
.card .card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card .card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.card .card-head .sub {
  color: var(--ink-4);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card .card-body { padding: 20px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.kpi .label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
.kpi .value {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 4px 0 2px;
}
.kpi .value .unit {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink-3);
  margin-left: 4px;
  font-weight: 500;
}
.kpi .meta {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi .delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.kpi .delta.up { background: var(--accent-soft); color: var(--accent-ink); }
.kpi .delta.dn { background: var(--danger-soft); color: var(--danger); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.tag.info { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 400ms;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-weight: 500;
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  background: var(--surface-2);
}
.rh-sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.rh-sortable-th:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.rh-sort-indicator {
  color: var(--accent-ink);
  font-weight: 800;
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }

.rh-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vh, 28px);
  background: rgba(15, 23, 42, .46);
  overflow: hidden;
}
.rh-modal-surface {
  width: min(100%, 640px);
  max-height: calc(100dvh - clamp(24px, 6vh, 56px));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-margin: 0;
}
.rh-modal-surface > :first-child {
  scroll-margin-top: 0;
}
@media (max-width: 640px) {
  .rh-modal-overlay {
    align-items: flex-start;
    padding: 10px;
  }
  .rh-modal-surface {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }
}

/* 9-Box grid */
.ninebox {
  display: grid;
  grid-template-columns: 24px repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr) 24px;
  gap: 8px;
  aspect-ratio: 1.15 / 1;
}
.ninebox-cell {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 150ms;
}
.ninebox-cell:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.ninebox-cell.tier-3 {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.ninebox-cell.tier-2 {
  background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface));
}
.ninebox-cell .name {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ninebox-cell .count {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}
.ninebox-cell .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}
.ninebox .axis {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}
.ninebox .y-axis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  grid-row: 1 / 4;
  grid-column: 1;
}
.ninebox .x-axis {
  grid-row: 4;
  grid-column: 2 / 5;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-left {
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.login-right {
  background: var(--ink);
  color: var(--bg);
  padding: 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.login-right .grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.login-form {
  margin: auto 0;
  max-width: 360px;
  width: 100%;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* Big serif heading */
.h-display {
  font-family: var(--font-serif);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0;
}

/* tweaks panel button */
.tweak-btn {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
}

/* Funnel */
.funnel-row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.funnel-row:last-child { border-bottom: 0; }
.funnel-row .step-no {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  min-width: 24px;
}
.funnel-row .step-name {
  font-weight: 500;
  flex: 1;
  min-width: 180px;
}
.funnel-row .step-bar {
  flex: 2;
  height: 28px;
  background: var(--surface-2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
}
.funnel-row .step-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  position: relative;
}
.funnel-row .step-pct {
  font-family: var(--font-serif);
  font-size: 22px;
  min-width: 80px;
  text-align: right;
}
.funnel-row .step-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  min-width: 80px;
  text-align: right;
}

/* Skill bar */
.skill-row {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.skill-row:last-child { border-bottom: 0; }
.skill-row .skill-name { font-size: 13px; }
.skill-row .skill-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.skill-row .skill-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.skill-row .skill-bar.warn > span { background: var(--warn); }
.skill-row .skill-bar.danger > span { background: var(--danger); }
.skill-row .skill-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

/* Meeting list */
.meeting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 120ms;
}
.meeting-row:hover { background: var(--surface-2); }
.meeting-row.active {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
.meeting-row .when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 70px;
}
.meeting-row .who { font-weight: 500; font-size: 13px; }
.meeting-row .preview { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* OKR card */
.okr-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.okr-card .obj-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.okr-card .obj-line .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  margin-top: 4px;
  min-width: 28px;
}
.okr-card .obj-line .obj-text {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.25;
  flex: 1;
}
.okr-card .kr {
  display: grid;
  grid-template-columns: 1fr 100px 60px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.okr-card .kr-text { font-size: 13px; }

/* Toggle for Likert */
.likert {
  display: flex;
  gap: 6px;
}
.likert label {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms;
  background: var(--surface);
}
.likert label:hover { border-color: var(--accent); }
.likert input { display: none; }
.likert input:checked + label {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
[data-theme="dark"] .likert input:checked + label { color: #0B0C0E; }

/* Avatar pill */
.avatar-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  padding: 1px 10px 1px 1px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  gap: 6px;
}

/* Comparison cells (Auto vs Líder) */
.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 96px 96px 60px;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}
.cmp-grid:last-child { border-bottom: 0; }
.cmp-grid .cmp-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.cmp-grid .cmp-cell.yes { background: var(--accent-soft); color: var(--accent-ink); }
.cmp-grid .cmp-cell.no  { background: var(--danger-soft); color: var(--danger); }
.cmp-grid .cmp-cell.gap { background: var(--warn-soft); color: var(--warn); }

/* Section heading */
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 14px;
}
.sec-h h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.015em;
}
.sec-h .sub {
  font-size: 12px;
  color: var(--ink-3);
}

/* Hero band on dashboard */
.hero {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}
.hero h2 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  max-width: 600px;
  line-height: 1.15;
}
.hero .accent-word { color: var(--accent); }
.hero .sub {
  color: var(--ink-3);
  font-size: 13px;
  max-width: 520px;
}
.hero .stamp {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero .stamp .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* helper */
.row { display: flex; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }

@media (min-width: 1800px) {
  .main .content {
    max-width: min(1760px, calc(100vw - var(--sidebar-w) - 56px));
    margin-left: 0;
    margin-right: auto;
  }
  .main .screen-fade {
    max-width: none;
  }
  .content > .grid-3,
  .grid-3 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .content > .grid-4,
  .grid-4 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Login illustration grid */
.login-card-mini {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  border: 1px solid var(--line);
  position: relative;
}

/* PDI item */
.pdi-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  align-items: flex-start;
}
.pdi-bullet {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  flex-shrink: 0;
}
.pdi-bullet.done { background: var(--accent); color: white; }
[data-theme="dark"] .pdi-bullet.done { color: var(--bg); }

/* Methodology dots 70/20/10 */
.method-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.method-bar div { height: 100%; }

/* Toast for tweaks*/
.toast-pill {
  position: fixed; bottom: 90px; right: 18px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  z-index: 60;
  opacity: 0;
  transform: translateY(8px);
  transition: all 200ms;
  pointer-events: none;
}
.toast-pill.show { opacity: 1; transform: translateY(0); }

/* Sparkline */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}
.spark span {
  flex: 1;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.6;
}
.spark span:last-child { opacity: 1; }

/* Avatar dots in 9-Box */
.dot-person {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}
[data-theme="dark"] .dot-person { color: var(--bg); }

/* ===== Loading states ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2, #eee) 25%, var(--surface, #fff) 50%, var(--surface-2, #eee) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
.skeleton-line { height: 12px; width: 100%; margin: 4px 0; }
.skeleton-line.sm { height: 10px; width: 60%; }
.skeleton-line.lg { height: 18px; width: 80%; }
.skeleton-card { padding: 16px; }
.skeleton-card .skeleton-line + .skeleton-line { margin-top: 8px; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: absolute; inset: 0;
  background: color-mix(in oklch, var(--surface, #fff) 70%, transparent);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; border-radius: inherit;
}

/* ===== Hamburguesa — siempre visible en el DOM pero oculta en desktop ===== */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-3);
  flex-shrink: 0;
}
.menu-toggle:hover { background: var(--surface-2); color: var(--ink); }

/* ===== Responsive — tablet 1024px ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .app { grid-template-columns: var(--sidebar-w) 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-3, .grid-3-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 18px; }
  .topbar h1 { font-size: 18px; max-width: none; }
  .topbar-titleblock { flex-basis: auto; }
  .content { padding: 18px 20px 32px; }

  /* #87 tablet: reduce espaios y filtros colapsables */
  .kpi { padding: 14px 16px; }
  .kpi .value { font-size: 38px; }
  .content .sec-h { margin: 16px 0 10px; }

  /* Topbar search: shorter on tablet */
  .topbar-search { min-width: 160px !important; max-width: 240px !important; }
  .topbar-improvement { display: none; }

  /* Filtros en acordeón — marcador para módulos */
  .filter-panel { overflow: hidden; }
}

/* ===== Responsive — ancho intermedio 900px ===== */
/* Atracción / Incorporación: el panel lateral (alertas/tareas) se apila bajo el contenido en pantallas estrechas. */
@media (max-width: 900px) {
  [style*="1fr) 300px"] { grid-template-columns: 1fr !important; }
}

/* ===== Responsive — móvil 768px ===== */
@media (max-width: 768px) {
  /* Layout: colapsar sidebar */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 262px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 20px rgba(0,0,0,.14);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.38);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  /* Topbar sticky — #87 navigation visible always */
  .main { min-width: 0; }
  .topbar {
    padding: 0 12px;
    height: 52px;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .topbar h1 { font-size: 15px; max-width: none; }
  .crumbs--desktop { display: none; }
  .crumbs--mobile  { display: block; }
  /* Ocultar elementos secundarios en topbar móvil */
  .topbar .topbar-search { display: none !important; }
  .topbar-improvement { display: inline-flex; flex-shrink: 0; }
  .topbar-improvement .rh-improvement-trigger {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
  }
  .topbar-improvement .rh-improvement-trigger span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .topbar-back-label { max-width: 90px; }

  /* Content: menos padding */
  .content { padding: 12px 12px 32px; }

  /* Cards: más compactas */
  .card { padding: 14px; border-radius: 12px; }

  /* Grids: single column */
  .grid-2, .grid-3, .grid-4, .grid-2-3, .grid-3-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* #87 KPI cards más compactas */
  .kpi { padding: 14px; }
  .kpi .value { font-size: 36px; }
  .kpi .label { font-size: 10px; }
  .kpi .meta { font-size: 11px; }

  /* Tables */
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 6px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Botones táctiles — min 44px para accesibilidad (#87) */
  .btn { min-height: 44px; padding: 10px 14px; font-size: 13px; }
  .btn.sm { min-height: 36px; padding: 6px 12px; font-size: 12px; }
  .btn.ghost.sm { min-height: 36px; }

  /* Hamburguesa visible */
  .menu-toggle { display: inline-flex !important; }

  /* Modal */
  .modal-backdrop .card { width: 94% !important; max-width: 94% !important; }
  .rh-modal-overlay {
    align-items: flex-end;
    padding: 8px;
  }
  .rh-modal-box {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px);
    border-radius: 14px 14px 10px 10px;
  }
  .rh-modal-header { padding: 14px 14px 12px; }
  .rh-modal-context { display: grid; grid-template-columns: 1fr; }
  .rh-ctx-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
  }
  .rh-ctx-item:last-child { border-bottom: 0; }
  .rh-modal-body { padding: 14px; }
  .rh-modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
  }
  .rh-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Section headings */
  .sec-h { margin: 14px 0 8px; }
  .sec-h h2 { font-size: 18px; }

  /* Nav items: táctiles */
  .nav-item { min-height: 44px; padding: 10px 10px; }
  .nav-primary-item { min-height: 56px; }

  /* Hero band menos padding */
  .hero { padding: 20px 18px; border-radius: 14px; }
  .hero h2 { font-size: 24px; }

  /* rh-hero */
  .rh-hero { padding: 18px 16px !important; border-radius: 14px !important; }
  .rh-hero h2 { font-size: 22px !important; }
  .rh-hero-actions { flex-wrap: wrap; gap: 8px !important; }
  .rh-hero-actions .btn { width: 100%; justify-content: center; }

  /* Acciones rápidas arriba (#87) */
  .quick-actions-bar { order: -1; }

  /* Filtros acordeón en móvil — ocultar por defecto y revelar con clase .open */
  .filter-panel-mobile {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .filter-panel-mobile.open {
    max-height: 600px;
  }

  /* Reducir separación entre KPI cards (#87) */
  .grid-4 { gap: 8px; }
}

/* ===== Responsive — móvil pequeño 480px ===== */
@media (max-width: 480px) {
  .topbar { padding: 0 10px; height: 50px; }
  .topbar h1 { font-size: 14px; max-width: none; }
  .content { padding: 10px 10px 28px; }
  .card { padding: 12px; }
  .kpi .value { font-size: 32px; }
  .btn { min-height: 44px; }
}

/* ============================================
   Design upgrades (plan: que-le-cambiarias)
   ============================================ */

/* Empty state */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 50%;
  margin-bottom: 8px;
  font-size: 20px;
}
.empty-state-title {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.empty-state-hint {
  font-size: 13px;
  max-width: 320px;
  color: var(--ink-3);
}
.empty-state-action { margin-top: 12px; }

/* Card surface variants */
.card.nested {
  box-shadow: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.card.featured {
  box-shadow: var(--shadow);
  border: 1px solid var(--accent-line);
}

/* Motion: micro-stagger on card mount */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content > .card,
.content > .grid-2 > .card,
.content > .grid-3 > .card,
.content > .grid-4 > .card,
.content > .grid-2-3 > .card,
.content > .grid-3-2 > .card {
  animation: card-rise 280ms var(--ease-out) backwards;
}
.content > .card:nth-child(2),
.content > * > .card:nth-child(2) { animation-delay: 40ms; }
.content > .card:nth-child(3),
.content > * > .card:nth-child(3) { animation-delay: 80ms; }
.content > .card:nth-child(4),
.content > * > .card:nth-child(4) { animation-delay: 120ms; }
.content > .card:nth-child(5),
.content > * > .card:nth-child(5) { animation-delay: 160ms; }
.content > .card:nth-child(6),
.content > * > .card:nth-child(6) { animation-delay: 200ms; }

@media (prefers-reduced-motion: reduce) {
  .content > .card,
  .content > * > .card,
  .login-blob,
  .skeleton { animation: none; }
}

/* Bar chart primitive (for analytics/compensation/engagement) */
.bar-chart { display: grid; gap: 6px; }
.bar-chart .bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 3fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bar-chart .bar-label { color: var(--ink-2); }
.bar-chart .bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-chart .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bar-chart .bar-fill.warn { background: var(--warn); }
.bar-chart .bar-fill.danger { background: var(--danger); }
.bar-chart .bar-fill.info { background: var(--info); }
.bar-chart .bar-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  min-width: 40px;
  text-align: right;
}

/* Heatmap cell (engagement eNPS by area, etc.) */
.heatmap-cell {
  padding: 10px 12px;
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: color-mix(in oklch, var(--accent) calc(var(--intensity, 0) * 1%), var(--surface));
  border: 1px solid var(--line);
  transition: transform 150ms ease;
}
.heatmap-cell:hover { transform: translateY(-1px); }
.heatmap-cell.warn  { background: color-mix(in oklch, var(--warn)  calc(var(--intensity, 0) * 1%), var(--surface)); }
.heatmap-cell.danger{ background: color-mix(in oklch, var(--danger) calc(var(--intensity, 0) * 1%), var(--surface)); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 48px 16px;
  background: rgba(15, 18, 28, 0.48);
}

/* ── Sugerir mejora — modal ──────────────────────────────── */
.rh-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(10, 12, 22, 0.55);
  backdrop-filter: blur(4px);
  animation: rhModalFadeIn 0.18s ease;
}

.rh-modal-overlay--top {
  align-items: flex-start;
  overflow-y: auto;
}

@keyframes rhModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rh-modal-box {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface, #fff);
  color: var(--ink, #1f2430);
  border: 1px solid var(--line, #e4e6f0);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  animation: rhModalSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rh-modal-box--scroll {
  overflow: hidden;
}

@keyframes rhModalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.rh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line, #e4e6f0);
  gap: 12px;
  flex-shrink: 0;
}

.rh-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line, #e4e6f0);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--ink-3, #9095a0);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.rh-modal-close:hover { background: var(--surface-2, #f5f6fa); color: var(--ink, #1f2430); }

.rh-modal-context {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line, #e4e6f0);
  flex-shrink: 0;
}

.rh-ctx-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 16px;
  border-right: 1px solid var(--line, #e4e6f0);
  min-width: 0;
}
.rh-ctx-item:last-child { border-right: none; }

.rh-ctx-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-4, #9095a0);
  font-weight: 700;
}

.rh-ctx-value {
  font-size: 12px;
  color: var(--ink, #1f2430);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rh-modal-body {
  padding: 18px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.rh-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line, #e4e6f0);
  flex-shrink: 0;
}

.rh-field {
  display: grid;
  gap: 6px;
}

.rh-field > span:first-child {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4, #737782);
  font-weight: 700;
}

.rh-field textarea,
.rh-field select,
.rh-field input[type="file"] {
  width: 100%;
  border: 1px solid var(--ink-2, #d8dae2);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
  font-size: 13px;
  padding: 10px 11px;
  box-sizing: border-box;
}

.rh-field textarea { resize: vertical; }

.rh-field small {
  color: var(--ink-4, #737782);
  font-size: 11px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.empty-state {
  border-style: dashed;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--line, #e4e6f0);
  background: var(--surface-2, #f6f7fc);
  color: var(--ink-3, #5c6370);
}
.status-badge.ok {
  background: color-mix(in srgb, var(--accent-soft, #e8f7ef) 78%, white);
  color: var(--accent-ink, #0a6a3b);
  border-color: var(--accent-line, #bfe8d0);
}
.status-badge.warn {
  background: var(--warn-soft, #fff7dc);
  color: color-mix(in srgb, var(--warn, #c78900) 70%, black);
}
.status-badge.danger,
.status-badge.err {
  background: var(--danger-soft, #fde8e8);
  color: var(--danger, #b42318);
}

.kpi-card {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #e4e6f0);
  border-radius: var(--r, 10px);
  background: var(--surface, #fff);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #e4e6f0);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4, #737782);
  font-weight: 700;
  background: var(--surface-2, #f6f7fc);
}
.data-table tr:last-child td {
  border-bottom: none;
}

.improvements-list {
  display: grid;
  gap: 10px;
}

.improvement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line, #e4e6f0);
  border-radius: var(--r, 10px);
  background: var(--surface, #fff);
}

.improvement-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.improvement-main p {
  margin: 0;
  color: var(--ink, #111827);
  white-space: pre-wrap;
}

.improvement-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.improvement-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.note-box {
  border-left: 3px solid var(--accent, #0ea5e9);
  background: var(--accent-soft, #eef8ff);
  color: var(--ink-2, #1f2937);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .improvement-row {
    grid-template-columns: 1fr;
  }
  .improvement-actions {
    justify-content: flex-start;
  }
}
/* ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .hide-sm {
    display: none;
  }
}

/* ============================================
   Dashboard — #88 SaaS redesign
   KPI cards, quick-actions, hero band
   ============================================ */

/* Hero band rh-hero — modern gradient less ERP */
.rh-hero {
  border-radius: var(--r-xl);
  padding: 28px 32px;
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.rh-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 90% 10%, color-mix(in oklch, var(--accent) 22%, transparent), transparent);
  pointer-events: none;
}
.rh-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-4);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rh-hero h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.rh-hero p {
  color: var(--ink-3);
  font-size: 13.5px;
  margin: 0 0 18px;
  max-width: 560px;
  line-height: 1.55;
}
.rh-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Quick actions bar — #87/#88: acciones rápidas arriba */
.quick-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0 6px;
  margin-bottom: 6px;
}
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
  min-height: 36px;
  letter-spacing: -0.005em;
}
.quick-action-btn:hover {
  background: var(--saas-surface-hover);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
}
.quick-action-btn .icon { color: var(--accent); }

/* KPI cards — SaaS modern (#88) */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 150ms, border-color 150ms, transform 150ms;
}
.kpi:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
.kpi .label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 500;
}
.kpi .value {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 6px 0 4px;
  color: var(--ink);
}
.kpi .value .unit {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink-3);
  margin-left: 4px;
  font-weight: 500;
}
.kpi .meta {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* SaaS section heading — cleaner */
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 12px;
  gap: 12px;
}
.sec-h h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.015em;
}
.sec-h .sub {
  font-size: 12px;
  color: var(--ink-3);
}

/* Module tile cards — dashboard modules grid */
.module-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow 150ms, border-color 150ms, transform 150ms;
  position: relative;
  overflow: hidden;
}
.module-tile:hover {
  box-shadow: var(--shadow);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.module-tile .tile-icon {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.module-tile h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.module-tile .tile-sub {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.45;
}
.module-tile .tile-meta {
  font-size: 10.5px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin-top: auto;
  padding-top: 6px;
}

/* Filter toggle button for mobile (#87) */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
}

/* Highlight: topbar cycle tag — more breathing */
.topbar > .tag {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Dark mode adjustments */
[data-theme="dark"] .rh-hero {
  background: var(--surface);
  border: 1px solid var(--line);
}
[data-theme="dark"] .kpi:hover {
  border-color: var(--accent-line);
}
[data-theme="dark"] .module-tile:hover {
  border-color: var(--accent-line);
}
[data-theme="dark"] .quick-action-btn:hover {
  border-color: var(--accent-line);
}

/* ── Caribe accent overrides for hero ── */
[data-accent="caribe"] .rh-hero {
  background: #1A1F6F;
}
[data-accent="caribe"][data-theme="dark"] .rh-hero {
  background: var(--surface);
}

/* Responsive: filter toggle visible en tablet/móvil */
@media (max-width: 1024px) {
  .filter-toggle-btn { display: inline-flex; }
}
@media (max-width: 768px) {
  .filter-toggle-btn { display: inline-flex; min-height: 44px; width: 100%; justify-content: center; }
  .quick-action-btn { min-height: 44px; flex: 1; justify-content: center; }
  .quick-actions-bar { gap: 8px; }
  .module-tile { padding: 14px 16px; }
  .module-tile h4 { font-size: 13px; }
}

