/*
Theme Name: ILMO Dashboard
Theme URI: https://ilmo.mx
Author: ILMO Consulting
Author URI: https://ilmo.mx
Description: Tema showcase del producto de datos ILMO Example. Dashboards animados, tablero interactivo (38 indicadores, 6 vistas), chat de IA con los datos del dashboard, insights automáticos y reporte mensual imprimible. Bilingüe ES-MX / EN-US.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ilmodashboard
Tags: dark, one-column, custom-logo, custom-menu, translation-ready
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #02040a;
  --panel: rgba(9, 13, 26, 0.72);
  --panel-solid: #070b16;
  --panel-2: #0b1120;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-blue: rgba(72, 96, 240, 0.5);
  --text: #fafafa;
  --text-dim: #d1d5db;
  --text-mute: #9ca3af;
  --text-faint: #6b7280;
  --accent: #2d43e6;
  --accent-hover: #3b52f0;
  --blue-bright: #5b7cfa;
  --blue-soft: #93b4ff;
  --blue-glow: rgba(45, 67, 230, 0.45);
  --green: #4ade80;
  --amber: #f59e0b;
  --orange: #f97316;
  --teal: #14b8a6;
  --violet: #8b5cf6;
  --danger: #ff5d5d;
  --p1: #2d43e6;
  --p2: #f97316;
  --p3: #14b8a6;
  --p4: #f59e0b;
  --p5: #8b5cf6;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --nav-h: 96px;
  --nav-h-scrolled: 72px;
  --content-gap: 40px;
  --section-py: 120px;
  --max-w: 1440px;
}

:root.theme-light,
.theme-light {
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-2: #f1f3f9;
  --line: rgba(15, 23, 42, 0.08);
  --line-2: rgba(15, 23, 42, 0.14);
  --line-blue: rgba(72, 96, 240, 0.45);
  --text: #0b1020;
  --text-dim: #2c3344;
  --text-mute: #4b5363;
  --text-faint: #6b7383;
  --accent: #2d43e6;
  --accent-hover: #1f33c9;
  --blue-bright: #2d43e6;
  --blue-soft: #3b52f0;
  --blue-glow: rgba(45, 67, 230, 0.28);
  --nav-bg: rgba(246, 247, 251, 0.72);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.92);
  --vignette-1: rgba(246, 247, 251, 0.55);
  --vignette-2: rgba(246, 247, 251, 0.15);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 16px 40px rgba(15, 23, 42, 0.10);
}
:root,
:root.theme-dark {
  --nav-bg: rgba(2, 4, 10, 0.55);
  --nav-bg-scrolled: rgba(2, 4, 10, 0.88);
  --vignette-1: rgba(2, 4, 10, 0.55);
  --vignette-2: rgba(2, 4, 10, 0.25);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); transition: background-color 0.25s ease; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
  transition: background-color 0.25s ease, color 0.25s ease;
}
html.theme-transition, html.theme-transition body, html.theme-transition #ilmo-bg,
html.theme-transition .bg-vignette, html.theme-transition .site-nav {
  transition: background-color 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.3s ease, color 0.25s ease !important;
}
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus {
  left: 16px; top: 16px; width: auto; height: auto; padding: 10px 16px;
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-blue);
  border-radius: 8px; z-index: 10000; box-shadow: var(--shadow-card);
}
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
p { margin: 0; }
button { font-family: inherit; }
select, input, textarea { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .container { padding: 0 48px; } }
.mono { font-family: var(--font-mono); }

/* ============================================================
   FONDO — mosaico digital (canvas) + viñeta
   ============================================================ */
#ilmo-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 1; transition: opacity 0.35s ease; }
#ilmo-bg canvas { display: block; }
.theme-light #ilmo-bg { opacity: 0.14; }
.bg-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, var(--vignette-1), transparent 70%),
    linear-gradient(180deg, var(--vignette-2), transparent 30%);
}
.site-wrap { position: relative; z-index: 1; }

/* ============================================================
   TIPOGRAFÍA
   ============================================================ */
.display-xl { font-size: clamp(3rem, 7.5vw, 6rem); font-weight: 300; letter-spacing: -0.035em; line-height: 1.02; color: var(--text); }
.display-lg { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.08; }
.display-lg strong, .display-xl strong { font-weight: 600; letter-spacing: -0.02em; }
.dim-word { color: var(--text-mute); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--blue-soft); margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-bright); box-shadow: 0 0 10px var(--blue-glow); }

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}
.site-nav.scrolled { height: var(--nav-h-scrolled); background: var(--nav-bg-scrolled); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom-color: var(--line-2); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.26em; text-transform: uppercase; flex: none; line-height: 1; }
.nav-brand .brand-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #1b2bb0); box-shadow: 0 0 22px var(--blue-glow); }
.nav-brand .brand-mark svg { width: 20px; height: 20px; }
.nav-brand .nav-brand-text { display: inline-flex; flex-direction: column; gap: 4px; line-height: 1; }
.nav-brand .nav-brand-text .nav-brand-sub { font-size: 0.6rem; font-weight: 500; letter-spacing: 0.42em; color: var(--text-mute); }

.nav-links { display: flex; align-items: center; gap: 34px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; }
.nav-links a { font-size: 0.95rem; color: var(--text-dim); padding: 8px 0; position: relative; transition: color 0.2s ease; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--blue-bright); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 14px; flex: none; }

.lang-toggle { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; background: var(--panel-2); }
.lang-toggle button { border: 0; background: transparent; color: var(--text-mute); font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.lang-toggle button.active { background: var(--accent); color: #fff; }

.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-dim); border-radius: 8px; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease; flex: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--line-blue); }
.theme-toggle:active { transform: translateY(1px); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
.theme-light .theme-toggle .theme-icon-sun { display: block; }
.theme-light .theme-toggle .theme-icon-moon { display: none; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 32px var(--blue-glow); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.btn-outline-blue { background: transparent; border-color: var(--line-blue); color: var(--blue-bright); }
.btn-outline-blue:hover { background: rgba(45, 67, 230, 0.12); box-shadow: 0 0 24px rgba(45, 67, 230, 0.2); }
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-lg { padding: 16px 34px; font-size: 1rem; }

.nav-burger { display: none; border: 1px solid var(--line-2); background: transparent; color: var(--text); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; }
.nav-burger svg { width: 20px; height: 20px; display: block; }
.nav-burger .burger-close { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: calc(var(--nav-h) + var(--content-gap)) 0 110px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr); gap: 48px; align-items: center; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy h1 { margin-bottom: 28px; }
.hero-sub { max-width: 540px; color: var(--text-dim); font-size: 1.12rem; font-weight: 400; margin-bottom: 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badge { display: inline-flex; align-items: center; gap: 10px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-soft); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 16px; margin: 0 0 22px; background: var(--panel); }
.hero-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(74,222,128,.7); flex: none; }
.hero-proof { list-style: none; display: flex; gap: 28px; flex-wrap: wrap; margin: 34px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.hero-proof li { display: flex; flex-direction: column; gap: 2px; }
.hero-proof strong { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.hero-proof span { font-size: 0.85rem; color: var(--text-mute); }

.hero-visual { position: relative; min-height: 520px; }
.hero-visual-caption { position: absolute; top: -30px; right: 0; font-size: 0.73rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

/* ============================================================
   MOCKUP DE DASHBOARD (animado)
   ============================================================ */
.dash-card {
  position: relative; width: 100%;
  border-radius: var(--radius-lg); border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel), var(--panel-solid));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card-hover);
  display: grid; grid-template-columns: 148px 1fr; overflow: hidden;
}
.dash-side { border-right: 1px solid var(--line); padding: 16px 12px; font-size: 0.74rem; }
.dash-side .dash-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.18em; font-size: 0.68rem; padding: 4px 8px 16px; }
.dash-side .dash-logo svg { width: 17px; height: 17px; }
.dash-side nav a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--text-mute); margin-bottom: 2px; font-size: 0.72rem; }
.dash-side nav a.on { background: rgba(45, 67, 230, 0.18); color: var(--text); }
.dash-main { padding: 16px; min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.dash-head .dh-title { font-size: 0.82rem; font-weight: 600; }
.dash-head .dh-pill { font-size: 0.64rem; color: var(--text-mute); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 10px; white-space: nowrap; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.dstat { border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: var(--panel-2); min-width: 0; }
.dstat .ds-label { font-size: 0.56rem; color: var(--text-faint); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dstat .ds-value { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dstat .ds-delta { font-size: 0.56rem; color: var(--green); margin-top: 3px; }
.dstat .ds-delta.down { color: var(--danger); }
.dash-panels { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; }
.dpanel { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--panel-2); min-height: 150px; min-width: 0; }
.dpanel .dp-title { font-size: 0.64rem; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
.dpanel svg.chart { width: 100%; height: 106px; display: block; overflow: visible; }
.drow { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.6rem; color: var(--text-mute); padding: 6px 0; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: 0; }
.drow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.drow .dot.p { background: var(--p1); } .drow .dot.o { background: var(--p2); } .drow .dot.t { background: var(--p3); }
.drow .tag { font-size: 0.54rem; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; color: var(--text-faint); }
.chart-fill-blue { fill: url(#mockGrad); }
.chart-line-blue { fill: none; stroke: var(--blue-bright); stroke-width: 2; }
.chart-line-p3 { fill: none; stroke: var(--p3); stroke-width: 2; }
.chart-line-p2 { fill: none; stroke: var(--p2); stroke-width: 2; }
.bar-blue { fill: var(--accent); }
.bar-soft { fill: rgba(91, 124, 250, 0.4); }
.spark-area { fill: rgba(45, 67, 230, 0.16); }

/* Animaciones de los mockups */
@keyframes dash-draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.anim-line { stroke-dasharray: 1000; animation: dash-draw 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes bar-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.anim-bar { transform-origin: bottom; animation: bar-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes pulse-dot { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.pulse-dot { animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-line { background: linear-gradient(90deg, var(--line), var(--line-2), var(--line)); background-size: 200% 100%; animation: shimmer 2s linear infinite; height: 8px; border-radius: 4px; }

/* ============================================================
   SECCIONES
   ============================================================ */
.section { position: relative; padding: var(--section-py) 0; }
.section-line-top { border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p { color: var(--text-mute); font-weight: 300; max-width: 620px; font-size: 1.05rem; line-height: 1.7; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.section-head-row .section-head { margin-bottom: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { border-color: var(--line-blue); transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ============================================================
   MOCKUPS: 6 VISTAS
   ============================================================ */
.mock-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.mock-tab { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-mute); border-radius: 999px; padding: 9px 16px; font-size: 0.84rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; }
.mock-tab .mt-code { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.7; }
.mock-tab:hover { color: var(--text); border-color: var(--line-blue); }
.mock-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mock-stage { position: relative; }
.mock-panel { display: none; }
.mock-panel.active { display: block; animation: mock-in 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes mock-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mock-caption { margin-top: 18px; color: var(--text-mute); font-size: 0.92rem; font-weight: 300; }
.mock-caption strong { color: var(--blue-soft); font-weight: 600; }

/* ============================================================
   TABLERO EN VIVO
   ============================================================ */
.live-shell { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(45,67,230,0.06), var(--panel)); overflow: hidden; }
.dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.dash-toolbar .dt-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-toolbar .dt-title { font-size: 0.9rem; font-weight: 600; }
.freshness { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--text-mute); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; background: var(--panel-solid); }
.freshness .fd { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,.7); flex: none; }
.filter { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-mute); }
.filter select { background: var(--panel-solid); border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 7px 10px; font-size: 0.8rem; cursor: pointer; }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.view-tab { border: 1px solid var(--line-2); background: transparent; color: var(--text-mute); border-radius: 8px; padding: 8px 13px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease; }
.view-tab:hover { color: var(--text); border-color: var(--line-blue); }
.view-tab.active { background: rgba(45,67,230,0.18); border-color: var(--line-blue); color: var(--text); }

.dash-body { padding: 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); padding: 16px; min-width: 0; }
.kpi-card .k-label { font-size: 0.72rem; color: var(--text-faint); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-card .k-value { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-card .k-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.68rem; color: var(--text-faint); flex-wrap: wrap; }
.kpi-card .k-code { font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-faint); }

.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.66rem; font-weight: 600; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--line-2); white-space: nowrap; }
.status-chip.ok { color: var(--green); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.08); }
.status-chip.warn { color: var(--amber); border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.status-chip.risk { color: var(--orange); border-color: rgba(249,115,22,.4); background: rgba(249,115,22,.08); }
.status-chip.critical { color: var(--danger); border-color: rgba(255,93,93,.4); background: rgba(255,93,93,.08); }
.status-chip.none { color: var(--text-faint); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); padding: 16px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 0.88rem; font-weight: 600; }
.panel-head .ph-sub { font-size: 0.7rem; color: var(--text-faint); font-weight: 400; }
.panel-actions { display: flex; gap: 6px; }
.chip-toggle { border: 1px solid var(--line-2); background: transparent; color: var(--text-mute); border-radius: 7px; padding: 5px 10px; font-size: 0.68rem; cursor: pointer; transition: all 0.2s ease; }
.chip-toggle:hover { color: var(--text); }
.chip-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 0.72rem; color: var(--text-mute); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.axis-label { font-size: 9px; fill: var(--text-faint); font-family: var(--font-mono); }
.grid-line { stroke: var(--line); stroke-width: 1; }
.value-label { font-size: 10px; fill: var(--text-dim); font-family: var(--font-mono); }
.point-label { font-size: 11px; fill: var(--text); font-family: var(--font-mono); font-weight: 700; }

.data-table { display: none; margin-top: 12px; max-height: 260px; overflow: auto; }
.data-table.show { display: block; }
.data-table table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--text-faint); font-weight: 600; position: sticky; top: 0; background: var(--panel-2); }
.data-table td { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Portafolio: barras horizontales comparativas */
.pf-list { display: flex; flex-direction: column; gap: 12px; }
.pf-row { display: grid; grid-template-columns: 168px 1fr 74px; align-items: center; gap: 12px; }
.pf-name { font-size: 0.8rem; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.pf-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-track { height: 10px; border-radius: 999px; background: var(--panel-solid); overflow: hidden; }
.pf-bar { height: 100%; border-radius: 999px; transition: width 0.9s cubic-bezier(0.16,1,0.3,1); }
.pf-val { font-family: var(--font-mono); font-size: 0.78rem; text-align: right; color: var(--text-dim); }
.dpanel .pf-list { gap: 10px; }
.dpanel .pf-row { grid-template-columns: 112px 1fr 58px; gap: 8px; }
.dpanel .pf-name span { font-size: 0.62rem; }
.dpanel .pf-name .pf-dot { width: 7px; height: 7px; }
.dpanel .pf-val { font-size: 0.64rem; }
.dpanel .tag { font-size: 0.5rem; border: 0; padding: 0; }

.note { font-size: 0.76rem; color: var(--text-faint); font-weight: 300; margin-top: 14px; }
.warn-banner { display: none; align-items: center; gap: 10px; border: 1px solid rgba(245,158,11,.4); background: rgba(245,158,11,.08); color: var(--amber); border-radius: 10px; padding: 10px 14px; font-size: 0.82rem; margin-bottom: 14px; }
.warn-banner.show { display: flex; }

/* ============================================================
   INSIGHTS IA
   ============================================================ */
.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.insight-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.insight-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--line-blue); }
.insight-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.insight-card.critical::before { background: var(--danger); }
.insight-card.risk::before { background: var(--orange); }
.insight-card.warn::before { background: var(--amber); }
.insight-card.ok::before { background: var(--green); }
.insight-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insight-tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-soft); }
.insight-card.critical .insight-tag { color: var(--danger); }
.insight-card.risk .insight-tag { color: var(--orange); }
.insight-card.warn .insight-tag { color: var(--amber); }
.insight-card.ok .insight-tag { color: var(--green); }
.insight-card h3 { font-size: 1.05rem; font-weight: 600; }
.insight-card p { color: var(--text-mute); font-size: 0.94rem; font-weight: 300; line-height: 1.65; flex: 1; }
.insight-metric { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; background: var(--panel-2); align-self: flex-start; }
.ai-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.7rem; color: var(--text-faint); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; }
.ai-badge .sp { width: 12px; height: 12px; }

/* ============================================================
   CONSOLA DE IA (chat embebido)
   ============================================================ */
.ai-console { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: start; }
.ai-chat-card { border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--panel-solid); overflow: hidden; display: flex; flex-direction: column; height: 540px; max-height: 72vh; box-shadow: var(--shadow-card); }
.ai-chat-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(45, 67, 230, 0.14), transparent); }
.ai-chat-head .ch-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.78rem; flex: none; }
.ai-chat-head .ch-title { font-size: 0.92rem; font-weight: 600; }
.ai-chat-head .ch-status { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-mute); }
.ai-chat-head .ch-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.8); }
.ai-chat-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ai-chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.ai-chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); border-radius: 10px; padding: 11px 14px; font-size: 0.88rem; line-height: 1.4; max-height: 110px; outline: none; }
.ai-chat-input textarea:focus { border-color: var(--line-blue); }
.ai-suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ai-suggest button { border: 1px solid var(--line-2); background: var(--panel); color: var(--text-mute); border-radius: 999px; padding: 8px 14px; font-size: 0.78rem; cursor: pointer; transition: all 0.2s ease; }
.ai-suggest button:hover { color: var(--text); border-color: var(--line-blue); }

/* ============================================================
   REPORTE
   ============================================================ */
.report-preview { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; }
.report-preview-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--panel-2); }
.report-doc { padding: 30px 34px; }
.report-doc h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.report-doc .rd-sub { color: var(--text-mute); font-size: 0.9rem; font-weight: 300; margin-bottom: 22px; }
.report-sec { border-top: 1px solid var(--line); padding: 18px 0; }
.report-sec:first-of-type { border-top: 0; }
.report-sec .rs-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--blue-bright); }
.report-sec h4 { font-size: 0.98rem; font-weight: 600; margin: 4px 0 10px; }
.report-sec p, .report-sec li { color: var(--text-dim); font-size: 0.94rem; font-weight: 300; }
.report-sec ul { margin: 0; padding-left: 1.2em; }
.report-sec li + li { margin-top: 6px; }
.report-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.report-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.report-kpi .rk-label { font-size: 0.66rem; color: var(--text-faint); }
.report-kpi .rk-value { font-size: 1.05rem; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.report-kpi .rk-var { font-size: 0.66rem; margin-top: 3px; color: var(--text-faint); }
.report-kpi .rk-var.up { color: var(--green); } .report-kpi .rk-var.down { color: var(--danger); }
.report-foot { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-faint); }

/* ============================================================
   CONTACTO / FORMULARIOS
   ============================================================ */
.contact-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.contact-form-wrap { padding: 36px 38px; }
.form-alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 22px; font-size: 0.9rem; border: 1px solid var(--line); }
.form-alert.is-ok { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.4); color: var(--green); }
.form-alert.is-err { background: rgba(255, 93, 93, 0.08); border-color: rgba(255, 93, 93, 0.4); color: var(--danger); }
.contact-form .field { margin-bottom: 20px; }
.contact-form label { display: block; font-size: 0.92rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 13px 16px; color: var(--text); font-size: 1rem; outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--line-blue); box-shadow: 0 0 0 3px rgba(45, 67, 230, 0.12); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .btn { width: 100%; justify-content: center; margin-top: 6px; }
.form-note { margin-top: 14px; font-size: 0.78rem; color: var(--text-faint); text-align: center; }

/* ============================================================
   CTA FINAL + FOOTER
   ============================================================ */
.cta-band { position: relative; border: 1px solid var(--line); border-radius: 24px; padding: 80px 40px; text-align: center; overflow: hidden; background: var(--panel); }
.cta-band::before { content: ""; position: absolute; left: 50%; top: -30%; width: 70%; padding-bottom: 70%; transform: translateX(-50%); background: radial-gradient(circle, var(--blue-glow), transparent 70%); opacity: 0.6; pointer-events: none; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band p { color: var(--text-mute); font-weight: 300; max-width: 540px; margin: 0 auto 36px; font-size: 1.05rem; line-height: 1.7; }
.cta-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.cta-bullets { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; color: var(--text-faint); font-size: 0.82rem; }
.cta-bullets span + span::before { content: "•"; margin-right: 10px; color: var(--text-faint); }

.footer-top { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 48px; padding-bottom: 48px; }
.footer-brand { max-width: 320px; }
.footer-tagline { color: var(--text-mute); font-size: 0.98rem; font-weight: 300; margin: 16px 0 20px; }
.footer-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); font-size: 0.82rem; color: var(--text-dim); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(74, 222, 128, 0.6); flex: none; }
.footer-col h4.eyebrow { margin-bottom: 20px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a { color: var(--text-mute); font-size: 0.95rem; transition: color 0.2s ease; }
.footer-col ul a:hover { color: var(--text); }
.footer-social { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-social a { display: inline-flex; align-items: center; gap: 10px; color: var(--text-mute); font-size: 0.9rem; transition: color 0.2s ease; }
.footer-social a:hover { color: var(--text); }
.footer-social svg { width: 18px; height: 18px; flex: none; }
.footer-social img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 26px; margin-top: 8px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--text-mute); font-size: 0.88rem; }

/* ============================================================
   CHAT FAB
   ============================================================ */
#ilmo-chat { position: fixed; right: 22px; bottom: 22px; z-index: 999; }
.chat-fab { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 28px var(--blue-glow); transition: transform 0.2s ease, background 0.2s ease; position: relative; }
.chat-fab:hover { transform: scale(1.07); background: var(--accent-hover); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab .fab-badge { position: absolute; top: -2px; right: -2px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }

/* Indicador del analista (demo/dashboard) */
.chat-hint { position: absolute; right: 0; bottom: 74px; width: 268px; max-width: calc(100vw - 32px); display: flex; align-items: flex-start; gap: 10px; padding: 12px 30px 12px 14px; border-radius: 14px; border: 1px solid var(--line-blue); background: var(--panel-solid); box-shadow: var(--shadow-card-hover); cursor: pointer; }
.chat-hint::after { content: ""; position: absolute; right: 20px; bottom: -7px; width: 12px; height: 12px; background: var(--panel-solid); border-right: 1px solid var(--line-blue); border-bottom: 1px solid var(--line-blue); transform: rotate(45deg); }
.chat-hint .ch-avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.68rem; flex: none; }
.chat-hint-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-hint-text strong { font-size: 0.82rem; }
.chat-hint-text span { font-size: 0.78rem; color: var(--text-mute); line-height: 1.4; }
.chat-hint-close { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.chat-hint-close:hover { color: var(--text); }
.chat-hint.hidden { display: none; }
@keyframes chat-hint-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chat-hint-pulse { 0%, 100% { box-shadow: var(--shadow-card-hover); } 50% { box-shadow: 0 0 0 6px rgba(45, 67, 230, 0.14), var(--shadow-card-hover); } }
.chat-hint:not(.hidden) { animation: chat-hint-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both, chat-hint-pulse 2.8s ease-in-out 0.6s infinite; }
#ilmo-chat.open .chat-hint { display: none; }
.chat-panel { position: absolute; right: 0; bottom: 74px; width: 372px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100dvh - 130px); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel-solid); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow-card-hover); overflow: hidden; opacity: 0; transform: translateY(16px) scale(0.97); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
#ilmo-chat.open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(45, 67, 230, 0.12), transparent); }
.chat-head .ch-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.78rem; flex: none; }
.chat-head .ch-info { flex: 1; min-width: 0; }
.chat-head .ch-title { font-size: 0.92rem; font-weight: 600; }
.chat-head .ch-status { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-mute); }
.chat-head .ch-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.8); }
.chat-close { border: 0; background: transparent; color: var(--text-mute); cursor: pointer; font-size: 1.2rem; padding: 4px 8px; border-radius: 8px; }
.chat-close:hover { color: var(--text); background: var(--panel-2); }
.chat-modes { display: flex; gap: 6px; padding: 10px 14px 0; }
.chat-modes button { flex: 1; border: 1px solid var(--line-2); background: transparent; color: var(--text-mute); border-radius: 8px; padding: 7px 8px; font-size: 0.74rem; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.chat-modes button:hover { color: var(--text); border-color: var(--line-blue); }
.chat-modes button.active { background: rgba(45, 67, 230, 0.16); border-color: var(--line-blue); color: var(--text); font-weight: 600; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.chat-msg { max-width: 82%; padding: 11px 15px; border-radius: 15px; font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: msg-in 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chat-msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--text-dim); }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg.error { align-self: center; background: rgba(255, 93, 93, 0.1); border: 1px solid rgba(255, 93, 93, 0.3); color: var(--danger); font-size: 0.78rem; }
.chat-typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 15px; border-bottom-left-radius: 5px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); animation: typing-b 1.2s ease infinite; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-b { 0%, 60%, 100% { transform: none; opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat-suggest button { border: 1px solid var(--line-2); background: var(--panel); color: var(--text-mute); border-radius: 999px; padding: 8px 13px; font-size: 0.8rem; cursor: pointer; text-align: left; transition: color 0.2s ease, border-color 0.2s ease; }
.chat-suggest button:hover { color: var(--text); border-color: var(--line-blue); }
.chat-input-row { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.chat-input-row textarea { flex: 1; resize: none; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); border-radius: 10px; padding: 11px 14px; font-size: 0.88rem; line-height: 1.4; max-height: 110px; outline: none; }
.chat-input-row textarea:focus { border-color: var(--line-blue); }
.chat-send { width: 44px; height: 44px; align-self: flex-end; border: 0; border-radius: 10px; cursor: pointer; display: grid; place-items: center; background: var(--accent); color: #fff; transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease; }
.chat-send:hover { background: var(--accent-hover); box-shadow: 0 0 18px var(--blue-glow); }
.chat-send:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.chat-send svg { width: 19px; height: 19px; }
.chat-powered { text-align: center; font-size: 0.62rem; letter-spacing: 0.08em; color: var(--text-faint); padding: 0 0 10px; }

/* ============================================================
   EXPLORE FAB
   ============================================================ */
#ilmo-explore { position: fixed; left: 22px; bottom: 22px; z-index: 998; }
.explore-fab { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; display: grid; place-items: center; background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow-card); transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease; position: relative; }
.explore-fab:hover { transform: scale(1.07); background: var(--panel-2); border-color: var(--line-blue); color: var(--blue-bright); }
.explore-fab svg { width: 26px; height: 26px; display: block; }
.explore-fab .explore-icon-close { display: none; }
#ilmo-explore.open .explore-fab .explore-icon-open { display: none; }
#ilmo-explore.open .explore-fab .explore-icon-close { display: block; }
#ilmo-explore.open .explore-fab { background: var(--accent); color: #fff; border-color: var(--accent); }
.explore-panel { position: absolute; left: 0; bottom: 74px; width: 328px; max-width: calc(100vw - 32px); border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel-solid); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow-card-hover); overflow: hidden; opacity: 0; transform: translateY(16px) scale(0.97); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
#ilmo-explore.open .explore-panel { opacity: 1; transform: none; pointer-events: auto; }
.explore-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(45, 67, 230, 0.10), transparent); }
.explore-head .eyebrow { margin: 0; }
.explore-close { border: 0; background: transparent; color: var(--text-mute); cursor: pointer; font-size: 1.4rem; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.explore-close:hover { color: var(--text); background: var(--panel-2); }
.explore-nav { display: flex; flex-direction: column; padding: 8px 0; }
.explore-link { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--text-dim); font-size: 0.98rem; font-weight: 500; border-left: 2px solid transparent; transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.explore-link:hover { color: var(--text); background: var(--panel-2); border-left-color: var(--accent); }
.explore-link .explore-num { font-size: 0.72rem; color: var(--text-faint); letter-spacing: 0.1em; width: 22px; flex: none; }
.explore-link .explore-name { flex: 1; }
.explore-foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
.explore-foot .btn { width: 100%; justify-content: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1300px) {
  .hero-grid { gap: 32px; }
}
@media (max-width: 1100px) {
  :root { --nav-h: 88px; --nav-h-scrolled: 68px; --content-gap: 32px; --section-py: 96px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; margin-top: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-console { grid-template-columns: 1fr; }
  .report-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .mock-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --nav-h: 76px; --nav-h-scrolled: 64px; --content-gap: 24px; --section-py: 84px; }
  .nav-links { display: none; }
  .nav-burger { display: grid; place-items: center; }
  .nav-links.mobile-open { display: flex; position: fixed; top: var(--nav-h); left: 0; right: 0; flex: none; justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 0; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; background: var(--nav-bg-scrolled); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); padding: 12px 24px 20px; }
  .nav-links.mobile-open li { width: 100%; }
  .nav-links.mobile-open a { display: block; padding: 14px 0; font-size: 1rem; }
  .nav-links.mobile-open a::after { display: none; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-panels { grid-template-columns: 1fr; }
  .dash-card { grid-template-columns: 1fr; }
  .dash-side { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: none; margin-bottom: 8px; }
  .contact-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --nav-h: 68px; --nav-h-scrolled: 60px; --content-gap: 20px; --section-py: 62px; }
  .container { padding: 0 20px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .insight-grid { grid-template-columns: 1fr; }
  .report-kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-body { padding: 14px; }
  .dash-toolbar { padding: 14px; }
  .view-tabs { padding: 12px 14px 0; }
  .pf-row { grid-template-columns: 110px 1fr 58px; gap: 8px; }
  .section-head { margin-bottom: 40px; }
  .section-head-row { margin-bottom: 40px; }
  .nav-inner { gap: 12px; }
  .nav-brand { gap: 10px; font-size: 0.9rem; letter-spacing: 0.2em; }
  .nav-brand .brand-mark { width: 30px; height: 30px; }
  .nav-actions { gap: 10px; }
  .nav-actions .btn-sm { display: none; }
  .lang-toggle button { padding: 4px 8px; font-size: 0.68rem; }
  .display-xl { font-size: clamp(2.4rem, 9vw, 4rem); }
  .display-lg { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .cta-band { padding: 56px 24px; }
  #ilmo-chat { right: 14px; bottom: 14px; }
  #ilmo-explore { left: 14px; bottom: 14px; }
  .report-doc { padding: 22px 20px; }
}
@media (max-width: 400px) {
  :root { --nav-h: 64px; --content-gap: 16px; --section-py: 54px; }
  .nav-brand .nav-brand-text .nav-brand-sub { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .anim-line, .anim-bar, .pulse-dot, .skeleton-line { animation: none !important; }
  #ilmo-bg { opacity: 0.6; }
}
body.nav-open { overflow: hidden; }
.nav-overlay { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99; background: rgba(0,0,0,0.35); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.nav-overlay.visible { opacity: 1; pointer-events: auto; }
.theme-light .nav-overlay { background: rgba(15,23,42,0.08); }

/* ============================================================
   REPORTE EJECUTIVO — documento y portada
   ============================================================ */
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.report-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.report-doc { max-width: 940px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 46px 52px; box-shadow: var(--shadow-card); }
.report-cover { border-bottom: 2px solid var(--line-2); padding-bottom: 32px; }
.rc-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.rc-brand .brand-mark { width: 40px; height: 40px; }
.rc-brand-text { font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; font-size: 1rem; display: inline-flex; flex-direction: column; gap: 3px; }
.rc-brand-text span { font-size: 0.58rem; letter-spacing: 0.42em; color: var(--text-mute); font-weight: 500; }
.rc-kicker { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--blue-soft); font-weight: 600; }
.rc-title { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 300; letter-spacing: -0.03em; margin: 10px 0 4px; line-height: 1; }
.rc-period { color: var(--text-mute); font-size: 1.1rem; }
.rc-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.rc-meta > div { border-top: 1px solid var(--line); padding-top: 10px; }
.rc-meta span { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 5px; }
.rc-meta strong { font-size: 0.92rem; }
.rc-note { margin-top: 22px; font-size: 0.74rem; color: var(--text-faint); }

.report-sec { border-top: 1px solid var(--line); padding: 26px 0; }
.report-sec:first-of-type { border-top: 0; }
.rs-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.rs-head .rs-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--blue-bright); }
.rs-head h3 { font-size: 1.1rem; font-weight: 600; }
.report-lead { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 300; line-height: 1.5; color: var(--text-dim); }

.funnel-viz { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 14px; }
.fv-row { display: grid; grid-template-columns: 120px 1fr 92px; align-items: center; gap: 14px; }
.fv-label { font-size: 0.84rem; }
.fv-track { height: 22px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.fv-bar { display: block; height: 100%; border-radius: 6px; }
.fv-value { text-align: right; font-size: 0.92rem; font-weight: 700; }
.funnel-loss { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-mute); }
.funnel-loss strong { color: var(--danger); }

.report-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 10px; }
.report-chart { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 14px; }
.rc-chart-title { display: block; font-size: 0.74rem; color: var(--text-mute); margin-bottom: 10px; }
.report-chart svg { width: 100%; height: 110px; display: block; overflow: visible; }
.report-axis { display: flex; justify-content: space-between; gap: 4px; font-size: 0.6rem; color: var(--text-faint); }
.report-chart-foot { margin-top: 12px; font-size: 0.72rem; color: var(--text-faint); font-weight: 300; }

.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: grid; grid-template-columns: 22px 190px 1fr 96px 132px; align-items: center; gap: 12px; font-size: 0.82rem; }
.rank-pos { color: var(--text-faint); }
.rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-track { height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.rank-bar { display: block; height: 100%; border-radius: 999px; }
.rank-cac { text-align: right; font-weight: 700; }
.rank-extra { text-align: right; color: var(--text-faint); font-size: 0.72rem; }

.alerts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--text-dim); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--panel-2); }
.alert-ic { color: var(--amber); flex: none; }
.recos-list { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 12px; }
.recos-list li { font-size: 0.95rem; color: var(--text-dim); line-height: 1.6; }

.report-sign { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 6px; }
.report-sign > div { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; }
.sign-line { width: 220px; border-top: 1px solid var(--line-2); margin-bottom: 8px; }
.sign-right { text-align: right; }
.sign-right span { font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.report-foot-note { margin-top: 18px; font-size: 0.76rem; color: var(--text-faint); font-weight: 300; }

@media (max-width: 700px) {
  .report-doc { padding: 26px 20px; }
  .rc-meta { grid-template-columns: 1fr 1fr; }
  .report-charts { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 18px 1fr 84px; }
  .rank-track, .rank-extra { display: none; }
  .fv-row { grid-template-columns: 90px 1fr 72px; }
}

/* ============================================================
   IMPRESIÓN — REPORTE Y FICHAS
   ============================================================ */
@page { size: A4 portrait; margin: 14mm; }
@media print {
  #ilmo-bg, .bg-vignette, .site-nav, #ilmo-chat, #ilmo-explore,
  .nav-overlay, .no-print, .page-hero, .ai-console, .mock-tabs, .dash-toolbar,
  .view-tabs, .panel-actions, .cta-final-section, .site-footer { display: none !important; }
  html, body { background: #fff !important; color: #0b1020 !important; }
  body { font-size: 11.5px; }
  .site-wrap { z-index: auto; }
  .section { padding: 0 !important; }
  .container { max-width: 100%; padding: 0 !important; }
  .report-page, .report-doc { background: #fff !important; border: 0 !important; box-shadow: none !important; max-width: 100% !important; padding: 0 !important; border-radius: 0 !important; }
  .report-cover { break-after: page; border-bottom: 0; padding-bottom: 0; margin-bottom: 0; min-height: 90vh; }
  .rc-title { font-size: 46px; }
  .report-sec, .report-kpi, .report-chart, .rank-row, .alert-item, .report-sign { break-inside: avoid; }
  .report-kpi, .report-chart, .alert-item, .rank-track, .fv-track, .fv-bar, .rank-bar,
  .report-chart svg, .status-chip, .dstat { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .anim-line { stroke-dasharray: none !important; animation: none !important; }
  .anim-bar { animation: none !important; transform: none !important; }
  .report-sec { border-top: 1px solid #d5d8e0; }
  .report-kpi, .report-chart, .alert-item, .panel, .card, .insight-card { border-color: #d5d8e0 !important; background: #fff !important; box-shadow: none !important; }
  a { color: #0b1020 !important; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ============================================================
   DEMO INTERACTIVA — app shell
   ============================================================ */
.demo-page { padding-top: var(--nav-h); }
.demo-app { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - var(--nav-h)); }

.demo-side {
  position: sticky; top: var(--nav-h);
  align-self: start;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(45,67,230,0.05), transparent 40%);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 18px;
}
.ds-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.9rem; }
.ds-brand .brand-mark { width: 30px; height: 30px; }
.ds-brand .nav-brand-sub { font-size: 0.54rem; letter-spacing: 0.34em; color: var(--text-mute); }
.ds-block { display: flex; flex-direction: column; gap: 4px; }
.ds-client { font-size: 1.05rem; }
.ds-sub { font-size: 0.74rem; color: var(--text-faint); }
.ds-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.ds-select { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; width: 100%; cursor: pointer; }
.ds-views { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ds-view { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 9px 10px; color: var(--text-mute); font-size: 0.82rem; cursor: pointer; transition: all 0.18s ease; }
.ds-view:hover { color: var(--text); background: var(--panel-2); }
.ds-view.active { color: var(--text); background: rgba(45,67,230,0.16); border-color: var(--line-blue); }
.ds-view-code { font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.7; flex: none; }
.ds-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.ds-foot .freshness { font-size: 0.7rem; }

.demo-main { min-width: 0; padding: 18px 22px 60px; }
.demo-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 14px; }
.dt-filters, .dt-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-sep { color: var(--text-faint); }
.demo-scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scope-pill { font-size: 0.78rem; color: var(--blue-soft); border: 1px solid var(--line-blue); background: rgba(45,67,230,0.08); border-radius: 999px; padding: 6px 14px; }
.scope-range { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-mute); }

.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.demo-content { min-width: 0; }
.demo-kpis { grid-template-columns: repeat(4, 1fr); }
.demo-charts { grid-template-columns: 1fr 1fr; }

.kpi-card.clickable { text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--line); background: var(--panel-2); transition: border-color 0.2s ease, transform 0.15s ease; }
.kpi-card.clickable:hover { border-color: var(--line-blue); transform: translateY(-2px); }
.kpi-card.masked { opacity: 0.7; }
.kpi-card .k-spark { margin-top: 8px; height: 30px; }
.kpi-card .k-spark svg { width: 100%; height: 30px; display: block; }
.lock-tag { font-size: 0.68rem; color: var(--text-faint); border: 1px dashed var(--line-2); border-radius: 6px; padding: 3px 8px; display: inline-block; }

button.pf-row { width: 100%; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 2px 0; }
button.pf-row:hover .pf-name span:last-child { color: var(--blue-bright); }

.demo-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--nav-h) + 16px); }
.rail-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.rail-head h3 { font-size: 0.84rem; font-weight: 600; }
.rail-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; }
.rail-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }

.demo-insight { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--panel-2); padding: 12px 14px; animation: mock-in 0.4s cubic-bezier(0.16,1,0.3,1) both; }
.demo-insight.critical { border-left-color: var(--danger); }
.demo-insight.risk { border-left-color: var(--orange); }
.demo-insight.warn { border-left-color: var(--amber); }
.demo-insight.ok { border-left-color: var(--green); }
.demo-insight.info { border-left-color: var(--blue-soft); }
.demo-insight.clickable { cursor: pointer; }
.demo-insight.clickable:hover { border-color: var(--line-blue); }
.di-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.di-tag { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.di-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.di-dot.critical { background: var(--danger); } .di-dot.risk { background: var(--orange); } .di-dot.warn { background: var(--amber); } .di-dot.ok { background: var(--green); } .di-dot.info { background: var(--blue-soft); }
.demo-insight h4 { font-size: 0.9rem; font-weight: 600; margin: 6px 0; }
.demo-insight p { font-size: 0.82rem; color: var(--text-mute); font-weight: 300; line-height: 1.55; }
.di-metric { display: inline-block; margin-top: 8px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text); border: 1px solid var(--line-2); border-radius: 7px; padding: 3px 9px; }

.demo-ai-box { border: 1px solid var(--line-blue); background: rgba(45,67,230,0.08); border-radius: 10px; padding: 12px 14px; margin-bottom: 4px; }
.demo-ai-box p { font-size: 0.84rem; color: var(--text-dim); line-height: 1.6; margin-top: 8px; }

.demo-alert { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.da-bar { width: 4px; border-radius: 999px; background: var(--amber); flex: none; }
.demo-alert.risk .da-bar { background: var(--orange); }
.demo-alert.critical .da-bar { background: var(--danger); }
.demo-alert strong { display: block; font-size: 0.82rem; }
.demo-alert span { font-size: 0.76rem; color: var(--text-mute); }

.rail-chat { display: flex; flex-direction: column; }
.rail-chat .chat-body { max-height: 240px; padding: 12px; }
.rail-chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel-2); }
.rail-chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); border-radius: 9px; padding: 9px 12px; font-size: 0.82rem; max-height: 90px; outline: none; }
.rail-chat-input textarea:focus { border-color: var(--line-blue); }

/* Simulador */
.sim-panel { margin-top: 18px; }
.sim-sliders { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 14px; }
.sim-row { display: grid; grid-template-columns: 200px 1fr 96px; align-items: center; gap: 14px; }
.sim-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.sim-val { text-align: right; font-size: 0.82rem; }
.sim-totals { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-mute); border-top: 1px solid var(--line); padding-top: 12px; }
.sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.sim-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 14px; }
.sim-values { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; font-family: var(--font-mono); }
.sim-base { color: var(--text-faint); text-decoration: line-through; }
.sim-arrow { color: var(--text-faint); }
.sim-proj { color: var(--text); font-weight: 700; font-size: 1.05rem; }

/* Drawer */
.demo-drawer { position: fixed; top: var(--nav-h); right: 0; bottom: 0; width: min(480px, 100vw); background: var(--panel-solid); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0,0,0,0.5); transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.16,1,0.3,1); z-index: 500; overflow-y: auto; padding: 28px 26px; }
.demo-drawer.open { transform: none; }
.demo-drawer-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; color: var(--text-mute); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.demo-drawer-close:hover { color: var(--text); }
.drawer-value { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.drawer-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.drawer-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.drawer-meta > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.drawer-meta span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 5px; }
.drawer-meta code { font-size: 0.78rem; color: var(--blue-soft); }
.drawer-h { font-size: 0.9rem; font-weight: 600; margin: 18px 0 10px; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.drawer-stat span { display: block; font-size: 0.7rem; color: var(--text-faint); margin-bottom: 4px; }
.drawer-stat strong { font-size: 0.95rem; }

.theme-light .demo-drawer { box-shadow: -20px 0 60px rgba(15,23,42,0.12); }

@media (max-width: 1100px) {
  .demo-app { grid-template-columns: 1fr; }
  .demo-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .ds-views { flex-direction: row; flex-wrap: wrap; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-rail { position: static; }
  .demo-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .demo-kpis, .demo-charts, .sim-grid, .drawer-grid, .drawer-meta { grid-template-columns: 1fr; }
  .sim-row { grid-template-columns: 1fr 80px; }
  .sim-row .pf-name { grid-column: 1 / -1; }
  .demo-main { padding: 14px 14px 50px; }
}
