/* =====================================================================
   R.I.J Security — sistema de diseño
   Idea: "centro de monitoreo". Sobrio, mucho aire, el azul marino es la
   marca y el dorado es solo un acento (botones clave, estados activos).

   Se carga DESPUÉS de Bootstrap. Las clases propias están en español
   (.boton, .tarjeta, .tabla...) para no chocar con las de Bootstrap.

   1. Variables          5. Tablas y estados        9. Sitio público
   2. Base y tipografía  6. Estructura del panel   10. Login y páginas sueltas
   3. Botones            7. Panel: piezas          11. Movimiento
   4. Formularios        8. Diálogos y avisos      12. Responsive e impresión
   ===================================================================== */

/* ---------- 1. Variables -------------------------------------------- */
:root {
  /* Marca (sección 8.1) */
  --navy-950: #060c18;
  --navy-900: #0a1428;
  --navy-800: #0f1d3a;
  --navy-700: #16284d;
  --navy: #0b1b3a;
  --gold: #c9a04e;
  --gold-600: #b8893a;
  --gold-300: #e6c886;
  --gold-50: #fbf6ea;
  --sand: #f6efdf;

  /* Superficies del panel (claro) */
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #f2f1ed;
  --line: #e9e6e0;
  --line-2: #dbd7cf;
  --text: #111827;
  --text-2: #4f5867;
  --text-3: #8a919e;

  /* Señales */
  --ok: #1d8a58;        --ok-bg: #e9f6ef;
  --danger: #c2372b;    --danger-bg: #fcefed;
  --warn: #a8650d;      --warn-bg: #fdf3e3;
  --info: #2462a6;      --info-bg: #eaf2fb;
  --muted-bg: #f0efeb;

  /* Forma */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-2: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -8px rgba(16, 24, 40, .12);
  --sombra-3: 0 30px 60px -20px rgba(6, 12, 24, .35);
  --anillo: 0 0 0 3px rgba(201, 160, 78, .28);

  /* Tipografía: todas alojadas en el proyecto (funciona sin internet) */
  --f-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --f-ui: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, Consolas, monospace;

  /* Movimiento (skill motion-design: curvas y duraciones) */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 240ms;
  --dur-4: 300ms;
  --dur-5: 500ms;
  --ease-out-quad: cubic-bezier(.25, .46, .45, .94);
  --ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
  --ease-out-quart: cubic-bezier(.165, .84, .44, 1);
  --ease-out-expo: cubic-bezier(.19, 1, .22, 1);
  --ease-in-out-cubic: cubic-bezier(.645, .045, .355, 1);

  color-scheme: light;
}

/* Modo oscuro del panel: por preferencia del sistema o a mano */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #0a0f1b;
    --surface: #101828;
    --surface-2: #141e31;
    --surface-3: #18233a;
    --line: #1e2a42;
    --line-2: #2a3854;
    --text: #e9edf4;
    --text-2: #a5afc2;
    --text-3: #6e7a91;
    --ok-bg: rgba(29, 138, 88, .16);       --ok: #4cc48c;
    --danger-bg: rgba(194, 55, 43, .18);   --danger: #f07a6f;
    --warn-bg: rgba(168, 101, 13, .2);     --warn: #e6ad55;
    --info-bg: rgba(36, 98, 166, .22);     --info: #7db3ec;
    --muted-bg: #1a2439;
    --gold-50: rgba(201, 160, 78, .12);
    --sombra-1: 0 1px 2px rgba(0, 0, 0, .3);
    --sombra-2: 0 10px 30px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-tema="oscuro"] {
  --bg: #0a0f1b;
  --surface: #101828;
  --surface-2: #141e31;
  --surface-3: #18233a;
  --line: #1e2a42;
  --line-2: #2a3854;
  --text: #e9edf4;
  --text-2: #a5afc2;
  --text-3: #6e7a91;
  --ok-bg: rgba(29, 138, 88, .16);       --ok: #4cc48c;
  --danger-bg: rgba(194, 55, 43, .18);   --danger: #f07a6f;
  --warn-bg: rgba(168, 101, 13, .2);     --warn: #e6ad55;
  --info-bg: rgba(36, 98, 166, .22);     --info: #7db3ec;
  --muted-bg: #1a2439;
  --gold-50: rgba(201, 160, 78, .12);
  --sombra-1: 0 1px 2px rgba(0, 0, 0, .3);
  --sombra-2: 0 10px 30px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* Bootstrap toma estos valores en vez de los suyos */
:root {
  --bs-body-font-family: var(--f-ui);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color: var(--text);
  --bs-link-hover-color: var(--gold-600);
  --bs-primary: var(--navy);
  --bs-primary-rgb: 11, 27, 58;
}

/* ---------- 2. Base y tipografía ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

h1, h2, h3, h4 {
  margin: 0 0 .4em;
  color: var(--text);
  font-family: var(--f-ui);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

/* Títulos grandes en serif (sección 8.2: títulos con serif) */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.05;
}

.display em { font-style: italic; color: var(--gold); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-600); }

.enlace { color: var(--text); font-weight: 500; }
.enlace:hover { color: var(--gold-600); text-decoration: underline; text-underline-offset: 3px; }

.mono, .monto, .num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.monto { white-space: nowrap; }

.t2 { color: var(--text-2); }
.t3 { color: var(--text-3); }
.chico { font-size: 12.5px; }
.ok { color: var(--ok); }
.peligro { color: var(--danger); }
.oro { color: var(--gold-600); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-600);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: inset 0 -1px 0 var(--line-2);
}

code {
  font-family: var(--f-mono);
  font-size: .9em;
  color: var(--text);
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 5px;
}

::selection { background: rgba(201, 160, 78, .3); }

.solo-lectores {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 2000;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: var(--navy-950);
  font-weight: 600;
}

.saltar:focus { left: 8px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Marca (logo vectorial) ---------------------------------- */
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.marca:hover { color: inherit; }
.marca img { width: 34px; height: 34px; flex: none; }

.marca-texto { display: flex; flex-direction: column; line-height: 1; }

.marca-texto b {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: .03em;
}

.marca-texto small {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .34em;
  color: var(--gold);
}

/* ---------- 3. Botones ---------------------------------------------- */
.boton {
  --b-bg: var(--surface);
  --b-fg: var(--text);
  --b-borde: var(--line-2);
  --b-bg-hover: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--b-borde);
  border-radius: var(--r-sm);
  background: var(--b-bg);
  color: var(--b-fg);
  font: 500 14px/1 var(--f-ui);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--sombra-1);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
              transform var(--dur-1) var(--ease-out-quad);
}

.boton i { font-size: 15px; }

@media (hover: hover) {
  .boton:hover { background: var(--b-bg-hover); color: var(--b-fg); }
}

.boton:active { transform: scale(.97); }
.boton[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.boton-primario {
  --b-bg: var(--navy);
  --b-fg: #fff;
  --b-borde: var(--navy);
  --b-bg-hover: var(--navy-700);
}

.boton-oro {
  --b-bg: var(--gold);
  --b-fg: #1a1205;
  --b-borde: var(--gold);
  --b-bg-hover: var(--gold-300);
}

.boton-fantasma {
  --b-bg: transparent;
  --b-borde: transparent;
  --b-bg-hover: var(--surface-3);
  box-shadow: none;
}

.boton-peligro {
  --b-bg: var(--danger);
  --b-fg: #fff;
  --b-borde: var(--danger);
  --b-bg-hover: #a82d23;
}

.boton-peligro-suave {
  --b-bg: transparent;
  --b-fg: var(--danger);
  --b-borde: transparent;
  --b-bg-hover: var(--danger-bg);
  box-shadow: none;
}

.boton-sm { height: 32px; padding: 0 10px; font-size: 13px; gap: 6px; }
.boton-sm i { font-size: 14px; }
.boton-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 10px; }

.boton-icono { width: 32px; height: 32px; padding: 0; }
.boton-icono.boton-sm { width: 30px; height: 30px; }

/* En oscuro el botón primario se invierte para no perderse en el fondo */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .boton-primario {
    --b-bg: #eef1f6; --b-fg: var(--navy-900); --b-borde: #eef1f6; --b-bg-hover: #fff;
  }
}

:root[data-tema="oscuro"] .boton-primario {
  --b-bg: #eef1f6; --b-fg: var(--navy-900); --b-borde: #eef1f6; --b-bg-hover: #fff;
}

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- 4. Formularios ------------------------------------------ */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; min-width: 0; }

.campo > label,
.etiqueta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.obligatorio { color: var(--danger); margin-left: 2px; }

.control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: 400 14px var(--f-ui);
  box-shadow: var(--sombra-1);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  appearance: none;
}

textarea.control { height: auto; min-height: 104px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

select.control {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%238a919e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.control::placeholder { color: var(--text-3); }
.control:hover { border-color: var(--text-3); }

.control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--anillo);
}

.control[readonly] { background: var(--surface-2); color: var(--text-2); }

.ayuda { font-size: 12.5px; color: var(--text-3); }

/* El error va debajo del campo (sección 7.1) */
.error-campo {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
  animation: error-entra var(--dur-2) var(--ease-out-cubic);
}

.error-campo i { margin-top: 1px; }

.campo.con-error .control {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(194, 55, 43, .12);
}

@keyframes error-entra {
  from { opacity: 0; transform: translateY(-3px); }
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.rejilla .completo { grid-column: 1 / -1; }

.seccion-form {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.seccion-form:first-child { border-top: 0; padding-top: 4px; }
.seccion-form h2 { font-size: 14.5px; margin-bottom: 4px; }
.seccion-form p { font-size: 13px; color: var(--text-3); }

.pie-form {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Buscador con lupa */
.buscador { position: relative; }
.buscador i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.buscador .control { padding-left: 36px; }

/* ---------- 5. Tablas y estados ------------------------------------- */
.tarjeta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sombra-1);
}

.tarjeta-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.tarjeta-cab h2 { margin: 0; font-size: 14.5px; }
.tarjeta-cab .chico { color: var(--text-3); }
.tarjeta-cuerpo { padding: 20px; }

.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tabla {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

/* Encabezado azul marino (sección 8.2), en versión sobria */
.tabla thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 16px;
  background: var(--navy);
  color: rgba(255, 255, 255, .78);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.tabla thead th:first-child { border-top-left-radius: calc(var(--r) - 1px); }
.tabla thead th:last-child { border-top-right-radius: calc(var(--r) - 1px); }
.tarjeta > .tabla-scroll:not(:first-child) .tabla thead th { border-radius: 0; }

.tabla thead th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tabla thead th a:hover { color: #fff; }
.tabla thead th a i { font-size: 10px; opacity: .5; }
.tabla thead th a.activo { color: var(--gold-300); }
.tabla thead th a.activo i { opacity: 1; }

.tabla tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.tabla tbody tr:last-child td { border-bottom: 0; }

/* Filas alternadas en arena muy suave (sección 8.2) */
.tabla tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--sand) 35%, var(--surface)); }

.tabla tbody tr { transition: background-color var(--dur-1) ease; }
.tabla tbody tr:hover td { background: var(--surface-3); }

.tabla .der { text-align: right; }
.tabla .cen { text-align: center; }
.tabla .min { width: 1%; white-space: nowrap; }
.tabla .titulo-fila { font-weight: 500; color: var(--text); }
.tabla .titulo-fila:hover { color: var(--gold-600); }
.tabla .sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.tabla tr.alerta td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* Acciones de la fila: discretas hasta que se pasa el mouse */
.fila-acciones { display: flex; justify-content: flex-end; gap: 2px; }

@media (hover: hover) {
  .fila-acciones .boton { opacity: .55; transition: opacity 150ms ease, background-color 150ms ease; }
  .tabla tbody tr:hover .fila-acciones .boton,
  .fila-acciones .boton:focus-visible { opacity: 1; }
}

.tabla tfoot td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 600;
}

/* Estado: punto de color + texto */
.estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--muted-bg);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.estado::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.estado-ok     { background: var(--ok-bg);     color: var(--ok); }
.estado-danger { background: var(--danger-bg); color: var(--danger); }
.estado-warn   { background: var(--warn-bg);   color: var(--warn); }
.estado-info   { background: var(--info-bg);   color: var(--info); }
.estado-gold   { background: var(--gold-50);   color: var(--gold-600); }
.estado-navy   { background: var(--info-bg);   color: var(--info); }
.estado-muted  { background: var(--muted-bg);  color: var(--text-2); }

/* Etiqueta neutra (tipo de cliente, categoría) */
.etiqueta-suave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
}

.etiqueta-suave i { color: var(--text-3); }

/* Stock con barra mínima */
.stock { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); }
.stock .pista { width: 42px; height: 4px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.stock .pista span { display: block; height: 100%; border-radius: 9px; background: var(--ok); }
.stock.medio .pista span { background: var(--warn); }
.stock.bajo { color: var(--danger); font-weight: 600; }
.stock.bajo .pista span { background: var(--danger); }

.vacio {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}

.vacio i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--surface-3);
  font-size: 20px;
  color: var(--text-2);
}

.vacio p { margin-bottom: 14px; }

.paginado {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}

.paginado nav { display: flex; gap: 4px; }

.paginado a,
.paginado span.actual {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 500;
}

.paginado a:hover { background: var(--surface-3); color: var(--text); }
.paginado span.actual { background: var(--navy); color: #fff; }

/* ---------- 6. Estructura del panel --------------------------------- */
.panel {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.lateral {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy-900);
  color: #c4ccdb;
  border-right: 1px solid rgba(255, 255, 255, .04);
  view-transition-name: lateral;
}

.lateral-marca {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  color: #fff;
}

.lateral nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .12) transparent;
}

.nav-grupo {
  padding: 18px 10px 6px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5e6b85;
}

.nav-enlace {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #b4bdcf;
  font-size: 14px;
  font-weight: 450;
  transition: background-color 150ms ease, color 150ms ease;
}

.nav-enlace i { font-size: 16px; color: #6f7c96; transition: color 150ms ease; }
.nav-enlace:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-enlace:hover i { color: #c4ccdb; }

.nav-enlace.activo { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 500; }
.nav-enlace.activo i { color: var(--gold); }

.nav-enlace.activo::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.nav-cuenta {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #c4ccdb;
  font: 500 11px/20px var(--f-mono);
  text-align: center;
}

.nav-cuenta.oro { background: var(--gold); color: var(--navy-950); }
.nav-cuenta.rojo { background: rgba(240, 122, 111, .18); color: #f39a91; }

.lateral-pie {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  font-size: 12px;
  color: #8592ab;
}

.lateral-pie a { color: #c4ccdb; display: flex; align-items: center; gap: 8px; }
.lateral-pie a:hover { color: #fff; }

.estado-sistema {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #6f7c96;
}

.punto-vivo {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 0 0 rgba(62, 207, 142, .6);
  animation: pulso 2.4s var(--ease-out-quart) infinite;
}

@keyframes pulso {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 142, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

.contenido { display: flex; flex-direction: column; min-width: 0; }

.barra {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.migas { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--text-3); }
.migas a:hover { color: var(--text); }
.migas .sep { color: var(--line-2); }
.migas .actual { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.barra-derecha { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.boton-buscar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 240px;
  height: 36px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-3);
  font: 400 13.5px var(--f-ui);
  cursor: pointer;
  transition: border-color 150ms ease;
}

.boton-buscar:hover { border-color: var(--text-3); }
.boton-buscar kbd { margin-left: auto; }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-300);
  font: 600 12px var(--f-mono);
  flex: none;
}

.menu-usuario { position: relative; }

.menu-usuario > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease;
}

.menu-usuario > summary::-webkit-details-marker { display: none; }
.menu-usuario > summary:hover { background: var(--surface-3); }
.menu-usuario > summary .nombre { font-size: 13.5px; font-weight: 500; }

.menu-usuario .desplegable {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sombra-2);
  transform-origin: top right;
  animation: desplegar var(--dur-2) var(--ease-out-quart);
}

@keyframes desplegar {
  from { opacity: 0; transform: scale(.96) translateY(-4px); }
}

.desplegable .cabeza { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.desplegable .cabeza b { display: block; font-size: 13.5px; }
.desplegable .cabeza span { font-size: 12px; color: var(--text-3); }

.desplegable a,
.desplegable button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font: 400 13.5px var(--f-ui);
  text-align: left;
  cursor: pointer;
}

.desplegable a:hover,
.desplegable button:hover { background: var(--surface-3); color: var(--text); }
.desplegable i { color: var(--text-3); font-size: 15px; }

.abrir-menu { display: none; }

.cuerpo {
  width: 100%;
  max-width: 1280px;
  padding: 32px 32px 64px;
}

/* Encabezado de cada página */
.cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.cabecera h1 {
  margin: 0;
  font-family: var(--f-display);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1;
}

.cabecera .descripcion { margin: 8px 0 0; color: var(--text-2); font-size: 14.5px; }
.cabecera .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; color: var(--text-3); font-size: 13.5px; }

/* Barra de herramientas de las listas */
.herramientas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.herramientas .buscador { flex: 1 1 260px; max-width: 360px; }
.herramientas .control { height: 36px; font-size: 13.5px; }
.herramientas select.control { width: auto; min-width: 150px; }
.herramientas .resumen { margin-left: auto; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.herramientas .resumen b { color: var(--text); font-weight: 600; }

/* Pestañas de estado (control segmentado) */
.segmento {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
  gap: 2px;
  overflow-x: auto;
  max-width: 100%;
}

.segmento a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}

.segmento a:hover { color: var(--text); }
.segmento a.activo { background: var(--surface); color: var(--text); box-shadow: var(--sombra-1); }
.segmento .n { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-3); }

/* ---------- 7. Panel: piezas ---------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sombra-1);
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.kpi:hover { color: inherit; border-color: var(--line-2); box-shadow: var(--sombra-2); }

.kpi-cab { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); font-weight: 500; }

.kpi-icono {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 15px;
}

.kpi.alerta .kpi-icono { background: var(--danger-bg); color: var(--danger); }
.kpi.destacado .kpi-icono { background: var(--gold-50); color: var(--gold-600); }

/* La flecha se mueve, la tarjeta no (no se mueve lo que está bajo el mouse) */
.kpi-flecha {
  margin-left: auto;
  color: var(--text-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--dur-2) var(--ease-out-quart), transform var(--dur-2) var(--ease-out-quart);
}

.kpi:hover .kpi-flecha { opacity: 1; transform: none; }

.kpi-valor {
  font-family: var(--f-ui);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-valor .moneda { margin-right: 4px; font-size: 15px; font-weight: 500; color: var(--text-3); }
.kpi.alerta .kpi-valor { color: var(--danger); }
.kpi-pie { font-size: 12.5px; color: var(--text-3); }

.rejilla-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.rejilla-2 + .rejilla-2 { margin-top: 16px; }
.columna-apilada { display: grid; gap: 16px; }

.grafico { position: relative; height: 280px; padding: 16px 20px 20px; }

.lista { display: flex; flex-direction: column; }

.lista-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: inherit;
  transition: background-color var(--dur-1) ease;
}

.lista-item:first-child { border-top: 0; }
a.lista-item:hover { background: var(--surface-2); color: inherit; }
.lista-item .principal { min-width: 0; flex: 1; }
.lista-item .principal b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-item .principal span { display: block; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-item .final { text-align: right; flex: none; }

.fecha-bloque {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  border-radius: 9px;
  background: var(--surface-3);
  line-height: 1;
  flex: none;
}

.fecha-bloque b { font-size: 16px; font-weight: 600; }
.fecha-bloque span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }

.aviso-banda {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  border-radius: var(--r);
  background: var(--gold-50);
  font-size: 14px;
}

.aviso-banda i { color: var(--gold-600); font-size: 17px; }
.aviso-banda a { margin-left: auto; font-weight: 500; white-space: nowrap; }

/* Datos clave de una ficha */
.datos { display: grid; gap: 14px; margin: 0; }
.datos div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.datos dt { font-size: 13px; font-weight: 400; color: var(--text-3); }
.datos dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

.cifras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.cifras div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.cifras div:first-child { border-left: 0; }
.cifras span { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.cifras b { display: block; font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nota-cascada {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}

.nota-cascada i { margin-top: 1px; }

/* Totales de venta y presupuesto */
.totales { display: grid; gap: 8px; width: min(340px, 100%); margin-left: auto; font-size: 14px; }
.totales div { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.totales .monto { color: var(--text); }
.totales .final {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
}

/* Detalle dinámico de la venta */
.detalle { width: 100%; border-collapse: collapse; }
.detalle th { padding: 0 8px 8px; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; }
.detalle td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.detalle tr.fila-detalle { animation: fila-entra var(--dur-3) var(--ease-out-quart); }
.detalle .numero-fila { width: 28px; color: var(--text-3); font-family: var(--f-mono); font-size: 12px; }
.detalle .col-cant { width: 110px; }
.detalle .col-monto { width: 112px; text-align: right; white-space: nowrap; }
.detalle select.control { min-width: 220px; }
.detalle .control { height: 36px; }
.aviso-stock { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-3); font-family: var(--f-mono); }
.aviso-stock.poco { color: var(--danger); }

@keyframes fila-entra { from { opacity: 0; transform: translateY(-4px); } }

/* Tablero de servicios */
.tablero {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}

.columna {
  border-radius: var(--r);
  background: var(--surface-3);
  padding: 6px;
  min-height: 160px;
  transition: background-color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}

.columna.encima { background: var(--gold-50); box-shadow: inset 0 0 0 1.5px var(--gold); }

.columna-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  font-size: 13px;
  font-weight: 600;
}

.columna-titulo .cuenta { margin-left: auto; font: 500 12px var(--f-mono); color: var(--text-3); }
.columna-cuerpo { display: flex; flex-direction: column; gap: 6px; min-height: 80px; }

.tarjeta-servicio {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--sombra-1);
  cursor: grab;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.tarjeta-servicio:hover { border-color: var(--line-2); box-shadow: var(--sombra-2); }
.tarjeta-servicio.arrastrando { opacity: .4; cursor: grabbing; }
.tarjeta-servicio .cliente { display: block; font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.tarjeta-servicio p { font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.tarjeta-servicio .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.tarjeta-servicio.atrasado { box-shadow: inset 3px 0 0 var(--danger), var(--sombra-1); }
.columna-vacia { padding: 20px 10px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* Pestañas de reportes */
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }

.pestanas a {
  position: relative;
  padding: 10px 14px 12px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.pestanas a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--dur-3) var(--ease-out-quart);
}

.pestanas a:hover { color: var(--text); }
.pestanas a.activo { color: var(--text); }
.pestanas a.activo::after { transform: scaleX(1); }

.reporte { margin-bottom: 40px; scroll-margin-top: 90px; }
.reporte-cab { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.reporte-cab h2 { margin: 0; font-size: 18px; }
.reporte-cab p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }

.barra-fina { height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; min-width: 80px; }
.barra-fina span { display: block; height: 100%; border-radius: 9px; background: var(--gold); transform-origin: left; animation: crecer var(--dur-5) var(--ease-out-quart) both; }
@keyframes crecer { from { transform: scaleX(0); } }

.grupo { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.grupo > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.grupo > summary::-webkit-details-marker { display: none; }
.grupo > summary .chev { margin-left: 8px; color: var(--text-3); transition: transform var(--dur-3) var(--ease-in-out-cubic); }
.grupo[open] > summary .chev { transform: rotate(180deg); }
.grupo[open] > summary { border-bottom: 1px solid var(--line); }
.grupo .resumen-grupo { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }

/* Solicitudes */
.solicitud { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 20px; border-top: 1px solid var(--line); }
.solicitud:first-child { border-top: 0; }
.solicitud.nueva { box-shadow: inset 3px 0 0 var(--gold); }
.solicitud h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; }
.solicitud .mensaje { margin: 10px 0 0; color: var(--text-2); max-width: 70ch; }
.solicitud .lado { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 200px; }

/* ---------- 8. Diálogos y avisos ------------------------------------ */
.avisos {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
}

.aviso {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sombra-2);
  font-size: 13.5px;
  overflow: hidden;
  animation: aviso-entra var(--dur-2) var(--ease-out-cubic);
}

.aviso.saliendo { animation: aviso-sale var(--dur-1) ease-in forwards; }
.aviso > i { font-size: 16px; margin-top: 1px; }
.aviso-ok > i     { color: var(--ok); }
.aviso-danger > i { color: var(--danger); }
.aviso-warn > i   { color: var(--warn); }
.aviso-info > i   { color: var(--info); }

.aviso .cerrar {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* Barra que muestra cuánto falta para que el aviso se cierre (tiempo = lineal) */
.aviso .tiempo {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: .25;
  transform-origin: left;
  animation: consumir 6s linear forwards;
}

.aviso-ok .tiempo { color: var(--ok); }
.aviso-warn .tiempo { color: var(--warn); }
.aviso-info .tiempo { color: var(--info); }

@keyframes aviso-entra { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes aviso-sale  { to { opacity: 0; transform: translateY(-6px); } }
@keyframes consumir    { to { transform: scaleX(0); } }

/* Cuadro de confirmación: popover nativo de HTML (se abre sin JS) */
[popover].dialogo {
  width: min(440px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sombra-3);
}

[popover].dialogo::backdrop { background: rgba(6, 12, 24, .45); backdrop-filter: blur(3px); }

.dialogo-cuerpo { padding: 24px; }

.dialogo-icono {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 18px;
}

.dialogo h3 { font-size: 17px; margin-bottom: 6px; }
.dialogo p { color: var(--text-2); font-size: 14px; }
.dialogo .nota-cascada { margin: 14px 0 0; }
.dialogo .campo { margin: 18px 0 0; }

.dialogo-pie {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

@media (prefers-reduced-motion: no-preference) {
  [popover].dialogo,
  [popover].dialogo::backdrop {
    transition: opacity var(--dur-3) var(--ease-out-quart),
                transform var(--dur-3) var(--ease-out-quart),
                overlay var(--dur-3) allow-discrete,
                display var(--dur-3) allow-discrete;
  }
  [popover].dialogo { opacity: 0; transform: scale(.95); }
  [popover].dialogo::backdrop { opacity: 0; }
  [popover].dialogo:popover-open { opacity: 1; transform: none; }
  [popover].dialogo:popover-open::backdrop { opacity: 1; }
  @starting-style {
    [popover].dialogo:popover-open { opacity: 0; transform: scale(.95); }
    [popover].dialogo:popover-open::backdrop { opacity: 0; }
  }
}

/* Buscador global (Ctrl+K) */
.paleta-fondo {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: grid;
  place-items: start center;
  padding: 12vh 16px 16px;
  background: rgba(6, 12, 24, .45);
  backdrop-filter: blur(3px);
  animation: fundido var(--dur-2) ease;
}

.paleta-fondo[hidden] { display: none; }

.paleta {
  width: min(600px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sombra-3);
  overflow: hidden;
  animation: paleta-entra var(--dur-2) var(--ease-out-quart);
}

@keyframes paleta-entra { from { opacity: 0; transform: scale(.97); } }
@keyframes fundido { from { opacity: 0; } }

.paleta-entrada { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); }
.paleta-entrada i { color: var(--text-3); font-size: 17px; }
.paleta-entrada input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: 400 16px var(--f-ui); }
.paleta-resultados { max-height: 50vh; overflow-y: auto; padding: 6px; }
.paleta-grupo { padding: 10px 10px 4px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* La selección con teclado no se anima (es de alta frecuencia) */
.paleta-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.paleta-item .ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); flex: none; }
.paleta-item .titulo { font-size: 14px; }
.paleta-item .sub { font-size: 12px; color: var(--text-3); }
.paleta-item .atajo { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.paleta-item.sel, .paleta-item:hover { background: var(--surface-3); color: var(--text); }
.paleta-pie { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text-3); }

/* ---------- 9. Sitio público ---------------------------------------- */
.publico { background: #fff; color: #111827; }
.publico .seccion { padding: 112px 24px; }
.publico .contenedor { max-width: 1180px; margin: 0 auto; }

.pub-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  color: #fff;
  view-transition-name: pub-nav;
}

/* La barra se vuelve sólida al bajar: lo calcula el navegador con el scroll */
.pub-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(6, 12, 24, .82);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .pub-nav::before {
    opacity: 0;
    animation: barra-solida linear both;
    animation-timeline: scroll(root);
    animation-range: 0 140px;
  }
}

@keyframes barra-solida { to { opacity: 1; } }

.pub-nav .interior { display: flex; align-items: center; gap: 32px; width: 100%; max-width: 1180px; margin: 0 auto; }
.pub-nav nav { display: flex; gap: 4px; margin-left: auto; }
.pub-nav nav a { padding: 8px 12px; border-radius: 8px; color: rgba(255, 255, 255, .72); font-size: 14px; transition: color 150ms ease; }
.pub-nav nav a:hover { color: #fff; }
.pub-nav .acciones { gap: 8px; }

.boton-claro {
  --b-bg: rgba(255, 255, 255, .06);
  --b-fg: #fff;
  --b-borde: rgba(255, 255, 255, .16);
  --b-bg-hover: rgba(255, 255, 255, .12);
  box-shadow: none;
}

/* Portada */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 24px 72px;
  background: var(--navy-950);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  /* luz suave azul + dorada, como el reflejo de un monitor */
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 900px;
  height: 900px;
  background: radial-gradient(closest-side, rgba(38, 72, 140, .45), transparent 70%);
  z-index: -1;
}

.hero::after {
  /* retícula técnica que se desvanece */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  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: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
}

.hero .contenedor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero h1 {
  margin: 22px 0 22px;
  color: #fff;
  font-family: var(--f-display);
  font-size: clamp(46px, 5.6vw, 84px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.02em;
}

.hero h1 em { color: var(--gold-300); font-style: italic; }
.hero .bajada { max-width: 480px; color: rgba(255, 255, 255, .66); font-size: 17px; line-height: 1.6; }
.hero .acciones { margin-top: 36px; gap: 12px; }
.hero .eyebrow { color: var(--gold-300); }

.enlace-flecha { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .82); font-weight: 500; font-size: 15px; padding: 0 8px; }
.enlace-flecha i { transition: transform var(--dur-2) var(--ease-out-quart); }
.enlace-flecha:hover { color: #fff; }
.enlace-flecha:hover i { transform: translateX(3px); }

/* Visor de cámara (CCTV) */
.visor {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 80px -30px rgba(0, 0, 0, .8);
}

.visor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) contrast(1.05) brightness(.92);
}

.visor::after {
  /* líneas de barrido muy finas, como un monitor */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.visor-capa {
  position: absolute;
  inset: 0;
  padding: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  pointer-events: none;
  /* sombra arriba y abajo para que los textos del visor siempre se lean */
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 64px),
    linear-gradient(to top, rgba(0, 0, 0, .55), transparent 64px);
}

.visor-capa .arriba,
.visor-capa .abajo {
  position: absolute;
  left: 16px; right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visor-capa .arriba { top: 14px; }
.visor-capa .abajo { bottom: 14px; }

.rec { display: inline-flex; align-items: center; gap: 7px; }
.rec::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4b3e;
  box-shadow: 0 0 10px #ff4b3e;
  animation: parpadeo 1.2s steps(1) infinite;
}

@keyframes parpadeo { 50% { opacity: .15; } }

/* Esquinas del visor */
.esquina { position: absolute; width: 22px; height: 22px; border-color: rgba(255, 255, 255, .7); border-style: solid; }
.esquina.a { top: 40px; left: 16px; border-width: 1.5px 0 0 1.5px; }
.esquina.b { top: 40px; right: 16px; border-width: 1.5px 1.5px 0 0; }
.esquina.c { bottom: 40px; left: 16px; border-width: 0 0 1.5px 1.5px; }
.esquina.d { bottom: 40px; right: 16px; border-width: 0 1.5px 1.5px 0; }

/* Barrido de escaneo: es tiempo, entonces lineal */
.barrido {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(201, 160, 78, .10) 85%, rgba(230, 200, 134, .55) 100%);
  border-bottom: 1px solid rgba(230, 200, 134, .6);
  animation: barrer 5.5s linear infinite;
  pointer-events: none;
}

@keyframes barrer {
  from { transform: translateY(-100%); }
  to   { transform: translateY(340%); }
}

/* Recuadros de detección */
.deteccion {
  position: absolute;
  border: 1.5px solid var(--c, #3ecf8e);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 18px -4px var(--c, #3ecf8e);
  opacity: 0;
  animation: detectar 900ms var(--ease-out-expo) forwards;
}

.deteccion span {
  position: absolute;
  left: -1.5px;
  bottom: calc(100% + 4px);
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--c, #3ecf8e);
  color: #04110a;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .06em;
  white-space: nowrap;
  text-shadow: none;
}

.deteccion.derecha span { left: auto; right: -1.5px; }

@keyframes detectar {
  from { opacity: 0; transform: scale(1.12); }
  to   { opacity: 1; transform: none; }
}

/* Franja de cifras */
.cifras-hero {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 24px 44px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.cifras-hero b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.cifras-hero span { font-size: 13px; color: rgba(255, 255, 255, .5); }

/* Encabezado de sección pública */
.titulo-seccion { max-width: 640px; margin-bottom: 56px; }
.titulo-seccion.centro { margin-left: auto; margin-right: auto; text-align: center; }
.titulo-seccion.centro .eyebrow::after { content: ""; width: 18px; height: 1px; background: currentColor; }

.titulo-seccion h2 {
  margin: 16px 0 14px;
  font-family: var(--f-display);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.015em;
  color: #0b1220;
}

.titulo-seccion h2 em { font-style: italic; color: var(--gold-600); }
.titulo-seccion p { color: #5b6474; font-size: 16.5px; line-height: 1.6; }

/* Servicios */
.servicios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.servicio {
  position: relative;
  display: grid;
  grid-template-rows: 260px auto;
  border-radius: var(--r-lg);
  border: 1px solid #ebe8e2;
  background: #fff;
  overflow: hidden;
  transition: box-shadow var(--dur-3) ease, border-color var(--dur-3) ease;
}

.servicio:hover { box-shadow: 0 30px 60px -30px rgba(11, 27, 58, .28); border-color: #e0dcd4; }

.servicio .imagen { position: relative; overflow: hidden; background: var(--navy-900); }

/* Se mueve la imagen (el hijo), no la tarjeta */
.servicio .imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-out-expo);
}

@media (hover: hover) {
  .servicio:hover .imagen img { transform: scale(1.045); }
}

.servicio .numero {
  position: absolute;
  top: 16px; left: 16px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(6, 12, 24, .6);
  backdrop-filter: blur(6px);
  color: #fff;
  font: 500 11px var(--f-mono);
  letter-spacing: .1em;
}

.servicio .texto { padding: 26px 28px 30px; }
.servicio h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 20px; letter-spacing: -.02em; color: #0b1220; }
.servicio h3 i { color: var(--gold-600); font-size: 19px; }
.servicio p { color: #5b6474; font-size: 15px; margin-bottom: 18px; }
.servicio ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.servicio li { padding: 5px 11px; border-radius: 999px; background: #f4f2ee; color: #3f4756; font-size: 12.5px; }

/* Ilustración del cerco eléctrico (no hay foto de esta línea) */
.ilustracion-cerco { width: 100%; height: 100%; display: block; }
.ilustracion-cerco .pulso { animation: recorrer 3.2s linear infinite; }
@keyframes recorrer { from { transform: translateX(-160px); } to { transform: translateX(760px); } }

/* Público objetivo */
.publicos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: #ebe8e2; border: 1px solid #ebe8e2; border-radius: var(--r-lg); overflow: hidden; }
.publico-item { padding: 36px 32px; background: #fff; }
.publico-item i { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px; border-radius: 12px; background: var(--navy); color: var(--gold-300); font-size: 19px; }
.publico-item h3 { font-size: 18px; margin-bottom: 8px; color: #0b1220; }
.publico-item p { color: #5b6474; font-size: 15px; }

/* Cómo trabajamos */
.seccion-oscura { background: var(--navy-950); color: #fff; position: relative; overflow: hidden; }
.seccion-oscura .titulo-seccion h2 { color: #fff; }
.seccion-oscura .titulo-seccion p { color: rgba(255, 255, 255, .6); }
.seccion-oscura .eyebrow { color: var(--gold-300); }

.pasos { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }

.pasos::before {
  /* línea que une los pasos: se dibuja al hacer scroll */
  content: "";
  position: absolute;
  top: 23px; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(201, 160, 78, .15));
  transform-origin: left;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .pasos::before { animation: crecer linear both; animation-timeline: view(); animation-range: entry 10% cover 45%; }
  }
}

.paso .num {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  border: 1px solid rgba(201, 160, 78, .5);
  border-radius: 50%;
  background: var(--navy-950);
  color: var(--gold-300);
  font: 500 14px var(--f-mono);
}

.paso h3 { color: #fff; font-size: 20px; margin-bottom: 10px; }
.paso p { color: rgba(255, 255, 255, .6); font-size: 15px; line-height: 1.6; }

/* Galería */
.galeria { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 240px 240px; gap: 12px; }
.galeria figure { position: relative; margin: 0; border-radius: var(--r); overflow: hidden; background: #eee; }
.galeria figure:first-child { grid-row: span 2; }
.galeria img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out-expo); }
@media (hover: hover) { .galeria figure:hover img { transform: scale(1.04); } }
.galeria figcaption { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(6, 12, 24, .62); backdrop-filter: blur(6px); color: #fff; font-size: 12px; }
.nota-imagenes { margin-top: 14px; font-size: 12.5px; color: #8a919e; }

/* Contacto */
.contacto { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; border-radius: 22px; overflow: hidden; border: 1px solid #ebe8e2; box-shadow: 0 40px 80px -40px rgba(11, 27, 58, .25); }

.contacto-lado { position: relative; padding: 48px 44px; background: var(--navy-950); color: #fff; overflow: hidden; }
.contacto-lado::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; background: radial-gradient(closest-side, rgba(201, 160, 78, .22), transparent); }
.contacto-lado h2 { font-family: var(--f-display); font-size: 44px; font-weight: 400; line-height: 1.02; color: #fff; margin: 16px 0 14px; }
.contacto-lado h2 em { color: var(--gold-300); }
.contacto-lado p { color: rgba(255, 255, 255, .62); }

.datos-contacto { display: grid; gap: 4px; margin-top: 32px; position: relative; z-index: 1; }
.dato-contacto { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.dato-contacto:hover { color: var(--gold-300); }
.dato-contacto i { color: var(--gold-300); font-size: 17px; width: 20px; }
.dato-contacto span { font-size: 12px; color: rgba(255, 255, 255, .5); display: block; }
.dato-contacto b { font-weight: 500; font-size: 15px; }

.contacto-form { padding: 44px; background: #fff; }
.contacto-form .control { background: #fff; border-color: #dcd8d0; color: #111827; }
.contacto-form .campo > label { color: #111827; }

/* Pie */
.pie { background: var(--navy-950); color: rgba(255, 255, 255, .55); padding: 72px 24px 32px; font-size: 14px; }
.pie .contenedor { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.pie h4 { color: #fff; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.pie ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pie a { color: rgba(255, 255, 255, .6); }
.pie a:hover { color: #fff; }
.pie .legal { max-width: 1180px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }

/* Páginas públicas simples (gracias, error, verificación) */
.pagina-simple { min-height: 100svh; display: grid; place-items: center; padding: 120px 24px 72px; background: var(--bg); }
.pagina-simple .caja { width: min(560px, 100%); text-align: center; }
.pagina-simple h1 { font-family: var(--f-display); font-weight: 400; font-size: 52px; line-height: 1; margin: 20px 0 14px; }
.pagina-simple p { color: var(--text-2); font-size: 16px; }

.sello { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; font-size: 28px; }
.sello.ok { background: var(--ok-bg); color: var(--ok); }
.sello.oro { background: var(--gold-50); color: var(--gold-600); }

.hoja { width: min(760px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sombra-2); overflow: hidden; text-align: left; }
.hoja-cab { display: flex; align-items: center; gap: 16px; padding: 22px 28px; background: var(--navy-950); color: #fff; }
.hoja-cab .derecha { margin-left: auto; text-align: right; }
.hoja-cab .codigo { font: 500 16px var(--f-mono); }
.hoja-cuerpo { padding: 28px; }

/* ---------- 10. Login ----------------------------------------------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
}

.login-arte {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  background: var(--navy-950);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.login-arte::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  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: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 20%, transparent 80%);
}

/* Barrido de radar: es tiempo, entonces lineal */
.radar {
  position: absolute;
  z-index: -1;
  left: 64%;
  top: 40%;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  border: 1px solid rgba(201, 160, 78, .18);
  background:
    radial-gradient(circle, transparent 32%, rgba(201, 160, 78, .14) 32.3%, transparent 32.8%),
    radial-gradient(circle, transparent 65%, rgba(201, 160, 78, .12) 65.3%, transparent 65.8%);
}

.radar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(201, 160, 78, .22), transparent 16%);
  animation: girar 6s linear infinite;
}

@keyframes girar { to { transform: rotate(1turn); } }

.login-arte blockquote { max-width: 420px; margin: 0; font-family: var(--f-display); font-size: 34px; line-height: 1.12; color: #fff; }
.login-arte blockquote em { color: var(--gold-300); }
.login-arte .pie-arte { font-size: 13px; color: rgba(255, 255, 255, .45); }

.login-caja { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: min(380px, 100%); }
.login-form h1 { font-family: var(--f-display); font-weight: 400; font-size: 44px; line-height: 1; margin: 32px 0 10px; }
.login-form .t2 { margin-bottom: 28px; }

.aviso-en-linea {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin-bottom: 18px;
  border-radius: 10px;
  font-size: 13.5px;
}

.aviso-en-linea.danger { background: var(--danger-bg); color: var(--danger); }
.aviso-en-linea.info,
.aviso-en-linea.warn,
.aviso-en-linea.ok { background: var(--info-bg); color: var(--info); }

/* ---------- Orden de trabajo e impresión ---------------------------- */
.checklist td:nth-child(2), .checklist td:nth-child(3) { width: 60px; text-align: center; font-size: 18px; color: var(--text-3); }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.firmas div { border-top: 1px solid var(--line-2); padding-top: 8px; font-size: 12.5px; color: var(--text-3); }

/* ---------- 11. Movimiento ------------------------------------------ */

/* Transición entre páginas del mismo sitio: el navegador cruza las vistas.
   El menú lateral tiene nombre propio, así queda quieto. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--dur-2); animation-timing-function: var(--ease-out-quart); }

/* Entrada del contenido de cada página del panel */
.entra { animation: entra var(--dur-3) var(--ease-out-quart) both; }
.entra-1 { animation-delay: 40ms; }
.entra-2 { animation-delay: 80ms; }
.entra-3 { animation-delay: 120ms; }
.entra-4 { animation-delay: 160ms; }

@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

/* Entrada de la portada: es marketing, se permite más recorrido */
.aparece { animation: aparece 1000ms var(--ease-out-expo) both; }
.aparece-1 { animation-delay: 100ms; }
.aparece-2 { animation-delay: 200ms; }
.aparece-3 { animation-delay: 320ms; }
.aparece-4 { animation-delay: 440ms; }

@keyframes aparece { from { opacity: 0; transform: translateY(20px); } }

/* Revelado al hacer scroll, sin JavaScript */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .revelar {
      animation: revelar linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
  }
}

@keyframes revelar { from { opacity: 0; transform: translateY(32px); } }

/* Quien pide menos movimiento, no lo ve */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .barrido, .radar::after, .ilustracion-cerco .pulso { display: none; }
}

/* ---------- 12. Responsive ------------------------------------------ */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejilla-2 { grid-template-columns: 1fr; }
  .hero .contenedor { grid-template-columns: 1fr; gap: 48px; }
  .hero { min-height: auto; padding-top: 140px; }
  .contacto { grid-template-columns: 1fr; }
  .pie .contenedor { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .panel { grid-template-columns: 1fr; }

  .lateral {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform var(--dur-2) ease-in;
    box-shadow: var(--sombra-3);
  }

  .lateral.abierto { transform: none; transition: transform var(--dur-3) var(--ease-out-quart); }

  .velo-lateral { position: fixed; inset: 0; z-index: 65; background: rgba(6, 12, 24, .45); animation: fundido var(--dur-2) ease; }
  .velo-lateral[hidden] { display: none; }
  .abrir-menu { display: inline-flex; }

  .barra { padding: 0 16px; }
  .boton-buscar { width: auto; }
  .boton-buscar .texto, .boton-buscar kbd { display: none; }
  .menu-usuario > summary .nombre { display: none; }
  .cuerpo { padding: 24px 16px 56px; }
  .cabecera h1 { font-size: 34px; }
  .seccion-form { grid-template-columns: 1fr; gap: 12px; }
  .servicios, .publicos, .pasos { grid-template-columns: 1fr; }
  .pasos::before { display: none; }
  .galeria { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 200px 200px; }
  .galeria figure:first-child { grid-column: span 2; grid-row: auto; }
  .pub-nav nav { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .solicitud { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .cifras-hero { grid-template-columns: repeat(2, auto); }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-valor { font-size: 22px; }
  .rejilla { grid-template-columns: 1fr; }
  .publico .seccion { padding: 80px 16px; }
  .pub-nav { padding: 0 16px; }
  .pub-nav .boton-claro { display: none; }
  .hero { padding: 120px 16px 56px; }
  .contacto-lado, .contacto-form { padding: 32px 22px; }
  .pie .contenedor { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: 1fr; }
  .cifras div { border-left: 0; border-top: 1px solid var(--line); }
  .cifras div:first-child { border-top: 0; }
  .herramientas .buscador { max-width: none; }
  .herramientas .resumen { margin-left: 0; }
  .ocultar-movil { display: none !important; }
  .datos div { grid-template-columns: 1fr; gap: 2px; }
  .servicio { grid-template-rows: 200px auto; }
}

/* ---------- Impresión ----------------------------------------------- */
@media print {
  .lateral, .barra, .avisos, .no-imprimir, .herramientas, .paginado { display: none !important; }
  .panel { display: block; }
  body { background: #fff; }
  .cuerpo { padding: 0; max-width: none; }
  .tarjeta { box-shadow: none; break-inside: avoid; }
  .tabla thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
