.dashboard-container {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
}

.cards-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 15px;
}


.stats-card-compact {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.85) 0%, rgba(21, 101, 192, 0.85) 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    cursor: pointer;
    position: relative;
}

    .stats-card-compact:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }


.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.stats-card-title {
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-align: left;
}

.maximize-btn-white {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    gap: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

    .maximize-btn-white:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

.stats-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


.stats-number-compact {
    font-size: 42px;
    font-weight: bold;
    color: white;
    margin: 5px 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stats-label-compact {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 8px;
    font-weight: 500;
}

.stats-icon-compact {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}


.multi-stats-card-compact {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    cursor: pointer;
    position: relative;
}

    .multi-stats-card-compact:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }

    .multi-stats-card-compact.Siniestros {
        background: linear-gradient(135deg, rgba(13, 60, 97, 0.85) 0%, rgba(18, 72, 107, 0.85) 100%);
    }

    .multi-stats-card-compact.Ahorros {
        background: linear-gradient(135deg, rgba(67, 153, 120, 0.85) 0%, rgba(81, 155, 201, 0.85) 100%);
    }

    .multi-stats-card-compact.clientes {
        background: linear-gradient(135deg, rgba(55, 71, 79, 0.85) 0%, rgba(69, 90, 100, 0.85) 100%);
    }

    .multi-stats-card-compact.ventas {
        background: linear-gradient(135deg, rgba(21, 101, 192, 0.85) 0%, rgba(25, 118, 210, 0.85) 100%);
    }

    .multi-stats-card-compact.oportunidades {
        background: linear-gradient(135deg, rgba(13, 60, 97, 0.85) 0%, rgba(26, 35, 126, 0.85) 100%);
    }

.multi-stats-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-item-compact {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

    .stat-item-compact:last-child {
        border-bottom: none;
    }

.stat-item-number-compact {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


.stat-item-number-compact-min {
    /*font-size: 22px;*/
    font-weight: bold;
    color: white;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-item-label-compact {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 5px;
    font-weight: 500;
}

.chart-card-compact {
    background: rgba(240, 248, 255, 0.85);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 12px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    cursor: pointer;
    position: relative;
}


    .chart-card-compact:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

.chart-card-title-compact {
    font-size: 14px;
    font-weight: bold;
    color: #0d3c61;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px solid #1565c0;
    padding-bottom: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.maximize-btn {
    background: rgba(21, 101, 192, 0.8);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    gap: 5px;
    white-space: nowrap;
}

    .maximize-btn:hover {
        background: rgba(21, 101, 192, 1);
        transform: scale(1.1);
    }


.chart-card-wide {
    flex: 2;
    min-width: 450px;
}


.vertical-cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-width: 180px;
}

    .vertical-cards-container .multi-stats-card-compact {
        min-width: unset;
    }


.chart-produccion-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
}


.gauge-percentage-hover-area {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
}


.produccion-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 5px;
    padding: 0 10px;
}

.produccion-label-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.produccion-label-number {
    font-size: 18px;
    font-weight: bold;
    color: #0d3c61;
}

.produccion-label-text {
    font-size: 11px;
    color: #0d3c61;
    font-weight: 500;
}

.exitosa-color {
    color: #1b8a5e !important;
}

.no-exitosa-color {
    color: #d35400 !important;
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 1% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 93%;
    max-height: 96vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .close:hover {
        background: rgba(255,255,255,0.2);
        transform: rotate(90deg);
    }

.modal-body {
    flex: 1;
    padding: 30px;
    overflow: auto;
}

.modal-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 16px;
}

    .modal-placeholder i {
        font-size: 48px;
        margin-bottom: 20px;
        opacity: 0.5;
    }


.modal-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
}

.modal-chart-card {
    background: rgba(240, 248, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-chart-title {
    font-size: 16px;
    font-weight: bold;
    color: #0d3c61;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1565c0;
    text-align: center;
}

.modal-chart-container {
    flex: 1;
    min-height: 0;
}


.chart-card-hybrid {
    background: rgba(240, 248, 255, 0.85);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 12px;
    transition: all 0.3s ease;
    flex: 1.5;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    cursor: pointer;
    position: relative;
}

    .chart-card-hybrid:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

.cartera-content {
    display: flex;
    gap: 15px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.cartera-chart-section {
    flex: 1.2;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


.cartera-stats-section {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cartera-stat-box {
    background: linear-gradient(135deg, rgba(26, 108, 165, 0.10) 0%, rgba(46, 139, 199, 0.10) 100%);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    border: 2px solid rgba(26, 108, 165, 0.3);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .cartera-stat-box:hover {
        background: linear-gradient(135deg, rgba(26, 108, 165, 0.15) 0%, rgba(46, 139, 199, 0.15) 100%);
        border-color: rgba(26, 108, 165, 0.6);
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(26, 108, 165, 0.2);
    }

.cartera-stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #1a6ca5;
    line-height: 1;
    margin-bottom: 8px;
}

.cartera-stat-label {
    font-size: 12px;
    color: #0d3c61;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}


.cartera-stat-metric {
    font-size: 11px;
    color: #0d3c61;
    font-weight: 500;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(26, 108, 165, 0.3);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .cartera-stat-metric > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.cartera-stat-metric-label {
    font-weight: 600;
    color: #0d3c61;
    font-size: 11px;
}

.cartera-stat-metric-value {
    font-weight: 700;
    color: #1a6ca5;
    font-size: 13px;
}



.stats-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-detail-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.stats-detail-value {
    font-size: 14px;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


.stats-card-compact.polizas-extended {
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.85) 0%, rgba(21, 101, 192, 0.85) 100%);
}



.chart-card-siniestros {
    padding: 8px !important;
    flex: 1.3 !important;
    min-width: 320px !important;
}

    .chart-card-siniestros .chart-card-title-compact {
        margin-bottom: 4px;
        padding-bottom: 4px;
    }


.siniestros-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 0 8px;
    flex-wrap: wrap;
}

.siniestros-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

    .siniestros-legend-item:hover {
        background: #fff;
        border-color: #1a6ca5;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

.siniestros-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-radicados {
    background-color: #e67e22;
}

.legend-tramite {
    background-color: #f39c12;
}

.legend-pagados {
    background-color: #1b8a5e;
}

.legend-rechazados {
    background-color: #d35400;
}


.vertical-cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 0.7 !important;
    min-width: 150px;
}

    .vertical-cards-container .multi-stats-card-compact {
        min-width: unset;
    }


.multi-stats-card-compact.clientes {
    background: linear-gradient(135deg, rgba(55, 71, 79, 0.85) 0%, rgba(69, 90, 100, 0.85) 100%);
    flex: 0.7 !important;
    min-width: 150px !important;
}


#chartModalSecondary {
    z-index: 10001;
}

    #chartModalSecondary .modal-content {
        animation: modalSlideIn 0.3s ease;
    }

.modal-content-large {
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
}

.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.custom-modal-content {
    background: #fff;
    width: 90%;
    height: 70%;
    overflow-y: scroll;
    /*max-width: 1000px;*/
    border-radius: 10px;
    padding: 20px;
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
}

.modalBody {
    width: 70%;
    overflow-y: scroll;
}

.modal-close-btn:hover {
    color: #000;
    transform: scale(1.2);
}

.chart-canvas {
    width: 100%;
    height: 160px;
}

.tt-box {
    padding: 8px;
}

.tt-box-lg {
    padding: 15px;
    max-width: 420px;
    min-width: 380px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.tt-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    border-bottom: 3px solid #1a6ca5;
    padding-bottom: 8px;
    color: #0d3c61;
}

.tt-title-sm {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: #0d3c61;
}

.tt-key {
    color: #1a6ca5;
}

.tt-sep {
    margin: 6px 0;
}

/* --- paneles del tooltip del gauge --- */

.tt-panel {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.tt-panel-ok {
    background: rgba(27, 138, 94, 0.08);
    border-left: 4px solid #1b8a5e;
}

.tt-panel-warn {
    background: rgba(211, 84, 0, 0.06);
    border-left: 4px solid #d35400;
    margin-bottom: 16px;
}

.tt-panel-head {
    color: #0d3c61;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.tt-panel-text {
    color: #4a5568;
    font-size: 13px;
    line-height: 1.4;
}

.tt-footer {
    padding: 10px;
    background: linear-gradient(90deg, #1b8a5e 0%, #1a6ca5 100%);
    border-radius: 8px;
    text-align: center;
    margin-top: 8px;
}

.tt-footer-title {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    margin-bottom: 2px;
}

.tt-footer-value {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tt-footer-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}