/* ============================================================
   SIGEFOR — Sistema de diseño
   Paleta: azul corporativo, navy, acento cian "generado"
   Tipografía: Space Grotesk (display) · Inter (cuerpo) · JetBrains Mono (data)
   ============================================================ */

:root {
  /* Color */
  --ink:        #0A1A33;
  --ink-soft:   #14264a;
  --blue:       #1E50E5;
  --blue-deep:  #1638A8;
  --blue-tint:  #EAF0FF;
  --cyan:       #16C8C8;
  --cyan-deep:  #0E9AA0;
  --surface:    #FFFFFF;
  --bg:         #F4F7FC;
  --bg-2:       #EEF2FA;
  --slate:      #56688A;
  --slate-soft: #8294B3;
  --line:       #DCE4F0;
  --line-soft:  #E8EEF7;

  /* Semánticos (acciones CRUD) */
  --ok:    #16A34A;  --ok-bg:    #E7F6EC;
  --edit:  #B45309;  --edit-bg:  #FBF0DC;
  --del:   #DC2626;  --del-bg:   #FBE7E7;
  --warn:  #D97706;  --warn-bg:  #FDF1DF;
  --info:  #1E50E5;  --info-bg:  #EAF0FF;

  /* Tipografía */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radios y sombras */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(10,26,51,.06), 0 1px 3px rgba(10,26,51,.05);
  --shadow:    0 8px 24px rgba(16,40,90,.08);
  --shadow-lg: 0 24px 60px rgba(16,40,90,.16);

  --container: 1180px;
  --nav-h: 70px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, white); outline-offset: 2px; border-radius: 4px; }

/* ---------- Tipografía base ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.02em; font-weight: 600; }
.display { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 600; letter-spacing: -.035em; }
.h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--slate); }
.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .76rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--cyan-deep);
  display: inline-flex; align-items: center; gap: .55rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--cyan); border-radius: 2px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.center { text-align: center; }
.muted { color: var(--slate); }
.stack-sm > * + * { margin-top: .6rem; }

/* ============================================================
   NAVEGACIÓN
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; letter-spacing: -.02em; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--blue); }

.nav__links { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav__links a {
  padding: 9px 13px; border-radius: var(--r-sm); font-size: .94rem; font-weight: 500;
  color: var(--slate); transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--ink); background: var(--bg-2); }
.nav__links a.is-active { color: var(--blue); background: var(--blue-tint); }

.nav__spacer { flex: 1; }
.nav__cta { display: inline-flex; gap: 10px; align-items: center; }

.nav__burger { display: none; width: 42px; height: 42px; border-radius: var(--r-sm); align-items: center; justify-content: center; color: var(--ink); }
.nav__burger:hover { background: var(--bg-2); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 11px 19px; border-radius: var(--r-sm); font-weight: 600; font-size: .94rem;
  border: 1px solid transparent; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(30,80,229,.28); }
.btn--primary:hover { background: var(--blue-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--slate-soft); }
.btn--light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.28); }
.btn--light:hover { background: rgba(255,255,255,.2); }
.btn--sm { padding: 8px 13px; font-size: .86rem; }
.btn--ok { background: var(--ok); color: #fff; }
.btn--ok:hover { filter: brightness(.94); }
.btn--lg { padding: 14px 26px; font-size: 1.02rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 520px at 78% -10%, rgba(22,200,200,.18), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(30,80,229,.16), transparent 55%),
    linear-gradient(180deg, #07142c 0%, #0A1A33 60%, #0c1f3e 100%);
  color: #fff;
}
/* Plano técnico de fondo (signature) */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(120% 100% at 60% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 100% at 60% 0%, #000 35%, transparent 78%);
  pointer-events: none;
}
.hero__inner { position: relative; padding-block: clamp(64px, 9vw, 108px); display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero .eyebrow { color: var(--cyan); }
.hero .eyebrow::before { background: var(--cyan); }
.hero .display { color: #fff; }
.hero__sub { color: #C5D2EA; max-width: 36ch; margin-top: 18px; font-size: 1.12rem; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero__trust { margin-top: 30px; display: flex; gap: 26px; flex-wrap: wrap; color: #93A6C9; font-size: .86rem; }
.hero__trust b { color: #fff; font-family: var(--font-display); font-size: 1.5rem; display: block; line-height: 1; }

/* Demo "metadata -> interfaz" del hero */
.gencard {
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; backdrop-filter: blur(6px);
}
.gencard__head { display: flex; align-items: center; gap: 8px; padding: 11px 15px; border-bottom: 1px solid rgba(255,255,255,.1); font-family: var(--font-mono); font-size: .76rem; color: #9fb2d6; }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.genbody { display: grid; grid-template-columns: 1fr; }
.genbody__def {
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.7; color: #cfe0ff;
  padding: 16px 18px; background: rgba(7,18,40,.5);
}
.genbody__def .k { color: var(--cyan); }
.genbody__def .s { color: #ffd479; }
.genbody__def .c { color: #6f86b0; }
.genflow { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; color: var(--cyan); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.genflow svg { width: 16px; height: 16px; }
.genout { background: #fff; color: var(--ink); padding: 16px; }
.genout__row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 9px; font-size: .82rem; }
.genout__row:last-child { margin-bottom: 0; }
.genout__row label { font-size: .68rem; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; flex: none; width: 78px; }
.genout__row .fld { flex: 1; height: 26px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.genout__row .pill { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
.section-head { max-width: 620px; }
.section-head.center { margin-inline: auto; }
.section-head .h2 { margin-top: 14px; }
.section-head p { margin-top: 14px; }

/* "¿Qué es?" split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.qcard + .qcard { margin-top: 16px; }
.qcard h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.qcard p { color: var(--slate); margin-top: 8px; font-size: .96rem; }
.qcard .ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); }
.qcard .ic svg { width: 20px; height: 20px; }

/* Características (grid de tarjetas con icono) */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.feature__ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; margin-bottom: 16px; }
.feature__ic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.06rem; }
.feature p { color: var(--slate); font-size: .92rem; margin-top: 7px; }

/* "Cómo funciona" (pasos numerados — secuencia real) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--shadow-sm); }
.step__n { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--cyan-deep); letter-spacing: .12em; }
.step h3 { margin-top: 12px; font-size: 1.18rem; }
.step p { color: var(--slate); margin-top: 9px; font-size: .94rem; }
.step__bar { position: absolute; left: 0; top: 28px; bottom: 28px; width: 3px; border-radius: 3px; background: linear-gradient(var(--blue), var(--cyan)); }

/* Casos de uso */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.case { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.case .ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--cyan-deep); color: #fff; }
.case .ic svg { width: 19px; height: 19px; }
.case b { font-family: var(--font-display); font-size: 1rem; }
.case p { color: var(--slate); font-size: .88rem; margin-top: 2px; }

/* Banda CTA */
.ctaband {
  background:
    radial-gradient(700px 300px at 85% 20%, rgba(22,200,200,.22), transparent 60%),
    linear-gradient(120deg, var(--blue-deep), var(--blue));
  color: #fff; border-radius: var(--r-xl); padding: clamp(36px, 6vw, 60px);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.ctaband::after { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 34px 34px; -webkit-mask-image: radial-gradient(80% 120% at 100% 0%, #000, transparent 70%); mask-image: radial-gradient(80% 120% at 100% 0%, #000, transparent 70%); pointer-events:none; }
.ctaband h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); position: relative; }
.ctaband p { color: #d6e2ff; margin-top: 8px; position: relative; }
.ctaband .hero__actions { position: relative; margin-top: 0; }

/* ============================================================
   ENCABEZADO DE PÁGINAS DE EJEMPLO
   ============================================================ */
.pagehead { background: linear-gradient(180deg, #07142c, #0A1A33); color: #fff; position: relative; overflow: hidden; }
.pagehead::before { content:""; position:absolute; inset:0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: radial-gradient(120% 120% at 80% 0%, #000 40%, transparent 80%); mask-image: radial-gradient(120% 120% at 80% 0%, #000 40%, transparent 80%); }
.pagehead__inner { position: relative; padding-block: clamp(40px, 6vw, 64px); }
.pagehead .eyebrow { color: var(--cyan); } .pagehead .eyebrow::before { background: var(--cyan); }
.pagehead h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: 12px; }
.pagehead p { color: #C5D2EA; max-width: 60ch; margin-top: 12px; }
.crumb { font-family: var(--font-mono); font-size: .78rem; color: #8aa0c8; }
.crumb a:hover { color: #fff; }

/* Tarjeta "cómo lo genera Sigefor" (definición metadata) */
.genexplain { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.genexplain__code { background: #0A1A33; color: #cfe0ff; padding: 22px 24px; font-family: var(--font-mono); font-size: .82rem; line-height: 1.75; overflow-x: auto; }
.genexplain__code .k { color: var(--cyan); } .genexplain__code .s { color: #ffd479; } .genexplain__code .c { color: #6f86b0; } .genexplain__code .p { color: #ff9eb0; }
.genexplain__txt { padding: 24px 26px; }
.genexplain__txt h3 { font-size: 1.12rem; }
.genexplain__txt p { color: var(--slate); margin-top: 10px; font-size: .94rem; }
.genexplain__txt .tag { display:inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: .72rem; color: var(--cyan-deep); background: var(--blue-tint); padding: 5px 11px; border-radius: 999px; }

/* ============================================================
   PANEL / TOOLBAR / GRID (CRUD)
   ============================================================ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.toolbar .grow { flex: 1; min-width: 180px; }
.search { display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 13px; }
.search svg { width: 18px; height: 18px; color: var(--slate); flex: none; }
.search input { border: none; background: none; width: 100%; outline: none; font-size: .94rem; }
.field-select { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 32px 9px 13px; font-size: .9rem; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2356688A' stroke-width='2' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }

.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.filterbar .lbl { font-size: .8rem; font-weight: 600; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; }
.filterbar .lbl svg { width: 16px; height: 16px; }

.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 760px; }
table.grid thead th {
  text-align: left; font-family: var(--font-display); font-weight: 600; font-size: .82rem;
  color: var(--slate); text-transform: uppercase; letter-spacing: .04em;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2);
  position: sticky; top: 0; cursor: pointer; user-select: none; white-space: nowrap;
}
table.grid thead th .sortic { opacity: .35; margin-left: 4px; }
table.grid thead th.sorted .sortic { opacity: 1; color: var(--blue); }
table.grid thead th.nosort { cursor: default; }
table.grid tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.grid tbody tr { transition: background .12s; }
table.grid tbody tr:hover { background: var(--blue-tint); }
table.grid tbody tr.is-sel { background: color-mix(in srgb, var(--cyan) 12%, white); }
table.grid .code { font-family: var(--font-mono); font-size: .85rem; color: var(--slate); }
table.grid .prod { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.low-stock { color: var(--del); font-weight: 700; }

.checkbox { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--del { color: var(--del); background: var(--del-bg); }
.badge--info { color: var(--info); background: var(--info-bg); }

.rowact { display: flex; gap: 6px; justify-content: flex-end; }
.iconbtn { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; border: 1px solid var(--line); color: var(--slate); background: var(--surface); transition: all .14s; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn--edit:hover { color: var(--edit); border-color: var(--edit); background: var(--edit-bg); }
.iconbtn--del:hover  { color: var(--del);  border-color: var(--del);  background: var(--del-bg); }

.gridfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.gridfoot .info { font-size: .86rem; color: var(--slate); }
.pager { display: flex; gap: 6px; }
.pager button { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--slate); }
.pager button.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager button:hover:not(.is-active) { background: var(--bg-2); }

.empty { padding: 48px 20px; text-align: center; color: var(--slate); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--slate-soft); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg { position: fixed; inset: 0; background: rgba(10,26,51,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.modal-bg.is-open { display: flex; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal__head h3 { font-size: 1.2rem; }
.modal__body { padding: 22px; display: grid; gap: 16px; }
.modal__foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg); }
.xclose { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--slate); }
.xclose:hover { background: var(--bg-2); }

/* ============================================================
   FORMULARIOS (Incidencias)
   ============================================================ */
.form-shell { display: grid; grid-template-columns: 1fr; gap: 22px; }
.formcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.formcard__head { padding: 18px 24px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.formcard__head .step-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: .82rem; }
.formcard__head h3 { font-size: 1.12rem; }
.formcard__body { padding: 24px; }

.fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.col-2 { grid-column: span 2; }
.field > label { font-size: .86rem; font-weight: 600; }
.field .req { color: var(--del); }
.field .hint { font-size: .78rem; color: var(--slate); }
.control {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); font-size: .95rem; transition: border-color .14s, box-shadow .14s, background .14s;
}
.control:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px var(--blue-tint); }
textarea.control { resize: vertical; min-height: 120px; line-height: 1.6; }
select.control { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2356688A' stroke-width='2' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.field.invalid .control { border-color: var(--del); background: #fff; }
.field.invalid .control:focus { box-shadow: 0 0 0 4px var(--del-bg); }
.err { font-size: .78rem; color: var(--del); font-weight: 600; display: none; align-items: center; gap: 5px; }
.err svg { width: 14px; height: 14px; }
.field.invalid .err { display: flex; }

/* radios prioridad */
.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radiopill { position: relative; }
.radiopill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radiopill span { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--slate); transition: all .14s; }
.radiopill span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.radiopill input:checked + span { color: #fff; }
.radiopill[data-p="baja"]  input:checked + span { background: var(--ok);   border-color: var(--ok); }
.radiopill[data-p="media"] input:checked + span { background: var(--warn); border-color: var(--warn); }
.radiopill[data-p="alta"]  input:checked + span { background: var(--del);  border-color: var(--del); }
.radiopill input:focus-visible + span { box-shadow: 0 0 0 4px var(--blue-tint); }

/* dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: var(--r); padding: 26px; text-align: center; background: var(--bg); transition: all .15s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-tint); }
.dropzone svg { width: 34px; height: 34px; color: var(--blue); margin: 0 auto 10px; }
.dropzone b { font-size: .95rem; }
.dropzone p { font-size: .82rem; color: var(--slate); margin-top: 4px; }
.filelist { list-style: none; margin-top: 14px; display: grid; gap: 8px; padding: 0; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: .88rem; background: #fff; }
.filelist li svg { width: 18px; height: 18px; color: var(--blue); flex: none; }
.filelist li .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist li .fsize { color: var(--slate); font-size: .8rem; font-variant-numeric: tabular-nums; }
.filelist li .x { color: var(--slate); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; }
.filelist li .x:hover { background: var(--del-bg); color: var(--del); }

.checkrow { display: flex; align-items: flex-start; gap: 10px; }
.checkrow input { margin-top: 3px; }
.checkrow label { font-size: .9rem; color: var(--slate); }

.formfoot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 24px; border-top: 1px solid var(--line-soft); background: var(--bg); flex-wrap: wrap; }
.formfoot .req-note { font-size: .82rem; color: var(--slate); }

.form-success { display: none; text-align: center; padding: 40px 24px; }
.form-success.show { display: block; animation: pop .25s ease; }
.form-success .ok-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.form-success .ok-ic svg { width: 34px; height: 34px; }
.form-success h3 { font-size: 1.4rem; }
.form-success p { color: var(--slate); margin-top: 8px; }
.form-success .ticket { font-family: var(--font-mono); font-weight: 700; color: var(--blue); }

/* aside resumen del form */
.aside-tips { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.aside-tips h4 { font-family: var(--font-display); font-size: 1rem; }
.aside-tips ul { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 10px; }
.aside-tips li { display: flex; gap: 9px; font-size: .88rem; color: var(--slate); }
.aside-tips li svg { width: 18px; height: 18px; color: var(--cyan-deep); flex: none; margin-top: 1px; }

/* ============================================================
   DASHBOARD / MAPA
   ============================================================ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.kpi__ic svg { width: 21px; height: 21px; }
.kpi__ic.b { background: var(--blue-tint); color: var(--blue); }
.kpi__ic.c { background: #def7f7; color: var(--cyan-deep); }
.kpi__ic.o { background: var(--warn-bg); color: var(--warn); }
.kpi__ic.g { background: var(--ok-bg); color: var(--ok); }
.kpi__val { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; letter-spacing: -.03em; margin-top: 14px; font-variant-numeric: tabular-nums; }
.kpi__lbl { color: var(--slate); font-size: .88rem; }
.kpi__delta { font-size: .78rem; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.kpi__delta svg { width: 13px; height: 13px; }
.kpi__delta.up { color: var(--ok); } .kpi__delta.down { color: var(--del); }

.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; margin-top: 20px; }
.mapcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.cardhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); gap: 12px; flex-wrap: wrap; }
.cardhead h3 { font-size: 1.06rem; }
.cardhead .tabset { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: var(--r-sm); }
.cardhead .tabset button { font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 6px; color: var(--slate); }
.cardhead .tabset button.is-active { background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }

/* placeholder de mapa (Mapbox / Google Maps) */
.mapph { position: relative; height: 440px; background:
    radial-gradient(120% 120% at 30% 20%, #163a6b, transparent 60%),
    linear-gradient(160deg, #0e2a52, #0A1A33);
  overflow: hidden; }
.mapph::before { content:""; position:absolute; inset:0; background-image:
    linear-gradient(rgba(120,170,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,170,255,.12) 1px, transparent 1px);
  background-size: 48px 48px; }
.mapph__land { position: absolute; inset: 0; opacity: .5; }
.mapph__note { position: absolute; left: 16px; bottom: 14px; font-family: var(--font-mono); font-size: .72rem; color: #9fb6dd; background: rgba(10,26,51,.6); border: 1px solid rgba(255,255,255,.14); padding: 6px 11px; border-radius: 8px; display: flex; align-items: center; gap: 7px; }
.mapph__note svg { width: 14px; height: 14px; }
.marker { position: absolute; transform: translate(-50%, -100%); cursor: pointer; }
.marker__pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.marker__pin span { transform: rotate(45deg); color: #fff; font-size: .68rem; font-weight: 800; }
.marker--ok  .marker__pin { background: var(--ok); }
.marker--warn .marker__pin { background: var(--warn); }
.marker--del  .marker__pin { background: var(--del); }
.marker::after { content: ""; position: absolute; left: 50%; top: 0; width: 40px; height: 40px; transform: translate(-50%,-50%); border-radius: 50%; background: currentColor; opacity: .25; animation: pulse 2.4s infinite ease-out; }
.marker--ok { color: var(--ok);} .marker--warn{color:var(--warn);} .marker--del{color:var(--del);}
@keyframes pulse { 0% { transform: translate(-50%,-50%) scale(.4); opacity:.4; } 100% { transform: translate(-50%,-50%) scale(1.6); opacity:0; } }
.maplegend { display: flex; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.maplegend span { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--slate); }
.maplegend i { width: 11px; height: 11px; border-radius: 50%; }

/* panel lateral dashboard */
.sidecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.region { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.region:last-child { border-bottom: none; }
.region__top { display: flex; justify-content: space-between; align-items: baseline; }
.region__top b { font-size: .94rem; }
.region__top .v { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .86rem; color: var(--slate); }
.bar { height: 8px; border-radius: 999px; background: var(--bg-2); margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
/* mini barras */
.barchart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 16px 20px 8px; }
.barchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart .col .b { width: 100%; max-width: 42px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--blue), var(--cyan)); transition: height .6s ease; }
.barchart .col small { font-size: .72rem; color: var(--slate); font-family: var(--font-mono); }
.donutwrap { display: flex; align-items: center; gap: 22px; padding: 20px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut .hole { width: 96px; height: 96px; background: var(--surface); border-radius: 50%; display: grid; place-items: center; text-align: center; }
.donut .hole b { font-family: var(--font-display); font-size: 1.5rem; }
.donut .hole small { color: var(--slate); font-size: .72rem; }
.legend2 { display: grid; gap: 10px; }
.legend2 div { display: flex; align-items: center; gap: 9px; font-size: .88rem; }
.legend2 i { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); color: #C5D2EA; margin-top: 0; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-block: 54px; }
.footer .brand { color: #fff; } .footer .brand b { color: var(--cyan); }
.footer p { font-size: .9rem; margin-top: 14px; max-width: 34ch; color: #8aa0c8; }
.footer h5 { font-family: var(--font-display); color: #fff; font-size: .9rem; letter-spacing: .02em; margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer a { font-size: .9rem; color: #93A6C9; }
.footer a:hover { color: #fff; }
.footer__bar { border-top: 1px solid rgba(255,255,255,.1); padding-block: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: #6f86b0; }
.footer__bar .mono { color: #8aa0c8; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .split { grid-template-columns: 1fr; gap: 30px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps, .cases { grid-template-columns: 1fr; }
  .genexplain { grid-template-columns: 1fr; }
  .dash-grid, .dash-bottom { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}
@media (max-width: 760px) {
  .nav__links, .nav__cta .btn--ghost { display: none; }
  .nav__burger { display: flex; }
  .nav.is-open .nav__links {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 18px; box-shadow: var(--shadow); margin: 0;
  }
  .nav.is-open .nav__links a { padding: 12px 14px; }
  .fgrid { grid-template-columns: 1fr; }
  .field.col-2 { grid-column: auto; }
  .ctaband { flex-direction: column; align-items: flex-start; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .kpis { grid-template-columns: 1fr; }
  .hero__trust { gap: 18px; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
