/**
 * dbv.css - Estilos del modulo Dashboard Cumplimiento de Visitas
 * @version 1.0.0
 * @author Equipo ERP
 * @date 2026-07-14
 */

[data-dbv-module="dbv"] {
    --dbv-primary: #ef8f12;
    --dbv-primary-dark: #c66f00;
    --dbv-primary-soft: #fff3da;
    --dbv-top-blue: #ef8f12;
    --dbv-top-blue-dark: #c66f00;
    --dbv-top-blue-soft: #fff3da;
    --dbv-ink: #27364a;
    --dbv-muted: #6b7785;
    --dbv-border: #e6dcc8;
    --dbv-surface: #fffaf2;
    --dbv-surface-strong: #fff2cf;
    --dbv-shadow: 0 14px 30px rgba(70, 49, 11, 0.08);
}

.dbv-wrapper {
    background: linear-gradient(180deg, #fff7e9 0%, #f8f4eb 180px, #f4f5f7 181px, #f4f5f7 100%);
    min-height: calc(100vh - 57px);
}

.dbv-header {
    background: transparent;
    color: var(--dbv-ink);
    margin-bottom: 1rem;
    box-shadow: none;
}

.dbv-pagebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0 0.85rem;
}

.dbv-pagebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dbv-pagebar-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef8f12 0%, #ffbc49 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(198, 111, 0, 0.22);
}

.dbv-pagebar-copy h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #10243d;
    letter-spacing: 0.01em;
}

.dbv-pagebar-crumbs {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    color: #7a8694;
    font-size: 0.9rem;
}

.dbv-pagebar-crumbs a {
    color: #d48000;
}

.dbv-filter-panel {
    background: #fff;
    border: 1px solid #dbe6ee;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(50, 80, 110, 0.08);
    overflow: hidden;
}

.dbv-filter-panel-head {
    background: linear-gradient(180deg, var(--dbv-top-blue) 0%, var(--dbv-top-blue-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
}

.dbv-filter-panel-title {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dbv-filter-panel-help {
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.15rem 0.3rem;
}

.dbv-filter-panel-body {
    padding: 0.95rem 1rem 1.05rem;
}

.dbv-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2.1fr) minmax(180px, 1.25fr) minmax(180px, 0.95fr);
    gap: 0.95rem 0.85rem;
    align-items: end;
}

.dbv-filter-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #5f7084;
    margin-bottom: 0.38rem;
}

.dbv-filter-panel .form-control {
    min-height: 38px;
    border-radius: 4px;
    border-color: #cfd8e3;
    box-shadow: none;
}

.dbv-filter-field-period .form-control {
    border-color: #7db2ff;
    box-shadow: 0 0 0 2px rgba(110, 169, 255, 0.16);
    color: #0b63d1;
    font-weight: 700;
}

.dbv-filter-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dbv-filter-actions .btn {
    min-height: 38px;
    border-radius: 999px;
    padding-inline: 1rem;
    font-weight: 700;
}

.dbv-filter-actions-secondary {
    align-self: end;
}

.dbv-meta-bar {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dbv-meta-item {
    background: #fff;
    border: 1px solid var(--dbv-border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    box-shadow: var(--dbv-shadow);
    min-width: 180px;
}

.dbv-meta-label {
    display: block;
    color: var(--dbv-muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dbv-meta-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dbv-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.dbv-kpi-card {
    background: linear-gradient(180deg, #fff 0%, var(--dbv-surface) 100%);
    border: 1px solid var(--dbv-border);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    box-shadow: var(--dbv-shadow);
}

.dbv-kpi-label {
    display: block;
    color: var(--dbv-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dbv-kpi-value {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    color: var(--dbv-ink);
    margin-top: 0.25rem;
}

.dbv-kpi-foot {
    color: var(--dbv-muted);
}

.dbv-status {
    border-radius: 14px;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.dbv-status-loading {
    background: #fff6dc;
    color: #8b5a00;
    border: 1px solid #f4dc97;
}

.dbv-status-error {
    background: #fff0ef;
    color: #b5392f;
    border: 1px solid #f3b1aa;
}

.dbv-status-empty {
    background: #eef4fb;
    color: #3c5f84;
    border: 1px solid #c8d8ea;
}

.dbv-card {
    border: 1px solid var(--dbv-border);
    border-radius: 18px;
    box-shadow: var(--dbv-shadow);
    overflow: hidden;
    background: #fff;
    margin-bottom: 1rem;
}

.dbv-card .card-header {
    background: linear-gradient(180deg, var(--dbv-top-blue) 0%, var(--dbv-top-blue-dark) 100%);
    color: #fff;
    border-bottom: 1px solid var(--dbv-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dbv-card .card-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.dbv-card-stretch {
    height: calc(100% - 1rem);
    min-height: 0;
}

@media (min-width: 992px) {
    .dbv-main-grid > .col-xl-8.col-lg-7 {
        position: relative;
    }

    .dbv-main-grid > .col-xl-8.col-lg-7 > .dbv-card-stretch {
        position: absolute;
        top: 0;
        right: 7.5px;
        bottom: 0;
        left: 7.5px;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .dbv-card-stretch .card-body {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    #tblDbvEstaciones_wrapper {
        height: 100%;
    }

    .dbv-card-stretch .table-responsive {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: hidden;
    }

    #tblDbvEstaciones_wrapper {
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    .dbv-stations-info {
        flex: 0 0 2rem;
        background: #fff;
    }

    #tblDbvEstaciones_wrapper > .row:nth-child(2) {
        flex: 1 1 0;
        min-height: 0;
    }

    #tblDbvEstaciones_wrapper > .row:nth-child(2) > .col-sm-12 {
        display: flex;
        min-height: 0;
        flex-direction: column;
    }

    #tblDbvEstaciones_wrapper .dataTables_scroll {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    #tblDbvEstaciones_wrapper .dataTables_scrollBody {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
    }
}

.dbv-chart {
    min-height: 280px;
}

.dbv-main-grid .table thead th {
    background: #ffe7aa;
    color: #5d430b;
    border-color: #f0d48c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.dbv-main-grid .table td {
    vertical-align: middle;
    border-color: #f0eadb;
}

.dbv-main-grid tbody tr {
    transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
}

.dbv-main-grid tbody tr.selected {
    background: #fff0b6;
    box-shadow: inset 4px 0 0 #d66f00;
}

.dbv-main-grid tbody tr.related {
    background: #fff9e6;
}

.dbv-main-grid tbody tr.dimmed {
    opacity: 0.38;
}

.dbv-main-grid tbody tr:focus,
.dbv-main-grid tbody tr:hover {
    background: #fff5cf;
}

.dbv-week-chip {
    display: inline-flex;
    min-height: 30px;
    min-width: 38px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: #fff7e5;
    border: 1px solid #efd8a2;
    color: #6f5113;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.35rem;
}

.dbv-week-chip.is-empty {
    background: transparent;
    border-style: dashed;
    color: #ad9f81;
}

.dbv-week-chip.is-complete {
    background: #e7f8e8;
    border-color: #93c798;
    color: #22612d;
}

.dbv-week-chip.is-partial {
    background: #fff4dd;
    border-color: #f0c267;
}

.dbv-percent {
    font-weight: 800;
    color: var(--dbv-ink);
}

.dbv-percent small {
    display: block;
    color: var(--dbv-muted);
    font-weight: 600;
}

.dbv-modal-header {
    background: linear-gradient(135deg, var(--dbv-primary-dark) 0%, var(--dbv-primary) 100%);
    color: #fff;
}

.dbv-help-block {
    border: 1px solid #f1e5c6;
    background: #fff9ec;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
}

.dbv-help-block h6 {
    color: var(--dbv-ink);
    font-weight: 800;
}

.dbv-help-legend {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dbv-help-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dbv-help-chip.selected {
    background: #fff0b6;
    color: #7d4900;
}

.dbv-help-chip.related {
    background: #fff8de;
    color: #755619;
}

.dbv-help-chip.dimmed {
    background: #eceff3;
    color: #7a8391;
}

.dbv-dt-empty {
    color: var(--dbv-muted);
    padding: 1rem 0.5rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .dbv-pagebar {
        flex-direction: column;
        align-items: flex-start;
    }

    .dbv-filter-grid {
        grid-template-columns: 1fr;
    }

    .dbv-kpi-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .dbv-pagebar-copy h1 {
        font-size: 1.45rem;
    }

    .dbv-meta-item {
        min-width: 100%;
    }

    .dbv-filter-actions {
        justify-content: stretch;
    }

    .dbv-filter-actions .btn {
        width: 100%;
    }

    .dbv-main-grid .table {
        font-size: 0.82rem;
    }
}
