#vergelijk {
    font-family: Arial, sans-serif;
    margin: 0px 0px;
    line-height: normal;
}

/* Buttons & controls */
#vergelijk .controls {
    margin-bottom: 15px;
}

#vergelijk .controls button {
    padding: 6px 12px;
    cursor: pointer;
}

#vergelijk .controls button.active {
    background-color: #999;
    color: #fff;
}

/* Titles */
#vergelijk .report-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#vergelijk .report-hint {
    font-size: 0.9rem;
    font-weight: normal;
    color: #555;
}

/* TABLES */
#vergelijk table {
    border-collapse: collapse;
    width: 100%;
}

#vergelijk th,
#vergelijk td {
    border: 1px solid #ccc;
    padding: 5px;
    text-align: right;
    position: relative;
    transition: background 0.2s;
}

#vergelijk th:first-child,
#vergelijk td:first-child {
    text-align: center;
    font-weight: bold;
}

/* Hovering */
#vergelijk .hovered {
    background-color: #ffffcc !important;
    cursor: default;
}

#vergelijk th.hovered,
#vergelijk td:first-child.hovered {
    background-color: rgba(255, 255, 153, 0.3);
}

/* Remove diagonal overlay */
#vergelijk td.hovered.intersection::after {
    content: none;
}

/* Header background */
#vergelijk thead {
    background: #f2f2f2;
}

/* Footer */
#vergelijk tfoot td {
    font-weight: bold;
    background-color: #d0d0d0;
}

/* Record colors */
#vergelijk .record-high {
    background-color: #fdd;
}

#vergelijk .record-low {
    background-color: #ddf;
}

/* Table container */
#vergelijk .table-container {
    max-height: 1200px;
    overflow: auto;
    border: 1px solid #ccc;
    position: relative;
    isolation: isolate;
}

/* Sticky header */
#vergelijk thead th {
    position: sticky;
    top: 0;
    background: #f2f2f2;
    z-index: 2;
}

/* Sticky first column */
#vergelijk th:first-child,
#vergelijk td:first-child {
    position: sticky;
    left: 0;
    background: #f2f2f2;
    z-index: 1;
}

/* Top-left cell */
#vergelijk thead th:first-child {
    z-index: 3;
}

/* Legend */
#vergelijk .legend {
    margin-top: 15px;
    font-size: 0.9em;
}

#vergelijk .legend span {
    display: inline-block;
    padding: 3px 8px;
    margin-right: 10px;
    border-radius: 3px;
    color: #000;
    font-weight: bold;
}

/* DAILY STATS TABLE */
#vergelijk #dailyStatsTable {
    table-layout: auto;
    width: auto;
    border-collapse: separate;
    border-spacing: 0;
}

#vergelijk #dailyStatsTable th .th-label {
    display: inline;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.2em;
    max-width: 120px;
}

#vergelijk #dailyStatsTableContainer {
    max-height: 600px;
    overflow: auto;
    border: 1px solid #ccc;
}

#vergelijk #dailyStatsTable th:first-child,
#vergelijk #dailyStatsTable td:first-child {
    min-width: 100px;
}

#vergelijk #dailyStatsTable th:not(:first-child) {
    min-width: 60px;
}

/* Sticky footer */
#vergelijk #dailyStatsTable tfoot {
    position: sticky;
    bottom: 0;
    background: #f3f3f3;
    z-index: 20;
    background-clip: padding-box;
}

#vergelijk #dailyStatsTable tfoot td {
    background: #f3f3f3;
    padding: 5px;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

#vergelijk #dailyStatsTable tfoot tr + tr td {
    border-top: 1px solid #ccc;
}

#vergelijk #dailyStatsTable tfoot tr:last-child td {
    border-bottom: 1px solid #ccc;
}

#vergelijk #dailyStatsTable tfoot tr:first-child td {
    box-shadow: 0 -2px 0 #ccc;
}

/* Units */
#vergelijk #dailyStatsTable td span {
    display: inline;
    vertical-align: text-bottom;
    font-size: 0.7em;
    margin-left: 2px;
    white-space: nowrap;
}

/* Center headings */
#vergelijk #dailyStatsTable th {
    text-align: center;
    vertical-align: middle;
}

/* Search box */
#vergelijk #dailySearch {
    width: 250px;
    max-width: 90%;
    padding: 5px 28px 5px 8px;
    font-size: 0.95em;
    box-sizing: border-box;
}

#vergelijk .search-wrapper {
    position: relative;
    display: inline-block;
}

#vergelijk .clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1em;
    color: #888;
    display: none;
    user-select: none;
    z-index: 2;
}

#vergelijk input#dailySearch:not(:placeholder-shown) ~ .clear-search {
    display: inline;
}

#vergelijk .clear-search:hover {
    color: #000;
}

/* Sort indicator */
#vergelijk #dailyStatsTable thead th .sort-indicator {
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 4px;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Comparison table sticky footer */
#vergelijk #comparison {
    border-collapse: separate;
    border-spacing: 0;
}

#vergelijk #comparison tfoot {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #d0d0d0;
    background-clip: padding-box;
}

#vergelijk #comparison tfoot td {
    background: #d0d0d0;
    padding: 5px;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

#vergelijk #comparison tfoot tr + tr td {
    border-top: 1px solid #ccc;
}

#vergelijk #comparison tfoot tr:first-child td {
    box-shadow: 0 -2px 0 #999;
}

#vergelijk #comparison tfoot tr:last-child td {
    border-bottom: 1px solid #ccc;
}

#vergelijk #comparisonContainer .table-container {
    max-height: 1200px;
    overflow-y: auto;
}
