/* ============================================================
   NORDLICHT CONSOLE — Design Tokens
   Papierweiß · Tinte · Ultramarin. Viel Luft, wenig Lärm.
   ============================================================ */
:root{
  --bg:#FCFCFB;
  --surface:#FFFFFF;
  --surface-2:#F6F6F4;
  --ink:#12141A;
  --ink-2:#3C4250;
  --muted:#7A8090;
  --line:#EBECE9;
  --line-2:#E0E1DD;

  --accent:#2727E6;          /* Ultramarin */
  --accent-soft:#EDEDFE;
  --accent-ink:#1B1BB4;

  --ok:#118A5E;   --ok-soft:#E4F5EE;
  --warn:#B76E00; --warn-soft:#FBF0DC;
  --err:#C93838;  --err-soft:#FBE9E9;

  --font-display:"Space Grotesk",sans-serif;
  --font-body:"Inter",system-ui,sans-serif;
  --font-mono:"JetBrains Mono",monospace;

  --r-sm:8px; --r-md:12px; --r-lg:16px;
  --shadow-sm:0 1px 2px rgba(18,20,26,.05);
  --shadow-md:0 6px 24px -8px rgba(18,20,26,.12);
  --shadow-lg:0 20px 50px -12px rgba(18,20,26,.22);

  --sidebar-w:248px;
  --sidebar-w-rail:68px;
  --dock-w:288px;
  --topbar-h:64px;

  /* z-index-Leiter — HIER zentral, NIE inline. Reihenfolge von unten nach oben:
     Chrome (Topbar/Dock) < Popover (Menüs/Dropdowns) < Modal < System-Modal
     (alert/confirm/prompt) < Notification < Toast. */
  --z-popover:500;
  --z-modal:1000;
  --z-preview-modal:1050;
  --z-system-modal:1100;
  --z-notification:1200;
  --z-toast:1300;
}
[data-theme="dark"]{
  --bg:#0E0F13;
  --surface:#15161C;
  --surface-2:#1B1D24;
  --ink:#F2F3F5;
  --ink-2:#C4C8D2;
  --muted:#8A90A0;
  --line:#23252E;
  --line-2:#2C2F3A;
  --accent:#6D6DFF;
  --accent-soft:#202140;
  --accent-ink:#A3A3FF;
  --ok:#3CC98F;   --ok-soft:#123528;
  --warn:#E5A13C; --warn-soft:#3A2C12;
  --err:#F17070;  --err-soft:#3B1A1A;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 6px 24px -8px rgba(0,0,0,.5);
  --shadow-lg:0 20px 50px -12px rgba(0,0,0,.6);
}

/* ---------- Reset & Basis ---------- */
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:var(--font-body);
  background:var(--bg);
  color:var(--ink);
  font-size:14px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  transition:background .3s,color .3s;
}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
input,select,textarea{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}
svg{display:block}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}

.mono{font-family:var(--font-mono)}
.eyebrow{
  font-family:var(--font-mono);
  font-size:11px;font-weight:500;
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);
}

/* ============================================================
   LAYOUT-GERÜST
   ============================================================ */
.shell{display:flex;min-height:100vh}

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w);
  flex-shrink:0;
  border-right:1px solid var(--line);
  background:var(--surface);
  position:sticky;top:0;height:100vh;
  display:flex;flex-direction:column;
  transition:width .25s ease;
  z-index:40;
}
.brand{
  height:var(--topbar-h);
  display:flex;align-items:center;gap:12px;
  padding:0 20px;
  border-bottom:1px solid var(--line);
  overflow:hidden;white-space:nowrap;
}
.brand-mark{
  width:30px;height:30px;flex-shrink:0;
  border-radius:9px;
  background:var(--accent);
  display:grid;place-items:center;
  color:#fff;font-family:var(--font-display);font-weight:700;font-size:15px;
}
.brand-name{font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:-.01em}
.brand-name small{display:block;font-family:var(--font-mono);font-weight:400;font-size:10px;color:var(--muted);letter-spacing:.1em;text-transform:uppercase}

.nav{flex:1;overflow-y:auto;padding:16px 12px;scrollbar-width:thin}
.nav-section{margin-bottom:8px}
.nav-label{
  padding:14px 10px 6px;
  font-family:var(--font-mono);font-size:10px;font-weight:500;
  letter-spacing:.14em;text-transform:uppercase;color:var(--muted);
  white-space:nowrap;overflow:hidden;
}
.nav-item{
  display:flex;align-items:center;gap:11px;
  width:100%;padding:9px 10px;border-radius:var(--r-sm);
  color:var(--ink-2);font-weight:500;font-size:13.5px;
  white-space:nowrap;overflow:hidden;
  transition:background .15s,color .15s;
}
.nav-item svg{flex-shrink:0;width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.nav-item:hover{background:var(--surface-2);color:var(--ink)}
.nav-item.active{background:var(--accent-soft);color:var(--accent-ink)}
.nav-item .chev{margin-left:auto;width:14px;height:14px;transition:transform .2s;color:var(--muted)}
.nav-item .count{
  margin-left:auto;
  font-family:var(--font-mono);font-size:10.5px;
  background:var(--surface-2);color:var(--muted);
  padding:1px 7px;border-radius:99px;
}
.nav-item.active .count{background:var(--surface);color:var(--accent-ink)}

.nav-group.open > .nav-item .chev{transform:rotate(90deg)}
.nav-sub{
  max-height:0;overflow:hidden;
  transition:max-height .25s ease;
  padding-left:18px;
}
.nav-group.open .nav-sub{max-height:300px}
.nav-sub .nav-item{
  font-size:13px;padding:7px 10px;position:relative;color:var(--muted)
}
.nav-sub .nav-item::before{
  content:"";position:absolute;left:-8px;top:0;bottom:0;
  border-left:1px solid var(--line-2);
}
.nav-sub .nav-item:hover{color:var(--ink)}

.sidebar-foot{
  border-top:1px solid var(--line);
  padding:12px;
}
.storage{
  padding:10px;border-radius:var(--r-sm);background:var(--surface-2);
  margin-bottom:10px;white-space:nowrap;overflow:hidden;
}
.storage .eyebrow{font-size:10px}
.storage-bar{height:4px;border-radius:99px;background:var(--line-2);margin:8px 0 6px;overflow:hidden}
.storage-bar i{display:block;height:100%;width:62%;background:var(--accent);border-radius:99px}
.storage p{font-size:11.5px;color:var(--muted)}

/* Rail-Modus (eingeklappt) */
.shell.rail .sidebar{width:var(--sidebar-w-rail)}
.shell.rail .brand-name,
.shell.rail .nav-label,
.shell.rail .nav-item span,
.shell.rail .nav-item .chev,
.shell.rail .nav-item .count,
.shell.rail .storage,
.shell.rail .nav-sub{display:none}
.shell.rail .nav-item{justify-content:center;padding:11px 0}
.shell.rail .brand{padding:0;justify-content:center}

/* ---------- Hauptspalte ---------- */
.main-col{flex:1;min-width:0;display:flex;flex-direction:column}

/* ---------- Topbar ---------- */
.topbar{
  height:var(--topbar-h);
  position:sticky;top:0;z-index:30;
  background:color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:16px;
  padding:0 28px;
}
.icon-btn{
  width:36px;height:36px;border-radius:var(--r-sm);
  display:grid;place-items:center;color:var(--ink-2);
  transition:background .15s;position:relative;flex-shrink:0;
}
.icon-btn:hover{background:var(--surface-2)}
.icon-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.icon-btn .dot{
  position:absolute;top:7px;right:7px;
  width:8px;height:8px;border-radius:99px;
  background:var(--err);border:2px solid var(--bg);
}
.crumbs{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);min-width:0}
.crumbs b{color:var(--ink);font-weight:600}
.crumbs .sep{color:var(--line-2)}

.search{
  margin-left:auto;
  display:flex;align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--line);
  border-radius:99px;padding:7px 14px;width:280px;
  color:var(--muted);transition:border-color .15s, box-shadow .15s;
}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.search svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round}
.search input{border:none;background:none;outline:none;flex:1;font-size:13px;color:var(--ink)}
.search kbd{
  font-family:var(--font-mono);font-size:10px;
  border:1px solid var(--line-2);border-radius:5px;padding:1px 5px;color:var(--muted);
}
.avatar{
  width:34px;height:34px;border-radius:99px;flex-shrink:0;
  background:linear-gradient(135deg,var(--accent),#7C3AED);
  color:#fff;display:grid;place-items:center;
  font-family:var(--font-display);font-weight:600;font-size:13px;
  cursor:pointer;
}

/* ---------- Notification-Panel ---------- */
.notif-panel{
  position:fixed;top:calc(var(--topbar-h) + 8px);right:calc(var(--dock-w) + 40px);
  width:340px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg);z-index:var(--z-notification);
  opacity:0;transform:translateY(-6px);pointer-events:none;
  transition:opacity .2s,transform .2s;
}
.notif-panel.open{opacity:1;transform:none;pointer-events:auto}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line)}
.notif-head h3{font-family:var(--font-display);font-size:14px;font-weight:600}
.notif-head button{font-size:12px;color:var(--accent);font-weight:500}
.notif-list{max-height:340px;overflow-y:auto}
.notif-item{display:flex;gap:12px;padding:13px 18px;border-bottom:1px solid var(--line);transition:background .15s}
.notif-item:last-child{border-bottom:none}
.notif-item:hover{background:var(--surface-2)}
.notif-item .n-dot{width:8px;height:8px;border-radius:99px;margin-top:6px;flex-shrink:0}
.notif-item p{font-size:13px;color:var(--ink-2)}
.notif-item p b{color:var(--ink);font-weight:600}
.notif-item time{font-family:var(--font-mono);font-size:10.5px;color:var(--muted)}

/* ============================================================
   AGENT-DOCK — immer sichtbar
   ============================================================ */
.dock{
  width:var(--dock-w);flex-shrink:0;
  position:sticky;top:0;height:100vh;
  border-left:1px solid var(--line);
  background:var(--surface);
  display:flex;flex-direction:column;
  z-index:35;
}
.dock-head{
  height:var(--topbar-h);flex-shrink:0;
  display:flex;align-items:center;gap:10px;
  padding:0 20px;border-bottom:1px solid var(--line);
}
.pulse{
  width:9px;height:9px;border-radius:99px;background:var(--ok);position:relative;flex-shrink:0;
}
.pulse::after{
  content:"";position:absolute;inset:-4px;border-radius:99px;
  border:2px solid var(--ok);opacity:.5;
  animation:pulse 2s ease-out infinite;
}
@keyframes pulse{from{transform:scale(.5);opacity:.7}to{transform:scale(1.4);opacity:0}}
.dock-head h2{font-family:var(--font-display);font-size:14px;font-weight:600}
.dock-head .count{margin-left:auto;font-family:var(--font-mono);font-size:11px;color:var(--muted)}

.dock-body{flex:1;overflow-y:auto;padding:16px;scrollbar-width:thin}
.agent{
  border:1px solid var(--line);border-radius:var(--r-md);
  padding:14px;margin-bottom:12px;background:var(--bg);
  transition:border-color .15s, box-shadow .15s;
}
.agent:hover{border-color:var(--line-2);box-shadow:var(--shadow-sm)}
.agent-top{display:flex;align-items:center;gap:9px;margin-bottom:8px}
.agent-status{width:8px;height:8px;border-radius:99px;flex-shrink:0}
.agent-status.run{background:var(--ok);animation:blink 1.6s ease infinite}
.agent-status.wait{background:var(--warn)}
.agent-status.idle{background:var(--muted)}
@keyframes blink{50%{opacity:.35}}
.agent-top h4{font-size:13px;font-weight:600;flex:1;letter-spacing:-.01em}
.agent-top .mono{font-size:10px;color:var(--muted)}
.agent-task{font-size:12px;color:var(--muted);margin-bottom:10px}
.agent-bar{height:4px;border-radius:99px;background:var(--surface-2);overflow:hidden;margin-bottom:8px}
.agent-bar i{display:block;height:100%;background:var(--accent);border-radius:99px;transition:width .8s ease}
.agent-meta{display:flex;justify-content:space-between;font-family:var(--font-mono);font-size:10px;color:var(--muted)}
.agent-thread{margin-top:10px;height:26px}
.agent-thread polyline{fill:none;stroke:var(--accent);stroke-width:1.5;opacity:.65}

.dock-foot{
  border-top:1px solid var(--line);padding:14px 16px;flex-shrink:0;
}
.btn-ghost-full{
  width:100%;padding:9px;border-radius:var(--r-sm);
  border:1px dashed var(--line-2);color:var(--muted);
  font-size:12.5px;font-weight:500;transition:all .15s;
  display:flex;align-items:center;justify-content:center;gap:7px;
}
.btn-ghost-full:hover{border-color:var(--accent);color:var(--accent)}

/* ============================================================
   CONTENT
   ============================================================ */
.content{padding:40px 44px 120px;max-width:1120px;width:100%;margin:0 auto}

.page-head{margin-bottom:44px}
.page-head h1{
  font-family:var(--font-display);
  font-size:32px;font-weight:600;letter-spacing:-.02em;
  margin:6px 0 8px;
}
.page-head .lede{color:var(--muted);font-size:14.5px;max-width:560px}
.page-actions{display:flex;gap:10px;margin-top:20px}

.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 16px;border-radius:var(--r-sm);
  font-size:13.5px;font-weight:500;
  transition:all .15s;border:1px solid transparent;
}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent-ink)}
.btn-secondary{background:var(--surface);border-color:var(--line-2);color:var(--ink)}
.btn-secondary:hover{border-color:var(--muted)}
.btn-danger{background:var(--err-soft);color:var(--err)}
.btn-sm{padding:6px 12px;font-size:12.5px}

/* ---------- Section-Gliederung ---------- */
.section{margin-bottom:64px}
.section-head{
  display:flex;align-items:baseline;gap:14px;
  margin-bottom:20px;padding-bottom:12px;
  border-bottom:1px solid var(--line);
}
.section-head h2{font-family:var(--font-display);font-size:18px;font-weight:600;letter-spacing:-.01em}
.section-head .hint{margin-left:auto;font-size:12px;color:var(--muted)}

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);
}
.card-pad{padding:22px}
.card h3{font-family:var(--font-display);font-size:14.5px;font-weight:600;letter-spacing:-.01em}
.card .sub{font-size:12.5px;color:var(--muted);margin-top:2px}

/* ---------- KPI-Zeile ---------- */
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.kpi{padding:20px 22px}
.kpi .eyebrow{margin-bottom:10px;display:block}
.kpi-val{font-family:var(--font-display);font-size:27px;font-weight:600;letter-spacing:-.02em}
.kpi-delta{display:inline-flex;align-items:center;gap:4px;font-family:var(--font-mono);font-size:11px;margin-top:6px;padding:2px 8px;border-radius:99px}
.kpi-delta.up{background:var(--ok-soft);color:var(--ok)}
.kpi-delta.down{background:var(--err-soft);color:var(--err)}
.kpi svg.spark{margin-top:14px;width:100%;height:30px}
.kpi svg.spark polyline{fill:none;stroke:var(--accent);stroke-width:1.6}
.kpi svg.spark .fill{fill:var(--accent-soft);stroke:none;opacity:.6}

/* ---------- Chart + Gauges ---------- */
.duo{display:grid;grid-template-columns:1.7fr 1fr;gap:16px}
.chart-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px}
.legend{display:flex;gap:16px;font-size:12px;color:var(--muted)}
.legend i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:6px}
.chart-svg{width:100%;height:220px}
.chart-svg .grid-line{stroke:var(--line);stroke-width:1}
.chart-svg .axis-label{font-family:var(--font-mono);font-size:9.5px;fill:var(--muted)}
.chart-svg .area{fill:url(#areaGrad);}
.chart-svg .line-a{fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round}
.chart-svg .line-b{fill:none;stroke:var(--muted);stroke-width:1.5;stroke-dasharray:4 5;stroke-linecap:round}

.gauge-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:18px}
.gauge{text-align:center}
.gauge svg{width:84px;height:84px;margin:0 auto}
.gauge .track{fill:none;stroke:var(--surface-2);stroke-width:8;stroke-linecap:round}
.gauge .value{fill:none;stroke-width:8;stroke-linecap:round;transition:stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1)}
.gauge .g-num{font-family:var(--font-display);font-weight:600;font-size:16px;fill:var(--ink)}
.gauge .g-label{font-size:11px;color:var(--muted);margin-top:6px;display:block}

/* ---------- Tabelle ---------- */
.table-toolbar{display:flex;align-items:center;gap:10px;padding:16px 22px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.chip{
  padding:5px 13px;border-radius:99px;font-size:12.5px;font-weight:500;
  border:1px solid var(--line-2);color:var(--muted);transition:all .15s;
}
.chip:hover{border-color:var(--muted);color:var(--ink)}
.chip.active{background:var(--ink);border-color:var(--ink);color:var(--bg)}
table{width:100%;border-collapse:collapse}
thead th{
  text-align:left;padding:11px 22px;
  font-family:var(--font-mono);font-size:10.5px;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
  border-bottom:1px solid var(--line);white-space:nowrap;
}
tbody td{padding:14px 22px;border-bottom:1px solid var(--line);font-size:13.5px;vertical-align:middle}
tbody tr{transition:background .12s}
tbody tr:hover{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:none}
td .mono{font-size:12px;color:var(--muted)}
.cell-user{display:flex;align-items:center;gap:11px}
.mini-avatar{width:28px;height:28px;border-radius:99px;display:grid;place-items:center;font-size:10.5px;font-weight:600;color:#fff;flex-shrink:0}
.badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:3px 10px;border-radius:99px;font-size:11.5px;font-weight:500;
}
.badge i{width:6px;height:6px;border-radius:99px;background:currentColor}
.badge.ok{background:var(--ok-soft);color:var(--ok)}
.badge.warn{background:var(--warn-soft);color:var(--warn)}
.badge.err{background:var(--err-soft);color:var(--err)}
.badge.neutral{background:var(--surface-2);color:var(--muted)}
.table-foot{display:flex;align-items:center;justify-content:space-between;padding:14px 22px}
.table-foot p{font-size:12.5px;color:var(--muted)}
.pager{display:flex;gap:4px}
.pager button{
  min-width:30px;height:30px;border-radius:var(--r-sm);
  font-family:var(--font-mono);font-size:12px;color:var(--muted);
  display:grid;place-items:center;padding:0 6px;transition:all .12s;
}
.pager button:hover{background:var(--surface-2);color:var(--ink)}
.pager button.active{background:var(--accent-soft);color:var(--accent-ink);font-weight:600}

/* ---------- Formular ---------- */
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px 24px}
.form-grid .full{grid-column:1/-1}
.field label{display:block;font-size:12.5px;font-weight:600;margin-bottom:7px;color:var(--ink-2)}
.field .hint-t{font-size:11.5px;color:var(--muted);margin-top:6px}
.input,select.input,textarea.input{
  width:100%;padding:9px 13px;
  background:var(--bg);border:1px solid var(--line-2);
  border-radius:var(--r-sm);font-size:13.5px;
  transition:border-color .15s, box-shadow .15s;outline:none;
}
.input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.input::placeholder{color:var(--muted)}
textarea.input{resize:vertical;min-height:88px}
select.input{
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8090' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;
  padding-right:36px;
}
.input-group{display:flex}
.input-group .input{border-radius:var(--r-sm) 0 0 var(--r-sm)}
.input-group .addon{
  display:grid;place-items:center;padding:0 13px;
  background:var(--surface-2);border:1px solid var(--line-2);border-left:none;
  border-radius:0 var(--r-sm) var(--r-sm) 0;
  font-family:var(--font-mono);font-size:12px;color:var(--muted);
}

/* Toggle */
.toggle-row{display:flex;align-items:flex-start;gap:12px;padding:4px 0}
.toggle{
  position:relative;width:38px;height:22px;flex-shrink:0;
  background:var(--line-2);border-radius:99px;transition:background .2s;margin-top:1px;
}
.toggle::after{
  content:"";position:absolute;top:3px;left:3px;
  width:16px;height:16px;border-radius:99px;background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s;
}
.toggle.on{background:var(--accent)}
.toggle.on::after{transform:translateX(16px)}
.toggle-row b{font-size:13px;font-weight:600;display:block}
.toggle-row small{font-size:12px;color:var(--muted)}

/* Radio-Karten */
.radio-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.radio-card{
  border:1px solid var(--line-2);border-radius:var(--r-md);
  padding:13px 14px;cursor:pointer;transition:all .15s;position:relative;
}
.radio-card:hover{border-color:var(--muted)}
.radio-card input{position:absolute;opacity:0}
.radio-card b{font-size:13px;font-weight:600;display:block;margin-bottom:2px}
.radio-card small{font-size:11.5px;color:var(--muted)}
.radio-card:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.radio-card:has(input:checked) b{color:var(--accent-ink)}

/* Checkbox */
.check-row{display:flex;align-items:center;gap:10px;font-size:13px;padding:3px 0;cursor:pointer}
.check-row input{
  appearance:none;width:17px;height:17px;flex-shrink:0;
  border:1.5px solid var(--line-2);border-radius:5px;
  display:grid;place-items:center;transition:all .15s;cursor:pointer;
}
.check-row input:checked{background:var(--accent);border-color:var(--accent)}
.check-row input:checked::after{
  content:"";width:9px;height:5px;
  border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px);
}

/* Slider */
.slider-wrap{display:flex;align-items:center;gap:14px}
input[type=range]{
  flex:1;appearance:none;height:4px;border-radius:99px;
  background:linear-gradient(to right,var(--accent) var(--pct,50%),var(--line-2) var(--pct,50%));
  outline-offset:6px;
}
input[type=range]::-webkit-slider-thumb{
  appearance:none;width:17px;height:17px;border-radius:99px;
  background:var(--surface);border:2px solid var(--accent);
  box-shadow:var(--shadow-sm);cursor:grab;
}
.slider-val{font-family:var(--font-mono);font-size:12.5px;min-width:52px;text-align:right;color:var(--ink-2)}

/* Dropzone */
.dropzone{
  border:1.5px dashed var(--line-2);border-radius:var(--r-md);
  padding:30px;text-align:center;color:var(--muted);
  transition:all .15s;cursor:pointer;
}
.dropzone:hover{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-ink)}
.dropzone svg{width:26px;height:26px;margin:0 auto 10px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.dropzone b{color:var(--ink);font-weight:600}
.dropzone:hover b{color:var(--accent-ink)}

.form-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:26px;padding-top:20px;border-top:1px solid var(--line)}

/* ---------- Tabs / Alerts / Feedback ---------- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:20px}
.tab{
  padding:9px 16px;font-size:13.5px;font-weight:500;color:var(--muted);
  border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .15s;
}
.tab:hover{color:var(--ink)}
.tab.active{color:var(--accent-ink);border-bottom-color:var(--accent)}
.tab-pane{display:none;animation:fadeIn .25s ease}
.tab-pane.active{display:block}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

.alert{display:flex;gap:12px;padding:14px 16px;border-radius:var(--r-md);font-size:13px;margin-bottom:12px;border:1px solid}
.alert svg{width:17px;height:17px;flex-shrink:0;margin-top:1px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.alert b{font-weight:600;display:block;margin-bottom:1px}
.alert.info{background:var(--accent-soft);color:var(--accent-ink);border-color:transparent}
.alert.ok{background:var(--ok-soft);color:var(--ok);border-color:transparent}
.alert.warn{background:var(--warn-soft);color:var(--warn);border-color:transparent}
.alert.err{background:var(--err-soft);color:var(--err);border-color:transparent}

/* Toast */
.toast-stack{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:var(--z-toast);display:flex;flex-direction:column;gap:10px;align-items:center}
.toast{
  display:flex;align-items:center;gap:11px;
  background:var(--ink);color:var(--bg);
  padding:11px 18px;border-radius:99px;font-size:13px;
  box-shadow:var(--shadow-lg);
  animation:toastIn .3s cubic-bezier(.2,.9,.3,1.2);
}
.toast i{width:8px;height:8px;border-radius:99px;background:var(--ok);flex-shrink:0}
@keyframes toastIn{from{opacity:0;transform:translateY(14px) scale(.95)}to{opacity:1;transform:none}}
.toast.leaving{opacity:0;transform:translateY(8px);transition:all .25s}

/* Modal */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(18,20,26,.4);backdrop-filter:blur(3px);
  z-index:var(--z-modal);display:grid;place-items:center;
  opacity:0;pointer-events:none;transition:opacity .2s;
}
/* Datei-Preview liegt über einem normalen Modal, aber UNTER den System-Modals. */
.modal-backdrop.is-preview{z-index:var(--z-preview-modal)}
/* System-Modals (alert/confirm/prompt, auch aus einem offenen Modal heraus) liegen darüber. */
.modal-backdrop.is-system{z-index:var(--z-system-modal)}
.modal-backdrop.open{opacity:1;pointer-events:auto}
.modal{
  width:min(440px,90vw);background:var(--surface);
  border-radius:var(--r-lg);box-shadow:var(--shadow-lg);
  padding:26px;transform:translateY(12px) scale(.98);transition:transform .25s;
}
.modal-backdrop.open .modal{transform:none}
.modal h3{font-family:var(--font-display);font-size:17px;font-weight:600;margin-bottom:6px}
.modal p{font-size:13.5px;color:var(--muted);margin-bottom:20px}
.modal-actions{display:flex;justify-content:flex-end;gap:10px}

/* ---------- Timeline / Team / Kalender ---------- */
.trio{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:16px}
.timeline{list-style:none;position:relative;padding-left:22px}
.timeline::before{content:"";position:absolute;left:5px;top:6px;bottom:6px;border-left:1.5px solid var(--line-2)}
.timeline li{position:relative;padding-bottom:20px}
.timeline li:last-child{padding-bottom:0}
.timeline li::before{
  content:"";position:absolute;left:-22px;top:5px;
  width:11px;height:11px;border-radius:99px;
  background:var(--surface);border:2.5px solid var(--accent);
}
.timeline li.done::before{background:var(--accent)}
.timeline li.muted::before{border-color:var(--line-2)}
.timeline b{font-size:13px;font-weight:600;display:block}
.timeline p{font-size:12.5px;color:var(--muted)}
.timeline time{font-family:var(--font-mono);font-size:10px;color:var(--muted);letter-spacing:.05em}

.team-row{display:flex;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.team-row:last-child{border-bottom:none}
.team-row b{font-size:13px;font-weight:600;display:block}
.team-row small{font-size:11.5px;color:var(--muted)}
.presence{margin-left:auto;width:8px;height:8px;border-radius:99px;flex-shrink:0}

.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.cal-head b{font-family:var(--font-display);font-size:13.5px;font-weight:600}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center}
.cal-grid .dow{font-family:var(--font-mono);font-size:9.5px;color:var(--muted);padding:5px 0;text-transform:uppercase;letter-spacing:.08em}
.cal-grid .day{
  aspect-ratio:1;display:grid;place-items:center;
  font-size:12px;border-radius:8px;color:var(--ink-2);
  cursor:pointer;transition:background .12s;position:relative;
}
.cal-grid .day:hover{background:var(--surface-2)}
.cal-grid .day.dim{color:var(--line-2)}
.cal-grid .day.today{background:var(--accent);color:#fff;font-weight:600}
.cal-grid .day.marked::after{
  content:"";position:absolute;bottom:4px;left:50%;transform:translateX(-50%);
  width:4px;height:4px;border-radius:99px;background:var(--accent);
}
.cal-grid .day.today.marked::after{background:#fff}

/* ---------- Kanban ---------- */
.kanban{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.kb-col-head{display:flex;align-items:center;gap:9px;margin-bottom:12px}
.kb-col-head i{width:8px;height:8px;border-radius:3px}
.kb-col-head b{font-size:13px;font-weight:600}
.kb-col-head .count{font-family:var(--font-mono);font-size:11px;color:var(--muted)}
.kb-card{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-md);padding:14px;margin-bottom:10px;
  cursor:grab;transition:all .15s;box-shadow:var(--shadow-sm);
}
.kb-card:hover{border-color:var(--line-2);box-shadow:var(--shadow-md);transform:translateY(-1px)}
.kb-card .tag{font-family:var(--font-mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:2px 8px;border-radius:5px;display:inline-block;margin-bottom:8px}
.kb-card p{font-size:13px;font-weight:500;line-height:1.4;margin-bottom:10px}
.kb-card-foot{display:flex;align-items:center;justify-content:space-between}
.kb-card-foot .mono{font-size:10.5px;color:var(--muted)}
.avatar-stack{display:flex}
.avatar-stack .mini-avatar{width:22px;height:22px;font-size:8.5px;border:2px solid var(--surface);margin-left:-7px}
.avatar-stack .mini-avatar:first-child{margin-left:0}

/* ---------- Progress / Skeleton / Empty ---------- */
.misc-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.prog-row{margin-bottom:16px}
.prog-row:last-child{margin-bottom:0}
.prog-label{display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:7px}
.prog-label span:last-child{font-family:var(--font-mono);font-size:11px;color:var(--muted)}
.prog-bar{height:6px;border-radius:99px;background:var(--surface-2);overflow:hidden}
.prog-bar i{display:block;height:100%;border-radius:99px;background:var(--accent);transition:width 1s ease}

.skel{border-radius:6px;background:linear-gradient(90deg,var(--surface-2) 25%,var(--line) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:shimmer 1.6s infinite}
@keyframes shimmer{to{background-position:-200% 0}}
.skel-row{display:flex;gap:12px;margin-bottom:14px;align-items:center}
.skel-row:last-child{margin-bottom:0}

.empty{text-align:center;padding:14px 10px}
.empty-ring{
  width:56px;height:56px;margin:0 auto 14px;border-radius:99px;
  background:var(--surface-2);display:grid;place-items:center;color:var(--muted);
}
.empty-ring svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.empty b{font-family:var(--font-display);font-size:14px;display:block;margin-bottom:4px}
.empty p{font-size:12.5px;color:var(--muted);margin-bottom:14px}

/* ---------- Footer ---------- */
.foot{
  display:flex;align-items:center;gap:14px;
  padding-top:28px;border-top:1px solid var(--line);
  font-family:var(--font-mono);font-size:11px;color:var(--muted);
}
.foot .spacer{flex:1}

/* ---------- Responsive ---------- */
@media (max-width:1400px){
  .notif-panel{right:24px}
}
@media (max-width:1280px){
  .dock{
    position:fixed;right:20px;bottom:20px;top:auto;height:auto;
    max-height:56vh;width:300px;
    border:1px solid var(--line);border-radius:var(--r-lg);
    box-shadow:var(--shadow-lg);
  }
  .dock.min .dock-body,.dock.min .dock-foot{display:none}
  .dock-head{border-radius:var(--r-lg) var(--r-lg) 0 0;cursor:pointer}
}
@media (max-width:1024px){
  .kpi-grid{grid-template-columns:1fr 1fr}
  .duo,.trio,.misc-grid{grid-template-columns:1fr}
  .kanban{grid-template-columns:1fr}
  .content{padding:32px 24px 140px}
  .search{width:auto;flex:1}
}
@media (max-width:820px){
  .sidebar{position:fixed;left:0;transform:translateX(-100%);transition:transform .25s}
  .shell.rail .sidebar{width:var(--sidebar-w);transform:none;box-shadow:var(--shadow-lg)}
  .shell.rail .brand-name,.shell.rail .nav-label,.shell.rail .nav-item span,
  .shell.rail .nav-item .chev,.shell.rail .nav-item .count,.shell.rail .storage{display:block}
  .shell.rail .nav-item .count,.shell.rail .nav-item .chev{display:inline-flex}
  .shell.rail .nav-item{justify-content:flex-start;padding:9px 10px}
  .shell.rail .brand{padding:0 20px;justify-content:flex-start}
  .form-grid,.radio-cards{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001s!important;transition-duration:.001s!important}
}

/* ============================================================
   App-Ergänzungen (Konto-Menü) — nutzt dieselben Tokens
   ============================================================ */
.acct-menu{
  position:fixed;top:calc(var(--topbar-h) + 8px);right:20px;
  width:230px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg);z-index:var(--z-popover);padding:6px;
  opacity:0;transform:translateY(-6px);pointer-events:none;
  transition:opacity .18s,transform .18s;
}
.acct-menu.open{opacity:1;transform:none;pointer-events:auto}
.acct-head{padding:10px 12px 8px;font-weight:600;font-size:13.5px;line-height:1.3}
.acct-head small{display:block;font-family:var(--font-mono);font-size:10.5px;color:var(--muted);font-weight:400;margin-top:2px}
.acct-label{padding:8px 12px 4px;font-family:var(--font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.acct-item{display:block;width:100%;text-align:left;padding:8px 12px;border-radius:var(--r-sm);font-size:13px;color:var(--ink-2);transition:background .12s}
.acct-item:hover{background:var(--surface-2);color:var(--ink)}
.acct-item.active{color:var(--accent-ink);font-weight:600}
.acct-sep{height:1px;background:var(--line);margin:6px 4px}
.avatar{border:none}
.brand-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- Overrides (Feedback) ---------- */
.content{max-width:none;margin:0}                 /* Content full-width, nicht 1120 zentriert */
.notif-panel{right:16px}                           /* direkt unter der Glocke, nicht mittig */
/* Checkbox + Label einzeilig — schlägt .field label{display:block} (Template-Bug) */
.check-row{display:inline-flex!important;align-items:center;gap:8px;white-space:nowrap;font-weight:500;margin-bottom:0}
.check-row input{flex:0 0 auto;margin:0}
.row-actions{display:inline-flex;gap:6px;justify-content:flex-end} /* Table-Buttons mit Spacing */
.notif-item{cursor:pointer}
.notif-del{margin-left:auto;color:var(--muted);font-size:16px;line-height:1;padding:2px 7px;border-radius:6px;flex:0 0 auto;align-self:center}
.notif-del:hover{background:var(--surface-2);color:var(--err)}
.agent-close{border:none;background:none;color:var(--muted);cursor:pointer;font-size:15px;line-height:1;padding:0 2px;flex:0 0 auto}
.agent-close:hover{color:var(--err)}
