@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-primary: 'Outfit', sans-serif;
  --font-secondary: 'Plus Jakarta Sans', sans-serif;
  
  /* Executive High-Contrast BI Color Palette */
  --bg-dark: #070913;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  
  --primary: #38bdf8; /* Sky Blue Accent */
  --primary-glow: rgba(56, 189, 248, 0.15);
  --secondary: #818cf8; /* Indigo Accent */
  --secondary-glow: rgba(129, 140, 248, 0.15);
  --accent: #10b981; /* Emerald Accent */
  --accent-glow: rgba(16, 185, 129, 0.15);
  
  --text-white: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dark: #94a3b8;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(56, 189, 248, 0.4);
  
  /* Status Colors */
  --color-high: #f43f5e;   /* Rose Red */
  --color-medium: #f59e0b; /* Amber */
  --color-low: #10b981;    /* Emerald */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(217, 70, 239, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 70, 239, 0.5);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: rgba(8, 10, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px border-color var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

/* Executive process views */
.process-badge {
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.process-badge-blue { color: #7dd3fc; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.28); }
.process-badge-green { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.28); }
.process-intro {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 1.5rem;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.58);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.process-intro strong { color: var(--text-white); white-space: nowrap; }
.process-kpi-grid { margin-bottom: 1.5rem; }
.process-card-blue { border-color: rgba(56, 189, 248, 0.34) !important; background: linear-gradient(135deg, rgba(14, 116, 144, 0.2), rgba(15, 23, 42, 0.76)); }
.process-card-green { border-color: rgba(16, 185, 129, 0.34) !important; background: linear-gradient(135deg, rgba(6, 95, 70, 0.2), rgba(15, 23, 42, 0.76)); }
.process-card-gold { border-color: rgba(245, 158, 11, 0.34) !important; background: linear-gradient(135deg, rgba(146, 64, 14, 0.2), rgba(15, 23, 42, 0.76)); }
.process-card-red { border-color: rgba(244, 63, 94, 0.34) !important; background: linear-gradient(135deg, rgba(159, 18, 57, 0.2), rgba(15, 23, 42, 0.76)); }
.process-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.process-panel { padding: 1.35rem; background: rgba(15, 23, 42, 0.68); border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; }
.process-panel h3 { margin-bottom: 1rem; color: var(--text-white); font-size: 1rem; }
.process-step { display: flex; gap: 12px; align-items: flex-start; padding: 0.8rem 0; border-top: 1px solid rgba(255,255,255,0.07); }
.process-step:first-of-type { border-top: 0; }
.process-step > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: #07111d; background: var(--primary); font-weight: 800; }
.process-step strong, .process-step small { display: block; }
.process-step strong { color: var(--text-white); font-size: 0.88rem; }
.process-step small { margin-top: 3px; color: var(--text-dark); font-size: 0.78rem; line-height: 1.4; }
.process-action { display: block; width: 100%; margin: 0.65rem 0; padding: 0.8rem 0.9rem; border: 1px solid rgba(56,189,248,0.24); border-radius: 7px; background: rgba(56,189,248,0.08); color: #bae6fd; text-align: left; font: inherit; font-size: 0.84rem; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.process-action:hover { background: rgba(56,189,248,0.18); transform: translateX(3px); }
.process-footnote { margin-top: 1rem; color: var(--text-dark); font-size: 0.75rem; line-height: 1.45; }
@media (max-width: 900px) { .process-columns { grid-template-columns: 1fr; } .process-intro { display: block; } .process-intro span { display: block; margin-top: 5px; } }

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
  padding-left: 0.5rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--text-white);
}

.logo-text h1 {
  font-family: var(--font-secondary);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  transition: all 0.3s;
}

.nav-link:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--text-white);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}

.nav-link.active svg {
  stroke: var(--primary);
  filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.5));
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.db-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(20, 184, 166, 0.05);
  border: 1px solid rgba(20, 184, 166, 0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #5eead4;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 14px var(--accent); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  margin-left: 280px;
  padding: 2.5rem 3rem;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-title h2 {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-secondary);
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* View Pages */
.view-page {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom right, rgba(99, 102, 241, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.1);
  background: var(--bg-card-hover);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
}

.kpi-icon.primary { background: var(--primary-glow); color: var(--primary); }
.kpi-icon.secondary { background: var(--secondary-glow); color: var(--secondary); }
.kpi-icon.accent { background: var(--accent-glow); color: var(--accent); }
.kpi-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--color-medium); }

.kpi-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.kpi-info h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.kpi-info p {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-secondary);
}

/* Charts / Dashboard Content */
.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-row.equal {
  grid-template-columns: 1fr 1fr;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.75rem;
}

.chart-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-family: var(--font-secondary);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Tab Panels & Lists */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.2s;
}

.server-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.server-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.server-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.server-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* BI Reports List */
.reports-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

.reports-list-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-menu-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.report-menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.report-menu-item.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.report-menu-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.report-menu-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active Report Details */
.report-view-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.25rem;
  min-height: 500px;
}

.report-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.report-header h3 {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-secondary);
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.report-objective-box {
  background: rgba(255, 255, 255, 0.02);
  border-left: 4px solid var(--primary);
  padding: 12px 18px;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Database Relationship Flow Visualizer */
.relation-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.flow-node {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #a5b4fc;
}

.flow-node.highlight {
  background: rgba(217, 70, 239, 0.08);
  border-color: rgba(217, 70, 239, 0.3);
  color: #f5d0fe;
}

.flow-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   SISTEMA DE DISEÑO UNIFICADO DE TABLAS (DARK EXECUTIVE RAMÉDICAS)
   ══════════════════════════════════════════════════════════════ */
.data-grid-container,
.dim-table-container,
.dim-table-container-large,
.ger-modal-body-table {
  background: rgba(11, 17, 32, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) rgba(15, 23, 42, 0.6);
}

.data-grid-container::-webkit-scrollbar,
.dim-table-container::-webkit-scrollbar,
.dim-table-container-large::-webkit-scrollbar,
.ger-modal-body-table::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.data-grid-container::-webkit-scrollbar-track,
.dim-table-container::-webkit-scrollbar-track,
.dim-table-container-large::-webkit-scrollbar-track,
.ger-modal-body-table::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

.data-grid-container::-webkit-scrollbar-thumb,
.dim-table-container::-webkit-scrollbar-thumb,
.dim-table-container-large::-webkit-scrollbar-thumb,
.ger-modal-body-table::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}
.data-grid-container::-webkit-scrollbar-thumb:hover,
.dim-table-container::-webkit-scrollbar-thumb:hover,
.dim-table-container-large::-webkit-scrollbar-thumb:hover,
.ger-modal-body-table::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
}

/* Unified Tables Base */
.data-table,
.dim-compact-table,
.dim-ranking-table,
.cuotas-paf-table,
.cuotas-detail-table,
.ger-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.83rem;
  line-height: 1.45;
  text-align: left;
}

/* Sticky Headers */
.data-table thead,
.dim-compact-table thead,
.dim-ranking-table thead,
.cuotas-paf-table thead,
.cuotas-detail-table thead,
.ger-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table thead th,
.dim-compact-table thead th,
.dim-ranking-table thead th,
.cuotas-paf-table thead th,
.cuotas-detail-table thead th,
.ger-table thead th {
  background: #0b1322 !important;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 2px solid rgba(56, 189, 248, 0.4);
  white-space: nowrap;
  user-select: none;
}

/* Cell padding and borders */
.data-table td,
.dim-compact-table td,
.dim-ranking-table td,
.cuotas-paf-table td,
.cuotas-detail-table td,
.ger-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Zebra Striping */
.data-table tbody tr:nth-child(even),
.dim-compact-table tbody tr:nth-child(even),
.dim-ranking-table tbody tr:nth-child(even),
.cuotas-paf-table tbody tr:nth-child(even),
.cuotas-detail-table tbody tr:nth-child(even),
.ger-table tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.42);
}

.data-table tbody tr:nth-child(odd),
.dim-compact-table tbody tr:nth-child(odd),
.dim-ranking-table tbody tr:nth-child(odd),
.cuotas-paf-table tbody tr:nth-child(odd),
.cuotas-detail-table tbody tr:nth-child(odd),
.ger-table tbody tr:nth-child(odd) {
  background-color: rgba(10, 15, 29, 0.72);
}

/* Row Hover with Cyan Glow and Focus Anchor */
.data-table tbody tr:hover td,
.dim-compact-table tbody tr:hover td,
.dim-ranking-table tbody tr:hover td,
.cuotas-paf-table tbody tr:hover td,
.cuotas-detail-table tbody tr:hover td,
.ger-table tbody tr:hover td,
.cuotas-detail-row:hover td {
  background-color: rgba(56, 189, 248, 0.10) !important;
  color: #ffffff;
}

.data-table tbody tr:hover,
.dim-compact-table tbody tr:hover,
.dim-ranking-table tbody tr:hover,
.cuotas-paf-table tbody tr:hover,
.cuotas-detail-table tbody tr:hover,
.ger-table tbody tr:hover,
.cuotas-detail-row:hover {
  box-shadow: inset 4px 0 0 0 #38bdf8;
}

/* Cell Alignment & Format Classes */
.td-num,
td.td-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}

.td-code,
td.td-code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.td-date,
td.td-date {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  white-space: nowrap;
}

.td-center,
td.td-center {
  text-align: center !important;
}

.td-left,
td.td-left {
  text-align: left !important;
}

.td-highlight {
  font-weight: 700;
  color: #38bdf8;
}

/* Unified Status Badges */
.status-pill-success,
.cuotas-status-recaudado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

.status-pill-danger,
.cuotas-status-fuga {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.16);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.35);
  white-space: nowrap;
}

.status-pill-warning,
.cuotas-status-omision {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.status-pill-info,
.cuotas-status-exento {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.30);
  white-space: nowrap;
}

/* Skeleton Shimmer Loading Effect */
@keyframes tableShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.table-skeleton-row td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.skeleton-shimmer-bar {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(56, 189, 248, 0.12) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: tableShimmer 1.6s infinite ease-in-out;
}

/* Table Pagination Toolbar */
.table-pagination-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0b1322;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 0 0 12px 12px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.table-pagination-toolbar .pagination-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.table-pagination-toolbar .pagination-info strong,
.table-pagination-toolbar .pagination-info span {
  color: #f8fafc;
  font-weight: 700;
}

.table-pagination-toolbar .pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

.pagination-current-page {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  padding: 0 6px;
  white-space: nowrap;
}

.pagination-select {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.pagination-select:focus {
  border-color: #38bdf8;
}


/* Filter controls */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px 16px 12px 42px;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
}

.filter-select {
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  font-weight: 600;
}

.filter-select option {
  background: #0f172a;
  color: #ffffff;
  font-weight: 500;
}

/* Badges for priority */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.alta {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge.media {
  background: rgba(245, 158, 11, 0.12);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.baja {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Database schema visualizer styles */
.schema-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.schema-list-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.schema-search {
  margin-bottom: 1.25rem;
}

.table-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: 0.88rem;
}

.table-list-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
}

.table-list-item.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-white);
}

.table-list-item span.count {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 700;
}

/* Detail page styling */
.schema-detail-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.25rem;
  min-height: 500px;
}

.detail-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.detail-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-secondary);
}

.detail-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Info pill styles */
.info-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.info-pill {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-pill strong {
  color: var(--text-white);
}

/* ------------------------------------------------------------- */
/* ADVANCED AUTO-RESPONSIVE MEDIA QUERIES & MOBILE OPTIMIZATIONS */
/* ------------------------------------------------------------- */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1.25rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .logo-section {
    margin-bottom: 1.25rem;
  }

  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    width: auto;
    flex-shrink: 0;
  }

  .nav-link {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .sidebar-footer {
    display: none; /* Hidden on compact header */
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem;
    width: 100%;
  }

  .reports-layout, .schema-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dashboard-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .top-header h2 {
    font-size: 1.3rem !important;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
  }

  .controls-row > div {
    width: 100%;
    justify-content: space-between;
  }

  .filter-select {
    width: 100% !important;
    min-width: 100% !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .chart-card {
    padding: 1rem !important;
  }

  .data-table th, .data-table td {
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
  }

  .reports-list-panel, .schema-list-panel {
    max-height: 40vh;
  }

  button {
    width: 100%;
    justify-content: center;
  }
}

/* Small Screens / Compact Phones (<= 480px) */
@media (max-width: 480px) {
  .main-content {
    padding: 1rem 0.5rem;
  }

  .logo-text h1 {
    font-size: 1.1rem;
  }

  .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

/* ==========================================================================
   DIMENSIONAMIENTO Y ANALÍTICA DE TRÁFICO PAF - EXECUTIVE UI
   ========================================================================== */

/* Hero Header */
.dim-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dim-header-left {
  flex: 1;
  min-width: 320px;
}

.dim-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.dim-main-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
}

.dim-main-subtitle {
  font-size: 0.88rem;
  color: #94a3b8;
  max-width: 780px;
  line-height: 1.45;
}

.dim-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dim-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dim-btn-refresh {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.dim-btn-refresh:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.dim-btn-export {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}
.dim-btn-export:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  transform: translateY(-1px);
}

/* Selector Bar */
.dim-selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 1.5rem;
}

.dim-select-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 320px;
}

.dim-select-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.dim-select-wrapper {
  flex: 1;
  position: relative;
}

.dim-styled-select {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}
.dim-styled-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.dim-badges-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.dim-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
}

.dim-meta-pill.highlight {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.3);
  color: #c7d2fe;
}

/* KPI Grid */
.dim-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 1.5rem;
}

.dim-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.dim-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.dim-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.dim-kpi-card.card-blue::before { background: #38bdf8; }
.dim-kpi-card.card-emerald::before { background: #10b981; }
.dim-kpi-card.card-amber::before { background: #f59e0b; }
.dim-kpi-card.card-purple::before { background: #a855f7; }
.dim-kpi-card.card-rose::before { background: #f43f5e; }

.dim-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dim-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
}

.dim-kpi-icon {
  font-size: 1.1rem;
}

.dim-kpi-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.dim-kpi-card.card-blue .dim-kpi-num { color: #38bdf8; }
.dim-kpi-card.card-emerald .dim-kpi-num { color: #10b981; }
.dim-kpi-card.card-amber .dim-kpi-num { color: #fbbf24; }
.dim-kpi-card.card-purple .dim-kpi-num { color: #c084fc; }
.dim-kpi-card.card-rose .dim-kpi-num { color: #fb7185; }

.dim-kpi-foot {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabs Navigation */
.dim-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
  overflow-x: auto;
}

.dim-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.dim-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px 8px 0 0;
}

.dim-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 8px 8px 0 0;
}

.dim-tab-pane {
  display: none;
}
.dim-tab-pane.active {
  display: block;
}

/* Grid Layouts */
.dim-grid-2col {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 1.2rem;
}

@media (max-width: 1024px) {
  .dim-grid-2col {
    grid-template-columns: 1fr;
  }
}

.dim-card-panel {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 12px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
}

.dim-tag-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

.dim-text-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}
.dim-text-btn:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Chart Container */
.dim-chart-box {
  position: relative;
  height: 280px;
  margin-bottom: 1.2rem;
}

.dim-chart-box-large {
  position: relative;
  height: 380px;
}

/* Shifts Modern Cards */
.dim-shifts-wrapper {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
}

.shifts-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.dim-shifts-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.shift-card-modern {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
}

.shift-card-modern.morning { border-top: 3px solid #38bdf8; }
.shift-card-modern.peak { border-top: 3px solid #f59e0b; background: rgba(245, 158, 11, 0.08); }
.shift-card-modern.evening { border-top: 3px solid #818cf8; }
.shift-card-modern.total { border-top: 3px solid #10b981; background: rgba(16, 185, 129, 0.08); }

.shift-card-modern .shift-icon { font-size: 1.2rem; margin-bottom: 2px; }
.shift-card-modern .shift-name { font-size: 0.72rem; font-weight: 700; color: #cbd5e1; }
.shift-card-modern .shift-time { font-size: 0.65rem; color: #64748b; margin-bottom: 4px; }
.shift-card-modern .shift-count { font-size: 1.6rem; font-weight: 900; color: #f8fafc; line-height: 1; }
.shift-card-modern.peak .shift-count { color: #fbbf24; }
.shift-card-modern.total .shift-count { color: #34d399; }
.shift-card-modern .shift-unit { font-size: 0.65rem; color: #94a3b8; margin-top: 2px; }

/* Sliders Stack */
.dim-sliders-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.2rem;
}

.slider-box {
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
}

.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
}

.slider-val-pill {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 10px;
  border-radius: 6px;
}

.slider-styled {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  accent-color: #38bdf8;
}

.slider-subtext {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 4px;
}

/* Compact Table - Container Bounds */
.dim-table-container {
  overflow-y: auto;
  max-height: 240px;
}


/* Heatmap */
.heatmap-scrollable {
  overflow-x: auto;
  padding: 8px 0;
}

.heatmap-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.dot-low { background: rgba(56, 189, 248, 0.35); }
.dot-med { background: rgba(16, 185, 129, 0.65); }
.dot-high { background: rgba(245, 158, 11, 0.85); }
.dot-peak { background: rgba(244, 63, 94, 0.95); }

.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 14px;
}

.heatmap-table th {
  padding: 8px 4px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.72rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.heatmap-cell {
  padding: 10px 4px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.heatmap-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 5;
  outline: 1px solid rgba(255, 255, 255, 0.2);
}

/* Ranking Table Large */
.dim-search-input {
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f8fafc;
  padding: 8px 14px;
  font-size: 0.82rem;
  width: 220px;
  outline: none;
}
.dim-search-input:focus {
  border-color: #38bdf8;
}

.dim-table-container-large {
  overflow-y: auto;
  max-height: 520px;
}


.dim-btn-analizar {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dim-btn-analizar:hover {
  background: #38bdf8;
  color: #0b0f19;
}

/* Real Traffic Analytics Helpers */
.dim-hourly-brackets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 1.2rem;
}

.dim-bracket-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dim-bracket-card.highlight {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.bracket-badge {
  font-size: 0.78rem;
  font-weight: 700;
}
.bracket-badge.morning { color: #38bdf8; }
.bracket-badge.peak { color: #fbbf24; }
.bracket-badge.afternoon { color: #c084fc; }

.bracket-num {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.bracket-desc {
  font-size: 0.7rem;
  color: #94a3b8;
}

.daily-kpi-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.78rem;
}

.summary-lbl { color: #cbd5e1; font-weight: 600; }
.summary-val { font-weight: 800; font-size: 0.85rem; }
.text-amber { color: #fbbf24; }
.text-emerald { color: #34d399; }
.text-purple { color: #c084fc; }

.summary-lbl { color: #cbd5e1; font-weight: 600; }
.summary-val { font-weight: 800; font-size: 0.85rem; }
.text-amber { color: #fbbf24; }
.text-emerald { color: #34d399; }
.text-purple { color: #c084fc; }

/* ══════════════════════════════════════════════════════
   HISTÓRICO & COMPORTAMIENTOS — Styles
   ══════════════════════════════════════════════════════ */

/* Filter bar */
.hist-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 1.4rem;
}

.hist-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hist-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hist-date-input {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.hist-date-input:focus {
  outline: none;
  border-color: #38bdf8;
}
.hist-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.hist-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.hist-apply-btn:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
}

/* Tabs override — reuse .dim-tabs-nav but reset border for hist */
.hist-tabs-nav {
  margin-bottom: 1.4rem !important;
}

/* Compare row */
.hist-compare-row {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 1.2rem;
}

.hist-compare-selectors {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hist-selector-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hist-period-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hist-period-label.period-a { color: #38bdf8; }
.hist-period-label.period-b { color: #f59e0b; }

.hist-period-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 8px 12px;
  cursor: pointer;
  min-width: 170px;
}
.hist-period-select:focus { outline: none; border-color: #38bdf8; }

.hist-vs-badge {
  font-size: 0.78rem;
  font-weight: 900;
  color: #64748b;
  padding: 0 4px 8px;
  letter-spacing: 1px;
}

.hist-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.hist-compare-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(245, 158, 11, 0.25));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

/* KPI Compare Panels */
.hist-kpi-compare-panels {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hist-kpi-panel {
  flex: 1;
  min-width: 220px;
  background: rgba(30, 41, 59, 0.4);
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}
.hist-kpi-panel.panel-a { border-top: 3px solid #38bdf8; }
.hist-kpi-panel.panel-b { border-top: 3px solid #f59e0b; }

.hist-kpi-panel-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.panel-a .hist-kpi-panel-title { color: #38bdf8; }
.panel-b .hist-kpi-panel-title { color: #f59e0b; }

.hist-kpi-panel-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hist-kpi-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.hist-kpi-panel-row .hist-kpi-row-label { color: #94a3b8; }
.hist-kpi-panel-row .hist-kpi-row-value { font-weight: 800; color: #f8fafc; }

.hist-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 10px;
}
.hist-delta-badge.up { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.hist-delta-badge.down { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.hist-delta-badge.neutral { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }

/* Accordion */
.hist-accordion {
  margin-top: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
}

.hist-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.hist-accordion-trigger:hover {
  background: rgba(56, 189, 248, 0.07);
  color: #38bdf8;
}
.hist-accordion-trigger.open svg {
  transform: rotate(180deg);
}
.hist-accordion-trigger svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.hist-accordion-body {
  padding: 18px;
  background: rgba(11, 15, 25, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hourly controls inside accordion */
.hist-hourly-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.hist-hourly-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.hist-granularity-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.hist-granularity-btn.active,
.hist-granularity-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Responsive */
@media (max-width: 900px) {
  .hist-filter-bar { gap: 10px; }
  .hist-kpi-compare-panels { flex-direction: column; }
  .hist-compare-selectors { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════════
   PUNTO CONTROL CUOTA MODERADORA (PROPIO ADN)
   ══════════════════════════════════════════════════════════════════ */
.cuotas-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.95) 45%, rgba(244, 63, 94, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.cuotas-hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #f43f5e);
}
.cuotas-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.cuotas-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: cuotasPulse 2s infinite;
}
@keyframes cuotasPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.cuotas-main-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.4rem 0;
  letter-spacing: -0.5px;
}
.cuotas-main-subtitle {
  font-size: 0.86rem;
  color: #94a3b8;
  max-width: 820px;
  line-height: 1.5;
  margin: 0;
}
.cuotas-main-subtitle strong {
  color: #f1f5f9;
}

/* Filter Bar */
.cuotas-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 1rem 1.4rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}
.cuotas-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cuotas-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cuotas-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s;
  align-self: flex-end;
  height: 38px;
}
.cuotas-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  filter: brightness(1.08);
}

/* KPI Grid */
.cuotas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.cuotas-kpi-card {
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cuotas-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.cuotas-kpi-card.kpi-card-emerald {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.cuotas-kpi-card.kpi-card-blue {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.cuotas-kpi-card.kpi-card-rose {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.cuotas-kpi-card.kpi-card-amber {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.cuotas-kpi-card.kpi-card-purple {
  border-color: rgba(168, 85, 247, 0.3);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.cuotas-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cuotas-kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cuotas-kpi-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}
.cuotas-badge-green { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.cuotas-badge-blue { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.cuotas-badge-red { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.cuotas-badge-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.cuotas-badge-purple { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.cuotas-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  letter-spacing: -0.4px;
}
.cuotas-kpi-sub {
  font-size: 0.73rem;
  color: #64748b;
  font-weight: 500;
}

/* Visual Row (Charts) */
.cuotas-visual-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 1.5rem;
}
@media (max-width: 1024px) {
  .cuotas-visual-row { grid-template-columns: 1fr; }
}
.cuotas-card-panel {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.3rem;
  backdrop-filter: blur(12px);
}
.cuotas-badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: #94a3b8;
}
.cuotas-badge-paf-selected {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 9999px;
  color: #34d399;
}
.cuotas-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
}
.cuotas-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
}
.cuotas-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
}

/* Tables Styling */
.cuotas-table-search-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.8rem;
  padding: 6px 12px;
  outline: none;
  transition: all 0.2s;
}
.cuotas-table-search-input:focus {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.cuotas-paf-row {
  cursor: pointer;
  transition: background 0.15s;
}
.cuotas-paf-row:hover {
  background: rgba(16, 185, 129, 0.08) !important;
}
.cuotas-btn-audit {
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  cursor: pointer;
  transition: all 0.15s;
}
.cuotas-btn-audit:hover {
  background: #10b981;
  color: #ffffff;
}

.cuotas-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}
.cuotas-status-fuga {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.cuotas-status-omision {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.cuotas-status-recaudado {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.cuotas-status-exento {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.cuotas-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}
.cuotas-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ==========================================================================
   DASHBOARD GERENCIAL - DISPENSACIÓN (DARK EXECUTIVE BI PALETTE)
   Unified with Ramedicas BI Dark Aesthetic
   ========================================================================== */

#gerencial-page {
  background-color: transparent;
  color: var(--text-white);
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-secondary), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
}

/* Top Header Bar */
.ger-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.ger-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ger-header-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.4px;
  margin: 0;
}

.ger-header-subtitle {
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 500;
  margin: 0;
}

.ger-header-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.ger-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ger-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ger-date-input,
.ger-styled-select {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.ger-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

.ger-styled-select {
  cursor: pointer;
}

.ger-styled-select option {
  background: #0f172a;
  color: #f8fafc;
}

.ger-date-input:focus,
.ger-styled-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.ger-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 40px;
  padding: 5px 14px 5px 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ger-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #070913;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.ger-user-info {
  display: flex;
  flex-direction: column;
}

.ger-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.15;
}

.ger-user-role {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 500;
}

/* Executive KPI Grid (5 Cards) */
.ger-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ger-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ger-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ger-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.ger-kpi-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ger-kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ger-icon-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.ger-icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.ger-icon-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.ger-icon-purple { background: rgba(129, 140, 248, 0.15); color: #818cf8; }

.ger-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.ger-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.ger-kpi-pct-label {
  font-size: 0.76rem;
  color: var(--text-dark);
  font-weight: 600;
}

.ger-kpi-footer {
  display: flex;
  align-items: center;
}

.ger-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ger-trend-up,
.ger-trend-down-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ger-trend-down-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Grid Layout Rows */
.ger-grid-row-2 {
  display: grid;
  grid-template-columns: 64% calc(36% - 1rem);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ger-grid-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Executive Dark Cards */
.ger-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.35rem 1.45rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

.ger-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ger-card-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ger-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
}

.ger-card-subtitle {
  font-size: 0.76rem;
  color: var(--text-dark);
  font-weight: 500;
}

.ger-card-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ger-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ger-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-blue { background: #38bdf8; }
.dot-green { background: #10b981; }
.dot-amber { background: #f59e0b; }
.dot-purple { background: #818cf8; }
.dot-teal { background: #06b6d4; }

/* Tendencia Chart Container */
.ger-trend-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

/* Donut EPS Container */
.ger-eps-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 100%;
}

.ger-donut-box {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.ger-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.ger-donut-center-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
}

.ger-donut-center-lbl {
  font-size: 0.68rem;
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
}

.ger-eps-table-box {
  flex: 1;
}

.ger-eps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ger-eps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.77rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ger-eps-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #cbd5e1;
}

.ger-eps-row-nums {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ger-eps-pct {
  font-weight: 700;
  color: #f8fafc;
}

.ger-eps-count {
  font-size: 0.72rem;
  color: var(--text-dark);
  font-weight: 500;
}

/* Top 5 Medicamentos Ranked List */
.ger-top-meds-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.ger-top-med-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ger-top-med-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.79rem;
}

.ger-top-med-rank {
  font-weight: 700;
  color: #38bdf8;
  margin-right: 5px;
}

.ger-top-med-name {
  font-weight: 600;
  color: #cbd5e1;
}

.ger-top-med-units {
  font-weight: 700;
  color: #f8fafc;
}

.ger-top-med-sub {
  font-size: 0.72rem;
  color: var(--text-dark);
  margin-left: 4px;
}

.ger-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.ger-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

/* Incidencias List */
.ger-incidents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.ger-incident-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.ger-incident-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ger-incident-desc {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
}

.ger-incident-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

.ger-incident-right {
  display: flex;
  align-items: baseline;
  gap: 5px;
  text-align: right;
}

.ger-incident-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f43f5e;
}

.ger-incident-pct {
  font-size: 0.72rem;
  color: var(--text-dark);
  font-weight: 600;
}

/* Map & Sede Section */
.ger-map-layout {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 100%;
}

.ger-map-svg-box {
  width: 130px;
  height: 160px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ger-colombia-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.25));
}

.ger-map-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #070913;
  box-shadow: 0 0 10px #38bdf8;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ger-map-dot:hover {
  transform: scale(1.4);
  box-shadow: 0 0 16px #38bdf8, 0 0 0 4px rgba(56, 189, 248, 0.4);
}

.ger-map-dot-bogota { top: 56%; left: 47%; }
.ger-map-dot-medellin { top: 43%; left: 36%; }
.ger-map-dot-cali { top: 62%; left: 31%; }
.ger-map-dot-barranquilla { top: 16%; left: 42%; }
.ger-map-dot-bucaramanga { top: 38%; left: 52%; }

.ger-sede-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ger-sede-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ger-sede-name {
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ger-sede-val {
  font-weight: 700;
  color: #f8fafc;
}

.ger-sede-sub {
  font-size: 0.7rem;
  color: var(--text-dark);
  margin-left: 4px;
}

/* Autorizaciones Stats Row */
.ger-auth-stats {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.ger-auth-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  flex: 1;
  text-align: center;
}

.ger-auth-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.ger-auth-stat-lbl {
  font-size: 0.66rem;
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
}

.ger-stat-green { color: #10b981 !important; }
.ger-stat-red { color: #f43f5e !important; }

/* Quick Action Buttons */
.ger-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.ger-action-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  color: #f8fafc;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ger-action-card-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: #38bdf8;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.ger-action-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ger-action-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ger-action-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ger-action-btn-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
}

.ger-action-btn-desc {
  font-size: 0.71rem;
  color: var(--text-dark);
  font-weight: 500;
}

.ger-action-btn-arrow {
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ger-action-card-btn:hover .ger-action-btn-arrow {
  color: #38bdf8;
  transform: translateX(2px);
}

/* Executive Footer */
.ger-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.ger-footer-brand {
  font-weight: 600;
  color: var(--text-dark);
}

.ger-footer-tagline {
  font-weight: 600;
  color: #38bdf8;
}

/* Patient Detail Modal */
.ger-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.ger-modal-overlay.active {
  display: flex;
}

.ger-modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 950px;
  max-height: 85vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ger-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ger-modal-head-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.ger-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.2s;
}

.ger-modal-close-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.15);
}

.ger-modal-search-row {
  display: flex;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}

.ger-modal-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.ger-modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.ger-modal-body-table {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem 1.5rem 1.5rem;
  max-height: 60vh;
}


/* Sidebar Light adjustments for Ramedicas brand */
.sidebar .logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-heart {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.sidebar-bottom-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

.sidebar-bottom-info-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.sidebar-bottom-info-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .sidebar, .ger-header-controls, .ger-action-card-btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  #gerencial-page {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
}

