:root {
    --sandai-plum: #3d1f52;
    --sandai-paars: #6b3fa0;
    --sandai-paars-licht: #b79bd9;
    --sandai-achtergrond: #f5f2f9;
    --sandai-lijn: #ece5f3;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--sandai-achtergrond);
    margin: 0;
    color: #2a1c38;
}
.topbalk {
    background: linear-gradient(135deg, var(--sandai-paars), var(--sandai-plum));
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.topbalk a { color: white; text-decoration: none; opacity: 0.9; }
.topbalk a:hover { opacity: 1; }
.inhoud { max-width: 1100px; margin: 28px auto; padding: 0 20px; }

.login-kader {
    max-width: 340px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(61,31,82,0.08);
    text-align: center;
}
.login-kader input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.login-kader button, .knop {
    width: 100%;
    padding: 9px 14px;
    background: var(--sandai-plum);
    color: white;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
}
.login-kader button:hover, .knop:hover { background: var(--sandai-paars); }
.knop-uitgeschakeld, .knop-uitgeschakeld:hover { background: #e5e7eb !important; color: #999 !important; cursor: default; }
.fout { color: #c0392b; font-size: 14px; }

.klantenlijst { list-style: none; padding: 0; }
.klantenlijst li {
    background: white;
    margin-bottom: 8px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(61,31,82,0.06);
}
.klantenlijst a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: #2a1c38;
    font-weight: 600;
    font-size: 14.5px;
}
.kleurbolletje { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.layout { display: flex; gap: 18px; align-items: flex-start; }

.zijbalk {
    width: 216px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(61,31,82,0.06);
    overflow: hidden;
    flex-shrink: 0;
}
.zijbalk-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--sandai-lijn);
    font-weight: 700;
    font-size: 14px;
}
.zijbalk-header img { height: 26px; max-width: 100px; object-fit: contain; }
.zijbalk-header::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--sandai-paars-licht);
    flex-shrink: 0;
    display: none;
}

.tab-knop {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 18px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 13.5px;
    border-bottom: 1px solid #f5f5f7;
    color: #362646;
    border-left: 2px solid transparent;
    transition: background 0.1s ease;
}
.tab-knop.actief {
    background: var(--sandai-achtergrond);
    font-weight: 600;
    color: var(--sandai-plum);
    border-left: 2px solid var(--sandai-paars);
}
.tab-knop:hover { background: #fafafa; }

.zijbalk-groep-titel {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 18px 8px 18px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a99bb8;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
}
.zijbalk-groep-titel:hover { color: var(--sandai-paars); }
.instellingen-submenu { border-bottom: 1px solid #f5f5f7; }
.tab-subknop { padding-left: 32px; font-size: 13px; }

.hoofdinhoud {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(61,31,82,0.06);
    min-width: 0;
}
.tab-paneel { display: none; }
.tab-paneel.actief { display: block; }

label { display: block; margin-top: 10px; font-weight: 600; font-size: 12.5px; color: #4a3a5a; }

.veld-grid { display: grid; gap: 0 14px; }
.veld-grid-2-1 { grid-template-columns: 2fr 1fr 1fr; }
.veld-grid-1-1-1 { grid-template-columns: 1fr 1fr 1fr; }
.veld-grid-1-1 { grid-template-columns: 1fr 1fr; }
.veld-grid > div:not(:first-child) label { margin-top: 10px; }

.sectie-titel { margin: 0 0 4px 0; font-size: 14.5px; font-weight: 700; color: var(--sandai-plum); }
.sectie-lijn { margin: 26px 0 4px 0; border: none; border-top: 1px solid var(--sandai-lijn); }
input[type=text], input[type=email], input[type=color], input[type=number], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 7px; margin-top: 4px; font-family: inherit; font-size: 13.5px; box-sizing: border-box;
}
input[type=text]:focus, input[type=email]:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--sandai-paars); box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.12);
}
textarea { min-height: 100px; }
.kleur-blok { width: 60px !important; height: 40px; padding: 2px; cursor: pointer; }
.opslaan-knop { margin-top: 18px; width: auto; padding: 9px 22px; }

.bestandslijst { list-style: none; padding: 0; }
.bestandslijst li { padding: 8px 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }

.stat-inleiding { color: #6b5c7a; font-size: 13.5px; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-kaart { background: var(--sandai-achtergrond); border-radius: 10px; padding: 13px 15px; }
.stat-kaart .getal { font-size: 21px; font-weight: 700; line-height: 1.2; color: var(--sandai-plum); }
.stat-kaart .label { color: #6b5c7a; font-size: 12px; margin-top: 3px; line-height: 1.3; }
.stat-kaart a { color: inherit; text-decoration: none; }
.stat-vragen-kaart { background: var(--sandai-achtergrond); border-radius: 10px; padding: 15px; }
.stat-vragen-kaart h4 { margin-top: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--sandai-plum); }
.stat-vragen-lijst { list-style: none; padding: 0; margin: 0; }
.stat-vragen-lijst li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #eee; font-size: 13.5px; }
.stat-vragen-lijst li:last-child { border-bottom: none; }

.gegevens-tabel { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.gegevens-tabel th { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--sandai-lijn); color: #8a7a99; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; }
.gegevens-tabel td { padding: 9px 10px; border-bottom: 1px solid #f2f0f5; vertical-align: top; }
.gegevens-tabel tr:hover td { background: #fbf9fc; }

/* Mobiel: zijbalk en inhoud onder elkaar i.p.v. naast elkaar, kleinere marges,
   statistieken in minder kolommen, en brede tabellen scrollen horizontaal binnen
   zichzelf i.p.v. de hele pagina breder te maken. */
@media (max-width: 800px) {
    .inhoud { margin: 12px auto; padding: 0 12px; }
    .layout { flex-direction: column; }
    .zijbalk { width: 100%; }
    .hoofdinhoud { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .topbalk { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
    .tabel-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gegevens-tabel { min-width: 640px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .g-acties { flex-wrap: wrap; }
    .veld-grid { grid-template-columns: 1fr !important; }
}
