/*
 * Stats-bar component — gedeeld patroon voor overzichtspagina's.
 * Gebruik via templates/_partials/stats_bar.html macro.
 *
 * Color palette: zet data-color="blue|amber|green|purple|red|teal" op .stats-group.
 * Elke groep krijgt omkaderd paneel + gekleurde tegels + gekleurde actieve state.
 */

.stats-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    align-items: flex-end;
}

.stats-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stats-group-label {
    font-size: 0.72rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding-left: 0.25rem;
}

.stats-group-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.stat-tile {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.stat-tile:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.stat-tile.is-total {
    cursor: default;
    background: #f8f9fa;
}

.stat-tile.is-total:hover {
    border-color: #e9ecef;
    box-shadow: none;
}

/* Niet-klikbare tegels (informatief, zonder href) */
.stat-tile.is-static { cursor: default; }
.stat-tile.is-static:hover { box-shadow: none; }

.stat-tile .stat-value {
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.1;
}

.stat-tile .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.3rem;
    text-align: center;
}

.stat-tile .stat-icon {
    font-size: 1.05rem;
    margin-right: 0.35rem;
}

/* =========================================================
   PALETTE — blauw
   ========================================================= */
.stats-group[data-color="blue"] .stats-group-label { color: #0a58ca; }
.stats-group[data-color="blue"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #e7f1ff;
    border-left: 3px solid #0d6efd;
    border-radius: 6px;
}
.stats-group[data-color="blue"] .stat-tile { border-color: #b6d4fe; }
.stats-group[data-color="blue"] .stat-tile .stat-value { color: #0a58ca; }
.stats-group[data-color="blue"] .stat-tile:hover { border-color: #0d6efd; background: #f0f6ff; }
.stats-group[data-color="blue"] .stat-tile.is-active {
    background: #0d6efd; border-color: #0a58ca; box-shadow: 0 0 0 1px #0a58ca;
}
.stats-group[data-color="blue"] .stat-tile.is-active .stat-value,
.stats-group[data-color="blue"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="blue"] .stat-tile .stat-label { color: #3c63a8; }

/* =========================================================
   PALETTE — amber
   ========================================================= */
.stats-group[data-color="amber"] .stats-group-label { color: #a25f00; }
.stats-group[data-color="amber"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #fff4dd;
    border-left: 3px solid #e67e22;
    border-radius: 6px;
}
.stats-group[data-color="amber"] .stat-tile { border-color: #f7c893; }
.stats-group[data-color="amber"] .stat-tile .stat-value { color: #a25f00; }
.stats-group[data-color="amber"] .stat-tile:hover { border-color: #e67e22; background: #fff8ea; }
.stats-group[data-color="amber"] .stat-tile.is-active {
    background: #e67e22; border-color: #b45309; box-shadow: 0 0 0 1px #b45309;
}
.stats-group[data-color="amber"] .stat-tile.is-active .stat-value,
.stats-group[data-color="amber"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="amber"] .stat-tile .stat-label { color: #a25f00; }

/* =========================================================
   PALETTE — green
   ========================================================= */
.stats-group[data-color="green"] .stats-group-label { color: #0f5132; }
.stats-group[data-color="green"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #e6f4ea;
    border-left: 3px solid #198754;
    border-radius: 6px;
}
.stats-group[data-color="green"] .stat-tile { border-color: #b8dcc2; }
.stats-group[data-color="green"] .stat-tile .stat-value { color: #0f5132; }
.stats-group[data-color="green"] .stat-tile:hover { border-color: #198754; background: #effaf2; }
.stats-group[data-color="green"] .stat-tile.is-active {
    background: #198754; border-color: #0f5132; box-shadow: 0 0 0 1px #0f5132;
}
.stats-group[data-color="green"] .stat-tile.is-active .stat-value,
.stats-group[data-color="green"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="green"] .stat-tile .stat-label { color: #2e6f4d; }

/* =========================================================
   PALETTE — purple
   ========================================================= */
.stats-group[data-color="purple"] .stats-group-label { color: #59359a; }
.stats-group[data-color="purple"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #f3eef8;
    border-left: 3px solid #6f42c1;
    border-radius: 6px;
}
.stats-group[data-color="purple"] .stat-tile { border-color: #d3c4e3; }
.stats-group[data-color="purple"] .stat-tile .stat-value { color: #59359a; }
.stats-group[data-color="purple"] .stat-tile:hover { border-color: #6f42c1; background: #f8f3fc; }
.stats-group[data-color="purple"] .stat-tile.is-active {
    background: #6f42c1; border-color: #59359a; box-shadow: 0 0 0 1px #59359a;
}
.stats-group[data-color="purple"] .stat-tile.is-active .stat-value,
.stats-group[data-color="purple"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="purple"] .stat-tile .stat-label { color: #59359a; }

/* =========================================================
   PALETTE — red
   ========================================================= */
.stats-group[data-color="red"] .stats-group-label { color: #842029; }
.stats-group[data-color="red"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #fbeaec;
    border-left: 3px solid #dc3545;
    border-radius: 6px;
}
.stats-group[data-color="red"] .stat-tile { border-color: #f1b9c0; }
.stats-group[data-color="red"] .stat-tile .stat-value { color: #842029; }
.stats-group[data-color="red"] .stat-tile:hover { border-color: #dc3545; background: #fdf1f3; }
.stats-group[data-color="red"] .stat-tile.is-active {
    background: #dc3545; border-color: #842029; box-shadow: 0 0 0 1px #842029;
}
.stats-group[data-color="red"] .stat-tile.is-active .stat-value,
.stats-group[data-color="red"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="red"] .stat-tile .stat-label { color: #842029; }

/* =========================================================
   PALETTE — teal
   ========================================================= */
.stats-group[data-color="teal"] .stats-group-label { color: #0f6875; }
.stats-group[data-color="teal"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #e3f5f8;
    border-left: 3px solid #17a2b8;
    border-radius: 6px;
}
.stats-group[data-color="teal"] .stat-tile { border-color: #b3dfe6; }
.stats-group[data-color="teal"] .stat-tile .stat-value { color: #0f6875; }
.stats-group[data-color="teal"] .stat-tile:hover { border-color: #17a2b8; background: #effafc; }
.stats-group[data-color="teal"] .stat-tile.is-active {
    background: #17a2b8; border-color: #0f6875; box-shadow: 0 0 0 1px #0f6875;
}
.stats-group[data-color="teal"] .stat-tile.is-active .stat-value,
.stats-group[data-color="teal"] .stat-tile.is-active .stat-label { color: #fff; }
.stats-group[data-color="teal"] .stat-tile .stat-label { color: #0f6875; }

/* =========================================================
   PALETTE — slate (neutrale groep, géén tegel-recoloring)
   Gebruik wanneer je de groep WEL een paneel-achtergrond wilt
   geven maar elke tegel een eigen kleur via data-color op de
   tegel. Alleen de panel-styling, niet de tegels.
   ========================================================= */
.stats-group[data-color="slate"] .stats-group-label { color: #495057; }
.stats-group[data-color="slate"] .stats-group-row {
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    background: #f1f3f5;
    border-left: 3px solid #adb5bd;
    border-radius: 6px;
}

/* =========================================================
   TEGEL-LEVEL PALETTE OVERRIDE
   Gebruik data-color direct op een .stat-tile om per tegel
   een andere kleur te kiezen binnen een neutrale groep
   (geen data-color, of data-color="slate").
   ========================================================= */
.stat-tile[data-color="blue"] { background: #f0f6ff; border-color: #9dbfff; }
.stat-tile[data-color="blue"] .stat-value { color: #0a58ca; }
.stat-tile[data-color="blue"] .stat-label { color: #3c63a8; }
.stat-tile[data-color="blue"]:hover { border-color: #0d6efd; background: #dfeaff; }
.stat-tile[data-color="blue"].is-active { background: #0d6efd; border-color: #0a58ca; box-shadow: 0 0 0 1px #0a58ca; }
.stat-tile[data-color="blue"].is-active .stat-value,
.stat-tile[data-color="blue"].is-active .stat-label { color: #fff; }

.stat-tile[data-color="amber"] { background: #fff4dd; border-color: #f1b06d; }
.stat-tile[data-color="amber"] .stat-value { color: #a25f00; }
.stat-tile[data-color="amber"] .stat-label { color: #a25f00; }
.stat-tile[data-color="amber"]:hover { border-color: #e67e22; background: #ffe7bf; }
.stat-tile[data-color="amber"].is-active { background: #e67e22; border-color: #b45309; box-shadow: 0 0 0 1px #b45309; }
.stat-tile[data-color="amber"].is-active .stat-value,
.stat-tile[data-color="amber"].is-active .stat-label { color: #fff; }

.stat-tile[data-color="green"] { background: #e6f4ea; border-color: #8fc6a0; }
.stat-tile[data-color="green"] .stat-value { color: #0f5132; }
.stat-tile[data-color="green"] .stat-label { color: #2e6f4d; }
.stat-tile[data-color="green"]:hover { border-color: #198754; background: #d1eadb; }
.stat-tile[data-color="green"].is-active { background: #198754; border-color: #0f5132; box-shadow: 0 0 0 1px #0f5132; }
.stat-tile[data-color="green"].is-active .stat-value,
.stat-tile[data-color="green"].is-active .stat-label { color: #fff; }

.stat-tile[data-color="purple"] { background: #f3eef8; border-color: #b497d0; }
.stat-tile[data-color="purple"] .stat-value { color: #59359a; }
.stat-tile[data-color="purple"] .stat-label { color: #59359a; }
.stat-tile[data-color="purple"]:hover { border-color: #6f42c1; background: #e6d9f2; }
.stat-tile[data-color="purple"].is-active { background: #6f42c1; border-color: #59359a; box-shadow: 0 0 0 1px #59359a; }
.stat-tile[data-color="purple"].is-active .stat-value,
.stat-tile[data-color="purple"].is-active .stat-label { color: #fff; }

.stat-tile[data-color="red"] { background: #fbeaec; border-color: #e68c95; }
.stat-tile[data-color="red"] .stat-value { color: #842029; }
.stat-tile[data-color="red"] .stat-label { color: #842029; }
.stat-tile[data-color="red"]:hover { border-color: #dc3545; background: #f7d6da; }
.stat-tile[data-color="red"].is-active { background: #dc3545; border-color: #842029; box-shadow: 0 0 0 1px #842029; }
.stat-tile[data-color="red"].is-active .stat-value,
.stat-tile[data-color="red"].is-active .stat-label { color: #fff; }

.stat-tile[data-color="teal"] { background: #e3f5f8; border-color: #82c4d1; }
.stat-tile[data-color="teal"] .stat-value { color: #0f6875; }
.stat-tile[data-color="teal"] .stat-label { color: #0f6875; }
.stat-tile[data-color="teal"]:hover { border-color: #17a2b8; background: #c9ebf1; }
.stat-tile[data-color="teal"].is-active { background: #17a2b8; border-color: #0f6875; box-shadow: 0 0 0 1px #0f6875; }
.stat-tile[data-color="teal"].is-active .stat-value,
.stat-tile[data-color="teal"].is-active .stat-label { color: #fff; }

/* =========================================================
   DARK MODE
   ========================================================= */
[data-bs-theme="dark"] .stat-tile { background: #2b3035; border-color: #495057; }
[data-bs-theme="dark"] .stat-tile.is-total { background: #212529; }
[data-bs-theme="dark"] .stat-tile .stat-label { color: #adb5bd; }
[data-bs-theme="dark"] .stats-group-label { color: #adb5bd; }

[data-bs-theme="dark"] .stats-group[data-color="blue"] .stats-group-label { color: #6ea8fe; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stats-group-row { background: #1c2f4a; border-left-color: #6ea8fe; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile { background: #2b3035; border-color: #4a6fa5; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile .stat-value { color: #9ec5fe; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile:hover { background: #24406a; border-color: #6ea8fe; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile.is-active {
    background: #6ea8fe; border-color: #9ec5fe; box-shadow: 0 0 0 1px #9ec5fe;
}
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile.is-active .stat-label { color: #0b2040; }
[data-bs-theme="dark"] .stats-group[data-color="blue"] .stat-tile .stat-label { color: #9ec5fe; }

[data-bs-theme="dark"] .stats-group[data-color="amber"] .stats-group-label { color: #ffc14e; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stats-group-row { background: #3a2f15; border-left-color: #ffc14e; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile { background: #2b3035; border-color: #8b6a2f; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile .stat-value { color: #ffc14e; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile:hover { background: #4d3e1c; border-color: #ffc14e; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile.is-active {
    background: #ffc14e; border-color: #ffd688; box-shadow: 0 0 0 1px #ffd688;
}
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile.is-active .stat-label { color: #3a2f15; }
[data-bs-theme="dark"] .stats-group[data-color="amber"] .stat-tile .stat-label { color: #ffd688; }

[data-bs-theme="dark"] .stats-group[data-color="green"] .stats-group-label { color: #75c48a; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stats-group-row { background: #15291d; border-left-color: #75c48a; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile { background: #2b3035; border-color: #3e6a4e; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile .stat-value { color: #75c48a; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile:hover { background: #1f3a2a; border-color: #75c48a; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile.is-active {
    background: #75c48a; border-color: #a7d9b4; box-shadow: 0 0 0 1px #a7d9b4;
}
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile.is-active .stat-label { color: #15291d; }
[data-bs-theme="dark"] .stats-group[data-color="green"] .stat-tile .stat-label { color: #a7d9b4; }

[data-bs-theme="dark"] .stats-group[data-color="purple"] .stats-group-label { color: #b794e0; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stats-group-row { background: #2a1e3b; border-left-color: #b794e0; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile { background: #2b3035; border-color: #5a4180; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile .stat-value { color: #b794e0; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile:hover { background: #3a2a54; border-color: #b794e0; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile.is-active {
    background: #b794e0; border-color: #d0b6ec; box-shadow: 0 0 0 1px #d0b6ec;
}
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile.is-active .stat-label { color: #2a1e3b; }
[data-bs-theme="dark"] .stats-group[data-color="purple"] .stat-tile .stat-label { color: #d0b6ec; }

[data-bs-theme="dark"] .stats-group[data-color="red"] .stats-group-label { color: #ea868f; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stats-group-row { background: #3a1c20; border-left-color: #ea868f; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile { background: #2b3035; border-color: #8a3d43; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile .stat-value { color: #ea868f; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile:hover { background: #4d262c; border-color: #ea868f; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile.is-active {
    background: #ea868f; border-color: #f2a7ae; box-shadow: 0 0 0 1px #f2a7ae;
}
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile.is-active .stat-label { color: #3a1c20; }
[data-bs-theme="dark"] .stats-group[data-color="red"] .stat-tile .stat-label { color: #f2a7ae; }

[data-bs-theme="dark"] .stats-group[data-color="teal"] .stats-group-label { color: #7ad3e0; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stats-group-row { background: #162d32; border-left-color: #7ad3e0; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile { background: #2b3035; border-color: #3c6972; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile .stat-value { color: #7ad3e0; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile:hover { background: #1d3d45; border-color: #7ad3e0; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile.is-active {
    background: #7ad3e0; border-color: #a8e2eb; box-shadow: 0 0 0 1px #a8e2eb;
}
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile.is-active .stat-value,
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile.is-active .stat-label { color: #162d32; }
[data-bs-theme="dark"] .stats-group[data-color="teal"] .stat-tile .stat-label { color: #a8e2eb; }

/* Slate — dark mode (alleen panel) */
[data-bs-theme="dark"] .stats-group[data-color="slate"] .stats-group-label { color: #adb5bd; }
[data-bs-theme="dark"] .stats-group[data-color="slate"] .stats-group-row { background: #2b3035; border-left-color: #6c757d; }

/* Tile-level palette override — dark mode */
[data-bs-theme="dark"] .stat-tile[data-color="blue"] { background: #1c2f4a; border-color: #6ea8fe; }
[data-bs-theme="dark"] .stat-tile[data-color="blue"] .stat-value { color: #9ec5fe; }
[data-bs-theme="dark"] .stat-tile[data-color="blue"] .stat-label { color: #9ec5fe; }
[data-bs-theme="dark"] .stat-tile[data-color="blue"]:hover { background: #24406a; border-color: #9ec5fe; }
[data-bs-theme="dark"] .stat-tile[data-color="amber"] { background: #3a2f15; border-color: #ffc14e; }
[data-bs-theme="dark"] .stat-tile[data-color="amber"] .stat-value { color: #ffc14e; }
[data-bs-theme="dark"] .stat-tile[data-color="amber"] .stat-label { color: #ffd688; }
[data-bs-theme="dark"] .stat-tile[data-color="amber"]:hover { background: #4d3e1c; border-color: #ffd688; }
[data-bs-theme="dark"] .stat-tile[data-color="green"] { background: #15291d; border-color: #75c48a; }
[data-bs-theme="dark"] .stat-tile[data-color="green"] .stat-value { color: #75c48a; }
[data-bs-theme="dark"] .stat-tile[data-color="green"] .stat-label { color: #a7d9b4; }
[data-bs-theme="dark"] .stat-tile[data-color="green"]:hover { background: #1f3a2a; border-color: #a7d9b4; }
[data-bs-theme="dark"] .stat-tile[data-color="purple"] { background: #2a1e3b; border-color: #b794e0; }
[data-bs-theme="dark"] .stat-tile[data-color="purple"] .stat-value { color: #b794e0; }
[data-bs-theme="dark"] .stat-tile[data-color="purple"] .stat-label { color: #d0b6ec; }
[data-bs-theme="dark"] .stat-tile[data-color="purple"]:hover { background: #3a2a54; border-color: #d0b6ec; }
[data-bs-theme="dark"] .stat-tile[data-color="red"] { background: #3a1c20; border-color: #ea868f; }
[data-bs-theme="dark"] .stat-tile[data-color="red"] .stat-value { color: #ea868f; }
[data-bs-theme="dark"] .stat-tile[data-color="red"] .stat-label { color: #f2a7ae; }
[data-bs-theme="dark"] .stat-tile[data-color="red"]:hover { background: #4d262c; border-color: #f2a7ae; }
[data-bs-theme="dark"] .stat-tile[data-color="teal"] { background: #162d32; border-color: #7ad3e0; }
[data-bs-theme="dark"] .stat-tile[data-color="teal"] .stat-value { color: #7ad3e0; }
[data-bs-theme="dark"] .stat-tile[data-color="teal"] .stat-label { color: #a8e2eb; }
[data-bs-theme="dark"] .stat-tile[data-color="teal"]:hover { background: #1d3d45; border-color: #a8e2eb; }
