:root {
    --bg: #eef3f8;
    --bg-soft: #f6f9fc;
    --card: #ffffff;
    --card-muted: #f8fbfe;
    --text: #1d2935;
    --text-soft: #607284;
    --line: #d8e1eb;
    --line-strong: #c8d3df;
    --primary: #68aef8;
    --primary-dark: #4c96e6;
    --primary-soft: #e8f3ff;
    --sidebar: #5e748b;
    --sidebar-dark: #4e647b;
    --sidebar-soft: rgba(255,255,255,0.1);
    --success: #46b47e;
    --success-soft: #e8f7f0;
    --warning: #e8a23b;
    --warning-soft: #fff5e6;
    --danger: #df6a71;
    --danger-soft: #fff0f1;
    --later: #7c8fa7;
    --later-soft: #eff3f8;
    --shadow-sm: 0 8px 24px rgba(28, 39, 51, 0.06);
    --shadow-md: 0 18px 40px rgba(28, 39, 51, 0.10);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --sidebar-width: 258px;
    --content-max: 1380px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, #f4f8fc 0%, var(--bg) 100%);
    color: var(--text);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-dark) 100%);
    color: #eef5fb;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand .brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: linear-gradient(135deg, #8ec2ff 0%, #c0ddff 100%);
    color: #365273;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.sidebar-brand h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.05;
    color: #fff;
}

.sidebar-brand p {
    margin: 4px 0 0;
    color: rgba(238,245,251,0.78);
    font-size: 12px;
}

.sidebar-user {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user .label {
    display: block;
    font-size: 11px;
    color: rgba(238,245,251,0.72);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.sidebar-user .value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(238,245,251,0.92);
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.sidebar-link .icon {
    width: 22px;
    text-align: center;
    opacity: 0.95;
}

.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.sidebar-quick {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 16px;
    padding: 12px 14px;
}

.sidebar-quick .title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-quick .sub {
    font-size: 12px;
    color: rgba(238,245,251,0.78);
}

.page-shell {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.78);
    border-bottom: 1px solid rgba(216,225,235,0.85);
}

.topbar-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 16px 26px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.topbar-main {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    gap: 14px;
    align-items: center;
}

.searchbar input,
.input,
.select,
.textarea,
input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.searchbar input {
    height: 48px;
    box-shadow: inset 0 1px 2px rgba(31, 42, 55, 0.03);
}

.searchbar input:focus,
.input:focus,
.select:focus,
.textarea:focus,
input[type="file"]:focus {
    border-color: rgba(104, 174, 248, 0.9);
    box-shadow: 0 0 0 4px rgba(104, 174, 248, 0.13);
}

.textarea { min-height: 140px; resize: vertical; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(104,174,248,0.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: #f9fbfd; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost {
    background: rgba(255,255,255,0.55);
    color: var(--text-soft);
    border-color: rgba(216,225,235,0.9);
}

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px 26px 34px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 6px 0 22px;
}
.page-header h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}
.page-header p { margin: 8px 0 0; color: var(--text-soft); font-size: 14px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(216,225,235,0.92);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stat-card .label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-soft);
}
.stat-card .value { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card.total { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.stat-card.urgent { background: linear-gradient(180deg, #ffffff 0%, var(--danger-soft) 100%); }
.stat-card.behandeling { background: linear-gradient(180deg, #ffffff 0%, var(--warning-soft) 100%); }
.stat-card.later { background: linear-gradient(180deg, #ffffff 0%, var(--later-soft) 100%); }
.stat-card.afgerond { background: linear-gradient(180deg, #ffffff 0%, var(--success-soft) 100%); }

.card, .panel, .table-wrap {
    background: rgba(255,255,255,0.84);
    border: 1px solid rgba(216,225,235,0.9);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}
.card-body, .panel-body { padding: 22px; }

.filters-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}
.filters-bar.compact { grid-template-columns: 2fr 1fr auto; }

.kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.kanban-column {
    background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.38) 100%);
    border: 1px solid rgba(216,225,235,0.74);
    border-radius: 24px;
    padding: 14px;
    min-height: 280px;
}
.kanban-column.drop-target {
    border-color: rgba(104, 174, 248, 0.7);
    box-shadow: 0 0 0 4px rgba(104,174,248,0.12);
}
.kanban-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 4px 4px 8px;
}
.kanban-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.kanban-head-left { display:flex; align-items:center; gap:10px; }
.kanban-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}
.kanban-column.urgent .kanban-dot { background: var(--danger); }
.kanban-column.behandeling .kanban-dot { background: var(--warning); }
.kanban-column.later .kanban-dot { background: var(--later); }
.kanban-head .count {
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.kanban-column.urgent .count { background: var(--danger-soft); color: var(--danger); }
.kanban-column.behandeling .count { background: var(--warning-soft); color: #c97b00; }
.kanban-column.later .count { background: var(--later-soft); color: var(--later); }
.kanban-list { min-height: 160px; }

.idea-card {
    background: #fff;
    border: 1px solid rgba(216,225,235,0.94);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    display: block;
}
.idea-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(104,174,248,0.35);
}
.idea-card.dragging {
    opacity: 0.55;
    transform: scale(0.98);
}
.idea-card h4 { margin: 0 0 6px; font-size: 16px; line-height: 1.25; }
.idea-card p { margin: 0 0 12px; color: var(--text-soft); font-size: 14px; }
.idea-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 12px;
    flex-wrap: wrap;
}
.card-handle {
    color: #8da1b7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent;
}
.badge-apps { background: #eaf4ff; color: #2f80ed; }
.badge-werk { background: #ebf9f2; color: #209261; }
.badge-prive { background: #fff4e8; color: #d97917; }
.badge-overige { background: #eef2f7; color: #64748b; }
.badge-type { background: #f4f7fb; color: #607086; border-color: #e2eaf3; }
.badge-reminder { background: #fff7dd; color: #9a7600; }
.badge-status { background: #f3f6fb; color: #53657b; border-color: #e1e8f0; }

.form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: #445366; }
.small-help { color: var(--text-soft); font-size: 12px; margin-top: 6px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    text-align: left; font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--text-soft); padding: 16px 18px; background: #f9fbfe; border-bottom: 1px solid var(--line);
}
.table tbody td { padding: 16px 18px; border-bottom: 1px solid #edf2f7; vertical-align: top; }
.table tbody tr:hover { background: #fbfdff; }

.file-list { display: grid; gap: 10px; }
.file-item {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff;
}
.file-meta { min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; word-break: break-word; }
.file-sub { color: var(--text-soft); font-size: 12px; }
.empty-state {
    padding: 22px; border: 1px dashed var(--line); border-radius: 16px; text-align: center;
    color: var(--text-soft); background: rgba(255,255,255,0.55);
}

.alert {
    padding: 14px 16px; border-radius: 14px; margin: 0 0 16px; font-size: 14px; border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); color: #206d4e; border-color: #cdeede; }
.alert-error, .alert-danger { background: var(--danger-soft); color: #9d3f47; border-color: #f4ccd1; }
.alert-info { background: #eef6ff; color: #315e8b; border-color: #d9eaff; }

.detail-description {
    border-top: 1px solid #edf2f7; margin-top: 18px; padding-top: 18px;
}
.text-soft { color: var(--text-soft); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.right { text-align: right; }
.hide-desktop { display: none; }

.auth-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-card {
    width: 100%; max-width: 460px; background: rgba(255,255,255,0.94);
    border: 1px solid rgba(216,225,235,0.9); border-radius: 28px; box-shadow: var(--shadow-md); overflow: hidden;
}
.auth-top { padding: 28px 28px 12px; }
.auth-body { padding: 0 28px 28px; }
.auth-title { margin: 0; font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; }
.auth-subtitle { margin: 8px 0 0; color: var(--text-soft); font-size: 14px; }
.auth-brand {
    display: flex; align-items: center; gap: 12px;
}
.auth-brand .brand-badge {
    width: 46px; height: 46px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #a3d1ff 100%);
    color: #fff; display:flex; align-items:center; justify-content:center; font-size:22px;
    box-shadow: var(--shadow-sm);
}
.auth-brand h1 { margin:0; font-size: 18px; }
.auth-brand p { margin:4px 0 0; color: var(--text-soft); font-size: 13px; }

@media (max-width: 1220px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
    .sidebar {
        width: 100%;
        position: static;
        min-height: auto;
        padding-bottom: 16px;
    }
    .page-shell { margin-left: 0; }
    .app-shell { display: block; }
    .topbar-inner,
    .topbar-main { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kanban, .form-grid { grid-template-columns: 1fr; }
    .filters-bar, .filters-bar.compact { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .container { padding: 18px 16px 26px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-inner { padding: 14px 16px; }
    .topbar-actions { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .file-item { flex-direction: column; align-items: stretch; }
    .hide-desktop { display: inline-flex; }
    .sidebar-bottom { margin-top: 8px; }
}
