/* ===== IMPORTAR FUENTES MODERNAS ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ===== VARIABLES GLOBALES ===== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --border-radius: 20px;
    --border-radius-sm: 14px;
    --box-shadow: 0 20px 35px -15px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 25px 40px -12px rgba(0, 0, 0, 0.15);
}

/* ===== ESTILOS GENERALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== BARRA DE NAVEGACIÓN ===== */
.navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #818cf8;
    margin-right: 10px;
}

.nav-link {
    font-weight: 600;
    margin: 0 4px;
    padding: 0.6rem 1.2rem !important;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link:hover {
    background: rgba(129, 140, 248, 0.15);
    transform: translateY(-2px);
}

.nav-link i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.nav-link.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container-fluid {
    padding: 0 2rem;
}

/* ===== TÍTULOS ===== */
h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--dark);
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 1rem;
}

h1:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #c084fc 100%);
    border-radius: 4px;
}

/* ===== TARJETAS DE ESTADÍSTICAS ===== */
.row {
    margin-bottom: 1.5rem;
}

.col-md-3 {
    margin-bottom: 1.2rem;
}

.stat-card {
    border: none;
    border-radius: var(--border-radius);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
}

.stat-card .card-body {
    padding: 1.8rem;
    position: relative;
    z-index: 1;
}

.stat-card h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 0.8rem;
}

.stat-card h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
}

.stat-card .fa-3x {
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    opacity: 0.15;
    font-size: 3.5rem;
    transition: all 0.3s;
}

.stat-card:hover .fa-3x {
    transform: scale(1.1);
    opacity: 0.25;
}

/* Colores de tarjetas */
.bg-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* ===== TARJETAS GENÉRICAS ===== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.8rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background: white;
    border-bottom: 2px solid #f1f5f9;
    padding: 1.2rem 1.5rem;
    font-weight: 700;
}

.card-header h3, 
.card-header h4, 
.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.card-body {
    padding: 1.8rem;
}

/* ===== TABLAS MEJORADAS ===== */
.table-responsive {
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
    background: white;
}

.table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    color: var(--gray);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.2rem 1rem;
}

.table tbody tr {
    transition: all 0.25s ease;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table tbody td {
    padding: 1.2rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ===== BADGES MODERNOS ===== */
.badge {
    font-size: 0.7rem;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.badge i {
    font-size: 0.7rem;
}

.badge:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Badges con gradientes */
.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.bg-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
}

.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}

/* ===== BOTONES ===== */
.btn {
    border-radius: 12px;
    padding: 0.6rem 1.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 4px;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn i {
    margin-right: 8px;
}

.btn:hover {
    transform: translateY(-3px);
    filter: brightness(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    border-radius: 10px;
}

/* ===== MODALES ===== */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    padding: 1.3rem 1.8rem;
    border: none;
}

.modal-header .btn-close {
    background-color: white;
    opacity: 0.8;
    filter: invert(1);
}

.modal-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.2rem 1.8rem;
}

/* ===== FORMULARIOS ===== */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-label {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PIE DE PÁGINA ===== */
footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
    border-radius: 24px 24px 0 0;
    margin-top: 3rem;
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ===== ALERTAS ===== */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.8rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fed7aa 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .stat-card h2 {
        font-size: 1.6rem;
    }
    
    .stat-card .card-body {
        padding: 1.2rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table tbody td {
        padding: 0.8rem 0.6rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.6rem;
        font-size: 0.65rem;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.7rem;
    }
    
    .card-body {
        padding: 1.2rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease forwards;
}

.table tbody tr {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.table tbody tr:nth-child(5) { animation-delay: 0.25s; }

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

/* ===== EFECTOS ESPECIALES ===== */
.glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== BOTÓN DE INSTALACIÓN ESPECIAL ===== */
.btn-installation {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
}

.btn-installation:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

/* ===== SEPARACIÓN EXTRA ===== */
.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}