/**
 * assets/estilos-sistema.css
 * Hojas de estilo globales adaptadas a la identidad visual CFTA
 */

:root {
    /* Colores Principales CFTA */
    --primary: #354764;        /* Tu Azul Institucional Exacto */
    --primary-hover: #243248;  /* Variación profunda para hovers y estados activos */
    --accent: #00a551;         /* Verde para detalles de éxito, activos o resaltados */
    --accent-hover: #008240;   
    
    /* Paleta de Neutros Moderna (Corregidos con su # correspondiente) */
    --dark: #0f172a;           /* Gris casi negro para títulos fuertes */
    --bg: #f1f5f9;             /* Fondo gris claro ultra limpio */
    --card: #ffffff;           /* Blanco puro para contenedores y tarjetas */
    --text: #1e293b;           /* Gris oscuro suave para textos largos (lectura cómoda) */
    --text-muted: #64748b;     /* Gris medio para etiquetas secundarios y subtítulos */
    --border: #e2e8f0;         /* Gris muy claro para líneas sutiles de división */
    
    /* Alertas y Errores */
    --danger: #d63031;
    --danger-light: rgba(255, 118, 117, 0.2);
    
    /* Espaciados y Radios de Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    /* Sombras Elevadas (Efecto 3D sutil) */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* =========================================
   1. RESET Y ESTILOS BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    background-color: var(--bg); 
    color: var(--text); 
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   2. CABECERA Y NAVEGACIÓN
   ========================================= */
.main-header {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
}

.logo span {
    color: var(--accent);
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.main-nav a {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: var(--accent);
}

.main-nav a.btn-salir {
    background: var(--danger-light);
    color: #ffb3b3;
    margin-left: 1rem;
}

.main-nav a.btn-salir:hover {
    background: var(--danger);
    color: white;
}

/* =========================================
   3. ESTRUCTURA PRINCIPAL (LAYOUT)
   ========================================= */
.contenedor-principal {
    max-width: 95%;
    margin: 2rem auto;
    width: 95%;
}

.card-contenido {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
}

/* =========================================
   4. TARJETAS DE ESTADÍSTICAS (DASHBOARD)
   ========================================= */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-link {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    display: inline-block;
}

.stat-link:hover {
    text-decoration: underline;
}

.stat-icon {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--primary);
}

/* =========================================
   5. TABLAS
   ========================================= */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.tabla-independiente {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    white-space: nowrap;
}

.tabla-independiente th,
.tabla-independiente td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tabla-independiente th {
    background: var(--bg);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.tabla-independiente tbody tr:hover {
    background: #f8fafc;
}

/* =========================================
   6. FORMULARIOS Y BOTONES
   ========================================= */
input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="number"], 
input[type="date"],   
select,
textarea {
    width: 100%;             
    height: 48px;            
    padding: 0 1rem;         
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
    display: block;
    box-sizing: border-box;  
}

textarea {
    height: auto;
    padding: 0.75rem 1rem;
}

input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(53, 71, 100, 0.15);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; 
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-primary { 
    background: var(--primary); 
    color: white; 
}

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

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: var(--accent-hover);
}

/* =========================================
   7. FOOTER Y EXTRAS
   ========================================= */
.footer-sistema {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* =========================================
   8. RESPONSIVE DESIGN (MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .main-nav a.btn-salir {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .contenedor-principal {
        margin: 1rem auto;
        padding: 0 1rem;
    }
}

/* =========================================
   9. LOGIN ESPECÍFICO Y ALERTAS
   ========================================= */
.login-container {
    max-width: 420px;
    margin: 80px auto;
    background: var(--card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-top: 5px solid var(--primary);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.alert {
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* =========================================
   10. DASHBOARD Y PANEL DE CONTROL
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-wrapper {
    animation: fadeIn 0.6s ease-out;
}

/* Banner Superior estilizado con tu degradado institucional */
.dashboard-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    color: white;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 25px rgba(53, 71, 100, 0.25);
    position: relative;
    overflow: hidden;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.banner-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
}

.banner-bg-icon {
    position: absolute;
    right: -20px;
    top: -40px;
    opacity: 0.1;
    width: 300px;
    height: 300px;
}

.section-title {
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.action-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.action-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(53, 71, 100, 0.12);
    transform: translateY(-3px);
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-primary {
    background: var(--primary);
    color: white;
}

.icon-secondary {
    background: var(--bg);
    color: var(--text-muted);
}

.action-text h4 {
    color: var(--dark);
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
}

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