:root{
  --bg:#f6f8fa;--surface:#fff;--surface-2:#f1f4f7;--border:#dde3ea;--text:#1d2630;--text-2:#5d6b7a;
  --primary:#0b7a75;--primary-h:#09645f;--primary-soft:#dff3f1;--on-primary:#fff;
  --danger:#c5362b;--danger-soft:#fdeceb;--warn:#b26a00;--warn-soft:#fff2d9;--ok:#1b7f3b;--ok-soft:#e1f5e7;
  --shadow:0 1px 2px rgba(20,30,40,.08),0 4px 14px rgba(20,30,40,.06);--shadow-lg:0 12px 40px rgba(10,20,30,.25);
  --radius:10px;--nav-w:208px;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
@media(prefers-color-scheme:dark){:root{
  --bg:#12171c;--surface:#1a2128;--surface-2:#222b34;--border:#2e3944;--text:#e6ebf0;--text-2:#9aa8b6;
  --primary:#38b2aa;--primary-h:#4fc7bf;--primary-soft:#173a39;--on-primary:#062321;
  --danger:#ff7b6e;--danger-soft:#3b1f1d;--warn:#f0b04a;--warn-soft:#3a2d12;--ok:#5fd183;--ok-soft:#173424;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.3);}}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--text);font-size:14px;line-height:1.45}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--primary)}
h1,h2,h3{margin:0;font-weight:600}
[hidden]{display:none!important}
svg.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* Shell */
.app{display:grid;grid-template-columns:var(--nav-w) minmax(0,1fr);grid-template-rows:56px minmax(0,1fr);grid-template-areas:"top top" "nav main";height:100vh;height:100dvh}
.topbar{grid-area:top;display:flex;align-items:center;gap:16px;padding:0 16px;background:var(--surface);border-bottom:1px solid var(--border)}
.wordmark{font-size:22px;font-weight:700;letter-spacing:-.5px;color:var(--primary);width:calc(var(--nav-w) - 32px);display:flex;align-items:center;gap:8px;text-decoration:none}
.wordmark .logo{width:28px;height:28px;border-radius:8px;background:var(--primary);color:var(--on-primary);display:grid;place-items:center;font-size:17px}
.search{position:relative;flex:1;max-width:640px}
.search input[type=search]{width:100%;height:38px;border:1px solid transparent;background:var(--surface-2);border-radius:20px;padding:0 14px 0 40px;outline:none}
.search input[type=search]:focus{background:var(--surface);border-color:var(--primary);box-shadow:var(--shadow)}
.search>svg{position:absolute;left:12px;top:9px;color:var(--text-2)}
.search-results{position:absolute;top:44px;left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:70vh;overflow:auto;z-index:50;padding:6px}
.search-results h4{margin:8px 10px 2px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-2)}
.search-results a{display:flex;gap:10px;align-items:center;padding:8px 10px;border-radius:8px;color:inherit;text-decoration:none}
.search-results a:hover,.search-results a:focus{background:var(--surface-2);outline:none}
.search-results .muted{padding:10px}
.spacer{flex:1}
.sidebar{grid-area:nav;display:flex;flex-direction:column;gap:2px;padding:10px 8px;background:var(--surface);border-right:1px solid var(--border);overflow:auto}
.sidebar a{display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:20px;color:var(--text-2);text-decoration:none;font-weight:500}
.sidebar a:hover{background:var(--surface-2);color:var(--text)}
.sidebar a.active{background:var(--primary-soft);color:var(--primary)}
.main{grid-area:main;min-width:0;min-height:0;position:relative;overflow:hidden}
.view{height:100%;overflow:auto;padding:20px 24px 32px}
.view.flush{padding:0;overflow:hidden}
.page-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.page-head h1{font-size:22px;margin-right:auto}

/* Controls */
.btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:18px;border:1px solid var(--border);background:var(--surface);cursor:pointer;font-weight:500;white-space:nowrap}
.btn:hover{background:var(--surface-2)}
.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.btn.primary:hover{background:var(--primary-h)}
.btn.danger{color:var(--danger);border-color:var(--danger)}
.btn.danger.solid{background:var(--danger);color:#fff}
.btn.ghost{border-color:transparent;background:transparent}
.btn.ghost:hover{background:var(--surface-2)}
.btn.sm{height:30px;padding:0 10px;font-size:13px}
.btn:disabled{opacity:.55;cursor:default}
.icon-btn{width:34px;height:34px;display:inline-grid;place-items:center;border-radius:50%;border:0;background:transparent;cursor:pointer;color:var(--text-2);flex:none}
.icon-btn:hover{background:var(--surface-2);color:var(--text)}
.icon-btn.danger:hover{color:var(--danger)}
input[type=text],input[type=password],input[type=search],input[type=date],input[type=time],input[type=email],select,textarea{width:100%;border:1px solid var(--border);background:var(--surface);border-radius:8px;padding:8px 10px;outline:none;min-height:36px}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-soft)}
textarea{resize:vertical}
select{width:auto;min-width:0}
input[type=checkbox]{width:17px;height:17px;accent-color:var(--primary);cursor:pointer}
input[type=color]{width:44px;height:36px;padding:2px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.field{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}
.field>label,.field>.lbl{font-size:12px;font-weight:600;color:var(--text-2)}
.row{display:flex;gap:12px;align-items:flex-end}
.row>.field{flex:1;min-width:0}
.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.muted{color:var(--text-2)}
.small{font-size:12px}
.card-box{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.avatar{display:inline-grid;place-items:center;border-radius:50%;color:#fff;font-weight:600;flex:none;user-select:none;text-shadow:0 1px 1px rgba(0,0,0,.25)}
.badge{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:10px;font-size:12px;font-weight:600;background:var(--surface-2);color:var(--text-2)}
.badge.high{background:var(--danger-soft);color:var(--danger)}
.badge.medium{background:var(--warn-soft);color:var(--warn)}
.badge.low{background:var(--ok-soft);color:var(--ok)}
.badge.ok{background:var(--ok-soft);color:var(--ok)}
.badge.warn{background:var(--warn-soft);color:var(--warn)}
.badge.bad{background:var(--danger-soft);color:var(--danger)}
.chip{display:inline-block;padding:0 7px;border-radius:9px;font-size:11px;background:var(--primary-soft);color:var(--primary);font-weight:600}
.overdue{color:var(--danger)!important;font-weight:600}

/* States */
.state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:48px 16px;color:var(--text-2);text-align:center}
.state svg.icon{width:40px;height:40px;opacity:.6}
.state strong{color:var(--text);font-size:15px}
.spinner{width:26px;height:26px;border:3px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Modal + toast */
.overlay{position:fixed;inset:0;background:rgba(10,18,26,.5);display:flex;align-items:center;justify-content:center;padding:16px;z-index:100}
.modal{background:var(--surface);border-radius:14px;box-shadow:var(--shadow-lg);width:min(520px,100%);max-height:92vh;display:flex;flex-direction:column;border:1px solid var(--border)}
.modal.wide{width:min(900px,100%)}
.modal-head{display:flex;align-items:center;gap:8px;padding:14px 18px;border-bottom:1px solid var(--border)}
.modal-head h2{font-size:17px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.modal-body{padding:16px 18px;overflow:auto}
.modal-foot{display:flex;gap:8px;justify-content:flex-end;padding:12px 18px;border-top:1px solid var(--border)}
.modal-foot .left{margin-right:auto}
.toasts{position:fixed;bottom:76px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:8px;z-index:200;align-items:center;pointer-events:none}
@media(min-width:761px){.toasts{bottom:24px}}
.toast{background:#26313b;color:#fff;padding:10px 16px;border-radius:8px;box-shadow:var(--shadow-lg);max-width:90vw;pointer-events:auto}
.toast.error{background:#b3261e}
.toast.ok{background:#1b6e3a}

/* Login */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:16px}
.login{width:min(380px,100%);padding:28px}
.login h1{color:var(--primary);font-size:28px;letter-spacing:-.5px;margin-bottom:4px}
.login .err{color:var(--danger);min-height:20px;margin:4px 0 8px}

/* Menu */
.menu{position:absolute;right:0;top:44px;min-width:220px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:6px;z-index:60}
.menu .who{padding:10px 12px;border-bottom:1px solid var(--border);margin-bottom:4px}
.menu button{display:flex;gap:10px;width:100%;align-items:center;border:0;background:transparent;padding:9px 12px;border-radius:8px;cursor:pointer;text-align:left}
.menu button:hover{background:var(--surface-2)}
.userbtn{position:relative;border:0;background:none;padding:0;cursor:pointer;border-radius:50%}

/* Dashboard */
.dash-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.panel{padding:16px}
.panel h2{font-size:15px;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.panel h2 a{margin-left:auto;font-size:12px;font-weight:500}
.list-item{display:flex;align-items:center;gap:10px;padding:7px 4px;border-radius:8px;color:inherit;text-decoration:none;min-width:0}
a.list-item:hover{background:var(--surface-2)}
.list-item .grow{flex:1;min-width:0}
.ellip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.done-text{text-decoration:line-through;color:var(--text-2)}

/* Task list */
.task-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto auto auto 30px;gap:12px;align-items:center;padding:9px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.task-row:last-child{border-bottom:0}
.task-row:hover{background:var(--surface-2)}
.task-row .meta{font-size:12px;color:var(--text-2)}
@media(max-width:760px){.task-row{grid-template-columns:28px minmax(0,1fr) 30px}.task-row .hide-m{display:none}}

/* Board */
.board-scroll{display:flex;gap:12px;align-items:flex-start;overflow-x:auto;padding-bottom:16px;min-height:60vh}
.col{flex:0 0 280px;background:var(--surface-2);border-radius:12px;display:flex;flex-direction:column;max-height:calc(100vh - 210px)}
.col-head{display:flex;align-items:center;gap:6px;padding:10px 10px 6px 14px;font-weight:600}
.col-head .name{flex:1;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.col-head .count{font-weight:500;color:var(--text-2);font-size:12px}
.col-body{padding:4px 8px 8px;overflow-y:auto;min-height:44px;display:flex;flex-direction:column;gap:8px}
.col.over{outline:2px dashed var(--primary);outline-offset:-2px}
.tcard{background:var(--surface);border:1px solid var(--border);border-radius:9px;padding:10px 12px;cursor:grab;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.tcard:hover{border-color:var(--primary)}
.tcard.dragging{opacity:.4}
.tcard .t{font-weight:500;word-break:break-word}
.tcard .labels{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}
.tcard .foot{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:12px;color:var(--text-2)}
.drop-ph{height:44px;border:2px dashed var(--primary);border-radius:9px;background:var(--primary-soft);flex:none}
.col-add{flex:0 0 240px}

/* Split views */
.split{display:grid;grid-template-columns:260px minmax(0,1fr);height:100%}
.split>.side{border-right:1px solid var(--border);background:var(--surface);overflow:auto;display:flex;flex-direction:column}
.split>.pane{min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--bg)}
.side-head{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 6px 16px;font-weight:600}
.side-item{display:flex;align-items:center;gap:8px;padding:9px 16px;cursor:pointer;border-left:3px solid transparent;color:inherit;text-decoration:none;min-width:0}
.side-item:hover{background:var(--surface-2)}
.side-item.active{background:var(--primary-soft);border-left-color:var(--primary)}
.side-item .dot{width:8px;height:8px;border-radius:50%;background:var(--primary);margin-left:auto;flex:none}
.side-item .grow{flex:1;min-width:0}

/* Chat */
.msgs{flex:1;overflow-y:auto;padding:12px 20px}
.day-sep{display:flex;align-items:center;gap:12px;color:var(--text-2);font-size:12px;margin:14px 0 6px}
.day-sep::before,.day-sep::after{content:"";flex:1;height:1px;background:var(--border)}
.msg{display:flex;gap:10px;padding:5px 0;position:relative}
.msg .body{min-width:0;flex:1}
.msg .head{display:flex;gap:8px;align-items:baseline}
.msg .head b{font-weight:600}
.msg .text{white-space:pre-wrap;word-break:break-word}
.msg .del{opacity:0;position:absolute;right:0;top:2px}
.msg:hover .del{opacity:1}
.composer{display:flex;gap:8px;padding:10px 16px;border-top:1px solid var(--border);background:var(--surface);align-items:flex-end}
.composer textarea{resize:none;max-height:140px}

/* Files */
.crumbs{display:flex;align-items:center;gap:2px;flex-wrap:wrap;margin-right:auto}
.crumbs button{border:0;background:none;padding:4px 8px;border-radius:6px;cursor:pointer;color:var(--primary);font-weight:500}
.crumbs button:hover{background:var(--surface-2)}
.crumbs span.sep{color:var(--text-2)}
.crumbs .cur{padding:4px 8px;font-weight:600}
.file-row{display:grid;grid-template-columns:28px minmax(0,1fr) 90px 150px auto;gap:12px;align-items:center;padding:8px 14px;border-bottom:1px solid var(--border)}
.file-row:last-child{border-bottom:0}
.file-row.clickable{cursor:pointer}
.file-row.clickable:hover{background:var(--surface-2)}
.file-row.head{font-size:12px;color:var(--text-2);font-weight:600;cursor:default}
.file-row .acts{display:flex}
@media(max-width:760px){.file-row{grid-template-columns:28px minmax(0,1fr) auto}.file-row .hide-m{display:none}}
.dropzone{position:relative}
.dropzone.drag::after{content:"Dateien hier ablegen";position:absolute;inset:0;border:3px dashed var(--primary);border-radius:var(--radius);background:color-mix(in srgb,var(--primary-soft) 85%,transparent);display:grid;place-items:center;font-size:18px;font-weight:600;color:var(--primary);z-index:5}
.uploads{margin-bottom:12px;padding:8px 14px}
.up-row{display:grid;grid-template-columns:minmax(0,1fr) 140px 44px;gap:10px;align-items:center;padding:4px 0}
progress{width:100%;height:8px;accent-color:var(--primary)}
.preview-img{max-width:100%;max-height:70vh;display:block;margin:0 auto}
.preview-text{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;margin:0;max-height:70vh;overflow:auto;background:var(--surface-2);padding:12px;border-radius:8px}
.preview-frame{width:100%;height:70vh;border:0;border-radius:8px;background:#fff}

/* Notes */
.note-meta{font-size:12px;color:var(--text-2)}
.editor{flex:1;display:flex;flex-direction:column;min-height:0;padding:16px 24px}
.editor-bar{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.editor-bar input{font-size:20px;font-weight:600;border:0;background:transparent;padding:4px 0;box-shadow:none!important}
.editor-cols{flex:1;display:grid;grid-template-columns:1fr 1fr;gap:16px;min-height:0}
.editor-cols textarea{height:100%;resize:none;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px}
.md{overflow:auto;padding:4px 12px;border-left:1px solid var(--border);word-break:break-word}
.md h1{font-size:22px;margin:12px 0 6px}.md h2{font-size:18px;margin:12px 0 6px}.md h3{font-size:15px;margin:10px 0 4px}
.md p{margin:6px 0}.md ul,.md ol{margin:6px 0;padding-left:24px}
.md code{background:var(--surface-2);padding:1px 5px;border-radius:4px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.9em}
.md pre{background:var(--surface-2);padding:10px;border-radius:8px;overflow:auto}.md pre code{padding:0;background:none}
.saved{font-size:12px;color:var(--text-2);white-space:nowrap}
.seg{display:none;gap:0}
@media(max-width:900px){.editor-cols{grid-template-columns:1fr}.editor-cols.show-edit .md{display:none}.editor-cols.show-prev textarea{display:none}.seg{display:inline-flex}}

/* Calendar */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.cal .dow{padding:6px 8px;font-size:12px;font-weight:600;color:var(--text-2);background:var(--surface-2);border-bottom:1px solid var(--border)}
.cal .day{min-height:104px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:4px;cursor:pointer;min-width:0;overflow:hidden}
.cal .day:nth-child(7n+7){border-right:0}
.cal .day:hover{background:var(--surface-2)}
.cal .day.other{background:var(--bg);color:var(--text-2)}
.cal .num{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font-size:12px;margin-bottom:2px}
.cal .today .num{background:var(--primary);color:var(--on-primary);font-weight:700}
.ev{display:block;width:100%;text-align:left;border:0;border-radius:4px;padding:1px 6px;margin-bottom:2px;font-size:12px;background:var(--primary);color:var(--on-primary);cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev.task{background:transparent;color:var(--text);border:1px dashed var(--warn)}
.ev.task.done{opacity:.55;text-decoration:line-through}
.cal .more{font-size:11px;color:var(--text-2);padding-left:4px}
@media(max-width:760px){.cal .day{min-height:70px}.ev{font-size:10px;padding:0 3px}.view{padding:14px 12px 24px}}

/* Settings */
.kv{display:grid;grid-template-columns:200px minmax(0,1fr);gap:8px 16px}
.kv dt{color:var(--text-2)}.kv dd{margin:0;word-break:break-all}
.bar{height:10px;border-radius:5px;background:var(--surface-2);overflow:hidden;margin:4px 0}
.bar>i{display:block;height:100%;background:var(--primary)}
.banner{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--radius);font-weight:600;margin-bottom:14px}
.banner.demo{background:var(--warn-soft);color:var(--warn)}
.banner.nas{background:var(--ok-soft);color:var(--ok)}
.swatches{display:flex;gap:6px;flex-wrap:wrap}
.swatches button{width:26px;height:26px;border-radius:50%;border:2px solid transparent;cursor:pointer}
.swatches button.sel{border-color:var(--text)}
.stack{display:flex;flex-direction:column;gap:16px;max-width:720px}

/* Mobile shell */
@media(max-width:760px){
  .app{grid-template-columns:minmax(0,1fr);grid-template-rows:52px minmax(0,1fr) 58px;grid-template-areas:"top" "main" "nav"}
  .wordmark{width:auto}.wordmark span.t{display:none}.topbar{gap:10px;padding:0 10px}
  .sidebar{flex-direction:row;padding:0 4px;border-right:0;border-top:1px solid var(--border);gap:0;overflow-x:auto;padding-bottom:env(safe-area-inset-bottom)}
  .sidebar a{flex:1 0 auto;flex-direction:column;gap:1px;padding:6px 10px;font-size:10.5px;border-radius:10px;justify-content:center;min-width:58px}
  .split{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  .split>.side{border-right:0;border-bottom:1px solid var(--border);max-height:150px;flex-direction:row;overflow-x:auto;overflow-y:hidden}
  .split>.side .side-head{display:none}
  .split>.side.tall{max-height:34vh;flex-direction:column;overflow-y:auto}
  .side-item{border-left:0;border-bottom:3px solid transparent;white-space:nowrap}
  .side-item.active{border-bottom-color:var(--primary)}
  .kv{grid-template-columns:1fr}.row{flex-direction:column;align-items:stretch}
  .col{flex-basis:78vw;max-height:none}
}
@media(max-width:760px){.search-results{position:fixed;left:8px;right:8px;top:54px}}

/* Spalten: verschieben & löschen */
.col-head{cursor:grab}
.col-head .icon-btn{width:26px;height:26px}
.col-head .icon-btn:disabled{opacity:.3;cursor:default;background:transparent}
.col.col-dragging{opacity:.45}
.col.col-before{box-shadow:-4px 0 0 var(--primary)}
.col.col-after{box-shadow:4px 0 0 var(--primary)}

/* Dashboard (KPIs & Diagramme) */
:root{--viz:#0b7a75;--viz-track:#e6ebf0;--viz-crit:#d03b3b;--viz-good:#0ca30c;
  --series-1:#2a78d6;--series-2:#eb6834;--series-3:#1baf7a;--series-4:#eda100;--series-5:#e87ba4;--series-6:#008300;--series-7:#6250d6;--series-8:#e34948;
  --ord-1:#104281;--ord-2:#2a78d6;--ord-3:#86b6ef}
@media(prefers-color-scheme:dark){:root{--viz:#38b2aa;--viz-track:#2a343e;--viz-crit:#e66767;
  --series-1:#3987e5;--series-2:#d95926;--series-3:#199e70;--series-4:#c98500;--series-5:#d55181;--series-6:#008300;--series-7:#9085e9;--series-8:#e66767;
  --ord-1:#cde2fb;--ord-2:#5598e7;--ord-3:#1c5cab}}
.dash{max-width:1280px;margin:0 auto}
.dash-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 24px;margin-bottom:20px}
.dash-head h1{font-size:26px;letter-spacing:-.4px}
.dash-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.seg{display:inline-flex;background:var(--surface-2);border-radius:20px;padding:3px}
.seg-btn{border:0;background:transparent;padding:7px 18px;border-radius:17px;cursor:pointer;color:var(--text-2);font-weight:500;transition:background .15s,color .15s}
.seg-btn.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow)}
.kpi-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}
.kpi{display:flex;gap:14px;align-items:flex-start;padding:18px;color:inherit;text-decoration:none;transition:transform .15s,box-shadow .15s}
.kpi:hover{transform:translateY(-2px);box-shadow:0 2px 4px rgba(20,30,40,.08),0 10px 24px rgba(20,30,40,.1)}
.kpi-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary);flex:none}
.kpi.crit .kpi-icon{background:var(--danger-soft);color:var(--danger)}
.kpi.good .kpi-icon{background:var(--ok-soft);color:var(--ok)}
.kpi-main{min-width:0}
.kpi-label{color:var(--text-2);font-size:13px;font-weight:500}
.kpi-value{font-size:32px;font-weight:650;line-height:1.2;letter-spacing:-.5px;font-variant-numeric:tabular-nums}
.kpi-note{color:var(--text-2);font-size:12px}
.dash-row{display:grid;gap:16px;margin-bottom:16px;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.dash .panel{padding:20px}
.dash .panel h2{margin-bottom:4px}
.viz-sub{margin:0 0 16px;color:var(--text-2);font-size:12px}
.dash .panel h2+:not(.viz-sub){margin-top:12px}
.viz-tip{position:fixed;z-index:200;pointer-events:none;background:var(--text);color:var(--surface);padding:6px 10px;border-radius:6px;font-size:12px;max-width:280px;box-shadow:var(--shadow-lg)}
/* Donut */
.donut{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.donut-ring{position:relative;width:156px;height:156px;flex:none;margin:0 auto}
.donut-ring svg{width:100%;height:100%;display:block}
.donut-seg{transition:stroke-dasharray .7s cubic-bezier(.2,.8,.2,1),opacity .15s,stroke-width .15s;cursor:pointer}
.donut.has-focus .donut-seg{opacity:.3}
.donut.has-focus .donut-seg.on{opacity:1;stroke-width:15}
.donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;text-align:center;padding:0 30px}
.donut-num{font-size:30px;font-weight:650;line-height:1.1;font-variant-numeric:tabular-nums}
.donut-cap{font-size:11px;color:var(--text-2);line-height:1.2}
.legend{list-style:none;margin:0;padding:0;flex:1;min-width:150px;display:grid;gap:2px}
.legend li{display:grid;grid-template-columns:12px minmax(0,1fr) auto 40px;gap:8px;align-items:center;padding:5px 8px;border-radius:8px;outline:none;cursor:default;transition:background .15s}
.legend li.on,.legend li:focus-visible{background:var(--surface-2)}
.legend .swatch{width:12px;height:12px;border-radius:3px}
.legend b{font-variant-numeric:tabular-nums}
.legend .lg-pct{color:var(--text-2);font-size:12px;text-align:right;font-variant-numeric:tabular-nums}
/* Balken */
.hbars{display:grid;gap:12px}
.hbar-row{display:grid;grid-template-columns:minmax(80px,40%) minmax(0,1fr) 24px;gap:10px;align-items:center}
.hbar-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:13px}
.hbar-track{height:12px;outline:none;border-radius:4px}
.hbar-track:focus-visible,.meter:focus-visible{box-shadow:0 0 0 2px var(--primary)}
.hbar-fill{height:100%;min-width:2px;background:var(--viz);border-radius:0 4px 4px 0}
.hbar-val{text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
.prog-list{display:grid;gap:14px}
.prog-row{display:block;color:inherit;text-decoration:none}
.prog-row:hover .prog-name{color:var(--primary)}
.prog-top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.prog-name{font-weight:600;flex:1}
.prog-pct{font-weight:600;font-variant-numeric:tabular-nums}
.prog-top .badge svg{width:12px;height:12px}
.meter{height:10px;background:var(--viz-track);border-radius:5px;overflow:hidden;margin-bottom:4px;outline:none}
.meter-fill{height:100%;background:var(--viz);border-radius:5px}
.vbars{position:relative}
.vbars-max{position:absolute;top:-16px;right:0;font-size:11px;color:var(--text-2)}
.vbars-plot{display:flex;gap:2px;align-items:stretch;height:168px;border-top:1px dashed var(--border);margin-top:16px}
.vbar-col{flex:1;min-width:0;display:flex;flex-direction:column;outline:none;border-radius:4px;transition:background .15s}
.vbar-col:hover,.vbar-col:focus-visible{background:var(--surface-2)}
.vbar-space{flex:1;display:flex;align-items:flex-end;justify-content:center;border-bottom:1px solid var(--border)}
.vbar{width:min(22px,64%);background:var(--viz);border-radius:4px 4px 0 0}
.vbar-x{display:flex;flex-direction:column;align-items:center;font-size:11px;color:var(--text-2);padding:4px 0 2px;line-height:1.25}
.vbar-x b{font-weight:500;color:var(--text)}
.vbar-col.we .vbar-x span{opacity:.6}
.vbar-col.today .vbar-x b{background:var(--primary);color:var(--on-primary);border-radius:9px;padding:0 5px}
/* Einblend-Animationen (nur beim Öffnen und Umschalten) */
@keyframes growX{from{transform:scaleX(0)}}
@keyframes growY{from{transform:scaleY(0)}}
@keyframes riseIn{from{opacity:0;transform:translateY(6px)}}
.dash.animate .grow-x{transform-origin:left;animation:growX .6s cubic-bezier(.2,.8,.2,1)}
.dash.animate .grow-y{transform-origin:bottom;animation:growY .6s cubic-bezier(.2,.8,.2,1)}
.dash.animate .kpi,.dash.animate .panel{animation:riseIn .35s ease-out both}
.dash.animate .dash-row .panel{animation-delay:.08s}
@media(prefers-reduced-motion:reduce){.dash *{animation:none!important;transition:none!important}}
@media(max-width:900px){.kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.kpi{padding:14px;gap:10px}.kpi-icon{width:34px;height:34px}.kpi-value{font-size:26px}.dash-row{grid-template-columns:minmax(0,1fr)}.dash-filters{width:100%}.seg{flex:1}.seg-btn{flex:1}}
