:root {
    --crt-red: #d81f26;
    --crt-red-dark: #b0151b;
    --crt-black: #111111;
    --crt-surface: #171717;
    --crt-surface-2: #202020;
    --crt-border: #2c2c2c;
    --crt-text: #f4f4f4;
    --crt-muted: #b8b8b8;
    --crt-bg: #0f0f10;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.crt-app {
    margin: 0;
    background: linear-gradient(180deg, #151515 0%, var(--crt-bg) 100%);
    color: var(--crt-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { color: inherit; text-decoration: none; }

.crt-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: rgba(17, 17, 17, 0.95);
    border-bottom: 1px solid var(--crt-border);
    backdrop-filter: blur(8px);
}

.crt-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.crt-brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.25rem;
}

.crt-mobile-toggle {
    display: none;
    border: 1px solid var(--crt-border);
    background: var(--crt-surface);
    color: var(--crt-text);
    border-radius: 0.6rem;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
}

.crt-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.crt-user-chip {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--crt-border);
    border-radius: 999px;
    color: var(--crt-muted);
    background: var(--crt-surface);
}

.crt-link-button,
.crt-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.65rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    font-weight: 600;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.crt-link-button {
    border-color: var(--crt-border);
    background: transparent;
    color: var(--crt-text);
}

.crt-primary-button {
    background: var(--crt-red);
    color: #fff;
}

.crt-link-button:hover,
.crt-primary-button:hover {
    transform: translateY(-1px);
}

.crt-primary-button:hover { background: var(--crt-red-dark); }

.crt-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 74px);
}

.crt-sidebar {
    border-right: 1px solid var(--crt-border);
    background: rgba(17, 17, 17, 0.82);
    padding: 1rem;
}

.crt-nav {
    display: grid;
    gap: 0.5rem;
}

.crt-nav-link {
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    background: var(--crt-surface);
    border: 1px solid var(--crt-border);
    color: var(--crt-text);
}

.crt-nav-link:hover { background: var(--crt-surface-2); }
.crt-nav-link.is-disabled { opacity: 0.65; }

.crt-content {
    padding: 1.5rem;
}

.crt-page-head,
.crt-stats-grid,
.crt-empty-state,
.crt-auth-card {
    max-width: 1200px;
    margin: 0 auto;
}

.crt-page-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.crt-eyebrow {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--crt-red);
    font-weight: 700;
}

.crt-muted { color: var(--crt-muted); }

.crt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.crt-stat-card,
.crt-auth-card,
.crt-empty-state {
    background: rgba(17, 17, 17, 0.86);
    border: 1px solid var(--crt-border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.crt-stat-card {
    padding: 1.1rem;
}

.crt-stat-card span {
    display: block;
    color: var(--crt-muted);
    margin-bottom: 0.5rem;
}

.crt-stat-card strong {
    font-size: 2rem;
}

.crt-auth-card {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    overflow: hidden;
}

.crt-auth-copy,
.crt-auth-form {
    padding: 2rem;
}

.crt-auth-copy {
    background: linear-gradient(180deg, rgba(216, 31, 38, 0.16), rgba(216, 31, 38, 0.04));
    border-right: 1px solid var(--crt-border);
}

.crt-auth-form {
    display: grid;
    gap: 0.75rem;
    align-content: center;
}

.crt-auth-form label {
    font-weight: 600;
}

.crt-input {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--crt-border);
    border-radius: 0.7rem;
    background: var(--crt-surface);
    color: var(--crt-text);
}

.crt-input:focus {
    outline: 2px solid rgba(216, 31, 38, 0.35);
    border-color: var(--crt-red);
}

.crt-alert {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--crt-border);
    background: var(--crt-surface);
}

.crt-alert-error {
    border-color: rgba(216, 31, 38, 0.45);
    background: rgba(216, 31, 38, 0.12);
}

.crt-messages { margin-bottom: 1rem; }

.crt-empty-state {
    padding: 2rem;
    text-align: center;
}

.crt-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--crt-border);
    color: var(--crt-muted);
    background: rgba(17, 17, 17, 0.92);
}

@media (max-width: 1024px) {
    .crt-shell { grid-template-columns: 1fr; }
    .crt-sidebar {
        display: none;
        border-right: 0;
        border-bottom: 1px solid var(--crt-border);
    }
    .crt-sidebar.is-open { display: block; }
    .crt-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .crt-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-auth-card { grid-template-columns: 1fr; }
    .crt-auth-copy { border-right: 0; border-bottom: 1px solid var(--crt-border); }
}

@media (max-width: 640px) {
    .crt-topbar,
    .crt-footer,
    .crt-page-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .crt-stats-grid { grid-template-columns: 1fr; }
}

/* --- Dashboard 2.0: rapportages, grafieken, filters --- */
.crt-report-filters {
    background: var(--crt-surface);
    border: 1px solid var(--crt-border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}
.crt-report-filters .form-label {
    font-size: 0.75rem;
    color: var(--crt-muted);
    margin-bottom: 0.25rem;
}
.crt-report-filters .form-control,
.crt-report-filters .form-select {
    background: var(--crt-surface-2);
    border: 1px solid var(--crt-border);
    color: var(--crt-text);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}

.crt-chart { display: flex; flex-direction: column; gap: 0.4rem; }
.crt-chart-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.crt-chart-label { width: 70px; flex-shrink: 0; color: var(--crt-muted); }
.crt-chart-bar-wrap { flex: 1; background: var(--crt-surface-2); border-radius: 6px; overflow: hidden; }
.crt-chart-bar { height: 18px; background: linear-gradient(90deg, var(--crt-red), #ff6b3d); border-radius: 6px; min-width: 2px; }
.crt-chart-value { width: 90px; text-align: right; flex-shrink: 0; }

.crt-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.progress { background: var(--crt-surface-2); border-radius: 6px; height: 18px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--crt-red), #ff6b3d); color: #fff; font-size: 0.7rem; text-align: center; }

/* Print-vriendelijk: verberg navigatie en knoppen */
@media print {
    .crt-sidebar, .crt-topbar, .crt-footer, .crt-report-filters, .crt-messages { display: none !important; }
    body.crt-app { background: #fff; color: #000; }
    .crt-content { margin: 0; padding: 0; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; }
    a { text-decoration: none; color: #000; }
}
