/* ============================================
   SISTEMA DE EVALUACIONES PSICOLÓGICAS
   site.css - Estilos Globales
   ============================================ */

/* ===== VARIABLES ===== */
:root {
    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    /* Colores principales */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7392ff;
    --secondary: #6c757d;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --info: #118ab2;
    /* Backgrounds */
    --bg-body: #f7fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    /* Text */
    --text-dark: #2d3748;
    --text-muted: #718096;
    --text-light: #cbd5e0;
    /* Borders */
    --border-color: #e2e8f0;
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    /* Transitions */
    --transition: all 0.2s ease;
}

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

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    color: var(--text-dark);
    background: var(--bg-body);
}

/* ============================================
   TOPBAR (Header)
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    align-items: center;
}

    .topbar .container-fluid {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 1.5rem;
    }

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.75rem;
}

    .brand-icon i {
        font-size: 1.25rem;
        color: white;
    }

.brand-text h5 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
    color: var(--text-dark);
}

.brand-text small {
    font-size: 0.75rem;
    line-height: 1;
    color: var(--text-muted);
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    display: flex;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
}

    .sidebar-nav .nav {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .sidebar-nav .nav-item {
        margin: 0;
    }

    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 1.5rem;
        color: var(--text-dark);
        text-decoration: none;
        transition: var(--transition);
        border-left: 3px solid transparent;
        font-size: 0.95rem;
    }

        .sidebar-nav .nav-link:hover {
            background: var(--bg-body);
            color: var(--primary);
            border-left-color: var(--primary);
        }

        .sidebar-nav .nav-link.active {
            background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
            color: var(--primary);
            border-left-color: var(--primary);
            font-weight: 600;
        }

            .sidebar-nav .nav-link.active .nav-icon {
                color: var(--primary);
            }

    .sidebar-nav .nav-icon {
        font-size: 1.125rem;
        width: 24px;
        text-align: center;
        color: var(--text-muted);
        transition: color 0.2s ease;
        flex-shrink: 0;
    }

    .sidebar-nav .nav-text {
        font-weight: 500;
    }

/* Section Titles */
.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

    .nav-section-title:first-child {
        margin-top: 0.5rem;
    }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--topbar-height));
    background: var(--bg-body);
}

.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ============================================
   CARDS
   ============================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

    .dropdown-item:hover {
        background: var(--bg-body);
        color: var(--primary);
    }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

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

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

/* ============================================
   UTILITIES
   ============================================ */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .brand-text {
        display: none !important;
    }
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   XigTable Styles (para compatibilidad)
   ============================================ */
.xig-table-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table {
    margin-bottom: 0;
}

    .table thead th {
        border-bottom: 2px solid var(--border-color);
        font-weight: 600;
        color: var(--text-dark);
    }

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}
