/* ═══════════════════════════════════════════════════════════
   ESTILOS PERSONALIZADOS - DBNODEJS + Bootstrap 5.3.8
   Diseño moderno y profesional
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --light: #f1f5f9;
    --dark: #1e293b;
}

/* ─────────────────────────────────────────────────────────
   GENERAL
   ───────────────────────────────────────────────────────── */
* {
    transition: all 0.2s ease-in-out;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding-top: 2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark);
}

body.bg-page {
    background-color: #d5d8dc;
}

.hero-wrap {
    background-color: #2f3640;
    min-height: 280px;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-box {
    border-radius: 10px;
    background-color: #ffffff;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────
   IMÁGENES Y LOGOS
   ───────────────────────────────────────────────────────── */
.logo-img {
    max-width: 200px;
    height: auto;
    margin: 1rem 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    margin: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    border-radius: 6px;
}

header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

/* ─────────────────────────────────────────────────────────
   CONTENEDOR
   ───────────────────────────────────────────────────────── */
.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────
   BOTONES Y COLORES
   ───────────────────────────────────────────────────────── */
.btn {
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.25);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ef4444 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────── */
.card {
    border: none;
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px 8px 0 0 !important;
    padding: 1rem 1.25rem !important;
    border: none !important;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────────────────
   FORMULARIOS
   ───────────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* ─────────────────────────────────────────────────────────
   TABLAS
   ───────────────────────────────────────────────────────── */
.table {
    margin-bottom: 0;
}

.table-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.table-primary th {
    border-color: var(--primary-dark);
    font-weight: 600;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9 !important;
    transform: scale(1.01);
}

.table-primary tbody tr:hover {
    background-color: rgba(30, 58, 138, 0.05) !important;
}

.table-responsive {
    border-radius: 6px;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────
   ALERTAS Y ANIMACIONES
   ───────────────────────────────────────────────────────── */
.alert {
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    color: #047857;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(3, 102, 214, 0.05) 100%);
    color: #0c4a6e;
    border-left: 4px solid #0ea5e9;
}

.btn-close {
    transition: all 0.2s ease;
}

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

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

/* ─────────────────────────────────────────────────────────
   SECCIONES Y CONTENEDOR DE ALERTAS
   ───────────────────────────────────────────────────────── */
#alertContainer {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1050;
    max-width: 400px;
}

.alert-dismissible {
    border-radius: 6px;
}

section {
    margin-bottom: 2.5rem;
    animation: fadeIn 0.4s ease-in;
}

/* ─────────────────────────────────────────────────────────
   SPINNER Y CARGA
   ───────────────────────────────────────────────────────── */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

/* ─────────────────────────────────────────────────────────
   BADGES Y ESTADOS
   ───────────────────────────────────────────────────────── */
.badge {
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    font-size: 0.85rem;
}

.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.bg-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
        margin-bottom: 1rem;
    }

    header h2 {
        font-size: 1.4rem;
    }

    #alertContainer {
        max-width: 90%;
        right: 1rem;
        left: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }
}