/* ==========================================================================
   OBSERVATORIO DE CONTRATACIÓN PÚBLICA · HOSPITAL DE GUADARRAMA (SERMAS)
   Directorio de 16.785 Contratos Públicos y 16,28 M€ de Gasto Asistencial
   Diseño Profesional, Arquitectura Responsiva (Móvil + Escritorio) y SEO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Paleta Base y Superficies */
  --ink: #040807;
  --ink-2: #07120f;
  --ink-3: #0c1a16;
  --ink-card: rgba(8, 20, 17, 0.84);
  --ink-card-solid: #091512;
  --ink-card-hover: rgba(12, 28, 24, 0.95);
  --card-border: rgba(36, 229, 163, 0.16);
  --card-border-hover: rgba(36, 229, 163, 0.42);
  --paper: #f0f6f3;
  --paper-soft: #c4d7d0;
  --muted: #79948a;
  --text-dim: #79948a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(36, 229, 163, 0.28);

  /* Acentos y Señalética Analítica */
  --mint: #24e5a3;
  --mint-light: #52f3bb;
  --mint-glow: rgba(36, 229, 163, 0.28);
  --mint-soft: rgba(36, 229, 163, 0.08);
  --accent: #24e5a3;
  --accent-glow: rgba(36, 229, 163, 0.32);
  --accent-soft: rgba(36, 229, 163, 0.09);

  --signal: #f87171;
  --signal-soft: rgba(248, 113, 113, 0.12);
  --signal-border: rgba(248, 113, 113, 0.35);

  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.12);
  --blue-border: rgba(96, 165, 250, 0.3);

  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --amber-border: rgba(251, 191, 36, 0.3);

  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.12);

  /* Dimensiones y Tipografía */
  --topbar: 68px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Consolas", "Roboto Mono", monospace;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(36, 229, 163, 0.16);
}

/* Reset y Normalización */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--paper);
  background-color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  transition: all 0.2s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* ----------------------------------------------------
   1. ESCENA 3D THREE.JS & RESPLANDORES AMBIENTALES
---------------------------------------------------- */
.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#contracts-canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.85;
  transition: opacity 600ms ease, filter 400ms ease;
}

.is-analysis #contracts-canvas {
  opacity: 0.28;
  filter: contrast(1.1) saturate(0.5);
}

.ambient-glow-top {
  position: fixed;
  top: -18vh;
  left: 15%;
  width: 70vw;
  height: 50vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 229, 163, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 1;
  filter: blur(80px);
}

.ambient-glow-bottom {
  position: fixed;
  bottom: -22vh;
  right: 10%;
  width: 55vw;
  height: 45vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 1;
  filter: blur(90px);
}

/* ----------------------------------------------------
   2. TOPBAR HUD DE NAVEGACIÓN
---------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3.5vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 8, 7, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
}

.brand-code {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--mint) 0%, #34d399 100%);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  border-radius: var(--radius-xs);
  box-shadow: 0 0 12px var(--mint-glow);
}

.brand-title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.2;
}

.brand-title p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.hud-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: rgba(36, 229, 163, 0.08);
  border-color: rgba(36, 229, 163, 0.35);
  color: #ffffff;
}

.hud-btn-highlight {
  border-color: rgba(36, 229, 163, 0.35);
  color: var(--mint);
  background: rgba(36, 229, 163, 0.06);
}

.hud-btn-search {
  background: rgba(36, 229, 163, 0.12);
  border-color: var(--mint);
  color: #ffffff;
  font-weight: 700;
}

.hud-btn.active {
  border-color: var(--mint);
  color: var(--mint);
  background: rgba(36, 229, 163, 0.12);
}

.btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

/* ----------------------------------------------------
   3. BARRA STICKY DE NAVEGACIÓN RÁPIDA (SUBNAV ANCHORS)
---------------------------------------------------- */
.subnav-strip {
  position: sticky;
  top: var(--topbar);
  z-index: 50;
  background: rgba(7, 18, 15, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 8px clamp(16px, 3.5vw, 48px);
}

.subnav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.subnav-inner::-webkit-scrollbar {
  display: none;
}

.subnav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 4px;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.subnav-pill:hover {
  background: rgba(36, 229, 163, 0.1);
  border-color: rgba(36, 229, 163, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.subnav-pill-accent {
  background: rgba(36, 229, 163, 0.12);
  border-color: rgba(36, 229, 163, 0.45);
  color: var(--mint);
  font-weight: 700;
}

/* ----------------------------------------------------
   4. CONTENIDO PRINCIPAL Y BREADCRUMBS
---------------------------------------------------- */
.main-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3.5vw, 48px) 100px;
}

/* Breadcrumb Trail */
.breadcrumb-trail {
  margin-bottom: 20px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.breadcrumb-list a {
  color: var(--muted);
  transition: color 0.2s;
}

.breadcrumb-list a:hover {
  color: var(--mint);
}

.breadcrumb-list .separator {
  color: rgba(255, 255, 255, 0.2);
}

.breadcrumb-list .current {
  color: var(--paper-soft);
  font-weight: 600;
}

/* ----------------------------------------------------
   5. HERO HEADER
---------------------------------------------------- */
.hero-header {
  margin-bottom: 32px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 24px;
  background: rgba(36, 229, 163, 0.08);
  border: 1px solid rgba(36, 229, 163, 0.24);
  font-size: 12px;
  font-weight: 700;
  color: var(--mint);
  margin-bottom: 16px;
  box-shadow: 0 0 16px rgba(36, 229, 163, 0.08);
}

.hero-title {
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 16px;
}

.accent-gradient {
  background: linear-gradient(135deg, var(--mint) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-desc {
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--paper-soft);
  line-height: 1.65;
  max-width: 900px;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hero-btn-primary {
  background: linear-gradient(135deg, var(--mint) 0%, #10b981 100%);
  color: var(--ink);
  box-shadow: 0 4px 20px rgba(36, 229, 163, 0.35);
}

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(36, 229, 163, 0.5);
  background: #34d399;
}

.hero-btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: #ffffff;
}

.hero-btn-secondary:hover {
  background: rgba(36, 229, 163, 0.1);
  border-color: var(--mint);
  transform: translateY(-2px);
}

/* ----------------------------------------------------
   6. INDICADORES CLAVE KPI
---------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.kpi-card {
  position: relative;
  background: var(--ink-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.kpi-card.kpi-accent::before { background: var(--mint); }
.kpi-card.kpi-blue::before { background: var(--blue); }
.kpi-card.kpi-signal::before { background: var(--signal); }
.kpi-card.kpi-amber::before { background: var(--amber); }

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  gap: 8px;
}

.kpi-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kpi-accent .kpi-tag { background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(36, 229, 163, 0.25); }
.kpi-blue .kpi-tag { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(96, 165, 250, 0.25); }
.kpi-signal .kpi-tag { background: var(--signal-soft); color: var(--signal); border: 1px solid rgba(248, 113, 113, 0.25); }
.kpi-amber .kpi-tag { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.25); }

.kpi-value {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 850;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

/* ----------------------------------------------------
   7. SECCIÓN DE NOVEDADES Y ÚLTIMA ACTUALIZACIÓN
---------------------------------------------------- */
.recent-section {
  margin-bottom: 36px;
}

.section-head-slide {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.kicker-badge {
  display: inline-block;
  background: var(--mint-soft);
  color: var(--mint);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: 1px solid rgba(36, 229, 163, 0.2);
}

.section-head-h3 {
  font-size: clamp(18px, 2vw, 22px);
  color: #ffffff;
  margin-top: 6px;
  font-weight: 800;
}

.section-head-small {
  color: var(--muted);
  font-size: 12px;
}

.recent-updated {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(36, 229, 163, 0.05);
  border: 1px solid rgba(36, 229, 163, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
}

.pulse-beacon-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.recent-updated-label {
  font-size: 12px;
  color: var(--mint);
  font-weight: 700;
}

.recent-updated-date {
  font-size: 13px;
  color: #ffffff;
  font-weight: 700;
}

.recent-updated-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.recent-card {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--ink-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-card);
}

.recent-card-top,
.recent-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recent-card-date {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.recent-card-amount {
  font-size: 14px;
  font-weight: 850;
  color: var(--mint);
  white-space: nowrap;
}

.recent-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-card-supplier {
  font-size: 12px;
  color: var(--paper-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-card-supplier strong {
  color: #ffffff;
}

.recent-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.recent-card-chip {
  font-size: 10px;
  font-weight: 700;
  color: var(--mint);
  background: var(--mint-soft);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  border: 1px solid rgba(36, 229, 163, 0.2);
  white-space: nowrap;
}

.recent-card-proc-chip {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  white-space: nowrap;
}

.recent-card-ref {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}

.recent-card-link {
  font-size: 11px;
  color: var(--mint);
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

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

/* ----------------------------------------------------
   8. DOSSIERS MONOGRÁFICOS (SEO HUBS)
---------------------------------------------------- */
.hubs-section {
  margin-bottom: 40px;
}

.hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.hub-item-card {
  position: relative;
  background: var(--ink-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}

.hub-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 20px rgba(36, 229, 163, 0.12);
}

.hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.hub-card-kicker {
  font-size: 11px;
  color: var(--mint);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hub-card-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--mint);
  background: var(--mint-soft);
  border: 1px solid rgba(36, 229, 163, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.hub-badge-alert {
  color: var(--signal) !important;
  background: var(--signal-soft) !important;
  border-color: var(--signal-border) !important;
}

.hub-badge-amber {
  color: var(--amber) !important;
  background: var(--amber-soft) !important;
  border-color: var(--amber-border) !important;
}

.hub-badge-blue {
  color: var(--blue) !important;
  background: var(--blue-soft) !important;
  border-color: var(--blue-border) !important;
}

.hub-card-title {
  color: #ffffff;
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hub-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.hub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--mint);
}

.hub-arrow {
  transition: transform 0.2s ease;
}

.hub-item-card:hover .hub-arrow {
  transform: translateX(4px);
}

.hub-card-alert {
  border-color: rgba(248, 113, 113, 0.28);
}
.hub-card-alert .hub-card-kicker { color: var(--signal); }
.hub-card-alert .hub-card-footer { color: var(--signal); }

.hub-card-amber {
  border-color: rgba(251, 191, 36, 0.28);
}
.hub-card-amber .hub-card-kicker { color: var(--amber); }
.hub-card-amber .hub-card-footer { color: var(--amber); }

.hub-card-blue {
  border-color: rgba(96, 165, 250, 0.28);
}
.hub-card-blue .hub-card-kicker { color: var(--blue); }
.hub-card-blue .hub-card-footer { color: var(--blue); }

/* ----------------------------------------------------
   9. SECCIÓN DE ANALÍTICA Y GRÁFICOS
---------------------------------------------------- */
.analytics-section {
  margin-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 850;
  color: #ffffff;
}

.section-sub-tip {
  font-size: 12px;
  color: var(--muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-bottom: 20px;
  width: 100%;
}

.chart-card {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--ink-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.chart-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.chart-header small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--mint);
  background: var(--mint-soft);
  border: 1px solid rgba(36, 229, 163, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.chart-tag-accent {
  color: var(--accent);
}

/* Gráfico Anual de Barras */
.year-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 10px 0 28px;
  position: relative;
  width: 100%;
}

.year-bar-wrap {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.year-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #08111e;
  border: 1px solid rgba(36, 229, 163, 0.35);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--paper);
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
}

.year-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #08111e;
}

.year-bar-wrap:hover .year-tooltip,
.year-bar-wrap:focus-visible .year-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.year-bar-wrap:first-child .year-tooltip {
  left: 0;
  transform: translateX(0) translateY(4px);
}
.year-bar-wrap:first-child .year-tooltip::after {
  left: 12px;
  transform: none;
}
.year-bar-wrap:last-child .year-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.year-bar-wrap:last-child .year-tooltip::after {
  left: auto;
  right: 12px;
  transform: none;
}
.year-bar-wrap:first-child:hover .year-tooltip,
.year-bar-wrap:last-child:hover .year-tooltip {
  transform: translateX(0) translateY(0);
}

.year-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--mint) 0%, rgba(36, 229, 163, 0.35) 100%);
  border-radius: 4px 4px 0 0;
  border: 1px solid rgba(36, 229, 163, 0.35);
  border-bottom: none;
  transition: all 0.25s ease;
  min-height: 4px;
}

.year-bar-wrap:hover .year-bar,
.year-bar-wrap.is-selected .year-bar {
  background: linear-gradient(180deg, #52f3bb 0%, var(--mint) 100%);
  box-shadow: 0 0 14px var(--mint-glow);
  filter: brightness(1.2);
}

.year-label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s;
}

.year-bar-wrap:hover .year-label,
.year-bar-wrap.is-selected .year-label {
  color: var(--mint);
}

/* ==========================================================================
   DESGLOSE POR TIPOLOGÍAS DE CONTRATO (Suministros vs Servicios vs Obras)
   Gráfica visual interactiva con Donut SVG, barras comparativas y regla apilada
   ========================================================================== */
.types-breakdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-start;
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
}

/* 1. Layout de 2 columnas: Donut a la izquierda + Desglose de barras a la derecha */
.types-chart-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* Donut SVG Wrapper */
.types-donut-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
}

.types-donut-svg {
  display: block;
  overflow: visible;
  width: 160px;
  height: 160px;
}

.donut-bg-circle {
  stroke: rgba(255, 255, 255, 0.05);
}

.donut-segment {
  cursor: pointer;
  transition: stroke-width 0.25s ease, filter 0.25s ease, opacity 0.2s ease;
}

.donut-segment:hover,
.donut-segment.is-hovered {
  stroke-width: 23px;
  filter: brightness(1.25) drop-shadow(0 0 8px rgba(36, 229, 163, 0.5));
}

.donut-segment.segment-suministros:hover,
.donut-segment.segment-suministros.is-hovered {
  filter: brightness(1.25) drop-shadow(0 0 10px rgba(36, 229, 163, 0.6));
}

.donut-segment.segment-servicios:hover,
.donut-segment.segment-servicios.is-hovered {
  filter: brightness(1.25) drop-shadow(0 0 10px rgba(96, 165, 250, 0.6));
}

.donut-segment.segment-obras:hover,
.donut-segment.segment-obras.is-hovered {
  filter: brightness(1.25) drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
}

.donut-segment.is-selected {
  stroke-width: 24px;
  filter: brightness(1.3) drop-shadow(0 0 12px #ffffff);
}

.donut-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  width: 104px;
  z-index: 2;
}

.donut-center-val {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-family: var(--mono);
}

.donut-center-lbl {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--mint);
  margin-top: 3px;
  line-height: 1.2;
  white-space: nowrap;
}

.donut-center-sub {
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
}

/* 2. Filas de Desglose Individual */
.types-rows-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.type-card-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-sizing: border-box;
  min-width: 0;
}

.type-card-row:hover,
.type-card-row.is-hovered {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(36, 229, 163, 0.35);
  transform: translateY(-1px);
}

.type-card-row.is-selected {
  background: rgba(36, 229, 163, 0.08);
  border-color: var(--mint);
  box-shadow: 0 0 16px rgba(36, 229, 163, 0.2);
}

.type-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.type-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.type-icon-dot {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.type-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.type-share-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.share-suministros {
  background: rgba(36, 229, 163, 0.15);
  color: var(--mint);
  border: 1px solid rgba(36, 229, 163, 0.3);
}

.share-servicios {
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.share-obras {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.type-amount-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.type-amount-val {
  font-size: 13px;
  font-weight: 850;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.type-count-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.type-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.type-dot-sub {
  opacity: 0.5;
}

.type-avg-sub {
  color: var(--paper-soft);
  font-weight: 600;
}

/* Track y Barra de Progreso */
.type-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}

.type-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 4px;
}

.fill-suministros {
  background: linear-gradient(90deg, #24e5a3 0%, #10b981 100%);
  box-shadow: 0 0 10px rgba(36, 229, 163, 0.4);
}

.fill-servicios {
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
}

.fill-obras {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* 3. Barra segmentada proporcional continua (Stacked Bar Ruler) */
.types-stacked-bar {
  display: flex;
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.stacked-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.15s ease;
  user-select: none;
}

.stacked-segment:hover {
  filter: brightness(1.25);
  z-index: 2;
}

.stacked-segment.is-selected {
  outline: 2px solid #ffffff;
  outline-offset: -1px;
  z-index: 3;
}

.stacked-segment.segment-suministros {
  background: linear-gradient(90deg, #24e5a3 0%, #10b981 100%);
}

.stacked-segment.segment-servicios {
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  border-left: 1px solid rgba(0, 0, 0, 0.25);
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}

.stacked-segment.segment-obras {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.segment-label {
  font-size: 9.5px;
  font-weight: 900;
  color: #040807;
  letter-spacing: -0.02em;
  padding: 0 4px;
}

/* 4. Cuadro de Advertencia LCSP */
.minor-warning-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--paper-soft);
  margin-top: 2px;
  box-sizing: border-box;
}

.minor-warning-icon {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
}

.minor-warning-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.minor-warning-title {
  color: var(--amber);
  font-size: 11.5px;
}

.minor-warning-title strong {
  color: #ffffff;
  font-weight: 800;
}

.minor-warning-desc {
  color: var(--paper-soft);
  font-size: 11px;
}

.minor-warning-desc strong {
  color: #ffffff;
}

/* Compatibilidad retrospectiva con clases legacy */
.breakdown-row,
.type-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.breakdown-info,
.type-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.breakdown-bar-bg,
.type-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}

.breakdown-bar-fill,
.type-progress-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tarjeta Patrón Mensual ("Fiebre de Diciembre") */
.monthly-pattern-card {
  background: var(--ink-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.monthly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.monthly-badge-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--signal);
  margin-bottom: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.monthly-main-title {
  font-size: 18px;
  font-weight: 850;
  color: #ffffff;
  margin-bottom: 4px;
}

.monthly-subtitle {
  font-size: 12px;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.45;
}

.monthly-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.monthly-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.monthly-control-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monthly-select {
  height: 38px;
  background: var(--ink-card-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Indicadores de Cierre de Año HUD */
.year-end-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.hud-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-box-highlight {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.3);
}

.hud-box-highlight .hud-box-val {
  color: var(--amber);
}

.hud-box-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-box-val {
  font-size: 20px;
  font-weight: 850;
  color: #ffffff;
}

.hud-box-sub {
  font-size: 11px;
  color: var(--muted);
}

.hud-diagnosis-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: rgba(248, 113, 113, 0.15);
  color: var(--signal);
  border: 1px solid var(--signal-border);
  margin-top: 2px;
  width: fit-content;
}

/* Gráfico de 12 Meses */
.monthly-chart-wrapper {
  position: relative;
  height: 220px;
  padding: 26px 0 28px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.monthly-chart-canvas-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100%;
  position: relative;
}

.month-bar-wrap {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  padding: 0 2px;
  transition: transform 0.15s ease;
  user-select: none;
}

.month-bar-wrap:hover {
  transform: translateY(-2px);
}

.month-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #08111e;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--paper);
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.month-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #08111e;
}

.month-bar-wrap[data-month="1"] .month-tooltip,
.month-bar-wrap[data-month="2"] .month-tooltip {
  left: 0;
  transform: translateX(0) translateY(4px);
}
.month-bar-wrap[data-month="1"] .month-tooltip::after,
.month-bar-wrap[data-month="2"] .month-tooltip::after {
  left: 20px;
  transform: none;
}

.month-bar-wrap[data-month="11"] .month-tooltip,
.month-bar-wrap[data-month="12"] .month-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.month-bar-wrap[data-month="11"] .month-tooltip::after,
.month-bar-wrap[data-month="12"] .month-tooltip::after {
  left: auto;
  right: 20px;
  transform: none;
}

.month-bar-wrap:hover .month-tooltip,
.month-bar-wrap:focus-visible .month-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.month-bar-wrap[data-month="1"]:hover .month-tooltip,
.month-bar-wrap[data-month="2"]:hover .month-tooltip,
.month-bar-wrap[data-month="11"]:hover .month-tooltip,
.month-bar-wrap[data-month="12"]:hover .month-tooltip {
  transform: translateX(0) translateY(0);
}

.month-yearend-tag {
  position: absolute;
  top: 0;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

.month-val-top {
  font-size: 10px;
  font-weight: 700;
  color: var(--paper-soft);
  margin-bottom: 5px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

.month-bar-wrap:hover .month-val-top,
.month-bar-wrap.is-active .month-val-top {
  color: #ffffff;
  font-weight: 850;
}

.month-bar {
  width: 100%;
  max-width: 38px;
  min-height: 4px;
  background: linear-gradient(180deg, var(--blue) 0%, rgba(96, 165, 250, 0.3) 100%);
  border-radius: 4px 4px 0 0;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-bottom: none;
  transition: all 0.25s ease;
}

.month-bar-wrap.is-yearend .month-bar {
  background: linear-gradient(180deg, var(--amber) 0%, rgba(251, 191, 36, 0.35) 100%);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.22);
}

.month-bar-wrap:hover .month-bar {
  filter: brightness(1.2);
  border-color: rgba(96, 165, 250, 0.8);
}

.month-bar-wrap.is-yearend:hover .month-bar {
  filter: brightness(1.25);
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.45);
}

.month-bar-wrap.is-active .month-bar {
  border: 2px solid #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
}

.month-label-bottom {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  transition: color 0.15s;
}

.month-bar-wrap:hover .month-label-bottom,
.month-bar-wrap.is-active .month-label-bottom {
  color: #ffffff;
}

.monthly-ref-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.ref-line-label {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 10px;
  color: var(--muted);
}

.monthly-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.monthly-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-standard { background: var(--blue); }
.legend-rush { background: var(--amber); }
.legend-ref { border-top: 2px dashed rgba(255, 255, 255, 0.4); width: 16px; height: 0; }

.btn-filter-q4 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-filter-q4:hover {
  background: rgba(251, 191, 36, 0.22);
  transform: translateY(-1px);
}

/* ==========================================================================
   GRÁFICO DE RANKING: PRINCIPALES EMPRESAS ADJUDICATARIAS
   Visualización forense por barras horizontales con comparativa de volumen
   ========================================================================== */
.leaderboard-card {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--ink-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Conmutador de Métrica: Volumen vs Contratos */
.leaderboard-metric-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.btn-supplier-metric {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-supplier-metric:hover {
  color: #ffffff;
}

.btn-supplier-metric.is-active {
  background: rgba(36, 229, 163, 0.18);
  color: var(--mint);
  border: 1px solid rgba(36, 229, 163, 0.35);
  box-shadow: 0 0 10px rgba(36, 229, 163, 0.15);
}

/* Contenedor Principal del Gráfico */
.leaderboard-chart-container,
.leaderboard-list {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.supplier-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* 1. Eje de escala superior */
.supplier-chart-axis {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-sizing: border-box;
}

.axis-col-identity {
  width: 270px;
  flex-shrink: 0;
}

.axis-col-track {
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  position: relative;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 0 2px;
}

.axis-tick {
  color: var(--muted);
  position: relative;
}

.axis-col-value {
  width: 140px;
  flex-shrink: 0;
  text-align: right;
}

/* 2. Contenedor de Barras */
.supplier-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

/* Fila de Barra de Proveedor en el Gráfico */
.supplier-bar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  user-select: none;
  box-sizing: border-box;
  width: 100%;
}

.supplier-bar-row:hover {
  background: rgba(36, 229, 163, 0.04);
  border-color: rgba(36, 229, 163, 0.3);
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.supplier-bar-row.is-selected {
  background: rgba(36, 229, 163, 0.09);
  border-color: var(--mint);
  box-shadow: 0 0 18px rgba(36, 229, 163, 0.25);
}

/* Columna de Identidad (Rank + Nombre + NIF + Tipo) */
.supplier-row-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 270px;
  min-width: 0;
  flex-shrink: 0;
}

.supplier-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.supplier-rank-badge.rank-gold {
  background: linear-gradient(135deg, rgba(36, 229, 163, 0.35) 0%, rgba(16, 185, 129, 0.35) 100%);
  color: #52f3bb;
  border: 1px solid rgba(36, 229, 163, 0.6);
  box-shadow: 0 0 10px rgba(36, 229, 163, 0.35);
}

.supplier-rank-badge.rank-silver {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.35) 0%, rgba(59, 130, 246, 0.35) 100%);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.35);
}

.supplier-rank-badge.rank-bronze {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.35) 100%);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.supplier-rank-badge.rank-regular {
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper-soft);
  border: 1px solid var(--line);
}

.supplier-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.supplier-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.supplier-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.supplier-nif {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.supplier-type-pill {
  font-size: 9px;
  font-weight: 750;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.supplier-type-pill.type-servicios {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.supplier-type-pill.type-suministros {
  background: rgba(36, 229, 163, 0.12);
  color: #52f3bb;
  border: 1px solid rgba(36, 229, 163, 0.3);
}

.supplier-type-pill.type-obras {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Columna Central de Barra Visual con Líneas Guía */
.supplier-row-bar-zone {
  flex-grow: 1;
  min-width: 0;
  position: relative;
}

.supplier-bar-track {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.supplier-bar-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 1;
}
.supplier-bar-gridline.gl-25 { left: 25%; }
.supplier-bar-gridline.gl-50 { left: 50%; }
.supplier-bar-gridline.gl-75 { left: 75%; }

.supplier-bar-fill {
  height: 100%;
  border-radius: 4px;
  position: relative;
  z-index: 2;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  box-sizing: border-box;
}

.supplier-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px #ffffff;
  border-radius: 1px;
}

.bar-inner-label {
  font-size: 10px;
  font-weight: 850;
  color: #040807;
  letter-spacing: -0.01em;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

.supplier-bar-fill.rank-gold-fill {
  background: linear-gradient(90deg, #24e5a3 0%, #10b981 100%);
  box-shadow: 0 0 12px rgba(36, 229, 163, 0.45);
}

.supplier-bar-fill.rank-silver-fill {
  background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.45);
}

.supplier-bar-fill.rank-bronze-fill {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.supplier-bar-fill.rank-regular-fill {
  background: linear-gradient(90deg, #34d399 0%, #059669 100%);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

/* Columna Derecha de Valores y Porcentajes */
.supplier-row-value-zone {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
  white-space: nowrap;
}

.supplier-metric-val {
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

.supplier-bar-row.rank-gold .supplier-metric-val { color: #52f3bb; }
.supplier-bar-row.rank-silver .supplier-metric-val { color: #93c5fd; }
.supplier-bar-row.rank-bronze .supplier-metric-val { color: #fde68a; }

.supplier-metric-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

/* 3. Pie de Gráfico: Resumen de Concentración */
.supplier-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--paper-soft);
  margin-top: 6px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.chart-summary-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-stat-icon {
  font-size: 15px;
  line-height: 1;
}

.chart-summary-hint {
  font-size: 11px;
  color: var(--mint);
  font-weight: 650;
}

/* Compatibilidad con clases antiguas */
.supplier-item,
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  cursor: pointer;
}
.supplier-item:hover,
.leaderboard-item:hover {
  background: rgba(36, 229, 163, 0.06);
  border-color: rgba(36, 229, 163, 0.3);
  transform: translateY(-2px);
}
.supplier-rank,
.leaderboard-rank {
  font-size: 13px;
  font-weight: 900;
  color: var(--mint);
  width: 26px;
  flex-shrink: 0;
}
.supplier-meta,
.leaderboard-info {
  flex-grow: 1;
  min-width: 0;
}
.supplier-sub,
.leaderboard-cif {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.supplier-amount,
.leaderboard-amount {
  font-size: 13px;
  font-weight: 850;
  color: var(--mint);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----------------------------------------------------
   10. CONSOLA SPOTLIGHT DE BÚSQUEDA Y AUDITORÍA
---------------------------------------------------- */
.explorer-section {
  margin-bottom: 40px;
}

.search-console {
  background: var(--ink-card-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 24px;
}

.search-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}

.console-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: beaconPulse 2s infinite ease-in-out;
}

@keyframes beaconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

.console-title-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.console-title-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--mint);
  background: var(--mint-soft);
  border: 1px solid rgba(36, 229, 163, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
}

.console-status-area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mint);
  font-weight: 600;
}

.console-status-indicator {
  color: var(--mint);
  font-size: 10px;
}

/* Spotlight Wrap */
.spotlight-search-row {
  margin-bottom: 18px;
}

.spotlight-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(4, 8, 7, 0.85);
  border: 1px solid rgba(36, 229, 163, 0.3);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.spotlight-wrap:focus-within {
  border-color: var(--mint);
  box-shadow: 0 0 24px rgba(36, 229, 163, 0.25);
}

.spotlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  color: var(--mint);
  flex-shrink: 0;
}

.spotlight-input {
  flex-grow: 1;
  height: 50px;
  background: transparent;
  border: 0;
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  padding: 0 8px;
  outline: none;
}

.spotlight-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
}

.spotlight-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
}

.spotlight-counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--mint);
  background: var(--mint-soft);
  border: 1px solid rgba(36, 229, 163, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.kbd-shortcut {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  white-space: nowrap;
}

.spotlight-clear {
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.spotlight-clear.is-visible {
  display: flex;
}

.spotlight-clear:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Sugerencias Rápidas */
.search-quick-queries {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.search-quick-queries::-webkit-scrollbar {
  display: none;
}

.quick-queries-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.quick-queries-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.quick-query-btn {
  padding: 5px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.quick-query-btn:hover {
  background: rgba(36, 229, 163, 0.1);
  border-color: rgba(36, 229, 163, 0.4);
  color: #ffffff;
}

/* Smart Presets Bar */
.smart-presets-bar {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}

.smart-presets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.smart-presets-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.smart-presets-help {
  font-size: 11px;
  color: var(--muted);
}

.preset-pills-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.preset-pill:hover {
  background: rgba(36, 229, 163, 0.1);
  border-color: rgba(36, 229, 163, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.preset-pill.is-active {
  background: var(--mint-soft);
  border-color: var(--mint);
  color: var(--mint);
  font-weight: 750;
  box-shadow: 0 0 12px rgba(36, 229, 163, 0.25);
}

.preset-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 750;
}

.preset-tag-alert {
  background: var(--signal-soft);
  color: var(--signal);
}

.preset-tag-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.preset-tag-warn {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.preset-tag-major {
  background: var(--blue-soft);
  color: var(--blue);
}

/* Toolbar de Filtros */
.filter-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.filter-segments-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-grow: 1;
}

.segmented-tipo {
  display: inline-flex;
  background: rgba(4, 8, 7, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.seg-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.seg-btn.is-active {
  background: var(--mint);
  color: var(--ink);
  font-weight: 800;
}

/* Botón Móvil para Colapsar Filtros */
.btn-toggle-filters-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: rgba(36, 229, 163, 0.08);
  border: 1px solid rgba(36, 229, 163, 0.25);
  border-radius: var(--radius-sm);
  color: var(--mint);
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
}

.btn-toggle-filters-mobile .filter-active-count {
  background: var(--mint);
  color: var(--ink);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
}

.filter-dropdowns-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.filter-select {
  height: 38px;
  background: rgba(4, 8, 7, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper-soft);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s;
  cursor: pointer;
}

.filter-select:hover,
.filter-select:focus {
  border-color: rgba(36, 229, 163, 0.4);
  color: #ffffff;
}

.select-splitting {
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--signal);
}

.view-switch-group {
  display: flex;
  background: rgba(4, 8, 7, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
}

.view-btn:hover {
  color: #ffffff;
}

.view-btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 750;
}

/* Telemetría */
.telemetry-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.telemetry-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.telemetry-stat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.telemetry-stat-card.is-highlight {
  background: rgba(36, 229, 163, 0.07);
  border-color: rgba(36, 229, 163, 0.3);
}

.telemetry-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.telemetry-stat-val {
  font-size: 14px;
  font-weight: 850;
  color: #ffffff;
}

.stat-badge {
  color: var(--mint);
}

.active-filter-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(36, 229, 163, 0.1);
  border: 1px solid rgba(36, 229, 163, 0.35);
  color: var(--mint);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--signal-border);
  color: var(--signal);
}

.btn-reset-filters {
  font-size: 11px;
  font-weight: 700;
  color: var(--signal);
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--signal-border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-filters:hover {
  background: var(--signal);
  color: var(--ink);
}

/* ----------------------------------------------------
   11. TABLA DE CONTRATOS (VISTA PRO)
---------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--ink-card-solid);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
  table-layout: auto;
}

.contracts-table thead {
  background: rgba(6, 15, 12, 0.95);
  border-bottom: 1px solid var(--line-strong);
}

.contracts-table th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mint);
  white-space: nowrap;
  vertical-align: middle;
}

.th-exp { width: 14%; min-width: 140px; }
.th-tit { width: 32%; min-width: 280px; }
.th-tipo { width: 10%; min-width: 110px; }
.th-proc { width: 12%; min-width: 130px; }
.th-supplier { width: 16%; min-width: 175px; }
.th-date { width: 8%; min-width: 95px; }
.th-amount { width: 12%; min-width: 135px; text-align: right; }
.th-action { width: 6%; min-width: 90px; text-align: center; }

.contracts-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
  cursor: pointer;
}

.contracts-table tbody tr:hover {
  background: rgba(36, 229, 163, 0.05);
}

.contracts-table td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--paper-soft);
}

.td-exp {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--mint);
  white-space: nowrap;
}

.exp-code {
  display: inline-block;
  background: rgba(36, 229, 163, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
}

.td-tit {
  line-height: 1.4;
}

.table-title-wrap {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 480px;
}

.table-contract-title,
.td-tit-text {
  font-weight: 600;
  color: #ffffff;
}

.td-tit small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-family: var(--mono);
}

.badge-split-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: var(--signal);
  background: var(--signal-soft);
  border: 1px solid var(--signal-border);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Badges de Tipo y Procedimiento */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-tipo {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.badge-suministros {
  background: var(--mint-soft);
  color: var(--mint);
  border: 1px solid rgba(36, 229, 163, 0.3);
}

.badge-servicios {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.badge-obras {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-proc {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.badge-menor {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.badge-abierto {
  background: rgba(36, 229, 163, 0.08);
  border-color: rgba(36, 229, 163, 0.3);
  color: var(--mint);
  font-weight: 700;
}

/* Proveedor */
.td-supplier-wrap,
.supplier-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.supplier-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(36, 229, 163, 0.12);
  border: 1px solid rgba(36, 229, 163, 0.3);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 850;
  flex-shrink: 0;
}

.td-supplier-name,
.supplier-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.td-supplier-cif,
.supplier-cif {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  display: block;
}

/* Importe */
.td-amount {
  text-align: right;
}

.td-amount-wrap,
.amount-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.amount-main,
.amount-net {
  font-size: 13px;
  font-weight: 850;
  color: #ffffff;
}

.amount-sub,
.amount-iva-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.badge-near-limit {
  font-size: 9px;
  font-weight: 800;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
}

.td-split-hint {
  font-size: 10px;
  font-weight: 750;
  color: var(--signal);
  margin-top: 2px;
}

/* Acciones en Tabla */
.td-action {
  text-align: center;
}

.td-actions-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-inspect-row {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: rgba(36, 229, 163, 0.1);
  border: 1px solid rgba(36, 229, 163, 0.3);
  color: var(--mint);
  font-size: 11px;
  font-weight: 750;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-inspect-row:hover {
  background: var(--mint);
  color: var(--ink);
  box-shadow: 0 0 10px var(--mint-glow);
}

.btn-cam-link {
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-cam-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ----------------------------------------------------
   12. VISTA EN FICHAS / TARJETAS
---------------------------------------------------- */
.contracts-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.contract-card-item {
  background: var(--ink-card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.contract-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-exp {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 750;
  color: var(--mint);
  background: var(--mint-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-date {
  font-size: 11px;
  color: var(--muted);
}

.card-title {
  font-size: 14px;
  font-weight: 750;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-split-badge {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: var(--signal-soft);
  border: 1px solid var(--signal-border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--signal);
  margin-bottom: 10px;
}

.card-supplier-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.card-supplier-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.card-supplier-cif {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

.card-financials {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.card-fin-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-fin-val {
  font-size: 16px;
  font-weight: 850;
  color: var(--mint);
}

.card-bottom-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* ----------------------------------------------------
   13. BARRA DE PAGINACIÓN
---------------------------------------------------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--ink-card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.page-size-selector,
.page-jumper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: rgba(36, 229, 163, 0.1);
  border-color: rgba(36, 229, 163, 0.4);
  color: #ffffff;
}

.page-btn.is-active {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--mint);
  font-weight: 850;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-mobile-info {
  font-size: 12px;
  font-weight: 750;
  color: var(--paper-soft);
  padding: 0 8px;
}

.page-dots {
  color: var(--muted);
  padding: 0 4px;
  font-family: var(--sans);
}

.page-jumper input {
  width: 50px;
  height: 32px;
  background: rgba(4, 8, 7, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ----------------------------------------------------
   14. SECCIÓN FAQ (PREGUNTAS FRECUENTES)
---------------------------------------------------- */
.faq-section {
  margin-bottom: 40px;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.faq-card {
  background: var(--ink-card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-card[open] {
  border-color: rgba(36, 229, 163, 0.3);
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 750;
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  gap: 12px;
  transition: background 0.2s;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary:hover {
  background: rgba(36, 229, 163, 0.04);
}

.faq-chevron {
  font-size: 14px;
  color: var(--mint);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-card[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 13px;
  color: var(--paper-soft);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 14px;
}

.faq-answer strong {
  color: #ffffff;
}

.faq-answer em {
  color: var(--mint);
  font-style: normal;
  font-weight: 600;
}

/* ----------------------------------------------------
   15. HERRAMIENTAS DE EXPORTACIÓN (OPEN DATA)
---------------------------------------------------- */
.footer-tools {
  background: var(--ink-card-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-tools-desc h4 {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer-tools-desc p {
  font-size: 12px;
  color: var(--muted);
  max-width: 600px;
}

.export-btns {
  display: flex;
  gap: 12px;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s;
}

.export-btn:hover {
  background: rgba(36, 229, 163, 0.12);
  border-color: var(--mint);
  transform: translateY(-2px);
}

/* ----------------------------------------------------
   16. SITE FOOTER INSTITUCIONAL
---------------------------------------------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 0 60px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.footer-brand strong {
  color: #ffffff;
  font-size: 13px;
}

.footer-copy {
  margin-top: 6px;
  max-width: 500px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--mint);
}

/* ----------------------------------------------------
   17. BOTÓN VOLVER ARRIBA & BARRA MÓVIL INFERIOR
---------------------------------------------------- */
.btn-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-card-solid);
  border: 1px solid rgba(36, 229, 163, 0.4);
  color: var(--mint);
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s ease;
}

.btn-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-back-to-top:hover {
  background: var(--mint);
  color: var(--ink);
  box-shadow: 0 0 16px var(--mint-glow);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(4, 8, 7, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-strong);
  z-index: 90;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--paper-soft);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  min-width: 54px;
  min-height: 44px;
}

.mobile-nav-icon {
  font-size: 16px;
}

.mobile-nav-btn:hover,
.mobile-nav-btn:active {
  color: var(--mint);
}

/* ----------------------------------------------------
   18. MODAL / DOSSIER DE INSPECCIÓN PERICIAL
---------------------------------------------------- */
.dossier-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.dossier-modal.is-active,
.dossier-modal.is-open {
  display: flex;
}

.dossier-card {
  width: 100%;
  max-width: 820px;
  background: #091714;
  border: 1px solid rgba(36, 229, 163, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(36, 229, 163, 0.15);
  overflow: hidden;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  margin: auto;
  box-sizing: border-box;
}

.dossier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 8, 7, 0.8);
  flex-shrink: 0;
}

.dossier-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--mint);
  letter-spacing: 0.06em;
}

.dossier-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--muted);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.dossier-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.dossier-body {
  padding: 22px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.dossier-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}

.dossier-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.dossier-meta-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.dossier-meta-item strong {
  font-size: 13px;
  color: #ffffff;
}

.dossier-financials {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.dossier-fin-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mint);
  margin-bottom: 12px;
}

.dossier-fin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dossier-fin-item span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}

.dossier-fin-item strong {
  font-size: 14px;
  color: #ffffff;
}

/* Alerta Forense de Fraccionamiento en el Dossier */
.dossier-split-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16) 0%, rgba(239, 68, 68, 0.06) 100%);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.16);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.dossier-split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-split-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #ff8585;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-split-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.dossier-split-summary-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #fecaca;
  margin: 0;
}

.dossier-split-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.split-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.split-kpi-item span {
  display: block;
  font-size: 10px;
  color: #fca5a5;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.split-kpi-item strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.split-kpi-item.is-excess strong {
  color: #ff6b6b;
}

.dossier-split-companions {
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  padding-top: 12px;
}

.split-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.split-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 160ms ease;
  cursor: pointer;
}

.split-companion-item:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateX(3px);
}

.split-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.split-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--mint);
  font-weight: 700;
}

.split-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.split-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

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

.split-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #fca5a5;
}

.split-companion-btn {
  font-size: 11px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fff;
  white-space: nowrap;
}

.dossier-card .minor-warning-box {
  background: rgba(36, 229, 163, 0.05);
  border-left: 3px solid var(--mint);
  padding: 12px 14px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 12px;
  color: var(--paper-soft);
  line-height: 1.5;
}

.dossier-card .minor-warning-box strong {
  color: #ffffff;
}

.dossier-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.dossier-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 750;
  transition: all 0.2s;
  flex: 1;
}

.dossier-btn-primary {
  background: var(--mint);
  color: var(--ink);
  box-shadow: 0 0 16px rgba(36, 229, 163, 0.3);
}

.dossier-btn-primary:hover {
  background: #52f3bb;
  transform: translateY(-1px);
}

.dossier-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  color: #ffffff;
}

.dossier-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ----------------------------------------------------
   18b. EXPORTACIÓN UNITARIA (TARJETAS Y MODAL)
---------------------------------------------------- */
.card-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.card-footer-actions .card-open {
  margin-top: 0;
  width: 100%;
}

.card-export-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.card-export-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-right: 2px;
}

.btn-card-export {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-card-export:hover {
  background: rgba(36, 229, 163, 0.15);
  border-color: rgba(36, 229, 163, 0.45);
  color: var(--mint);
  transform: translateY(-1px);
}

.btn-card-export.btn-export-pdf:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-card-export.btn-export-csv:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.btn-card-export.btn-export-json:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.dossier-export-section {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.dossier-export-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.dossier-export-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dossier-btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1 1 110px;
  min-height: 40px;
}

.dossier-btn-export:hover {
  background: rgba(36, 229, 163, 0.15);
  border-color: var(--mint);
  color: var(--mint);
  transform: translateY(-1px);
}

.dossier-btn-pdf:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.dossier-btn-csv:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.dossier-btn-json:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.dossier-btn-print:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

/* ----------------------------------------------------
   19. RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
---------------------------------------------------- */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .leaderboard-chart-container,
  .leaderboard-list {
    display: block;
    width: 100%;
  }

  .year-end-hud {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --topbar: auto;
  }

  body {
    padding-bottom: 64px; /* Espacio para barra móvil inferior */
  }

  .topbar {
    position: relative;
    top: auto;
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .brand {
    justify-content: flex-start;
  }

  .hud-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    justify-content: flex-start;
    box-sizing: border-box;
  }

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

  .hud-btn {
    height: 36px;
    padding: 0 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .subnav-strip {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 6px 14px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .subnav-inner {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .main-content {
    padding: 16px 14px 80px;
  }

  .hero-header {
    margin-bottom: 24px;
  }

  .hero-title {
    font-size: clamp(22px, 5.5vw, 28px);
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .hero-desc {
    font-size: 14px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-btn {
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-card {
    padding: 14px 16px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .recent-grid {
    grid-template-columns: 1fr;
  }

  .hubs-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-chart-container,
  .leaderboard-list {
    display: block;
    width: 100%;
  }

  .supplier-chart-axis {
    display: none;
  }

  .supplier-bar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .supplier-row-identity {
    width: 100%;
    justify-content: space-between;
  }

  .supplier-row-value-zone {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.07);
    padding-top: 6px;
  }

  .supplier-bar-track {
    height: 16px;
  }

  .types-chart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }

  .types-donut-wrapper {
    margin: 0 auto;
  }

  .supplier-chart-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  .chart-card {
    padding: 16px 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .type-card-row {
    padding: 9px 10px;
    min-width: 0;
  }

  .type-row-header {
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .type-amount-wrap {
    gap: 6px;
  }

  .year-chart-container {
    padding: 10px 0 24px;
    overflow-x: hidden;
  }

  .leaderboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .leaderboard-controls {
    width: 100%;
    justify-content: space-between;
  }

  .year-end-hud {
    grid-template-columns: 1fr;
  }

  .monthly-controls {
    flex-direction: column;
    width: 100%;
  }

  .monthly-select {
    width: 100%;
  }

  .monthly-pattern-card {
    padding: 16px 12px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .monthly-chart-wrapper {
    height: 190px;
    padding: 24px 0 22px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .monthly-chart-canvas-area {
    gap: 3px;
    min-width: 280px;
  }

  .month-val-top {
    display: none;
  }

  .month-yearend-tag {
    display: none;
  }

  .month-label-bottom {
    font-size: 9px;
    margin-top: 4px;
  }

  .year-chart-container {
    gap: 3px;
    padding-bottom: 22px;
  }

  .year-label {
    font-size: 9px;
    bottom: -18px;
  }

  /* Consola de Búsqueda Móvil */
  .search-console {
    padding: 16px 12px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .spotlight-wrap {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .spotlight-icon {
    width: 36px;
    flex-shrink: 0;
  }

  .spotlight-input {
    min-width: 0;
    width: 100%;
    font-size: 13px;
    padding: 0 4px;
  }

  .spotlight-actions {
    padding-right: 8px;
    gap: 4px;
    flex-shrink: 0;
  }

  .spotlight-actions .kbd-shortcut {
    display: none;
  }

  .spotlight-counter {
    display: none;
  }

  .search-quick-queries {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .quick-queries-list {
    flex-shrink: 0;
  }

  .smart-presets-bar {
    padding: 12px 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .preset-pills-list {
    gap: 6px;
  }

  .preset-pill {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Filtros colapsables en móvil */
  .btn-toggle-filters-mobile {
    display: flex;
  }

  .filter-dropdowns-strip {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .filter-dropdowns-strip.is-open {
    display: flex;
  }

  .select-wrapper {
    width: 100%;
  }

  .filter-select {
    width: 100%;
    height: 44px; /* Touch target */
    font-size: 13px;
  }

  .segmented-tipo {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .seg-btn {
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
  }

  .telemetry-status-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .telemetry-info {
    justify-content: space-between;
  }

  .telemetry-stat-card {
    flex: 1;
    padding: 8px 10px;
  }

  .telemetry-stat-val {
    font-size: 12px;
  }

  /* Ocultar columnas secundarias en tabla móvil */
  .contracts-table th.th-exp,
  .contracts-table td.td-exp,
  .contracts-table th.th-proc,
  .contracts-table td.td-proc,
  .contracts-table th.th-date,
  .contracts-table td.td-date {
    display: none;
  }

  .contracts-table th,
  .contracts-table td {
    padding: 10px 12px;
  }

  .td-tit-text,
  .table-contract-title {
    font-size: 12px;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .btn-back-to-top {
    bottom: 68px; /* Por encima de la barra móvil */
    right: 16px;
  }

  .dossier-meta-grid,
  .dossier-fin-grid {
    grid-template-columns: 1fr;
  }

  .dossier-actions {
    flex-direction: column;
  }
}

/* Mobile Compact (max-width: 580px) */
@media (max-width: 580px) {
  .month-val-top {
    display: none;
  }

  .month-yearend-tag {
    display: none;
  }
}

/* Small Mobile (max-width: 420px) */
@media (max-width: 420px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .brand-title h1 {
    font-size: 13px;
  }

  .hero-title {
    font-size: clamp(20px, 5.2vw, 24px);
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .hero-kicker {
    font-size: 10px;
    padding: 4px 10px;
  }
}

/* Impresión */
@media print {
  .canvas-wrap,
  .ambient-glow-top,
  .ambient-glow-bottom,
  .topbar,
  .subnav-strip,
  .btn-back-to-top,
  .mobile-bottom-nav,
  .search-console,
  .pagination-bar,
  .footer-tools {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .kpi-card,
  .chart-card,
  .table-container {
    border: 1px solid #cccccc;
    box-shadow: none;
    background: #ffffff;
    color: #000000;
  }
}
/* Directory reading layout: keep full text in the accessible detail sheet. */
.contracts-table { table-layout: fixed; width: 100%; min-width: 0; }
.contracts-table th, .contracts-table td { padding: 18px 14px; vertical-align: top; overflow-wrap: anywhere; }
.contracts-table .th-exp { width: 13%; }
.contracts-table .th-tit { width: 28%; }
.contracts-table .th-tipo { width: 9%; }
.contracts-table .th-proc { width: 10%; }
.contracts-table .th-supplier { width: 17%; }
.contracts-table .th-date { width: 9%; }
.contracts-table .th-amount { width: 14%; }
.contracts-table .th-action { width: 9%; }
.td-tit-text, .td-supplier-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: normal; line-height: 1.5; }
.td-exp { font-size: 11px; white-space: normal !important; }
.td-tit small, .td-supplier-cif, .btn-cam-link, .td-split-hint { display: none; }
.td-supplier-wrap .supplier-avatar { display: none; }
.contracts-table .badge { white-space: normal; font-size: 11px; }
.td-amount strong { font-size: 14px; white-space: normal; }
.td-amount-wrap { align-items: flex-start; }
.contracts-cards-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 20px; }
.contract-card-item { padding: 24px; min-width: 0; border-radius: 18px; background: linear-gradient(145deg,#10221d,#091611); box-shadow: 0 8px 28px #0002; }
.card-title { font-size: 18px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 4.5em; }
.card-top { align-items: flex-start; gap: 12px; }
.card-exp { overflow-wrap: anywhere; white-space: normal; }
.card-bottom { flex-wrap: wrap; gap: 16px; }
.card-badges { flex-wrap: wrap; }
.card-open { margin-top: 18px; width: 100%; min-height: 44px; }
.review-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(232, 199, 140, 0.12); color: #e8c78c; border: 1px solid rgba(232, 199, 140, 0.3); padding: 2px 7px; border-radius: 6px; font-size: 10.5px; line-height: 1.4; margin: 4px 0; }
.methodology-note { max-width: 1400px; margin: 24px auto; padding: 22px; border: 1px solid #28483c; border-radius: 14px; background: #0d1b16; color: #b9cec4; line-height: 1.7; font-size: 14px; overflow-wrap: anywhere; }
.methodology-note summary { cursor: pointer; color: #e1eee7; font-weight: 600; min-height: 32px; }
.methodology-note a { color: #48e6b5; }
.dossier-card { width: min(920px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); }
.dossier-header { gap: 18px; }
.dossier-badge { overflow-wrap: anywhere; min-width: 0; }
.dossier-close { flex-shrink: 0; width: 44px; height: 44px; }
.dossier-body { padding: clamp(18px,3vw,32px); overflow-x: hidden; }
.dossier-title { font-size: clamp(20px,2.4vw,28px); line-height: 1.4; overflow-wrap: anywhere; }
.dossier-meta-grid, .dossier-fin-grid { gap: 22px; }
.dossier-meta-item, .dossier-fin-item { min-width: 0; overflow-wrap: anywhere; }
.dossier-fin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.dossier-card .minor-warning-box { display: block; }
.dossier-actions { flex-wrap: wrap; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #50efbc; outline-offset: 4px; }
@media (max-width: 1100px) {
 .contracts-table .th-proc, .contracts-table .td-proc { display: none; }
}
@media (max-width: 700px) {
 .contracts-table thead { display: none; }
 .contracts-table, .contracts-table tbody { display: block; width: 100%; }
 .contracts-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 18px; gap: 12px; }
 .contracts-table td { display: block; padding: 0; border: 0; min-width: 0; }
 .contracts-table .td-exp, .contracts-table .td-proc, .contracts-table .td-date, .contracts-table .td-tipo { display: none; }
 .contracts-table .td-tit { grid-column: 1 / -1; }
 .contracts-table .td-supplier { grid-column: 1 / -1; font-size: 12px; }
 .contracts-table .td-action { align-self: center; }
 .btn-inspect-row { min-height: 44px; }
 .contract-card-item { padding: 20px; }
 .dossier-modal { padding: 8px; }
 .dossier-card { width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px; }
 .dossier-header { padding: 14px 18px; }
 .dossier-meta-grid, .dossier-fin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 14px; }
 .dossier-financials { padding: 18px; }
 .dossier-fin-item strong { font-size: 17px; }
 .dossier-actions .dossier-btn { width: 100%; white-space: normal; }
 .dossier-export-buttons { flex-direction: column; }
 .dossier-btn-export { width: 100%; }
 .card-export-bar { flex-wrap: wrap; gap: 6px; }
 .split-companion-item { flex-wrap: wrap; }
 .methodology-note { margin: 18px 12px; padding: 18px; }
 .dossier-body .methodology-note { margin-inline: 0; }
}
@media (max-width: 380px) {
 .dossier-meta-grid, .dossier-fin-grid { grid-template-columns: minmax(0,1fr); }
}
/* Seven columns on desktop; procedure remains available in the full sheet. */
.contracts-table .th-proc, .contracts-table .td-proc { display: none; }
.contracts-table .th-exp { width: 12%; }
.contracts-table .th-tit { width: 27%; }
.contracts-table .th-tipo { width: 10%; }
.contracts-table .th-supplier { width: 18%; }
.contracts-table .th-date { width: 10%; }
.contracts-table .th-amount { width: 15%; }
.contracts-table .th-action { width: 8%; }
.contracts-table th { white-space: normal; font-size: 11px; line-height: 1.5; }
.contracts-table .td-date { white-space: nowrap; font-size: 12px; }
.contracts-table .badge { overflow-wrap: normal; word-break: normal; padding: 5px; }
#filter-review { max-width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid #355446; color: #dcebe3; background: #10221a; }
.amount-source { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.modal-signals-box {
  margin: 18px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(232, 199, 140, 0.08), rgba(20, 32, 27, 0.8));
  border: 1px solid rgba(232, 199, 140, 0.32);
  border-radius: 12px;
  color: #e1eee7;
}
.modal-signals-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #f3d49f;
}
.modal-signals-icon { font-size: 14px; }
.modal-signals-count {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(232, 199, 140, 0.15);
  color: #e8c78c;
  font-weight: 600;
}
.modal-signals-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-signals-list li {
  font-size: 12px;
  line-height: 1.55;
  color: #d1dfd8;
}
.modal-amount-source {
  margin: 10px 0;
  font-size: 11.5px;
  color: #48e6b5;
}

/* Alerta de Recurrencia Periódica / Serie Plurianual en el Dossier */
.dossier-plurianual-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(232, 199, 140, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(232, 199, 140, 0.45);
  box-shadow: 0 6px 24px rgba(232, 199, 140, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-plurianual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-plurianual-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #f3d49f;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-plurianual-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(232, 199, 140, 0.2);
  color: #fde6b3;
  border: 1px solid rgba(232, 199, 140, 0.45);
}

.dossier-plurianual-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #e6dfcf;
  margin: 0;
}

.dossier-plurianual-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.plurianual-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(232, 199, 140, 0.25);
}

.plurianual-kpi-item span {
  display: block;
  font-size: 10px;
  color: #d1c5a5;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.plurianual-kpi-item strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.dossier-plurianual-companions {
  border-top: 1px solid rgba(232, 199, 140, 0.2);
  padding-top: 12px;
}

.plurianual-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #f3d49f;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.plurianual-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plurianual-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(232, 199, 140, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.plurianual-companion-item:hover {
  background: rgba(232, 199, 140, 0.16);
  border-color: rgba(232, 199, 140, 0.6);
  transform: translateX(3px);
}

.plurianual-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.plurianual-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #48e6b5;
  font-weight: 700;
}

.plurianual-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.plurianual-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.plurianual-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #f3d49f;
}

.plurianual-companion-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(232, 199, 140, 0.2);
  border: 1px solid rgba(232, 199, 140, 0.45);
  color: #fff;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.plurianual-companion-item:hover .plurianual-companion-btn {
  background: #e8c78c;
  color: #0b1511;
  font-weight: 800;
}

.badge-plurianual-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #e8c78c;
  background: rgba(232, 199, 140, 0.15);
  border: 1px solid rgba(232, 199, 140, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-plurianual-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(232, 199, 140, 0.12);
  border: 1px solid rgba(232, 199, 140, 0.35);
  color: #e8c78c;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.td-plurianual-hint {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #e8c78c;
  font-weight: 600;
}

@media (max-width: 700px) {
  .dossier-plurianual-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .plurianual-companion-item {
    flex-wrap: wrap;
  }
  .plurianual-companion-tit {
    max-width: 100%;
    white-space: normal;
  }
}

/* Card Badges para patrones de observación */
.card-split-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--signal-soft);
  border: 1px solid var(--signal-border);
  color: #ff8585;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-duplicate-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-repeat-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: #fdba74;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-limit-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #d8b4fe;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-yearend-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fda4af;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* Badges e indicadores para tabla */
.badge-duplicate-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-repeat-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
  border: 1px solid rgba(251, 146, 60, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-near-limit {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #d8b4fe;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.td-duplicate-hint {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #38bdf8;
  font-weight: 600;
}

.td-repeat-hint {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #fb923c;
  font-weight: 600;
}

/* 1. Alerta de Parámetros Idénticos / Coincidencia Registral en Dossier */
.dossier-duplicate-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-duplicate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-duplicate-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #7dd3fc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-duplicate-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.dossier-duplicate-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #e0f2fe;
  margin: 0;
}

.dossier-duplicate-companions {
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  padding-top: 12px;
}

.duplicate-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.duplicate-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duplicate-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.duplicate-companion-item:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateX(3px);
}

.duplicate-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.duplicate-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #38bdf8;
  font-weight: 700;
}

.duplicate-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.duplicate-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.duplicate-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #7dd3fc;
}

.duplicate-companion-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #fff;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.duplicate-companion-item:hover .duplicate-companion-btn {
  background: #38bdf8;
  color: #082f49;
  font-weight: 800;
}

/* 2. Alerta de Reiteración de Objeto en Ejercicio en Dossier */
.dossier-repeat-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 6px 24px rgba(251, 146, 60, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-repeat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-repeat-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #fdba74;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-repeat-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(251, 146, 60, 0.2);
  color: #ffedd5;
  border: 1px solid rgba(251, 146, 60, 0.45);
}

.dossier-repeat-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #fed7aa;
  margin: 0;
}

.dossier-repeat-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.repeat-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.repeat-kpi-item span {
  display: block;
  font-size: 10px;
  color: #fdba74;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.repeat-kpi-item strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.dossier-repeat-companions {
  border-top: 1px solid rgba(251, 146, 60, 0.2);
  padding-top: 12px;
}

.repeat-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #fdba74;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.repeat-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.repeat-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(251, 146, 60, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.repeat-companion-item:hover {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.6);
  transform: translateX(3px);
}

.repeat-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.repeat-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #fb923c;
  font-weight: 700;
}

.repeat-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.repeat-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.repeat-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #fdba74;
}

.repeat-companion-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(251, 146, 60, 0.45);
  color: #fff;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.repeat-companion-item:hover .repeat-companion-btn {
  background: #fb923c;
  color: #431407;
  font-weight: 800;
}

/* 3. Alerta de Proximidad al Umbral Normativo en Dossier */
.dossier-limit-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow: 0 6px 24px rgba(192, 132, 252, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-limit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-limit-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #d8b4fe;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-limit-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(192, 132, 252, 0.2);
  color: #f3e8ff;
  border: 1px solid rgba(192, 132, 252, 0.45);
}

.dossier-limit-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #ede9fe;
  margin: 0;
}

.dossier-limit-companions {
  border-top: 1px solid rgba(192, 132, 252, 0.2);
  padding-top: 12px;
}

.limit-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #d8b4fe;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.limit-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.limit-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(192, 132, 252, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.limit-companion-item:hover {
  background: rgba(192, 132, 252, 0.16);
  border-color: rgba(192, 132, 252, 0.6);
  transform: translateX(3px);
}

.limit-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.limit-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #c084fc;
  font-weight: 700;
}

.limit-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.limit-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.limit-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #d8b4fe;
}

.limit-companion-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(192, 132, 252, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #fff;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.limit-companion-item:hover .limit-companion-btn {
  background: #c084fc;
  color: #2e1065;
  font-weight: 800;
}

/* Responsividad en pantallas pequeñas */
@media (max-width: 700px) {
  .dossier-repeat-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .duplicate-companion-item,
  .repeat-companion-item,
  .limit-companion-item {
    flex-wrap: wrap;
  }
  .duplicate-companion-tit,
  .repeat-companion-tit,
  .limit-companion-tit {
    max-width: 100%;
    white-space: normal;
  }
}

/* 4. Vínculo Licitación Mayor / Menores en Dossier */
.dossier-mayor-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 6px 24px rgba(45, 212, 191, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-mayor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-mayor-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #5eead4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-mayor-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(45, 212, 191, 0.2);
  color: #ccfbf1;
  border: 1px solid rgba(45, 212, 191, 0.45);
}

.dossier-mayor-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #ccfbf1;
  margin: 0;
}

.dossier-mayor-companions {
  border-top: 1px solid rgba(45, 212, 191, 0.2);
  padding-top: 12px;
}

.mayor-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #5eead4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.mayor-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mayor-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(45, 212, 191, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.mayor-companion-item:hover {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.6);
  transform: translateX(3px);
}

.mayor-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mayor-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #2dd4bf;
  font-weight: 700;
}

.mayor-companion-proc {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(45, 212, 191, 0.2);
  color: #a7f3d0;
  font-family: var(--sans);
  font-weight: 700;
}

.mayor-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.mayor-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.mayor-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #5eead4;
}

.mayor-companion-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(45, 212, 191, 0.2);
  border: 1px solid rgba(45, 212, 191, 0.45);
  color: #fff;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.mayor-companion-item:hover .mayor-companion-btn {
  background: #2dd4bf;
  color: #042f2e;
  font-weight: 800;
}

@media (max-width: 700px) {
  .mayor-companion-item {
    flex-wrap: wrap;
  }
  .mayor-companion-tit {
    max-width: 100%;
    white-space: normal;
  }
}

/* ====================================================
   19. SUCESIÓN HISTÓRICA DE LICITACIONES DEL SERVICIO
   ==================================================== */
.dossier-chain-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0.04) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.dossier-chain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-chain-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #7dd3fc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-chain-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.dossier-chain-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #bae6fd;
  margin: 0;
}

.dossier-chain-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.chain-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.chain-kpi-item span {
  display: block;
  font-size: 10px;
  color: #7dd3fc;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.chain-kpi-item strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.chain-kpi-item.is-jump strong {
  color: #38bdf8;
}

.dossier-chain-companions {
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  padding-top: 12px;
}

.chain-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.chain-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chain-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all 160ms ease;
  cursor: pointer;
}

.chain-companion-item:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateX(3px);
}

.chain-companion-item.is-current {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.8);
  cursor: default;
  transform: none;
}

.chain-companion-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.chain-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: #38bdf8;
  font-weight: 700;
}

.chain-companion-seq {
  font-size: 10px;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
}

.chain-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: normal;
}

.chain-companion-tit {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

.chain-companion-imp {
  font-size: 13.5px;
  font-weight: 800;
  color: #bae6fd;
}

.chain-companion-btn {
  font-size: 11px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #fff;
  white-space: nowrap;
}

.chain-companion-item:hover .chain-companion-btn {
  background: #38bdf8;
  color: #0c4a6e;
  font-weight: 800;
}

/* Badges de cadena y puente en tabla y tarjetas */
.badge-chain-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 750;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
  margin-top: 4px;
  max-width: 100%;
}

.badge-bridge-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 750;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-top: 4px;
  max-width: 100%;
}

.badge-captive-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 750;
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.45);
  margin-top: 4px;
  max-width: 100%;
}

@media (max-width: 700px) {
  .chain-companion-item {
    flex-wrap: wrap;
  }
  .chain-companion-tit {
    max-width: 100%;
    white-space: normal;
  }
}

/* Sector Tag Chip */
.sector-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 9999px;
  margin-top: 3px;
  margin-right: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.sector-chip:hover, .sector-chip:focus {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Badges de alerta anual y lotes simultáneos */
.badge-annual-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-batch-alert {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-annual-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.card-batch-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #67e8f9;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Dossier Modal: Alerta de Superación del Tope Anual por Proveedor (Art. 118.3 LCSP) */
.dossier-annual-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(244, 63, 94, 0.45);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-annual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-annual-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #fecdd3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-annual-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.2);
  color: #ffe4e6;
  border: 1px solid rgba(244, 63, 94, 0.45);
}

.dossier-annual-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #ffe4e6;
  margin: 0;
}

.dossier-annual-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.annual-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.annual-kpi-item span {
  display: block;
  font-size: 10px;
  color: #f472b6;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.annual-kpi-item strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.annual-kpi-item.is-excess strong {
  color: #fb7185;
}

.dossier-annual-companions {
  border-top: 1px solid rgba(244, 63, 94, 0.2);
  padding-top: 12px;
}

.annual-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #fecdd3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.annual-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.annual-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(244, 63, 94, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.annual-companion-item:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.45);
  transform: translateX(2px);
}

.annual-companion-left {
  min-width: 0;
  flex: 1;
}

.annual-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  color: #fecdd3;
  margin-bottom: 2px;
}

.annual-companion-date {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

.annual-companion-tit {
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.annual-companion-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.annual-companion-imp {
  font-size: 12.5px;
  font-weight: 750;
  color: #fecdd3;
}

.annual-companion-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fff;
  cursor: pointer;
}

/* Dossier Modal: Alerta de Lote Simultáneo (Art. 99.2 LCSP) */
.dossier-batch-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.14) 0%, rgba(20, 32, 27, 0.85) 100%);
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.dossier-batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.dossier-batch-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  color: #a5f3fc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dossier-batch-law {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.2);
  color: #cffafe;
  border: 1px solid rgba(6, 182, 212, 0.45);
}

.dossier-batch-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #cffafe;
  margin: 0;
}

.dossier-batch-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.batch-kpi-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.batch-kpi-item span {
  display: block;
  font-size: 10px;
  color: #67e8f9;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

.batch-kpi-item strong {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.dossier-batch-companions {
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  padding-top: 12px;
}

.batch-companions-heading {
  font-size: 11px;
  font-weight: 800;
  color: #a5f3fc;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.batch-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(6, 182, 212, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.batch-companion-item:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateX(2px);
}

.batch-companion-left {
  min-width: 0;
  flex: 1;
}

.batch-companion-exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  color: #a5f3fc;
  margin-bottom: 2px;
}

.batch-companion-supp {
  font-size: 10.5px;
  color: #e0f2fe;
  font-weight: 600;
}

.batch-companion-tit {
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.batch-companion-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.batch-companion-imp {
  font-size: 12.5px;
  font-weight: 750;
  color: #a5f3fc;
}

.batch-companion-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 700px) {
  .annual-companion-item,
  .batch-companion-item {
    flex-wrap: wrap;
  }
  .annual-companion-tit,
  .batch-companion-tit {
    max-width: 100%;
    white-space: normal;
  }
  .dossier-annual-kpis,
  .dossier-batch-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Las agrupaciones de contexto no se presentan como incumplimientos. */
.badge-annual-alert, .badge-repeat-alert, .badge-plurianual-alert {
  color: #b7d6d0;
  background: rgba(130, 170, 160, 0.10);
  border-color: rgba(130, 170, 160, 0.28);
}
.dossier-annual-badge-title, .dossier-annual-law, .dossier-repeat-badge-title {
  color: #b7d6d0;
}
