/*
 * Financieel Beheer Systeem — Dark Theme
 * Geïnspireerd op Skyhold.nl — minimalistisch, tech, donker
 */

/* ─── Variabelen ──────────────────────────────────────────── */
:root {
    --bg-base:        #0d0f14;
    --bg-card:        #13161f;
    --bg-card-2:      #181c27;
    --bg-hover:       #1c2030;
    --bg-input:       #0f1219;
    --bg-thead:       #0f1118;

    --accent:         #4f8ef7;
    --accent-dim:     rgba(79,142,247,.12);
    --accent-border:  rgba(79,142,247,.3);

    --success:        #22c97a;
    --success-dim:    rgba(34,201,122,.12);
    --success-border: rgba(34,201,122,.3);

    --danger:         #f75b5b;
    --danger-dim:     rgba(247,91,91,.12);
    --danger-border:  rgba(247,91,91,.3);

    --warning:        #f7a832;
    --warning-dim:    rgba(247,168,50,.12);
    --warning-border: rgba(247,168,50,.3);

    --text-primary:   #dde1f0;
    --text-secondary: #7c829e;
    --text-muted:     #454a61;

    --border:         #1e2235;
    --border-light:   #252a40;

    --radius:         10px;
    --radius-sm:      6px;
    --radius-lg:      14px;

    --font: -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    --transition: all .18s ease;
}

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: #78aefb; }

/* ─── Navbar ──────────────────────────────────────────────── */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .6rem;
    letter-spacing: -.01em;
}

.navbar-brand-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(79,142,247,.5);
}

.navbar-brand-version {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 400;
    padding: 2px 7px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .875rem;
    color: var(--text-secondary);
}

/* ─── Container ───────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.02em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-top: .25rem;
}

/* ─── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0; height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-light); }
.stat-card:hover::before { opacity: 1; }

.stat-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: .6rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.03em;
    line-height: 1;
    margin-bottom: .4rem;
    font-variant-numeric: tabular-nums;
}

.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }

.stat-description {
    font-size: .75rem;
    color: var(--text-muted);
}

.stat-bar {
    margin-top: 1rem;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width .6s ease;
}

/* ─── Periode Cards ───────────────────────────────────────── */
.periode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.periode-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.periode-card-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.periode-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .9rem;
    color: var(--text-secondary);
    padding: .3rem 0;
}

.periode-row.total {
    border-top: 1px solid var(--border);
    margin-top: .5rem;
    padding-top: .75rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font);
    letter-spacing: .01em;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-sm { padding: .35rem .8rem; font-size: .75rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: .9375rem; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
    background: #6ea1f9;
    border-color: #6ea1f9;
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #0a1f14;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
    background: #3cd98a;
    border-color: #3cd98a;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #f97272;
    border-color: #f97272;
}

.btn-warning {
    background: var(--warning);
    color: #0d0800;
    border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) {
    background: #f9b94a;
    border-color: #f9b94a;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-info {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}
.btn-info:hover:not(:disabled) {
    background: rgba(79,142,247,.2);
}

.btn-group { display: flex; gap: .35rem; }

/* Icon buttons voor tabel acties */
.icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    border-radius: var(--radius-sm);
}

.icon-btn.btn-success { background: var(--success-dim); color: var(--success); border-color: var(--success-border); }
.icon-btn.btn-success:hover { background: var(--success); color: #0a1f14; }
.icon-btn.btn-warning { background: var(--warning-dim); color: var(--warning); border-color: var(--warning-border); }
.icon-btn.btn-warning:hover { background: var(--warning); color: #0d0800; }
.icon-btn.btn-danger  { background: var(--danger-dim);  color: var(--danger);  border-color: var(--danger-border); }
.icon-btn.btn-danger:hover  { background: var(--danger);  color: #fff; }

/* ─── Filter Bar ──────────────────────────────────────────── */
.filter-buttons {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: .4rem 1rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: .8rem;
    font-weight: 600;
    font-family: var(--font);
}

.filter-btn:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

/* ─── Tabel Kaarten ───────────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

.table-meta {
    font-size: .75rem;
    color: var(--text-muted);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead tr {
    background: var(--bg-thead);
}

.table th {
    padding: .75rem 1.25rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.25rem;
    font-size: .875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td { background: var(--bg-hover); }

.table tbody tr.row-danger td   { background: rgba(247,91,91,.05); }
.table tbody tr.row-warning td  { background: rgba(247,168,50,.05); }
.table tbody tr.row-danger:hover td  { background: rgba(247,91,91,.1); }
.table tbody tr.row-warning:hover td { background: rgba(247,168,50,.1); }

/* Tabel cel stijlen */
.td-description {
    font-weight: 600;
    color: var(--text-primary);
    font-size: .9rem;
}

.td-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.td-date {
    font-size: .8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.td-note {
    font-size: .8rem;
    color: var(--text-muted);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}

.badge-primary  { background: var(--accent-dim);   color: var(--accent);   border: 1px solid var(--accent-border); }
.badge-success  { background: var(--success-dim);  color: var(--success);  border: 1px solid var(--success-border); }
.badge-danger   { background: var(--danger-dim);   color: var(--danger);   border: 1px solid var(--danger-border); }
.badge-warning  { background: var(--warning-dim);  color: var(--warning);  border: 1px solid var(--warning-border); }
.badge-muted    { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: .875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .875rem;
    border-left: 3px solid;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.alert-success { background: var(--success-dim); border-color: var(--success); color: #6beba0; }
.alert-danger  { background: var(--danger-dim);  border-color: var(--danger);  color: #fb8f8f; }
.alert-warning { background: var(--warning-dim); border-color: var(--warning); color: #fbc86a; }
.alert-info    { background: var(--accent-dim);  border-color: var(--accent);  color: #7fb4fb; }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-control {
    width: 100%;
    padding: .6rem .9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .875rem;
    font-family: var(--font);
    transition: var(--transition);
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-border);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237c829e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.25rem;
}

select.form-control option {
    background: var(--bg-card-2);
    color: var(--text-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .3rem;
}

/* ─── Cards (algemeen) ────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.show { display: flex; }

.modal-content {
    background: var(--bg-card-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.modal-close:hover {
    border-color: var(--danger-border);
    color: var(--danger);
    background: var(--danger-dim);
}

.modal-body   { padding: 1.5rem; }
.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* ─── Actie toolbar ───────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.toolbar-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ─── Login pagina ────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Notificaties ────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    min-width: 280px;
    padding: .9rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    animation: toastIn .25s ease;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.toast-success { background: var(--success-dim); border: 1px solid var(--success-border); color: #6beba0; }
.toast-danger  { background: var(--danger-dim);  border: 1px solid var(--danger-border);  color: #fb8f8f; }

@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

/* ─── Utilities ───────────────────────────────────────────── */
.d-flex { display: flex; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.text-sm   { font-size: .8125rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--font-mono); }

/* ─── Loading ─────────────────────────────────────────────── */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: .75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    max-width: 1400px;
    margin: 0 auto;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 0 1rem 2rem; }
    .navbar-content { padding: 0 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .periode-grid { grid-template-columns: 1fr; }
    .table-container { overflow-x: auto; }
    .table { min-width: 600px; }
    .page-title { font-size: 1.5rem; }
    .toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-actions { width: 100%; flex-wrap: wrap; }
    .toolbar-actions .btn { flex: 1; min-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR LAYOUT
═══════════════════════════════════════════════════════════ */

:root {
    --sidebar-width:          240px;
    --sidebar-collapsed-width: 64px;
    --topbar-height:           56px;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width .25s ease;
    overflow: hidden;
}

/* ── Brand ────────────────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    flex-shrink: 0;
}

.sidebar-brand-logo {
    width: 32px;
    height: 32px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(79,142,247,.6);
    display: block;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-brand-name {
    font-family: var(--font-mono);
    font-size: .875rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-version {
    font-size: .65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sidebar-collapse-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
    transition: var(--transition);
    margin-left: auto;
}
.sidebar-collapse-btn:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── Maand selector ───────────────────────────────────────── */
.sidebar-month {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-month-select {
    font-size: .75rem !important;
    padding: .4rem .6rem !important;
}

/* ── Navigatie ────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .75rem 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-light); }

.sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    padding: .75rem 1rem .3rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
    position: relative;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: .875rem;
}

.sidebar-link span { overflow: hidden; text-overflow: ellipsis; flex: 1; }

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-badge {
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Sidebar footer / user ────────────────────────────────── */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: .75rem 1rem;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .7rem;
    color: var(--text-muted);
}

.sidebar-logout-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
    font-size: .8rem;
}
.sidebar-logout-btn:hover {
    border-color: var(--danger-border);
    color: var(--danger);
    background: var(--danger-dim);
}

/* ── Layout wrapper & main content ───────────────────────── */
.layout-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content {
    flex: 1;
    padding: 2rem 2.5rem 3rem;
    width: 100%;
    max-width: 1600px;
    box-sizing: border-box;
}

/* Collapsed: iets meer ruimte benutten */
body.sidebar-collapsed .main-content {
    max-width: 1700px;
}

/* Overschrijf de oude .container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ── Collapsed sidebar ────────────────────────────────────── */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-badge,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-month {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: .6rem;
    border-left: none;
    border-radius: var(--radius-sm);
    margin: .1rem .5rem;
}

body.sidebar-collapsed .sidebar-link.active {
    background: var(--accent-dim);
}

body.sidebar-collapsed .sidebar-link i {
    width: auto;
    font-size: 1rem;
}

body.sidebar-collapsed .sidebar-collapse-btn {
    margin: 0 auto;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 1rem .5rem;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-logout-btn {
    margin: 0 auto;
}

body.sidebar-collapsed .layout-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tooltip voor collapsed links */
body.sidebar-collapsed .sidebar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-2);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: .35rem .7rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 300;
    transition: opacity .15s;
}

body.sidebar-collapsed .sidebar-link:hover::after {
    opacity: 1;
}

/* ── Topbar (alleen mobiel) ───────────────────────────────── */
.topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 1rem;
}

.topbar-menu-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-brand {
    font-family: var(--font-mono);
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1;
}

/* ── Mobile overlay ───────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease, width .25s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .layout-wrapper {
        margin-left: 0;
        padding-top: var(--topbar-height);
    }
    body.sidebar-collapsed .layout-wrapper {
        margin-left: 0;
    }
    .topbar { display: flex; }
    .main-content { padding: 1.5rem 1rem 2rem; }
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIES
═══════════════════════════════════════════════════════════ */

/* ── Bell knop in sidebar ─────────────────────────────────── */
.sidebar-notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
    font-family: var(--font);
}
.sidebar-notif-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.sidebar-notif-btn i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: .875rem;
}
.sidebar-notif-btn.has-notifications {
    color: var(--warning);
}
.sidebar-notif-btn.has-notifications i {
    animation: bellShake 2s ease infinite;
}
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    10%, 30%  { transform: rotate(-12deg); }
    20%, 40%  { transform: rotate(12deg); }
    50%       { transform: rotate(0); }
}

.notif-count-badge {
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 20px;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 18px;
    text-align: center;
}

/* Collapsed sidebar: badge op icoon */
body.sidebar-collapsed .sidebar-notif-btn {
    justify-content: center;
    padding: .6rem;
    border-left: none;
    border-radius: var(--radius-sm);
    margin: .1rem .5rem;
}
body.sidebar-collapsed .sidebar-notif-btn span,
body.sidebar-collapsed .notif-count-badge { display: none; }
body.sidebar-collapsed .sidebar-notif-btn i { width: auto; font-size: 1rem; }

/* Floating badge op icoon (collapsed) */
body.sidebar-collapsed .sidebar-notif-btn.has-notifications::before {
    content: attr(data-count);
    position: absolute;
    top: 4px; right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Notificatie paneel ───────────────────────────────────── */
.notif-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transition: right .3s ease;
    box-shadow: -8px 0 32px rgba(0,0,0,.4);
}
.notif-panel.open { right: 0; }

.notif-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notif-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.notif-panel-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}
.notif-panel-close:hover {
    border-color: var(--danger-border);
    color: var(--danger);
    background: var(--danger-dim);
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0;
}
.notif-panel-body::-webkit-scrollbar { width: 3px; }
.notif-panel-body::-webkit-scrollbar-thumb { background: var(--border-light); }

.notif-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

/* ── Notificatie item ─────────────────────────────────────── */
.notif-item {
    display: flex;
    gap: .875rem;
    padding: .875rem 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }

.notif-item-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.notif-item-icon.danger  { background: var(--danger-dim);  color: var(--danger); }
.notif-item-icon.warning { background: var(--warning-dim); color: var(--warning); }
.notif-item-icon.success { background: var(--success-dim); color: var(--success); }
.notif-item-icon.info    { background: var(--accent-dim);  color: var(--accent); }

.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .2rem;
}
.notif-item-message {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Empty state ──────────────────────────────────────────── */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    gap: .75rem;
}
.notif-empty i { font-size: 2.5rem; }
.notif-empty p { font-size: .875rem; }

/* ── Browser notificatie toestemming banner ───────────────── */
.notif-permission-bar {
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .85rem;
    color: var(--accent);
    flex-wrap: wrap;
}
.notif-permission-bar i { flex-shrink: 0; }
.notif-permission-bar .btn { margin-left: auto; flex-shrink: 0; }

/* ── Overlay ──────────────────────────────────────────────── */
.notif-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 490;
}
.notif-overlay.show { display: block; }

@media (max-width: 480px) {
    .notif-panel { width: 100%; right: -100%; }
}
