/* KVH WATER STATISTICS V1 */

.kws {
    --brand: #1f5875;
    --muted: #557487;
    --soft: #eff5f8;
    --border: #d7e3e9;
    padding: 32px;
    border-radius: 20px;
    background: #fff;
    color: #304956;
    min-width: 0;
    box-sizing: border-box;
}

.kws .kws-heading {
    border-left: 4px solid var(--brand);
    padding-left: 20px;
    margin-bottom: 32px;
}

.kws h2, .kws h3 {
    color: var(--brand);
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 18px;
}

.kws h2 { font-size: 25px; }
.kws h3 { font-size: 21px; }
.kws .kws-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.kws .kws-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.kws .kws-kpi {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    padding: 22px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--soft);
}

.kws .kws-kpi span {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.kws .kws-kpi strong {
    font-size: 32px;
    line-height: 1.2;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.kws .kws-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.kws .kws-primary span,
.kws .kws-primary strong {
    color: #fff;
}

.kws .kws-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.kws .kws-chart-scroll,
.kws .kws-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.kws .kws-chart {
    display: block;
    width: 100%;
    min-width: 650px;
    height: auto;
}

.kws .kws-gridline {
    stroke: var(--border);
    stroke-dasharray: 4 4;
}

.kws .kws-axis {
    font-size: 12px;
    fill: var(--muted);
}

.kws .kws-value {
    font-size: 13px;
    font-weight: 600;
    fill: var(--brand);
}

.kws .kws-trend {
    stroke: var(--brand);
    stroke-width: 3;
    stroke-linecap: round;
}

.kws .kws-partial { stroke-dasharray: 6 5; }
.kws .kws-dot {
    fill: var(--brand);
    stroke: #fff;
    stroke-width: 2;
}
.kws .kws-dot-open {
    fill: #fff;
    stroke: var(--brand);
    stroke-width: 2;
}

.kws .kws-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
}

.kws table {
    width: 100%;
    min-width: 740px;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.kws th, .kws td {
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 15px 12px;
    text-align: center;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.kws th:first-child {
    text-align: left;
    font-weight: 600;
}

.kws thead th {
    color: #fff;
    background: var(--brand);
    font-weight: 600;
}

.kws tbody tr:nth-child(even) {
    background: #f7f9fa;
}

.kws tbody tr.kws-highlight,
.kws tfoot tr {
    background: #e7f0f4;
    color: var(--brand);
    font-weight: 600;
}

.kws .kws-branch-table { min-width: 870px; }

.kws .kws-filter:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.kws .kws-filter select {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--brand);
    background: #fff;
    font: inherit;
}

.kws .kws-branch-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 10px;
    background: var(--soft);
    margin-bottom: 24px;
}

.kws .kws-branch-summary strong {
    font-size: 26px;
    color: var(--brand);
}

.kws .kws-bars {
    display: grid;
    gap: 16px;
}

.kws .kws-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    margin-bottom: 8px;
}

.kws .kws-bar-label strong {
    color: var(--brand);
    white-space: nowrap;
}

.kws .kws-track {
    height: 10px;
    border-radius: 6px;
    background: #e7f0f4;
    overflow: hidden;
}

.kws .kws-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transition: width .25s ease;
}

.kws .kws-note {
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
    margin: 14px 0;
}

.kws .kws-history {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

@media (max-width: 991px) {
    .kws .kws-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .kws { padding: 20px 16px; }
    .kws h2 { font-size: 20px; }
    .kws h3 { font-size: 18px; }
    .kws .kws-kpis { gap: 10px; }
    .kws .kws-kpi { padding: 14px; }
    .kws .kws-kpi strong { font-size: 24px; }
    .kws .kws-kpi span { font-size: 12px; }
    .kws .kws-heading { padding-left: 12px; }
    .kws .kws-filter select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .kws .kws-fill { transition: none; }
}


/* BEGIN KVH WATERSTATS DESIGN V2 */

/* Official section heading */

.kws .kws-heading {
    display: block;
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
    background: transparent;
    border: 0;
    border-left: 4px solid #1f5875;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0 4px 20px;
    margin: 0 0 32px;
}

.kws .kws-heading h2 {
    color: #1f5875;
    font-size: 24px;
    line-height: 1.5;
    font-weight: 600;
    text-transform: none;
    margin: 0 0 12px;
    background: transparent;
    overflow-wrap: break-word;
}

.kws .kws-heading p {
    color: #557487;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}


/* Table dimensions */

.kws .kws-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.kws .kws-table-wrap table {
    width: 100%;
    min-width: 900px;
    table-layout: auto !important;
    border-collapse: collapse;
    margin: 0;
}

.kws .kws-table-wrap table.kws-branch-table {
    min-width: 1050px;
}


/* Reset inherited table styles */

.kws .kws-table-wrap table th,
.kws .kws-table-wrap table td {
    font-size: 14px;
    line-height: 1.5;
    padding: 13px 12px;
    vertical-align: middle;
    text-transform: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none;
}


/* Table header */

.kws .kws-table-wrap table thead th {
    background: #1f5875 !important;
    color: #fff !important;
    font-weight: 600;
    text-align: center;
    white-space: normal;
}


/* Light backgrounds for all body cells */

.kws .kws-table-wrap table tbody th,
.kws .kws-table-wrap table tbody td {
    background: #fff !important;
    color: #304956 !important;
}

.kws .kws-table-wrap table tbody tr:nth-child(even) > th,
.kws .kws-table-wrap table tbody tr:nth-child(even) > td {
    background: #f7f9fa !important;
}


/* Remove dark row headers */

.kws .kws-table-wrap table tbody th,
.kws .kws-table-wrap table tfoot th {
    font-weight: 600;
    text-align: left;
    text-transform: none !important;
}


/* Keep all numeric values on one line */

.kws .kws-table-wrap table td,
.kws .kws-table-wrap table td strong,
.kws .kws-table-wrap table:not(.kws-branch-table)
    tbody th:first-child {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    font-variant-numeric: tabular-nums;
}

.kws .kws-table-wrap table td {
    text-align: center;
}


/* Annual table: year column */

.kws .kws-table-wrap table:not(.kws-branch-table)
    th:first-child {
    min-width: 76px;
    white-space: nowrap !important;
    text-align: center;
}


/* Totals and agricultural producers */

.kws .kws-table-wrap table tr > :nth-child(2),
.kws .kws-table-wrap table tr > :nth-child(3) {
    min-width: 96px;
    white-space: nowrap !important;
}


/* Consumer group columns */

.kws .kws-table-wrap table thead th:nth-child(4),
.kws .kws-table-wrap table thead th:nth-child(5),
.kws .kws-table-wrap table thead th:nth-child(7) {
    min-width: 150px;
}

.kws .kws-table-wrap table tr > :nth-child(6) {
    min-width: 92px;
    white-space: nowrap !important;
}


/* Branch names */

.kws .kws-table-wrap table.kws-branch-table
    tr > :first-child {
    min-width: 220px;
    text-align: left;
}

.kws .kws-table-wrap table.kws-branch-table
    tbody th:first-child {
    color: #1f5875 !important;
    white-space: normal !important;
}


/* Latest year and grand totals */

.kws .kws-table-wrap table tbody tr.kws-highlight > th,
.kws .kws-table-wrap table tbody tr.kws-highlight > td,
.kws .kws-table-wrap table tfoot tr > th,
.kws .kws-table-wrap table tfoot tr > td {
    background: #e7f0f4 !important;
    color: #1f5875 !important;
    font-weight: 600;
}


/* Mobile adjustments */

@media (max-width: 576px) {
    .kws .kws-heading {
        padding-left: 12px;
        margin-bottom: 24px;
    }

    .kws .kws-heading h2 {
        font-size: 19px;
        line-height: 1.45;
    }

    .kws .kws-table-wrap table th,
    .kws .kws-table-wrap table td {
        font-size: 13px;
        padding: 11px 10px;
    }
}

/* END KVH WATERSTATS DESIGN V2 */
