:root {
    --brand: #e67e00;
    --brand-dark: #c96b00;
    --brand-light: #fff4e6;
    --brand-gradient: linear-gradient(90deg, #e67e00 0%, #d97200 100%);
    --brand-gradient-vertical: linear-gradient(135deg, #f29422 0%, #e67e00 50%, #c96b00 100%);
    --sidebar-bg: #ffffff;
    --sidebar-text: #495057;
    --sidebar-active-bg: #fff4e6;
    --sidebar-active-text: #c96b00;
    --content-bg: #f5f6f8;
    --topbar-h: 60px;
    --sidebar-w: 240px;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
    color: #212529;
}

a { text-decoration: none; }

/* ===== Login ===== */
.login-bg {
    min-height: 100vh;
    background: var(--brand-gradient-vertical);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 380px;
    padding: 32px 28px;
}
.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}
.login-title {
    text-align: center;
    color: #2b2f33;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-bottom: 22px;
    font-size: 14px;
}
.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-brand {
    color: var(--brand);
    border-color: var(--brand);
    background: #fff;
}
.btn-outline-brand:hover {
    background: var(--brand);
    color: #fff;
}

/* ===== App shell ===== */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-topbar {
    height: var(--topbar-h);
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 18px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-topbar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: #fff;
}
.app-topbar .brand-logo {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.app-topbar .topbar-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    margin-right: 8px;
    cursor: pointer;
}
.app-topbar .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
.app-topbar .welkom { font-size: 14px; font-weight: 500; }
.app-topbar .btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.app-topbar .btn-logout:hover { background: rgba(255, 255, 255, 0.28); }

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}
.app-sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid #e6e8eb;
    overflow-y: auto;
    transition: margin-left 0.2s;
}
.app-sidebar.collapsed { margin-left: calc(var(--sidebar-w) * -1); }
.app-sidebar .menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #adb5bd;
    padding: 14px 18px 6px;
    letter-spacing: 1px;
}
.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--sidebar-text);
    font-size: 14px;
    border-left: 3px solid transparent;
    border-radius: 0;
}
.app-sidebar .nav-link i { font-size: 17px; width: 20px; text-align: center; }
.app-sidebar .nav-link:hover { background: #f8f9fa; color: var(--brand); }
.app-sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: var(--brand);
    font-weight: 600;
}
.app-sidebar .nav-group-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--sidebar-text);
    font-size: 14px;
    user-select: none;
}
.app-sidebar .nav-group-toggle:hover { color: var(--brand); }
.app-sidebar .nav-group-toggle .chev { margin-left: auto; transition: transform 0.15s; }
.app-sidebar .nav-group-toggle.open .chev { transform: rotate(90deg); }
.app-sidebar .nav-group-children .nav-link { padding-left: 48px; font-size: 13.5px; }

.app-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    background: var(--content-bg);
}

/* ===== Dashboard cards ===== */
.dash-title { font-weight: 700; color: #1f3548; margin-bottom: 4px; }
.dash-sub { color: #6c757d; margin-bottom: 24px; }
.dash-card {
    background: #fff;
    border: 1px solid #eceef1;
    border-radius: 10px;
    padding: 26px 22px;
    text-align: center;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    cursor: pointer;
    height: 100%;
    color: inherit;
    display: block;
}
.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(230, 126, 0, 0.12);
    border-color: var(--brand);
    color: inherit;
}
.dash-card .icon {
    color: var(--brand);
    font-size: 38px;
    margin-bottom: 12px;
}
.dash-card .title { font-weight: 600; color: #1f3548; font-size: 17px; }
.dash-card .desc { color: #6c757d; font-size: 13px; margin-top: 4px; }

/* ===== Forms / tables ===== */
.page-title { font-weight: 700; color: #1f3548; margin-bottom: 18px; }
.card-block {
    background: #fff;
    border: 1px solid #eceef1;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.card-block h6 {
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid #eceef1;
    padding-bottom: 8px;
    margin-bottom: 14px;
}
.form-label { font-weight: 500; font-size: 13.5px; color: #495057; margin-bottom: 4px; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(230, 126, 0, 0.15);
}
.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}
.table thead { background: #f8f9fa; }
.table thead th {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 2px solid #eceef1;
}
.table-actions .btn { padding: 4px 8px; }

/* ===== Toast container ===== */
.toast-stack {
    position: fixed;
    top: 76px;
    right: 18px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== Validation ===== */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #dc3545; }
.validation-message { color: #dc3545; font-size: 12.5px; }

/* ===== Error boundary ===== */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: #fff;
}
.blazor-error-boundary::after { content: "Er is een fout opgetreden."; }

/* ===== Print ===== */
@media print {
    .app-topbar, .app-sidebar { display: none !important; }
    .app-content { padding: 0; background: #fff; }
}
