:root {
    /* Protección Civil Theme */
    --primary-color: #e65100; /* Naranja Seguridad */
    --secondary-color: #0d253f; /* Azul Marino Institucional */
    --accent-color: #ffb300; /* Amarillo Alerta */
    --text-dark: #212529;
    --text-light: #6c757d;
    --sidebar-width: 260px;
    --sidebar-bg: #0d253f;
    --sidebar-active: rgba(255, 255, 255, 0.15);
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    height: 100%;
    margin: 0;
    background-color: #f8f9fa;
    color: var(--text-dark);
}

a { text-decoration: none; }

/* =========================================
   ADMIN LAYOUT STYLES
   ========================================= */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    background-color: #f4f6f9;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.sidebar {
    background-color: var(--sidebar-bg);
    background-image: linear-gradient(180deg, var(--secondary-color) 0%, #05101a 100%);
    color: white;
    z-index: 100;
    min-width: var(--sidebar-width);
}

.top-row {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.top-row a {
    margin-left: 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Sidebar Navigation */
.navbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: white !important;
    text-transform: uppercase;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-scrollable {
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
}

.nav-item {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.nav-item ::deep a {
    color: rgba(255,255,255,0.75);
    border-radius: 6px;
    height: 2.75rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    padding: 0 1rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item ::deep a.active {
    background-color: var(--sidebar-active);
    color: white;
    font-weight: 700;
    border-left: 4px solid var(--primary-color);
}

.nav-item ::deep a:hover {
    background-color: rgba(255,255,255,0.08);
    color: white;
    padding-left: 1.25rem;
}

.nav-item ::deep .fa-solid, 
.nav-item ::deep .fas {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Desktop Sidebar Layout */
@media (min-width: 768px) {
    .page { flex-direction: row; }
    .sidebar {
        width: var(--sidebar-width);
        height: 100vh;
        position: sticky;
        top: 0;
    }
}

/* Mobile Sidebar */
@media (max-width: 767.98px) {
    .sidebar { position: static; height: auto; width: 100%; }
    .top-row { display: none; }
    .nav-scrollable { display: none; }
    .navbar-toggler:checked ~ .nav-scrollable { display: block; padding-bottom: 1rem; }
    
    .navbar-toggler {
        display: block;
        position: absolute;
        right: 1rem;
        top: 0.75rem;
        color: white;
        border: 1px solid rgba(255,255,255,0.3);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        cursor: pointer;
    }
}

/* =========================================
   PUBLIC SITE STYLES
   ========================================= */
/* Navbar Custom (Public) */
.navbar-custom {
    background: #ffffff;
    border-bottom: 4px solid var(--primary-color);
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.navbar-custom .navbar-brand {
    color: var(--secondary-color) !important;
    padding: 0;
}

/* Hero Modern */
.hero-modern {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: white;
    padding: 60px 0;
}

/* Categories Grid Fix */
.category-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    height: 100%; /* Important for grid alignment */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    transition: color 0.3s;
}

.category-card:hover .category-icon {
    color: var(--primary-color);
}

/* Cards Modern */
.card-modern {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card-img-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.card-modern:hover img { transform: scale(1.05); }

.category-pill {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Footer Modern */
.footer-modern {
    background: #1f2937;
    border-top: 4px solid var(--primary-color);
    color: #9ca3af;
    padding: 40px 0 20px;
}

.footer-title {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 0.25rem;
}

/* Buttons */
.btn-custom {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.btn-custom:hover { background: #d84315; color: white; }

/* Utilities */
.section-title {
    font-weight: 800;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    color: var(--secondary-color);
    font-size: 1.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-color);
}

/* Table Styles */
.table thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
}
.table td { padding: 0.75rem 1rem; vertical-align: middle; }
.badge { font-weight: 600; letter-spacing: 0.3px; }