
:root{--bg:#f3f5f2;--text:#26372e;--muted:#64786b;--line:#dfe7e0;--shadow:0 4px 20px rgba(20,49,34,.035)}
.stack-sidebar{display:none}body.stack-authed .app-shell{max-width:none;margin:0;display:grid;grid-template-columns:218px minmax(0,1fr);min-height:100dvh;padding:0}
body.stack-authed .stack-sidebar{display:flex;flex-direction:column;position:sticky;top:0;align-self:start;height:100dvh;overflow-y:auto;background:#203d35;color:#eaf4ec;padding:25px 13px;gap:26px}
.stack-sidebar .brand{padding:0 6px}.stack-sidebar .brand strong{font-size:14px;letter-spacing:0;color:#fff;overflow-wrap:anywhere}.stack-sidebar .brand small{font-size:11px;color:#bdd3c4}.stack-sidebar .brand-icon{flex:none;background:#4b7566}
.stack-sidebar .tabs{border:0;display:flex;flex-direction:column;overflow:visible;gap:4px}.stack-sidebar .tab{padding:11px 13px;text-align:left;border:0;border-radius:8px;color:#c9dbd0;font-size:13px;font-weight:550;white-space:normal}.stack-sidebar .tab:hover,.stack-sidebar .tab.active{background:#355b4e;color:#fff}.stack-sidebar .tab.active{box-shadow:inset 3px 0 #a9cbb7}.stack-sidebar .tab[hidden]{display:none}
.sidebar-secondary-link{font-size:12px;color:#a9cdb7;display:block;text-decoration:none;border-top:1px solid #426256;padding:14px 12px}.sidebar-secondary-link:hover{color:#fff}
body.stack-authed .stack-workspace{min-width:0;padding:0 clamp(20px,3vw,46px) 28px}body.stack-authed .masthead{min-height:70px;border-bottom:1px solid var(--line);margin:0}.stack-heading{font-size:14px;font-weight:660;color:#516c5a}body.stack-authed main{padding-top:26px;min-height:65vh}body:not(.stack-authed) .app-shell{max-width:1180px}body:not(.stack-authed) .stack-workspace{min-width:0}body:not(.stack-authed) .masthead{border-bottom:1px solid var(--line)}body:not(.stack-authed) .stack-heading{font-size:17px}body:not(.stack-authed) #app{max-width:650px;margin:auto}
body.stack-authed .save-status{border:1px solid var(--line);padding:8px 12px;border-radius:28px;background:#fff;color:var(--text)}body.stack-authed .login-status-group{align-items:flex-end}
body.stack-authed .page-top h1{font-size:30px}body.stack-authed .card{border-radius:13px}
.overview-filters{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:19px}.overview-filters label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:650;color:#4f6557}.overview-filters select{border:1px solid var(--line);padding:9px 12px;border-radius:8px;background:#fff;min-width:150px;font:inherit;color:var(--text)}
.overview-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:20px}.overview-metric{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:16px 17px;min-width:0;box-shadow:var(--shadow)}.overview-metric>small,.overview-metric>span{display:block;color:var(--muted);font-size:11px}.overview-metric>strong{font-size:clamp(20px,2vw,28px);font-weight:700;display:block;letter-spacing:-.045em;color:#284535;margin:6px 0 2px;overflow-wrap:anywhere}.overview-metric.highlight{background:#edf5ef;border-color:#d5e7d9}
.overview-panels{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;margin-bottom:26px;align-items:start}.overview-panel{padding:18px 20px}.overview-panel header,.overview-project-section>header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.overview-panel h2,.overview-project-section h2{font-size:16px;font-weight:700;letter-spacing:-.02em;margin:0}.overview-panel header>small{font-size:12px;color:var(--muted)}
.overview-chart{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:5px;height:175px}.overview-chart-month{border:0;border-radius:5px;background:transparent;padding:4px 1px;display:flex;align-items:center;flex-direction:column;gap:7px;cursor:pointer;min-width:0;color:var(--muted)}.overview-chart-month:hover,.overview-chart-month.selected{background:#e6f1e9;color:#29684b}.overview-chart-slot{width:100%;flex:1;display:flex;justify-content:center;align-items:end;background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#edf2ed calc(25% - 1px),#edf2ed 25%);border-bottom:1px solid var(--line)}.overview-chart-bar{width:65%;max-width:27px;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden;border-radius:4px 4px 0 0;min-height:0}.overview-chart-bar i{width:100%;background:#54896b;display:block}.overview-chart-bar i.indirect{background:#c5d9c8}.overview-chart-month small{font-size:10px;font-weight:630}.overview-legend{display:flex;justify-content:flex-end;gap:16px;margin-top:10px;color:var(--muted);font-size:11px}.overview-legend span{display:flex;align-items:center;gap:5px}.overview-legend i{width:10px;height:10px;background:#54896b;border-radius:3px}.overview-legend span:last-child i{background:#c5d9c8}
.overview-recent{width:100%;display:flex;gap:10px;align-items:center;text-align:left;border:0;border-bottom:1px solid var(--line);padding:10px 0;background:transparent;cursor:pointer;color:var(--text);font:inherit}.overview-recent:last-child{border:0}.overview-recent:hover{background:#f4f8f5}.overview-recent-icon{height:32px;width:32px;flex:none;display:grid;place-items:center;border-radius:8px;background:#e7f1ea;color:#3d7555;font-size:10px;font-weight:730}.overview-recent-copy{min-width:0;flex:1}.overview-recent-copy strong{font-size:12px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overview-recent-copy small{color:var(--muted);font-size:10px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-recent>b{font-size:12px;color:#315d42;white-space:nowrap}.overview-empty{padding:22px;color:var(--muted);font-size:13px}
.overview-project-section>header{margin-bottom:13px}.overview-project-section h2 span{font-size:11px;border-radius:15px;padding:3px 8px;background:#e1ede3;color:#38664d;margin-left:5px}.overview-project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.overview-project{border:1px solid var(--line);background:var(--paper);border-radius:13px;box-shadow:var(--shadow);padding:16px;text-align:left;display:flex;flex-direction:column;gap:12px;min-width:0;cursor:pointer;color:var(--text);font:inherit}.overview-project:hover{border-color:#89b29a;background:#fcfefc}.overview-project-top{display:flex;justify-content:space-between;align-items:center;gap:6px}.overview-project-code{color:#3b6f50;background:#e5f1e8;border-radius:6px;padding:4px 7px;font-size:11px;font-weight:730;overflow-wrap:anywhere}.overview-project-top small{font-size:10px;color:var(--muted)}.overview-project>strong{font-size:15px;min-height:25px;overflow-wrap:anywhere}.overview-project-numbers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.overview-project-numbers span{min-width:0}.overview-project-numbers small{display:block;color:var(--muted);font-size:10px}.overview-project-numbers b{font-size:17px;font-weight:720;overflow-wrap:anywhere}.overview-progress{height:7px;border-radius:5px;overflow:hidden;background:#eaf0e9}.overview-progress i{height:100%;display:block;background:#72a182;border-radius:5px}.overview-project-bottom{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;align-items:center}.overview-project-bottom span{font-size:17px;color:#508264}.overview-more{margin-top:20px}.overview-more-toggle{width:100%;border:0;padding:18px 20px;cursor:pointer;text-align:left;display:flex;align-items:center;justify-content:space-between;font:inherit;font-weight:650;background:var(--paper);color:var(--text)}.overview-more-body{padding:0 20px 18px}.overview-more-body .actions{justify-content:flex-end;margin-top:18px}.overview-mini-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:14px}.overview-project-dialog .overview-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.overview-project-dialog h3{font-size:14px;margin:18px 0 8px}
body.stack-authed .setting-card{max-width:920px}
@media(max-width:1180px){body.stack-authed .app-shell{grid-template-columns:185px minmax(0,1fr)}.overview-project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-panels{grid-template-columns:1fr}.overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:750px){body.stack-authed .app-shell{display:block}body.stack-authed .stack-sidebar{position:static;height:auto;padding:13px 12px;gap:12px;overflow:visible}body.stack-authed .stack-sidebar .brand{padding:0}body.stack-authed .stack-sidebar .tabs{flex-direction:row;overflow-x:auto;gap:3px;scrollbar-width:thin}body.stack-authed .stack-sidebar .tab{padding:10px 11px;flex:none;font-size:12px;white-space:nowrap}body.stack-authed .stack-sidebar .sidebar-secondary-link{padding:4px 7px;border:0;align-self:flex-end}body.stack-authed .stack-workspace{padding:0 13px 22px}body.stack-authed .masthead{min-height:54px}body.stack-authed main{padding-top:18px}.overview-project-grid{grid-template-columns:1fr}.overview-metrics{gap:8px}.overview-metric{padding:12px}.overview-panels{gap:12px}.overview-panel{padding:14px}.overview-chart{gap:2px;height:155px}.overview-chart-month small{font-size:9px}.overview-mini-stats{grid-template-columns:1fr}.overview-project-dialog .overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.stack-heading{font-size:12px}body.stack-authed .page-top{flex-wrap:wrap;align-items:flex-start}}
@media print{body.stack-authed .app-shell{display:block}body.stack-authed .stack-sidebar{display:none}body.stack-authed .stack-workspace{padding:0}}

/* Optionele modules, met duidelijke status en weinig formulierdrukte */
.option-settings{max-width:920px;padding:22px 24px;margin:0 0 20px}.option-settings h2{font-size:18px;letter-spacing:-.03em;margin:0}.option-settings>p{color:var(--muted);font-size:12px;margin:5px 0 13px}.option-switch{display:flex;gap:12px;align-items:center;border-bottom:1px solid var(--line);padding:13px 0;position:relative;cursor:pointer}.option-switch>span:first-child{flex:1;min-width:0}.option-switch strong,.option-switch small{display:block}.option-switch strong{font-size:13px}.option-switch small{font-size:11px;color:var(--muted);margin-top:3px}.option-switch input{width:44px;height:25px;opacity:0;position:absolute;right:0;cursor:pointer}.option-toggle{width:44px;height:25px;background:#aebfb1;border-radius:20px;position:relative;pointer-events:none;flex:none}.option-toggle:after{content:'';position:absolute;width:19px;height:19px;border-radius:50%;background:white;top:3px;left:3px;box-shadow:0 1px 3px #0002;transition:transform .15s}.option-switch input:checked+.option-toggle{background:#3e8062}.option-switch input:checked+.option-toggle:after{transform:translateX(19px)}.option-switch input:focus-visible+.option-toggle{outline:3px solid #88bba3;outline-offset:2px}.option-settings .actions{justify-content:flex-end;margin-top:17px}
.stopwatch-panel{padding:14px 18px;margin-bottom:15px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.stopwatch-panel strong{font-variant-numeric:tabular-nums;font-size:27px;letter-spacing:0;display:block}.stopwatch-panel small{display:block;color:var(--muted);font-size:10px}
.budget-client{display:block;font-size:11px;color:var(--muted)}.budget-item{display:grid;gap:4px;border-top:1px solid var(--line);padding-top:6px;font-size:11px;min-width:150px}.budget-item>div:first-child{display:flex;gap:8px;justify-content:space-between;flex-wrap:wrap}.budget-item b{color:var(--text)}.budget-track{height:6px;border-radius:6px;background:#e5ede6;overflow:hidden}.budget-track i{height:100%;border-radius:6px;background:#79a386;display:block}.budget-item.near .budget-track i{background:#bb9141}.budget-item.over .budget-track i{background:#bd6960}.budget-item.near small{color:#91662d}.budget-item.over small{color:#a33a30}.budget-col{min-width:180px;white-space:normal}.overview-warning{padding:12px 15px;border:1px solid #e5d5b5;border-radius:10px;background:#fcf8ed;color:#73551d;margin-bottom:15px;font-size:12px}.overview-warning>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.overview-warning .btn{border-color:#e2cfa8;background:transparent;color:#73551d}

/* Donkere modus: gedeelde tokens voor gewone en agenda-schermen */
body.stack-dark{color-scheme:dark;--bg:#18241e;--paper:#24352b;--text:#e6eee8;--muted:#adbfaf;--line:#405747;--accent:#8dc9ac;--accent-d:#c0ebd2;--pale:#304838;--amber:#ebc17f;--red:#f4ada7;--shadow:0 6px 25px #0002;scrollbar-color:#637968 #24352b}
body.stack-dark .stack-sidebar{background:#152d23}body.stack-dark .stack-heading{color:#c2d6c9}body.stack-dark .card,body.stack-dark .kpi,body.stack-dark .overview-metric,body.stack-dark .overview-project{background:var(--paper);border-color:var(--line)}
body.stack-dark .overview-metric>strong,body.stack-dark .overview-project>b,body.stack-dark .overview-recent>b,body.stack-dark .budget-item b{color:#c2e7cc}
body.stack-dark .overview-metric.highlight{background:#2d4536}body.stack-dark .overview-project-code,body.stack-dark .overview-recent-icon,body.stack-dark .overview-project-section h2 span{background:#365440;color:#d2efd8}
body.stack-dark .overview-project:hover,body.stack-dark .overview-recent:hover,body.stack-dark .overview-chart-month:hover,body.stack-dark .overview-chart-month.selected{background:#314839;color:#def2df}
body.stack-dark .overview-project-bottom span{color:#b3ddc2}body.stack-dark .overview-more-toggle{background:var(--paper);color:var(--text)}body.stack-dark .overview-chart-slot{background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#34473a calc(25% - 1px),#34473a 25%);border-color:var(--line)}body.stack-dark .overview-progress,body.stack-dark .budget-track{background:#405847}
body.stack-dark :is(.field input,.field select,.field textarea,.toolbar input,.toolbar select,.overview-filters select,.year-choice select,.bill-row input,.dialog input,.dialog select,.dialog textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea){background:#2b4033;color:#e9f3e9;border:1px solid #6b8b74;color-scheme:dark}
body.stack-dark :is(input,textarea)::placeholder{color:#b0c4b3;opacity:1}body.stack-dark select :is(option,optgroup){background:#2b4033;color:#e9f3e9}body.stack-dark :is(input,select,textarea):focus-visible{outline:2px solid #a8e2bf;outline-offset:2px}body.stack-dark input[type="checkbox"]{accent-color:#86b99a}body.stack-dark input::file-selector-button{background:#3c5443;color:#e9f3e9;border:1px solid #708e7b;border-radius:6px;padding:6px}
body.stack-dark :is(.btn:not(.primary),.year-choice select,.save-status,.pill.off){background:#314739;color:var(--text);border-color:#658471}body.stack-dark .btn:not(.primary):hover{background:#405a47;color:#fff}
body.stack-dark .btn.primary{background:#316d55;color:#fff;border-color:#91bea2}body.stack-dark .btn.primary:hover{background:#417d64}
body.stack-dark .field label,body.stack-dark .year-choice label,body.stack-dark .overview-filters label,body.stack-dark .setting-row strong{color:#c2d4c5}body.stack-dark .subnote,body.stack-dark .tagline,body.stack-dark .entry-label small{color:var(--muted)}
body.stack-dark .data-table th{background:#2b4033;color:#c2d4c5;border-color:var(--line)}body.stack-dark .data-table td{border-color:var(--line)}body.stack-dark .data-table tr:hover td{background:#304737}body.stack-dark .data-table .empty-month{color:#8aa295}
body.stack-dark :is(.entry,.bill-row,.setting-row,.section-head,.dialog .dialog-actions){border-color:var(--line)}body.stack-dark .readonly-block,body.stack-dark .summary-tags span,body.stack-dark .bill-total,body.stack-dark .editor-details{background:#2d4134;border-color:var(--line);color:var(--text)}
body.stack-dark .pill{background:#355a43;color:#d7efdf}body.stack-dark .pill.pending{background:#483f2c;color:#f4d59f}
body.stack-dark .dialog{background:#26382d;color:var(--text)}body.stack-dark .dialog-backdrop{background:#07130dbb}
body.stack-dark .notice{background:#423a28;color:#f3d8a7;border-color:#73613f}body.stack-dark .notice.ok{background:#294739;color:#c4ebd0;border-color:#4d7960}body.stack-dark .notice.error,body.stack-dark .form-error{background:#482d2b;color:#ffc2b9;border-color:#805752}
body.stack-dark .overview-warning{background:#413927;color:#f4dca9;border-color:#8a734a}body.stack-dark .overview-warning .btn{color:#f4dca9;border-color:#8a734a}body.stack-dark .budget-item.near small{color:#e2c17b}body.stack-dark .budget-item.over small{color:#f1aba3}
body.stack-dark :is(.agenda-card,.agenda-aside,.agenda-aside-hint,.agenda-day-header,.agenda-top-corner,.agenda-filters,.agenda-unscheduled,.agenda-month-day,.agenda-detail,.agenda-view-switch,.agenda-summary>div){background:var(--paper);border-color:var(--line);color:var(--text)}
body.stack-dark :is(.agenda-btn,.agenda-select,.agenda-control){background:#314739;border-color:#6b8b74;color:var(--text)}
body.stack-dark :is(.agenda-btn.active,.agenda-btn:hover){background:#3d6249;color:#f5fff8}
body.stack-dark .agenda-day-track{background:#25382b;border-color:#425c47}body.stack-dark .agenda-day-track.today{background:#2b4232}
body.stack-dark :is(.agenda-times,.agenda-day-header span,.agenda-day-header small,.agenda-visual-legend){color:var(--muted)}
body.stack-dark :is(.agenda-event,.agenda-unscheduled-item,.agenda-month-item){background:color-mix(in srgb,var(--event-color,#52876c) 30%,#23362c);color:#eef8ee;border-color:color-mix(in srgb,var(--event-color,#52876c) 55%,#bedec8)}
body.stack-dark .agenda-event small{color:#dce9de}body.stack-dark .agenda-month-day.other-month{background:#29382c;color:#abc1ae}body.stack-dark .agenda-slot:hover{background:#698d7133}
@media(max-width:750px){.option-settings{padding:15px}.budget-col{min-width:140px}.stopwatch-panel strong{font-size:24px}}

/* Controleerbaar declaratieoverzicht (bestaand STACK-jaarbestand) */
.billing-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px;margin:0 0 18px}
.billing-stats>div{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:12px;min-width:0}
.billing-stats small{font-size:10px;color:var(--muted);display:block}
.billing-stats strong{font-size:18px;color:var(--text);margin-top:4px;display:block;font-variant-numeric:tabular-nums}
.billing-ledger{margin:15px 0;padding:0;overflow:hidden}
.billing-ledger>summary{padding:17px;cursor:pointer;display:flex;justify-content:space-between;gap:10px;align-items:center}
.billing-ledger>summary strong{font-size:14px}.billing-ledger>summary span{font-size:11px;color:var(--muted)}
.billing-ledger-body{padding:0 16px 16px}.billing-ledger-table td:first-child{min-width:180px}.billing-ledger-table td small{display:block;color:var(--muted);font-size:10px;max-width:300px}
.billing-status{font-size:11px;white-space:nowrap;color:var(--text)}
.billing-detail h3{font-size:14px;margin:22px 0 10px}.billing-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.billing-detail-summary>div{padding:12px;background:var(--pale);border-radius:8px;min-width:0}.billing-detail-summary small{display:block;font-size:11px;color:var(--muted)}
.billing-detail-summary strong{font-size:15px;overflow-wrap:anywhere}.billing-log{font-size:11px;padding:8px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.billing-history-actions{gap:5px;justify-content:flex-end;flex-wrap:wrap;min-width:150px}
.billing-alert{background:#fff5e7;border:1px solid #e6c9a1;color:#81521d;padding:12px 14px;border-radius:9px}
body.stack-dark .billing-alert{background:#453923;border-color:#877044;color:#f1d1a0}
body.stack-dark .billing-detail-summary>div{background:#314739}
@media(max-width:1100px){.billing-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.billing-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-ledger>summary{align-items:flex-start;flex-direction:column}.billing-detail-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-history-actions{min-width:100px}}
