/* Statistiekenpagina: ruimte in tabel, compacte maar zichtbare grafiek */
.statistieken-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.statistieken-page .statistieken-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.statistieken-page .statistieken-overview {
    flex-shrink: 0;
    margin-bottom: 1.5rem;
    background-color: rgb(249 250 251); /* gray-50 */
}

.dark .statistieken-page .statistieken-overview {
    background-color: rgb(31 41 55 / 0.45); /* gray-800/45 */
}

.statistieken-page .statistieken-chart-area {
    flex-shrink: 0;
    min-width: 0;
    background-color: rgb(248 250 252); /* slate-50 */
}

.dark .statistieken-page .statistieken-chart-area {
    background-color: rgb(17 24 39 / 0.55); /* gray-900/55 */
}

.statistieken-page .statistieken-section-header {
    background-color: rgb(243 244 246); /* gray-100 */
}

.dark .statistieken-page .statistieken-section-header {
    background-color: rgb(55 65 81 / 0.55); /* gray-700/55 */
}

.statistieken-page .statistieken-section-filters {
    background-color: rgb(241 245 249); /* slate-100 */
}

.dark .statistieken-page .statistieken-section-filters {
    background-color: rgb(51 65 85 / 0.35); /* slate-700/35 */
}

.statistieken-page .statistieken-chart-wrap {
    height: min(42vh, 360px);
    min-height: 280px;
    max-height: 360px;
}

.statistieken-page .statistieken-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.statistieken-page .statistieken-table th,
.statistieken-page .statistieken-table td {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.statistieken-page .statistieken-table-scroll {
    overflow-x: auto;
}

/* Foutkleur: ~10% zachter dan Tailwind red-600 / red-500 */
.stats-error-value {
    color: rgb(225 79 79);
}

.dark .stats-error-value {
    color: rgb(250 135 135);
}

/* Totaalrij: subtiel afwijkende achtergrond + lichte scheidingslijn erboven */
.statistieken-page .statistieken-totals-row td {
    border-top: 1px solid rgb(209 213 219); /* gray-300 */
    background-color: rgb(243 244 246); /* gray-100 */
}

.dark .statistieken-page .statistieken-totals-row td {
    border-top-color: rgb(75 85 99); /* gray-600 */
    background-color: rgb(37 45 58); /* iets lichter dan gray-800 datarijen */
}

.statistieken-page .statistieken-totals-value {
    font-weight: 600;
    color: rgb(29 78 216); /* blue-700 */
}

.dark .statistieken-page .statistieken-totals-value {
    color: rgb(147 197 253); /* blue-300 */
}

.statistieken-page .statistieken-filter-field {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.statistieken-page .statistieken-filter-input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.statistieken-page .statistieken-filters {
    max-width: 100%;
}

@media (max-width: 640px) {
    .statistieken-page .statistieken-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .statistieken-page .statistieken-filter-field {
        width: 100%;
    }

    .statistieken-page .statistieken-filter-input {
        width: 100% !important;
        max-width: 100% !important;
    }

    .statistieken-page .statistieken-table-scroll {
        overflow-x: visible;
    }

    .statistieken-page .statistieken-table {
        min-width: 0;
        width: 100%;
    }

    .statistieken-page .statistieken-table thead {
        display: none;
    }

    .statistieken-page .statistieken-table tbody {
        display: block;
    }

    .statistieken-page .statistieken-table tr {
        display: block;
        border-bottom: 1px solid rgb(229 231 235);
        padding: 0.75rem 1rem;
    }

    .dark .statistieken-page .statistieken-table tr {
        border-bottom-color: rgb(55 65 81);
    }

    .statistieken-page .statistieken-table tr:last-child {
        border-bottom: none;
    }

    .statistieken-page .statistieken-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        border: none !important;
        padding: 0.25rem 0;
        text-align: right;
        white-space: normal;
    }

    .statistieken-page .statistieken-table td:first-child {
        display: block;
        font-weight: 600;
        text-align: left;
        padding-bottom: 0.5rem;
        word-break: break-word;
    }

    .statistieken-page .statistieken-table td:not(:first-child)::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 0.75rem;
        font-weight: 500;
        color: rgb(107 114 128);
        text-align: left;
    }

    .dark .statistieken-page .statistieken-table td:not(:first-child)::before {
        color: rgb(156 163 175);
    }
}

@media (max-height: 800px) {
    .statistieken-page .statistieken-chart-wrap {
        height: min(36vh, 280px);
        min-height: 220px;
        max-height: 280px;
    }
}
