@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES (MULTI-PROJECT PMO COMMAND CENTER)
   ========================================================================== */
:root {
  /* Canvas & Backgrounds */
  --bg-app: #FAF7FD;
  --bg-main: #FFFFFF;
  --surface-subtle: #FBFBFE;
  --surface-lavender: #EAE0F2;
  --surface-lavender-subtle: #F4EDFA;
  --sidebar-bg: #E3D6ED;
  --sidebar-item-hover: rgba(109, 38, 201, 0.08);

  /* Primary Brand Colors */
  --purple-main: #6C20C8;
  --purple-dark: #5413A8;
  --purple-capsule: #6419B8;
  --purple-active-pill: #6D26C9;
  --purple-light: #F0E6FA;
  --purple-glow: rgba(108, 32, 200, 0.28);

  /* Secondary Accents */
  --gold-main: #E5AA3F;
  --gold-light: #F4C95D;
  --gold-glow: rgba(229, 170, 63, 0.28);
  
  --teal-main: #159D9A;
  --teal-light: #3BB7AD;
  --teal-accent: #4CBDB4;
  --teal-glow: rgba(21, 157, 154, 0.25);

  /* Status Colors */
  --status-vigilancia: #D9822B;
  --status-vigilancia-bg: #FFF5E5;
  --status-vigilancia-border: #F7D7A3;

  --status-critico: #E03137;
  --status-critico-bg: #FEECEE;
  --status-critico-border: #F8B4B7;

  --status-cumple: #10B981;
  --status-cumple-bg: #EDF9F4;
  --status-cumple-border: #A7F3D0;

  /* Typography & Neutral Colors */
  --text-main: #2A2533;
  --text-muted: #8E8799;
  --text-light: #7E6DA3;
  --text-white: #FFFFFF;
  --border-subtle: rgba(108, 32, 200, 0.07);
  --border-card: rgba(108, 32, 200, 0.08);
  --border-light: rgba(255, 255, 255, 0.8);

  /* Shadows */
  --shadow-card-purple: 0 14px 28px -6px rgba(100, 25, 184, 0.35);
  --shadow-card-gold: 0 12px 24px -6px rgba(229, 170, 63, 0.3);
  --shadow-card-teal: 0 12px 24px -6px rgba(21, 157, 154, 0.3);
  --shadow-soft: 0 6px 18px rgba(108, 32, 200, 0.05);

  /* Radii */
  --radius-card: 20px;
  --radius-capsule: 28px;
  --radius-pill: 9999px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Transitions */
  --trans-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-lavender-subtle);
}
::-webkit-scrollbar-thumb {
  background: #C4B5DC;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #A794C7;
}

/* ==========================================================================
   EDGE-TO-EDGE DASHBOARD CONTAINER (3-ZONE COCKPIT)
   ========================================================================== */
.app-viewport {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  overflow: hidden;
}

.dashboard-container {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  border-radius: 0;
  box-shadow: none;
  border: none;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 380px;
  overflow: hidden;
}

@media (max-width: 1400px) {
  .dashboard-container {
    grid-template-columns: 88px minmax(0, 1fr) 340px;
  }
}

@media (max-width: 1100px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

/* ==========================================================================
   1. SIDEBAR IZQUIERDO
   ========================================================================== */
.sidebar {
  background: var(--sidebar-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0.4rem;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  z-index: 10;
}

@media (max-width: 1100px) {
  .sidebar {
    display: none;
  }
}

.sidebar-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-main) 100%);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card-purple);
  cursor: pointer;
  transition: transform var(--trans-fast);
  margin-bottom: 0.5rem;
}

.sidebar-brand-icon:hover {
  transform: scale(1.05);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  flex: 1;
}

.nav-item {
  width: 76px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--trans-fast);
  position: relative;
  user-select: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.nav-item .nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--purple-main);
  background: var(--sidebar-item-hover);
}

.nav-item.active {
  background: var(--purple-active-pill);
  color: var(--text-white);
  box-shadow: 0 6px 16px rgba(109, 38, 201, 0.35);
}

.nav-item.active:hover {
  background: var(--purple-active-pill);
  color: var(--text-white);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(108, 32, 200, 0.08);
  width: 100%;
}

/* ==========================================================================
   2. ÁREA CENTRAL PRINCIPAL
   ========================================================================== */
.main-center-area {
  height: 100vh;
  padding: 1.25rem 2.25rem 2rem 2.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-main);
  position: relative;
}

/* Header & Project Selector */
.center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(108, 32, 200, 0.06);
  flex-shrink: 0;
}

.header-left-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 320px;
}

/* Project Selector Dropdown */
.project-selector-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
}

.project-select-custom {
  width: 100%;
  background: linear-gradient(135deg, #FAF4FF 0%, #F1E5FB 100%);
  border: 1.5px solid rgba(108, 32, 200, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.6rem 2.2rem 0.6rem 2.4rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--purple-dark);
  outline: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108, 32, 200, 0.08);
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--trans-fast);
}

.project-select-custom:hover, .project-select-custom:focus {
  background: #FFFFFF;
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px rgba(108, 32, 200, 0.15);
}

.project-selector-icon-left {
  position: absolute;
  left: 0.9rem;
  color: var(--purple-main);
  pointer-events: none;
}

.project-selector-icon-right {
  position: absolute;
  right: 0.9rem;
  color: var(--purple-main);
  pointer-events: none;
}

.search-box-wrapper {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-wrapper svg {
  position: absolute;
  left: 1rem;
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  background: var(--surface-lavender-subtle);
  border: 1px solid rgba(108, 32, 200, 0.08);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.25rem 0.6rem 2.5rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
  transition: var(--trans-fast);
}

.search-input:focus {
  background: #FFFFFF;
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px rgba(108, 32, 200, 0.12);
}

.header-right-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface-lavender-subtle);
  color: var(--purple-main);
  border: 1px solid rgba(108, 32, 200, 0.1);
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.4rem;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F4C95D 0%, #E5AA3F 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #5413A8;
  box-shadow: 0 4px 10px rgba(229, 170, 63, 0.25);
  font-size: 0.9rem;
}

.user-greeting-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.user-name-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   WELCOME EMPTY STATE ONBOARDING (ESTADO INICIAL LIMPIO)
   ========================================================================== */
.welcome-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1.75rem;
  background: linear-gradient(135deg, #FAF7FD 0%, #F5ECFB 100%);
  border: 2px dashed #C4B5DC;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 30px rgba(108, 32, 200, 0.05);
  animation: fadeIn 0.3s ease-out;
  margin-top: 1rem;
}

.welcome-icon-capsule {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-main) 100%);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card-purple);
}

.welcome-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--purple-dark);
  letter-spacing: -0.4px;
}

.welcome-subtitle {
  font-size: 0.9rem;
  color: var(--text-main);
  max-width: 620px;
  line-height: 1.6;
}

.welcome-dropzone-hero {
  width: 100%;
  max-width: 600px;
  border: 2px dashed var(--purple-main);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-card);
  padding: 2.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.welcome-dropzone-hero:hover, .welcome-dropzone-hero.dragover {
  background: #FFFFFF;
  border-color: var(--purple-dark);
  box-shadow: 0 8px 24px rgba(108, 32, 200, 0.15);
  transform: translateY(-2px);
}

.welcome-actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   VIEW PANES
   ========================================================================== */
.views-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view-pane {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.25s ease-in-out;
}

.view-pane.active {
  display: flex;
}

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

/* View Pane Heading */
.view-heading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(108, 32, 200, 0.06);
}

.view-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-number-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--purple-main);
  background: var(--purple-light);
  border: 1px solid rgba(108, 32, 200, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
}

.view-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.view-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.view-actions-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ==========================================================================
   GUÍA DE INTERPRETACIÓN
   ========================================================================== */
.btn-guide-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, #F0E6FA 0%, #E9DDF0 100%);
  color: var(--purple-dark);
  border: 1px solid rgba(108, 32, 200, 0.18);
  box-shadow: 0 2px 8px rgba(108, 32, 200, 0.08);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-guide-pill svg {
  width: 15px;
  height: 15px;
  color: var(--purple-main);
}

.btn-guide-pill:hover {
  background: linear-gradient(135deg, var(--purple-main) 0%, var(--purple-dark) 100%);
  color: var(--text-white);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(108, 32, 200, 0.25);
  transform: translateY(-1px);
}

.btn-guide-pill:hover svg {
  color: var(--text-white);
}

.btn-guide-pill.active {
  background: var(--purple-dark);
  color: var(--text-white);
  border-color: transparent;
}
.btn-guide-pill.active svg {
  color: var(--gold-light);
}

/* Guide Accordion Box */
.guide-accordion-box {
  display: none;
  background: linear-gradient(135deg, #FAF7FD 0%, #F5ECFB 100%);
  border: 1px solid rgba(108, 32, 200, 0.15);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(108, 32, 200, 0.08);
  animation: slideDown 0.28s ease-out;
  position: relative;
  overflow: hidden;
}

.guide-accordion-box.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(108, 32, 200, 0.1);
  padding-bottom: 0.65rem;
}

.guide-badge-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--purple-dark);
}

.btn-guide-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: var(--trans-fast);
}

.btn-guide-close:hover {
  background: rgba(108, 32, 200, 0.1);
  color: var(--purple-dark);
}

.guide-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 1rem;
}

@media (max-width: 1100px) {
  .guide-grid-3 {
    grid-template-columns: 1fr;
  }
}

.guide-card-item {
  background: #FFFFFF;
  border: 1px solid rgba(108, 32, 200, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 2px 10px rgba(90, 50, 140, 0.03);
}

.guide-card-icon-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guide-card-icon-title.purple { color: var(--purple-main); }
.guide-card-icon-title.gold { color: #B36800; }
.guide-card-icon-title.teal { color: #0F766E; }

.guide-card-body-text {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.5;
}

.guide-card-list {
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */

/* 3 Crypto/Executive Summary Cards Row */
.executive-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .executive-cards-row {
    grid-template-columns: 1fr;
  }
}

.exec-card {
  border-radius: var(--radius-card);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.exec-card:hover {
  transform: translateY(-2px);
}

.exec-card-purple {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-main) 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-card-purple);
}

.exec-card-gold {
  background: linear-gradient(135deg, #D9822B 0%, #F4C95D 100%);
  color: #381E04;
  box-shadow: var(--shadow-card-gold);
}

.exec-card-teal {
  background: linear-gradient(135deg, #0F766E 0%, #2DD4BF 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-card-teal);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.card-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-number-val {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
}

.card-label-sub {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.9;
}

/* White Section Card */
.white-section-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1000px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

/* Chart Wrapper */
.chart-box-container {
  position: relative;
  width: 100%;
  min-height: 260px;
  max-height: 300px;
}

/* Verdict & Central Question Banner */
.verdict-banner-box {
  background: var(--surface-lavender-subtle);
  border: 1px solid rgba(108, 32, 200, 0.12);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.verdict-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verdict-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFF5E5;
  color: #D9822B;
  border: 1px solid #F7D7A3;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.root-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.root-tag-item {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  border: 1px solid rgba(108, 32, 200, 0.08);
  color: var(--text-main);
}

.root-tag-item.red {
  background: var(--status-critico-bg);
  border-color: var(--status-critico-border);
  color: var(--status-critico);
}

.root-tag-item.amber {
  background: var(--status-vigilancia-bg);
  border-color: var(--status-vigilancia-border);
  color: var(--status-vigilancia);
}

.root-tag-item.teal {
  background: #EDF9F8;
  border-color: #A3E5E3;
  color: var(--teal-main);
}

/* Anomaly Alert Banner */
.anomaly-alert-box {
  background: #FFF8EB;
  border-left: 4px solid var(--status-vigilancia);
  border-radius: var(--radius-xs);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.84rem;
  color: #593A0E;
  line-height: 1.5;
}

/* Tables in Luxury Pastel */
.pastel-table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(108, 32, 200, 0.06);
}

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

.pastel-table th {
  background: var(--surface-lavender-subtle);
  color: var(--text-light);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(108, 32, 200, 0.08);
  white-space: nowrap;
}

.pastel-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(108, 32, 200, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.pastel-table tbody tr:hover {
  background: rgba(108, 32, 200, 0.02);
}

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-critico { background: var(--status-critico-bg); color: var(--status-critico); border: 1px solid var(--status-critico-border); }
.pill-alto { background: #FFF0E6; color: #E05D1A; border: 1px solid #FBD0B7; }
.pill-medio { background: var(--status-vigilancia-bg); color: var(--status-vigilancia); border: 1px solid var(--status-vigilancia-border); }
.pill-cumple { background: var(--status-cumple-bg); color: var(--status-cumple); border: 1px solid var(--status-cumple-border); }
.pill-en-curso { background: #EDF9F8; color: var(--teal-main); border: 1px solid #B8ECE9; }
.pill-pendiente { background: var(--surface-lavender-subtle); color: var(--text-muted); border: 1px solid rgba(108,32,200,0.06); }
.pill-nodata { background: #F3F4F6; color: #9CA3AF; border: 1px dashed #D1D5DB; }

/* Interactive Simulator */
.sim-controls-panel {
  background: var(--surface-lavender-subtle);
  border: 1px solid rgba(108, 32, 200, 0.08);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-slider-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sim-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #D8C7EB;
  outline: none;
}

.sim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--purple-main);
  cursor: pointer;
  box-shadow: 0 0 8px var(--purple-glow);
}

.sim-output-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 800px) {
  .sim-output-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sim-stat-box {
  background: #FFFFFF;
  border: 1px solid rgba(108, 32, 200, 0.08);
  border-radius: var(--radius-xs);
  padding: 0.75rem;
  text-align: center;
}

.sim-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple-main);
}

.sim-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==========================================================================
   3. PANEL LATERAL DERECHO (28-30%)
   ========================================================================== */
.right-panel {
  background: var(--surface-lavender);
  height: 100vh;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-left: 1px solid var(--border-subtle);
  z-index: 10;
}

@media (max-width: 1100px) {
  .right-panel {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    height: auto;
  }
}

.health-capsule-card {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-capsule) 100%);
  border-radius: var(--radius-card);
  padding: 1.4rem;
  color: var(--text-white);
  box-shadow: var(--shadow-card-purple);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.capsule-top-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.gauge-donut-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0.35rem 0 0.85rem;
}

.gauge-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 10;
}

.donut-val {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 1s ease-in-out;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-num {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.donut-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Action Buttons */
.action-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--trans-fast);
  text-decoration: none;
}

.btn-pill-gold {
  background: var(--gold-main);
  color: #381E04;
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-pill-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.btn-pill-teal {
  background: var(--teal-main);
  color: var(--text-white);
  box-shadow: 0 4px 14px var(--teal-glow);
}

.btn-pill-teal:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
}

/* Right Metric Cards */
.right-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.right-metric-card {
  background: #FFFFFF;
  border: 1px solid rgba(108, 32, 200, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: var(--shadow-soft);
  transition: transform var(--trans-fast);
}

.right-metric-card:hover {
  transform: translateY(-1px);
}

.metric-icon-square {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.metric-icon-square.purple { background: var(--purple-light); color: var(--purple-dark); }
.metric-icon-square.gold { background: #FFF3D6; color: #B36800; }
.metric-icon-square.teal { background: #E0F5F4; color: #0F766E; }
.metric-icon-square.red { background: #FEECEE; color: var(--status-critico); }

.metric-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.metric-label-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-light);
}

.metric-value-main {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

.metric-detail-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PORTFOLIO CONSOLIDATED VIEW STYLES
   ========================================================================== */
.portfolio-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .portfolio-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portfolio-stat-card {
  background: var(--surface-lavender-subtle);
  border: 1px solid rgba(108, 32, 200, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portfolio-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple-dark);
}

.portfolio-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(42, 37, 51, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card-box {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px rgba(80, 50, 120, 0.25);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform var(--trans-normal);
}

.modal-overlay.active .modal-card-box {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: var(--surface-lavender-subtle);
  border-bottom: 1px solid rgba(108, 32, 200, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--surface-lavender-subtle);
  border-top: 1px solid rgba(108, 32, 200, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Dropzone */
.dropzone-box {
  border: 2px dashed #C4B5DC;
  border-radius: var(--radius-sm);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface-lavender-subtle);
  cursor: pointer;
  transition: var(--trans-fast);
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--purple-main);
  background: #F0E6FA;
}

/* Printable Dossier */
.executive-dossier-print {
  background: #FFFFFF;
  color: #2A2533;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media print {
  body {
    background: #FFFFFF !important;
  }
  .sidebar, .right-panel, .btn-guide-pill, .guide-accordion-box, .modal-footer, .header-right-meta, .project-selector-wrapper {
    display: none !important;
  }
  .dashboard-container {
    grid-template-columns: 1fr !important;
  }
}
