/* ============================================================
   StudyOS — design system
   ============================================================ */

:root {
    --bg: #eef1f7;
    --bg-soft: #e5e9f2;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --border: #dfe4ee;
    --text: #1c2333;
    --text-soft: #5b6478;
    --text-faint: #9aa3b8;
    --primary: #6366f1;
    --primary-soft: #eef0ff;
    --primary-strong: #4f46e5;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 1px 3px rgba(20, 25, 50, .07), 0 6px 20px rgba(20, 25, 50, .06);
    --shadow-lg: 0 8px 40px rgba(20, 25, 50, .18);
    --radius: 14px;
    --radius-sm: 9px;
    --topbar-h: 52px;
}

[data-theme="dark"] {
    --bg: #0f1422;
    --bg-soft: #141a2c;
    --surface: #1a2235;
    --surface-2: #202a42;
    --border: #2c3753;
    --text: #e7ebf5;
    --text-soft: #a3adc4;
    --text-faint: #6b7591;
    --primary: #818cf8;
    --primary-soft: #272f4d;
    --primary-strong: #a5b0ff;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- knoppen & velden ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
[data-theme="dark"] .btn-primary { color: #10142a; }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, .08); border-color: var(--danger); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"],
select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 70px; }

input[type="color"] {
    width: 44px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

.field { display: block; margin-bottom: 13px; }
.field > span {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

/* ---------- login / reset ---------- */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60vw 60vw at 15% 10%, rgba(99, 102, 241, .35), transparent 60%),
        radial-gradient(50vw 50vw at 90% 30%, rgba(168, 85, 247, .28), transparent 60%),
        radial-gradient(55vw 55vw at 50% 100%, rgba(56, 189, 248, .25), transparent 60%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 410px;
    padding: 34px 32px 28px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .auth-card {
    background: rgba(26, 34, 53, .8);
    border-color: rgba(255, 255, 255, .08);
}

.auth-head { position: relative; text-align: center; margin-bottom: 22px; }
.auth-logo { font-size: 44px; line-height: 1; }
.auth-head h1 { margin: 8px 0 2px; font-size: 26px; letter-spacing: -.5px; }
.auth-head p { margin: 0; color: var(--text-soft); font-size: 13.5px; }

.lang-toggle {
    position: absolute;
    top: -12px;
    right: -10px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-soft);
}
.lang-toggle:hover { color: var(--primary); border-color: var(--primary); }

.auth-panel h2 { margin: 0 0 16px; font-size: 18px; }
.auth-panel label { display: block; margin-bottom: 13px; }
.auth-panel label > span {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.auth-panel small { display: block; margin-top: 4px; color: var(--text-faint); font-size: 11.5px; }
.auth-sub { margin: -6px 0 14px; font-size: 13px; color: var(--text-soft); }

.auth-msg {
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
    font-size: 13px;
}
.auth-msg.ok { background: rgba(34, 197, 94, .12); color: #15803d; }
[data-theme="dark"] .auth-msg.ok { color: #4ade80; }

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    font-size: 13px;
}

/* ---------- topbar & tabs ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--topbar-h);
    padding: 0 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    font-weight: 800;
    font-size: 15.5px;
    letter-spacing: -.3px;
    white-space: nowrap;
}
.brand-logo { font-size: 19px; }

.tabbar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    align-self: flex-end;
    height: 40px;
}
.tabbar::-webkit-scrollbar { display: none; }

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 190px;
    min-width: 0;
    height: 36px;
    padding: 0 10px 0 12px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background .12s;
}
.tab:hover { background: var(--surface-2); }
.tab.active {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
    font-weight: 600;
}
.tab.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }

.tab-icon { font-size: 14px; }
.tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    max-width: 130px;
}
.tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-faint);
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}
.tab-close:hover { background: rgba(239, 68, 68, .15); color: var(--danger); }

.tab-add {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    font-size: 19px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
.tab-add:hover { background: var(--primary-soft); color: var(--primary); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-focus {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-focus:hover { border-color: var(--primary); color: var(--primary); }

.avatar {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.avatar:hover { filter: brightness(1.1); }

/* ---------- panels ---------- */

#panels { height: calc(100vh - var(--topbar-h)); }

.tab-panel {
    display: none;
    height: 100%;
    overflow: auto;
}
.tab-panel.active { display: block; }
.tab-panel.no-scroll { overflow: hidden; }

/* ---------- menu's (dropdowns) ---------- */

.menu {
    position: fixed;
    z-index: 200;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.menu-title {
    padding: 7px 10px 5px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-faint);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13.5px;
}
.menu-item:hover { background: var(--primary-soft); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border); }

/* ---------- modals ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 14, 28, .45);
    backdrop-filter: blur(3px);
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modal-in .16s ease-out;
}
@keyframes modal-in {
    from { transform: translateY(14px) scale(.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 18px;
}
.modal-foot .left { margin-right: auto; }

/* ---------- toast ---------- */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 400;
    padding: 10px 20px;
    border-radius: 99px;
    background: var(--text);
    color: var(--bg);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- generieke kaarten ---------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-soft);
}

.empty-hint { color: var(--text-faint); font-size: 13px; padding: 8px 0; }

/* ---------- taakrijen (gedeeld: home, widget, planner, focus) ---------- */

.task-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
}
.task-row:hover { background: var(--surface-2); }
.task-row .task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-row .task-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .task-title { text-decoration: line-through; color: var(--text-faint); }
.task-row .task-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.task-row .task-meta .overdue { color: var(--danger); font-weight: 600; }

.subject-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.prio {
    display: inline-flex;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
}
.prio-3 { background: rgba(239, 68, 68, .12); color: var(--danger); }
.prio-2 { background: rgba(99, 102, 241, .12); color: var(--primary); }
.prio-1 { background: rgba(148, 163, 184, .18); color: var(--text-soft); }

/* ---------- HOME ---------- */

.home { max-width: 1150px; margin: 0 auto; padding: 28px 24px 50px; }

.home-header { margin-bottom: 22px; }
.home-header h1 { margin: 0 0 3px; font-size: 26px; letter-spacing: -.5px; }
.home-header p { margin: 0; color: var(--text-soft); }

.home-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.home-grid .span-4 { grid-column: span 4; }
.home-grid .span-6 { grid-column: span 6; }
.home-grid .span-8 { grid-column: span 8; }
.home-grid .span-12 { grid-column: span 12; }
@media (max-width: 980px) {
    .home-grid .span-4, .home-grid .span-6, .home-grid .span-8 { grid-column: span 12; }
}

.stat-pair { display: flex; gap: 16px; }
.stat-big { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-soft); }
.stat-cell { flex: 1; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, transform .1s;
}
.quick-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.quick-item .qi-icon { font-size: 22px; }
.quick-item .qi-label {
    font-size: 12.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.quote { font-size: 16px; font-style: italic; line-height: 1.55; margin: 0 0 6px; }
.quote-author { color: var(--text-soft); font-size: 13px; }

/* ---------- DASHBOARD ---------- */

.dash { padding: 14px 18px 60px; }

.dash-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.dash-grid { position: relative; min-height: 300px; }

.widget {
    position: absolute;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: top .15s, left .15s, width .15s, height .15s;
}
.widget.dragging, .widget.resizing {
    transition: none;
    z-index: 20;
    box-shadow: var(--shadow-lg);
    opacity: .92;
}

.widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    cursor: grab;
    user-select: none;
}
.widget-head:active { cursor: grabbing; }
.widget-title {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.widget-remove {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.widget-remove:hover { background: rgba(239, 68, 68, .12); color: var(--danger); }

.widget-body { flex: 1; padding: 12px 14px; overflow: auto; min-height: 0; }

.widget-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    color: var(--text-faint);
    font-size: 11px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    user-select: none;
}

.drop-ghost {
    position: absolute;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    background: var(--primary-soft);
    opacity: .6;
    pointer-events: none;
    z-index: 10;
}

/* widget: timer */
.timer-modes { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mode-btn {
    padding: 4px 11px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-soft);
}
.mode-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .mode-btn.active { color: #10142a; }

.timer-display {
    text-align: center;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    margin: 8px 0 4px;
}
.timer-display.break-mode { color: var(--success); }
.timer-sub { text-align: center; font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.timer-controls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.timer-extra { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.timer-extra select { flex: 1; }
.timer-extra input[type="number"] { width: 76px; }

/* widget: stats */
.stats-nums { display: flex; gap: 14px; margin-bottom: 10px; }
.stats-nums .stat-cell { flex: 1; }
.stats-canvas { width: 100%; height: 110px; display: block; }
.subject-bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: 6px; }
.subject-bar .bar-track { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.subject-bar .bar-fill { height: 100%; border-radius: 99px; }

/* widget: streak */
.streak-box { text-align: center; padding-top: 4px; }
.streak-flame { font-size: 40px; }
.streak-num { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.streak-label { color: var(--text-soft); font-size: 12.5px; }

/* widget: goals */
.goal-row { display: flex; align-items: center; gap: 9px; padding: 5px 2px; }
.goal-row.done span { text-decoration: line-through; color: var(--text-faint); }
.goal-row span { flex: 1; }
.goal-del { border: none; background: none; color: var(--text-faint); cursor: pointer; }
.goal-del:hover { color: var(--danger); }

/* widget: notes */
.notes-area {
    width: 100%;
    height: 100%;
    min-height: 100px;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    box-shadow: none;
    padding: 0;
}

/* widget: subject (studie) */
.subj-progress { margin-top: 10px; }
.progress-track { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .25s; }
.subj-counter { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; font-size: 13px; }
.subj-counter .count-btns { display: flex; gap: 6px; }

/* mini-kalender */
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font-weight: 700; font-size: 13px; }
.mini-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 11.5px;
}
.mini-cal .dow { color: var(--text-faint); font-weight: 700; font-size: 10px; padding: 2px 0; }
.mini-day {
    position: relative;
    padding: 4px 0;
    border-radius: 7px;
    cursor: pointer;
}
.mini-day:hover { background: var(--surface-2); }
.mini-day.other { color: var(--text-faint); opacity: .5; }
.mini-day.today { background: var(--primary); color: #fff; font-weight: 700; }
[data-theme="dark"] .mini-day.today { color: #10142a; }
.mini-day .dot {
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--warning);
}
.mini-day.today .dot { background: #fff; }
.mini-day-list { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }

/* ---------- PLANNER ---------- */

.planner { display: flex; height: 100%; min-height: 0; }

.planner-side {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
    min-height: 0;
}
.planner-side-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 9px; }
.planner-filters { display: flex; gap: 8px; align-items: center; }
.planner-filters select { flex: 1; }
.planner-list { flex: 1; overflow-y: auto; padding: 0 8px 20px; }

.group-title {
    margin: 14px 8px 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-faint);
}
.group-title.overdue { color: var(--danger); }

.task-item { border-left: 3px solid transparent; }
.subtask-list { margin-left: 30px; }
.subtask-list .task-row { padding: 3px 8px; font-size: 13px; }

.planner-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.planner-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-wrap: wrap;
}
.planner-toolbar .cal-title { font-weight: 700; font-size: 15.5px; flex: 1; text-transform: capitalize; }

.view-switch { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-switch button {
    padding: 6px 13px;
    border: none;
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}
.view-switch button.active { background: var(--primary); color: #fff; }
[data-theme="dark"] .view-switch button.active { color: #10142a; }

.cal-wrap { flex: 1; overflow: auto; padding: 14px 16px 30px; }

.cal-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 4px 0;
}
.cal-cell {
    min-height: 96px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cal-cell.other { opacity: .55; background: transparent; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-cell.drag-over { background: var(--primary-soft); border-color: var(--primary); }
.cal-cell-date { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.cal-cell.today .cal-cell-date { color: var(--primary); }

.task-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 7px;
    border-radius: 6px;
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
}
.task-chip.done { opacity: .5; text-decoration: line-through; }
.task-chip:hover { filter: brightness(.96); }
.chip-more { font-size: 11px; color: var(--text-faint); cursor: pointer; }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week.one-day { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
.day-col {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.day-col.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day-col.drag-over { background: var(--primary-soft); }
.day-col-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: capitalize;
}
.day-col.today .day-col-head { color: var(--primary); }
.day-col-body { padding: 7px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.day-task-time { font-size: 10.5px; opacity: .75; font-weight: 700; margin-right: 4px; }

/* ---------- WEBSITE-TAB ---------- */

.web-setup { max-width: 660px; margin: 0 auto; padding: 40px 24px; }
.web-setup h2 { margin: 0 0 18px; }
.web-url-row { display: flex; gap: 10px; margin-bottom: 28px; }
.web-url-row input { flex: 1; }

.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s;
}
.fav-item:hover { border-color: var(--primary); }
.fav-item .fav-title { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-item .fav-url { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-del {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    background: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 12px;
}
.fav-del:hover { color: var(--danger); }

.web-view { display: flex; flex-direction: column; height: 100%; }
.web-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.web-toolbar .web-url {
    flex: 1;
    font-size: 12.5px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
}
.web-frame-wrap { flex: 1; position: relative; background: #fff; }
.web-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.web-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(245, 158, 11, .12);
    color: var(--text-soft);
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
}

/* ---------- FOCUS MODE ---------- */

.focus-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    overflow-y: auto;
    background:
        radial-gradient(70vw 70vw at 20% 0%, rgba(99, 102, 241, .25), transparent 60%),
        radial-gradient(60vw 60vw at 90% 100%, rgba(168, 85, 247, .2), transparent 60%),
        var(--bg);
}
.focus-inner { max-width: 880px; margin: 0 auto; padding: 38px 24px 60px; }
.focus-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.focus-top h2 { margin: 0; font-size: 20px; }

.focus-timer-card { text-align: center; padding: 30px 20px 26px; margin-bottom: 18px; }
.focus-timer-card .timer-display { font-size: 76px; margin: 2px 0 6px; }

.focus-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .focus-cols { grid-template-columns: 1fr; } }
.focus-cols .notes-area { min-height: 170px; }

/* ---------- profielmodal ---------- */

.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 6px 0 4px; }
.profile-stat {
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.profile-stat .stat-big { font-size: 24px; }

.settings-sep { height: 1px; background: var(--border); margin: 18px 0 16px; }

/* ---------- klein scherm ---------- */

@media (max-width: 760px) {
    .brand-name { display: none; }
    .btn-focus span { display: none; }
    .planner { flex-direction: column; }
    .planner-side { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border); }
    .home { padding: 18px 14px 40px; }
}
