/* QC Mind - sistema de diseño.
   Lenguaje visual: fondo gris verdoso claro, tarjetas blancas, tipografía Figtree,
   botones de esquinas redondeadas y acento verde menta. Móvil primero, modo oscuro propio.
   El texto verde usa --accent-text (contraste AA); el verde claro --brand es solo
   para fondos, rellenos y gráficos, y los botones verdes llevan texto oscuro.
   Todos los pares de texto cumplen WCAG AA; la paleta de gráficos está validada
   para daltonismo (ver docs/ARQUITECTURA.md). */

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/vendor/fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/vendor/fonts/figtree-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Titulares de marca (portada, ingreso, presentación): serifa suave. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/fraunces-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-glass: rgba(243, 246, 244, 0.82);
  --surface: #ffffff;
  --surface-2: #edf2ef;
  --surface-3: #e1e8e4;
  --border: #e0e7e3;
  --border-strong: #cdd7d1;
  --text: #0f1714;
  --text-2: #2a3530;
  --muted: #64706a;
  --grid: #e8eeea;
  --axis: #cdd7d1;

  --brand: #2fcf8a;
  --brand-glow: rgba(47, 207, 138, 0.38);
  --accent: #2fcf8a;
  --accent-soft: #dcf7ea;
  --accent-text: #0b7a4f;
  --accent-solid: #3ddc97;
  --accent-solid-hover: #2cc985;
  --on-accent: #05291b;
  --ink: #0f1714;
  --on-ink: #ffffff;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-soft: #e7f6ec;
  --warning-soft: #fdf3dc;
  --serious-soft: #fdede4;
  --critical-soft: #fde8ea;
  --good-text: #11713f;
  --warning-text: #8a5a00;
  --serious-text: #9a3e14;
  --critical-text: #b3122b;

  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #4a3aa7;
  --s8: #e34948;
  --ref: #898781;

  --seq-100: #cde2fb;
  --seq-200: #9ec5f4;
  --seq-300: #6da7ec;
  --seq-400: #3987e5;
  --seq-500: #256abf;
  --seq-600: #184f95;
  --seq-700: #0d366b;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 15, 18, 0.04), 0 16px 36px -26px rgba(14, 15, 18, 0.22);
  --shadow-lg: 0 24px 60px -20px rgba(14, 15, 18, 0.32);
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  /* Verde bosque de marca: igual en modo claro y oscuro. */
  --forest: #2d6650;
  --forest-2: #357459;
  --on-forest: #eaf5ef;
  --on-forest-2: #c9e0d4;
  /* Menta para texto chico sobre verde (contraste AA); el menta de marca queda para íconos y titulares. */
  --on-forest-accent: #7ff0bf;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --nav-h: 66px;
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0c110f;
    --bg-glass: rgba(12, 17, 15, 0.82);
    --surface: #141b18;
    --surface-2: #1b2420;
    --surface-3: #25302b;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.17);
    --text: #eef4f1;
    --text-2: #c3cdc8;
    --muted: #93a19a;
    --grid: #222b27;
    --axis: #34403a;
    --brand: #4ee3a3;
    --brand-glow: rgba(78, 227, 163, 0.25);
    --accent: #4ee3a3;
    --accent-soft: #10291f;
    --accent-text: #6eeab4;
    --ink: #eef4f1;
    --on-ink: #0c110f;
    --good-soft: #12281c;
    --warning-soft: #30260c;
    --serious-soft: #33200f;
    --critical-soft: #3a1218;
    --good-text: #4fd08a;
    --warning-text: #fab219;
    --serious-text: #ef8a60;
    --critical-text: #ff8597;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c110f;
  --bg-glass: rgba(12, 17, 15, 0.82);
  --surface: #141b18;
  --surface-2: #1b2420;
  --surface-3: #25302b;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #eef4f1;
  --text-2: #c3cdc8;
  --muted: #93a19a;
  --grid: #222b27;
  --axis: #34403a;
  --brand: #4ee3a3;
  --brand-glow: rgba(78, 227, 163, 0.25);
  --accent: #4ee3a3;
  --accent-soft: #10291f;
  --accent-text: #6eeab4;
  --ink: #eef4f1;
  --on-ink: #0c110f;
  --good-soft: #12281c;
  --warning-soft: #30260c;
  --serious-soft: #33200f;
  --critical-soft: #3a1218;
  --good-text: #4fd08a;
  --warning-text: #fab219;
  --serious-text: #ef8a60;
  --critical-text: #ff8597;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.18; font-weight: 700; color: var(--text); }
h1 { font-size: 1.6rem; letter-spacing: -0.015em; }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
h3 { font-size: 1.02rem; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.78rem; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.hidden { display: none !important; }

/* Etiqueta superior (antetítulo) en verde */
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em; color: var(--accent-text); }
/* Palabra destacada en verde de marca */
.hl { color: var(--accent-text); white-space: nowrap; }
/* Insignia con marca cuadrada */
.pill-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.pill-badge .dot, .live-dot {
  width: 8px; height: 8px; border-radius: 2px; background: var(--brand); flex: none;
}

/* ---------- Arranque ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-weight: 600; }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- Estructura ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); display: none; flex-direction: column;
  background: var(--bg); border-right: 1px solid var(--border); padding: 18px 14px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.brand img { width: 34px; height: 34px; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--text); }
.brand-org { font-size: 0.76rem; color: var(--muted); max-width: 170px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2);
  font-weight: 600; font-size: 0.93rem; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(14, 15, 18, 0.06), inset 0 0 0 1px var(--border); }
.nav a.active .icon { color: var(--accent-text); }
.nav-section { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 16px 12px 6px; font-weight: 700; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--on-ink); font-weight: 800; font-size: 0.8rem; letter-spacing: -0.02em;
}
/* Menú lateral verde bosque (identidad propia de la app en escritorio). */
.sidebar { background: var(--forest); border-right: 0; color: var(--on-forest); }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-org { color: var(--on-forest-2); }
.sidebar .nav a { color: var(--on-forest-2); }
.sidebar .nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar .nav a.active { background: rgba(61, 220, 151, 0.13); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .nav a.active .icon { color: var(--brand); }
.sidebar .nav-section { color: rgba(234, 245, 239, 0.48); }
.sidebar-foot { border-top-color: rgba(255, 255, 255, 0.1); }
.sidebar .user-chip:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar .user-chip .muted { color: var(--on-forest-2); }
.sidebar .avatar { background: var(--brand); color: var(--on-accent); }
.sidebar .badge.good { background: rgba(61, 220, 151, 0.14); color: var(--on-forest-accent); }
.sidebar .badge.good .dot { background: var(--brand); color: var(--on-accent); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg-glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.1rem; letter-spacing: -0.02em; }
.topbar .back { margin-left: -8px; }
.content { width: 100%; max-width: 1200px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.content.wide { max-width: 1440px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { color: var(--text-2); margin-top: 4px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
  font-size: 0.7rem; font-weight: 700; text-decoration: none; min-width: 0;
}
.bottom-nav a.active { color: var(--text); }
.bottom-nav a.active .icon { color: var(--accent-text); }
.bottom-nav .fab-slot { position: relative; }
.bottom-nav .fab {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin-top: -22px;
  background: var(--accent-solid); color: var(--on-accent); box-shadow: 0 12px 26px -8px var(--brand-glow), 0 0 0 5px var(--bg);
}
.hide-nav .bottom-nav { display: none; }
.hide-nav .content { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .main { margin-left: var(--sidebar-w); }
  .bottom-nav { display: none; }
  .content { padding: 28px 32px 56px; }
  .hide-nav .content { padding-bottom: 120px; }
  .mobile-only { display: none !important; }
  h1 { font-size: 2rem; }
}
@media (max-width: 899px) {
  .desktop-only { display: none !important; }
}

/* ---------- Avisos ---------- */
.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; font-size: 0.9rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.banner.info { background: var(--surface-2); }
.banner.warning { background: var(--warning-soft); border-color: transparent; }
.banner.critical { background: var(--critical-soft); border-color: transparent; }
.banner.good { background: var(--good-soft); border-color: transparent; }
.banner .icon { flex: none; }
/* Ambiente de pruebas: franja visible para no confundirlo con el real. */
.env-strip {
  position: sticky; top: 0; z-index: 60; text-align: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 12px; background: #f5c542; color: #3a2a00;
}
.login-wrap.link-page { grid-template-columns: 1fr; }
.link-page .login-side { margin-top: 0; padding-top: 40px; align-items: flex-start; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; font-weight: 500; }
.card + .card { margin-top: 18px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .lp-grid > .card + .card { margin-top: 0; }
.section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; margin: 24px 0 10px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 0.92rem; letter-spacing: -0.01em; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); box-shadow: 0 10px 24px -10px var(--brand-glow); }
.btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--text-2); border-color: var(--text-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--critical-text); }
.btn-danger-solid { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.hint { font-size: 0.8rem; color: var(--muted); }
.error-text { font-size: 0.82rem; color: var(--critical-text); font-weight: 700; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 500; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus { border-color: var(--accent-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 24%, transparent); }
.input.invalid { border-color: var(--critical); background: var(--critical-soft); }
.input-sm { min-height: 40px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-group .addon {
  display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 12px 12px 0; background: var(--surface-2); color: var(--text-2); font-size: 0.88rem; font-weight: 700; white-space: nowrap;
}
.input-group .btn-pm { border-radius: 12px 0 0 12px; border-right: 0; min-height: 46px; width: 48px; padding: 0; font-weight: 800; }
.input-group .btn-pm + .input { border-radius: 0; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; min-height: 32px; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--accent-solid); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.form-grid .span-all { grid-column: 1 / -1; }

/* Segmentado y chips */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 700; cursor: pointer; color: var(--text-2);
}
.seg button:hover { background: var(--surface-2); }
.seg button.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.seg.compact button { min-height: 34px; padding: 0 13px; font-size: 0.85rem; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip .x { opacity: 0.7; }

/* ---------- Insignias de estado (siempre ícono + texto) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 7px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge .dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.badge.good { background: var(--good-soft); color: var(--good-text); }
.badge.good .dot { background: var(--good); }
.badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.badge.warning .dot { background: var(--warning); color: #3d2a00; }
.badge.critical { background: var(--critical-soft); color: var(--critical-text); }
.badge.critical .dot { background: var(--critical); }
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.badge.lg { height: 34px; font-size: 0.9rem; padding: 0 14px 0 8px; }
.badge.lg .dot { width: 20px; height: 20px; font-size: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 0.68rem;
  font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap;
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.fruit-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* ---------- Listas y tablas ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; font-weight: 500;
}
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); text-decoration: none; }
button.list-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.list-row .title { font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.list-row .meta { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .out { color: var(--critical-text); font-weight: 800; }

/* ---------- Indicadores ---------- */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 0.68rem; color: var(--muted); font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.kpi .value { font-size: 1.95rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.05; color: var(--text); }
.kpi .value small { font-size: 0.95rem; font-weight: 700; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.kpi .delta { font-size: 0.8rem; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 1px; color: var(--muted); font-weight: 600; }
.kpi .delta-val { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-weight: 800; }
.kpi .delta.good { color: var(--good-text); }
.kpi .delta.bad { color: var(--critical-text); }
.kpi .delta .muted { color: var(--muted); font-weight: 600; }

/* ---------- Pestañas (píldoras) ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding: 4px; width: fit-content; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  padding: 8px 16px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-weight: 700; font-size: 0.88rem;
  white-space: nowrap; cursor: pointer; text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs a.active, .tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(14, 15, 18, 0.1), 0 0 0 1px var(--border); }

/* ---------- Filtros (una fila sobre lo que filtran) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filters .field { min-width: 160px; flex: 1 1 180px; max-width: 340px; }
.filters .field > label { font-size: 0.68rem; color: var(--muted); font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }

/* ---------- Vacíos, carga ---------- */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 500; }
.empty b { color: var(--text-2); font-weight: 800; }
.empty .icon { color: var(--axis); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spin, .spinner, .boot img, .skeleton { animation: none; } }
.loading-block { display: grid; place-items: center; padding: 40px; }
.refetching { opacity: 0.55; transition: opacity 0.15s; pointer-events: none; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Avisos flotantes y modales ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 14px;
  background: #0e0f12; color: #fff; box-shadow: var(--shadow-lg); font-size: 0.92rem; font-weight: 600; animation: toast-in 0.18s ease-out;
}
.toast .icon { flex: none; margin-top: 1px; }
.toast.good .icon { color: #4fd08a; }
.toast.critical .icon { color: #ff8597; }
.toast.warning .icon { color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 15, 18, 0.5); z-index: 90; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: sheet-in 0.2s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } }
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { width: min(560px, 94vw); border-radius: 22px; padding: 24px; }
  .modal.wide { width: min(840px, 94vw); }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Captura ---------- */
.capture-section { padding: 0; overflow: hidden; }
.capture-section > h2 { padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 0.98rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); }
.capture-field { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; scroll-margin-top: 84px; }
.capture-field:last-child { border-bottom: 0; }
.capture-field.is-out { background: color-mix(in srgb, var(--critical-soft) 60%, transparent); }
.capture-field.is-missing { background: color-mix(in srgb, var(--warning-soft) 75%, transparent); }
.field-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.field-label { font-weight: 700; letter-spacing: -0.01em; }
.field-spec { font-size: 0.8rem; color: var(--muted); margin-top: 2px; font-weight: 500; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 800; white-space: nowrap; padding: 3px 9px 3px 5px; border-radius: 999px; }
.status-pill .dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; font-weight: 800; }
.status-pill.ok { background: var(--good-soft); color: var(--good-text); }
.status-pill.ok .dot { background: var(--good); }
.status-pill.out-critico { background: var(--critical-soft); color: var(--critical-text); }
.status-pill.out-critico .dot { background: var(--critical); }
.status-pill.out-mayor { background: var(--serious-soft); color: var(--serious-text); }
.status-pill.out-mayor .dot { background: var(--serious); }
.status-pill.out-menor { background: var(--warning-soft); color: var(--warning-text); }
.status-pill.out-menor .dot { background: var(--warning); color: #3d2a00; }
.defect-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.pct-pill { min-width: 86px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -0.01em; }
.stepper { display: flex; align-items: stretch; width: fit-content; }
.stepper button { width: 52px; min-height: 46px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 1.3rem; font-weight: 800; cursor: pointer; color: var(--text); }
.stepper button:first-child { border-radius: 12px 0 0 12px; }
.stepper button:last-child { border-radius: 0 12px 12px 0; }
.stepper .input { width: 76px; border-radius: 0; border-left: 0; border-right: 0; text-align: center; font-weight: 700; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; }
.yesno button { min-height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 800; cursor: pointer; color: var(--text-2); }
.yesno button.active.yes { background: var(--good-soft); border-color: var(--good); color: var(--good-text); }
.yesno button.active.no { background: var(--critical-soft); border-color: var(--critical); color: var(--critical-text); }
.calc-value { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; width: 86px; height: 86px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(14, 15, 18, 0.65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-add { width: 86px; height: 86px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-2); cursor: pointer; font-size: 0.74rem; font-weight: 700; }
.photo-add span { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg-glass);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border); box-shadow: 0 -10px 30px -18px rgba(14, 15, 18, 0.25);
}
@media (min-width: 900px) { .action-bar { left: var(--sidebar-w); padding-left: 32px; padding-right: 32px; } }
.action-bar .summary { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.action-bar .score { font-size: 0.8rem; color: var(--text-2); line-height: 1.25; font-weight: 600; }
.action-bar .score b { color: var(--text); font-size: 0.98rem; font-weight: 800; }

.picker-list { max-height: 55dvh; overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.select-button {
  width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600;
}
.select-button:hover { border-color: var(--text-2); }
.select-button.invalid { border-color: var(--critical); background: var(--critical-soft); }
.select-button .placeholder { color: var(--muted); }

.template-card {
  display: flex; align-items: stretch; gap: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none; color: inherit; min-height: 88px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.template-card:hover { border-color: var(--border-strong); transform: translateY(-1px); text-decoration: none; box-shadow: var(--shadow-lg); }
.template-card .stripe { width: 6px; flex: none; }
.template-card .body { padding: 15px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.template-card .title { font-weight: 800; letter-spacing: -0.015em; color: var(--text); }
.template-card .go { display: grid; place-items: center; padding: 0 16px; color: var(--muted); }

/* ---------- Editor de planillas ---------- */
.editor-layout { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .editor-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .editor-preview { position: sticky; top: 80px; max-height: calc(100dvh - 100px); overflow: auto; } }
.field-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.field-card + .field-card { margin-top: 8px; }
.field-card-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; min-width: 0; }
.field-card-head .type-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.field-card-body { padding: 6px 13px 15px; border-top: 1px solid var(--border); }
.section-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.section-card + .section-card { margin-top: 14px; }
.formula-help code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; font-family: var(--mono); }
.key-chip { font-family: var(--mono); font-size: 0.8rem; }
.field-card.has-error { border-color: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 12%, transparent); }
.field-card.open { border-color: var(--border-strong); box-shadow: var(--shadow); }
.form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Asistente de planillas: pasos en orden */
.step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.step-head h2 { font-size: 1.12rem; letter-spacing: -0.02em; margin-top: 3px; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 800; color: var(--text);
}
.step-card.done .step-num { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.step-card.locked { background: var(--surface-2); box-shadow: none; }
.step-card.locked .step-head { margin-bottom: 4px; }
.step-card.locked h2 { color: var(--text-2); }
.choice-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 13px 15px; border-radius: 14px; min-height: 60px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice:hover { border-color: var(--text-2); }
.choice:disabled { cursor: default; }
.choice.active { border-color: var(--brand); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.choice-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.choice.active .choice-icon { background: var(--surface); color: var(--accent-text); }
.choice-title { font-weight: 800; letter-spacing: -0.01em; }
.choice-check { margin-left: auto; color: var(--accent-text); display: grid; }
.choice-desc { font-size: 0.82rem; color: var(--text-2); font-weight: 500; line-height: 1.4; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chips .chip { min-height: 34px; padding: 0 12px; }
.summary-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--text-2); }
.summary-line b { color: var(--text); font-weight: 800; }

/* Productores de un control (uno o varios) */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.producer-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 38px; padding: 0 4px 0 13px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 600; font-size: 0.88rem; color: var(--text);
}
.producer-chip b { font-weight: 800; }
.producer-chip button {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center;
  cursor: pointer; color: var(--text-2); flex: none;
}
.producer-chip button:hover { background: var(--surface-3); color: var(--text); }
.id-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-2); font-weight: 600; }

/* ---------- Gráficos ---------- */
.chart-card .card-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin: -2px -18px 14px; padding-left: 18px; padding-right: 18px; }
.chart-card .chart-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.chart-card .card-head { flex-wrap: wrap; }
.chart-card .card-head > .grow { flex: 1 1 220px; }
.chart-card .chart-tools .input-sm { width: auto; max-width: 240px; }
.chart-card .chart-tools .btn { border-color: var(--border); }
.chart { position: relative; width: 100%; user-select: none; }
.chart svg { overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--text-2); font-size: 11.5px; font-weight: 700; }
.chart .limit-label { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.chart .crosshair { stroke: var(--text-2); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:focus { outline: none; }
.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 290px; padding: 11px 13px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 0.82rem;
}
.chart-tooltip .tt-title { font-weight: 800; margin-bottom: 6px; color: var(--text-2); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.chart-tooltip .tt-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.chart-tooltip .tt-key.box { height: 10px; width: 10px; border-radius: 3px; }
.chart-tooltip .tt-val { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tooltip .tt-name { color: var(--text-2); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 12px; font-size: 0.83rem; color: var(--text-2); font-weight: 600; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-key { width: 16px; height: 3px; border-radius: 2px; }
.legend-key.box { width: 12px; height: 12px; border-radius: 3px; }
.legend-key.dashed { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 9px 0; }
.hbar + .hbar { border-top: 1px solid var(--border); }
.hbar .hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; font-weight: 600; }
.hbar .hbar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbar .hbar-fill { height: 100%; border-radius: 999px; background: var(--s1); }
.meter { height: 6px; border-radius: 999px; background: var(--seq-100); overflow: hidden; width: 72px; }
.meter > div { height: 100%; background: var(--seq-500); border-radius: 999px; }
.heatmap td.cell { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.82rem; min-width: 64px; cursor: pointer; padding: 9px 6px; border: 2px solid var(--surface); border-radius: 8px; }
.heatmap td.cell.empty { background: var(--surface-2); color: var(--muted); cursor: default; }
.heatmap th.col { white-space: normal; min-width: 76px; max-width: 120px; vertical-align: bottom; text-transform: none; letter-spacing: 0; font-size: 0.76rem; }
.heatmap th:first-child, .heatmap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.heatmap td:first-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.scale-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.spark { width: 96px; height: 28px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 800; }
.trend.mejora { color: var(--good-text); }
.trend.empeora { color: var(--critical-text); }
.trend.estable { color: var(--muted); }

/* ---------- Plataforma de calidad (lotes, encabezado, alertas, análisis) ---------- */
.org-switch {
  display: flex; align-items: center; gap: 8px; margin: -8px 4px 14px; padding: 8px 10px; border-radius: 12px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent-text); font-size: 0.8rem; font-weight: 700;
}
.org-switch:hover { text-decoration: none; filter: brightness(0.98); }
.org-switch .tiny { margin-left: auto; text-decoration: underline; text-underline-offset: 2px; }
.sidebar .org-switch { background: rgba(61, 220, 151, 0.14); color: var(--on-forest-accent); }
a.chip:hover, a.type-card:hover, a.alert-row:hover { text-decoration: none; }

/* Estado «en advertencia»: dentro de la norma, cerca del límite */
.status-pill.warn { background: var(--warning-soft); color: var(--warning-text); }
.status-pill.warn .dot { background: var(--warning); color: #3d2a00; }
.capture-field.is-warn { background: color-mix(in srgb, var(--warning-soft) 55%, transparent); }
.warn-text { font-size: 0.82rem; color: var(--warning-text); font-weight: 700; }
.tag.tag-warn { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.tag.tag-good { background: var(--good-soft); color: var(--good-text); border-color: transparent; }
.tag.tag-bad { background: var(--critical-soft); color: var(--critical-text); border-color: transparent; }
.tag.tag-out { background: var(--critical-soft); color: var(--critical-text); border-color: transparent; }
.missing-count { color: var(--warning-text); font-weight: 800; }
.spec-line { background: var(--surface-2); }
.input-group .addon-btn { border-radius: 0 12px 12px 0; min-height: 46px; border-left: 0; }
.header-required { padding-top: 4px; }

/* Datos en grilla (ficha del lote, de la planilla) */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 20px; }
.kv-grid .kv-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--muted); margin-bottom: 3px; font-weight: 700; }
.kv-grid b { font-weight: 700; overflow-wrap: anywhere; }
.scope-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 12px; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.spec-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface); }
.spec-card .title { font-weight: 800; letter-spacing: -0.01em; }
.spec-table { min-width: 780px; }
.spec-table td:first-child { min-width: 170px; }
.spec-table .input-sm { min-width: 74px; }
.spec-table select.input-sm { min-width: 150px; }
.platform-bar { border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }

/* Recorrido del lote */
.lot-chain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.lot-chain > span:not(.sep) { padding: 1px 8px; border-radius: 6px; border: 1px dashed var(--border-strong); }
.lot-chain > span.on { border-style: solid; border-color: transparent; background: var(--good-soft); color: var(--good-text); }
.lot-chain .sep { color: var(--axis); }
.lot-hint { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.lot-hint .icon { flex: none; margin-top: 1px; color: var(--muted); }
.lot-hint.warn { background: var(--warning-soft); color: var(--warning-text); }
.lot-hint.warn .icon { color: var(--warning-text); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 18px 32px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 2px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--good); box-shadow: 0 0 0 3px var(--surface); }
.tl-item.observado .tl-dot { border-color: var(--warning); }
.tl-item.rechazado .tl-dot { border-color: var(--critical); }
.tl-body .title { font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.tl-body .meta { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

/* Tipo de inspección (elegir qué inspeccionar) */
.type-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .type-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.type-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); text-align: left; cursor: pointer; font: inherit; min-height: 72px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.type-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.type-card .grow { display: flex; flex-direction: column; gap: 3px; }
.type-card > .icon { color: var(--muted); flex: none; }
.type-card-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.type-grid.compact .type-card { min-height: 60px; padding: 12px 14px; }
.type-grid.compact .type-card-icon { width: 36px; height: 36px; border-radius: 11px; }

/* Buscar lote (inicio) */
.lot-search {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow); max-width: 640px;
}
.lot-search > .icon { color: var(--muted); flex: none; }
.lot-search .input { border: 0; box-shadow: none; padding: 6px 0; min-height: 40px; background: transparent; }
.lot-search .input:focus { box-shadow: none; }

/* Alertas */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--text); text-decoration: none;
  background: var(--surface-2); border: 1px solid transparent;
}
.alert-row .grow { display: flex; flex-direction: column; gap: 2px; }
.alert-row .title { font-weight: 800; letter-spacing: -0.01em; }
.alert-row .meta { font-size: 0.84rem; color: var(--text-2); font-weight: 500; }
.alert-row > .icon { color: var(--muted); flex: none; }
.alert-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--text-2); }
.alert-row.critical { background: var(--critical-soft); }
.alert-row.critical .alert-icon { background: var(--critical); color: #fff; }
.alert-row.warning { background: var(--warning-soft); }
.alert-row.warning .alert-icon { background: var(--warning); color: #3d2a00; }
.state-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--axis); }
.state-dot.good { background: var(--good); }
.state-dot.warning { background: var(--warning); }
.state-dot.critical { background: var(--critical); box-shadow: 0 0 0 4px color-mix(in srgb, var(--critical) 18%, transparent); }

/* Análisis: subpestañas, ayuda y más filtros */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 10px; }
.subtabs .chip { text-decoration: none; }
.tab-help { color: var(--text-2); font-size: 0.9rem; margin-bottom: 14px; max-width: 900px; }
.more-filters { margin: -6px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.more-panel { margin: 0; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.table tbody tr.selected td { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.chart .axis-title { fill: var(--muted); font-size: 11px; font-weight: 700; }

/* ---------- Informe imprimible (documento «papel»: siempre claro) ---------- */
.report { background: #fff; color: #0f1714; color-scheme: light; border-radius: var(--radius); border: 1px solid var(--border); padding: 36px 40px; max-width: 920px; margin: 0 auto; box-shadow: var(--shadow); }
.report h1 { font-size: 1.65rem; letter-spacing: -0.025em; margin: 3px 0 2px; color: #0f1714; }
.report-brand { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 3px solid #0b7a4f; }
.report-brand .rb-left { display: flex; align-items: center; gap: 11px; }
.report-brand .rb-name { font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; line-height: 1.15; }
.report-brand .rb-sub { font-size: 0.64rem; color: #7d8882; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.report-brand .rb-org { text-align: right; font-size: 0.82rem; color: #64706a; }
.report-brand .rb-org b { color: #0f1714; font-size: 0.95rem; }
.report-eyebrow { color: #0b7a4f; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; }
.report-meta { color: #64706a; font-size: 0.86rem; }
.report-result { display: flex; align-items: center; gap: 14px; margin: 18px 0; padding: 14px 18px; border-radius: 14px; border: 1px solid transparent; }
.report-result .rr-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; color: #fff; flex: none; }
.report-result .rr-label { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.report-result .rr-sub { font-size: 0.82rem; color: #64706a; }
.report-result .rr-score { text-align: right; }
.report-result .rr-score-num { font-weight: 800; font-size: 1.8rem; letter-spacing: -0.03em; line-height: 1; }
.report-result .rr-score-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.13em; color: #7d8882; font-weight: 700; margin-top: 3px; }
.report-result.aprobado { background: #ecf7f0; border-color: #cdeada; }
.report-result.aprobado .rr-icon { background: #1d9b53; }
.report-result.observado { background: #fdf4e3; border-color: #f4ddb2; }
.report-result.observado .rr-icon { background: #d98e04; }
.report-result.rechazado { background: #fdedf0; border-color: #f7c9d2; }
.report-result.rechazado .rr-icon { background: #d03b3b; }
.report .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; margin-bottom: 20px; background: #f3f6f4; border: 1px solid #e0e7e3; border-radius: 12px; padding: 16px 18px; }
.report .kv .kv-label, .report .kv-label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: #7d8882; margin-bottom: 3px; font-weight: 700; }
.report .kv b { font-weight: 700; }
.report .table th { color: #64706a; border-bottom: 2px solid #0f1714; }
.report .table td { border-color: #e0e7e3; }
.report tr.row-out td { background: #fdf1f4; }
.report .st { font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.report .st.ok { color: #1d9b53; }
.report .st.warn { color: #b07408; }
.report .st.out { color: #b3122b; }
.report-note { margin-top: 16px; padding: 12px 16px; border-left: 3px solid #0b7a4f; background: #f3f6f4; border-radius: 0 10px 10px 0; font-size: 0.92rem; }
.report-note .kv-label { margin-bottom: 4px; }
.report .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 56px; }
.report .sign div { border-top: 1px solid #64706a; padding-top: 7px; font-size: 0.82rem; text-align: center; color: #64706a; }
.report .photos img { width: 150px; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid #e0e7e3; }
.report .table td, .report .table th { padding: 7px 9px; }
.report-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #e0e7e3; font-size: 0.72rem; color: #7d8882; display: flex; justify-content: space-between; }

/* Membrete y pie que solo existen al imprimir (los agrega el Shell). */
.print-masthead, .print-footnote { display: none; }

/* ---------- Firma dibujada (campo tipo firma) ---------- */
.sign-pad { border: 2px dashed var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.sign-pad canvas { cursor: crosshair; }
.photo-thumb.sign-thumb img { object-fit: contain; background: #fff; }

.qr svg { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 16px; border: 1px solid var(--border); }
.code { font-family: var(--mono); background: var(--surface-2); padding: 3px 9px; border-radius: 8px; font-size: 0.88rem; word-break: break-all; }

/* ---------- Ingreso: panel verde bosque + formulario ---------- */
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.login-hero { position: relative; overflow: hidden; background: var(--forest); color: var(--on-forest); padding: 26px 22px 46px; display: flex; flex-direction: column; gap: 16px; }
.login-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px; -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent); mask-image: linear-gradient(180deg, #000 35%, transparent); }
.login-hero::after { content: ''; position: absolute; width: 620px; height: 620px; right: -260px; bottom: -340px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.26), transparent 62%); }
.login-hero > * { position: relative; z-index: 1; }
.login-hero .brand-name { color: #fff; }
.login-kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; color: var(--on-forest-accent); }
.login-kicker::before { content: ''; width: 22px; height: 2px; background: var(--on-forest-accent); }
.login-title { font-family: var(--display); font-weight: 600; font-size: 2.3rem; line-height: 1.04; letter-spacing: -0.01em; color: #fff; }
.login-title em { font-style: italic; font-weight: 500; color: var(--brand); }
.login-lead { color: var(--on-forest-2); font-size: 1.04rem; line-height: 1.65; max-width: 500px; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: var(--on-forest); font-weight: 500; }
.login-points .ic { width: 32px; height: 32px; border-radius: 9px; background: rgba(61, 220, 151, 0.14); color: var(--brand); display: grid; place-items: center; flex: none; }
.login-more { color: var(--on-forest); font-weight: 600; }
.login-more:hover { color: #fff; }
.login-side { display: flex; align-items: flex-start; justify-content: center; padding: 0 16px 32px; margin-top: -24px; position: relative; z-index: 2; background: color-mix(in srgb, var(--brand) 8%, var(--bg)); }
.login-card { width: min(440px, 100%); padding: 26px; }
.login-card h2 { font-size: 1.45rem; }
.demo-box { margin-top: 18px; font-size: 0.85rem; align-items: flex-start; }
.demo-box button { all: unset; cursor: pointer; color: var(--accent-text); font-weight: 700; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 0.8rem; }
.demo-box button:hover { background: var(--surface-2); }
.demo-box .code { white-space: nowrap; word-break: normal; }
@media (max-width: 979px) { .login-lead, .login-points, .login-hero .login-foot { display: none; } }
@media (min-width: 980px) {
  .login-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .login-hero { padding: 48px 64px; justify-content: center; gap: 26px; }
  .login-title { font-size: clamp(2.9rem, 4.3vw, 4.3rem); }
  .login-side { align-items: center; padding: 40px; margin-top: 0; }
}

/* ---------- Página de presentación ---------- */
.lp { background: var(--bg); }
.lp-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.lp-top { position: sticky; top: 0; z-index: 20; background: rgba(45, 102, 80, 0.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.lp-nav { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.lp-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; }
.lp-logo:hover { text-decoration: none; }
.lp-nav .links { display: none; gap: 26px; }
.lp-nav .links a { color: var(--on-forest-2); font-weight: 600; font-size: 0.92rem; }
.lp-nav .links a:hover { color: #fff; text-decoration: none; }
.lp-nav .actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.lp-signin { color: var(--on-forest); font-weight: 600; font-size: 0.92rem; }
.lp-signin:hover { color: #fff; }
@media (min-width: 900px) { .lp-nav .links { display: flex; } }
.show-sm { display: none; }
@media (max-width: 520px) { .hide-sm { display: none; } .show-sm { display: inline; } .lp-nav { gap: 12px; } .lp-nav .actions { gap: 12px; } .lp-kicker, .login-kicker { font-size: 0.8rem; } .lp-kicker::before, .login-kicker::before { width: 16px; } }

.lp-hero { position: relative; overflow: hidden; background: var(--forest); color: var(--on-forest); }
.lp-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 95%); mask-image: linear-gradient(180deg, #000 40%, transparent 95%); }
.lp-hero::after { content: ''; position: absolute; width: 820px; height: 820px; right: -240px; bottom: -420px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.3), transparent 62%); }
.lp-hero-grid { position: relative; z-index: 1; display: grid; gap: 40px; padding-top: 56px; align-items: end; }
.lp-hero-copy { padding-bottom: 56px; }
.lp-kicker { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; color: var(--on-forest-accent); font-size: 0.95rem; }
.lp-kicker::before { content: ''; width: 26px; height: 2px; background: var(--on-forest-accent); }
.lp-display { font-family: var(--display); font-weight: 600; font-size: clamp(2.7rem, 6.2vw, 5.2rem); line-height: 1.02; letter-spacing: -0.015em; color: #fff; margin-top: 18px; }
.lp-display em, .lp-h2 em, .lp-final h2 em { font-style: italic; font-weight: 500; }
.lp-display em { color: var(--brand); }
.lp-lead { margin-top: 22px; font-size: 1.12rem; line-height: 1.65; color: var(--on-forest-2); max-width: 540px; }
.lp-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 32px; }
.lp-textlink { color: #fff; font-weight: 600; }
.lp-textlink:hover { color: var(--brand); }
.lp-proof { list-style: none; margin: 36px 0 0; padding: 22px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--on-forest-2); font-size: 0.9rem; font-weight: 600; }
.lp-proof li { display: flex; align-items: center; gap: 8px; }
.lp-proof svg { color: var(--brand); flex: none; }
.lp-hero-visual { position: relative; justify-self: center; width: min(340px, 78vw); }
.lp-phone { background: #08100c; border-radius: 46px; padding: 11px; margin-bottom: -90px; box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.65), inset 0 0 0 2px #22302a; }
.lp-phone img { display: block; width: 100%; height: auto; border-radius: 36px; }
.lp-float { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; width: max-content; max-width: 280px; padding: 12px 16px 12px 12px;
  background: #fff; color: var(--text); border-radius: 14px; box-shadow: 0 26px 50px -18px rgba(0, 0, 0, 0.5); font-size: 0.82rem; line-height: 1.35; }
.lp-float b { display: block; font-size: 0.92rem; color: var(--text); }
.lp-float span { color: var(--muted); font-weight: 500; }
.lp-float .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.lp-float-a { left: -46%; top: 14%; }
.lp-float-a .ic { background: var(--accent-soft); color: var(--accent-text); }
.lp-float-b { right: -40%; top: 50%; }
.lp-float-b .ic { background: var(--good-soft); color: var(--good-text); }
@media (max-width: 860px) { .lp-float { display: none; } }
@media (min-width: 980px) {
  .lp-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); padding-top: 88px; }
  .lp-hero-copy { padding-bottom: 104px; }
}

.lp-sec { padding: 88px 0; }
.lp-sec-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-head { max-width: 780px; }
.lp-num { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.15rem; color: var(--accent-text); }
.lp-h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.08; letter-spacing: -0.01em; margin-top: 10px; }
.lp-h2 em { color: var(--accent-text); }
.lp-head p { margin-top: 16px; color: var(--text-2); font-size: 1.06rem; line-height: 1.65; }

/* Controles presentados como planillas */
.lp-sheets { display: grid; gap: 18px; margin-top: 44px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .lp-sheets { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .lp-sheets { grid-template-columns: repeat(4, 1fr); } }
.lp-sheet { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; }
.lp-sheet header { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-sheet header small { color: var(--accent-text); font-weight: 700; font-size: 0.76rem; }
.lp-sheet header h3 { font-size: 1.08rem; margin-top: 3px; }
.lp-sheet ul { list-style: none; margin: 0; padding: 4px 18px 10px; flex: 1; }
.lp-sheet li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border-strong); font-size: 0.9rem; color: var(--text-2); font-weight: 500; }
.lp-sheet li:last-child { border-bottom: 0; }
.lp-sheet li i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.84rem; }
.lp-sheet li i.ok { color: var(--good-text); font-weight: 700; }
.lp-sheet li i.out { color: var(--critical-text); font-weight: 700; }
.lp-sheet.custom { border: 2px dashed var(--brand); background: var(--accent-soft); padding: 26px 22px; gap: 12px; justify-content: center; }
.lp-sheet.custom h3 { font-family: var(--display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.lp-sheet.custom p { color: var(--text-2); line-height: 1.55; }

/* Pasos */
.lp-steps { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 30px; }
@media (min-width: 860px) { .lp-steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.lp-steps li { border-top: 2px solid var(--text); padding-top: 18px; }
.lp-steps .n { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 3.4rem; line-height: 1; color: var(--accent-text); }
.lp-steps h3 { font-size: 1.22rem; margin: 12px 0 8px; }
.lp-steps p { color: var(--text-2); line-height: 1.6; }
.lp-browser { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 34px 80px -46px rgba(45, 102, 80, 0.45); }
.lp-browser .bar { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.lp-browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.lp-browser img { display: block; width: 100%; height: auto; }
.lp-shot { margin: 56px 0 0; }
.lp-shot figcaption { margin-top: 14px; color: var(--muted); font-size: 0.92rem; }

/* Análisis */
.lp-split { display: grid; gap: 44px; align-items: center; }
@media (min-width: 980px) { .lp-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; } }
.lp-checks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.lp-checks li { display: flex; gap: 12px; align-items: center; font-weight: 600; color: var(--text-2); }
.lp-checks .ic { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }

/* Para quién: lista editorial */
.lp-roles { margin-top: 40px; border-top: 1px solid var(--border-strong); }
.lp-role { display: grid; gap: 6px 48px; padding: 24px 0; border-bottom: 1px solid var(--border-strong); }
@media (min-width: 760px) { .lp-role { grid-template-columns: 300px 1fr; align-items: baseline; } }
.lp-role h3 { font-family: var(--display); font-weight: 600; font-size: 1.65rem; line-height: 1.15; }
.lp-role p { color: var(--text-2); font-size: 1.04rem; line-height: 1.6; }

/* Llamado final en verde menta */
.lp-final { background: var(--accent-solid); color: var(--on-accent); padding: 80px 0; }
.lp-final-grid { display: grid; gap: 26px; }
@media (min-width: 900px) { .lp-final-grid { grid-template-columns: 1.2fr 0.8fr; align-items: end; } }
.lp-final h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2.3rem, 4.8vw, 3.8rem); line-height: 1.04; color: var(--on-accent); }
.lp-final p { color: rgba(5, 41, 27, 0.82); font-size: 1.08rem; line-height: 1.6; margin-top: 14px; max-width: 520px; }
.lp-final .row-wrap { gap: 12px; }
.lp-final .btn-forest { background: var(--forest); border-color: var(--forest); color: #fff; }
.lp-final .btn-forest:hover { background: var(--forest-2); border-color: var(--forest-2); }
.lp-final .btn-line { background: transparent; border-color: rgba(5, 41, 27, 0.35); color: var(--on-accent); }
.lp-final .btn-line:hover { background: rgba(5, 41, 27, 0.06); }
.lp-foot { background: var(--forest); color: var(--on-forest-2); padding: 40px 0; font-size: 0.88rem; }
.lp-foot .lp-logo { font-size: 1rem; }
.lp-foot a { color: var(--on-forest); }

/* ---------- Impresión ---------- */
/* ---------------------------------------------------------------------------
   Impresión / PDF: documento de marca, pensado para entregarse a gerencia,
   productores o auditores. Tipografía compacta, acento verde y tablas limpias.
--------------------------------------------------------------------------- */
@media print {
  @page { size: A4; margin: 12mm 12mm 16mm; }
  :root { color-scheme: light; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; text-shadow: none !important; }
  html, body { background: #fff !important; color: #0f1714 !important; font-size: 10pt; line-height: 1.45; }

  /* Fuera: navegación, filtros y todo lo interactivo. */
  .sidebar, .topbar, .bottom-nav, .action-bar, .toasts, .no-print, .banner,
  .tabs, .subtabs, .tab-help, .filters, .more-filters, .chips, .page-head,
  .chart-tooltip, .modal-backdrop, .chart-tools { display: none !important; }
  .shell, .main { display: block !important; margin: 0 !important; }
  .content { padding: 0 0 12mm !important; max-width: none !important; }
  a { color: inherit !important; text-decoration: none !important; }

  /* Membrete de marca (primera página) y pie en cada página. */
  .print-masthead { display: flex !important; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 3px solid #0b7a4f; }
  .print-masthead .pm-brand { display: flex; align-items: center; gap: 9px; }
  .print-masthead img { width: 28px; height: 28px; }
  .print-masthead .pm-name { font-weight: 800; font-size: 12.5pt; letter-spacing: -0.02em; line-height: 1.1; }
  .print-masthead .pm-org { font-size: 7pt; color: #7d8882; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
  .print-masthead .pm-doc { text-align: right; }
  .print-masthead .pm-title { font-weight: 800; font-size: 11pt; letter-spacing: -0.01em; }
  .print-masthead .pm-date { font-size: 7.5pt; color: #7d8882; }
  .print-footnote { display: flex !important; position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-between; font-size: 7pt; color: #7d8882; border-top: 1px solid #e0e7e3; padding-top: 4px; letter-spacing: 0.04em; }
  /* El informe de inspección ya trae su propio membrete y pie. */
  body:has(.report) .print-masthead, body:has(.report) .print-footnote { display: none !important; }

  /* Jerarquía tipográfica de documento. */
  h1 { font-size: 16pt; letter-spacing: -0.02em; }
  h2 { font-size: 12.5pt; letter-spacing: -0.015em; }
  .card-head h3, h3 { font-size: 10.5pt; }
  .card-head p { font-size: 8pt; color: #7d8882 !important; }
  .section-title, .eyebrow { color: #0b7a4f !important; }

  /* Tarjetas: filo fino, sin sombra, sin cortes entre páginas. */
  .card, .kpi, .spec-card { border: 1px solid #e3ded7 !important; border-radius: 10px !important; background: #fff !important; break-inside: avoid; }
  .grid-2, .grid-3 { break-inside: avoid; }

  /* Indicadores: barra verde y cifra protagonista. */
  .kpi-grid { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 7px !important; break-inside: avoid; }
  .kpi { border-left: 3px solid #0b7a4f !important; padding: 8px 11px !important; }
  .kpi .label { font-size: 6.8pt; letter-spacing: 0.11em; color: #7d8882 !important; }
  .kpi .value { font-size: 15pt; font-weight: 800; letter-spacing: -0.02em; }
  .kpi .value small { font-size: 8pt; }
  .kpi .delta { font-size: 7.3pt; }

  /* Tablas: encabezado editorial y filas con filo de pelo. */
  .table { font-size: 8.6pt; }
  .table th { font-size: 7pt; text-transform: uppercase; letter-spacing: 0.1em; color: #64706a !important; background: #fff !important; border-bottom: 1.4pt solid #0f1714 !important; padding: 4px 8px !important; }
  .table td { border-bottom: 0.6pt solid #e8e3dc !important; padding: 4.5px 8px !important; }
  .table tr { break-inside: avoid; }
  .table-wrap { max-height: none !important; overflow: visible !important; }
  td.num.out, .num.out, .missing-count { color: #c40f33 !important; font-weight: 700; }

  /* Listas y gráficos. */
  .list-row { padding: 5px 0 !important; border-color: #e8e3dc !important; }
  .chart-card, .chart-frame, figure.card { break-inside: avoid; }
  .legend { font-size: 7.5pt; }

  /* Informe de inspección: hoja limpia, el documento ES la página. */
  .report { border: 0 !important; border-radius: 0 !important; padding: 0 !important; max-width: none !important; }
  .report-result, .report .kv, .report-note, .report tr.row-out td { break-inside: avoid; }
  .report .photos img { width: 118px; height: 118px; }
  .report .sign { margin-top: 42px; break-inside: avoid; }
}
