/* Marmo UI · paquete web (grupomarmo.es)
   Secciones de dist/marmo-ui.css copiadas sin cambios: styles/tokens.css, styles/base.css, components/buttons, components/forms, components/badges, components/tabs, components/modal, components/feedback, components/layout-navigation, components/cards-dashboard, components/pricing-commerce, components/content-utilities.
   Se genera desde marmo-ui.css; no editar a mano. */
/* ===== styles/tokens.css ===== */
/* ============================================================
   MARMO UI — Tokens de diseño
   Fuente: Manual de identidad Grupo Marmo, edición 2 (oct. 2026)
   Regla base: se separa con filete, no con sombra.
   ============================================================ */

/* Tipografías: se sirven desde el propio servidor (manual, cap. 04).
   Ajusta la ruta a la carpeta de assets del SaaS. */
@font-face {
  font-family: "Outfit";
  src: url("../fonts/Outfit-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* — Paleta principal (manual, cap. 03) — */
  --marmo-blue-dark:   #06264a;  /* azul de marca: titulares, bandas, pastilla */
  --marmo-blue:        #003e7e;  /* enlaces, foco sobre claro */
  --marmo-blue-deep:   #041a33;  /* arranque del degradado, veladuras */
  --marmo-white:       #ffffff;  /* fondo principal */
  --marmo-surface:     #f7f9fc;  /* fondo alterno */
  --marmo-blue-light:  #eaf2fa;  /* fondos suaves y etiquetas */
  --marmo-red:         #c9352b;  /* eliminar/cancelar y error (en el SaaS la acción principal es azul) */
  --marmo-gold:        #8a641f;  /* acento sobre claro (texto pequeño, filetes) */
  --marmo-gold-light:  #c9a45c;  /* acento y foco sobre oscuro */

  /* — Texto y líneas — */
  --marmo-text:   #1f2933;
  --marmo-muted:  #6b7280;
  --marmo-ink:    #101923;
  --marmo-line:   #d8e1ec;

  /* — Estados — */
  --marmo-success: #426b5d;
  --marmo-error:   var(--marmo-red);
  --marmo-green:   #1f7a5a;  /* solo WhatsApp */

  /* — Derivados para interacción (no son colores nuevos: son
       oscurecimientos/transparencias de la paleta) — */
  --marmo-red-hover:       #b02d24;
  --marmo-red-pressed:     #96261f;
  --marmo-blue-dark-hover: #0a3260;
  --marmo-blue-hover-bg:   rgba(0, 62, 126, 0.06);
  --marmo-blue-press-bg:   rgba(0, 62, 126, 0.12);
  --marmo-blue-34:         rgba(0, 62, 126, 0.34);   /* borde de tarjeta en hover */
  --marmo-white-78:        rgba(255, 255, 255, 0.78); /* párrafos sobre oscuro */
  --marmo-white-72:        rgba(255, 255, 255, 0.72);
  --marmo-white-12:        rgba(255, 255, 255, 0.12);
  --marmo-white-20:        rgba(255, 255, 255, 0.20);

  /* — Fondo oscuro (degradado oficial) — */
  --marmo-gradient-dark:
    radial-gradient(circle at 78% 18%, rgba(201, 164, 92, 0.18), transparent 30%),
    linear-gradient(135deg, #041a33, #06264a 52%, #003e7e);

  /* — Tipografía — */
  --font-serif: "Outfit", "Helvetica Neue", Arial, sans-serif;          /* alias de compatibilidad */
  --font-sans: "Outfit", "Helvetica Neue", Arial, sans-serif;    /* voz de servicio */
  --font-mono:  ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Escala (manual, cap. 04) */
  --text-titular:       4rem;      /* Outfit 500 · 1.05 */
  --text-titulo:        2.5rem;    /* Outfit 500 · 1.1  */
  --text-titulo-bloque: 2.25rem;
  --text-titulo-menor:  1.375rem;  /* título menor: 22 px */
  --text-cita:          1.55rem;
  --text-cifra:         2.35rem;
  --text-precio:        1.7rem;    /* Outfit 700 */
  --text-h3:            1.125rem;  /* Outfit 600 */
  --text-entradilla:    1.1rem;
  --text-cuerpo:        1rem;
  --text-tarjeta:       0.92rem;
  --text-boton:         0.92rem;   /* Outfit 600 */
  --text-menu:          0.85rem;
  --text-legal:         0.8rem;
  --text-etiqueta:      0.78rem;
  --text-antetitulo:    0.75rem;   /* mayúsculas, +0.08em */

  --weight-light:    300;  /* citas y énfasis */
  --weight-regular:  400;  /* leer */
  --weight-medium:   500;  /* datos */
  --weight-semibold: 600;  /* títulos y controles */
  --weight-bold:     700;  /* solo precios */

  --tracking-titular:    -0.02em;
  --tracking-modelo:     -0.035em;
  --tracking-antetitulo:  0.08em;

  /* — Espaciado — */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;   /* relleno de tarjeta */
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;   /* relleno vertical de sección */

  /* — Radios — */
  --radius-sm:   6px;    /* campos de formulario */
  --radius-md:   10px;   /* tarjetas, celdas, pastilla del logo */
  --radius-pill: 999px;  /* botones en web */
  --radius-app:  8px;    /* botones en SaaS y apps corporativas */

  /* — Bordes — */
  --border:        1px solid var(--marmo-line);
  --border-strong: 1px solid #c3cfdd;

  /* — Sombras: solo para lo que flota o en hover de tarjeta — */
  --shadow-card:  0 12px 28px rgba(6, 38, 74, 0.08);
  --shadow-soft:  0 18px 40px rgba(4, 26, 51, 0.28);
  --shadow-float: 0 16px 40px rgba(6, 38, 74, 0.14), 0 2px 6px rgba(6, 38, 74, 0.06);

  /* — Foco de teclado (decisión del proyecto, sustituye al anillo de 3 px del manual web):
       no se crea ningún anillo ni halo. El foco de un control es su propio borde
       de 1 px, que pasa a azul corporativo. Los controles sin borde visible llevan
       un borde transparente de 1 px que se enciende al recibir el foco. — */
  --focus-color:       var(--marmo-blue-dark);   /* sobre claro: azul oscuro corporativo, el control activo */
  --focus-color-dark:  var(--marmo-gold-light);  /* sobre oscuro */
  /* Pulso al recibir el foco: el borde se engrosa 1 px hacia dentro y vuelve (una vez). Nada sale fuera. */
  --focus-pulse:       rgba(6, 38, 74, 0.6);
  --focus-pulse-dark:  rgba(201, 164, 92, 0.7);
  --focus-pulse-size:  1px;    /* lo que engorda el borde, hacia dentro, en el latido */
  --focus-pulse-time:  650ms;

  /* — Movimiento — */
  --ease:           cubic-bezier(0.2, 0, 0, 1);
  --duration-state: 170ms;   /* cambios de estado: 160–180 ms */
  --duration-enter: 600ms;   /* entrada de bloques */
  --lift-hover:     -1px;    /* el botón sube 1 px */

  /* — Controles — */
  --control-h-sm: 32px;
  --control-h-md: 40px;   /* botón estándar del manual */
  --control-h-lg: 48px;
  --field-h:      36px;   /* campo de formulario y desplegable */
  --field-h-sm:   32px;
  --field-font:   0.75rem; /* 12 px: texto y marcador de posición de campos y desplegables */   /* filtros de tabla y barras (igual que el botón pequeño) */
}

/* — Forma por contexto (se hereda: manda el contenedor más cercano) —
   app: SaaS y aplicaciones corporativas · web: grupomarmo.es y piezas al cliente */
[data-ui="app"], .ui-app {
  --ui-radius:       var(--radius-app);   /* botones */
  --ui-radius-field: var(--radius-app);   /* campos */
  --ui-radius-card:  var(--radius-app);   /* tarjetas, modales, menús */
  --ui-radius-badge: 4px;                 /* etiquetas */
}
[data-ui="web"], .ui-web {
  --ui-radius:       var(--radius-pill);
  --ui-radius-field: var(--radius-sm);
  --ui-radius-card:  var(--radius-md);
  --ui-radius-badge: var(--radius-pill);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-state: 0ms;
    --duration-enter: 0ms;
    --lift-hover: 0px;
  }
}

/* ===== styles/base.css ===== */
/* ============================================================
   MARMO UI — Base
   Tipografía de página, estilos de texto del manual y utilidades.
   Requiere tokens.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--marmo-white);
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--text-cuerpo);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums; /* cifras del mismo ancho: los precios no bailan */
}

img, svg { vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--marmo-blue); text-underline-offset: 3px; }
a:hover { color: var(--marmo-blue-dark); }

:focus-visible { outline: none; }

/* Pulso de foco: al llegar el foco, el propio borde «late» una vez (se engrosa hacia
   dentro y vuelve a 1 px) y queda encendido en azul. Nada sale por fuera del control:
   ni anillo ni halo. */
@keyframes ui-focus-pulse {
  0%   { box-shadow: inset 0 0 0 0 var(--pulse-c, var(--focus-pulse)); }
  35%  { box-shadow: inset 0 0 0 var(--focus-pulse-size) var(--pulse-c, var(--focus-pulse)); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}
:focus-visible:not([role="tabpanel"]):not(.table-scroll):not(main):not(.tab-panel):not(.form-summary):not(dialog):not(.notification-panel),
.input:focus,
input[type="checkbox"]:focus, input[type="radio"]:focus, input[type="range"]:focus,
.choice-card:has(input:focus),
.file-drop:has(input:focus),
.card-link:has(.card-title a:focus-visible),
.table-wrapper:has(> .table-scroll:focus-visible) {
  animation: ui-focus-pulse var(--focus-pulse-time) var(--ease) 1;
}
/* Los que ya tienen el foco en un hijo no repiten el pulso en el hijo */
.choice-card input:focus, .card-link .card-title a:focus-visible, .file-drop input:focus { animation: none; }
.on-dark, .section-dark, .sidebar-dark, .card-dark { --pulse-c: var(--focus-pulse-dark); }
/* Enlaces de texto: no tienen borde; el foco se marca con el subrayado en azul corporativo */
a:not([class]):focus-visible { color: var(--focus-color); text-decoration: underline; text-decoration-thickness: 1px; }
.on-dark :focus-visible,
.section-dark a:not([class]):focus-visible { color: var(--focus-color-dark); }

/* ---------- Estilos de texto (manual, cap. 04) ---------- */
.ui-titular,
.ui-titulo,
.ui-titulo-bloque,
.ui-titulo-menor,
.ui-cita,
.ui-cifra {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  color: var(--marmo-blue-dark);
  margin: 0;
  text-wrap: balance;
}
.ui-titular       { font-size: var(--text-titular);       line-height: 1.05; letter-spacing: var(--tracking-titular); }
.ui-titulo        { font-size: var(--text-titulo);        line-height: 1.1;  letter-spacing: var(--tracking-titular); }
.ui-titulo-bloque { font-size: var(--text-titulo-bloque); line-height: 1.1;  letter-spacing: var(--tracking-titular); }
.ui-titulo-menor  { font-size: var(--text-titulo-menor);  line-height: 1.2; }
.ui-cita          { font-size: var(--text-cita); line-height: 1.3; font-style: normal; font-weight: var(--weight-light); }
.ui-cifra         { font-size: var(--text-cifra); line-height: 1; font-weight: var(--weight-light); }

.ui-h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: 1.25; color: var(--marmo-ink); margin: 0; }
.ui-entradilla { font-size: var(--text-entradilla); line-height: 1.6; color: var(--marmo-muted); max-width: 760px; }
.ui-cuerpo     { font-size: var(--text-cuerpo); line-height: 1.6; color: var(--marmo-muted); }
.ui-legal      { font-size: var(--text-legal); line-height: 1.45; color: var(--marmo-muted); }

.ui-eyebrow {
  display: block;
  font-size: var(--text-antetitulo);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: var(--tracking-antetitulo);
  text-transform: uppercase;
  color: var(--marmo-gold);
}
.ui-modelo {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-modelo);
  text-transform: uppercase;
  line-height: 0.94;
}
.ui-precio {
  font-family: var(--font-sans);
  font-size: var(--text-precio);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  color: var(--marmo-blue-dark);
}
.ui-precio.is-oferta { color: var(--marmo-red); }

/* ---------- Fondo oscuro ---------- */
.section-dark,
.ui-dark {
  background: var(--marmo-gradient-dark);
  color: var(--marmo-white);
}
.section-dark .ui-titular, .section-dark .ui-titulo, .section-dark .ui-titulo-bloque,
.section-dark .ui-titulo-menor, .section-dark .ui-cita, .section-dark .ui-cifra,
.on-dark .ui-titular, .on-dark .ui-titulo, .on-dark .ui-titulo-menor { color: var(--marmo-white); }
.section-dark .ui-eyebrow, .on-dark .ui-eyebrow { color: var(--marmo-white-78); }
.section-dark p, .on-dark p { color: var(--marmo-white-78); }

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

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: var(--border);
  border-radius: 4px;
  background: var(--marmo-surface);
  color: var(--marmo-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.ui-divider { border: 0; border-top: var(--border); margin: var(--space-5) 0; }

.ui-container { max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
@media (max-width: 480px) { .ui-container { padding-inline: 12px; } }

/* Iconos: toman el color del texto */
.ui-ico { flex: none; stroke: currentColor; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Los indicadores de carga sí giran (más despacio): informan de un estado */
  [aria-busy="true"]::after,
  .ui-spinner,
  .ui-spinner::after {
    animation-duration: 1.6s !important;
    animation-iteration-count: infinite !important;
  }
}

/* Outfit has no italic face: emphasis uses weight, never synthetic slant. */
body { font-synthesis: none; }
em, i, blockquote { font-style: normal; }
.ui-titular em, .ui-titulo em, .ui-titulo-menor em { font-weight: var(--weight-light); }

/* ===== components/buttons ===== */
/* ============================================================
   MARMO UI — Botones
   Planos, sin sombras ni relieve.
   Azul = acción principal. Rojo = eliminar o cancelar algo.
   Dos formas:
     · web (por defecto): píldora, como pide el manual
     · app: radio de 8 px para el SaaS y aplicaciones corporativas.
       Se activa con data-ui="app" (o .ui-app) en <body> o en
       cualquier contenedor; por botón con .btn-shape-app / .btn-shape-web
   Requiere styles/tokens.css
   ============================================================ */

.btn {
  --btn-h: var(--control-h-md);
  --btn-px: 20px;
  --btn-bg: transparent;
  --btn-fg: var(--marmo-blue-dark);
  --btn-bd: transparent;
  --btn-bg-hover: var(--btn-bg);
  --btn-fg-hover: var(--btn-fg);
  --btn-bd-hover: var(--btn-bd);
  --btn-bg-active: var(--btn-bg-hover);
  --btn-radius: var(--ui-radius, var(--radius-pill));

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid var(--btn-bd);
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--text-boton);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-state) var(--ease),
    border-color var(--duration-state) var(--ease),
    color var(--duration-state) var(--ease),
    transform var(--duration-state) var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
}

.btn:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-fg-hover);
  border-color: var(--btn-bd-hover);
  transform: translateY(var(--lift-hover));
}

.btn:active {
  background: var(--btn-bg-active);
  transform: translateY(0);
}

/* Foco: el propio borde de 1 px pasa a azul corporativo. Sin anillo. */
.btn:focus { outline: none; }
.btn:focus-visible,
.btn:focus-visible:hover {
  border-color: var(--focus-color);
}

/* ---------- Variantes ---------- */

/* Acción principal. Azul de marca. Una por bloque.
   .btn-solid se mantiene como alias. */
.btn-primary,
.btn-solid {
  --btn-bg: var(--marmo-blue-dark);
  --btn-fg: var(--marmo-white);
  --btn-bd: var(--marmo-blue-dark);
  --btn-bg-hover: var(--marmo-blue-dark-hover);
  --btn-bd-hover: var(--marmo-blue-dark-hover);
  --btn-bg-active: var(--marmo-blue-deep);
}

/* Acción secundaria sobre claro (= .button-outline del manual).
   .btn-outline se mantiene como alias por compatibilidad. */
.btn-secondary,
.btn-outline {
  --btn-bg: var(--marmo-white);
  --btn-fg: var(--marmo-blue-dark);
  --btn-bd: var(--marmo-blue-dark);
  --btn-bg-hover: var(--marmo-blue-light);
  --btn-bg-active: #dbe8f5;
}

/* Suave: baja prioridad dentro de paneles, tablas y tarjetas. */
.btn-soft {
  --btn-bg: var(--marmo-blue-light);
  --btn-fg: var(--marmo-blue-dark);
  --btn-bd: var(--marmo-blue-light);
  --btn-bg-hover: #dbe8f5;
  --btn-bd-hover: #dbe8f5;
  --btn-bg-active: #cfdfef;
}

/* Fantasma: barras de herramientas y acciones de fila. */
.btn-ghost {
  --btn-fg: var(--marmo-text);
  --btn-bg-hover: var(--marmo-blue-hover-bg);
  --btn-fg-hover: var(--marmo-blue-dark);
  --btn-bg-active: var(--marmo-blue-press-bg);
}
.btn-ghost:hover { transform: none; }

/* Enlace: la tercera acción («dos botones como mucho; el tercero es un enlace»). */
.btn-link {
  --btn-fg: var(--marmo-blue);
  --btn-px: 2px;
  height: auto;
  min-width: 0;
  padding-block: 4px;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.btn-link:hover {
  transform: none;
  text-decoration-color: currentColor;
}

/* Eliminar o cancelar algo (un vehículo, una cita, un pedido).
   Rojo sólido: es la acción principal de un diálogo de confirmación. */
.btn-danger {
  --btn-bg: var(--marmo-red);
  --btn-fg: var(--marmo-white);
  --btn-bd: var(--marmo-red);
  --btn-bg-hover: var(--marmo-red-hover);
  --btn-bd-hover: var(--marmo-red-hover);
  --btn-bg-active: var(--marmo-red-pressed);
}

/* La misma intención con menos peso: filas de tabla, fichas, junto
   a otra acción principal. */
.btn-danger-outline {
  --btn-bg: var(--marmo-white);
  --btn-fg: var(--marmo-red);
  --btn-bd: var(--marmo-red);
  --btn-bg-hover: #fbecea;
  --btn-bg-active: #f6d9d6;
}
.btn-icon.btn-ghost.btn-danger-hover:hover { --btn-fg-hover: var(--marmo-red); --btn-bg-hover: #fbecea; }

/* ---------- Tamaños ---------- */
.btn-sm {               /* tablas y barras densas, solo escritorio */
  --btn-h: var(--control-h-sm);
  --btn-px: 14px;
  font-size: var(--text-etiqueta);
}
.btn-sm svg { width: 16px; height: 16px; }

.btn-md { --btn-h: var(--control-h-md); --btn-px: 20px; }

.btn-lg {
  --btn-h: var(--control-h-lg);
  --btn-px: 26px;
  font-size: var(--text-cuerpo);
}

/* Compatibilidad: xs desaparece (26 px no llega al mínimo táctil). */
.btn-xs { --btn-h: var(--control-h-sm); --btn-px: 12px; font-size: var(--text-etiqueta); }

.btn-block { display: flex; width: 100%; }

/* Solo icono: circular en web, cuadrado de 8 px en app. Requiere aria-label. */
.btn-icon { --btn-px: 0; width: var(--btn-h); }
.btn-icon.btn-ghost { --btn-fg: var(--marmo-muted); --btn-fg-hover: var(--marmo-blue-dark); }

/* ---------- Deshabilitado ---------- */
.btn:disabled:not([aria-busy="true"]),
.btn[aria-disabled="true"]:not([aria-busy="true"]) {
  --btn-bg: var(--marmo-surface);
  --btn-fg: #9aa5b1;
  --btn-bd: var(--marmo-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bd);
  cursor: not-allowed;
  transform: none;
}
.btn-ghost:disabled, .btn-ghost[aria-disabled="true"],
.btn-link:disabled, .btn-link[aria-disabled="true"] {
  --btn-bg: transparent;
  --btn-bd: transparent;
  text-decoration: none;
}

/* ---------- Cargando ---------- */
.btn[aria-busy="true"],
.btn[aria-busy="true"]:hover {
  cursor: progress;
  transform: none;
  background: var(--btn-bg);
  border-color: var(--btn-bd);
}
.btn[aria-busy="true"] > * { visibility: hidden; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: btn-spin 0.7s linear infinite;
}
/* Mientras carga no se ve gris: mantiene su color para que se entienda qué se está haciendo. */
.btn-primary[aria-busy="true"],
.btn-solid[aria-busy="true"]    { --btn-bg: var(--marmo-blue-dark); --btn-fg: var(--marmo-white); --btn-bd: var(--marmo-blue-dark); }
.btn-danger[aria-busy="true"]   { --btn-bg: var(--marmo-red); --btn-fg: var(--marmo-white); --btn-bd: var(--marmo-red); }
.btn-danger-outline[aria-busy="true"] { --btn-bg: var(--marmo-white); --btn-fg: var(--marmo-red); --btn-bd: var(--marmo-red); }
.btn-secondary[aria-busy="true"],
.btn-outline[aria-busy="true"]  { --btn-bg: var(--marmo-white); --btn-fg: var(--marmo-blue-dark); --btn-bd: var(--marmo-blue-dark); }
.btn-soft[aria-busy="true"]     { --btn-bg: var(--marmo-blue-light); --btn-fg: var(--marmo-blue-dark); --btn-bd: var(--marmo-blue-light); }

@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::after { animation-duration: 1.6s; }
}

/* ---------- Sobre fondo oscuro ---------- */
.on-dark .btn:focus-visible,
.section-dark .btn:focus-visible { border-color: var(--focus-color-dark); }

/* Principal sobre oscuro: blanco con texto azul */
.on-dark .btn-primary,
.on-dark .btn-solid,
.section-dark .btn-primary,
.section-dark .btn-solid {
  --btn-bg: var(--marmo-white);
  --btn-fg: var(--marmo-blue-dark);
  --btn-bd: var(--marmo-white);
  --btn-bg-hover: var(--marmo-blue-light);
  --btn-bd-hover: var(--marmo-blue-light);
  --btn-bg-active: #dbe8f5;
}

/* = .button-secondary del manual */
.on-dark .btn-secondary,
.on-dark .btn-outline,
.section-dark .btn-secondary,
.section-dark .btn-outline {
  --btn-bg: transparent;
  --btn-fg: var(--marmo-white);
  --btn-bd: rgba(255, 255, 255, 0.55);
  --btn-bg-hover: var(--marmo-white-12);
  --btn-bd-hover: var(--marmo-white);
  --btn-bg-active: var(--marmo-white-20);
}
.on-dark .btn-ghost,
.section-dark .btn-ghost {
  --btn-fg: var(--marmo-white-78);
  --btn-fg-hover: var(--marmo-white);
  --btn-bg-hover: var(--marmo-white-12);
  --btn-bg-active: var(--marmo-white-20);
}
.on-dark .btn-link,
.section-dark .btn-link { --btn-fg: var(--marmo-gold-light); }
.on-dark .btn:disabled:not([aria-busy="true"]),
.on-dark .btn[aria-disabled="true"]:not([aria-busy="true"]),
.section-dark .btn:disabled:not([aria-busy="true"]),
.section-dark .btn[aria-disabled="true"]:not([aria-busy="true"]) {
  --btn-bg: var(--marmo-white-12);
  --btn-fg: rgba(255, 255, 255, 0.45);
  --btn-bd: transparent;
}

/* ---------- Forma: web (píldora) / app (8 px) ----------
   El contexto define --ui-radius y se hereda: manda siempre el
   contenedor más cercano (body data-ui="app" + una tarjeta .ui-web
   dentro = píldoras solo en esa tarjeta). */
/* Los contextos [data-ui] / .ui-app / .ui-web se definen en tokens.css */
.btn.btn-shape-app { --btn-radius: var(--radius-app); }
.btn.btn-shape-web { --btn-radius: var(--radius-pill); }
.btn.btn-link { --btn-radius: 2px; }

/* ---------- Grupo de acciones (separación estándar) ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* ---------- Selector segmentado ----------
   .segmented (nuevo) y .btn-group (compatibilidad) */
.segmented,
.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: var(--border);
  border-radius: calc(var(--ui-radius, var(--radius-pill)) + 2px);
  background: var(--marmo-white);
}
.segmented .btn,
.btn-group .btn {
  --btn-h: calc(var(--control-h-md) - 8px);
  --btn-px: 16px;
  --btn-bg: transparent;
  --btn-bd: transparent;
  --btn-fg: var(--marmo-muted);
  --btn-fg-hover: var(--marmo-blue-dark);
  --btn-bg-hover: var(--marmo-blue-hover-bg);
  --btn-bd-hover: transparent;
  --btn-bg-active: var(--marmo-blue-press-bg);
  --btn-radius: max(calc(var(--ui-radius, var(--radius-pill)) - 2px), 0px);
}
.segmented .btn:hover,
.btn-group .btn:hover { transform: none; }
.segmented.segmented-sm .btn,
.btn-group .btn-sm,
.btn-group .btn-xs {
  --btn-h: calc(var(--control-h-sm) - 8px);
  --btn-px: 12px;
  font-size: var(--text-etiqueta);
}
.segmented .btn[aria-pressed="true"],
.btn-group .btn[aria-pressed="true"],
.btn-group .btn.active {
  --btn-bg: var(--marmo-blue-dark);
  --btn-fg: var(--marmo-white);
  --btn-bg-hover: var(--marmo-blue-dark);
  --btn-fg-hover: var(--marmo-white);
  --btn-bg-active: var(--marmo-blue-dark);
}
.segmented .btn:focus-visible,
.btn-group .btn:focus-visible { border-color: var(--focus-color); }

/* ===== components/forms ===== */
/* ============================================================
   MARMO UI — Formularios
   Etiqueta siempre visible encima · campo de 44 px · filete de 1 px
   Error en rojo, debajo del campo, diciendo qué hacer.
   Controles nativos (appearance: none): accesibles y sin trucos.
   Mantiene los nombres de clase de neokit.
   Requiere tokens.css y base.css
   ============================================================ */

/* ---------- Estructura del campo ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 var(--space-4);
  min-width: 0;
}
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  color: var(--marmo-ink);
}
.form-label .form-req,
.form-label.required::after {
  color: var(--marmo-muted);
  font-weight: var(--weight-regular);
}
.form-label.required::after { content: "*"; }          /* compatibilidad neokit */
.form-label.required .form-req { display: none; }
.form-label .form-optional { font-weight: var(--weight-regular); color: var(--marmo-muted); }

.form-helper,
.form-error,
.form-success-msg,
.form-counter {
  font-size: var(--text-etiqueta);
  line-height: 1.4;
  margin: 0;
}
.form-helper { color: var(--marmo-muted); }
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--marmo-red);
  font-weight: var(--weight-medium);
}
.form-error[hidden] { display: none; }
.form-error svg { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.form-success-msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--marmo-success);
  font-weight: var(--weight-medium);
}
.form-success-msg svg { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.form-foot { display: flex; justify-content: space-between; gap: var(--space-3); }
.form-counter { color: var(--marmo-muted); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.form-counter.is-over { color: var(--marmo-red); font-weight: var(--weight-semibold); }

/* ---------- Campo base: input, select, textarea ---------- */
.input {
  display: block;
  width: 100%;
  min-width: 0;
  height: var(--fh, var(--field-h));
  padding: 0 12px;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius-field, var(--radius-sm));
  background: var(--marmo-white);
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--field-font);
  line-height: 1.4;
  appearance: none;
  transition: border-color var(--duration-state) var(--ease), background-color var(--duration-state) var(--ease);
}
.input::placeholder { color: #9aa5b1; opacity: 1; }
.input:hover:not(:disabled):not([readonly]):not(:focus) { border-color: #b9c7d8; }
.input:focus { outline: none; }
.input:focus-visible,
.input:focus,
.input.is-focus { /* .is-focus: solo para enseñar el estado en documentación */
  border-color: var(--focus-color);
  outline: none;
}

textarea.input {
  height: auto;
  min-height: 84px;
  padding: 7px 12px;
  resize: vertical;
  line-height: 1.5;
}

select.input {
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2306264a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
select.input[multiple] { height: auto; padding: 6px; background-image: none; }

/* Fechas y números: sin adornos del navegador que rompan el alto */
.input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.input[type="number"]::-webkit-inner-spin-button { opacity: 1; }
.input[type="search"]::-webkit-search-cancel-button { display: none; }

/* Tamaño compacto: filtros de tabla y barras (solo escritorio) */
.input.input-sm, .input-sm .input { --fh: var(--field-h-sm); padding-inline: 10px; }
.input-sm select.input, select.input.input-sm { padding-right: 30px; background-position: right 8px center; }

/* ---------- Estados ---------- */
.input:disabled,
.input.is-disabled {
  background-color: var(--marmo-surface);
  color: #9aa5b1;
  cursor: not-allowed;
}
.input[readonly] {
  background-color: var(--marmo-surface);
  border-style: dashed;
}
.input[aria-invalid="true"],
.input.error {
  border-color: var(--marmo-red);
}
.input[aria-invalid="true"]:focus,
.input.error:focus { border-color: var(--focus-color); } /* el foco manda; el mensaje de error sigue debajo */
.input.success,
.input[data-valid="true"] { border-color: var(--marmo-success); }

/* ---------- Iconos y acciones dentro del campo ---------- */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.input-wrapper .input { flex: 1; }
.input-wrapper .input-icon-left {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--marmo-muted);
  pointer-events: none;
}
.input-wrapper:has(.input-icon-left) .input,
.input-wrapper.has-left-icon .input { padding-left: 36px; }
.input-wrapper.has-action .input,
.input-wrapper.has-right-icon .input { padding-right: 38px; }

.input-action {
  position: absolute;
  border: 1px solid transparent !important;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: max(calc(var(--ui-radius-field, 6px) - 2px), 4px);
  background: transparent;
  color: var(--marmo-muted);
  cursor: pointer;
}
.input-action:hover { color: var(--marmo-blue-dark); background: var(--marmo-blue-hover-bg); }
.input-action:focus-visible { outline: none; border-color: var(--focus-color) !important; color: var(--marmo-blue-dark); }
.input-action svg { width: 16px; height: 16px; }
.input-action[hidden] { display: none; }
.input-sm .input-action, .input-wrapper.input-sm .input-action { width: 24px; height: 24px; right: 4px; }

/* ---------- Prefijo / sufijo (€, km, CV, %) ---------- */
.input-group {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.input-group .input { flex: 1; position: relative; z-index: 0; }
.input-group .input:focus { z-index: 1; }
.input-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--marmo-line);
  background: var(--marmo-surface);
  color: var(--marmo-muted);
  font-size: var(--field-font);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.input-group > :first-child { border-top-left-radius: var(--ui-radius-field, var(--radius-sm)); border-bottom-left-radius: var(--ui-radius-field, var(--radius-sm)); }
.input-group > :last-child  { border-top-right-radius: var(--ui-radius-field, var(--radius-sm)); border-bottom-right-radius: var(--ui-radius-field, var(--radius-sm)); }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child)  { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-addon:first-child { border-right: 0; }
.input-group > .input-addon:last-child  { border-left: 0; }
.input-group .input { text-align: inherit; }
.input-group.is-numeric .input { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Casilla, opción y interruptor ---------- */
.checkbox-wrapper,
.radio-wrapper,
.switch-wrapper {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
  cursor: pointer;
  font-size: var(--text-cuerpo);
  line-height: 1.4;
  color: var(--marmo-text);
  -webkit-tap-highlight-color: transparent;
}
.checkbox-wrapper:has(input:disabled),
.radio-wrapper:has(input:disabled),
.switch-wrapper:has(input:disabled) { cursor: not-allowed; color: #9aa5b1; }

/* Las piezas visuales antiguas de neokit ya no hacen falta */
.checkbox-box, .radio-dot, .switch-track { display: none !important; }

.checkbox-label, .switch-label { padding-top: 1px; }
.choice-desc { display: block; font-size: var(--text-etiqueta); color: var(--marmo-muted); margin-top: 2px; }

.checkbox,
.checkbox-wrapper input[type="checkbox"],
.radio,
.radio-wrapper input[type="radio"] {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  margin: 5px 0 0;
  border: 1px solid #a9b8ca;
  background: var(--marmo-white);
  appearance: none;
  cursor: inherit;
  transition: background-color var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.checkbox,
.checkbox-wrapper input[type="checkbox"] { border-radius: 2px; }
.radio,
.radio-wrapper input[type="radio"] { border-radius: 50%; }

.checkbox:hover:not(:disabled),
.checkbox-wrapper:hover input[type="checkbox"]:not(:disabled),
.radio:hover:not(:disabled),
.radio-wrapper:hover input[type="radio"]:not(:disabled) { border-color: var(--marmo-blue-dark); }

.checkbox:checked,
.checkbox:indeterminate,
.checkbox-wrapper input[type="checkbox"]:checked,
.checkbox-wrapper input[type="checkbox"]:indeterminate {
  background-color: var(--marmo-blue-dark);
  border-color: var(--marmo-blue-dark);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px;
}
.checkbox:checked,
.checkbox-wrapper input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.checkbox:indeterminate,
.checkbox-wrapper input[type="checkbox"]:indeterminate {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E");
}
.radio:checked,
.radio-wrapper input[type="radio"]:checked {
  border-color: var(--marmo-blue-dark);
  border-width: 4px;
}

.checkbox:focus,
.checkbox-wrapper input[type="checkbox"]:focus,
.radio:focus,
.radio-wrapper input[type="radio"]:focus {
  outline: none;
  border-color: var(--focus-color);
}
.checkbox:disabled, .radio:disabled,
.checkbox-wrapper input:disabled, .radio-wrapper input:disabled {
  background-color: var(--marmo-surface);
  border-color: var(--marmo-line);
}
.checkbox:disabled:checked, .checkbox-wrapper input:disabled:checked { background-color: #b7c3d1; border-color: #b7c3d1; }
.radio:disabled:checked, .radio-wrapper input:disabled:checked { border-color: #b7c3d1; }

[aria-invalid="true"].checkbox,
.checkbox-wrapper input[aria-invalid="true"],
.choice-group[aria-invalid="true"] input { border-color: var(--marmo-red); }

/* Interruptor: activa algo al momento, sin botón de guardar */
.switch,
.switch-wrapper input[type="checkbox"] {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border: 1.5px solid #a9b8ca;
  border-radius: 999px;
  background: #e3e9f1;
  appearance: none;
  cursor: inherit;
  transition: background-color var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.switch::before,
.switch-wrapper input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--marmo-white);
  border: 1px solid #a9b8ca;
  transition: transform var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
.switch:checked,
.switch-wrapper input[type="checkbox"]:checked {
  background: var(--marmo-blue-dark);
  border-color: var(--marmo-blue-dark);
}
.switch:checked::before,
.switch-wrapper input[type="checkbox"]:checked::before {
  transform: translateX(16px);
  border-color: var(--marmo-white);
}
.switch:focus,
.switch-wrapper input[type="checkbox"]:focus { outline: none; border-color: var(--focus-color); }
.switch:disabled,
.switch-wrapper input:disabled { opacity: .5; }
[data-ui="app"] .switch, .ui-app .switch,
[data-ui="app"] .switch-wrapper input[type="checkbox"], .ui-app .switch-wrapper input[type="checkbox"] { border-radius: 6px; }
[data-ui="app"] .switch::before, .ui-app .switch::before,
[data-ui="app"] .switch-wrapper input[type="checkbox"]::before, .ui-app .switch-wrapper input[type="checkbox"]::before { border-radius: 4px; }

.switch-wrapper.is-right { flex-direction: row-reverse; justify-content: space-between; width: 100%; }

/* Grupo de opciones */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.choice-group.is-inline { flex-direction: row; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.choice-group > legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-semibold);
  color: var(--marmo-ink);
}
.choice-group > legend + * { margin-top: 0; }

/* Opción en tarjeta (planes, tipos de cita) */
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius-field, var(--radius-sm));
  background: var(--marmo-white);
  cursor: pointer;
  transition: border-color var(--duration-state) var(--ease), background-color var(--duration-state) var(--ease);
}
.choice-card:hover { border-color: var(--marmo-blue-34); }
.choice-card:has(input:checked) { border-color: var(--marmo-blue-dark); background: var(--marmo-blue-light); }
.choice-card:has(input:focus) { border-color: var(--focus-color); }
.choice-card:has(input:focus) input { outline: none; }
.choice-card:not(:has(.choice-desc)) { align-items: center; min-height: var(--field-h); }
.choice-card strong { display: block; font-weight: var(--weight-semibold); color: var(--marmo-ink); }

/* ---------- Deslizador ---------- */
.range-field { display: flex; align-items: center; gap: var(--space-3); }
.range-field output {
  min-width: 56px;
  text-align: right;
  font-weight: var(--weight-semibold);
  color: var(--marmo-blue-dark);
  font-variant-numeric: tabular-nums;
}
.slider,
.range {
  --val: 50%;
  flex: 1;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track,
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--marmo-blue-dark) var(--val), var(--marmo-line) var(--val));
}
.slider::-moz-range-track, .range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--marmo-line); }
.slider::-moz-range-progress, .range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--marmo-blue-dark); }
.slider::-webkit-slider-thumb,
.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border: 2px solid var(--marmo-blue-dark);
  border-radius: 50%;
  background: var(--marmo-white);
}
.slider::-moz-range-thumb, .range::-moz-range-thumb {
  width: 16px; height: 16px;
  border: 2px solid var(--marmo-blue-dark);
  border-radius: 50%;
  background: var(--marmo-white);
}
.slider:focus, .range:focus { outline: none; }
.slider:focus::-webkit-slider-thumb,
.range:focus::-webkit-slider-thumb { border-color: var(--focus-color); }
.slider:focus::-moz-range-thumb,
.range:focus::-moz-range-thumb { border-color: var(--focus-color); }
.slider:disabled, .range:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Subida de archivos ---------- */
.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-5);
  border: 1.5px dashed #b9c7d8;
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-surface);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-state) var(--ease), background-color var(--duration-state) var(--ease);
}
.file-drop svg { width: 24px; height: 24px; color: var(--marmo-blue-dark); margin-bottom: 4px; }
.file-drop:hover,
.file-drop.is-dragover { border-color: var(--marmo-blue-dark); background: var(--marmo-blue-light); }
.file-drop:has(input:focus) { border-style: solid; border-color: var(--focus-color); }
.file-drop input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-drop-title { font-weight: var(--weight-semibold); color: var(--marmo-blue-dark); font-size: var(--text-tarjeta); }
.file-drop-title u { text-underline-offset: 3px; }
.file-drop-hint { font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.file-drop.is-invalid { border-color: var(--marmo-red); }

.file-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius-field, var(--radius-sm));
  background: var(--marmo-white);
  font-size: var(--text-tarjeta);
}
.file-list svg { width: 16px; height: 16px; color: var(--marmo-muted); flex: none; }
.file-list .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--marmo-text); }
.file-list .file-size { color: var(--marmo-muted); font-size: var(--text-etiqueta); font-variant-numeric: tabular-nums; }

/* ---------- Maquetación de formularios ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(var(--form-cols, 2), minmax(0, 1fr));
  gap: var(--space-4) var(--space-4);
}
.form-grid > .form-group { margin: 0; }
.form-grid > .span-2 { grid-column: span 2; }
.form-grid > .span-all { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .span-2 { grid-column: auto; }
}

.form-section {
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
  min-width: 0;
}
.form-section > legend,
.form-section-title {
  padding: 0;
  margin: 0 0 var(--space-1);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--marmo-ink);
}
.form-section-desc { margin: 0 0 var(--space-4); font-size: var(--text-tarjeta); color: var(--marmo-muted); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  margin-top: var(--space-5);
  border-top: var(--border);
}
.form-actions.is-start { justify-content: flex-start; }
.form-actions .form-actions-aside { margin-right: auto; }

/* Resumen de errores al enviar */
.form-summary {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--marmo-red);
  border-left-width: 4px;
  border-radius: var(--ui-radius-field, var(--radius-sm));
  background: #fdf5f4;
  color: var(--marmo-text);
  font-size: var(--text-tarjeta);
}
.form-summary[hidden] { display: none; }
.form-summary strong { display: block; color: var(--marmo-red); margin-bottom: 4px; }
.form-summary ul { margin: 0; padding-left: 18px; }
.form-summary a { color: var(--marmo-text); }

/* ---------- Sobre fondo oscuro ---------- */
.on-dark .form-label, .section-dark .form-label { color: var(--marmo-white); }
.on-dark .form-helper, .section-dark .form-helper { color: var(--marmo-white-72); }
.on-dark .input:focus, .section-dark .input:focus { border-color: var(--focus-color-dark); }

/* Ajustes */
.choice-group > legend .form-req,
.choice-group > legend .form-optional { margin-left: 4px; }

/* ---------- Obligatorio pendiente ----------
   Un campo obligatorio lleva el borde en rojo de marca mientras está vacío o sin elegir,
   también con el foco. En cuanto se escribe o se elige algo, vuelve al estado normal
   (y con el foco, al azul oscuro corporativo). En PHP: 'required' => true. */
.input:required:placeholder-shown:not(:disabled):not([readonly]),
.input[type="date"]:required:invalid:not(:disabled),
.input[type="time"]:required:invalid:not(:disabled),
.input[type="datetime-local"]:required:invalid:not(:disabled),
select.input:required:has(option[value=""]:checked):not(:disabled),
.select-trigger.is-empty[aria-required="true"]:not(:disabled),
.checkbox:required:not(:checked):not(:disabled),
.checkbox-wrapper input[type="checkbox"]:required:not(:checked):not(:disabled),
:is(.choice-group, .form-group):has(input[type="radio"]:required):not(:has(input[type="radio"]:checked)) :is(.choice-card, input[type="radio"]:not(:disabled):not(.choice-card input)),
.file-drop:has(input[type="file"]:required:invalid) {
  border-color: var(--marmo-red);
  --pulse-c: rgba(201, 53, 43, 0.5);
}

/* ---------- Desplegable propio (select.input mejorado por JS) ----------
   El <select> queda oculto debajo y es el que se envía. El botón copia sus clases,
   así que tiene el mismo alto, borde, foco y estado obligatorio que un campo. */
.select-ui { position: relative; display: block; min-width: 0; }
.select-native {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.select-trigger {
  display: flex;
  align-items: center;
  text-align: left;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2306264a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.select-trigger[aria-expanded="true"] {
  border-color: var(--focus-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2306264a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'/%3E%3C/svg%3E");
}
.select-trigger:disabled { cursor: not-allowed; background-color: var(--marmo-surface); color: #a7b1bd; }
.select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-trigger.is-placeholder .select-value { color: #9aa5b1; }
.input-sm .select-trigger, .select-trigger.input-sm { padding-right: 30px; background-position: right 8px center; }
.pagination-size .select-ui { display: inline-block; }
.pagination-size .select-trigger { width: auto; min-width: 64px; --fh: var(--field-h-sm); padding-left: 10px; }

.select-list, .select-popup {
  --select-item-h: 32px;
  position: fixed;
  z-index: 1000;
  max-height: calc(var(--select-item-h) * 7 + 10px); /* 7 opciones a la vista; el resto con scroll */
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius-field, var(--radius-sm));
  background: var(--marmo-white);
  box-shadow: var(--shadow-float);
  font-family: var(--font-sans);
  font-size: var(--field-font);
  scrollbar-width: thin;
  scrollbar-color: #c3cfdd transparent;
}
.select-list[hidden] { display: none; }
.select-popup { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: calc(100dvh - 16px); max-width: calc(100vw - 16px); }
.select-popup[hidden] { display: none; }
.select-popup .select-list { position: relative; min-height: 0; flex: 1 1 auto; border: 0; border-radius: 0; box-shadow: none; }
.select-popup .select-list:empty { display: none; }
.select-search { flex: none; padding: var(--space-2); border-bottom: var(--border); }
.select-search .input { width: 100%; }
.select-empty { margin: 0; padding: var(--space-3); color: var(--marmo-muted); font-size: var(--field-font); }
.select-empty[hidden] { display: none; }
.select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--select-item-h);
  padding: 0 10px;
  border-radius: max(calc(var(--ui-radius-field, 6px) - 2px), 4px);
  color: var(--marmo-text);
  cursor: pointer;
  user-select: none;
}
.select-option > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-option::after { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; }
.select-option.is-active { background: var(--marmo-blue-hover-bg); }
.select-option[aria-selected="true"] { color: var(--marmo-ink); font-weight: var(--weight-semibold); }
.select-option[aria-selected="true"]::after { background: var(--marmo-blue-dark); } /* el elegido: punto azul corporativo */
.select-option.is-placeholder { color: #9aa5b1; }
.select-option[aria-disabled="true"] { color: #b3bcc7; cursor: not-allowed; }
.select-group { padding: 8px 10px 4px; font-size: 0.68rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-gold); }
.select-group:first-child { padding-top: 4px; }

/* Email stays red while invalid, including focus and hover. */
.input[type="email"]:invalid:not(:disabled):not([readonly]) {
  border-color: var(--marmo-red);
  animation: none;
}

/* ===== components/badges ===== */
/* ============================================================
   MARMO UI — Etiquetas, contadores, chips, estados y avatares
   Un estado nunca se comunica solo con color: lleva su texto.
   Sin colores nuevos: azules, rojo, oro y el verde de éxito.
   ============================================================ */

/* ---------- Etiqueta ---------- */
.badge {
  --bdg-bg: var(--marmo-surface);
  --bdg-fg: var(--marmo-text);
  --bdg-bd: var(--marmo-line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--bdg-bd);
  border-radius: var(--ui-radius-badge, 999px);
  background: var(--bdg-bg);
  color: var(--bdg-fg);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.badge svg { width: 12px; height: 12px; flex: none; }

/* Neutra (también badge-default / badge-secondary de neokit) */
.badge-neutral, .badge-default, .badge-secondary { --bdg-bg: var(--marmo-surface); --bdg-fg: var(--marmo-text); --bdg-bd: var(--marmo-line); }
/* Informativa: azul claro (manual: «fondos suaves y etiquetas») */
.badge-info, .badge-primary { --bdg-bg: var(--marmo-blue-light); --bdg-fg: var(--marmo-blue-dark); --bdg-bd: #d3e3f3; }
/* Fuerte: azul de marca */
.badge-strong { --bdg-bg: var(--marmo-blue-dark); --bdg-fg: var(--marmo-white); --bdg-bd: var(--marmo-blue-dark); }
/* Correcto */
.badge-success { --bdg-bg: #eef4f1; --bdg-fg: var(--marmo-success); --bdg-bd: #cfe0d8; }
/* Pendiente / atención: oro como texto y filete, nunca como fondo */
.badge-warning { --bdg-bg: var(--marmo-white); --bdg-fg: var(--marmo-gold); --bdg-bd: #d9c49a; }
/* Error / anulado */
.badge-danger, .badge-error { --bdg-bg: #fbecea; --bdg-fg: var(--marmo-red); --bdg-bd: #f2cbc7; }
/* Oferta y ahorro (manual: «Ahorras 850 €» en rojo) */
.badge-offer { --bdg-bg: var(--marmo-white); --bdg-fg: var(--marmo-red); --bdg-bd: var(--marmo-red); }

/* Con punto de estado */
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge-lg { height: 26px; padding: 0 10px; font-size: var(--text-etiqueta); }

/* Sobre oscuro */
.on-dark .badge-neutral, .section-dark .badge-neutral,
.on-dark .badge-default, .section-dark .badge-default { --bdg-bg: var(--marmo-white-12); --bdg-fg: var(--marmo-white); --bdg-bd: rgba(255,255,255,.2); }
.on-dark .badge-strong, .section-dark .badge-strong { --bdg-bg: var(--marmo-white); --bdg-fg: var(--marmo-blue-dark); --bdg-bd: var(--marmo-white); }
.on-dark .badge-warning, .section-dark .badge-warning { --bdg-bg: transparent; --bdg-fg: var(--marmo-gold-light); --bdg-bd: rgba(201,164,92,.6); }

/* ---------- Contador ---------- */
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--marmo-blue-dark);
  color: var(--marmo-white);
  font-size: 0.7rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count-alert { background: var(--marmo-red); }
.count-soft { background: var(--marmo-blue-light); color: var(--marmo-blue-dark); }
.count:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; }

/* ---------- Chip ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius, 999px);
  background: var(--marmo-white);
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; flex: none; }
.chip:has(.chip-remove) { padding-right: 4px; }
.chip-remove,
.chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: max(calc(var(--ui-radius, 999px) - 4px), 4px);
  background: transparent;
  color: var(--marmo-muted);
  cursor: pointer;
  font: inherit;
}
.chip-remove:hover, .chip-close:hover { background: var(--marmo-blue-hover-bg); color: var(--marmo-blue-dark); }
.chip-remove, .chip-close { border: 1px solid transparent; }
.chip-remove:focus-visible, .chip-close:focus-visible { outline: none; border-color: var(--focus-color); color: var(--marmo-blue-dark); }

/* Chip seleccionable (filtro) */
button.chip { cursor: pointer; transition: background-color var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease), color var(--duration-state) var(--ease); }
button.chip:hover { border-color: var(--marmo-blue-34); color: var(--marmo-blue-dark); }
button.chip[aria-pressed="true"] { background: var(--marmo-blue-dark); border-color: var(--marmo-blue-dark); color: var(--marmo-white); }
button.chip:focus-visible { outline: none; border-color: var(--focus-color); }
button.chip[aria-pressed="true"]:focus-visible { border-color: var(--focus-color); box-shadow: inset 0 0 0 1px var(--marmo-white); }
.chip-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }

/* ---------- Estado con punto ---------- */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-tarjeta);
  color: var(--marmo-text);
  line-height: 1.3;
}
.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sts, var(--marmo-muted));
  flex: none;
}
.status-dot.online  { --sts: var(--marmo-success); }
.status-dot.away    { --sts: var(--marmo-gold-light); }
.status-dot.busy    { --sts: var(--marmo-red); }
.status-dot.offline { --sts: #b7c3d1; }
.status-dot.offline::before { background: transparent; border: 1.5px solid #9aa5b1; width: 7px; height: 7px; }

/* ---------- Avatar ---------- */
.avatar {
  --avt: 32px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--avt);
  height: var(--avt);
  border-radius: 50%;
  background: var(--marmo-blue-light);
  color: var(--marmo-blue-dark);
  font-family: var(--font-sans);
  font-size: calc(var(--avt) * 0.38);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar.tone-2 { background: var(--marmo-blue-dark); color: var(--marmo-white); }
.avatar.tone-3 { background: var(--marmo-surface); color: var(--marmo-ink); box-shadow: inset 0 0 0 1px var(--marmo-line); }
.avatar-xs { --avt: 20px; }
.avatar-sm { --avt: 24px; }
.avatar-md { --avt: 32px; }
.avatar-lg { --avt: 40px; }
.avatar-xl { --avt: 56px; }
.avatar-square { border-radius: var(--ui-radius-card, 8px); }

/* Estado sobre el avatar */
.avatar .avatar-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: max(8px, calc(var(--avt) * 0.28));
  height: max(8px, calc(var(--avt) * 0.28));
  border: 2px solid var(--marmo-white);
  border-radius: 50%;
  background: var(--sts, #b7c3d1);
}
.avatar-status.online  { --sts: var(--marmo-success); }
.avatar-status.away    { --sts: var(--marmo-gold-light); }
.avatar-status.busy    { --sts: var(--marmo-red); }

/* Grupo */
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--marmo-white); }
.avatar-group .avatar + .avatar { margin-left: calc(var(--avt) * -0.28); }
.avatar-group .avatar-more { background: var(--marmo-surface); color: var(--marmo-muted); font-size: calc(var(--avt) * 0.32); text-transform: none; }

/* Persona: avatar + nombre + dato */
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.person-name { display: block; font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); color: var(--marmo-ink); line-height: 1.3; }
.person-meta { display: block; font-size: var(--text-etiqueta); color: var(--marmo-muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== components/tabs ===== */
/* ============================================================
   MARMO UI — Pestañas, filtros en píldora, paginación y acordeón
   La pestaña activa se marca con texto azul y filete de 2 px en oro
   (el mismo gesto que el menú de la web).
   ============================================================ */

/* ---------- Pestañas en línea ---------- */
.tabs {
  position: relative;
  display: flex;
  gap: var(--space-1);
  border-bottom: var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 44px;
  padding: 0 14px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--marmo-muted);
  font-family: var(--font-sans);
  font-size: var(--text-menu);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-state) var(--ease);
}
.tab-item svg { width: 16px; height: 16px; }
.tab-item::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--marmo-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-state) var(--ease);
}
.tab-item:hover { color: var(--marmo-blue-dark); }
.tab-item:hover::after { transform: scaleX(1); background: var(--marmo-line); }
.tab-item[aria-selected="true"],
.tab-item.active { color: var(--marmo-blue-dark); }
.tab-item[aria-selected="true"]::after,
.tab-item.active::after { transform: scaleX(1); background: var(--marmo-gold); }
.tab-item:focus { outline: none; }
.tab-item { border: 1px solid transparent !important; border-radius: 4px 4px 0 0; }
.tab-item:focus-visible { outline: none; border-color: var(--focus-color) !important; }
.tab-item:disabled { color: #b7c3d1; cursor: not-allowed; }
.tab-item:disabled::after { display: none; }
.tab-item .count { height: 18px; min-width: 18px; font-size: 0.66rem; }
.tab-item:not([aria-selected="true"]):not(.active) .count { background: var(--marmo-blue-light); color: var(--marmo-blue-dark); }

.tabs-sm .tab-item { height: 36px; padding: 0 10px; font-size: var(--text-etiqueta); }
.tabs-sm .tab-item::after { left: 10px; right: 10px; }
.tabs-fill .tab-item { flex: 1; justify-content: center; }

.tab-panel { padding-top: var(--space-5); }
.tab-panel[hidden] { display: none !important; }
.tab-panel:focus { outline: none; }
.tab-panel:focus-visible { outline: none; }

/* Indicador de que hay más pestañas a los lados */
.tabs-wrap { position: relative; }
.tabs-wrap.has-more-right::after,
.tabs-wrap.has-more-left::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 1px;
  width: 32px;
  pointer-events: none;
  z-index: 1;
}
.tabs-wrap.has-more-right::after { right: 0; background: linear-gradient(to left, var(--tabs-bg, var(--marmo-white)), transparent); }
.tabs-wrap.has-more-left::before { left: 0; background: linear-gradient(to right, var(--tabs-bg, var(--marmo-white)), transparent); }

/* ---------- Pestañas verticales (ajustes) ---------- */
.tabs-vertical { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.tabs-vertical .tabs {
  flex-direction: column;
  gap: 2px;
  border-bottom: 0;
  border-left: var(--border);
  overflow: visible;
}
.tabs-vertical .tab-item { height: 40px; justify-content: flex-start; padding: 0 14px; margin-left: -1px; border-left: 2px solid transparent; }
.tabs-vertical .tab-item::after { display: none; }
.tabs-vertical .tab-item:hover { border-left-color: var(--marmo-line); }
.tabs-vertical .tab-item[aria-selected="true"] { border-left-color: var(--marmo-gold); background: var(--marmo-surface); }
.tabs-vertical .tab-panel { padding-top: 0; }
@media (max-width: 760px) {
  .tabs-vertical { grid-template-columns: 1fr; gap: var(--space-4); }
  .tabs-vertical .tabs { flex-direction: row; border-left: 0; border-bottom: var(--border); overflow-x: auto; }
  .tabs-vertical .tab-item { margin-left: 0; border-left: 0; }
  .tabs-vertical .tab-item[aria-selected="true"] { background: transparent; box-shadow: inset 0 -2px 0 var(--marmo-gold); }
}

/* ---------- Filtros en píldora ---------- */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--marmo-line);
  border-radius: var(--ui-radius, 999px);
  background: var(--marmo-white);
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
}
.pill:hover { border-color: var(--marmo-blue-34); color: var(--marmo-blue-dark); }
.pill[aria-pressed="true"], .pill.active { background: var(--marmo-blue-dark); border-color: var(--marmo-blue-dark); color: var(--marmo-white); }
.pill:focus-visible { outline: none; border-color: var(--focus-color); }
.pill[aria-pressed="true"]:focus-visible, .pill.active:focus-visible { box-shadow: inset 0 0 0 1px var(--marmo-white); }
.pill .pill-count { color: var(--marmo-muted); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.pill[aria-pressed="true"] .pill-count, .pill.active .pill-count { color: var(--marmo-white-78); }

/* ---------- Paginación ---------- */
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}
.pagination-info { font-size: var(--text-tarjeta); color: var(--marmo-muted); font-variant-numeric: tabular-nums; }
.pagination-info strong { color: var(--marmo-text); font-weight: var(--weight-semibold); }
.pagination { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-field, 6px);
  background: transparent;
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-state) var(--ease), border-color var(--duration-state) var(--ease);
}
[data-ui="web"] .page-btn, .ui-web .page-btn { border-radius: 999px; }
.page-btn svg { width: 16px; height: 16px; }
.page-btn:hover { background: var(--marmo-blue-hover-bg); color: var(--marmo-blue-dark); }
.page-btn[aria-current="page"], .page-btn.active { background: var(--marmo-blue-dark); color: var(--marmo-white); }
.page-btn:focus-visible { outline: none; border-color: var(--focus-color); }
.page-btn[aria-disabled="true"], .page-btn:disabled, .page-btn.disabled { color: #b7c3d1; cursor: not-allowed; background: transparent; }
.page-gap { min-width: 24px; text-align: center; color: var(--marmo-muted); }
.page-btn.page-nav { gap: 6px; padding: 0 10px; border-color: var(--marmo-line); }
.pagination-compact { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-tarjeta); color: var(--marmo-muted); }
.pagination-compact strong { color: var(--marmo-text); }
.pagination-size { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-tarjeta); color: var(--marmo-muted); }
.pagination-size select.input { width: auto; --fh: var(--field-h-sm); padding-left: 10px; }
@media (max-width: 640px) {
  .pagination .page-num:not([aria-current="page"]) { display: none; }
  .pagination .page-gap { display: none; }
}

/* ---------- Acordeón (details/summary nativo) ---------- */
.accordion {
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
  overflow: hidden;
}
.accordion-item + .accordion-item { border-top: var(--border); }
.accordion-item > summary,
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  border: 0;
  background: transparent;
  color: var(--marmo-ink);
  font-family: var(--font-sans);
  font-size: var(--text-cuerpo);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  text-align: left;
  list-style: none;
  cursor: pointer;
  transition: background-color var(--duration-state) var(--ease);
}
.accordion-item > summary::-webkit-details-marker { display: none; }
.accordion-item > summary:hover,
.accordion-trigger:hover { background: var(--marmo-surface); }
.accordion-item > summary:focus { outline: none; }
.accordion-item > summary,
.accordion-trigger { border: 1px solid transparent; }
.accordion-item > summary:focus-visible,
.accordion-trigger:focus-visible { outline: none; border-color: var(--focus-color); }
.accordion-chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--marmo-blue-dark);
  transition: transform var(--duration-state) var(--ease);
  font-size: 0; /* oculta el «⌄» de texto antiguo */
}
.accordion-chevron::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 20px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.accordion-item[open] > summary .accordion-chevron,
.accordion-item.open .accordion-chevron,
.accordion-trigger[aria-expanded="true"] .accordion-chevron { transform: rotate(180deg); }
.accordion-item[open] > summary { color: var(--marmo-blue-dark); }
.accordion-body { padding: 0 var(--space-5) var(--space-5); color: var(--marmo-muted); font-size: var(--text-tarjeta); line-height: 1.6; }
.accordion-body > :first-child { margin-top: 0; }
.accordion-body > :last-child { margin-bottom: 0; }
/* Marcado antiguo (div + botón) */
.accordion-item:not(details) .accordion-body { display: none; }
.accordion-item.open:not(details) .accordion-body { display: block; }

.accordion-flush { border: 0; border-radius: 0; border-top: var(--border); border-bottom: var(--border); }
.accordion-flush .accordion-item > summary { padding-inline: 0; }
.accordion-flush .accordion-body { padding-inline: 0; }

/* ===== components/modal ===== */
/* ============================================================
   MARMO UI — Diálogos (modal) y paneles laterales (drawer)
   Elemento <dialog> nativo: foco retenido, Escape y fondo inerte
   sin código extra. La sombra solo aquí: es lo que flota.
   ============================================================ */

html.ui-scroll-lock { overflow: hidden; }

.modal,
.drawer {
  --mod-w: 560px;
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--marmo-white);
  color: var(--marmo-text);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
dialog.modal:not([open]),
dialog.drawer:not([open]) { display: none; }

.modal::backdrop,
.drawer::backdrop {
  background: rgba(4, 26, 51, 0.56); /* veladura marmo-blue-deep */
}

/* ---------- Diálogo ---------- */
dialog.modal {
  width: min(var(--mod-w), calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border-radius: var(--ui-radius-card, var(--radius-md));
}
dialog.modal[open] {
  display: flex;
  flex-direction: column;
  animation: mod-in var(--duration-state) var(--ease);
}
dialog.modal[open]::backdrop { animation: mod-fade var(--duration-state) var(--ease); }
.modal-sm { --mod-w: 420px; }
.modal-md { --mod-w: 560px; }
.modal-lg { --mod-w: 800px; }
.modal-xl { --mod-w: 1080px; }

.modal-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: var(--border);
  flex: none;
}
.modal-title,
.drawer-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-titulo-menor);
  font-weight: var(--weight-regular);
  line-height: 1.2;
  color: var(--marmo-blue-dark);
}
.modal-desc,
.drawer-desc {
  margin: 4px 0 0;
  font-size: var(--text-tarjeta);
  color: var(--marmo-muted);
  line-height: 1.5;
}
.modal-close,
.drawer-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -4px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius-field, 6px);
  background: transparent;
  color: var(--marmo-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close svg, .drawer-close svg { width: 20px; height: 20px; }
.modal-close:hover, .drawer-close:hover { background: var(--marmo-blue-hover-bg); color: var(--marmo-blue-dark); }
.modal-close, .drawer-close { border: 1px solid transparent !important; }
.modal-close:focus-visible, .drawer-close:focus-visible { outline: none; border-color: var(--focus-color) !important; color: var(--marmo-blue-dark); }

.modal-body,
.drawer-body {
  flex: 1;
  min-height: 0;
  padding: var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: var(--text-cuerpo);
  line-height: 1.6;
}
.modal-body > :first-child, .drawer-body > :first-child { margin-top: 0; }
.modal-body > :last-child, .drawer-body > :last-child { margin-bottom: 0; }

.modal-footer,
.drawer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: var(--border);
  background: var(--marmo-surface);
  flex: none;
}
.modal-footer .modal-footer-aside { margin-right: auto; font-size: var(--text-etiqueta); color: var(--marmo-muted); }

/* Confirmación: icono + título + texto, sin cabecera separada */
.modal-confirm .modal-confirm-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5) var(--space-5);
}
.modal-confirm .modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--marmo-blue-light);
  color: var(--marmo-blue-dark);
}
.modal-confirm.is-danger .modal-icon { background: #fbecea; color: var(--marmo-red); }
.modal-confirm .modal-icon svg { width: 22px; height: 22px; }
.modal-confirm .modal-title { font-size: 1.375rem; }
.modal-confirm p { margin: 6px 0 0; color: var(--marmo-muted); font-size: var(--text-tarjeta); }
.modal-confirm .modal-footer { background: var(--marmo-white); border-top: 0; padding-top: 0; }

@media (max-width: 560px) {
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--ui-radius-card, 10px) var(--ui-radius-card, 10px) 0 0; }
  .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  .modal-footer .btn { width: 100%; }
  .modal-confirm .modal-confirm-body { grid-template-columns: 1fr; }
}

/* ---------- Panel lateral ---------- */
dialog.drawer {
  --drw-w: 480px;
  position: fixed;
  inset: 0 0 0 auto;
  width: min(var(--drw-w), 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
}
dialog.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drw-in-r 220ms var(--ease);
}
dialog.drawer.drawer-left { inset: 0 auto 0 0; }
dialog.drawer.drawer-left[open] { animation-name: drw-in-l; }
.drawer-lg { --drw-w: 720px; }
.drawer-sm { --drw-w: 380px; }
dialog.drawer[open]::backdrop { animation: mod-fade 220ms var(--ease); }

@keyframes mod-in   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mod-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drw-in-r { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drw-in-l { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog.modal[open], dialog.drawer[open], dialog[open]::backdrop { animation: none; }
}

/* Contenido habitual del panel: lista de datos */
.drawer-dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px var(--space-4); margin: 0; font-size: var(--text-tarjeta); }
.drawer-dl dt { color: var(--marmo-muted); }
.drawer-dl dd { margin: 0; color: var(--marmo-text); font-weight: var(--weight-medium); }

/* ---------- Compatibilidad con el marcado de neokit (.overlay / .drawer-overlay) ---------- */
.overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 26, 51, 0.56); }
.overlay.open { display: flex; }
.overlay > .modal { width: min(var(--mod-w), 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; border-radius: var(--ui-radius-card, 10px); }
.drawer-overlay { position: fixed; inset: 0; z-index: 999; display: none; background: rgba(4, 26, 51, 0.56); }
.drawer-overlay.open { display: block; }
aside.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1000; width: min(480px, 100vw); display: none; flex-direction: column; }
aside.drawer.open { display: flex; }

/* Título que es un modelo o un precio: siempre Hanken Grotesk (regla 08 del manual) */
.modal-title.is-sans,
.drawer-title.is-sans {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-modelo);
  text-transform: uppercase;
  color: var(--marmo-ink);
}

/* ===== components/feedback ===== */
/* ============================================================
   MARMO UI — Avisos y progreso
   Alertas, notificaciones flotantes (toast), progreso, pasos,
   carga, esqueletos y estado vacío.
   Manual: «qué ha pasado y qué hacer, sin culpar». Sin exclamaciones.
   ============================================================ */

/* ---------- Alerta ---------- */
.alert {
  --alr-bg: var(--marmo-blue-light);
  --alr-bd: #cfdff0;
  --alr-ic: var(--marmo-blue-dark);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--alr-bd);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--alr-bg);
  color: var(--marmo-text);
  font-size: var(--text-tarjeta);
  line-height: 1.5;
}
.alert-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--alr-ic);
  font-size: 0; /* oculta los símbolos de texto antiguos (✓ ⚠) */
}
.alert-icon svg { width: 20px; height: 20px; }
.alert-content { min-width: 0; }
.alert-title { display: block; font-weight: var(--weight-semibold); color: var(--marmo-ink); margin-bottom: 2px; }
.alert-content p { margin: 0; }
.alert-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.alert-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px -6px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--marmo-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.alert-close svg { width: 16px; height: 16px; }
.alert-close:hover { background: rgba(6, 38, 74, 0.08); color: var(--marmo-ink); }
.alert-close { border: 1px solid transparent !important; }
.alert-close:focus-visible { outline: none; border-color: var(--focus-color) !important; color: var(--marmo-ink); }
.alert:not(:has(.alert-close)) { grid-template-columns: auto 1fr; }

.alert-info    { --alr-bg: var(--marmo-blue-light); --alr-bd: #cfdff0; --alr-ic: var(--marmo-blue-dark); }
.alert-success { --alr-bg: #eef4f1; --alr-bd: #cfe0d8; --alr-ic: var(--marmo-success); }
.alert-warning { --alr-bg: var(--marmo-white); --alr-bd: #d9c49a; --alr-ic: var(--marmo-gold); }
.alert-danger,
.alert-error   { --alr-bg: #fdf5f4; --alr-bd: #f2cbc7; --alr-ic: var(--marmo-red); }

/* Franja a todo el ancho (arriba de la página o de un panel) */
.alert-banner { border-radius: 0; border-width: 0 0 1px; padding-inline: max(16px, calc((100% - 1180px) / 2)); }
/* Compacta, dentro de una tarjeta o formulario */
.alert-sm { padding: 10px 12px; gap: 10px; font-size: var(--text-etiqueta); }
.alert-sm .alert-icon, .alert-sm .alert-icon svg { width: 16px; height: 16px; }

/* ---------- Notificación flotante (toast) ---------- */
.toast-container,
.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  --tst-ic: var(--marmo-blue-dark);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--marmo-line);
  border-left: 3px solid var(--tst-ic);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
  color: var(--marmo-text);
  box-shadow: var(--shadow-float);
  font-size: var(--text-tarjeta);
  line-height: 1.45;
  pointer-events: auto;
  animation: tst-in 200ms var(--ease);
}
.toast.success { --tst-ic: var(--marmo-success); }
.toast.warning { --tst-ic: var(--marmo-gold); }
.toast.danger, .toast.error { --tst-ic: var(--marmo-red); }
.toast-icon { display: inline-flex; color: var(--tst-ic); margin-top: 1px; font-size: 0; }
.toast-icon svg { width: 20px; height: 20px; }
.toast-title { font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.toast-sub { color: var(--marmo-muted); margin-top: 2px; }
.toast-action { margin-top: 8px; }
.toast-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: -4px -4px 0 0; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--marmo-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.toast-close svg { width: 16px; height: 16px; }
.toast-close:hover { background: var(--marmo-blue-hover-bg); color: var(--marmo-ink); }
.toast-close { border: 1px solid transparent !important; }
.toast-close:focus-visible { outline: none; border-color: var(--focus-color) !important; color: var(--marmo-ink); }
.toast.removing { animation: tst-out 160ms var(--ease) forwards; }
@keyframes tst-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tst-out { to { opacity: 0; transform: translateX(16px); } }
@media (max-width: 560px) {
  .toast-container, .toast-region { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* Barras de progreso: components/progress/component.css */

/* ---------- Pasos ---------- */
.stepper {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
  counter-increment: step;
}
.step::before { /* línea entre pasos */
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--marmo-line);
}
.step:first-child::before { display: none; }
.step.done::before, .step.active::before, .step[aria-current="step"]::before { background: var(--marmo-blue-dark); }
.step-circle {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--marmo-line);
  border-radius: 50%;
  background: var(--marmo-white);
  color: var(--marmo-muted);
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.step-circle::before { content: counter(step); }
.step-circle svg { width: 16px; height: 16px; }
.step-circle:has(svg)::before { content: none; }
.step.done .step-circle { background: var(--marmo-blue-dark); border-color: var(--marmo-blue-dark); color: var(--marmo-white); font-size: 0; }
.step.done .step-circle::before { content: none; }
.step.done .step-circle::after {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.step.active .step-circle, .step[aria-current="step"] .step-circle { border-color: var(--marmo-blue-dark); color: var(--marmo-blue-dark); font-size: var(--text-etiqueta); }
.step.active .step-circle::after, .step[aria-current="step"] .step-circle::after { content: none; }
.step-label { font-size: var(--text-etiqueta); font-weight: var(--weight-semibold); color: var(--marmo-muted); line-height: 1.3; }
.step.done .step-label, .step.active .step-label, .step[aria-current="step"] .step-label { color: var(--marmo-ink); }
.step-desc { display: block; font-weight: var(--weight-regular); color: var(--marmo-muted); font-size: 0.72rem; }
.step a { color: inherit; text-decoration: none; }
.step a:hover .step-label { color: var(--marmo-blue); text-decoration: underline; }

/* Vertical (procesos largos: preentrega, alta de cliente) */
.stepper-vertical { flex-direction: column; gap: 0; }
.stepper-vertical .step { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; padding-bottom: var(--space-5); }
.stepper-vertical .step::before { display: none; }
.stepper-vertical .step:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--marmo-line); }
.stepper-vertical .step.done:not(:last-child)::after { background: var(--marmo-blue-dark); }
.stepper-vertical .step:last-child { padding-bottom: 0; }
.stepper-vertical .step-label { padding-top: 6px; font-size: var(--text-tarjeta); }
@media (max-width: 560px) {
  .stepper:not(.stepper-vertical) .step:not(.active):not([aria-current="step"]) .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Indicador de carga ---------- */
.spinner,
.ui-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--marmo-line);
  border-top-color: var(--marmo-blue-dark);
  border-radius: 50%;
  animation: spn 0.7s linear infinite;
  flex: none;
}
.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.on-dark .spinner, .section-dark .spinner { border-color: rgba(255,255,255,.25); border-top-color: var(--marmo-white); }
@keyframes spn { to { transform: rotate(360deg); } }
.loading-inline { display: inline-flex; align-items: center; gap: 10px; font-size: var(--text-tarjeta); color: var(--marmo-muted); }
.loading-block { display: grid; place-items: center; gap: var(--space-3); padding: var(--space-7) var(--space-4); color: var(--marmo-muted); font-size: var(--text-tarjeta); text-align: center; }

/* ---------- Esqueleto ---------- */
.skeleton {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 40%, #eef2f7 80%) 0 0 / 300% 100%;
  animation: skl 1.4s ease-in-out infinite;
}
.skeleton-text { height: 12px; margin: 8px 0; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 18px; width: 50%; margin: 4px 0 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skeleton-img { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--ui-radius-card, 8px); }
.skeleton-btn { width: 120px; height: 40px; border-radius: var(--ui-radius, 8px); }
@keyframes skl { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Estado vacío ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
  text-align: center;
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--marmo-blue-light);
  color: var(--marmo-blue-dark);
  font-size: 0; /* oculta emojis antiguos */
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { margin: 0; font-family: var(--font-serif); font-size: var(--text-titulo-menor); font-weight: 400; line-height: 1.2; color: var(--marmo-blue-dark); }
.empty-desc { margin: 0 0 var(--space-3); font-size: var(--text-tarjeta); color: var(--marmo-muted); line-height: 1.5; }
.empty-state-sm { padding: var(--space-5) var(--space-4); }
.empty-state-sm .empty-title { font-family: var(--font-sans); font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--marmo-ink); }

/* ===== components/layout-navigation ===== */
/* ============================================================
   MARMO UI — Navegación y estructura de la aplicación
   Logotipo siempre sobre azul: en fondo claro, dentro de su pastilla.
   Menú: estilo «menu» (0,85 rem · 600) y subrayado de 2 px en oro que
   crece desde la izquierda (manual, cap. 08).
   ============================================================ */

/* ---------- Logotipo ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) + 2px);
}
.brand:focus-visible { outline: none; border-color: var(--focus-color); }
.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;          /* manual: 7 px arriba y abajo, 10 px a los lados para 124 px */
  border-radius: var(--radius-md);
  background: var(--marmo-blue-dark);
}
.brand img, .brand svg { display: block; width: 124px; height: auto; }
.brand-sm img, .brand-sm svg { width: 118px; } /* mínimo en pantalla (móvil) */
.brand-app {
  margin-left: 10px;
  padding-left: 12px;
  border-left: var(--border);
  font-size: var(--text-menu);
  font-weight: var(--weight-semibold);
  color: var(--marmo-ink);
  white-space: nowrap;
}

/* ---------- Estructura: barra lateral + contenido ---------- */
.app-shell {
  --side-w: 248px;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--marmo-surface);
}
.app-shell.is-collapsed { --side-w: 72px; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-content { flex: 1; padding: var(--space-6) var(--space-6) var(--space-7); min-width: 0; }
@media (max-width: 760px) { .app-content { padding: var(--space-5) 16px var(--space-6); } }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 64px;
  padding: 0 var(--space-5);
  border-bottom: var(--border);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
}
.topbar-brand { display: inline-flex; align-items: center; text-decoration: none; }
.topbar-nav { display: flex; align-items: stretch; gap: var(--space-1); height: 100%; margin: 0 auto 0 var(--space-3); }
.topbar-nav-item,
.topbar-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--marmo-text);
  font-size: var(--text-menu);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}
.topbar-nav-item::after,
.topbar-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  height: 2px;
  background: var(--marmo-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-state) var(--ease);
}
.topbar-nav-item:hover, .topbar-nav a:hover { color: var(--marmo-blue-dark); }
.topbar-nav-item:hover::after, .topbar-nav a:hover::after,
.topbar-nav-item.active::after, .topbar-nav a[aria-current="page"]::after { transform: scaleX(1); }
.topbar-nav-item.active, .topbar-nav a[aria-current="page"] { color: var(--marmo-blue-dark); }
.topbar-nav a:focus-visible, .topbar-nav-item:focus-visible { outline: none; border-color: var(--focus-color); border-radius: 4px; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.topbar-nav + .topbar-actions { margin-left: 0; }
.topbar .menu-toggle { display: none; }
.topbar-title { font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--marmo-ink); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Versión transparente sobre vídeo/foto (web) */
.topbar-over { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, rgba(4,26,51,.7), rgba(4,26,51,0)); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.topbar-over .topbar-nav a { color: var(--marmo-white); }

@media (max-width: 1080px) {
  .topbar .topbar-nav { display: none; }
  .topbar .menu-toggle { display: inline-flex; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: var(--space-3); height: 56px; }
  .topbar .brand img, .topbar .brand svg { width: 118px; }
  .topbar .brand-app { display: none; }
}

/* Panel del menú en móvil (abre desde la barra superior) */
.mobile-nav {
  position: fixed;
  inset: 56px 0 0 0;
  z-index: 39;
  display: none;
  flex-direction: column;
  padding: var(--space-4) 16px var(--space-6);
  background: var(--marmo-white);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { display: flex; align-items: center; min-height: 48px; border-bottom: var(--border); color: var(--marmo-ink); font-weight: var(--weight-semibold); text-decoration: none; }
.mobile-nav a[aria-current="page"] { color: var(--marmo-blue-dark); box-shadow: inset 3px 0 0 var(--marmo-gold); padding-left: 12px; }

/* ---------- Barra lateral ---------- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: var(--side-w, 248px);
  height: 100dvh;
  border-right: var(--border);
  background: var(--marmo-white);
  overflow: hidden;
  transition: width 220ms var(--ease);
}
.sidebar-logo { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: 64px; padding: 0 var(--space-4); border-bottom: var(--border); flex: none; }
.sidebar-logo-mark { /* compatibilidad neokit: se oculta, va el logotipo real */ display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-3) var(--space-4); scrollbar-width: thin; }
.sidebar-section-label {
  display: block;
  margin: var(--space-5) 12px var(--space-2);
  color: var(--marmo-gold);
  font-size: var(--text-antetitulo);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-antetitulo);
  text-transform: uppercase;
  white-space: nowrap;
}
.sidebar-nav > .sidebar-section-label:first-child { margin-top: var(--space-2); }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-field, 8px);
  color: var(--marmo-text);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--duration-state) var(--ease), color var(--duration-state) var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--marmo-muted); }
.nav-item:hover { background: var(--marmo-surface); color: var(--marmo-blue-dark); }
.nav-item:hover svg { color: var(--marmo-blue-dark); }
.nav-item.active,
.nav-item[aria-current="page"] { background: var(--marmo-blue-light); color: var(--marmo-blue-dark); }
.nav-item.active svg, .nav-item[aria-current="page"] svg { color: var(--marmo-blue-dark); }
.nav-item.active::before,
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--marmo-gold); }
.nav-item:focus-visible { outline: none; border-color: var(--focus-color); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count, .nav-badge { margin-left: auto; }

/* Subniveles (details nativo) */
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .nav-chevron { margin-left: auto; width: 16px; height: 16px; transition: transform var(--duration-state) var(--ease); }
.nav-group[open] > summary .nav-chevron { transform: rotate(180deg); }
.nav-sub { margin: 2px 0 6px 21px; padding-left: 12px; border-left: var(--border); }
.nav-sub .nav-item { height: 34px; font-weight: var(--weight-medium); }
.nav-sub .nav-item::before { display: none; }

.sidebar-footer { flex: none; padding: var(--space-3); border-top: var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--ui-radius-field, 8px); min-width: 0; }
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); color: var(--marmo-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: var(--text-etiqueta); color: var(--marmo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse { flex: none; }

/* Plegada: solo iconos */
.is-collapsed .sidebar .nav-label,
.is-collapsed .sidebar .count,
.is-collapsed .sidebar .nav-badge,
.is-collapsed .sidebar .sidebar-user-info,
.is-collapsed .sidebar .nav-chevron,
.is-collapsed .sidebar .brand,
.is-collapsed .sidebar .nav-sub { display: none; }
.is-collapsed .sidebar .sidebar-section-label { font-size: 0; margin: var(--space-3) 12px; height: 1px; background: var(--marmo-line); }
.is-collapsed .sidebar .nav-item { justify-content: center; padding: 0; }
.is-collapsed .sidebar .sidebar-logo { justify-content: center; padding: 0; }
.is-collapsed .sidebar .sidebar-collapse svg { transform: rotate(180deg); }
.is-collapsed .sidebar .sidebar-user { justify-content: center; }

/* Barra lateral oscura: el logotipo va sin pastilla (fondo azul aprobado) */
.sidebar-dark { background: var(--marmo-gradient-dark); border-right: 0; color: var(--marmo-white); }
.sidebar-dark .sidebar-logo, .sidebar-dark .sidebar-footer { border-color: rgba(255,255,255,.12); }
.sidebar-dark .brand-pill { padding: 0; background: transparent; }
.sidebar-dark .sidebar-section-label { color: var(--marmo-gold-light); }
.sidebar-dark .nav-item { color: var(--marmo-white-78); }
.sidebar-dark .nav-item svg { color: var(--marmo-white-72); }
.sidebar-dark .nav-item:hover { background: var(--marmo-white-12); color: var(--marmo-white); }
.sidebar-dark .nav-item:hover svg { color: var(--marmo-white); }
.sidebar-dark .nav-item.active, .sidebar-dark .nav-item[aria-current="page"] { background: rgba(255,255,255,.14); color: var(--marmo-white); }
.sidebar-dark .nav-item.active svg, .sidebar-dark .nav-item[aria-current="page"] svg { color: var(--marmo-white); }
.sidebar-dark .nav-item.active::before, .sidebar-dark .nav-item[aria-current="page"]::before { background: var(--marmo-gold-light); }
.sidebar-dark .nav-item:focus-visible { border-color: var(--focus-color-dark); }
.sidebar-dark .nav-sub { border-color: rgba(255,255,255,.16); }
.sidebar-dark .sidebar-user-name { color: var(--marmo-white); }
.sidebar-dark .sidebar-user-role { color: var(--marmo-white-72); }
.sidebar-dark .count:not(.count-alert) { background: var(--marmo-white); color: var(--marmo-blue-dark); }

/* Móvil: la barra lateral sale por la izquierda */
.sidebar-backdrop { display: none; }
@media (max-width: 1080px) {
  .app-shell, .app-shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .app-shell > .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease), visibility 0s 220ms;
    visibility: hidden;
  }
  .app-shell.nav-open > .sidebar { transform: none; visibility: visible; transition: transform 220ms var(--ease); box-shadow: var(--shadow-float); }
  .app-shell.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(4, 26, 51, .56); }
  .app-shell .sidebar .sidebar-collapse { display: none; }
  .app-shell.is-collapsed .sidebar .nav-label, .app-shell.is-collapsed .sidebar .brand, .app-shell.is-collapsed .sidebar .sidebar-user-info { display: initial; }
  .app-shell .topbar .menu-toggle { display: inline-flex; }
}
@media (min-width: 1081px) { .app-shell .topbar .menu-toggle { display: none; } }

/* ---------- Migas de pan ---------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs { font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before {
  content: "";
  width: 12px; height: 12px;
  background: currentColor;
  opacity: .6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center / 12px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.breadcrumbs a { color: var(--marmo-muted); text-decoration: none; border-bottom: 1px solid transparent; }
.breadcrumbs a:hover { color: var(--marmo-blue-dark); border-bottom-color: currentColor; }
.breadcrumbs a:focus-visible { outline: none; color: var(--focus-color); border-bottom-color: var(--focus-color); }
.breadcrumbs [aria-current="page"], .breadcrumbs .current { color: var(--marmo-ink); font-weight: var(--weight-semibold); }
/* neokit: <nav class="breadcrumbs"><a>…</a><span>⬺</span>… */
.breadcrumbs > a, .breadcrumbs > span { margin-right: 6px; }
.breadcrumbs > span:not(.current) { font-size: 0; }
.breadcrumbs > span:not(.current)::after { content: "›"; font-size: var(--text-etiqueta); }

/* ---------- Cabecera de página ---------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}
.page-header .breadcrumbs { margin-bottom: var(--space-3); }
.page-title { margin: 0; font-family: var(--font-serif); font-size: var(--text-titulo); font-weight: var(--weight-regular); line-height: 1.1; letter-spacing: var(--tracking-titular); color: var(--marmo-blue-dark); }
.page-title.is-model { font-family: var(--font-sans); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-modelo); text-transform: uppercase; font-size: 2rem; }
.page-desc { margin: 6px 0 0; max-width: 760px; color: var(--marmo-muted); font-size: var(--text-cuerpo); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 760px) { .page-title { font-size: 1.75rem; } }

/* ---------- Menú desplegable ---------- */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  display: none;
  min-width: 220px;
  max-width: 320px;
  padding: 6px;
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
  box-shadow: var(--shadow-float);
}
.dropdown-menu.open, .dropdown-menu:not([hidden]).is-open { display: block; animation: dd-in 140ms var(--ease); }
.dropdown-menu.right, .dropdown-menu.is-right { left: auto; right: 0; }
.dropdown-menu.is-up { top: auto; bottom: calc(100% + 6px); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-header { padding: 10px 12px 8px; border-bottom: var(--border); margin: -6px -6px 6px; }
.dropdown-header strong { display: block; font-size: var(--text-tarjeta); color: var(--marmo-ink); }
.dropdown-header span { display: block; font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.dropdown-label { padding: 8px 10px 4px; font-size: var(--text-antetitulo); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-gold); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: max(calc(var(--ui-radius-card, 10px) - 4px), 4px);
  background: transparent;
  color: var(--marmo-text);
  font-family: var(--font-sans);
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-medium);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-item svg { width: 16px; height: 16px; color: var(--marmo-muted); flex: none; }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--marmo-surface); color: var(--marmo-blue-dark); }
.dropdown-item:focus-visible { outline: none; border-color: var(--focus-color); }
.dropdown-item.danger, .dropdown-item.is-danger { color: var(--marmo-red); }
.dropdown-item.danger svg, .dropdown-item.is-danger svg { color: var(--marmo-red); }
.dropdown-item.danger:hover, .dropdown-item.is-danger:hover { background: #fbecea; color: var(--marmo-red); }
.dropdown-item[aria-disabled="true"], .dropdown-item:disabled { color: #b7c3d1; cursor: not-allowed; background: transparent; }
.dropdown-item .dropdown-kbd { margin-left: auto; font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.dropdown-item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 16px; height: 16px; background: var(--marmo-blue-dark); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 16px no-repeat; }
.dropdown-sep { height: 1px; margin: 6px -6px; background: var(--marmo-line); }

/* Botón de usuario (avatar + nombre) */
.user-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer; font: inherit; color: var(--marmo-ink); }
[data-ui="app"] .user-trigger, .ui-app .user-trigger { border-radius: var(--radius-app); }
.user-trigger:hover { background: var(--marmo-surface); }
.user-trigger:focus-visible { outline: none; border-color: var(--focus-color); }
.user-trigger .user-name { font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); }
.user-trigger svg { width: 16px; height: 16px; color: var(--marmo-muted); }
@media (max-width: 760px) { .user-trigger .user-name, .user-trigger > svg { display: none; } }

/* ===== components/cards-dashboard ===== */
/* ============================================================
   MARMO UI — Tarjetas y métricas
   Manual: borde de 1 px en marmo-line, radio md, fondo blanco y
   space-5 de relleno. Sin sombra en reposo; al pasar el cursor
   (solo si es pulsable): borde azul al 34 % y shadow-card.
   Rejillas de cifras: celdas blancas separadas por 1 px de filete.
   ============================================================ */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-5);
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
  color: var(--marmo-text);
  transition: border-color var(--duration-state) var(--ease), box-shadow var(--duration-state) var(--ease);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.card-eyebrow { display: block; margin-bottom: 4px; font-size: var(--text-antetitulo); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-gold); }
.card-title { margin: 0; font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: 1.25; color: var(--marmo-ink); }
.card-desc { margin: 4px 0 0; font-size: var(--text-tarjeta); line-height: 1.5; color: var(--marmo-muted); }
.card-body { flex: 1; font-size: var(--text-tarjeta); line-height: 1.5; }
.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) calc(var(--space-5) * -1) calc(var(--space-5) * -1);
  padding: var(--space-3) var(--space-5);
  border-top: var(--border);
}
.card-footer.is-end { justify-content: flex-end; }

/* Variantes */
.card.inset, .card-surface { background: var(--marmo-surface); }
.card-dark { background: var(--marmo-gradient-dark); border-color: transparent; color: var(--marmo-white-78); }
.card-dark .card-title { color: var(--marmo-white); }
.card-dark .card-desc { color: var(--marmo-white-72); }
.card-dark .card-eyebrow { color: var(--marmo-gold-light); }
.card-dark .card-footer { border-top-color: rgba(255,255,255,.14); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: var(--space-5) var(--space-5) 0; }
.card-compact { padding: var(--space-4); }

/* Pulsable: toda la tarjeta es el enlace (sin anidar elementos interactivos) */
.card-link .card-title a { color: inherit; text-decoration: none; }
.card-link .card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover { border-color: var(--marmo-blue-34); box-shadow: var(--shadow-card); }
.card-link:has(.card-title a:focus-visible) { border-color: var(--focus-color); }
.card-link .card-title a:focus-visible { outline: none; }
.card-link .card-arrow { position: absolute; top: var(--space-5); right: var(--space-5); width: 18px; height: 18px; color: var(--marmo-blue-dark); transition: transform var(--duration-state) var(--ease); }
.card-link:hover .card-arrow { transform: translateX(3px); }

/* Imagen arriba (manual: recorte a sangre, esquinas superiores redondeadas) */
.card-media { margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-4); aspect-ratio: 4 / 3; background: var(--marmo-blue-light); overflow: hidden; border-radius: var(--ui-radius-card, var(--radius-md)) var(--ui-radius-card, var(--radius-md)) 0 0; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.card-link:hover .card-media img { transform: scale(1.04); }

/* Rejilla de tarjetas: el número de tarjetas, múltiplo de las columnas */
.card-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-5); }
@media (max-width: 1080px) { .card-grid { --cols: 2 !important; } }
@media (max-width: 640px)  { .card-grid { --cols: 1 !important; } }

/* ---------- Métricas (KPI) ---------- */
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: var(--space-5);
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
}
.kpi-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.kpi-label { font-size: var(--text-etiqueta); font-weight: var(--weight-semibold); color: var(--marmo-muted); line-height: 1.3; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--marmo-blue-light); color: var(--marmo-blue-dark); font-size: 0; flex: none; }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: var(--weight-semibold);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--marmo-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-value small { font-size: 0.55em; font-weight: var(--weight-medium); color: var(--marmo-muted); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kpi-sub { font-size: var(--text-etiqueta); color: var(--marmo-muted); line-height: 1.4; }
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-delta svg { width: 14px; height: 14px; }
.kpi-delta.is-good, .kpi-delta.up { color: var(--marmo-success); }
.kpi-delta.is-bad, .kpi-delta.down { color: var(--marmo-red); }
.kpi-delta.is-flat { color: var(--marmo-muted); }
.kpi-spark { display: block; width: 100%; height: 40px; margin-top: 6px; overflow: visible; }
.kpi-spark .spark-line { fill: none; stroke: var(--marmo-blue-dark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.kpi-spark .spark-area { fill: var(--marmo-blue-light); }
.kpi-spark .spark-dot { fill: var(--marmo-blue-dark); }

/* Rejilla con filete: celdas blancas separadas por 1 px */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 1px;
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-line);
  overflow: hidden;
}
.kpi-grid > .kpi-card { border: 0; border-radius: 0; }
@media (max-width: 1080px) { .kpi-grid { --cols: 2 !important; } }
@media (max-width: 480px)  { .kpi-grid { --cols: 1 !important; } }

/* Cifra de trayectoria (voz de marca: Newsreader) */
.kpi-brand .kpi-value { font-family: var(--font-serif); font-weight: 400; font-size: var(--text-cifra); color: var(--marmo-blue-dark); letter-spacing: 0; }
.kpi-brand .kpi-label { color: var(--marmo-gold); text-transform: uppercase; letter-spacing: var(--tracking-antetitulo); font-size: var(--text-antetitulo); }

/* ---------- Actividad ---------- */
.activity-feed { margin: 0; padding: 0; list-style: none; }
.activity-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding-bottom: var(--space-4); }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 1px; background: var(--marmo-line); }
.activity-item:last-child { padding-bottom: 0; }
.activity-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--marmo-blue-light); color: var(--marmo-blue-dark); font-size: 0; }
.activity-icon svg { width: 16px; height: 16px; }
.activity-icon.is-success { background: #eef4f1; color: var(--marmo-success); }
.activity-icon.is-warning { background: var(--marmo-white); color: var(--marmo-gold); box-shadow: inset 0 0 0 1px #d9c49a; }
.activity-icon.is-danger { background: #fbecea; color: var(--marmo-red); }
.activity-body { padding-top: 6px; min-width: 0; }
.activity-text { font-size: var(--text-tarjeta); line-height: 1.45; color: var(--marmo-text); }
.activity-text strong { font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.activity-time { margin-top: 2px; font-size: var(--text-etiqueta); color: var(--marmo-muted); }

/* ---------- Objetivos ---------- */
.goal-list { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }

/* ---------- Lista de datos (clave · valor) ---------- */
.stat-list { display: grid; margin: 0; }
.stat-list > div { display: flex; justify-content: space-between; gap: var(--space-4); padding: 10px 0; border-bottom: var(--border); font-size: var(--text-tarjeta); }
.stat-list > div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--marmo-muted); }
.stat-list dd { margin: 0; font-weight: var(--weight-semibold); color: var(--marmo-ink); font-variant-numeric: tabular-nums; text-align: right; }

/* neokit: mini gráfico de barras */
.mini-chart { display: flex; align-items: flex-end; gap: 4px; }
.mini-bar { flex: 1; min-height: 4px; border-radius: 2px 2px 0 0; background: var(--marmo-blue-light); }
.mini-bar:last-child, .mini-bar.active { background: var(--marmo-blue-dark); }

/* ===== components/pricing-commerce ===== */
/* ============================================================
   MARMO UI — Precios y vehículos
   Manual: modelos y precios siempre en Hanken Grotesk. Precio de oferta
   en rojo; precio de ocasión en azul. Toda oferta lleva su condición.
   Formatos: 33.990 € · Desde 33.990 €* · 390 € al mes + IVA · 2023 · Km 0 · Manual
   ============================================================ */

/* ---------- Precio ---------- */
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.price-from { font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); color: var(--marmo-text); }
.price-amount { font-size: var(--text-precio); font-weight: var(--weight-bold); line-height: 1.1; color: var(--marmo-blue-dark); white-space: nowrap; }
.price-amount sup { font-size: .55em; font-weight: var(--weight-semibold); top: -.7em; margin-left: 1px; }
.price.is-offer .price-amount { color: var(--marmo-red); }
.price-old { font-size: var(--text-tarjeta); color: var(--marmo-muted); text-decoration: line-through; white-space: nowrap; }
.price-suffix { font-size: var(--text-etiqueta); color: var(--marmo-muted); font-weight: var(--weight-medium); white-space: nowrap; }
.price-lg .price-amount { font-size: 2.25rem; }
.price-sm .price-amount { font-size: 1.25rem; }
.price-note { display: block; margin-top: 4px; font-size: var(--text-legal); line-height: 1.45; color: var(--marmo-muted); }

/* ---------- Tarjeta de oferta (vehículo nuevo) ---------- */
.vehicle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
  overflow: hidden;
  transition: border-color var(--duration-state) var(--ease), box-shadow var(--duration-state) var(--ease);
}
.vehicle-card:hover { border-color: var(--marmo-blue-34); box-shadow: var(--shadow-card); }
.vehicle-card:has(.vehicle-link:focus-visible) { border-color: var(--focus-color); }
.vehicle-media { position: relative; aspect-ratio: 942 / 524; background: var(--marmo-blue-light); overflow: hidden; }
.vehicle-card.is-used .vehicle-media { aspect-ratio: 4 / 3; }
.vehicle-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
.vehicle-card:hover .vehicle-media img { transform: scale(1.04); }
.vehicle-media .vehicle-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--marmo-blue); font-size: var(--text-antetitulo); font-weight: 600; letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; }
.vehicle-media .badge { position: absolute; top: 12px; left: 12px; }
.vehicle-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: var(--space-4) var(--space-5) var(--space-5); }
.vehicle-brand { font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.vehicle-model { margin: 0; font-family: var(--font-sans); font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: 1.25; color: var(--marmo-ink); }
.vehicle-version { font-size: var(--text-etiqueta); color: var(--marmo-muted); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vehicle-specs { font-size: var(--text-etiqueta); color: var(--marmo-text); }
.vehicle-desc { font-size: var(--text-tarjeta); color: var(--marmo-muted); line-height: 1.5; margin: 2px 0 0; }
.vehicle-prices { margin-top: auto; padding-top: var(--space-3); }
.vehicle-cash { display: block; font-size: var(--text-etiqueta); color: var(--marmo-muted); margin-top: 2px; }
.vehicle-save { margin-top: 8px; }
.vehicle-link {
  margin-top: var(--space-3);
  align-self: flex-start;
  font-size: var(--text-tarjeta);
  font-weight: var(--weight-semibold);
  color: var(--marmo-blue-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.vehicle-link::after { content: ""; position: absolute; inset: 0; } /* toda la tarjeta es el enlace */
.vehicle-link:focus-visible { outline: none; }
.vehicle-card:hover .vehicle-link { border-bottom-color: currentColor; }
.vehicle-fav {
  position: absolute; z-index: 2; top: 10px; right: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid transparent; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--marmo-blue-dark); cursor: pointer;
}
.vehicle-fav svg { width: 18px; height: 18px; }
.vehicle-fav[aria-pressed="true"] svg { fill: var(--marmo-gold-light); stroke: var(--marmo-gold); }
.vehicle-fav:focus-visible { outline: none; border-color: var(--focus-color); }

/* ---------- Cuota ---------- */
.fee {
  display: grid;
  gap: 4px;
  padding: var(--space-4) var(--space-5);
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-surface);
}
.fee-label { display: block; font-size: var(--text-antetitulo); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-gold); }

/* ---------- Simulador de cuota ---------- */
.fee-sim { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.fee-sim-result { position: sticky; top: var(--space-5); padding: var(--space-5); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-gradient-dark); color: var(--marmo-white-78); }
.fee-sim-result .fee-label { display: block; margin-bottom: 4px; color: var(--marmo-gold-light); }
.fee-sim-result .price-amount { color: var(--marmo-white); font-size: 2.5rem; }
.fee-sim-result .price-suffix { color: var(--marmo-white-72); }
.fee-sim-result dl { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--space-4); margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,.14); font-size: var(--text-etiqueta); font-variant-numeric: tabular-nums; }
.fee-sim-result dd { margin: 0; color: var(--marmo-white); font-weight: var(--weight-semibold); text-align: right; }
.fee-sim-result .price-note { color: var(--marmo-white-72); }
@media (max-width: 760px) { .fee-sim { grid-template-columns: 1fr; } .fee-sim-result { position: static; } }

/* ---------- Presupuesto / resumen ---------- */
.summary { border: var(--border); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-white); overflow: hidden; font-variant-numeric: tabular-nums; }
.summary-head { padding: var(--space-4) var(--space-5); border-bottom: var(--border); }
.summary-head h3 { margin: 0; font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.summary-head p { margin: 2px 0 0; font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.summary-lines { margin: 0; padding: var(--space-2) var(--space-5); list-style: none; }
.summary-lines li { display: flex; justify-content: space-between; gap: var(--space-4); padding: 10px 0; border-bottom: var(--border); font-size: var(--text-tarjeta); }
.summary-lines li:last-child { border-bottom: 0; }
.summary-lines .qty { color: var(--marmo-muted); margin-right: 6px; }
.summary-lines .amt { white-space: nowrap; font-weight: var(--weight-medium); }
.summary-lines .is-discount .amt { color: var(--marmo-red); }
.summary-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px var(--space-4); margin: 0; padding: var(--space-3) var(--space-5) var(--space-4); background: var(--marmo-surface); border-top: var(--border); font-size: var(--text-tarjeta); }
.summary-totals dt { color: var(--marmo-muted); }
.summary-totals dd { margin: 0; text-align: right; }
.summary-totals .is-total { padding-top: 8px; margin-top: 4px; border-top: var(--border); font-size: var(--text-h3); font-weight: var(--weight-bold); color: var(--marmo-ink); }
.summary-foot { padding: var(--space-4) var(--space-5); border-top: var(--border); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: flex-end; }

/* ---------- Planes ---------- */
.plans { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-5); align-items: stretch; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: var(--border);
  border-radius: var(--ui-radius-card, var(--radius-md));
  background: var(--marmo-white);
}
.plan.is-featured { border-color: var(--marmo-blue-dark); box-shadow: inset 0 3px 0 var(--marmo-gold); }
.plan-flag { position: absolute; top: -11px; left: var(--space-5); }
.plan-name { margin: 0; font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.plan-desc { margin: 0; font-size: var(--text-tarjeta); color: var(--marmo-muted); }
.plan-features { display: grid; gap: 8px; margin: var(--space-2) 0 0; padding: var(--space-4) 0 0; border-top: var(--border); list-style: none; font-size: var(--text-tarjeta); }
.plan-features li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.plan-features svg { width: 16px; height: 16px; margin-top: 3px; color: var(--marmo-success); }
.plan-features .is-no { color: var(--marmo-muted); }
.plan-features .is-no svg { color: #b7c3d1; }
.plan .btn { margin-top: auto; }
.plan-toggle { display: flex; justify-content: center; margin-bottom: var(--space-5); }

/* ---------- Facturas ---------- */
.invoice-list { margin: 0; padding: 0; list-style: none; border: var(--border); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-white); }
.invoice-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: var(--space-4); padding: 12px var(--space-5); border-bottom: var(--border); font-size: var(--text-tarjeta); font-variant-numeric: tabular-nums; }
.invoice-row:last-child { border-bottom: 0; }
.invoice-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.invoice-name svg { width: 18px; height: 18px; color: var(--marmo-muted); flex: none; }
.invoice-id { font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.invoice-date { color: var(--marmo-muted); white-space: nowrap; }
.invoice-amount { font-weight: var(--weight-semibold); white-space: nowrap; text-align: right; }
@media (max-width: 640px) { .invoice-row { grid-template-columns: 1fr auto; } .invoice-date { grid-column: 1; } }

/* neokit: estrellas y producto genérico */
.stars { color: var(--marmo-gold-light); letter-spacing: 1px; }
.product-card { border: var(--border); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-white); overflow: hidden; }
.product-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--marmo-blue-light); font-size: 0; }
.product-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.product-name { font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.product-desc { font-size: var(--text-tarjeta); color: var(--marmo-muted); margin: 4px 0 var(--space-3); }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.product-price { font-size: 1.25rem; font-weight: var(--weight-bold); color: var(--marmo-blue-dark); }
.product-price-old { margin-right: 6px; color: var(--marmo-muted); text-decoration: line-through; font-size: var(--text-tarjeta); }

/* ===== components/content-utilities ===== */
/* ============================================================
   MARMO UI — Contenido y utilidades
   Piezas editoriales (cabecera, ventajas, cronología, cita, separadores,
   texto largo) y utilidades (ayuda emergente, copiar, volver arriba,
   fundamentos de marca). Planas: sin relieves ni sombras salvo lo que flota.
   ============================================================ */

/* ---------- EDI-HERO · Cabecera de contenido ---------- */
.page-hero {
  position: relative;
  padding: var(--space-8) 0 var(--space-7);
  background: var(--marmo-gradient-dark);
  color: var(--marmo-white);
  border-radius: var(--ui-radius-card, var(--radius-md));
  overflow: hidden;
}
.page-hero.is-bleed { border-radius: 0; }
.page-hero-inner { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-6); }
.page-hero-eyebrow { display: block; margin-bottom: var(--space-3); font-size: var(--text-antetitulo); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-gold-light); }
.page-hero-title { max-width: 18ch; margin: 0 0 var(--space-4); font-family: var(--font-serif); font-size: var(--text-titular); font-weight: 500; line-height: 1.05; letter-spacing: var(--tracking-titular); color: var(--marmo-white); }
.page-hero-title em { font-style: normal; font-weight: 300; color: var(--marmo-gold-light); }
.page-hero-desc { max-width: 60ch; margin: 0; font-size: var(--text-entradilla); line-height: 1.6; color: var(--marmo-white-78); }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.page-hero-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: var(--space-6) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--marmo-white-12); list-style: none; font-size: var(--text-etiqueta); color: var(--marmo-white-72); }
.page-hero-meta .meta-item, .page-hero-meta li { display: inline-flex; align-items: center; gap: 6px; }
.page-hero-meta svg { width: 14px; height: 14px; color: var(--marmo-gold-light); }
/* Versión clara */
.page-hero.is-light { background: var(--marmo-surface); color: var(--marmo-text); border: var(--border); }
.page-hero.is-light .page-hero-eyebrow { color: var(--marmo-gold); }
.page-hero.is-light .page-hero-title { color: var(--marmo-blue-dark); }
.page-hero.is-light .page-hero-title em { color: var(--marmo-gold); }
.page-hero.is-light .page-hero-desc { color: var(--marmo-muted); }
.page-hero.is-light .page-hero-meta { border-top: var(--border); color: var(--marmo-muted); }
.page-hero.is-light .page-hero-meta svg { color: var(--marmo-gold); }
@media (max-width: 720px) {
  .page-hero { padding: var(--space-7) 0 var(--space-6); }
  .page-hero-inner { padding: 0 var(--space-5); }
  .page-hero-title { font-size: 2.5rem; }
}

/* ---------- EDI-FEAT · Ventajas ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(var(--feat-cols, 3), minmax(0, 1fr)); gap: var(--space-6) var(--space-5); margin: 0; padding: 0; list-style: none; }
.feature-item { display: grid; gap: var(--space-2); align-content: start; }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--space-2); border-radius: var(--radius-app); background: var(--marmo-blue-light); color: var(--marmo-blue); }
.feature-icon svg { width: 20px; height: 20px; }
.feature-title { margin: 0; font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: 1.3; color: var(--marmo-ink); }
.feature-text { margin: 0; font-size: var(--text-tarjeta); line-height: 1.6; color: var(--marmo-muted); }
.feature-grid.is-ruled .feature-item { padding-top: var(--space-4); border-top: 2px solid var(--marmo-gold-light); }
.feature-grid.is-ruled .feature-icon { display: none; }
@media (max-width: 900px) { .feature-grid { --feat-cols: 2; } }
@media (max-width: 560px) { .feature-grid { --feat-cols: 1; } }

/* ---------- EDI-TML · Cronología ---------- */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); padding-bottom: var(--space-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::after { content: ""; position: absolute; left: 9.5px; top: 22px; bottom: 2px; width: 1px; background: var(--marmo-line); }
.timeline-item:last-child::after { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin: 5px 0 0 4.5px; border: 2px solid #b7c3d1; border-radius: 50%; background: var(--marmo-white); }
.timeline-item.is-done .timeline-dot { border-color: var(--marmo-blue); background: var(--marmo-blue); }
.timeline-item.is-done::after { background: var(--marmo-blue); opacity: .35; }
.timeline-item.is-current .timeline-dot { border-color: var(--marmo-blue); background: var(--marmo-white); box-shadow: 0 0 0 4px var(--marmo-blue-light); }
.timeline-item.is-alert .timeline-dot { border-color: var(--marmo-red); background: var(--marmo-red); }
.timeline-body { min-width: 0; }
.timeline-time { display: block; font-size: var(--text-etiqueta); color: var(--marmo-muted); font-variant-numeric: tabular-nums; }
.timeline-title { margin: 2px 0 0; font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.timeline-item.is-upcoming .timeline-title { color: var(--marmo-muted); font-weight: var(--weight-medium); }
.timeline-text { margin: 4px 0 0; font-size: var(--text-tarjeta); line-height: 1.55; color: var(--marmo-text); }
.timeline-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- EDI-QTE · Cita / opinión ---------- */
.quote { margin: 0; padding: 0 0 0 var(--space-5); border-left: 2px solid var(--marmo-gold-light); }
.quote-text { margin: 0; font-family: var(--font-serif); font-size: var(--text-cita); font-weight: 300; line-height: 1.35; color: var(--marmo-blue-dark); }
.quote-text::before { content: "«"; }
.quote-text::after { content: "»"; }
.quote-author { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); font-size: var(--text-tarjeta); font-style: normal; }
.quote-author strong { display: block; color: var(--marmo-ink); font-weight: var(--weight-semibold); }
.quote-author span { color: var(--marmo-muted); font-size: var(--text-etiqueta); }
.quote-source { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--marmo-muted); font-size: var(--text-etiqueta); }
.quote.is-card { padding: var(--space-5); border: var(--border); border-top: 2px solid var(--marmo-gold-light); border-left: var(--border); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-white); }
.quote.is-card .quote-text { font-size: var(--text-titulo-menor); }
.section-dark .quote-text, .on-dark .quote-text { color: var(--marmo-white); }

/* ---------- EDI-DIV · Separadores ---------- */
.divider { height: 0; margin: var(--space-5) 0; border: 0; border-top: var(--border); }
.divider-label { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; font-size: var(--text-antetitulo); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-antetitulo); text-transform: uppercase; color: var(--marmo-muted); }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--marmo-line); }
.divider-label.is-start::before { display: none; }
.divider-gold { width: 48px; height: 2px; margin: var(--space-4) 0; border: 0; background: var(--marmo-gold-light); }
.divider-vertical { display: inline-block; width: 1px; height: 1.2em; margin: 0 var(--space-2); vertical-align: middle; background: var(--marmo-line); }

/* ---------- EDI-PRS · Texto largo ---------- */
.prose { max-width: 70ch; color: var(--marmo-text); font-size: var(--text-cuerpo); line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin: 2em 0 0; font-family: var(--font-serif); font-size: var(--text-titulo-menor); font-weight: 500; line-height: 1.2; color: var(--marmo-blue-dark); }
.prose h3 { margin: 1.6em 0 0; font-size: var(--text-h3); font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.prose h2 + *, .prose h3 + * { margin-top: .5em; }
.prose p { margin: 0; }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--marmo-gold); }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: var(--space-4); border-left: 2px solid var(--marmo-gold-light); color: var(--marmo-muted); font-style: italic; }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--marmo-blue-light); font-family: var(--font-mono); font-size: .88em; color: var(--marmo-blue-dark); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-tarjeta); }
.prose th, .prose td { padding: 8px 10px; border-bottom: var(--border); text-align: left; }
.prose th { font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.prose small, .prose .legal { display: block; font-size: var(--text-legal); color: var(--marmo-muted); }

/* ---------- UTL-TIP · Ayuda emergente ---------- */
.tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--marmo-blue-dark);
  color: var(--marmo-white);
  font-size: var(--text-etiqueta);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
}
.tooltip.is-visible { opacity: 1; transform: none; }
.tooltip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); width: 8px; height: 8px; margin-left: -4px; background: inherit; transform: rotate(45deg); }
.tooltip[data-side="top"]::after { bottom: -4px; }
.tooltip[data-side="bottom"]::after { top: -4px; }
.tip-term { border-bottom: 1px dotted var(--marmo-muted); cursor: help; }
.tip-term:focus-visible { border-bottom-color: var(--focus-color); }
.tip-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--marmo-muted); cursor: help; vertical-align: middle; }
.tip-icon:hover { color: var(--marmo-blue); }
.tip-icon:focus-visible { border-color: var(--focus-color); color: var(--marmo-blue); }
.tip-icon svg { width: 16px; height: 16px; }

/* ---------- UTL-CPY · Copiar ---------- */
.copy-field { display: flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 4px 0 12px; height: var(--field-h); border: var(--border); border-radius: var(--ui-radius-field, var(--radius-sm)); background: var(--marmo-surface); }
.copy-field > code, .copy-field > .copy-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: .85rem; color: var(--marmo-ink); }
.copy-field .btn { flex: none; }
[data-copy].is-copied { color: var(--marmo-success); }
.copy-inline { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- UTL-TOP · Volver arriba ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--marmo-line);
  border-radius: 50%;
  background: var(--marmo-white);
  color: var(--marmo-blue-dark);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--duration-state) var(--ease), transform var(--duration-state) var(--ease), visibility 0s linear var(--duration-state), border-color var(--duration-state) var(--ease);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.back-to-top:hover { border-color: var(--marmo-blue-34); color: var(--marmo-blue); }
.back-to-top:focus-visible { border-color: var(--focus-color); }
.back-to-top svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .back-to-top { right: 16px; bottom: 16px; } }

/* ---------- UTL-TOK · Fundamentos de marca ---------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.swatch { display: grid; align-content: start; gap: 8px; }
.swatch-color { height: 72px; border-radius: var(--radius-app); border: 1px solid rgba(6, 38, 74, .08); }
.swatch-label { font-size: var(--text-tarjeta); font-weight: var(--weight-semibold); color: var(--marmo-ink); }
.swatch-value { font-family: var(--font-mono); font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.swatch-use { font-size: var(--text-etiqueta); color: var(--marmo-muted); line-height: 1.4; }
.swatch .btn { justify-self: start; }

.type-scale { display: grid; margin: 0; padding: 0; list-style: none; }
.type-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-5); align-items: baseline; padding: var(--space-4) 0; border-bottom: var(--border); }
.type-row:last-child { border-bottom: 0; }
.type-meta { font-size: var(--text-etiqueta); color: var(--marmo-muted); line-height: 1.5; }
.type-meta strong { display: block; color: var(--marmo-ink); font-size: var(--text-tarjeta); }
.type-sample { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--marmo-blue-dark); }
@media (max-width: 720px) { .type-row { grid-template-columns: 1fr; gap: 4px; } }

.radius-grid, .elevation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-5); }
.radius-sample, .elevation-sample { height: 80px; border: 1px solid var(--marmo-line); background: var(--marmo-white); }
.radius-sample { background: var(--marmo-blue-light); border-color: #c9dbee; }
.radius-label, .elevation-label { margin-top: 8px; font-size: var(--text-etiqueta); color: var(--marmo-muted); }
.radius-label strong, .elevation-label strong { display: block; color: var(--marmo-ink); font-size: var(--text-tarjeta); }

/* ---------- UTL-ICO · Iconos ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); margin: 0; padding: 0; list-style: none; background: var(--marmo-white); border: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.icon-grid li { margin: 0 -1px -1px 0; border-right: var(--border); border-bottom: var(--border); }
.icon-grid button { display: grid; justify-items: center; gap: 8px; width: 100%; padding: var(--space-4) 6px var(--space-3); border: 1px solid transparent; background: none; color: var(--marmo-blue-dark); font: inherit; cursor: pointer; }
.icon-grid button:hover { background: var(--marmo-blue-hover-bg); }
.icon-grid button:focus-visible { border-color: var(--focus-color); }
.icon-grid button span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--marmo-muted); }
.icon-grid button.is-copied span { color: var(--marmo-success); }
.icon-grid svg { width: 20px; height: 20px; }
.icon, .icon-sm, .icon-lg { display: inline-block; vertical-align: middle; flex: none; }
.icon { width: 18px; height: 18px; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- UTL-CLS · Clases de ayuda ---------- */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.text-muted { color: var(--marmo-muted); }
.text-legal { font-size: var(--text-legal); color: var(--marmo-muted); }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--stack-gap, var(--space-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-3)); }
.system-tag { display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--marmo-blue-light); font-family: var(--font-mono); font-size: 0.72rem; color: var(--marmo-blue-dark); }
.component-box { padding: var(--space-5); border: var(--border); border-radius: var(--ui-radius-card, var(--radius-md)); background: var(--marmo-white); }
.kbd-combo { display: inline-flex; align-items: center; gap: 4px; color: var(--marmo-muted); font-size: var(--text-etiqueta); }
