/* public/css/civic-core.css */
/* RYZOMA CIVIC: Core Architecture & Brand Guidelines v1.0 */
/* Estrategia: Modularización del monolito. Este archivo maneja variables, tipografía y estructura layout base. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Manrope:wght@400;600;700;800&display=swap');

:root {
/* --- Paleta Base Ajustada para Civic --- */
    --rz-charcoal:    #1E293B; /* Slate oscuro en vez del carbón genérico */
    --rz-slate-bg:    #F8FAFC; /* Fondo frío/técnico en reemplazo de --rz-beige */
    --rz-white:       #FFFFFF;
    --rz-grey-mid:    #E2E8F0;
    --rz-grey-light:  #F1F5F9;

    /* --- Identidad Civic --- */
    --civic-navy:     #122B3B; /* Azul institucional profundo para sidebar */
    --civic-water:    #0284C7; /* Azul cívico / hídrico principal */
    --civic-water-dark:#0369A1;
    --civic-green:    #16A34A; /* Reservado puntualmente para plazas/cobertura */
    --civic-alert:    #E11D48; /* Alertas e incidencias críticas */

    /* --- Mapeo UI --- */
    --color-bg-body:       var(--rz-slate-bg);   /* Neutral frío, menos "cálido/campo" */
    --color-text-main:     var(--rz-charcoal);
    --color-navbar-bg:     var(--rz-white);
    --color-sidebar-bg:    var(--civic-navy);     /* Sidebar institucional */
    --color-primary-cta:   var(--civic-water);    /* El agua y la gestión pública mandan */

    /* --- Tokens UI --- */
    --rz-space-1: 0.25rem;
    --rz-space-2: 0.5rem;
    --rz-space-3: 0.75rem;
    --rz-space-4: 1rem;
    --rz-space-5: 1.5rem;
    --rz-space-6: 2rem;
    --rz-radius-md: 12px;
    --rz-radius-lg: 16px;
    --rz-shadow-soft: 0 8px 24px rgba(49, 49, 49, 0.08);
    --rz-shadow-lifted: 0 14px 30px rgba(42, 123, 111, 0.14);
    --rz-focus-ring: 0 0 0 0.22rem rgba(42, 123, 111, 0.22);
}

/* ------------------------------------------------------- */
/* Estilos Globales                                        */
/* ------------------------------------------------------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rz-charcoal);
}

a { text-decoration: none; transition: all 0.2s ease; }

/* ------------------------------------------------------- */
/* Header de Navegación ("Clean Canvas")                   */
/* ------------------------------------------------------- */
.navbar {
    background-color: var(--color-navbar-bg, #ffffff) !important;
    border-bottom: 1px solid var(--rz-grey-mid, #e2e8f0);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
    padding: 0.75rem 1rem;
}

/* Marca Ryzoma: tipografía geométrica idéntica al original */
.navbar-brand, .brand-logo-container {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 1.55rem;
    letter-spacing: -0.04em;
    color: #1e293b !important;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

/* La 'y' con color diferenciado (Azul Cívico / Hídrico) */
.brand-y {
    color: #0284C7 !important; /* Azul hídrico municipal */
    display: inline-block;
}

/* Píldora / Badge al estilo de la referencia visual */
.brand-badge {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b !important;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px 7px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    line-height: 1;
}

.navbar .nav-link {
    color: var(--rz-charcoal, #313131) !important;
    font-weight: 500;
}

.navbar .nav-link:hover {
    color: #0284C7 !important;
}

/* ------------------------------------------------------- */
/* Sidebar (Contexto Civic - VERDE ESMERALDA)              */
/* ------------------------------------------------------- */
#sidebar {
    background-color: var(--color-sidebar-bg) !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
}

#sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--rz-white);
    transform: translateX(4px);
}

/* Reemplazar el amarillo por un blanco limpio contrastado */
#sidebar .nav-link.active {
    background-color: var(--rz-white);
    color: var(--civic-navy);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

#sidebar .nav-link.active i {
    color: var(--civic-water); /* El icono se tiñe del azul hídrico */
}
/* ------------------------------------------------------- */
/* Comportamiento Responsivo del Sidebar (Drawer Móvil)   */
/* ------------------------------------------------------- */

/* Desktop: ancho fijo y flujo normal */
#sidebar {
    width: 250px;
    min-width: 250px;
    min-height: calc(100vh - 61px);
    background-color: var(--color-sidebar-bg, #2A7B6F) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

/* Capa de fondo oscurecida */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

/* Pantallas móviles y tablets (menores a 992px) */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -260px; /* Oculto fuera de pantalla a la izquierda */
        width: 260px;
        height: 100vh;
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
    }

    /* Clase que lo desliza a la vista */
    #sidebar.active {
        left: 0;
    }
}
/* ------------------------------------------------------- */
/* Clases de Utilidad (Acentos)                            */
/* ------------------------------------------------------- */
.text-civic-green { color: var(--civic-green) !important; }
.bg-civic-green   { background-color: var(--civic-green) !important; color: white; }
.text-civic-water { color: var(--civic-water) !important; }
.bg-civic-water   { background-color: var(--civic-water) !important; color: white; }
.text-civic-alert { color: var(--civic-alert) !important; }

/* ------------------------------------------------------- */
/* Dashboard Home                                          */
/* ------------------------------------------------------- */
.dashboard-hero {
    border-radius: var(--rz-radius-lg);
    box-shadow: var(--rz-shadow-soft);
}

.dashboard-kicker {
    display: inline-flex;
    align-items: center;
    padding: var(--rz-space-1) var(--rz-space-3);
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: var(--civic-green);
    background: rgba(42, 123, 111, 0.1);
}

.dashboard-title {
    font-size: clamp(1.35rem, 1.15rem + 1vw, 2rem);
    line-height: 1.2;
}

.dashboard-date {
    display: inline-flex;
    align-items: center;
    padding: var(--rz-space-2) var(--rz-space-3);
    border-radius: 999px;
    background: rgba(49, 49, 49, 0.06);
    color: #545454;
    font-size: 0.95rem;
}

.dashboard-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(42, 123, 111, 0.2), rgba(42, 123, 111, 0.05));
    color: var(--civic-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.dashboard-section-header p {
    font-size: 0.94rem;
}

.dashboard-module-card {
    display: flex;
    flex-direction: column;
    gap: var(--rz-space-2);
    border-radius: var(--rz-radius-lg);
    color: inherit;
}

.dashboard-module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rz-shadow-lifted);
}

.dashboard-module-card:focus-visible {
    outline: none;
    box-shadow: var(--rz-focus-ring), var(--rz-shadow-lifted);
}

.dashboard-module-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-neutral {
    background: rgba(49, 49, 49, 0.08);
    color: var(--rz-charcoal);
}

.dashboard-module-title {
    font-size: 1.02rem;
}

@media (max-width: 575.98px) {
    .dashboard-hero {
        padding: var(--rz-space-4) !important;
    }

    .dashboard-date {
        font-size: 0.88rem;
    }
}
