/**
 * SIGA - Estilos personalizados del sistema
 * 
 * Complementa Bootstrap 5 con estilos específicos para:
 * - Layout: sidebar + main content
 * - Login page
 * - KPI cards del dashboard
 * - Componentes reutilizables
 * 
 * Convención de nombres: prefijo siga- para clases propias
 */

/* ═══════════════════════════════════════════════════════════════════════
   VARIABLES CSS GLOBALES
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --siga-sidebar-width: 260px;
    --siga-sidebar-bg: #1e293b;
    --siga-sidebar-text: #94a3b8;
    --siga-sidebar-active: #ffffff;
    --siga-sidebar-hover-bg: #334155;
    --siga-topbar-height: 60px;
    --siga-primary: #2563eb;
    --siga-body-bg: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════════════
   BODY Y LAYOUT GENERAL
   ═══════════════════════════════════════════════════════════════════════ */
.siga-body {
    background-color: var(--siga-body-bg);
    min-height: 100vh;
    display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR (Navegación lateral)
   ═══════════════════════════════════════════════════════════════════════ */
.siga-sidebar {
    width: var(--siga-sidebar-width);
    min-height: 100vh;
    background-color: var(--siga-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Brand / Logo area */
.siga-sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.siga-sidebar-brand a {
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

/* Nav items */
.siga-sidebar-nav {
    padding: 0.75rem 0;
}

.siga-sidebar-nav .nav-link {
    color: var(--siga-sidebar-text);
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.siga-sidebar-nav .nav-link:hover {
    color: var(--siga-sidebar-active);
    background-color: var(--siga-sidebar-hover-bg);
}

.siga-sidebar-nav .nav-link.active {
    color: var(--siga-sidebar-active);
    background-color: var(--siga-sidebar-hover-bg);
    border-left-color: var(--siga-primary);
    font-weight: 600;
}

/* Section headers dentro del sidebar */
.siga-sidebar-nav .nav-header {
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.2rem 1.5rem 0.4rem;
    font-weight: 700;
    list-style: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTENIDO PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════ */
.siga-main {
    margin-left: var(--siga-sidebar-width);
    width: calc(100% - var(--siga-sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.siga-topbar {
    height: var(--siga-topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Área de contenido */
.siga-content {
    flex: 1;
    padding: 1.5rem;
}

/* Footer */
.siga-footer {
    border-top: 1px solid #e2e8f0;
    background-color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════
   KPI CARDS (Dashboard)
   ═══════════════════════════════════════════════════════════════════════ */
.siga-kpi-card {
    border-radius: 0.75rem;
    transition: transform 0.15s ease;
}

.siga-kpi-card:hover {
    transform: translateY(-2px);
}

.siga-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════ */
.siga-login-body {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.siga-login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.siga-login-card {
    border-radius: 1rem;
    border: none;
}

.siga-login-icon {
    font-size: 2.5rem;
    color: var(--siga-primary);
}

/* ═══════════════════════════════════════════════════════════════════════
   TABLAS
   ═══════════════════════════════════════════════════════════════════════ */
.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   CARDS GENERALES
   ═══════════════════════════════════════════════════════════════════════ */
.card {
    border-radius: 0.75rem;
}

.card-header {
    padding: 1rem 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE: MOBILE (< 992px)
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .siga-sidebar {
        transform: translateX(-100%);
    }

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

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

/* ═══════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════ */

/* Badge con colores dinámicos del sistema */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Scrollbar personalizada para el sidebar */
.siga-sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.siga-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
