/**
 * Estilos principales del sistema CGNAT
 * Traficlog - Versión Full Width & White User Fix
 */

/* ============================================================================
   VARIABLES CSS
   ============================================================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --white: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.2);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ============================================================================
   BASE
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================================================
   LAYOUT - ANCHO COMPLETO
   ============================================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.main-content {
    flex: 1;
    padding: 0 !important; /* Eliminamos padding para que el contenido respire a lo ancho */
    overflow-y: auto;
    width: 100%;
    max-width: 100% !important;
}

/* ============================================================================
   SIDEBAR & USER INFO - ✅ CORRECCIÓN COLOR BLANCO
   ============================================================================ */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    border-bottom: 1px solid var(--gray-light);
}

/* Contenedor de usuario con degradado */
.user-info-sidebar {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
}

/* FORZAR BLANCO SIEMPRE para el nombre y el rol */
.user-info-sidebar, 
.user-info-sidebar .fw-bold, 
.user-info-sidebar div, 
.user-info-sidebar span,
.user-info-sidebar i {
    color: var(--white) !important;
}

/* Ajuste para el texto "Administrador" (badge) */
.user-info-sidebar .badge, 
.user-info-sidebar .small {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #4b5563;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link.active, .nav-link:hover {
    background: linear-gradient(90deg, #eef2ff 0%, transparent 100%);
    color: var(--primary) !important;
}

/* ============================================================================
   CARDS & IFRAME - OPTIMIZADO MONITOR
   ============================================================================ */
.dashboard-card {
    background: var(--white);
    border-radius: 0; /* Sin bordes redondeados para aprovechar cada pixel */
    margin-bottom: 0;
    box-shadow: none;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.card-header-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.card-body-custom.iframe-container {
    padding: 0 !important;
    flex: 1;
}

.iframe-container iframe {
    border: none;
    width: 100% !important;
    height: 100% !important;
    min-height: 90vh;
    display: block;
}

/* ============================================================================
   STAT CARDS (Para otros módulos)
   ============================================================================ */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--gray-light);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .main-content { padding: 0; }
}
