/* =======================================================================
   SISTEMA DE MONITOREO DE INDICADORES RIS - ESTILOS MODERNOS
   ======================================================================= */

:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #e0f2fe;
  --secondary: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* ===================================================================
     PUNTEROS DEL SISTEMA: ALTA PRECISIÓN ROJO VIVO CON CONTORNO BLANCO Y SOMBRA
     (Sin manos toscas: Flecha de Precisión Aerodinámica y Puntero Activo Elegante)
     =================================================================== */
  /* 1. Flecha Principal Moderna (Windows 11 / macOS Streamline) */
  --cursor-vivid-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 1 L1.5 18 L6 13.8 L10.2 22.2 L12.6 21 L8.4 12.8 L14.5 12.8 Z' fill='rgba(0,0,0,0.35)' transform='translate(1, 1.2)'/%3E%3Cpath d='M1.5 1 L1.5 18 L6 13.8 L10.2 22.2 L12.6 21 L8.4 12.8 L14.5 12.8 Z' fill='%23ff0033' stroke='%23ffffff' stroke-width='1.25' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 2 1, auto;

  /* 2. Puntero Interactivo de Precisión (Flecha Activa con Indicador de Clic, Cero Manos Toscas) */
  --cursor-vivid-red-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 1 L1.5 18 L6 13.8 L10.2 22.2 L12.6 21 L8.4 12.8 L14.5 12.8 Z' fill='rgba(0,0,0,0.35)' transform='translate(1, 1.2)'/%3E%3Ccircle cx='17' cy='17' r='3.8' fill='rgba(0,0,0,0.25)' transform='translate(1, 1.2)'/%3E%3Cpath d='M1.5 1 L1.5 18 L6 13.8 L10.2 22.2 L12.6 21 L8.4 12.8 L14.5 12.8 Z' fill='%23ff0033' stroke='%23ffffff' stroke-width='1.25' stroke-linejoin='round' stroke-linecap='round'/%3E%3Ccircle cx='17' cy='17' r='3.5' fill='%23ff0033' stroke='%23ffffff' stroke-width='1.25'/%3E%3Ccircle cx='17' cy='17' r='1.3' fill='%23ffffff'/%3E%3C/svg%3E") 2 1, pointer;

  /* 3. Mano Minimalista Slim (Alternativa estilizada, ultra-fina tipo Apple, sin deformaciones) */
  --cursor-vivid-red-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 1.5 C6.7 1.5 6 2.2 6 3 L6 11.5 C5.4 11.2 4.6 11.2 4 11.6 C3.2 12.2 2.8 13.2 3.2 14.1 L5.2 18.5 C6.2 20.6 8.3 22 10.6 22 L13.8 22 C16.6 22 18.8 19.8 18.8 17 L18.8 11 C18.8 10.2 18.1 9.5 17.3 9.5 C17 9.5 16.7 9.6 16.4 9.8 C16.1 8.9 15.3 8.3 14.3 8.3 C14 8.3 13.7 8.4 13.5 8.5 C13.2 7.6 12.3 7 11.3 7 C11 7 10.7 7.1 10.5 7.2 L10.5 3 C10.5 2.2 9.8 1.5 9 1.5 Z' fill='rgba(0,0,0,0.3)' transform='translate(1, 1)'/%3E%3Cpath d='M7.5 1.5 C6.7 1.5 6 2.2 6 3 L6 11.5 C5.4 11.2 4.6 11.2 4 11.6 C3.2 12.2 2.8 13.2 3.2 14.1 L5.2 18.5 C6.2 20.6 8.3 22 10.6 22 L13.8 22 C16.6 22 18.8 19.8 18.8 17 L18.8 11 C18.8 10.2 18.1 9.5 17.3 9.5 C17 9.5 16.7 9.6 16.4 9.8 C16.1 8.9 15.3 8.3 14.3 8.3 C14 8.3 13.7 8.4 13.5 8.5 C13.2 7.6 12.3 7 11.3 7 C11 7 10.7 7.1 10.5 7.2 L10.5 3 C10.5 2.2 9.8 1.5 9 1.5 Z' fill='%23ff0033' stroke='%23ffffff' stroke-width='1.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 7 2, pointer;

  /* 4. Selector de Texto I-Beam estilizado en rojo vivo */
  --cursor-vivid-red-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='22' viewBox='0 0 16 22'%3E%3Cpath d='M4 2 L12 2 M8 2 L8 20 M4 20 L12 20' stroke='rgba(0,0,0,0.35)' stroke-width='2.4' stroke-linecap='round' transform='translate(1,1)'/%3E%3Cpath d='M4 2 L12 2 M8 2 L8 20 M4 20 L12 20' stroke='%23ff0033' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M4 2 L12 2 M8 2 L8 20 M4 20 L12 20' stroke='%23ffffff' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E") 8 11, text;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  cursor: var(--cursor-vivid-red) !important;
}

/* Elementos interactivos / cliqueables con puntero de precisión aerodinámico */
a, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], 
input[type="checkbox"], input[type="radio"], select, label[for], 
.btn, .btn-nav, .btn-hamburger, .badge-year-pill, .badge-filter-model, 
.dropdown-item, .page-link, .nav-link, .clickable, .cursor-pointer,
.sidebar-hover-tab, .btn-icon-subtle, .period-btn, .tab-btn, .form-check-input, .form-select {
  cursor: var(--cursor-vivid-red-pointer) !important;
}

/* Campos de texto con puntero I-Beam rojo vivo */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], textarea {
  cursor: var(--cursor-vivid-red-text) !important;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR / HEADER ESTABLE Y FIJO */
.navbar-ris {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 0 1.25rem;
  height: 66px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1010;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* En páginas con Sidebar izquierdo (Dashboard en Desktop) */
@media (min-width: 992px) {
  body.has-sidebar .navbar-ris {
    left: 0;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.navbar-container {
  width: 100%;
  padding: 0 0.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
  min-width: 0;
}

/* BOTÓN HAMBURGUESA */
.btn-hamburger {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-hamburger:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-hamburger:active {
  transform: translateY(0);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(520px, 45vw);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-nav-primary {
  background: #0284c7;
  color: white;
}
.btn-nav-primary:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-nav-outline {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-nav-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* =======================================================================
   DASHBOARD LAYOUT (SIDEBAR LATERAL IZQUIERDO FIJO & EJECUTIVO)
   ======================================================================= */
.dashboard-layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 66px);
  position: relative;
}

/* =======================================================================
   SIDEBAR DE FILTROS LATERAL IZQUIERDO (DESDE LA PARTE ARRIBA, TOP: 0)
   ======================================================================= */
.sidebar-filtros {
  width: 340px;
  min-width: 340px;
  max-width: 340px;
  background: linear-gradient(180deg, #090e1a 0%, #0f172a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1030;
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.3s ease;
}

/* ÁREA DE CONTENIDO PRINCIPAL (100% ANCHO COMPLETO PARA EL DASHBOARD) */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  background-color: var(--bg-body);
  margin-left: 0;
  width: 100%;
  margin-top: 66px;
  min-height: calc(100vh - 66px);
  transition: padding 0.3s ease;
}

/* AUTO-MOSTRAR AL PONER EL PUNTERO / AUTO-OCULTAR AL RETIRAR EN DESKTOP */
@media (min-width: 992px) {
  /* Por defecto: oculto a la izquierda */
  body.has-sidebar .sidebar-filtros {
    transform: translateX(-340px);
  }

  /* Al colocar el puntero o estar activo: se muestra suavemente deslizándose hacia la derecha */
  body.has-sidebar.sidebar-hover-open .sidebar-filtros,
  body.has-sidebar .sidebar-filtros:hover,
  .dashboard-layout.sidebar-hover-open .sidebar-filtros {
    transform: translateX(0);
    z-index: 1060;
    box-shadow: 16px 0 50px rgba(0, 0, 0, 0.55), 4px 0 16px rgba(255, 0, 51, 0.15);
  }
}

/* PESTAÑA FLOTANTE Y ZONA TÁCTIL EN EL BORDE IZQUIERDO */
.sidebar-hover-edge {
  position: fixed;
  left: 0;
  top: 66px;
  width: 18px;
  height: calc(100vh - 66px);
  z-index: 1025;
  pointer-events: auto;
}

.sidebar-hover-tab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1028;
  background: linear-gradient(135deg, #090e1a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 0.75rem 0.55rem 0.75rem 0.5rem;
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 4px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  cursor: var(--cursor-vivid-red-pointer) !important;
  transition: all 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  user-select: none;
}

.sidebar-hover-tab:hover {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding-left: 0.8rem;
  box-shadow: 6px 6px 24px rgba(255, 0, 51, 0.4);
  border-color: #ff0033;
}

.sidebar-hover-tab .sidebar-tab-icon {
  font-size: 1.25rem;
  color: #ff0033; /* Rojo vivo */
  transition: transform 0.3s ease;
}

.sidebar-hover-tab:hover .sidebar-tab-icon {
  transform: rotate(90deg) scale(1.15);
}

.sidebar-hover-tab .sidebar-tab-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #e2e8f0;
}

/* Ocultar pestaña flotante cuando el panel de filtros se encuentra abierto */
body.sidebar-hover-open .sidebar-hover-tab,
body.sidebar-hover-open .sidebar-hover-edge,
body.sidebar-mobile-open .sidebar-hover-tab,
body.sidebar-mobile-open .sidebar-hover-edge {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-100%);
}

@media (max-width: 991px) {
  .sidebar-hover-edge,
  .sidebar-hover-tab {
    display: none !important;
  }
}

/* EFECTO PULSO AL HACER CLIC (ROJO VIVO) */
.cursor-click-pulse {
  position: fixed;
  width: 24px;
  height: 24px;
  border: 2px solid #ff0033;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0.95;
  box-shadow: 0 0 10px rgba(255, 0, 51, 0.6);
  animation: cursorPulseAnim 0.35s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes cursorPulseAnim {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* CABECERA DEL SIDEBAR (DESDE EL BORDE SUPERIOR DE LA PANTALLA) */
.sidebar-header {
  height: 66px;
  min-height: 66px;
  padding: 0 1.15rem;
  background: linear-gradient(135deg, #090e1a 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.sidebar-header-icon {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #93c5fd;
}

.sidebar-title {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 1.15;
  color: #ffffff;
}

.sidebar-subtitle {
  font-size: 0.69rem;
  color: #93c5fd;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.btn-icon-subtle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-icon-subtle:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateX(-1px);
}

.btn-close-sidebar {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 1rem;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
}

/* BARRA DE ACCIÓN SUPERIOR EN SIDEBAR */
.sidebar-toolbar {
  padding: 0.75rem 1.15rem;
  background: #0d1527;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-toolbar-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-active-filters {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-reset-modern {
  background: #162036;
  border: 1.5px solid #283958;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  padding: 0.42rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-reset-modern:hover {
  background: #1e2d4d;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}
.btn-reset-modern:hover .reset-icon {
  transform: rotate(-180deg);
}
.reset-icon {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CHIPS DINÁMICOS DE FILTROS ACTIVOS */
.active-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.2rem 0;
}

.chip-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #0f1c32;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.71rem;
  color: #f1f5f9;
  font-weight: 600;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.chip-filter-pill:hover {
  background: #16284a;
  border-color: #38bdf8;
}
.chip-filter-pill .chip-label {
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-filter-pill .chip-remove-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.1rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip-filter-pill .chip-remove-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* AVISO DE MESES SIN DATOS */
.month-no-data-notice {
  grid-column: span 2;
  background: rgba(234, 179, 8, 0.08);
  border: 1px dashed rgba(234, 179, 8, 0.4);
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.45rem;
  width: 100%;
}

/* SEMÁFORO SIN DATOS */
.badge-semaforo.semaforo-sin-datos {
  background: rgba(148, 163, 184, 0.15) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

/* CONTENIDO SCROLL */
.sidebar-content {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 5px;
}
.sidebar-content::-webkit-scrollbar-track {
  background: #090e1a;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: #25334d;
  border-radius: 4px;
}

/* GRUPOS EJECUTIVOS (CARDS) */
.sidebar-card-group {
  background: #111a2e;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-card-group:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.group-step-badge {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.4);
}

.group-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #f8fafc;
  text-transform: uppercase;
}

.modern-field-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.badge-mini-count {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
}

.form-select-modern {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid #263550;
  background-color: #090e1a;
  padding: 0.5rem 0.75rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}
.form-select-modern:focus {
  border-color: #38bdf8;
  background-color: #0b1222;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.form-select-modern.highlight-select {
  border-color: #0284c7;
  background-color: #0e172a;
}
.form-select-modern option {
  background-color: #0f172a;
  color: #ffffff;
}

/* BOTONES DE PERÍODOS DE ALTO IMPACTO */
.badge-meses-counter {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.period-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.btn-period-pill {
  background: #141f36;
  border: 1.5px solid #243452;
  border-radius: 9px;
  padding: 0.45rem 0.4rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  color: #f1f5f9;
  width: 100%;
}
.btn-period-pill i {
  font-size: 0.85rem;
  color: #38bdf8;
}
.btn-period-pill .period-name {
  font-size: 0.75rem;
  font-weight: 700;
}
.btn-period-pill .period-sub {
  font-size: 0.63rem;
  color: #94a3b8;
  font-weight: 600;
}
.btn-period-pill:hover {
  background: #1a2a49;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(56, 189, 248, 0.2);
}
.btn-period-pill.pill-todos {
  background: #0f291e;
  border-color: #166534;
}
.btn-period-pill.pill-todos i {
  color: #4ade80;
}
.btn-period-pill.pill-todos:hover {
  background: #143828;
  border-color: #22c55e;
  color: #86efac;
}
.btn-period-pill.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.45);
}
.btn-period-pill.active i, .btn-period-pill.active .period-sub {
  color: #e0f2fe !important;
}

.btn-clear-selection {
  background: rgba(225, 29, 72, 0.12);
  border: 1px dashed rgba(244, 63, 94, 0.4);
  border-radius: 8px;
  color: #fb7185;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.42rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn-clear-selection:hover {
  background: rgba(225, 29, 72, 0.22);
  border-color: #f43f5e;
  color: #ffffff;
  transform: translateY(-1px);
}

/* CÁPSULAS DE MESES (MONTH CAPSULES) */
.month-capsules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.month-capsule {
  background: #111a2e;
  border: 1.5px solid #202d45;
  border-radius: 8px;
  padding: 0.38rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.76rem;
  font-weight: 700;
  color: #f1f5f9;
  user-select: none;
}
.month-capsule .capsule-num {
  font-size: 0.66rem;
  font-weight: 800;
  color: #94a3b8;
  background: #1c273e;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.month-capsule .capsule-name {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.month-capsule .capsule-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.month-capsule .dot-available {
  background: #38bdf8;
}
.month-capsule .dot-active {
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
}
.month-capsule:hover {
  background: #1a2742;
  border-color: #38bdf8;
  transform: translateY(-1px);
}
.month-capsule.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border-color: #38bdf8;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
}
.month-capsule.active .capsule-num {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.month-capsule.disabled {
  background: #090e1a;
  color: #64748b !important;
  border: 1px dashed #1e293b;
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none !important;
  transform: none !important;
}

/* NOTA INFORMATIVA Y ESTADO EN VIVO */
.sidebar-live-status {
  padding: 0.75rem;
  background: #0b1222;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9px;
}
.status-indicator-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.5);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* BACKDROP OVERLAY PARA DISPOSITIVOS MÓVILES */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1020;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* RESPONSIVE PARA DISPOSITIVOS MÓVILES Y TABLETS (< 992px) */
@media (max-width: 991.98px) {
  .sidebar-filtros {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(340px, 86vw);
    min-width: 0;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1040;
    transform: translateX(-100%);
    margin-left: 0 !important;
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .dashboard-layout.sidebar-mobile-open .sidebar-filtros {
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .sidebar-backdrop {
    z-index: 1030;
  }

  .dashboard-layout.sidebar-mobile-open .sidebar-backdrop {
    display: block;
    opacity: 1;
  }

  .navbar-ris {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    margin-top: 66px !important;
  }
}

/* MAIN CONTAINER (para usuarios.php, carga.php, etc.) */
.main-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  margin-top: 66px !important;
  padding: 1.5rem 1.25rem 3rem 1.25rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* FILTERS SECTION */
.filter-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-select:focus, .form-input:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* MONTH PILLS */
.month-selector-wrapper {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.month-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.month-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-mini {
  padding: 0.32rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
  color: var(--secondary);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-mini:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}
.btn-mini.text-danger:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.month-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.month-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.month-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.month-pill.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.month-pill:disabled, .month-pill.disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

/* KPI CARDS CIRCULARES Y COMPACTOS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  justify-items: center;
}

@media (max-width: 991px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
}

.kpi-card {
  width: 154px;
  height: 154px;
  min-width: 154px;
  min-height: 154px;
  border-radius: 50% !important;
  padding: 0.65rem 0.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer;
  user-select: none;
  background: var(--card-bg);
  border: 3.5px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              border-color 0.3s ease !important;
}

.kpi-card::before {
  display: none !important;
}

/* Efecto de destello de luz tipo lente de cristal (Glass Shimmer Sweep) */
.kpi-card::after {
  content: '';
  position: absolute;
  top: -65%;
  left: -65%;
  width: 230%;
  height: 230%;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(32deg) translateY(-120%);
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.kpi-card:hover::after {
  transform: rotate(32deg) translateY(120%);
}

.kpi-card:active {
  transform: translateY(-2px) scale(0.97) !important;
  transition: transform 0.1s ease !important;
}

/* Efecto de pulso en actualización de datos */
.kpi-card.kpi-pulsing {
  animation: kpiCardPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes kpiCardPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 1. NUMERADOR (AZUL CELESTE) */
.kpi-card.blue {
  border-color: #0284c7 !important;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #f0f9ff 60%, #e0f2fe 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.12),
              0 8px 22px rgba(2, 132, 199, 0.14),
              inset 0 2px 8px rgba(255, 255, 255, 0.9) !important;
}
.kpi-card.blue:hover {
  transform: translateY(-7px) scale(1.05) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.28),
              0 16px 34px rgba(2, 132, 199, 0.28),
              inset 0 0 14px rgba(2, 132, 199, 0.1) !important;
}

/* 2. DENOMINADOR (ÍNDIGO / PÚRPURA) */
.kpi-card.indigo {
  border-color: #6366f1 !important;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #f5f3ff 60%, #ede9fe 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.12),
              0 8px 22px rgba(99, 102, 241, 0.14),
              inset 0 2px 8px rgba(255, 255, 255, 0.9) !important;
}
.kpi-card.indigo:hover {
  transform: translateY(-7px) scale(1.05) !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.28),
              0 16px 34px rgba(99, 102, 241, 0.28),
              inset 0 0 14px rgba(99, 102, 241, 0.1) !important;
}

/* 3. CUMPLIMIENTO (ESMERALDA / VERDE) */
.kpi-card.emerald {
  border-color: #10b981 !important;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #ecfdf5 60%, #d1fae5 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.12),
              0 8px 22px rgba(16, 185, 129, 0.14),
              inset 0 2px 8px rgba(255, 255, 255, 0.9) !important;
}
.kpi-card.emerald:hover {
  transform: translateY(-7px) scale(1.05) !important;
  border-color: #059669 !important;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.28),
              0 16px 34px rgba(16, 185, 129, 0.28),
              inset 0 0 14px rgba(16, 185, 129, 0.1) !important;
}

/* 4. ESTADO RIS (ÁMBAR / DINÁMICO) */
.kpi-card.amber {
  border-color: #f59e0b !important;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #fffbeb 60%, #fef3c7 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.12),
              0 8px 22px rgba(245, 158, 11, 0.14),
              inset 0 2px 8px rgba(255, 255, 255, 0.9) !important;
}
.kpi-card.amber:hover {
  transform: translateY(-7px) scale(1.05) !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.28),
              0 16px 34px rgba(245, 158, 11, 0.28),
              inset 0 0 14px rgba(245, 158, 11, 0.1) !important;
}

/* TEMA OSCURO PARA LAS TARJETAS CIRCULARES */
[data-theme="dark"] .kpi-card {
  background: #0f172a !important;
}
[data-theme="dark"] .kpi-card::after {
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 70%
  );
}
[data-theme="dark"] .kpi-card.blue {
  border-color: #38bdf8 !important;
  background: radial-gradient(circle at 35% 25%, #1e293b 0%, #0f172a 70%, #082f49 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.18), 0 8px 24px rgba(56, 189, 248, 0.2) !important;
}
[data-theme="dark"] .kpi-card.blue:hover {
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.35), 0 16px 34px rgba(56, 189, 248, 0.35) !important;
}
[data-theme="dark"] .kpi-card.indigo {
  border-color: #818cf8 !important;
  background: radial-gradient(circle at 35% 25%, #1e293b 0%, #0f172a 70%, #1e1b4b 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(129, 140, 248, 0.18), 0 8px 24px rgba(129, 140, 248, 0.2) !important;
}
[data-theme="dark"] .kpi-card.indigo:hover {
  box-shadow: 0 0 0 6px rgba(129, 140, 248, 0.35), 0 16px 34px rgba(129, 140, 248, 0.35) !important;
}
[data-theme="dark"] .kpi-card.emerald {
  border-color: #34d399 !important;
  background: radial-gradient(circle at 35% 25%, #1e293b 0%, #0f172a 70%, #064e3b 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(52, 211, 153, 0.18), 0 8px 24px rgba(52, 211, 153, 0.2) !important;
}
[data-theme="dark"] .kpi-card.emerald:hover {
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.35), 0 16px 34px rgba(52, 211, 153, 0.35) !important;
}
[data-theme="dark"] .kpi-card.amber {
  border-color: #fbbf24 !important;
  background: radial-gradient(circle at 35% 25%, #1e293b 0%, #0f172a 70%, #451a03 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(251, 191, 36, 0.18), 0 8px 24px rgba(251, 191, 36, 0.2) !important;
}
[data-theme="dark"] .kpi-card.amber:hover {
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.35), 0 16px 34px rgba(251, 191, 36, 0.35) !important;
}

.kpi-circle-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-circle-icon i {
  transition: transform 0.3s ease;
  display: inline-block;
}

.kpi-card:hover .kpi-circle-icon {
  transform: scale(1.25) translateY(-2px);
}

.kpi-card.blue:hover .kpi-circle-icon i {
  transform: rotate(8deg);
}

.kpi-card.indigo:hover .kpi-circle-icon i {
  transform: rotate(-8deg);
}

.kpi-card.emerald:hover .kpi-circle-icon i {
  transform: scale(1.15);
}

.kpi-card.amber:hover .kpi-circle-icon i {
  transform: rotate(10deg);
}

.kpi-label {
  font-size: 0.66rem !important;
  font-weight: 800 !important;
  color: var(--secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 2px !important;
  line-height: 1.2 !important;
  transition: color 0.25s ease;
}

.kpi-card:hover .kpi-label {
  color: var(--text-main) !important;
}

.kpi-value {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  line-height: 1.15 !important;
  margin-bottom: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.25s ease;
}

.kpi-card:hover .kpi-value {
  transform: scale(1.04);
}

#kpi-numerador {
  color: #0284c7 !important;
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900 !important;
}

#kpi-denominador {
  color: #4f46e5 !important;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900 !important;
}

#kpi-porcentaje {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.3px !important;
  color: #059669 !important;
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] #kpi-numerador {
  background: linear-gradient(135deg, #38bdf8 0%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] #kpi-denominador {
  background: linear-gradient(135deg, #818cf8 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] #kpi-porcentaje {
  background: linear-gradient(135deg, #34d399 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-circle-badge-wrap {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-semaforo {
  padding: 0.22rem 0.6rem !important;
  border-radius: 12px !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  max-width: 125px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.badge-semaforo .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: kpiStatusPulse 1.8s infinite ease-in-out;
}

.semaforo-verde .status-dot {
  background-color: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
}

.semaforo-amarillo .status-dot {
  background-color: #d97706;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.7);
}

.semaforo-rojo .status-dot {
  background-color: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
}

.semaforo-sin-datos .status-dot {
  background-color: #94a3b8;
  box-shadow: none;
}

@keyframes kpiStatusPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0);
  }
  100% {
    transform: scale(0.9);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.kpi-card:hover .badge-semaforo {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.kpi-subtext {
  font-size: 0.65rem !important;
  color: var(--text-muted) !important;
  margin-top: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.25rem !important;
  max-width: 130px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.kpi-subtext span {
  display: inline-block;
  max-width: 105px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 480px) {
  .kpi-card {
    width: 136px;
    height: 136px;
    padding: 0.5rem 0.4rem !important;
  }
  .kpi-value {
    font-size: 1.18rem !important;
  }
  #kpi-porcentaje {
    font-size: 1.25rem !important;
  }
  .kpi-label {
    font-size: 0.6rem !important;
  }
  .kpi-subtext {
    font-size: 0.58rem !important;
    max-width: 110px !important;
  }
}

/* BADGES & SEMÁFOROS */
.badge-semaforo {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-success, .semaforo-verde {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-warning, .semaforo-amarillo {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-danger, .semaforo-rojo {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* CHARTS SECTION */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.chart-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-container-combo {
  position: relative;
  height: 420px;
  width: 100%;
}

.chart-container-donut {
  position: relative;
  height: 320px;
  width: 100%;
}

.chart-container-tacometro {
  position: relative;
  min-height: 250px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

#chart-tacometro {
  max-width: 100%;
  height: auto;
  display: block;
}

.tacometro-digital-readout {
  margin-top: -1.2rem;
  z-index: 5;
}

#tacometro-digital-val {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* DATA TABLE */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table-toolbar {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.search-wrapper {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  outline: none;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  max-height: 520px;
}

.table-ris {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.table-ris thead th {
  background: #f8fafc;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.table-ris tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
}

.table-ris tbody tr:hover {
  background-color: #f8fafc;
}

/* TABS FOR CARGA */
.tabs-header {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* UPLOAD DROPZONE */
.dropzone-box {
  border: 2px dashed #93c5fd;
  background: #f0fdf4;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: #0284c7;
  background: #e0f2fe;
}

.dropzone-icon {
  font-size: 3rem;
  color: #0284c7;
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.dropzone-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* PROGRESS BAR */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}
.progress-bar-fill {
  height: 100%;
  background: #0284c7;
  width: 0%;
  transition: width 0.3s ease;
}

/* FOOTER */
.footer-ris {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* =======================================================================
   ADAPTABILIDAD 100% RESPONSIVE MULTIDISPOSITIVO (MÓVIL, TABLET, DESKTOP)
   ======================================================================= */

/* 1. TABLETS Y PANTALLAS MEDIANAS (< 992px) */
@media (max-width: 991.98px) {
  .main-content {
    padding: 1.25rem;
    width: 100%;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

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

  .table-toolbar {
    flex-wrap: wrap;
  }
}

/* 2. TABLETS PEQUEÑAS Y MÓVILES HORIZONTALES (< 768px) */
@media (max-width: 767.98px) {
  .navbar-ris {
    padding: 0.65rem 1rem;
  }

  .brand-title {
    font-size: 0.95rem;
    letter-spacing: -0.2px;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .btn-hamburger {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }

  .btn-nav {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .main-wrapper {
    padding: 1.25rem 1rem 2rem 1rem;
    margin: 0 auto;
    margin-top: 66px !important;
  }

  .chart-container-combo {
    height: 320px;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .table-toolbar .d-flex {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .table-toolbar .d-flex:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .search-wrapper {
    min-width: 100%;
    width: 100%;
  }

  .table-toolbar .btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.82rem;
  }

  /* Pestañas de Carga con scroll horizontal táctil */
  .tabs-header {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 0.35rem;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
  }

  .dropzone-box {
    padding: 1.8rem 1rem;
  }

  .dropzone-icon {
    font-size: 2.3rem;
  }

  .dropzone-title {
    font-size: 0.98rem;
  }
}

/* 3. MÓVILES (< 576px) */
@media (max-width: 575.98px) {
  .navbar-ris {
    padding: 0.5rem 0.65rem;
  }

  .navbar-container {
    padding: 0;
    gap: 0.4rem;
  }

  .brand-wrapper {
    gap: 0.5rem;
    min-width: 0;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 0.84rem;
    max-width: 165px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    display: none !important;
  }

  .btn-hamburger {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .nav-actions {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .btn-nav {
    padding: 0.38rem 0.55rem;
    font-size: 0.76rem;
    border-radius: 7px;
  }

  .main-content {
    padding: 0.75rem !important;
  }

  .main-wrapper {
    padding: 1rem 0.65rem 2rem 0.65rem !important;
    margin: 0 auto !important;
    margin-top: 66px !important;
  }

  .card, .rounded-4 {
    border-radius: 0.85rem !important;
  }

  .card.p-4, .rounded-4.p-4 {
    padding: 1rem !important;
  }

  /* Grid de KPIs a 1 sola columna fluida */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .kpi-card {
    padding: 0.85rem;
  }

  .kpi-value {
    font-size: 1.65rem;
  }

  .kpi-label {
    font-size: 0.74rem;
  }

  /* Altura óptima de combo chart en móvil */
  .chart-container-combo {
    height: 260px;
  }

  .chart-card {
    padding: 0.9rem;
  }

  .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .chart-card-header .d-flex {
    flex-wrap: wrap;
    width: 100%;
    gap: 0.35rem !important;
  }

  /* Tacómetro responsivo en móvil */
  .chart-container-tacometro {
    min-height: 180px;
    padding: 0.25rem 0;
  }

  #chart-tacometro {
    max-width: 100%;
    height: auto;
  }

  #tacometro-digital-val {
    font-size: 1.65rem;
  }

  .tacometro-digital-readout {
    margin-top: -0.75rem;
  }

  /* Tabla de Detalle */
  .table-card {
    margin-bottom: 1.25rem;
  }

  .table-ris th, .table-ris td {
    padding: 0.5rem 0.65rem;
    font-size: 0.76rem;
  }

  .table-ris {
    min-width: 650px;
  }

  /* Modo Administrador / Usuarios */
  .stat-card-admin {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }

  /* Login Card */
  .login-card {
    border-radius: 1rem;
  }

  .login-header {
    padding: 1.5rem 1rem;
  }

  .login-body {
    padding: 1.25rem 1rem;
  }
}

/* =======================================================================
   SISTEMA DE MODO OSCURO (DARK MODE) COMPLETO
   ======================================================================= */
[data-theme="dark"], body.dark-theme {
  --bg-body: #080c16;
  --card-bg: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  background-color: #080c16;
  color: #f8fafc;
}

[data-theme="dark"] .card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .filter-card,
body.dark-theme .card,
body.dark-theme .chart-card,
body.dark-theme .table-card,
body.dark-theme .filter-card {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .chart-card-header,
body.dark-theme .chart-card-header {
  border-bottom-color: #1e293b !important;
}

[data-theme="dark"] .kpi-card,
body.dark-theme .kpi-card {
  background: #0f172a;
  border-color: #1e293b;
}
[data-theme="dark"] .kpi-value,
body.dark-theme .kpi-value {
  color: #ffffff;
}

[data-theme="dark"] .table-ris,
body.dark-theme .table-ris {
  color: #f1f5f9;
}
[data-theme="dark"] .table-ris thead th,
body.dark-theme .table-ris thead th {
  background: #172033;
  color: #94a3b8;
  border-bottom-color: #1e293b;
}
[data-theme="dark"] .table-ris tbody td,
body.dark-theme .table-ris tbody td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}
[data-theme="dark"] .table-ris tbody tr:hover,
body.dark-theme .table-ris tbody tr:hover {
  background-color: #1a253c;
}
[data-theme="dark"] .table-toolbar,
body.dark-theme .table-toolbar {
  background-color: #0f172a;
  border-bottom-color: #1e293b;
}
[data-theme="dark"] .search-input,
body.dark-theme .search-input {
  background-color: #172033;
  border-color: #263550;
  color: #f8fafc;
}

[data-theme="dark"] .footer-ris,
body.dark-theme .footer-ris {
  background-color: #080c16;
  border-top-color: #1e293b;
  color: #64748b;
}

/* Ficha Técnica y Cajas de Numerador/Denominador en Modo Oscuro */
[data-theme="dark"] .ficha-card-num,
body.dark-theme .ficha-card-num {
  background: linear-gradient(180deg, #0c1a2e 0%, #0f172a 100%) !important;
  border-color: #0284c7 !important;
}
[data-theme="dark"] .ficha-card-den,
body.dark-theme .ficha-card-den {
  background: linear-gradient(180deg, #1c190c 0%, #0f172a 100%) !important;
  border-color: #d97706 !important;
}
[data-theme="dark"] #ficha-detalle-numerador,
[data-theme="dark"] #ficha-detalle-denominador,
body.dark-theme #ficha-detalle-numerador,
body.dark-theme #ficha-detalle-denominador {
  color: #e2e8f0 !important;
}

/* Módulo de Administración (usuarios.php) y Carga (carga.php) en Modo Oscuro */
[data-theme="dark"] .stat-card-admin,
body.dark-theme .stat-card-admin {
  background: #0f172a;
  border-color: #1e293b;
  color: #f8fafc;
}
[data-theme="dark"] .dropzone-box,
body.dark-theme .dropzone-box {
  background: #0d1527;
  border-color: #25334d;
}
[data-theme="dark"] .dropzone-title,
body.dark-theme .dropzone-title {
  color: #f8fafc;
}
[data-theme="dark"] .modal-content,
body.dark-theme .modal-content {
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #1e293b;
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
body.dark-theme .modal-header,
body.dark-theme .modal-footer {
  border-color: #1e293b;
}

/* =======================================================================
   ESTILOS PARA FICHA TÉCNICA Y BANNER TEMÁTICO ILUSTRADO
   ======================================================================= */
.ficha-tecnica-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.25rem;
}

.ficha-programa-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: #0369a1;
}

[data-theme="dark"] .ficha-programa-title,
body.dark-theme .ficha-programa-title {
  color: #38bdf8;
}

.ficha-indicador-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

[data-theme="dark"] .ficha-indicador-subtitle,
body.dark-theme .ficha-indicador-subtitle {
  color: #f1f5f9;
}

.thematic-hero-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .thematic-hero-banner,
body.dark-theme .thematic-hero-banner {
  background: linear-gradient(135deg, #0b1a2e 0%, #0d1e38 100%);
  border-color: #1e3a8a;
}

.thematic-illustration-box {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

[data-theme="dark"] .thematic-illustration-box,
body.dark-theme .thematic-illustration-box {
  background: #111e36;
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.thematic-illustration-svg {
  width: 48px;
  height: 48px;
}

/* =======================================================================
   SIDEBAR FOOTER & BOTONES DE ACCIÓN A4 EN EL PANEL DE FILTROS
   ======================================================================= */
.sidebar-footer {
  padding: 0.85rem 1rem 1rem 1rem;
  background: linear-gradient(180deg, #0c1424 0%, #070c17 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-footer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.badge-footer-status {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  transition: all 0.25s ease;
}

.btn-sidebar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.58rem 0.85rem;
  border-radius: 9px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  box-sizing: border-box;
}

.btn-sidebar-print {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1.5px solid #38bdf8;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}
.btn-sidebar-print:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
  border-color: #7dd3fc;
  color: #ffffff !important;
}

.btn-sidebar-save {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid #ef4444;
  color: #f87171 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.btn-sidebar-save:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

#btn-imprimir-cuadros-a4.btn-a4-ready,
.btn-sidebar-print.btn-a4-ready {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 6px 16px rgba(2, 132, 199, 0.4) !important;
  animation: pulseA4 2.5s infinite;
}

#btn-guardar-archivo-a4.btn-a4-ready,
.btn-sidebar-save.btn-a4-ready {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 6px 16px rgba(239, 68, 68, 0.35) !important;
}

@keyframes pulseA4 {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@media (max-height: 580px) {
  .sidebar-filtros {
    overflow-y: auto !important;
  }
  .sidebar-footer {
    position: static;
  }
}

/* =======================================================================
   NUEVO MODELO EJECUTIVO DE PANEL DE FILTROS (DISEÑO EXACTO)
   ======================================================================= */
.sidebar-model-panel {
  background: #0b1324 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 1.25rem 1.15rem !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

.filter-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.filter-model-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.text-cyan {
  color: #38bdf8 !important;
}

.badge-filter-model {
  background: #182236;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.badge-year-pill {
  background: #182236;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}
.badge-year-pill:hover,
.badge-year-pill:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.filter-model-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.filter-model-group {
  margin-bottom: 1.15rem;
}

.filter-model-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.45rem;
}

.filter-model-label i {
  font-size: 0.95rem;
  color: #38bdf8;
}

.filter-model-select {
  background-color: #172237 !important;
  border: 1px solid #283750 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0.62rem 2.2rem 0.62rem 0.85rem !important;
  width: 100% !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 14px 10px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.filter-model-select:hover {
  border-color: #38bdf8 !important;
}

.filter-model-select:focus {
  background-color: #1c2a44 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22) !important;
  outline: none !important;
}

.filter-model-select optgroup {
  background-color: #0b1324 !important;
  color: #38bdf8 !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.5px !important;
  padding: 6px 8px !important;
  text-transform: uppercase !important;
}

.filter-model-select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 0.5rem 0.75rem !important;
  font-weight: 500 !important;
}

.filter-model-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.5rem 0 1.25rem 0;
}

.filter-model-actions {
  margin-top: auto;
  padding-bottom: 0.5rem;
}

.btn-filter-model-reset {
  background-color: #172237 !important;
  border: 1.5px solid #283750 !important;
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  padding: 0.68rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.btn-filter-model-reset:hover {
  background-color: #1f2e4a !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

.btn-filter-model-print {
  background-color: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  padding: 0.68rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.btn-filter-model-print:hover {
  background-color: #0369a1 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5) !important;
  color: #ffffff !important;
}

.btn-filter-model-save {
  background-color: #dc2626 !important;
  border: 1px solid #dc2626 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  padding: 0.68rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35) !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.btn-filter-model-save:hover {
  background-color: #b91c1c !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.5) !important;
  color: #ffffff !important;
}

.btn-filter-model-db {
  background-color: #065f46 !important;
  border: 1px solid #10b981 !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  padding: 0.68rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.btn-filter-model-db:hover {
  background-color: #047857 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
}

/* =======================================================================
   REGLAS DE IMPRESIÓN PROFESIONAL (CUADROS ESTADÍSTICOS EN FORMATO HORIZONTAL A4)
   ======================================================================= */
@media print {
  @page {
    size: A4 landscape;
    margin: 6mm 8mm;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar elementos no gráficos durante la impresión */
  .navbar-ris,
  .sidebar-filtros,
  .sidebar-backdrop,
  .btn-hamburger,
  .table-card,
  .table-toolbar,
  .search-wrapper,
  .footer-ris,
  .btn-nav,
  .btn,
  #btn-reset-filtros,
  .sidebar-hover-tab,
  .sidebar-hover-edge {
    display: none !important;
  }

  .dashboard-layout {
    display: block !important;
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .card, .chart-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .charts-grid {
    display: grid !important;
    grid-template-columns: 1.65fr 1fr !important;
    gap: 0.8cm !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .chart-container-combo {
    height: 310px !important;
  }
}

/* =======================================================================
   LOGOTIPO OFICIAL RIS EL COLLAO - MINSA
   ======================================================================= */
.ris-official-logo {
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.85);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}
.ris-official-logo:hover {
  transform: scale(1.05);
}
.ris-official-logo-nav {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.ris-official-logo-login {
  width: 108px;
  height: 108px;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.35), 0 0 20px rgba(56, 189, 248, 0.35);
}

/* =======================================================================
   ESTILOS DE ALTO IMPACTO PARA EL MÓDULO DE LOGIN
   ======================================================================= */
.login-portal-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: 
    radial-gradient(circle at 12% 15%, rgba(220, 38, 38, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 88% 85%, rgba(2, 132, 199, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.6) 0%, transparent 100%),
    linear-gradient(135deg, #090e17 0%, #0f172a 50%, #1e293b 100%);
  position: relative;
  overflow-x: hidden;
}

.login-portal-bg::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.7;
}

.login-card-executive {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: loginCardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header-executive {
  background: linear-gradient(135deg, #0b1e3b 0%, #0f2e5a 60%, #0369a1 100%);
  padding: 2.25rem 2rem 1.75rem 2rem;
  text-align: center;
  color: #ffffff;
  position: relative;
}

.login-header-executive::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #dc2626 0%, #ffffff 50%, #0284c7 100%);
}

.login-halo {
  position: relative;
  display: inline-block;
  margin-bottom: 0.85rem;
}

.login-halo::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.6) 0%, transparent 70%);
  z-index: -1;
  animation: pulseHalo 3s infinite ease-in-out;
}

@keyframes pulseHalo {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.login-body-executive {
  padding: 2rem;
}

.input-group-modern {
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid #cbd5e1;
}

.input-group-modern:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.input-group-modern .input-group-text {
  background: #f8fafc;
  border: none;
  color: #64748b;
  padding-left: 1rem;
}

.input-group-modern .form-control {
  border: none;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
}

.input-group-modern .form-control:focus {
  box-shadow: none;
}

.btn-toggle-eye {
  background: #f8fafc;
  border: none;
  color: #64748b;
  padding: 0 0.85rem;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-toggle-eye:hover {
  color: #0284c7;
}

.btn-login-executive {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}
.btn-login-executive:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
  color: #ffffff;
}
.btn-login-executive:active {
  transform: translateY(0);
}

.credential-pill-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 20px;
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.credential-pill-btn:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
  transform: translateY(-1px);
}

/* =======================================================================
   ESTILOS DE ALTO IMPACTO PARA EL MÓDULO DE CARGA
   ======================================================================= */
.hero-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
  .hero-kpi-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 575px) {
  .hero-kpi-bar {
    grid-template-columns: 1fr;
  }
}

.hero-kpi-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.07);
}

.hero-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}
.hero-kpi-icon.blue { background: #e0f2fe; color: #0284c7; }
.hero-kpi-icon.emerald { background: #d1fae5; color: #059669; }
.hero-kpi-icon.amber { background: #fef3c7; color: #d97706; }
.hero-kpi-icon.purple { background: #ede9fe; color: #7c3aed; }

.hero-kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
}
.hero-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}
.hero-kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

/* DROPZONE PRO */
.dropzone-box-pro {
  border: 2px dashed #38bdf8;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-radius: 1.25rem;
  padding: 2.75rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.dropzone-box-pro:hover, .dropzone-box-pro.dragover {
  border-color: #0284c7;
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.15);
  transform: scale(1.01);
}
.dropzone-box-pro.metas {
  border-color: #facc15;
  background: linear-gradient(180deg, #fefce8 0%, #ffffff 100%);
}
.dropzone-box-pro.metas:hover, .dropzone-box-pro.metas.dragover {
  border-color: #ca8a04;
  background: linear-gradient(180deg, #fef9c3 0%, #fefce8 100%);
  box-shadow: 0 10px 25px -5px rgba(202, 138, 4, 0.15);
}

.cloud-icon-animated {
  font-size: 3.5rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  animation: floatCloud 3.5s ease-in-out infinite;
}
@keyframes floatCloud {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.badge-format-pill {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* PREVIEW BOX */
.preview-summary-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* LIVE CALCULATION IN FORM MANUAL */
.live-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

/* DARK THEME ADAPTATION FOR CARGA & LOGIN */
[data-theme="dark"] .login-card-executive,
body.dark-theme .login-card-executive {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 25px rgba(56, 189, 248, 0.15);
}
[data-theme="dark"] .login-body-executive,
body.dark-theme .login-body-executive {
  color: #f1f5f9;
}
[data-theme="dark"] .input-group-modern,
body.dark-theme .input-group-modern {
  border-color: #334155;
  background: #0f172a;
}
[data-theme="dark"] .input-group-modern .input-group-text,
body.dark-theme .input-group-modern .input-group-text {
  background: #1e293b;
  color: #94a3b8;
}
[data-theme="dark"] .input-group-modern .form-control,
body.dark-theme .input-group-modern .form-control {
  background: #0f172a;
  color: #f8fafc;
}
[data-theme="dark"] .btn-toggle-eye,
body.dark-theme .btn-toggle-eye {
  background: #0f172a;
  color: #94a3b8;
}
[data-theme="dark"] .credential-pill-btn,
body.dark-theme .credential-pill-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
[data-theme="dark"] .credential-pill-btn:hover,
body.dark-theme .credential-pill-btn:hover {
  background: #0f2e5a;
  border-color: #38bdf8;
  color: #38bdf8;
}

[data-theme="dark"] .hero-kpi-card,
body.dark-theme .hero-kpi-card {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .hero-kpi-icon.blue, body.dark-theme .hero-kpi-icon.blue { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }
[data-theme="dark"] .hero-kpi-icon.emerald, body.dark-theme .hero-kpi-icon.emerald { background: rgba(16, 185, 129, 0.2); color: #34d399; }
[data-theme="dark"] .hero-kpi-icon.amber, body.dark-theme .hero-kpi-icon.amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .hero-kpi-icon.purple, body.dark-theme .hero-kpi-icon.purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

[data-theme="dark"] .dropzone-box-pro,
body.dark-theme .dropzone-box-pro {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: #0284c7;
}
[data-theme="dark"] .dropzone-box-pro.metas,
body.dark-theme .dropzone-box-pro.metas {
  background: linear-gradient(180deg, #2a2415 0%, #0f172a 100%);
  border-color: #ca8a04;
}
[data-theme="dark"] .preview-summary-banner,
body.dark-theme .preview-summary-banner {
  background: #1e293b;
  border-color: #334155;
}

/* =======================================================================
   DESCRIPCIÓN TÉCNICA DEL NUMERADOR Y DENOMINADOR (+2 PUNTOS DE TAMAÑO)
   ======================================================================= */
#ficha-detalle-numerador,
#ficha-detalle-denominador {
  font-size: 1.02rem !important; /* Aumentado 2 puntos (+2pt/px) para mayor legibilidad */
  line-height: 1.55 !important;
  font-weight: 500;
}

[data-theme="dark"] #ficha-detalle-numerador,
body.dark-theme #ficha-detalle-numerador,
[data-theme="dark"] #ficha-detalle-denominador,
body.dark-theme #ficha-detalle-denominador {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .ficha-card-num,
body.dark-theme .ficha-card-num {
  background: linear-gradient(180deg, #0c1a2e 0%, #0f172a 100%) !important;
  border-color: #0369a1 !important;
}

[data-theme="dark"] .ficha-card-den,
body.dark-theme .ficha-card-den {
  background: linear-gradient(180deg, #241c08 0%, #0f172a 100%) !important;
  border-color: #854d0e !important;
}

/* =======================================================================
   SUITE INTEGRAL 100% RESPONSIVE MULTIDISPOSITIVO (MÓVILES, TABLETS, DESKTOP)
   ======================================================================= */

/* --- 1. AJUSTES GLOBALES PARA CERO DESBORDAMIENTOS HORIZONTALES --- */
html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
}

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

img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

/* --- 2. TABLETS Y PANTALLAS MEDIANAS (768px a 991.98px) --- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar-ris {
    height: 62px !important;
    padding: 0 1rem !important;
  }
  
  .main-content, .main-wrapper {
    margin-top: 62px !important;
    padding: 1.15rem 1rem !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.15rem !important;
    justify-items: center;
  }

  .kpi-card {
    width: 142px !important;
    height: 142px !important;
    min-width: 142px !important;
    min-height: 142px !important;
  }

  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .hero-kpi-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

/* --- 3. MÓVILES Y SMARTPHONES (Hasta 767.98px) --- */
@media (max-width: 767.98px) {
  /* Header compacto */
  .navbar-ris {
    height: 58px !important;
    padding: 0 0.75rem !important;
  }

  .main-content {
    margin-top: 58px !important;
    padding: 0.85rem 0.65rem !important;
    width: 100% !important;
  }

  .main-wrapper {
    margin-top: 58px !important;
    padding: 0.85rem 0.65rem 2rem 0.65rem !important;
    width: 100% !important;
  }

  /* Logotipo y Título de marca */
  .ris-official-logo-nav {
    width: 34px !important;
    height: 34px !important;
  }

  .brand-title {
    font-size: 0.82rem !important;
    max-width: 155px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
  }

  .brand-subtitle {
    display: none !important;
  }

  .btn-hamburger {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
  }

  .btn-nav {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.75rem !important;
    gap: 0.25rem !important;
  }

  /* SIDEBAR EN MÓVIL: Drawer flotante con animación suave */
  .sidebar-filtros {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(320px, 86vw) !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1050 !important;
    transform: translateX(-100%) !important;
    margin-left: 0 !important;
    box-shadow: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .dashboard-layout.sidebar-mobile-open .sidebar-filtros {
    transform: translateX(0) !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.6) !important;
  }

  .sidebar-backdrop {
    z-index: 1045 !important;
  }

  .dashboard-layout.sidebar-mobile-open .sidebar-backdrop {
    display: block !important;
    opacity: 1 !important;
  }

  /* Pestaña y borde flotante de escritorio deshabilitados en móvil */
  .sidebar-hover-tab,
  .sidebar-hover-edge {
    display: none !important;
  }

  /* KPIS CIRCULARES RESPONSIVOS (2 columnas con clamp para ajuste perfecto) */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    margin-bottom: 1.15rem !important;
    justify-items: center !important;
  }

  .kpi-card {
    width: clamp(120px, 42vw, 138px) !important;
    height: clamp(120px, 42vw, 138px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0.5rem 0.35rem !important;
  }

  .kpi-circle-icon {
    font-size: 1.1rem !important;
    margin-bottom: 1px !important;
  }

  .kpi-label {
    font-size: clamp(0.56rem, 2.3vw, 0.64rem) !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 1px !important;
  }

  .kpi-value {
    font-size: clamp(1.15rem, 4.5vw, 1.35rem) !important;
    margin-bottom: 1px !important;
  }

  #kpi-porcentaje {
    font-size: clamp(1.2rem, 4.8vw, 1.45rem) !important;
  }

  .badge-semaforo {
    font-size: clamp(0.6rem, 2.2vw, 0.68rem) !important;
    padding: 0.15rem 0.45rem !important;
    max-width: 108px !important;
  }

  .kpi-subtext {
    font-size: clamp(0.55rem, 2.1vw, 0.62rem) !important;
    max-width: 105px !important;
  }

  /* GRÁFICOS: APILADOS Y ALTURAS FLUIDAS */
  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-bottom: 1.15rem !important;
  }

  .chart-card {
    padding: 0.85rem !important;
  }

  .chart-container-combo {
    height: clamp(260px, 42vh, 320px) !important;
    width: 100% !important;
  }

  .chart-container-tacometro {
    min-height: 190px !important;
    padding: 0.35rem 0 !important;
  }

  #tacometro-digital-val {
    font-size: 1.75rem !important;
  }

  /* TOOLBAR DE TABLA: TOTALMENTE FLUIDO */
  .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    padding: 0.75rem !important;
  }

  .search-wrapper {
    width: 100% !important;
    min-width: 0 !important;
  }

  .search-input {
    width: 100% !important;
    font-size: 0.85rem !important;
  }

  .table-toolbar .d-flex {
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 0.4rem !important;
  }

  .table-toolbar .btn,
  .table-toolbar .btn-export {
    flex: 1 1 calc(50% - 0.4rem) !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.5rem !important;
  }

  /* MODAL RESPONSIVO A PANTALLA COMPLETA */
  .modal-dialog {
    margin: 0.5rem auto !important;
    max-width: calc(100% - 1rem) !important;
    width: calc(100% - 1rem) !important;
  }

  .modal-content {
    border-radius: 1rem !important;
  }

  .modal-body {
    padding: 1rem !important;
  }

  /* MÓDULO DE CARGA EN MÓVIL */
  .hero-kpi-bar {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.15rem !important;
  }

  .hero-kpi-card {
    padding: 0.75rem !important;
    gap: 0.65rem !important;
  }

  .hero-kpi-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.15rem !important;
  }

  .hero-kpi-value {
    font-size: 1.05rem !important;
  }

  .hero-kpi-label {
    font-size: 0.68rem !important;
  }

  .hero-kpi-subtext {
    font-size: 0.62rem !important;
    max-width: 120px !important;
  }

  .dropzone-box-pro {
    padding: 1.5rem 0.85rem !important;
  }

  .cloud-icon-animated {
    font-size: 2.4rem !important;
  }

  /* PESTAÑAS DE ADMIN Y CARGA */
  .admin-nav-tabs,
  .tabs-header {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    gap: 0.35rem !important;
    scrollbar-width: thin;
  }

  .admin-tab-btn,
  .tab-btn {
    flex-shrink: 0 !important;
    padding: 0.55rem 0.8rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  /* PORTAL DE LOGIN EN MÓVIL */
  .login-portal-bg {
    padding: 1rem 0.65rem !important;
  }

  .login-card-executive {
    max-width: 100% !important;
    border-radius: 1.15rem !important;
  }

  .login-header-executive {
    padding: 1.5rem 1.15rem 1.25rem 1.15rem !important;
  }

  .ris-official-logo-login {
    width: 80px !important;
    height: 80px !important;
  }

  .login-body-executive {
    padding: 1.25rem 1rem !important;
  }
}

/* --- 4. SMARTPHONES MUY PEQUEÑOS (<= 400px, e.g. iPhone SE, Galaxy A, etc.) --- */
@media (max-width: 400px) {
  .brand-title {
    max-width: 130px !important;
    font-size: 0.78rem !important;
  }

  .kpi-grid {
    gap: 0.5rem !important;
  }

  .kpi-card {
    width: clamp(112px, 44vw, 126px) !important;
    height: clamp(112px, 44vw, 126px) !important;
    padding: 0.4rem 0.25rem !important;
  }

  .kpi-value {
    font-size: 1.05rem !important;
  }

  #kpi-porcentaje {
    font-size: 1.12rem !important;
  }

  .badge-semaforo {
    font-size: 0.58rem !important;
    padding: 0.12rem 0.35rem !important;
    max-width: 96px !important;
  }

  .hero-kpi-bar {
    grid-template-columns: 1fr !important;
  }

  .table-toolbar .btn,
  .table-toolbar .btn-export {
    flex: 1 1 100% !important;
  }
}

/* --- 5. OBJETIVOS TÁCTILES OPTIMIZADOS (DISPOSITIVOS TOUCH) --- */
@media (hover: none) and (pointer: coarse) {
  button, 
  .btn, 
  .btn-nav, 
  .btn-hamburger, 
  select, 
  .form-select, 
  .badge-year-pill, 
  .tab-btn, 
  .admin-tab-btn {
    min-height: 42px;
  }

  .form-check-input {
    min-width: 20px;
    min-height: 20px;
  }
}

/* =======================================================================
   ESTILOS OFICIALES PARA REPORTE EN FORMATO A4 HORIZONTAL (LANDSCAPE)
   ======================================================================= */
.a4-page-container {
  width: 285mm;
  max-width: 285mm;
  margin: 0 auto;
  background: #ffffff;
  padding: 3mm 4mm;
  box-sizing: border-box;
  color: #0f172a;
}
.a4-header {
  border-bottom: 2px solid #0284c7;
  padding-bottom: 4px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.a4-brand-minsa {
  font-size: 7pt;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.a4-brand-ris {
  font-size: 11.5pt;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.3px;
  line-height: 1.15;
}
.a4-brand-title {
  font-size: 7.2pt;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
}
.a4-header-right {
  text-align: right;
  font-size: 7pt;
  color: #475569;
  line-height: 1.35;
}
.a4-indicator-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #0284c7;
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 5px;
}
.a4-badge-pp {
  font-size: 6.8pt;
  font-weight: 800;
  color: #0369a1;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.a4-indicator-name {
  font-size: 9.5pt;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.22;
}
.a4-definitions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 5px;
}
.a4-def-card {
  border-radius: 4px;
  padding: 4px 7px;
}
.a4-def-num {
  background: #f0f9ff;
  border: 1.2px solid #bae6fd;
}
.a4-def-den {
  background: #fefce8;
  border: 1.2px solid #fde047;
}
.a4-def-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 2px;
}
.a4-badge-def {
  font-size: 6.5pt;
  font-weight: 800;
  text-transform: uppercase;
}
.a4-header-num .a4-badge-def { color: #0369a1; }
.a4-header-den .a4-badge-def { color: #854d0e; }
.a4-def-type {
  font-size: 6.2pt;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.a4-def-content {
  color: #1e293b;
  font-size: 7.2pt;
  line-height: 1.3;
  font-weight: 500;
}
.a4-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.a4-kpi-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 5px;
  text-align: center;
}
.a4-kpi-label {
  font-size: 6.2pt;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.a4-kpi-val {
  font-size: 11.2pt;
  font-weight: 800;
  margin: 1px 0;
  line-height: 1.1;
}
.a4-kpi-sub {
  font-size: 6pt;
  color: #64748b;
}
.a4-semaforo-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 6.8pt;
  font-weight: 800;
}
.semaforo-verde-print { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.semaforo-amarillo-print { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.semaforo-rojo-print { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.semaforo-sin_datos-print { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.a4-charts-grid {
  display: grid;
  grid-template-columns: 1.68fr 1fr;
  gap: 7px;
  margin-bottom: 6px;
  align-items: stretch;
}
.a4-chart-box {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
.a4-chart-title {
  font-size: 7pt;
  font-weight: 800;
  color: #1e3a8a;
  text-transform: uppercase;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 2px;
  margin-bottom: 3px;
  text-align: center;
}
.a4-chart-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 175px;
}
.a4-chart-img {
  max-width: 100%;
  width: auto;
  height: 175px;
  object-fit: contain;
  display: block;
}
.a4-taco-img {
  max-width: 100%;
  width: auto;
  height: 120px;
  object-fit: contain;
  display: block;
}
.a4-taco-digital {
  font-size: 11pt;
  font-weight: 800;
  margin-top: 1px;
  line-height: 1;
}
.a4-taco-estado {
  font-size: 6.6pt;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  margin-top: 1px;
  display: inline-block;
}
.a4-signatures-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 5px;
  padding-top: 6px;
  page-break-inside: avoid;
}
.a4-sig-col {
  text-align: center;
}
.a4-sig-line {
  border-top: 1px dashed #64748b;
  margin-bottom: 2px;
}
.a4-sig-title {
  font-size: 7.2pt;
  font-weight: 800;
  color: #0f172a;
}
.a4-sig-sub {
  font-size: 6.2pt;
  color: #475569;
}
.a4-footer-note {
  margin-top: 4px;
  padding-top: 2px;
  border-top: 1px solid #e2e8f0;
  font-size: 6pt;
  color: #94a3b8;
  text-align: center;
}



