/* ==========================================================================
   ESTILOS GENERALES Y VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #f7c72a;    /* Dorado/Amarillo Chalchuapa */
    --primary-dark: #d4a017;
    --sidebar-bg: #2c3e50;      /* Azul oscuro para el menú */
    --sidebar-hover: #34495e;
    --light-bg: #f4f7f6;        /* Gris muy claro para el fondo */
    --white: #ffffff;
    --text-dark: #333333;
    --border-color: #dee2e6;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   ESTRUCTURA PRINCIPAL (LAYOUT FLEXBOX)
   ========================================================================== */
.main-content {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Área de contenido principal (a la derecha del sidebar) */
.content-area {
    flex-grow: 1;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    margin: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

h2 {
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ==========================================================================
   SIDEBAR (NAVEGACIÓN)
   ========================================================================== */
.sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    text-align: center;
    border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar ul.components {
    padding: 20px 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 1.1em;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar ul li a:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
}

.sidebar ul li.active > a {
    background: var(--sidebar-hover);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* ==========================================================================
   TARJETAS Y MÓDULOS (DASHBOARD)
   ========================================================================== */
.module-card-custom {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 10px;
}

.module-card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
}

.card-body i {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* ==========================================================================
   COMPONENTES DE UI (TABLAS, BOTONES, BADGES)
   ========================================================================== */
.navbar {
    border-radius: 0;
    padding: 12px 25px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
}

.status-approved { background-color: #d4edda; color: #155724; }
.status-pending { background-color: #fff3cd; color: #856404; }
.status-danger { background-color: #f8d7da; color: #721c24; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: #fff;
}

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
footer {
    background-color: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    color: var(--white);
    padding: 15px 0;
}

/* ==========================================================================
   RESPONSIVIDAD Y AJUSTES DE MAPAS
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        min-width: 80px;
        max-width: 80px;
    }
    .sidebar-header h3, .sidebar span {
        display: none;
    }
}

/* Corrección de z-index para Leaflet (OpenStreetMap) dentro de Modales */
.modal-open .leaflet-pane,
.modal-open .leaflet-control-container {
    z-index: 1060 !important;
}

