﻿.content-container {
    flex: 1 1 auto; /* empuja el footer hacia abajo */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 1.5rem; /* Add internal padding here instead of on body */
}
:root {
    --sidebar-width: 290px;
    --primary-color: #0d6efd;
    --sidebar-bg: #f8f9fa;
    --sidebar-active: #e9ecef;
    --text-color: #212529;
    --border-color: #dee2e6;
    --fire-red: #d32f2f; /* Primario operacional */
    --fire-red-50: #fff5f5;
    --fire-amber: #ff9800; /* Avisos */
    --fire-amber-50: #fff7e6;
    --fire-blue: #1976d2; /* Información */
    --fire-blue-50: #e8f1fb;
    --fire-green: #2e7d32; /* Ok */
    --gray-100: #f8fafc;
    --gray-200: #e5e7eb;
    --gray-700: #374151;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: var(--text-color);
    overflow-x: hidden;
}

html, body {
    height: 100%;
    margin: 0; /* ensure no UA margin leaks below footer */
}

/* Footer: make sure there’s no bottom gap rendered by rounding */
.footer-cbm {
    margin-bottom: 0 !important;
    border-bottom: 0; /* defensive: ensure no bottom border */
}
/* ============================================
   SIDEBAR FIJO Y NAVEGACIÓN LATERAL
============================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Estado inicial: oculto en móviles */
.sidebar {
    transform: translateX(-100%);
}

/* Cuando tiene la clase show (visible en móviles) */
.sidebar.show {
    transform: translateX(0);
}

/* En desktop siempre visible */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Overlay para móviles */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    cursor: pointer;
}

.sidebar.show ~ .sidebar-overlay {
    display: block;
}

/* Ajustes para el contenido principal */
.main-content {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* ya existía, lo mantenemos explícito */
    width: 100%;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}
.main-content > .content-container:last-of-type {
    padding-bottom: 0;
}
/* Resto de tus estilos se mantienen igual */
.sidebar .logo-container {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar .logo-container img {
    max-height: 120px;
    width: auto;
}

.sidebar .btn-toggle {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--text-color);
    background: transparent;
    border: 0;
    transition: all 0.2s ease;
}

.sidebar .btn-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

.sidebar .btn-toggle[aria-expanded="true"] {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
}

.sidebar .btn-toggle-nav {
    padding-left: 0.5rem;
}

.sidebar .sidebar-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.sidebar .sidebar-link:hover {
    background-color: rgba(0,0,0,0.05);
}

.sidebar .sidebar-link.active {
    background-color: var(--primary-color);
    color: white;
}

.content-container {
    flex: 1 1 auto; /* empuja el footer hacia abajo */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 1.5rem;
}
/* ============================================
   DASHBOARD VISUAL Y COMPONENTES
============================================ */
.dashboard-main-container {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.dashboard-header-section {
    margin-bottom: 2rem;
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-main-title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.dashboard-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.dashboard-cards-section {
    margin-bottom: 2rem;
}

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   RESPONSIVIDAD Y COMPORTAMIENTO EN MÓVIL
============================================ */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%); /* ← Oculto por defecto */
        transition: transform 0.3s ease;
    }

        .sidebar.show {
            transform: translateX(0); /* ← Visible al activar */
        }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
}

/* Dashboard Card Styles - COLORES MEJORADOS */
.dashboard-stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .dashboard-stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(45deg, #007bff, #28a745);
    }

    .dashboard-stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

.dashboard-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    min-height: 70px;
}

.dashboard-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

    .dashboard-card-icon i {
        color: white;
        font-size: 1.2rem;
    }

.dashboard-card-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
}

.dashboard-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.dashboard-card-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.dashboard-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-total-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    flex-shrink: 0;
}

.dashboard-total-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    line-height: 1;
}

.dashboard-total-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex: 1;
    align-content: start;
}

.dashboard-stat-item {
    text-align: center;
    padding: 0.75rem;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

    .dashboard-stat-item.highlight {
        background: linear-gradient(45deg, #28a745, #20c997);
        color: white;
    }

    .dashboard-stat-item:hover {
        transform: scale(1.05);
    }

.dashboard-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
}

.dashboard-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.25rem;
}

/* Charts Section */
.dashboard-charts-section {
    margin-bottom: 2rem;
}

.dashboard-chart-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-chart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.dashboard-chart-legend {
    display: flex;
    gap: 1rem;
}

.dashboard-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.dashboard-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.dashboard-chart-body {
    padding: 1.5rem;
}

/* Table Section */
.dashboard-table-section {
    margin-bottom: 2rem;
}

.dashboard-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dashboard-table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.dashboard-status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dashboard-status-resolved {
    background-color: #d4edda;
    color: #155724;
}

.dashboard-status-progress {
    background-color: #fff3cd;
    color: #856404;
}

/* ===== COMPONENTES BOMBEROS RESTAURADOS ===== */
.firefighter-unit-card {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    border: 1px solid #c8e6c9;
    border-left: 5px solid #2e7d32;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(46, 125, 50, 0.15);
    min-height: 200px;
    position: relative;
}

.firefighter-incident-card {
    background: linear-gradient(135deg, #ffebee 0%, #ffffff 100%);
    border: 1px solid #ffcdd2;
    border-left: 5px solid #d32f2f;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(211, 47, 47, 0.15);
    min-height: 200px;
}

.firefighter-time-display {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
    max-width: 120px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    border: 2px solid rgba(255,255,255,0.3);
    z-index: 10;
    font-size: 0.8rem;
    line-height: 1.2;
}

.firefighter-unit-card .d-flex {
    margin-right: 130px;
}

.firefighter-time-display.critical {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    color: white;
}

.firefighter-time-display.warning {
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
    color: white;
}

.firefighter-time-display.normal {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
}

/* ===== COMPONENTES ADICIONALES ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.card-description {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Banner principal */
.cbm-hero {
    background: linear-gradient(to bottom, #111 0%, #dc3545 100%);
    border-radius: 20px;
    margin: 2rem auto 2rem auto;
    max-width: 100%;
    min-height: 340px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.cbm-hero-content {
    width: 100%;
    text-align: center;
}

.cbm-hero h1 {
    color: #fff;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 1px;
}

.cbm-hero p.lead {
    color: #f8d7da;
    font-size: 1.5rem;
    font-weight: 400;
}

.cbm-hero .btn-danger {
    font-size: 1.35rem;
    padding: 0.9rem 2.5rem;
    border-radius: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(220,53,69,0.18);
    transition: background 0.2s, box-shadow 0.2s;
}

    .cbm-hero .btn-danger:hover {
        background: #b02a37;
        box-shadow: 0 6px 24px rgba(220,53,69,0.25);
    }

.footer-cbm {
    background: #212529;
    color: #fff;
    border-top: 3px solid #dc3545;
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    font-size: 1rem;
    letter-spacing: 0.5px;
    z-index: 10;
    padding: 1rem 0;
    margin-top: auto;
}

    .footer-cbm span {
        color: #fff;
        font-weight: 500;
    }

/* ===== RESPONSIVE CORREGIDO ===== */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        width: 100%;
        left: 0;
    }

    .sidebar-toggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1050;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-main-container {
        padding: 1rem;
    }

    .dashboard-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dashboard-header-actions {
        flex-direction: column;
        width: 100%;
    }

    .dashboard-cards-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .dashboard-stat-item {
        padding: 0.5rem;
        min-height: 50px;
    }

    .dashboard-stat-value {
        font-size: 1rem;
    }

    .dashboard-total-value {
        font-size: 2rem;
    }

    .dashboard-card-header {
        min-height: 60px;
    }

    .dashboard-card-title {
        font-size: 1rem;
    }

    .dashboard-card-subtitle {
        font-size: 0.75rem;
    }

    .cbm-hero {
        max-width: 98vw;
        min-height: 220px;
        padding: 1.5rem 0.5rem;
    }

        .cbm-hero h1 {
            font-size: 2rem;
        }

        .cbm-hero p.lead {
            font-size: 1.1rem;
        }

    .firefighter-unit-card .d-flex {
        margin-right: 0;
        flex-direction: column;
    }

    .firefighter-time-display {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
        max-width: none;
        width: auto;
    }
}

@media (max-width: 576px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .firefighter-unit-card .d-flex {
        margin-right: 100px;
    }

    .firefighter-time-display {
        min-width: 70px;
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (min-width: 1201px) {
    .firefighter-unit-card .d-flex {
        margin-right: 140px;
    }

    .firefighter-time-display {
        min-width: 90px;
        font-size: 0.85rem;
    }
}

/* En desktop (solo >=1200px) siempre visible */
@media (min-width: 1200px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

/* En tablet y móvil (<1200px) sidebar oculto por defecto */
@media (max-width: 1199.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        left: 0;
    }
}


/*CSS INDEX CCE */

.action-card .input-group .form-select[multiple] {
    min-height: 8rem;
}

.action-card .input-group-text {
    gap: .35rem;
}

.action-card .minw-140 {
    min-width: 140px;
}

.action-card hr {
    border-color: rgba(0,0,0,.1);
}

/* Layout: asegurar footer al fondo y mejorar flujo vertical de la página (solo layout) */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* ya existía, lo mantenemos explícito */
}

.content-container {
    flex: 1 1 auto; /* empuja el footer hacia abajo */
}

/* Sidebar: indicador visual del estado (caret) */
.sidebar .btn-toggle::after {
    content: "\f105"; /* angle-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    transition: transform .2s ease;
    opacity: .7;
}

.sidebar .btn-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
    opacity: 1;
}

/* Transición suave al expandir/colapsar paneles del sidebar (solo el sidebar) */
.sidebar .collapse {
    transition: height .2s ease;
}

/* ===== Dashboard VisualContext Theme (acento accesible) ===== */
.dashboard-stat-card { 
    /* valores por defecto */
    --vc-accent: #0d6efd;
    --vc-onAccent: #fff;
}

/* Mapear VisualContext a tokens */
.dashboard-stat-card.vc-primary   { --vc-accent: #0d6efd; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-danger    { --vc-accent: #dc3545; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-warning   { --vc-accent: #ffc107; --vc-onAccent: #212529; }
.dashboard-stat-card.vc-success   { --vc-accent: #28a745; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-info      { --vc-accent: #17a2b8; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-secondary { --vc-accent: #6c757d; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-dark      { --vc-accent: #212529; --vc-onAccent: #fff; }
.dashboard-stat-card.vc-light     { --vc-accent: #e9ecef; --vc-onAccent: #212529; }

/* Barra superior de acento (reemplaza cualquier valor fijo anterior) */
.dashboard-stat-card::before {
    background: var(--vc-accent);
}

/* Icono en pastilla con color de acento */
.dashboard-stat-card .dashboard-card-icon {
    background: var(--vc-accent);
    color: var(--vc-onAccent);
}

/* Título y valor total acentuados y legibles sobre fondo claro */
.dashboard-stat-card .dashboard-card-title {
    color: var(--vc-accent);
}
.dashboard-stat-card .dashboard-total-value {
    color: var(--vc-accent);
}

/* Resalte del tile “Hoy” con buen contraste */
.dashboard-stat-card .dashboard-stat-item.highlight {
    background: var(--vc-accent);
    color: var(--vc-onAccent);
}
.dashboard-stat-card .dashboard-stat-item.highlight .dashboard-stat-label {
    opacity: .95;
}





/*UNIDADES ATENDIENDO, ESTO ES PARA BOMBEROS*/

/* ===== Recientes ajustes para UnidadesAtendiendo (bomberos) ===== */


/* Resaltar fila (unidad lista para despachar) */
/* Dos columnas: información (unidad+incidente) y atendiendo (acciones/metadata) */
.info-col {
    width: 34%;
    min-width: 360px;
}

.attending-col {
    width: 66%;
}

@media (max-width: 1199.98px) { /* Tablets landscape y abajo */
    .info-col {
        width: 40%;
        min-width: 320px;
    }

    .attending-col {
        width: 60%;
    }
}

@media (max-width: 991.98px) { /* Tablets portrait */
    .info-col, .attending-col {
        width: 100%;
        display: block;
    }

    table.table > :not(caption) > * > th.info-col,
    table.table > :not(caption) > * > td.attending-col {
        display: block;
    }
}

/* Bloques visuales dentro de la celda combinada */
.unit-incident-wrap {
    padding: .75rem;
}

.unit-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.unit-ident {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.unit-name {
    font-weight: 700;
}

.unit-station {
    color: #6c757d;
}

.time-badge {
    padding: .25rem .5rem;
    border-radius: .5rem;
    font-weight: 600;
}

    .time-badge.normal {
        background: #e9f7ef;
        color: #13795b;
    }

    .time-badge.warning {
        background: #fff3cd;
        color: #664d03;
    }

    .time-badge.critical {
        background: #fde2e1;
        color: #b42318;
    }

.incident-block {
    margin-top: .5rem;
    padding: .75rem;
    background: #f8f9fa;
    border-radius: .5rem;
}

.incident-title {
    font-weight: 700;
}

.injured-badge {
    background: #fde2e1;
    color: #b42318;
    padding: .15rem .5rem;
    border-radius: .5rem;
    font-weight: 600;
}

.incident-callout {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    background: white;
    border: 1px dashed #e9ecef;
    border-radius: .5rem;
}

.incident-meta .chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: #fff7e6;
    color: #8a6d3b;
    font-weight: 600;
}

.firefighter-type-badge {
    background: #e7f1ff;
    color: #084298;
}

/* Área atendiendo (acciones/metadata) optimizada para tablet */
.actions-cell .btn {
    min-height: 44px;
}
/* mejor touch target */
.firefighter-actions form + form {
    margin-top: .5rem;
}

.firefighter-actions {
    padding: .5rem .25rem;
}