/* =========================================================
   SPARK DESIGN SYSTEM  ·  Schwarz / Weiß
   ========================================================= */
:root {
  --bg: #000;
  --bg-1: #070707;
  --bg-2: #0d0d0d;
  --bg-3: #141414;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --line-3: rgba(255, 255, 255, .24);
  --text: #f5f5f5;
  --text-2: #a3a3a3;
  --text-3: #6b6b6b;
  --ink: #fff;          /* Akzent (weiß) */
  --ink-on: #000;       /* Text auf Akzent */
  --glass: rgba(18, 18, 18, .66);
  --glow: rgba(255, 255, 255, .07);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--line);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;
  --top: 44px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fff;
  --bg-1: #fafafa;
  --bg-2: #f4f4f4;
  --bg-3: #ececec;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .13);
  --line-3: rgba(0, 0, 0, .25);
  --text: #0a0a0a;
  --text-2: #555;
  --text-3: #8f8f8f;
  --ink: #000;
  --ink-on: #fff;
  --glass: rgba(255, 255, 255, .72);
  --glow: rgba(0, 0, 0, .05);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, .25), 0 0 0 1px var(--line);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  font-feature-settings: "cv11", "ss01";
}
::selection { background: var(--ink); color: var(--ink-on); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* Hintergrund: feines Raster + Glow + Körnung */
.backdrop {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, var(--glow), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, var(--glow), transparent 60%);
}
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 60% 0%, #000 10%, transparent 70%);
  opacity: .45;
}
.backdrop::after {
  content: ""; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: overlay;
}

/* =========================================================
   LAYOUT
   ========================================================= */
.shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 252px 1fr;
  height: 100vh;
}
.sidebar {
  position: relative;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  padding: 14px 12px 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 10px 18px;
}
.brand .logo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--ink-on); box-shadow: 0 0 30px var(--glow), 0 0 0 1px var(--line-2); }
.brand .logo svg { width: 18px; height: 18px; }
.brand .brand-logo { display: block; height: 19px; width: auto; max-width: 150px; object-fit: contain; filter: drop-shadow(0 0 14px var(--glow)); }
.brand .brand-icon { display: block; width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 30px var(--glow), 0 0 0 1px var(--line-2); }
.mega-logo { position: relative; margin: 0; line-height: 0; }
.mega-logo img { display: block; width: min(640px, 100%); height: auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,.55)); }
:root[data-theme="light"] .mega-logo img { filter: drop-shadow(0 14px 30px rgba(0,0,0,.18)); }
.brand .word { font-weight: 800; letter-spacing: -.04em; font-size: 20px; }
.brand .tag { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; text-decoration: none;
  color: var(--text-2); font-weight: 500; transition: color .2s, background .2s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a.active { color: var(--ink-on); background: var(--ink); box-shadow: 0 10px 30px -10px var(--glow); }
.nav a.active svg { opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); line-height: 18px; }
.nav a.active .count { background: rgba(0,0,0,.15); color: var(--ink-on); }
.nav a.locked { opacity: .35; pointer-events: none; }
.nav a kbd { margin-left: auto; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; transition: border-color .2s;
}
.user-card:hover { border-color: var(--line-3); }
.user-card .meta { min-width: 0; flex: 1; }
.user-card .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .meta span { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--ink); color: var(--ink-on);
}
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.ghost { background: var(--bg-3); color: var(--text); border: 1px solid var(--line-2); }

.main { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  height: var(--top); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.crumbs { font-size: 13px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text); font-weight: 600; }
.top-search {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  width: 340px; height: 30px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-3); cursor: pointer; font-size: 13px;
  transition: border-color .2s, color .2s;
}
.top-search:hover { border-color: var(--line-3); color: var(--text-2); }
.top-search svg { width: 15px; height: 15px; }
.top-search kbd { margin-left: auto; }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; color: var(--text-2);
  transition: all .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); }
.icon-btn svg { width: 16px; height: 16px; }

kbd {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text-2);
}

.view { flex: 1; overflow: auto; padding: 28px 32px 60px; }
.view-inner { max-width: 1440px; margin: 0 auto; animation: viewIn .5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.banner {
  margin: 12px 32px 0; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg-2); display: flex; gap: 10px; align-items: center; font-size: 13px;
}
.banner svg { width: 16px; height: 16px; flex: none; }

/* Seitenkopf */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 34px; line-height: 1.05; letter-spacing: -.045em; font-weight: 800; }
.page-head .sub { margin-top: 6px; color: var(--text-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 12px var(--ink); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* =========================================================
   KOMPONENTEN
   ========================================================= */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .3s, opacity .2s;
  text-decoration: none; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--line-3); background: var(--bg-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--ink-on); border-color: var(--ink); box-shadow: 0 8px 30px -8px var(--glow); }
.btn.primary:hover { box-shadow: 0 0 0 4px var(--line-2), 0 12px 40px -6px var(--glow); background: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--bg-3); }
.btn.danger:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  overflow: hidden; isolation: isolate;
}
.card.pad { padding: 20px; }
/* Maus-Spotlight auf Karten */
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 45%);
}
.spot:hover::before { opacity: 1; }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--line-3), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::after { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 20px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }
@media (max-width: 1300px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-main { grid-template-columns: 1fr; } }

/* KPI */
.kpi { padding: 20px; min-height: 138px; display: flex; flex-direction: column; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi .label svg { width: 15px; height: 15px; }
.kpi .value { font-size: 32px; font-weight: 800; letter-spacing: -.045em; margin-top: auto; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .foot { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi.invert { background: var(--ink); color: var(--ink-on); border-color: var(--ink); }
.kpi.invert .label, .kpi.invert .foot { color: var(--ink-on); opacity: .65; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; font-size: 11px; }

/* Badges – nur schwarz/weiß, unterschieden durch Form */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.solid { background: var(--ink); color: var(--ink-on); border-color: var(--ink); }
.badge.outline { color: var(--text); border-color: var(--line-3); }
.badge.dashed { border-style: dashed; color: var(--text-3); }
.badge.dashed::before { background: transparent; border: 1px solid currentColor; }
.badge.strike { color: var(--text-3); text-decoration: line-through; }
.badge.alert { background: var(--ink); color: var(--ink-on); border-color: var(--ink); }
.badge.alert::before { animation: pulse 1s infinite; }
.badge.plain::before { display: none; }

/* Tabellen */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:hover { background: var(--bg-2); }
.table .r { text-align: right; }
.table .strong { font-weight: 600; }
.cell-2 b { display: block; font-weight: 600; }
.cell-2 span { display: block; font-size: 12px; color: var(--text-3); }

/* Formulare */
.form { display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 2), 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--line); background: var(--bg-1); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 34px; 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='%23888' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: var(--bg-2); color: var(--text); }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(var(--inv, 1)); opacity: .5; cursor: pointer; }
:root[data-theme="light"] { --inv: 0; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 10px 10px 0; background: var(--bg-3); color: var(--text-2); font-size: 13px; }
.form-section { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding-top: 8px; display: flex; align-items: center; gap: 10px; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Switch */
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2); transition: .25s var(--ease); }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-3); transition: .25s var(--ease); }
.switch input:checked + span { background: var(--ink); border-color: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--ink-on); }

/* Segment-Control / Tabs */
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); }
.seg button { height: 28px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--ink); color: var(--ink-on); }
.seg button .n { font-size: 10.5px; opacity: .6; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .input-icon { width: 300px; }
.toolbar .input { height: 36px; }

/* Leerer Zustand */
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty .ico { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; border: 1px dashed var(--line-3); color: var(--text); }
.empty .ico svg { width: 24px; height: 24px; }
.empty h4 { margin: 0 0 6px; color: var(--text); font-size: 16px; letter-spacing: -.01em; }
.empty p { margin: 0 0 18px; }

/* Listen */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--bg-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-chip { width: 44px; flex: none; text-align: center; border: 1px solid var(--line-2); border-radius: 10px; padding: 4px 0; line-height: 1.1; }
.date-chip b { display: block; font-size: 16px; letter-spacing: -.03em; }
.date-chip span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }

/* =========================================================
   OVERLAYS: Modal, Drawer, Toast, Palette
   ========================================================= */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 30px;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px);
  animation: fade .25s var(--ease);
}
:root[data-theme="light"] .overlay { background: rgba(255, 255, 255, .55); }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(640px, 100%); max-height: calc(100vh - 60px); display: flex; flex-direction: column;
  border-radius: 20px; background: var(--bg-1); box-shadow: var(--shadow);
  animation: pop .35s var(--ease);
}
.modal.wide { width: min(920px, 100%); }
.modal.sm { width: min(440px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-head .x { margin-left: auto; }
.modal-sub { padding: 4px 24px 0; color: var(--text-2); font-size: 13px; }
.modal-body { padding: 20px 24px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }

.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .45); backdrop-filter: blur(3px); animation: fade .2s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column;
  background: var(--bg-1); border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
  animation: slideIn .4s var(--ease);
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 54px 24px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 280px; max-width: 420px; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px;
  background: var(--ink); color: var(--ink-on); box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); font-weight: 500; font-size: 13.5px;
  animation: toastIn .4s var(--ease);
}
.toast.err { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-3); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.palette-wrap { place-items: start center; padding-top: 14vh; }
.palette { width: min(640px, 100%); border-radius: 18px; background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); box-shadow: var(--shadow); overflow: hidden; animation: pop .25s var(--ease); }
.palette .p-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette .p-input svg { width: 18px; height: 18px; color: var(--text-3); }
.palette input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette .p-list { max-height: 380px; overflow: auto; padding: 8px; }
.palette .p-group { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 10px; cursor: pointer; }
.palette .p-item svg { width: 17px; height: 17px; color: var(--text-2); flex: none; }
.palette .p-item .p-sub { margin-left: auto; font-size: 12px; color: var(--text-3); }
.palette .p-item.sel { background: var(--ink); color: var(--ink-on); }
.palette .p-item.sel svg, .palette .p-item.sel .p-sub { color: var(--ink-on); opacity: .7; }
.palette .p-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }

/* Menü (Dropdown) */
.menu { position: fixed; z-index: 200; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--bg-2); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.menu button svg { width: 15px; height: 15px; color: var(--text-2); }
.menu button:hover { background: var(--ink); color: var(--ink-on); }
.menu button:hover svg { color: var(--ink-on); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* =========================================================
   LOGIN
   ========================================================= */
.auth { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-drag { position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 5; }
.auth-hero { position: relative; overflow: hidden; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 64px 56px 48px; }
.auth-hero .grid-floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 60px 60px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: floor 3s linear infinite;
}
@keyframes floor { to { background-position: 0 60px; } }
.auth-hero .orb {
  position: absolute; width: 560px; height: 560px; right: -160px; top: 8%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.22), rgba(255,255,255,.04) 45%, transparent 70%);
  filter: blur(10px); animation: float 9s ease-in-out infinite;
}
:root[data-theme="light"] .auth-hero .orb { background: radial-gradient(circle at 35% 35%, rgba(0,0,0,.12), rgba(0,0,0,.02) 45%, transparent 70%); }
@keyframes float { 50% { transform: translate(-30px, 30px) scale(1.05); } }
.auth-hero .brand { padding: 0; position: relative; }
.auth-hero .mega {
  position: relative; font-size: clamp(80px, 13vw, 210px); font-weight: 900; letter-spacing: -.06em; line-height: .86; margin: 0; padding-bottom: .04em;
  background: linear-gradient(180deg, var(--text) 30%, transparent 105%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-hero .claim { position: relative; font-size: 18px; color: var(--text-2); max-width: 460px; margin-top: 18px; }
.auth-hero .features { position: relative; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.auth-hero .features span { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--bg); }
.auth-side { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 30px; letter-spacing: -.04em; margin: 0 0 6px; }
.auth-card .sub { color: var(--text-2); margin-bottom: 28px; }
.auth-card .switch-link { margin-top: 22px; text-align: center; color: var(--text-2); font-size: 13px; }
.auth-card .switch-link a { color: var(--text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-msg { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-3); font-size: 13px; margin-bottom: 16px; display: flex; gap: 10px; }
.auth-msg svg { width: 18px; height: 18px; flex: none; }
.demo-hint { margin-top: 26px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; font-size: 12.5px; color: var(--text-2); }
.demo-hint b { color: var(--text); }

/* Hilfsklassen */
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrap { flex-wrap: wrap; }
.gap-lg { gap: 16px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.w-full { width: 100%; }
.right { text-align: right; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.big-num { font-size: 26px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pill-note { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.pill-note svg { width: 14px; height: 14px; }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Balkendiagramm */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar .col { width: 100%; max-width: 54px; border-radius: 8px 8px 3px 3px; background: var(--bg-3); border: 1px solid var(--line-2); position: relative; transform-origin: bottom; animation: grow .9s var(--ease) both; }
.bar.cur .col { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 40px -6px var(--glow); }
.bar .col .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--text-2); opacity: 0; transition: opacity .2s; }
.bar:hover .col .tip, .bar.cur .col .tip { opacity: 1; }
.bar span { font-size: 11.5px; color: var(--text-3); }
@keyframes grow { from { transform: scaleY(0); } }

/* Ring */
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 30px; font-weight: 800; letter-spacing: -.05em; }
.ring .c span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; }
.legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
