:root {
    --spike-blauw: #0b3d63;
    --spike-accent: #1f7a8c;
    --grijs-licht: #f4f6f8;
    --grijs-rand: #d8dee4;
    --rood: #b3261e;
    --groen: #1e6b3a;
    --oranje: #ad6800;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--grijs-licht);
    color: #1c2733;
}

/* ── Sidebar ── */
aside.sidebar {
    width: 90px;
    background: var(--spike-blauw);
    position: fixed;
    left: 0; top: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
a.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    transition: background 0.2s, box-shadow 0.2s;
}
a.logo-mark.heeft-meldingen {
    background: #dc2626;
    box-shadow: 0 0 0 0 rgba(220,38,38,0.6);
    animation: melding-pulse 1.8s ease-out infinite;
}
@keyframes melding-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220,38,38,0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0;
    overflow-y: auto;
}
.sidebar-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    padding: 0.7rem 0.25rem 0.6rem;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 0.67rem;
    text-align: center;
    line-height: 1.2;
    transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-nav a.actief {
    background: rgba(255,255,255,0.14);
    color: white;
    box-shadow: inset 3px 0 0 rgba(255,255,255,0.75);
}
.sidebar-nav a svg { width: 26px; height: 26px; flex-shrink: 0; }

.sidebar-spacer { flex: 1; min-height: 0.5rem; }

.sidebar-voet {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 0.3rem 0;
}
.sidebar-voet a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    padding: 0.65rem 0.25rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.65rem;
    text-align: center;
    transition: color 0.12s;
}
.sidebar-voet a:hover { color: rgba(255,255,255,0.9); }
.sidebar-voet a svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ── Main content ── */
main {
    padding: 1.5rem 2rem;
}
main.met-sidebar {
    margin-left: 90px;
}
main:not(.met-sidebar) {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; }

.kaart {
    background: white;
    border: 1px solid var(--grijs-rand);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--grijs-rand); font-size: 0.92rem; }
th { background: #eef2f5; font-weight: 600; }
tr:hover td { background: #f9fbfc; }
table a { color: var(--spike-accent); text-decoration: none; font-weight: 600; }
table a:hover { text-decoration: underline; }

.formulier-rij { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.formulier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
label { font-weight: 600; font-size: 0.85rem; color: #44505c; }
input, select, textarea {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--grijs-rand);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; }

.knop {
    display: inline-block;
    background: var(--spike-accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
}
.knop:hover { background: var(--spike-blauw); }
.knop.secundair { background: white; color: var(--spike-blauw); border: 1px solid var(--spike-blauw); }
.knop.secundair:hover { background: var(--grijs-licht); }
.knop.gevaar { background: white; color: var(--rood); border: 1px solid var(--rood); }
.knop.gevaar:hover { background: #fbeceb; }

.filterbalk { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.filterbalk .formulier-rij { margin-bottom: 0; min-width: 150px; }

.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.actief { background: #e3f2e9; color: var(--groen); }
.badge.concept { background: #eef2f5; color: #44505c; }
.badge.verlopen { background: #fdeceb; color: var(--rood); }
.badge.opgezegd { background: #fdeceb; color: var(--rood); }
.badge.klant { background: #e6f0fa; color: var(--spike-blauw); }
.badge.leverancier { background: #fdf2e3; color: var(--oranje); }
.badge.beide { background: #ece6fa; color: #5b3aa6; }

.waarschuwing { color: var(--rood); font-weight: 600; }
.let-op { color: var(--oranje); font-weight: 600; }

.foutmelding { background: #fdeceb; color: var(--rood); padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; }

.acties { display: flex; gap: 0.6rem; margin-top: 1rem; }

.muted { color: #6b7785; font-size: 0.88rem; }

a.terug { color: var(--spike-accent); text-decoration: none; font-size: 0.9rem; display: inline-block; margin-bottom: 0.75rem; }

.login-kaart { max-width: 360px; margin: 4rem auto; }

/* ── KPI balk ── */
.kpi-balk {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-kaart {
    background: white;
    border: 1px solid var(--grijs-rand);
    border-radius: 8px;
    padding: 1.1rem 1rem;
    text-align: center;
}
.kpi-label {
    font-size: 0.78rem;
    color: #6b7785;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.kpi-waarde {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--spike-blauw);
    line-height: 1;
}
.kpi-kaart.kpi-rood  .kpi-waarde { color: var(--rood); }
.kpi-kaart.kpi-oranje .kpi-waarde { color: var(--oranje); }
.kpi-kaart.kpi-geel  .kpi-waarde { color: #856404; }

/* ── Urgentie badges ── */
.badge.urgent-rood   { background: #fdeceb; color: var(--rood); }
.badge.urgent-oranje { background: #fdf2e3; color: var(--oranje); }
.badge.urgent-geel   { background: #fff8e1; color: #856404; }
.badge.urgent-blauw  { background: #e6f0fa; color: var(--spike-blauw); }

/* ── Import previews ── */
.import-preview { overflow-x: auto; margin-top: 0.75rem; }
.import-preview table { min-width: 600px; font-size: 0.82rem; }
.mapping-tabel { width: 100%; border-collapse: collapse; }
.mapping-tabel td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--grijs-rand); vertical-align: middle; }
.mapping-tabel td:first-child { font-weight: 600; font-size: 0.88rem; width: 220px; }
.mapping-tabel select { width: 100%; }

/* ── Tickets ── */
.status-nieuw          { background:#e6f0fa; color:var(--spike-blauw); }
.status-in_behandeling { background:#fff3cd; color:#856404; }
.status-wacht_op_klant { background:#fdf2e3; color:var(--oranje); }
.status-bezoek_gepland { background:#ede9f8; color:#5b3aa6; }
.status-leverancier    { background:#e0f4f5; color:#0f6674; }
.status-opgelost       { background:#e3f2e9; color:var(--groen); }
.status-gesloten       { background:#eef2f5; color:#44505c; }

.prio-laag    { background:#eef2f5; color:#44505c; }
.prio-normaal { background:#e6f0fa; color:var(--spike-blauw); }
.prio-hoog    { background:#fdf2e3; color:var(--oranje); }
.prio-kritiek { background:#fdeceb; color:var(--rood); }

.update-type-opmerking         { background:#eef2f5; color:#44505c; }
.update-type-werkbon           { background:#e6f0fa; color:var(--spike-blauw); }
.update-type-bezoek            { background:#ede9f8; color:#5b3aa6; }
.update-type-email_klant       { background:#e3f2e9; color:var(--groen); }
.update-type-email_leverancier { background:#e0f4f5; color:#0f6674; }
.update-type-statuswijziging   { background:#f5f5f5; color:#888; }

.ticket-update.intern { border-left:3px solid var(--oranje); }
