body {
    font-family: Arial, sans-serif;
    background-image: linear-gradient(rgba(0, 49, 0, 0.604)), url(/Frontend/images/bandera.png);
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    background-attachment: fixed;
    margin: 0;
    overflow-x: hidden;
}

.contenedor-estadisticas {
    position: relative;
    margin-left: calc(16% + 7%);
    margin-right: 5%;
    width: auto;
    max-width: 1400px;
    padding: 20px 0 30px 0;
    animation: fadeIn 0.8s ease-out;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.barra-contraida .contenedor-estadisticas {
    margin-left: calc(60px + 5%);
}

.contenedor-titulo-estadisticas {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 8px 0;
    margin-bottom: 30px;
    margin-top: 30px;
}

.titulo-estadisticas {
    margin: 0;
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    text-align: center;
    line-height: 1;
}

.seccionPestanas {
    display: flex;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,94,17,0.2);
    margin-bottom: 15px;
}

.seccionBotonesComisarias {
    display: flex;
    position: relative;
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 94, 17, 0.2);
}

.botonTodos, .botonC1, .botonC2, .botonC3, .botonC4, .botonC5, .botonC6 {
    border: none;
    height: 45px;
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #138035;
    transition: all 0.3s ease;
    border-right: 1px solid #0d6829;
}

.botonTodos:last-child,
.botonC6:last-child {
    border-right: none;
}

.botonTodos:hover, 
.botonC1:hover, 
.botonC2:hover, 
.botonC3:hover, 
.botonC4:hover, 
.botonC5:hover, 
.botonC6:hover {
    background-color: #eefff3;
    color: #0d6829;
}

.botonTodos.activo, 
.botonC1.activo, 
.botonC2.activo, 
.botonC3.activo, 
.botonC4.activo, 
.botonC5.activo, 
.botonC6.activo {
    background-color: #eefff3;
    color: #0d6829;
    font-weight: 700;
    box-shadow: inset 0 -3px 0 #138035;
}

.filtros-estadisticas {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px 20px !important;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 94, 17, 0.2);
    border: 1px solid #d0f0d5;
}

.filtros-fila {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 15px !important;
}

.filtro-grupo {
    flex: 1 !important;
    min-width: 150px !important;
}

.filtro-grupo label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #0d6829;
    font-size: 14px;
    white-space: nowrap;
}

.filtro-grupo select,
.filtro-grupo input[type="date"] {
    width: 100% !important;
    box-sizing: border-box;
    height: 40px;
    padding: 0 10px !important;
    border: 2px solid #d0f0d5;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filtro-grupo select:hover,
.filtro-grupo input:hover {
    border-color: #138035;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
    outline: none;
    border-color: #138035;
    box-shadow: 0 0 0 3px rgba(19, 128, 53, 0.2);
}

.boton-aplicar-filtros {
    background-color: #138035;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(19, 128, 53, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    height: 40px !important;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0 !important;
}

.boton-aplicar-filtros:hover {
    background-color: #0d6829;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(19, 128, 53, 0.4);
}

.boton-aplicar-filtros:active {
    transform: translateY(0);
}

.boton-aplicar-filtros img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.dashboard-estadisticas {
    display: block;
}

.estado-carga {
    text-align: center;
    padding: 40px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 94, 17, 0.15);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #138035;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sin-datos {
    text-align: center;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 94, 17, 0.2);
    margin-top: 15px;
    border: 1px solid #d0f0d5;
    animation: fadeIn 0.5s ease-out;
}

.sin-datos h3 {
    color: #138035;
    font-size: 24px;
    margin-bottom: 15px;
}

.sin-datos p {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.resumen-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 25px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.panel-comisarias {
    background: white !important;
    border-radius: 15px;
    padding: 20px 25px;
    box-shadow: 0 4px 20px rgba(0, 94, 17, 0.15);
    border: 1px solid #d0f0d5;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    height: fit-content;
}

.seccion-titulo-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #138035;
}

.seccion-titulo-panel h2 {
    margin: 0;
    color: #138035;
    font-size: 20px;
    font-weight: 700;
}

.panel-titulo-icono {
    width: 36px;
    height: 36px;
    background-color: #f0faf2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #d0f0d5;
}

.panel-titulo-icono img {
    width: 20px;
    height: 20px;
}

.panel-comisarias-contenido {
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.grafico-donut-comisarias,
.grafico-pastel {
    transition: opacity 0.5s ease-in-out, transform 0.3s ease;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grafico-actualizando {
    opacity: 0.5;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

.grafico-donut-comisarias {
    width: 250px !important;
    height: 250px !important;
    min-width: 180px;
    flex-shrink: 0;
}

.tabla-comisarias-panel {
    flex: 1;
    min-width: 0;
    margin-top: 10px;
}

.tabla-comisarias {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-comisarias thead tr {
    border-bottom: 2px solid #138035;
}

.tabla-comisarias thead th {
    padding: 12px 8px;
    font-weight: 600;
    color: #138035;
    text-align: left;
    white-space: nowrap;
}

.tabla-comisarias thead th:nth-child(1) {
    padding-left: 0;
}

.tabla-comisarias thead th:nth-child(2),
.tabla-comisarias thead th:nth-child(3) {
    text-align: center;
}

.tabla-comisarias tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.tabla-comisarias tbody tr:last-child {
    border-bottom: none;
}

.tabla-comisarias tbody td {
    padding: 12px 8px;
    color: #333;
}

.tabla-comisarias tbody td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 0;
}

.comisaria-fila-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.tabla-comisarias tbody td:nth-child(2),
.tabla-comisarias tbody td:nth-child(3) {
    text-align: center;
    font-weight: 500;
}

.panel-totales {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    transition: all 0.3s ease;
    height: 100%;
}

.panel-totales .tarjeta-total {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 14px;
    padding: 12px 45px;
    box-shadow: 0 4px 15px rgba(0, 94, 17, 0.12);
    border: 1px solid #d0f0d5;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    min-width: 0;
    flex: 1;
    margin: 0;
}

.panel-totales .tarjeta-total .tarjeta-total-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.panel-totales .tarjeta-total-icono {
    width: 45px;
    height: 45px;
    background-color: #f0faf2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #d0f0d5;
}

.panel-totales .tarjeta-total-icono img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.panel-totales .tarjeta-total-info h3 {
    margin: 0 0 2px 0;
    color: #138035;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-totales .tarjeta-total-info .numero {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #138035;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resumen-layout.modo-comisaria {
    display: block;
}

.resumen-layout.modo-comisaria .panel-totales {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    height: auto;
    min-height: auto;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total {
    flex: 1;
    min-width: 0;
    padding: 15px 70px;
    margin: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 94, 17, 0.1);
    border: 1px solid #d0f0d5;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total-icono {
    width: 40px;
    height: 40px;
    background-color: #f0faf2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #d0f0d5;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total-icono img {
    width: 35px;
    height: 35px;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total-info {
    flex: 1;
    min-width: 0;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total-info h3 {
    margin: 0 0 2px 0;
    color: #138035;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resumen-layout.modo-comisaria .panel-totales .tarjeta-total-info .numero {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: #138035;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seccion-estadisticas {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 35px;
    box-shadow: 0 4px 20px rgba(0, 94, 17, 0.15);
    border: 1px solid #d0f0d5;
    animation: fadeIn 0.8s ease-out;
}

.seccion-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #138035;
}

.seccion-titulo h2 {
    margin: 0;
    color: #0d6829;
    font-size: 20px;
    font-weight: 600;
}

.seccion-titulo img {
    width: 28px;
    height: 28px;
}

.contador-tipos-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.contador-tipo-card {
    background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #d0f0d5;
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease-out;
}

.contador-tipo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(19, 128, 53, 0.2);
}

.contador-tipo-icono {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contador-tipo-imagen {
    width: 35px;
    height: 35px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.contador-tipo-info {
    flex: 1;
}

.contador-tipo-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.contador-tipo-numero {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #138035;
    line-height: 1.1;
}

.estadisticas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.estadistica-card {
    background-color: #f8fff9;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #d0f0d5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: none;
    overflow: hidden;
}

.estadistica-card h3 {
    margin: 0 0 15px 0;
    color: #138035;
    font-size: 17px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #d0f0d5;
    text-align: center;
}

.grafico-pastel-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.grafico-pastel-container.grafico-donut-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.grafico-pastel {
    width: 100% !important;
    height: 160px !important;
    max-width: 100%;
    max-height: none;
}

.grafico-pastel-container.grafico-donut-container .grafico-pastel {
    width: 140px !important;
    height: 140px !important;
    max-width: 140px;
    max-height: 140px;
    flex-shrink: 0;
}

.grafico-pastel-container.grafico-donut-container .leyenda-pastel {
    flex: 1;
    min-width: 140px;
    display: block;
}

.leyenda-pastel {
    font-size: 12px;
    display: none;
}

.leyenda-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 6px;
}

.leyenda-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.leyenda-texto {
    display: flex;
    justify-content: space-between;
    flex: 1;
    color: #555;
}

.leyenda-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.leyenda-valor {
    font-weight: 600;
    color: #138035;
}

.tabla-resumen {
    margin-top: 8px;
    border-top: 1px dashed #d0f0d5;
    padding-top: 8px;
}

.tabla-resumen-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid #e8f5e9;
}

.tabla-resumen-item:last-child {
    border-bottom: none;
}

.tabla-resumen-label {
    color: #555;
}

.tabla-resumen-valor {
    font-weight: 600;
    color: #138035;
}

.fondoCerrarSesion {
    animation: movimiento 0.5s ease-out;
    display: none;
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cerrarSesion {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.boton1cerrarSesion {
    background-color: #138035;
    color: white;
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.boton1cerrarSesion:hover {
    background-color: #0d6829;
    transform: translateY(-2px);
}

.boton2cerrarSesion {
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.boton2cerrarSesion:hover {
    background-color: #c5c5c5;
    transform: translateY(-2px);
}

.imgCerrarSesion {
    width: 100px;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

@keyframes movimiento {
    from {
        transform: translatey(10%);
        opacity: 0;
    }
    to {
        transform: translatey(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-detalle-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-detalle-overlay.abierto {
    display: flex;
}

.modal-detalle {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    overflow: hidden;
    animation: modalEntrar .18s ease;
}

@keyframes modalEntrar {
    from { transform: scale(.93); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.modal-detalle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8fdf9;
}

.modal-detalle-header h3 {
    margin: 0;
    font-size: 16px;
    color: #138035;
    font-weight: 700;
}

.modal-detalle-cerrar {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background .15s;
}

.modal-detalle-cerrar:hover {
    background: #f0f0f0;
}

.modal-detalle-body {
    overflow-y: auto;
    padding: 14px 22px 20px;
}

.modal-detalle-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}

.modal-detalle-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-detalle-lista li:last-child {
    border-bottom: none;
}

.modal-detalle-lista li:nth-child(odd) {
    background: #f8fdf9;
}

.modal-detalle-lista li:nth-child(even) {
    background: #fff;
}

.modal-detalle-lista .mdl-nombre {
    color: #333;
    flex: 1;
}

.modal-detalle-lista .mdl-cantidad {
    background: #138035;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    min-width: 30px;
    text-align: center;
    margin-left: 12px;
}

.modal-detalle-vacio {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-size: 14px;
}

.estadistica-card-grande {
    grid-column: 1 / -1;
}

.grafico-barrios-container {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.grafico-barrios-wrapper {
    width: 420px;
    height: 420px;
    flex-shrink: 0;
    position: relative;
}

.grafico-barrios-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 420px !important;
    height: 420px !important;
}

.barrios-panel-derecho {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 420px;
    overflow-y: auto;
}

.leyenda-barrio-fila {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.leyenda-barrio-fila:last-child {
    border-bottom: none;
}

.leyenda-barrio-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.leyenda-barrio-nombre {
    flex: 1;
    color: #333;
}

.leyenda-barrio-pct {
    font-weight: 600;
    color: #138035;
    min-width: 48px;
    text-align: right;
}

.leyenda-barrio-total {
    font-weight: 700;
    color: #138035;
    min-width: 28px;
    text-align: right;
}

.btn-ver-detalle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 14px;
    background: #138035;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, transform .12s;
}

.btn-ver-detalle:hover {
    background: #0f6129;
    transform: translateY(-1px);
}

.btn-ver-detalle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.btns-estado-medidas {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 10px;
}

.btns-estado-medidas .btn-ver-detalle {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
}

.btns-estado-medidas .btn-ver-detalle svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.botonPestana {
    border: none;
    height: 45px;
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #138035;
    transition: all 0.3s ease;
    border-right: 1px solid #0d6829;
}

.botonPestana:last-child {
    border-right: none;
}

.botonPestana:hover {
    background-color: #eefff3;
    color: #0d6829;
}

.botonPestana.activa {
    background-color: #eefff3;
    color: #0d6829;
    font-weight: 700;
    box-shadow: inset 0 -3px 0 #138035;
}

.panel-datos {
    display: block;
}

.panel-datos.oculto {
    display: none;
}

.panel-comparativo {
    display: none;
    padding: 28px 0 0 0;
}

.panel-comparativo.visible {
    display: block;
}

.comparativo-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.comparativo-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #138035;
    font-weight: 700;
    text-align: center;
}

.comparativo-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
}

.comparativo-canvas-wrapper canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.comparativo-tabla-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    padding: 24px 28px;
    margin-top: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.comparativo-tabla-card h3 {
    margin: 0 0 18px 0;
    font-size: 16px;
    color: #138035;
    font-weight: 700;
    text-align: center;
}

.comp-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

.comp-tabla thead tr {
    border-bottom: 2px solid #138035;
}

.comp-tabla thead th {
    padding: 10px 12px;
    font-weight: 700;
    color: #138035;
    text-align: center;
    white-space: nowrap;
    background: #f8fdf9;
}

.comp-tabla thead th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}

.comp-tabla thead th:last-child {
    border-radius: 0 8px 0 0;
    background: #e8f5e9;
}

.comp-tabla tbody tr {
    border-bottom: 1px solid #e8f5e9;
    transition: background .12s;
}

.comp-tabla tbody tr:hover {
    background: #f0faf2;
}

.comp-tabla tbody tr:last-child {
    border-bottom: none;
}

.comp-tabla tbody td {
    padding: 9px 12px;
    text-align: center;
    color: #444;
}

.comp-tabla tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #138035;
    white-space: nowrap;
}

.comp-tabla tbody td.celda-cero {
    color: #bbb;
}

.comp-tabla tfoot tr {
    border-top: 2px solid #138035;
    background: #e8f5e9;
}

.comp-tabla tfoot td {
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    color: #0d6829;
}

.comp-tabla tfoot td:first-child {
    text-align: left;
}

.comp-tabla .col-total-fila {
    font-weight: 700;
    color: #0d6829;
    background: #e8f5e9;
    border-left: 2px solid #c8e6c9;
}

.boton-limpiar-filtros {
    background-color: #4a9e6b;
    box-shadow: 0 4px 10px rgba(74, 158, 107, 0.3);
}

.boton-limpiar-filtros:hover {
    background-color: #3a7d55;
    box-shadow: 0 6px 15px rgba(74, 158, 107, 0.4);
}

.filtros-fila-2 {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8f5e9;
}

@media (min-width: 1024px) {
    .btn-descarga-estadisticas {
        position: absolute;
        right: 0.5%;
        top: 50%;
        transform: translateY(-50%);
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #138035;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 3px 10px rgba(19,128,53,0.35);
        transition: background .18s, transform .12s, box-shadow .18s;
        padding: 0;
    }

    .btn-descarga-estadisticas:hover {
        background: #0f6129;
        box-shadow: 0 5px 16px rgba(19,128,53,0.45);
        transform: translateY(calc(-50% - 1px));
    }

    .btn-descarga-estadisticas img {
        width: 18px;
        height: 18px;
        filter: brightness(0) invert(1);
    }
}

@media (max-width: 1023px) {
    .btn-descarga-estadisticas {
        display: none !important;
    }
}

.fondoDescarga {
    display: none;
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 9000;
    animation: aparecer 0.3s ease-out;
}

@keyframes aparecer {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.formularioDescarga {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    background-color: #eafff0;
    width: 22%;
    min-width: 280px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255,255,255,0.55);
    padding: 20px;
    transition: all 0.5s ease;
    animation: aparecer 0.3s ease-out;
    overflow-y: auto;
}

.cerrarDescargar {
    display: block;
    background-color: transparent;
    border: none;
    width: 20px;
    margin-left: auto;
    cursor: pointer;
}

.cerrarDescargar img {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.cerrarDescargar img:hover {
    transform: scale(1.15);
}

.labelDescargar {
    margin: 14px 0 0 0;
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.labelDescargar.sin-switches {
    margin-bottom: 20px;
}

.titulosSelectDescargas {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.botonDescargar {
    width: 50px;
    height: 50px;
    margin: 16px auto 0 auto;
    background-color: #68ea91;
    box-shadow: 0 0 5px rgba(0,200,37,0.71);
    color: white;
    padding: 8px;
    border: 2px solid #00d11f;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botonDescargar:hover {
    box-shadow: 0 0 15px rgba(0,200,37,0.71);
    transform: scale(1.08);
}

.botonDescargar img {
    width: 28px;
    height: 28px;
}

.pDescargar {
    margin-top: 14px;
    font-size: 12px;
    color: #afafaf;
    font-style: italic;
    line-height: 1.5;
}

.descarga-switches {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 18px 0 4px 0;
    padding: 8px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.descarga-switch-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e8f5e9;
}

.descarga-switch-fila:last-child {
    border-bottom: none;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background .2s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.switch-toggle input:checked + .switch-slider {
    background: #138035;
}

.switch-toggle input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.comparativo-sin-datos {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease-out;
}

.comparativo-sin-datos-icono {
    font-size: 52px;
    margin-bottom: 16px;
}

.comparativo-sin-datos h3 {
    margin: 0 0 10px 0;
    color: #138035;
    font-size: 20px;
}

.comparativo-sin-datos p {
    margin: 0;
    color: #888;
    font-size: 14px;
    line-height: 1.6;
}

.descarga-switch-fila.deshabilitada {
    opacity: 0.4;
    pointer-events: none;
}

.contador-medidas-especiales {
    margin-bottom: 30px;
}

.contador-medidas-especiales .contador-tipo-card {
    min-width: 220px;
}

.donut-leyenda-scroll {
    max-height: 140px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #138035 #e8f5e9;
}

.donut-leyenda-scroll::-webkit-scrollbar {
    width: 5px;
}

.donut-leyenda-scroll::-webkit-scrollbar-track {
    background: #e8f5e9;
    border-radius: 4px;
}

.donut-leyenda-scroll::-webkit-scrollbar-thumb {
    background-color: #138035;
    border-radius: 4px;
}

.donut-tabla-scroll {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #138035 #e8f5e9;
}

.donut-tabla-scroll::-webkit-scrollbar {
    width: 5px;
}

.donut-tabla-scroll::-webkit-scrollbar-track {
    background: #e8f5e9;
    border-radius: 4px;
}

.donut-tabla-scroll::-webkit-scrollbar-thumb {
    background-color: #138035;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .resumen-layout {
        grid-template-columns: 1fr;
    }

    .resumen-layout.modo-comisaria .panel-totales {
        flex-direction: row;
    }
}

@media (max-width: 1024px) {
    .contenedor-estadisticas {
        margin-left: calc(16% + 4%);
        margin-right: 4%;
    }

    .grafico-pastel-container.grafico-donut-container {
        flex-direction: column;
    }

    .grafico-pastel-container.grafico-donut-container .grafico-pastel {
        margin: 0 auto;
        width: 140px !important;
        height: 140px !important;
    }

    .grafico-pastel-container.grafico-donut-container .leyenda-pastel {
        width: 100%;
        display: block;
    }

    .panel-comisarias-contenido {
        flex-direction: column;
        align-items: center;
    }

    .grafico-donut-comisarias {
        width: 200px !important;
        height: 200px !important;
    }

    .grafico-barrios-wrapper {
        width: 300px;
        height: 300px;
    }

    .grafico-barrios-canvas {
        width: 300px !important;
        height: 300px !important;
    }

    .barrios-panel-derecho {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .contenedor-estadisticas {
        width: 95%;
        margin-left: auto;
        margin-right: auto;
        padding: 15px 0;
    }

    .titulo-estadisticas {
        font-size: 24px;
    }

    .resumen-layout {
        grid-template-columns: 1fr;
    }

    .panel-totales,
    .resumen-layout.modo-comisaria .panel-totales {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto;
    }

    .panel-totales .tarjeta-total,
    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total {
        flex: none !important;
        width: 100% !important;
        margin-bottom: 10px;
        padding: 15px 20px !important;
    }

    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total {
        padding: 12px 15px !important;
    }

    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total-icono {
        width: 35px;
        height: 35px;
    }

    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total-icono img {
        width: 20px;
        height: 20px;
    }

    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total-info h3 {
        font-size: 16px;
    }

    .resumen-layout.modo-comisaria .panel-totales .tarjeta-total-info .numero {
        font-size: 22px;
    }

    .grafico-donut-comisarias {
        width: 180px !important;
        height: 180px !important;
        min-width: 150px;
    }

    .seccionBotonesComisarias {
        flex-wrap: wrap;
    }

    .botonTodos, .botonC1, .botonC2, .botonC3, .botonC4, .botonC5, .botonC6 {
        flex: 1 1 calc(33.333% - 5px);
        font-size: 14px;
        height: 40px;
    }

    .estadisticas-grid {
        grid-template-columns: 1fr;
    }

    .tabla-comisarias {
        font-size: 12px;
    }

    .tabla-comisarias thead th,
    .tabla-comisarias tbody td {
        padding: 8px 3px;
    }

    .filtros-fila {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .filtro-grupo {
        width: 100%;
        min-width: auto !important;
    }

    .boton-aplicar-filtros {
        width: 100%;
        min-width: auto;
    }

    .contador-tipos-container {
        flex-direction: column;
        gap: 12px;
    }

    .contador-tipo-card {
        min-width: auto;
        padding: 15px 18px;
    }

    .contador-tipo-icono {
        width: 45px;
        height: 45px;
    }

    .contador-tipo-imagen {
        width: 28px;
        height: 28px;
    }

    .contador-tipo-info h4 {
        font-size: 14px;
    }

    .contador-tipo-numero {
        font-size: 26px;
    }

    .grafico-barrios-container {
        flex-direction: column;
        align-items: center;
    }

    .grafico-barrios-wrapper {
        width: 280px;
        height: 280px;
    }

    .grafico-barrios-canvas {
        width: 280px !important;
        height: 280px !important;
    }

    .barrios-panel-derecho {
        width: 100%;
        max-height: 250px;
    }

    .comparativo-card {
        padding: 16px;
    }

    .comparativo-canvas-wrapper {
        height: 280px;
    }

    .comparativo-tabla-card {
        padding: 16px;
        overflow-x: auto;
    }

    .comp-tabla {
        font-size: 11px;
        min-width: 400px;
    }

    .comp-tabla thead th,
    .comp-tabla tbody td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .titulo-estadisticas {
        font-size: 20px;
    }

    .seccion-titulo-panel h2,
    .seccion-titulo h2 {
        font-size: 16px;
    }

    .grafico-donut-comisarias {
        width: 150px !important;
        height: 150px !important;
    }

    .panel-totales .tarjeta-total-icono {
        width: 35px;
        height: 35px;
    }

    .panel-totales .tarjeta-total-icono img {
        width: 20px;
        height: 20px;
    }

    .panel-totales .tarjeta-total-info h3 {
        font-size: 14px;
    }

    .panel-totales .tarjeta-total-info .numero {
        font-size: 20px;
    }

    .botonTodos, .botonC1, .botonC2, .botonC3, .botonC4, .botonC5, .botonC6 {
        flex: 1 1 calc(50% - 5px);
        font-size: 12px;
        height: 38px;
    }

    .grafico-pastel-container.grafico-donut-container .grafico-pastel {
        width: 120px !important;
        height: 120px !important;
    }

    .grafico-barrios-wrapper {
        width: 240px;
        height: 240px;
    }

    .grafico-barrios-canvas {
        width: 240px !important;
        height: 240px !important;
    }

    .leyenda-barrio-fila {
        font-size: 11px;
        gap: 6px;
    }

    .leyenda-barrio-pct {
        min-width: 40px;
    }

    .leyenda-barrio-total {
        min-width: 24px;
    }

    .comparativo-canvas-wrapper {
        height: 220px;
    }
}