/**
 * dbv.css - Estilos del modulo Dashboard Cumplimiento de Visitas
 * @version 2.0.5
 * @author Equipo ERP
 * @date 2026-11-17
 */

[data-dbv-module="dbv"] {
    --dbv-primary: #008bd4;
    --dbv-primary-dark: #005aaa;
    --dbv-primary-soft: #e9f5ff;
    --dbv-top-blue: #008bd4;
    --dbv-top-blue-dark: #005aaa;
    --dbv-top-blue-soft: #e9f5ff;
    --dbv-ink: #27364a;
    --dbv-muted: #6b7785;
    --dbv-border: #bfd6e8;
    --dbv-surface: #f5faff;
    --dbv-surface-strong: #e6f3ff;
    --dbv-shadow: 0 14px 30px rgba(23, 81, 125, 0.10);
}

[data-dbv-module="dbv"] [hidden] { display: none !important; }
.dbv-tabs { display: flex; gap: 6px; border-bottom: 2px solid #0077bf; margin-bottom: 12px; }
.dbv-tabs button { border: 1px solid #bfd6e8; border-bottom: 0; border-radius: 9px 9px 0 0; background: #edf6fe; padding: 10px 28px; color: #245274; font-weight: 800; }
.dbv-tabs button[aria-selected="true"] { background: linear-gradient(#008bd4, #005aaa); color: white; }
.dbv-tabs { overflow-x: auto; }
.dbv-tabs button { flex-shrink: 0; }
.dbv-cer-kpis, .dbv-cer-summary { display: grid; gap: 10px; }
.dbv-cer-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
.dbv-cer-kpi > span { display: grid; min-width: 0; gap: 2px; }
.dbv-cer-kpi[data-estado="pendiente"] { background: #fff5dc; border-color: #e7be70; }
.dbv-cer-kpi[data-estado="pendiente"] > i { background: #ffebbc; color: #885200; }
.dbv-cer-kpi[data-estado="aprobado"] { background: #edf8e9; border-color: #9dc894; }
.dbv-cer-kpi[data-estado="aprobado"] > i { background: #d8edcb; color: #286620; }
.dbv-cer-kpi.dbv-cer-kpi-services { background: #eef8f8; border-color: #a6d3d7; cursor: default; }
.dbv-cer-kpi.dbv-cer-kpi-services > i { background: #d3eef0; color: #17636c; }
.dbv-cer-summary { grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr); margin-bottom: 10px; }
.dbv-cer-summary .dbv-advance-card { min-width: 0; }
#dbvCer .dbv-advance-card > h3 { font-size: 19px; padding-block: 8px; }
.dbv-cer-summary > .dbv-advance-card:first-child { display: flex; flex-direction: column; }
.dbv-cer-approval { flex: 1; display: grid; grid-template-columns: clamp(96px, calc(100% - 132px), 228px) minmax(0, 164px);
    justify-content: center; align-content: center; align-items: center; gap: clamp(12px, 2vw, 24px);
    padding: 18px 16px; font-size: clamp(14px, 1.4vw, 20px); font-weight: 600; line-height: 1.4; }
.dbv-cer-donut { display: grid; place-items: center; position: relative; isolation: isolate; width: 100%; aspect-ratio: 1;
    border-radius: 50%; background: conic-gradient(#398322 var(--dbv-cer-aprobado), #dce5eb 0); color: #225c1f; }
.dbv-cer-donut strong { font-size: clamp(16px, 1.95vw, 28px); line-height: 1; }
.dbv-cer-donut::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: white; z-index: -1; }
.dbv-cer-groups { padding: 8px 12px 12px; }
.dbv-cer-group { display: grid; gap: 6px; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1fr) minmax(70px, .55fr);
    margin-bottom: 4px; text-align: center; font-size: .82rem; }
.dbv-cer-group strong { overflow-wrap: anywhere; }
.dbv-cer-group-header { color: #23486e; font-weight: 700; }
.dbv-cer-group button { position: relative; isolation: isolate; min-height: 27px; padding: 1px 6px; border-radius: 4px;
    border: 1px solid #bfd6eb; background: #eff7ff; color: #102c47; }
.dbv-cer-group button > span { position: absolute; z-index: -1; inset: 0 auto 0 0; background: #9cd4ff; border-radius: 3px; }
.dbv-cer-group button[data-estado=""] > span { right: 0; left: auto; }
.dbv-cer-group button[data-estado="aprobado"] > span { background: #b4e294; }
.dbv-cer-group button[data-estado="pendiente"], .dbv-cer-chip[data-estado="pendiente"] { background: #fff3d7; color: #774501; }
.dbv-cer-group button[data-estado="pendiente"] > span { background: #ffe1a3; }
.dbv-cer-detail h3 { gap: 8px; flex-wrap: wrap; }
.dbv-cer-toolbar, .dbv-cer-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; }
.dbv-cer-toolbar .dbv-pending-tabs { flex-wrap: wrap; }
.dbv-cer-toolbar .dbv-pending-tabs button { font-size: 14px; }
.dbv-cer-toolbar input { flex: 1; min-width: 180px; max-width: 340px; }
.dbv-cer-pagination span { margin-right: auto; }
.dbv-cer-table { min-width: 790px; }
.dbv-cer-sort { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%;
    padding: 2px 0; border: 0; background: transparent; color: inherit; text-align: left; font-size: 14px; font-weight: 700; }
.dbv-cer-sort-icon::before { content: '↕'; }
.dbv-cer-table th[aria-sort="ascending"] .dbv-cer-sort-icon::before { content: '↑'; }
.dbv-cer-table th[aria-sort="descending"] .dbv-cer-sort-icon::before { content: '↓'; }
.dbv-cer-table tbody td { font-size: 15px; line-height: 1.4; }
.dbv-cer-table tbody small { font-size: 13px; }
.dbv-cer-table tbody .btn-sm { font-size: 14px; }
.dbv-cer-download { min-width: 4.25rem; }
.dbv-cer-chip { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #edf1f5; color: #344b62; font-size: 14px; }
.dbv-cer-chip[data-estado="aprobado"] { background: #e5f5dc; color: #235b20; }
@media (max-width: 850px) {
    .dbv-cer-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dbv-cer-summary { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .dbv-cer-kpis { grid-template-columns: 1fr; }
    .dbv-cer-group { gap: 4px; font-size: .7rem; }
}
.dbv-advance-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.dbv-advance-kpi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid #bfd3e7; border-radius: 13px; background: linear-gradient(120deg, #fff, #edf5fd); box-shadow: 0 2px 4px #184b7520; color: #101c39; text-align: left; }
.dbv-advance-kpi > i { display: grid; place-items: center; flex: 0 0 46px; height: 46px; font-size: 27px; border-radius: 50%; background: #cdeeff; color: #0076ce; }
.dbv-advance-kpi-label { display: block; font-size: 12px; font-weight: 800; line-height: 1.25; }
.dbv-advance-kpi strong { display: block; font-size: 28px; line-height: 1.1; font-weight: 800; }
.dbv-advance-kpi small { display: block; font-size: 11px; }
.dbv-cer-kpi strong { font-size: 36px; }
.dbv-cer-kpi small { font-size: 14px; line-height: 1.3; }
.dbv-cer-kpi small:first-child { font-size: 15px; font-weight: 700; }
.dbv-advance-kpi-pending { background: linear-gradient(#f9fff5, #dffbd0); border-color: #a4cea3; color: #167207; width: 100%; }
.dbv-advance-kpi-pending .dbv-advance-kpi-label { color: #172a27; }
.dbv-advance-kpi-pending > i { background: transparent; color: #e66a00; border-radius: 0; flex-basis: 36px; }
.dbv-advance-kpi-pending > b { margin-left: auto; font-size: 28px; }
.dbv-advance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dbv-advance-card { min-width: 0; border: 1px solid #acd4e9; border-radius: 12px; overflow: hidden; background: linear-gradient(#fff, #f3f8fd); box-shadow: 0 2px 5px #16547826; }
.dbv-advance-card > h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 5px 12px; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(#008bd4, #005aaa); line-height: 1.35; }
.dbv-advance-card > h3 > i { margin-right: 6px; }
.dbv-advance-summary .dbv-advance-card > h3 { justify-content: flex-start; }
.dbv-green > h3 { background: linear-gradient(#60be0c, #1b8900); }
.dbv-donut-body { display: flex; align-items: center; justify-content: space-evenly; gap: 16px; padding: 12px 18px; min-height: 174px; }
.dbv-donut { width: 140px; height: 140px; flex: 0 0 140px; border-radius: 50%; background: conic-gradient(#0097e4 0%, #0074cd var(--dbv-percent), #b3bfce var(--dbv-percent), #b3bfce 100%); display: grid; place-items: center; transform: rotate(0deg); }
.dbv-donut-green { background: conic-gradient(#4dc408 0%, #249c00 var(--dbv-percent), #b3bfce var(--dbv-percent), #b3bfce 100%); }
.dbv-donut > span { width: 94px; height: 94px; display: flex; justify-content: center; align-items: center; flex-direction: column; border-radius: 50%; background: #fff; color: #0e1735; font-size: 13px; font-weight: 700; line-height: 1.2; }
.dbv-donut strong { font-size: 30px; font-weight: 800; }
.dbv-donut-legend { flex: 1; max-width: 180px; color: #111d36; font-size: 13px; }
.dbv-donut-legend > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; line-height: 1.15; }
.dbv-donut-legend strong { font-size: 17px; }
.dbv-donut-total { border-top: 1px solid #b5c7d8; margin-top: 5px; font-weight: 700; }
.dbv-key { display: inline-block; width: 11px; height: 11px; margin-right: 8px; background: linear-gradient(#13bdff,#0071c7); border-radius: 2px; }
.dbv-key-green { background: linear-gradient(#65db1d,#20a000); }
.dbv-key-gray { background: #b3bfce; }
.dbv-priorities { display: grid; gap: 7px; padding: 12px 16px; }
.dbv-priority-row { display: flex; align-items: center; gap: 12px; padding: 5px 12px; border: 0; border-radius: 8px; width: 100%; text-align: left; min-height: 40px; }
.dbv-priority-row i { font-size: 24px; }
.dbv-priority-row strong, .dbv-priority-row small { display: block; line-height: 1.2; }
.dbv-priority-row small { color: #1a2636; font-size: 12px; }
.dbv-priority-row b { margin-left: auto; white-space: nowrap; }
.dbv-priority-alta { background: #ffdddd; color: #c60000; }
.dbv-priority-media { background: #fff2bf; color: #935000; }
.dbv-priority-al_dia { background: #d7f8c5; color: #155c0a; }
.dbv-priority-row[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -2px; }
.dbv-advance-detail { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); gap: 12px; margin-bottom: 16px; }
.dbv-advance-detail .table-responsive { padding: 4px 8px; }
.dbv-advance-detail > article:last-child { display: flex; flex-direction: column; }
.dbv-advance-detail > article:last-child > .table-responsive { display: flex; flex-direction: column; flex: 1; }
#tblDbvPendientes_wrapper { display: flex; flex-direction: column; flex: 1; }
#tblDbvPendientes_wrapper > .row:last-child { margin-top: auto; }
.dbv-advance-legend { font-size: 10px; border-radius: 20px; padding: 2px 8px; background: #fff; color: #10243d; white-space: nowrap; }
.dbv-advance-legend span:first-child { color: #008bd4; }
.dbv-advance-legend span:last-child { color: #20b332; }
.dbv-advance-table { margin-bottom: 0 !important; font-size: 11px; color: #14223a; }
.dbv-advance-table thead th { background: linear-gradient(#f8fcff,#dcebf7); border: 1px solid #c4d8e8; padding: 4px 5px; white-space: nowrap; }
.dbv-advance-table tbody td { padding: 4px 5px; vertical-align: middle; border-top: 1px solid #d8e5f0; }
.dbv-advance-table tbody tr:nth-child(even) { background: #edf4fb; }
.dbv-advance-table tbody td:first-child { white-space: nowrap; }
#tblDbvAvanceClientes tbody tr[tabindex] { cursor: pointer; }
#tblDbvAvanceClientes tbody tr.dbv-advance-client-selected > td { background: #d7eeff; }
#tblDbvAvanceClientes tbody tr.dbv-advance-client-selected > td:first-child { box-shadow: inset 4px 0 0 #0076c8; }
#tblDbvAvanceClientes tbody tr[tabindex]:focus-visible { outline: 2px solid #0076c8; outline-offset: -2px; }
.dbv-required { display: inline-block; border-radius: 20px; padding: 0 10px; background: #ded9ff; color: #282474; font-weight: 700; white-space: nowrap; }
.dbv-bar-cell { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 10px; }
.dbv-progress { display: inline-block; width: 64px; height: 12px; background: #d8e2ec; overflow: hidden; flex-shrink: 0; }
.dbv-progress > span { display: block; height: 100%; background: linear-gradient(90deg,#007aff,#20c4ff); }
.dbv-progress-green > span { background: linear-gradient(90deg,#12b33e,#59dc52); }
.dbv-no-service { display: block; text-align: center; color: #8293a6; }
.dbv-priority-badge { display: block; text-align: center; padding: 0 12px; border-radius: 20px; font-weight: 700; white-space: nowrap; }
.dbv-pending-tabs { display: inline-flex; border-radius: 20px; background: #e8f0f7; padding: 1px; }
.dbv-pending-tabs button { border: 0; border-radius: 20px; padding: 3px 9px; font-size: 10px; color: #14223a; background: transparent; white-space: nowrap; }
.dbv-pending-tabs button[aria-pressed="true"] { color: #fff; background: linear-gradient(#08adfb,#0076d2); box-shadow: 0 1px 3px #004e8e70; }
.dbv-advance-card .dataTables_info { font-size: 11px; padding: 8px; }
.dbv-advance-card .dataTables_paginate { padding: 4px 8px; font-size: 11px; }
.dbv-advance-card .page-link { padding: 5px 8px; border-radius: 5px; margin: 0 2px; }
.dbv-advance-card .dataTables_wrapper > .row { margin: 0; }
.dbv-advance-card .dataTables_wrapper > .row > div { padding: 0; }
.dbv-tabs button:focus-visible, .dbv-advance-card button:focus-visible, .dbv-advance-kpi:focus-visible { outline: 3px solid #41b4ff; outline-offset: 2px; }
@media (max-width: 1199.98px) {
    .dbv-advance-kpi { gap: 7px; padding: 8px; }
    .dbv-advance-kpi > i { flex-basis: 32px; height: 36px; font-size: 22px; }
    .dbv-donut-body { gap: 10px; padding: 12px; }
    .dbv-donut { width: 116px; height: 116px; flex-basis: 116px; }
    .dbv-donut > span { width: 78px; height: 78px; }
    .dbv-advance-detail { grid-template-columns: 1fr; }
}
@media (max-width: 991.98px) {
    .dbv-advance-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .dbv-advance-summary { grid-template-columns: 1fr; }
    .dbv-donut-legend { max-width: 240px; }
}
@media (max-width: 575.98px) {
    .dbv-advance-kpis { grid-template-columns: 1fr; }
    .dbv-advance-detail h3 { flex-wrap: wrap; }
    .dbv-tabs button { padding: 10px 16px; }
    .dbv-advance-table { min-width: 480px; }
}

.dbv-wrapper {
    background: linear-gradient(180deg, #eff8ff 0%, #f1f7fc 180px, #f4f5f7 181px, #f4f5f7 100%);
    min-height: calc(100vh - 57px);
}

.dbv-header {
    background: transparent;
    color: var(--dbv-ink);
    margin-bottom: 1rem;
    padding-bottom: 0;
    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, #008bd4 0%, #49c3ff 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(0, 100, 180, 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: #0074bf;
}

.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.3rem 0.75rem;
}

.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.55rem 0.75rem 0.65rem;
}

.dbv-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 1.65fr);
    gap: 0.65rem;
    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.25rem;
}

.dbv-filter-field {
    min-width: 0;
}

.dbv-filter-panel .form-control {
    min-height: 32px;
    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-panel .select2-container {
    width: 100% !important;
    min-width: 0;
}

.dbv-filter-panel .select2-selection--single {
    height: 32px;
    min-height: 32px;
}

.dbv-filter-panel .select2-selection__rendered {
    line-height: 30px !important;
}

.dbv-filter-panel .select2-selection__arrow {
    height: 30px;
}

#dbvFiltroSemana,
#dbvFiltroSemana + .select2-container .select2-selection--single {
    border-color: #008bd4 !important;
    color: #005aaa;
}

#dbvFiltroSemana + .select2-container .select2-selection__rendered {
    color: #005aaa !important;
}

.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(4, minmax(0, 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-card--pending .dbv-kpi-value {
    color: #15810b;
}

.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: #edf7ff;
    color: #005aaa;
    border: 1px solid #b9d9ef;
}

.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-export-button {
    border: 0;
    color: #005aaa;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.dbv-export-button:hover,
.dbv-export-button:focus {
    color: #00477c;
    background: #e9f5ff;
}

.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: #e0f0ff;
    color: #173d60;
    border-color: #bad7ee;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.dbv-main-grid .table td {
    vertical-align: middle;
    border-color: #dce8f2;
}

.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: #d7eeff;
    box-shadow: inset 4px 0 0 #0076c8;
}

.dbv-main-grid tbody tr.related {
    background: #eff8ff;
}

.dbv-main-grid tbody tr.dimmed {
    opacity: 0.38;
}

.dbv-main-grid tbody tr:focus,
.dbv-main-grid tbody tr:hover {
    background: #e1f2ff;
}

.dbv-week-chip {
    display: inline-flex;
    min-height: 30px;
    min-width: 38px;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: #edf7ff;
    border: 1px solid #b9d8ec;
    color: #235577;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.35rem;
}

.dbv-week-chip.is-empty {
    background: transparent;
    border-style: dashed;
    color: #8097a9;
}

.dbv-week-chip.is-complete {
    background: #e7f8e8;
    border-color: #93c798;
    color: #22612d;
}

.dbv-week-chip.is-partial {
    background: #fff8d8;
    border-color: #f0c267;
}

.dbv-filter-field-week .form-control {
    border-color: #92c5e8;
    color: #235577;
    font-weight: 700;
}

.dbv-filter-field-report .form-control {
    border-color: #92c5e8;
    color: #235577;
    font-weight: 700;
}

#tblDbvEstaciones .dbv-week-column {
    transition: opacity 0.18s ease, filter 0.18s ease;
}

#tblDbvEstaciones .dbv-week-column.is-week-muted {
    opacity: 0.24;
    filter: grayscale(0.45);
}

#tblDbvEstaciones tbody td.dbv-week-column.is-week-muted {
    pointer-events: none;
}

.dbv-visit-popover-card .popover-body {
    font-size: 1rem;
}

.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 #bdd9ee;
    background: #f1f8ff;
    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: #d7eeff;
    color: #005aaa;
}

.dbv-help-chip.related {
    background: #e6f5ff;
    color: #235577;
}

.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: repeat(2, minmax(0, 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-main-grid .table {
        font-size: 0.82rem;
    }

    .dbv-card-stretch .card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .dbv-filter-grid {
        grid-template-columns: 1fr;
    }
}
