/* ==========================================================================
   MugiMaster - Estilo Oficial MUGI (Verde & Azul / ATTG Gipuzkoa)
   Identidad visual oficial de MUGI: Verde Esmeralda, Azul Cyan y Modernidad Intermodal
   Sin emojis, iconografía 100% SVG vectorial y diseño interactivo dinámico.
   ========================================================================== */

:root {
  /* Paleta Corporativa MUGI */
  --mugi-green: #00a859;
  --mugi-green-hover: #008f4c;
  --mugi-green-dark: #006837;
  --mugi-green-light: #e6f7ef;
  --mugi-green-border: #a7f3d0;
  --mugi-green-glow: rgba(0, 168, 89, 0.25);

  --mugi-cyan: #009fe3;
  --mugi-cyan-hover: #0088c4;
  --mugi-cyan-dark: #0077b6;
  --mugi-cyan-light: #e0f2fe;
  --mugi-cyan-border: #bae6fd;
  --mugi-cyan-glow: rgba(0, 159, 227, 0.25);

  --mugi-navy: #081a30;
  --mugi-navy-surface: #0f2742;
  --mugi-navy-light: #1e3a5f;

  /* Colores de Operadores */
  --op-euskotren: #005baa;
  --op-renfe: #990033;
  --op-lurraldebus: #007a3d;
  --op-dbus: #0082c9;
  --op-metrobilbao: #e2231a;
  --op-bizkaibus: #5f8f1f;

  /* Superficies y Fondos */
  --bg-main: #f5f9fc;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: #009fe3;

  /* Tipografía */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #ffffff;

  /* Sombras y Elevaciones */
  --shadow-sm: 0 1px 3px rgba(8, 26, 48, 0.06);
  --shadow-md: 0 4px 16px rgba(8, 26, 48, 0.08);
  --shadow-lg: 0 10px 28px rgba(8, 26, 48, 0.12);
  --shadow-green: 0 6px 20px rgba(0, 168, 89, 0.25);
  --shadow-cyan: 0 6px 20px rgba(0, 159, 227, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* --- CLASE SVG ICON UNIVERSAL --- */
.svg-icon {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  fill: currentColor;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.2s ease, fill 0.2s ease;
}

.svg-icon-lg {
  width: 1.6em;
  height: 1.6em;
}

.svg-icon-xl {
  width: 2.2em;
  height: 2.2em;
}

/* --- HEADER (barra de marca azul marino + barra de pestañas) --- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 24px -12px rgba(8, 26, 48, 0.35);
}

.header-inner {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-top {
  position: relative;
  background:
    radial-gradient(600px 120px at 85% -40%, rgba(0, 159, 227, 0.22), transparent 70%),
    radial-gradient(500px 120px at 10% 140%, rgba(0, 168, 89, 0.18), transparent 70%),
    linear-gradient(90deg, #081a30 0%, #0b2140 55%, #0f2a4a 100%);
}

.header-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--mugi-green) 0%, var(--mugi-cyan) 55%, #a4cc26 100%);
}

.header-top .header-inner {
  height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

/* Escudo MUGI: blanco sobre el fondo marino para que destaque */
.mugi-header-shield {
  width: 52px;
  height: 40px;
  background: #ffffff;
  border-radius: 46% 46% 54% 54% / 40% 40% 60% 60%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(8, 26, 48, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header-brand:hover .mugi-header-shield {
  transform: translateY(-1px) rotate(-3deg);
}

.shield-mugi-text {
  color: #081a30;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.6px;
  line-height: 1;
}

.shield-mugi-dot {
  position: absolute;
  right: 11px;
  top: 9px;
  width: 6px;
  height: 6px;
  background: #a4cc26;
  border-radius: 50%;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  min-width: 0;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-title-accent {
  color: #34d399;
}

.brand-tagline {
  font-size: 0.66rem;
  color: #8ea3bd;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.live-dot,
.status-dot,
.scraping-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.header-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  padding: 0 12px;
  height: 36px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.header-sync-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.header-sync-btn:hover .svg-icon {
  transform: rotate(90deg);
}

.header-sync-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.header-user-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 4px 3px 3px;
  height: 38px;
  border-radius: 999px;
}

.header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a859 0%, #009fe3 100%);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.header-logout-btn {
  background: transparent;
  border: 1px solid rgba(252, 165, 165, 0.35);
  color: #fca5a5;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.header-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #f87171;
  color: #ffffff;
}

.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mugi-green);
  color: #ffffff;
  border: none;
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px -4px rgba(0, 168, 89, 0.7);
}

.header-login-btn:hover {
  background: #00bd64;
}

.header-reg-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-reg-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Barra de pestañas */
.header-nav-bar {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.main-nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 50px;
  overflow-x: auto;
  scrollbar-width: none;
  user-select: none;
  margin: 0 -6px;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #64748b;
  padding: 0 14px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-tab-btn::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--mugi-green), var(--mugi-cyan));
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.nav-tab-btn .svg-icon {
  width: 1.1em;
  height: 1.1em;
  color: #94a3b8;
  transition: color 0.15s ease;
}

.nav-tab-btn:hover {
  color: var(--mugi-navy);
  background: #f8fafc;
}

.nav-tab-btn.active {
  color: var(--mugi-navy);
  font-weight: 700;
}

.nav-tab-btn.active::after {
  transform: scaleX(1);
}

.nav-tab-btn.active .svg-icon {
  color: var(--mugi-green);
}

.nav-tab-btn:focus-visible,
.header-sync-btn:focus-visible,
.header-login-btn:focus-visible,
.header-reg-btn:focus-visible {
  outline: 2px solid var(--mugi-cyan);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .header-live-pill {
    display: none;
  }
}

@media (max-width: 720px) {
  .header-top .header-inner {
    height: 58px;
  }
  .brand-tagline,
  .header-sync-btn span {
    display: none;
  }
  .header-sync-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .header-user-name {
    display: none;
  }
  .nav-tab-btn {
    padding: 0 11px;
    font-size: 0.82rem;
  }
}

@media (max-width: 420px) {
  .header-reg-btn {
    display: none;
  }
  .brand-title {
    font-size: 1.05rem;
  }
}

/* --- CONTENEDOR PRINCIPAL --- */
.page-container {
  max-width: 1260px;
  margin: 24px auto 48px auto;
  padding: 0 16px;
  min-height: calc(100vh - 140px);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* --- TARJETAS CONTENEDORAS --- */
.gov-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.gov-card:hover {
  box-shadow: var(--shadow-md);
}

.gov-card-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.gov-card-header h2 {
  font-size: 1.3rem;
  color: var(--mugi-navy);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gov-card-header p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* --- AUTÉNTICA TARJETA MUGI GIPUZKOA (FORMATO REAL ATTG) --- */
.mugi-card-perspective {
  perspective: 1000px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.mugi-card-flip-inner {
  position: relative;
  width: 100%;
  height: 265px;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.mugi-card-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.mugi-card-front,
.mugi-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 265px;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 12px 28px rgba(130, 171, 18, 0.35), 0 4px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

/* CARA FRONTAL: Verde lima MUGI oficial ATTG */
.mugi-card-front {
  background: linear-gradient(135deg, #a6ce1e 0%, #9ec91d 45%, #8db814 100%);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 265px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(130, 171, 18, 0.4), 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

/* Variante Anónima (amarillo) */
.mugi-card-front.is-anon,
.mugi-card-back.is-anon {
  background: linear-gradient(135deg, #fedb00 0%, #f6ce00 45%, #e5bb00 100%);
  box-shadow: 0 14px 34px rgba(246, 206, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.15);
}

/* Escudo oficial MUGI (púa azul marina con relieve y logotipo) */
.mugi-official-shield {
  position: absolute;
  top: 14px;
  right: 36px;
  width: 94px;
  height: 82px;
  z-index: 3;
  filter: drop-shadow(0 4px 10px rgba(10, 37, 74, 0.35));
  transition: transform 0.2s ease;
}

.mugi-official-shield:hover {
  transform: scale(1.03);
}

.mugi-official-shield img,
.mugi-shield-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Bucle / cinta multicolor tridimensional oficial esquina inferior derecha */
.mugi-official-ribbon-swoosh {
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 250px;
  height: 200px;
  pointer-events: none;
  z-index: 1;
}

/* Sección izquierda con foto y datos del titular */
.mugi-official-left-col {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 210px;
}

.mugi-official-photo-box {
  width: 74px;
  height: 94px;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mugi-official-photo-box img,
.mugi-official-photo-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mugi-official-names-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mugi-official-surnames {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.90rem;
  font-weight: 700;
  color: #142b04;
  line-height: 1.15;
  letter-spacing: 0.3px;
}

.mugi-official-firstname {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1a3805;
  line-height: 1.15;
}

.mugi-official-number-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: #142b04;
  letter-spacing: 1.2px;
  margin-top: 5px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.mugi-official-colectivo-letter {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #142b04;
  margin-top: 1px;
  letter-spacing: 1.5px;
  min-height: 16px;
}

/* CARA TRASERA (REVERSO OFICIAL ATTG - VERDE LIMA REAL) */
.mugi-card-back {
  background: linear-gradient(135deg, #a6ce1e 0%, #9ec91d 45%, #8db814 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(130, 171, 18, 0.4), 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.mugi-official-back-ribbon {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 190px;
  height: 155px;
  pointer-events: none;
  z-index: 1;
}

.mugi-back-top-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mugi-back-chip-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mugi-chip-gold {
  width: 36px;
  height: 26px;
  background: linear-gradient(135deg, #fbe282 0%, #dfb537 50%, #b8860b 100%);
  border-radius: 4px;
  border: 1px solid #996515;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 3px;
}

.mugi-chip-line {
  height: 1px;
  background: rgba(153, 101, 21, 0.7);
  width: 100%;
}

.mugi-contactless-icon {
  color: #142b04;
  opacity: 0.85;
  display: flex;
  align-items: center;
}

.mugi-official-back-body {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: auto;
  padding: 10px 0;
}

.mugi-attg-two-cols {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.70rem;
  font-weight: 700;
  color: #142b04;
  line-height: 1.25;
}

.attg-col-eu,
.attg-col-es {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attg-divider-line {
  width: 1.5px;
  height: 38px;
  background: #142b04;
  opacity: 0.55;
  flex-shrink: 0;
}

.mugi-official-back-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0b254a;
  border-top: 1px solid rgba(20, 43, 4, 0.15);
  padding-top: 8px;
}

.mugi-back-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mugi-info-circle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.8px solid #0b254a;
  font-size: 0.72rem;
  font-weight: 900;
  font-family: serif;
  font-style: italic;
  line-height: 1;
}

.mugi-back-url {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0b254a;
}

/* --- SALDO Y TRAMOS ATTG --- */
.balance-panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 26px;
  align-items: start;
}

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

.balance-summary-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.balance-amount-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0;
}

.balance-amount-display .amount {
  font-size: 3rem;
  font-weight: 900;
  color: var(--mugi-green);
  line-height: 1;
}

.balance-amount-display .currency {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tier-progress-container {
  margin-top: 18px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.progress-bar-track {
  width: 100%;
  height: 12px;
  background-color: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mugi-cyan) 0%, var(--mugi-green) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 1px 4px rgba(0, 168, 89, 0.4);
}

/* --- TABLAS OFICIALES --- */
.gov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.gov-table th {
  background-color: #f1f5f9;
  color: var(--mugi-navy);
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border-subtle);
}

.gov-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.gov-table tr:hover td {
  background-color: #f8fafc;
}

/* --- BADGES OPERADORES --- */
.op-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.op-euskotren {
  background-color: #e6f0fa;
  color: var(--op-euskotren);
  border: 1px solid #bdd7f0;
}

.op-renfe {
  background-color: #fae6ec;
  color: var(--op-renfe);
  border: 1px solid #f3b6c7;
}

.op-lurraldebus {
  background-color: #e6f5ed;
  color: var(--op-lurraldebus);
  border: 1px solid #b3e2cb;
}

.op-dbus {
  background-color: #e6f4fc;
  color: var(--op-dbus);
  border: 1px solid #b3dff6;
}

.op-metrobilbao {
  background-color: #fdeceb;
  color: #b71c14;
  border: 1px solid #f7c4c1;
}

.op-bizkaibus {
  background-color: #eef5e4;
  color: #4a7016;
  border: 1px solid #cfe2b4;
}

.op-mugi {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* --- BOTONES Y CONTROLES --- */
.btn-primary {
  background: linear-gradient(135deg, var(--mugi-green) 0%, var(--mugi-green-hover) 100%);
  color: #ffffff;
  border: none;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-green);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--mugi-green-hover) 0%, var(--mugi-green-dark) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 168, 89, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--mugi-cyan) 0%, var(--mugi-cyan-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-cyan);
}

.btn-cyan:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 159, 227, 0.4);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--mugi-navy);
  border: 1px solid var(--border-subtle);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: var(--mugi-cyan);
  color: var(--mugi-cyan-dark);
}

/* --- FORMULARIOS --- */
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mugi-navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--mugi-cyan);
  box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.2);
}

/* --- CABECERA DE SECCIÓN (Trenes, Transbordos, Avisos) --- */
.section-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: -26px -26px 24px;
  padding: 24px 26px;
  background: linear-gradient(135deg, #f5faff 0%, #f2faf5 100%);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.section-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 420px;
  min-width: 0;
}

.section-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.section-hero-icon .svg-icon {
  width: 26px;
  height: 26px;
}

.section-hero-icon.is-cyan {
  background: linear-gradient(135deg, #22b8f0 0%, var(--mugi-cyan-dark) 100%);
  box-shadow: 0 8px 20px -8px rgba(0, 159, 227, 0.7);
}

.section-hero-icon.is-green {
  background: linear-gradient(135deg, #16c172 0%, var(--mugi-green-dark) 100%);
  box-shadow: 0 8px 20px -8px rgba(0, 168, 89, 0.7);
}

.section-hero-icon.is-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #ea580c 100%);
  box-shadow: 0 8px 20px -8px rgba(234, 88, 12, 0.6);
}

.section-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mugi-green-dark);
}

.section-hero h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--mugi-navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2px 0 4px;
}

.section-hero p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 640px;
}

.section-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.section-subhead h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--mugi-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-block + .section-block {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--mugi-cyan-light);
  color: var(--mugi-cyan-dark);
}

.count-pill.is-muted {
  background: #f1f5f9;
  color: #475569;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 36px 20px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.86rem;
  background: #fbfdff;
}

.empty-state .svg-icon {
  width: 32px;
  height: 32px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.empty-state strong {
  color: var(--mugi-navy);
  font-size: 0.98rem;
}

.empty-state.is-error {
  border-style: solid;
  border-color: #fecaca;
  background: #fef2f2;
}

.empty-state.is-error .svg-icon {
  color: #ef4444;
}

.empty-state.is-ok {
  border-style: solid;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.empty-state.is-ok .svg-icon {
  color: var(--mugi-green);
}

/* --- SELECTOR DE VISTAS (CATÁLOGO / MAPA) --- */
.view-toggle-group {
  display: inline-flex;
  background: #ffffff;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.view-toggle-btn {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.view-toggle-btn:hover {
  color: var(--mugi-navy);
}

.view-toggle-btn.active {
  background: var(--mugi-navy);
  color: #ffffff;
}

/* Panel de Mapa de Gipuzkoa */
.transport-map-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.map-card-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--mugi-navy);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
  margin-right: 6px;
  vertical-align: -1px;
}

/* --- FILTROS (chips con color por operador) --- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.filters-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mugi-navy);
  margin-right: 4px;
}

.btn-filter {
  --chip: var(--mugi-navy);
  background-color: #ffffff;
  border: 1px solid #dbe3ec;
  color: #334155;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-filter .svg-icon {
  width: 1em;
  height: 1em;
  color: var(--chip);
}

.btn-filter:hover {
  border-color: var(--chip);
  color: var(--chip);
}

.btn-filter.active {
  background: var(--chip);
  color: #ffffff;
  border-color: var(--chip);
  box-shadow: 0 4px 12px -5px var(--chip);
}

.btn-filter.active .svg-icon {
  color: #ffffff !important;
}

/* --- BUSCADOR DE PARADAS --- */
.stop-search-box {
  background: linear-gradient(180deg, #f8fbfe 0%, #f4f8fb 100%);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}

.search-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.search-head label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--mugi-navy);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .svg-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-input-wrap .form-control {
  height: 48px;
  padding-left: 42px;
  font-size: 0.95rem;
  border-radius: 10px;
  border-color: #d5dee8;
}

.stops-results-container {
  margin-top: 12px;
  max-height: 340px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.stops-results-container:empty {
  display: none;
}

.stop-card-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  transition: background-color 0.15s ease;
}

.stop-card-item:last-child {
  border-bottom: none;
}

.stop-card-item:hover {
  background-color: #f8fafc;
}

.stop-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.stop-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--mugi-navy);
}

.stop-hub-badge {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid #bfdbfe;
}

.stop-muni-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.stop-address {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}

.stop-address .svg-icon {
  width: 0.95em;
  height: 0.95em;
  color: var(--mugi-green);
}

.stop-lines-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.stop-line-chip {
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
}

.stop-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-maps-link,
.btn-dir-link {
  background: #ffffff;
  border: 1px solid #d5dee8;
  color: #1e293b;
  padding: 0 10px;
  height: 30px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-maps-link .svg-icon,
.btn-dir-link .svg-icon {
  width: 0.95em;
  height: 0.95em;
}

.btn-maps-link:hover {
  background: #f0fdf4;
  border-color: var(--mugi-green);
  color: #166534;
}

.btn-dir-link:hover {
  background: #f0f9ff;
  border-color: var(--mugi-cyan);
  color: var(--mugi-cyan-dark);
}

.stop-plan-group {
  display: inline-flex;
  border: 1px solid #d5dee8;
  border-radius: 7px;
  overflow: hidden;
}

.stop-plan-group button {
  background: #ffffff;
  border: none;
  height: 28px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--mugi-navy);
  cursor: pointer;
  transition: all 0.15s ease;
}

.stop-plan-group button + button {
  border-left: 1px solid #d5dee8;
}

.stop-plan-group button:hover {
  background: var(--mugi-green-light);
  color: var(--mugi-green-dark);
}

/* --- TARJETAS DE LÍNEAS --- */
.lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.line-item-card {
  --op: #0f2742;
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.line-item-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--op);
}

.line-item-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: 0 14px 30px -14px rgba(8, 26, 48, 0.3);
}

.line-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.line-badge-lg {
  background: var(--op, var(--mugi-navy));
  min-width: 52px;
  height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.line-card-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.line-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--mugi-navy);
  line-height: 1.25;
}

.line-card-op {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
}

.line-card-op .svg-icon {
  width: 1em;
  height: 1em;
  color: var(--op);
}

.line-route-terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 10px;
}

.line-route-terminal::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: var(--op);
  opacity: 0.35;
}

.terminal-stop {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.terminal-stop i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2.5px solid var(--op);
  background: #ffffff;
  flex-shrink: 0;
}

.terminal-stop.is-end i {
  background: var(--op);
}

.line-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 9px;
  border-radius: 999px;
  max-width: 100%;
}

.meta-chip .svg-icon {
  width: 0.95em;
  height: 0.95em;
  color: #64748b;
}

.line-card-footer {
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.btn-line-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--op);
  color: #ffffff;
  border: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-line-detail:hover {
  filter: brightness(1.12);
}

.btn-line-detail:hover .svg-icon {
  transform: translateX(2px);
}

/* --- TIMELINE DEL MODAL DE LÍNEA (bloque original) --- */
.line-timeline {
  position: relative;
  padding: 12px 0 12px 20px;
  list-style: none;
}

.line-timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 27px;
  width: 3px;
  background: #cbd5e1;
  z-index: 1;
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  z-index: 2;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-node {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #94a3b8;
  background-color: #64748b;
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-node.origin {
  background-color: var(--mugi-green);
  box-shadow: 0 0 0 2px var(--mugi-green);
}

.timeline-node.destination {
  background-color: #ef4444;
  box-shadow: 0 0 0 2px #ef4444;
}

.timeline-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-stop-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--mugi-navy);
}

.timeline-stop-address {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* --- PLANIFICADOR DE TRANSBORDOS --- */
.planner-form-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  background:
    radial-gradient(400px 140px at 100% 0%, rgba(0, 159, 227, 0.25), transparent 70%),
    linear-gradient(135deg, #081a30 0%, #0f2742 100%);
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 14px 30px -18px rgba(8, 26, 48, 0.6);
}

.planner-stops {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
}

.planner-stops > .planner-field:first-child { order: 1; }
.planner-swap-btn { order: 2; }
.planner-stops > .planner-field:nth-child(2) { order: 3; }

.planner-field {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.planner-field .form-group {
  flex: 1;
  min-width: 0;
}

.planner-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-bottom: 17px;
  flex-shrink: 0;
}

.planner-node.is-origin {
  background: #081a30;
  border: 3px solid #34d399;
}

.planner-node.is-dest {
  background: #f87171;
  border: 3px solid #fecaca;
}

.planner-form-grid .form-group label {
  color: #a5b4c8;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.planner-form-grid .form-control {
  height: 46px;
  border-color: transparent;
  border-radius: 10px;
  font-weight: 600;
  color: var(--mugi-navy);
}

.planner-swap-btn {
  width: 40px;
  height: 40px;
  margin-bottom: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.3s ease;
}

.planner-swap-btn .svg-icon {
  transform: rotate(90deg);
}

.planner-swap-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(180deg);
}

.planner-submit {
  height: 46px;
  padding: 0 24px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .planner-form-grid {
    grid-template-columns: 1fr;
  }
  .planner-stops {
    grid-template-columns: 1fr;
  }
  .planner-swap-btn {
    justify-self: center;
    margin: -4px 0;
  }
  .planner-swap-btn .svg-icon {
    transform: none;
  }
}

.preset-routes {
  margin-top: 18px;
}

.preset-routes-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.preset-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.btn-preset-route {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: inherit;
  transition: all 0.16s ease;
}

.btn-preset-route strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mugi-navy);
  font-size: 0.9rem;
}

.btn-preset-route strong .svg-icon {
  width: 0.9em;
  height: 0.9em;
  color: var(--mugi-green);
}

.btn-preset-route span {
  font-size: 0.76rem;
  color: #64748b;
}

.btn-preset-route:hover {
  border-color: var(--mugi-green);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgba(0, 168, 89, 0.5);
}

/* Tarjetas de ruta */
.route-card {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-top: 16px;
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeInResult 0.25s ease-out;
}

.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 20px;
  background: #fbfdff;
  border-bottom: 1px solid #eef2f6;
}

.route-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.route-option {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--mugi-navy);
  padding: 3px 9px;
  border-radius: 999px;
}

.route-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
}

.route-type-badge.is-direct {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.route-type-badge.is-transfer {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.route-type-badge.is-fastest {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.route-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--op);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 6px;
}

.route-chip .svg-icon {
  width: 1em;
  height: 1em;
}

.route-chip.is-walk {
  background: #f1f5f9;
  color: #475569;
}

.route-chip-sep {
  width: 0.9em;
  height: 0.9em;
  color: #cbd5e1;
}

.route-duration {
  text-align: right;
}

.route-duration-val {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--mugi-navy);
  line-height: 1;
  letter-spacing: -0.03em;
}

.route-duration-val small {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  margin-left: 3px;
  letter-spacing: 0;
}

.route-duration-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
}

.timeline {
  position: relative;
  padding: 20px 20px 4px 58px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 34px;
  left: 33px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-step {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -38px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--op, var(--mugi-navy));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.timeline-dot .svg-icon {
  width: 13px;
  height: 13px;
}

.timeline-dot.walk {
  background-color: #94a3b8;
}

.timeline-dot.end {
  background-color: var(--mugi-green);
}

.segment-body {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-left: 3px solid var(--op);
  border-radius: 10px;
  padding: 12px 14px;
}

.segment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.segment-head strong {
  color: var(--mugi-navy);
  font-size: 0.93rem;
}

.line-code-badge {
  background: var(--op);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 5px;
}

.segment-stops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
}

.segment-stops .svg-icon {
  width: 0.9em;
  height: 0.9em;
  color: #94a3b8;
}

.segment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.segment-meta span {
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

.segment-walk {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #14532d;
}

.segment-walk div {
  font-size: 0.8rem;
  color: #166534;
  margin-top: 2px;
}

.segment-arrival {
  padding-top: 4px;
  font-size: 0.9rem;
  color: var(--mugi-navy);
}

.fare-panel {
  margin: 4px 20px 20px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: 14px;
}

.fare-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.fare-panel-head strong {
  color: var(--mugi-navy);
  font-size: 0.88rem;
}

.fare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.fare-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fare-tile span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.fare-tile strong {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--mugi-navy);
}

.fare-tile.is-cash strong {
  color: #64748b;
}

.fare-tile.is-best {
  background: #f0fdf4;
  border-color: #86efac;
}

.fare-tile.is-best strong {
  color: var(--mugi-green-dark);
}

.transfer-highlight-box {
  background: linear-gradient(90deg, #ecfdf5 0%, #f0f9ff 100%);
  border-left: 4px solid var(--mugi-green);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mugi-discount-pill {
  background-color: var(--mugi-green-light);
  border: 1px solid var(--mugi-green-border);
  color: var(--mugi-green-dark);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* --- COMUNICADOS DE MUGI.EUS --- */
.scraped-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.scraped-news-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.scraped-news-card:hover {
  transform: translateY(-2px);
  border-color: var(--mugi-cyan-border);
  box-shadow: 0 12px 26px -14px rgba(0, 119, 182, 0.4);
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.74rem;
  color: #94a3b8;
}

.news-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--mugi-navy);
  line-height: 1.35;
  margin-bottom: 6px;
}

.news-card-summary {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mugi-cyan-dark);
  text-decoration: none;
}

.news-card-link .svg-icon {
  width: 0.9em;
  height: 0.9em;
}

.news-card-link:hover {
  text-decoration: underline;
}

.scraped-badge {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.scraped-badge .svg-icon {
  width: 0.9em;
  height: 0.9em;
}

/* Tablas de tarifas */
.tariffs-grid {
  display: grid;
  gap: 16px;
}

.tariff-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.tariff-card-title {
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--mugi-navy);
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
}

.tariff-card-scroll {
  overflow-x: auto;
}

.tariff-card .gov-table th {
  background: #ffffff;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.tariff-card .gov-table tr:last-child td {
  border-bottom: none;
}

.tariff-card .gov-table td:first-child {
  font-weight: 700;
  color: var(--mugi-navy);
}

@media (max-width: 640px) {
  .gov-card {
    padding: 18px;
  }
  .section-hero {
    margin: -18px -18px 20px;
    padding: 18px;
  }
  .section-hero h2 {
    font-size: 1.2rem;
  }
  .section-hero-icon {
    width: 44px;
    height: 44px;
  }
}

/* --- MODALES --- */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(8, 26, 48, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  max-width: 580px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 159, 227, 0.2);
}

.auth-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 18px;
}

.auth-tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-tab-btn.active {
  color: var(--mugi-green);
  border-bottom-color: var(--mugi-green);
}

/* --- FOOTER --- */
.gov-footer {
  background: linear-gradient(180deg, var(--mugi-navy) 0%, #040e1b 100%);
  color: #94a3b8;
  font-size: 0.84rem;
  padding: 36px 28px;
  margin-top: 50px;
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--mugi-green) 0%, var(--mugi-cyan) 100%) 1;
}

.footer-content {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-entity h3 {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
}

/* ==========================================================================
   PREDICCIONES IA & INCIDENCIAS
   ========================================================================== */

/* Banner del modelo */
.ml-hero-banner {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 220px at 92% -20%, rgba(0, 168, 89, 0.35), transparent 70%),
    radial-gradient(380px 200px at 60% 130%, rgba(0, 159, 227, 0.28), transparent 70%),
    linear-gradient(135deg, #071526 0%, #0c2240 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: 0 18px 40px -22px rgba(8, 26, 48, 0.8);
}

.ml-hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
  pointer-events: none;
}

.ml-hero-banner > * {
  position: relative;
  z-index: 1;
}

.ml-hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 420px;
  min-width: 0;
}

.ml-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mugi-green) 0%, var(--mugi-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 10px 24px -8px rgba(0, 168, 89, 0.7);
}

.ml-hero-icon .svg-icon {
  width: 28px;
  height: 28px;
}

.ml-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86efac;
}

.ml-hero-banner h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 3px 0 4px;
}

.ml-hero-banner p {
  font-size: 0.88rem;
  color: #a5b4c8;
  max-width: 560px;
}

.btn-ghost-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-ghost-light:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* KPIs del modelo */
.ml-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ml-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ml-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ml-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ml-kpi-icon .svg-icon {
  width: 18px;
  height: 18px;
}

.ml-kpi-icon.is-green { background: var(--mugi-green-light); color: var(--mugi-green-dark); }
.ml-kpi-icon.is-cyan { background: var(--mugi-cyan-light); color: var(--mugi-cyan-dark); }
.ml-kpi-icon.is-amber { background: #fffbeb; color: #d97706; }
.ml-kpi-icon.is-navy { background: #eef2f7; color: var(--mugi-navy-light); }

.ml-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ml-kpi-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--mugi-navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.ml-kpi-val .unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0;
}

.ml-kpi-desc {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

/* Consola del simulador */
.ml-console-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.ml-console-box textarea.form-control {
  font-size: 0.95rem;
  line-height: 1.5;
  border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
  background: #fbfdff;
}

.ml-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.ml-preset-chip {
  background: #ffffff;
  border: 1px solid #dbe3ec;
  color: #334155;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
  user-select: none;
}

.ml-preset-chip:hover {
  border-color: #94a3b8;
  color: var(--mugi-navy);
}

.ml-preset-chip.active {
  background: var(--mugi-navy);
  color: #ffffff;
  border-color: var(--mugi-navy);
}

.sev-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

/* Resultado del análisis */
.ml-result-card {
  --sev: var(--mugi-green);
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-top: 18px;
  animation: fadeInResult 0.25s ease-out;
}

.ml-result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--sev);
}

@keyframes fadeInResult {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ml-result-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 14px;
}

.ml-result-severity {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-result-severity-label,
.ml-result-delay span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.ml-result-severity strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
}

.ml-result-severity .sev-dot {
  width: 10px;
  height: 10px;
}

.ml-result-delay {
  border-radius: 12px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.ml-result-delay strong {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.ml-result-delay small {
  font-size: 0.9rem;
  margin-left: 3px;
}

.ml-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.ml-stat-tile {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  padding: 12px 14px;
}

.ml-stat-tile-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.ml-stat-tile-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--mugi-navy);
}

.ml-terms {
  margin-bottom: 16px;
}

.ml-terms-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.ml-terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ml-keyword-tag {
  display: inline-block;
  background: #eef6ff;
  border: 1px solid #cfe3fb;
  color: #0b4a8b;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

@media (max-width: 560px) {
  .ml-result-header {
    grid-template-columns: 1fr;
  }
  .ml-result-delay {
    text-align: left;
  }
}

/* Tarjetas de incidencia */
.incident-card {
  --sev: #eab308;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px 18px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.incident-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--sev);
}

.incident-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.incident-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.incident-severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.incident-zone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 3px 9px;
  border-radius: 999px;
}

.incident-zone .svg-icon {
  width: 0.95em;
  height: 0.95em;
}

.incident-time {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 0.75rem;
  color: #94a3b8;
}

.incident-time span:last-child {
  font-weight: 600;
  color: #64748b;
}

.incident-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--mugi-navy);
  margin-bottom: 4px;
}

.incident-text {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.55;
}

.incident-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 12px;
}

.incident-stats > div {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.incident-stats span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.incident-stats strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--mugi-navy);
}

.incident-stats strong.is-delay {
  color: #b91c1c;
}

@media (max-width: 560px) {
  .incident-stats {
    grid-template-columns: 1fr;
  }
  .incident-time {
    text-align: left;
  }
}

.incident-mitigation-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #166534;
  line-height: 1.45;
}

.incident-mitigation-box > .svg-icon {
  color: var(--mugi-green);
  margin-top: 1px;
}

.incident-mitigation-box > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.incident-mitigation-box strong {
  color: #14532d;
  font-size: 0.84rem;
}

/* Barra de confianza */
.ml-confidence-wrapper {
  background: #e2e8f0;
  border-radius: 10px;
  height: 6px;
  width: 100%;
  overflow: hidden;
  margin-top: 8px;
}

.ml-confidence-bar {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #009fe3 0%, #00a859 100%);
  transition: width 0.4s ease;
}

/* --- AVISO DE INICIO DE SESIÓN EN MI TARJETA --- */
.card-gate {
  text-align: center;
  padding: 56px 26px;
  background:
    radial-gradient(420px 200px at 50% -20%, rgba(0, 168, 89, 0.12), transparent 70%),
    #ffffff;
}

.card-gate-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #16c172 0%, var(--mugi-green-dark) 100%);
  box-shadow: 0 10px 24px -10px rgba(0, 168, 89, 0.7);
}

.card-gate-icon .svg-icon {
  width: 30px;
  height: 30px;
}

.card-gate h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--mugi-navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.card-gate p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 22px;
}

.card-gate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- LOGO MUGIMANAGER Y DISTINTIVO DE LA TARJETA --- */
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.header-brand:hover .brand-logo {
  transform: translateY(-1px) rotate(-3deg);
}

.card-brand-badge {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  padding: 6px 14px;
  border-radius: 12px;
  background: #0b254a;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(10, 37, 74, 0.35);
}
