/* ============================================
   LAYOUT PRINCIPAL - CIMA Dashboard
   ============================================ */

/* Reset base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: var(--color-bg-main);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}


/* ============================================
   ESTRUCTURA PRINCIPAL
   ============================================ */

.main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg-main);
}


/* ============================================
   HEADER
   ============================================ */

.header {
  padding: var(--space-xl) var(--space-2xl);
  background: var(--color-white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.header-left h1 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.3px;
}

.header-left p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Botón de notificaciones en header */
.header-notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-light);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 18px;
}

.header-notification-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-navy);
}

.header-notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: var(--radius-full);
  border: 2px solid white;
}

/* ============================================
   DASHBOARD / CONTENIDO PRINCIPAL
   ============================================ */

.dashboard {
  flex: 1;
  padding: var(--space-xl) var(--space-2xl);
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Vistas */
.view {
  display: none;
  animation: fadeInUp 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.card-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

/* ============================================
   GRID DEL DASHBOARD DE INICIO
   ============================================ */


/* ============================================
   ALERTAS
   ============================================ */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: fadeInDown 0.3s ease;
}

.alert-persistent {
  background: linear-gradient(135deg, rgba(0,86,179,0.08), rgba(0,86,179,0.04));
  border: 1px solid rgba(0,86,179,0.15);
  color: var(--color-navy);
}

/* ============================================
   TARJETA DE PERFIL
   ============================================ */

.profile-card {
  background: linear-gradient(135deg, var(--color-navy) 0%, #0056b3 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  color: white;
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: 0 8px 24px rgba(0,31,63,0.25);
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
}

.profile-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -20px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-full);
}

.profile-photo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-md);
}

.profile-photo-wrapper img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-xs) 0;
  color: white;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.profile-meta-item {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

/* ============================================
   UTILIDADES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-navy { color: var(--color-navy); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 320px;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-right {
    position: static;
  }
}

@media (max-width: 768px) {
  .main {
    margin-left: 0;
    margin-top: 60px;
  }

  .header {
    padding: var(--space-md) var(--space-lg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  .header-left h1 {
    font-size: var(--font-size-xl);
  }

  .dashboard {
    padding: var(--space-md) var(--space-lg);
  }
}

@media (max-width: 480px) {
  .dashboard {
    padding: var(--space-md);
  }

  .header {
    padding: var(--space-sm) var(--space-md);
  }
} 

/* FIX CRÍTICO CIMA — restaurar render correcto */

.content {
  display: block;
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg-main);
}

.main {
  display: block;
  width: 100%;
  background: var(--color-bg-main);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

