/* ==========================================================================
   Backoffice Lutz & Leder – Design nach der Corbel-Vorlage (Mono-Palette)
   Hell als Standard, Dunkel über den Schalter in der Navigation.
   ========================================================================== */

/* ── Tokens: hell ───────────────────────────────────────────────────────── */
:root {
  --bg:#efefed; --mesh-a:#e1e1de; --mesh-b:#f9f9f7; --mesh-c:#e6e6e3;
  --glass:rgba(255,255,255,.64); --glass-2:rgba(255,255,255,.78); --glass-3:rgba(255,255,255,.94); --rim:rgba(255,255,255,.92);
  --float:#fcfcfb; --surface:#fcfcfb; --surface-2:rgba(255,255,255,.55);
  --well:rgba(17,17,17,.06); --line:rgba(17,17,17,.09); --line-2:rgba(17,17,17,.17);
  --shadow:0 1px 0 rgba(255,255,255,.8) inset,0 22px 44px -30px rgba(0,0,0,.22);
  --shadow-pop:0 24px 60px -18px rgba(20,40,56,.34),0 2px 6px rgba(20,40,56,.08);
  --text:#121212; --muted:#4f4f4c; --faint:#636360;
  --primary:#121212; --primary-2:#a3a39e; --primary-ink:#121212; --primary-soft:#e4e4e1;
  --pill:#121212; --on-pill:#f6f6f4; --dock:#121212; --on-dock:#f6f6f4;
  --t-ink:#121212; --t-white:#ffffff; --t-stone:#e2e2de; --t-sand:#d2d2cd;
  --ocean:#121212; --oc-1:#ffffff; --oc-2:#8e8e89; --oc-3:#cfcfca;
  --c1:#121212; --c2:#b4b4af; --c3:#6a6a66; --c4:#8e8e89; --c5:#c8c8c3;
  --hatch:rgba(0,0,0,.16); --hatch-bg:rgba(0,0,0,.035);
  --heat-0:#e8e8e5; --heat-1:#d0d0cc; --heat-2:#a6a6a1; --heat-3:#696965; --heat-4:#121212;
  --up:#22735c; --up-soft:#d5eee4; --down:#b1412a; --down-soft:#f8e1da;
  --warn:#85580a; --sea:#3f3f3c; --sea-soft:#e4e4e1;
  --ease:cubic-bezier(.16,1,.3,1); --ease-io:cubic-bezier(.65,0,.35,1); --calm:cubic-bezier(.22,1,.36,1);
  --font:'Urbanist','Avenir Next','Avenir','Segoe UI',ui-sans-serif,system-ui,-apple-system,sans-serif;
  color-scheme:light;
}
/* ── Tokens: dunkel ─────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:#0b0b0b; --mesh-a:rgba(255,255,255,.05); --mesh-b:rgba(255,255,255,.025); --mesh-c:rgba(255,255,255,.035);
  --glass:rgba(255,255,255,.045); --glass-2:rgba(255,255,255,.08); --glass-3:#202020; --rim:rgba(255,255,255,.075);
  --float:#1a1a1a; --surface:#161616; --surface-2:rgba(255,255,255,.06);
  --well:rgba(255,255,255,.065); --line:rgba(255,255,255,.085); --line-2:rgba(255,255,255,.16);
  --shadow:0 1px 0 rgba(255,255,255,.05) inset,0 24px 48px -30px rgba(0,0,0,.8);
  --shadow-pop:0 24px 60px -18px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.08);
  --text:#ededeb; --muted:#a9a9a5; --faint:#8e8e8a;
  --primary:#ededeb; --primary-2:#6c6c68; --primary-ink:#ffffff; --primary-soft:rgba(255,255,255,.1);
  --pill:#ededeb; --on-pill:#111111; --dock:rgba(255,255,255,.08); --on-dock:#ededeb;
  --t-ink:#f0f0ee; --t-white:#d6d6d2; --t-stone:#c2c2bd; --t-sand:#ababa6; --ocean:#222222;
  --c1:#ededeb; --c2:#6c6c68; --c3:#a9a9a5; --c4:#8e8e8a; --c5:#c4c4bf;
  --hatch:rgba(255,255,255,.2); --hatch-bg:rgba(255,255,255,.04);
  --heat-0:#1a1a1a; --heat-1:#2e2e2e; --heat-2:#4c4c4a; --heat-3:#8a8a86; --heat-4:#ededeb;
  --up:#6fd3b0; --up-soft:rgba(111,211,176,.13); --down:#f2937c; --down-soft:rgba(242,147,124,.13);
  --warn:#e8bd62; --sea:#c4c4bf; --sea-soft:rgba(255,255,255,.1);
  color-scheme:dark;
}

/* ── Grundlagen ─────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { min-height:100%; background:var(--bg); }
body {
  font-family:var(--font); font-size:14px; font-weight:500; line-height:1.45;
  color:var(--text); font-variant-numeric:tabular-nums; -webkit-font-smoothing:antialiased;
}
button,input,select { font:inherit; color:inherit; }
button { cursor:pointer; background:none; border:0; }
a { color:inherit; text-decoration:none; }
:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
::selection { background:var(--pill); color:var(--on-pill); }
.hidden { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.cb-muted { color:var(--muted); } .cb-faint { color:var(--faint); }
.ic { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.ic-sm { width:15px; height:15px; }

.cb { position:relative; isolation:isolate; min-height:100dvh; overflow-x:clip; }

/* Weicher Hintergrund (Mesh) */
.cb-mesh { position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none; }
.cb-mesh i { position:absolute; border-radius:50%; filter:blur(60px); opacity:.95; }
.cb-mesh i:nth-child(1){ width:62vmax; height:62vmax; left:-18vmax; top:-24vmax; background:radial-gradient(closest-side,var(--mesh-a),transparent); animation:drift-a 26s ease-in-out infinite alternate; }
.cb-mesh i:nth-child(2){ width:70vmax; height:70vmax; right:-24vmax; bottom:-30vmax; background:radial-gradient(closest-side,var(--mesh-b),transparent); animation:drift-b 32s ease-in-out infinite alternate; }
.cb-mesh i:nth-child(3){ width:46vmax; height:46vmax; right:8vmax; top:-16vmax; background:radial-gradient(closest-side,var(--mesh-c),transparent); animation:drift-c 22s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform:translate3d(8vmax,6vmax,0) scale(1.08); } }
@keyframes drift-b { to { transform:translate3d(-7vmax,-5vmax,0) scale(1.1); } }
@keyframes drift-c { to { transform:translate3d(-6vmax,7vmax,0) scale(.92); } }

/* ── Bausteine ──────────────────────────────────────────────────────────── */
.cb-pane { position:relative; min-width:0; border-radius:22px; background:var(--glass); box-shadow:inset 0 0 0 1px var(--rim),var(--shadow); }
.cb-float { background:var(--float); box-shadow:var(--shadow-pop),inset 0 0 0 1px var(--line); }
.cb-well { background:var(--well); }

.cb-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; height:40px; padding:0 16px;
  border-radius:999px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line-2);
  font-weight:600; font-size:13.5px; white-space:nowrap; transition:background-color .2s,color .2s,opacity .2s;
}
.cb-btn:hover { background:var(--glass-3); }
.cb-btn-ink { background:var(--pill); color:var(--on-pill); box-shadow:none; }
.cb-btn-ink:hover { background:var(--pill); opacity:.88; }
.cb-btn-block { width:100%; height:44px; }
.cb-btn:disabled { opacity:.55; cursor:default; }

.cb-input {
  width:100%; height:44px; padding:0 16px; border:0; border-radius:14px;
  background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line-2); color:var(--text); transition:box-shadow .2s;
}
.cb-input::placeholder { color:var(--faint); }
.cb-input:focus { outline:none; box-shadow:inset 0 0 0 1.5px var(--text); }

.delta {
  display:inline-flex; align-items:center; gap:2px; height:20px; padding:0 7px 0 5px; border-radius:999px;
  background:var(--up-soft); color:var(--up); font-size:11px; font-weight:700; white-space:nowrap;
}
.delta svg { width:12px; height:12px; stroke-width:2.4; }
.delta.is-down { background:var(--down-soft); color:var(--down); }
.delta.is-down svg { transform:rotate(180deg); }
.delta.is-flat { background:var(--well); color:var(--muted); }

.info { display:inline-grid; place-items:center; color:var(--faint); cursor:help; }
.info svg { width:14px; height:14px; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.login-card {
  width:100%; max-width:380px; border-radius:28px; padding:36px 32px 28px;
  display:grid; gap:12px; justify-items:center; text-align:center; animation:land .9s var(--ease) both;
}
.login-title { font-size:28px; font-weight:600; letter-spacing:-.025em; margin-top:8px; }
.login-sub { margin-bottom:10px; }
.login-error { min-height:20px; color:var(--down); font-size:13px; font-weight:600; }

/* ── Marke / Avatar ─────────────────────────────────────────────────────── */
.brand { display:inline-flex; align-items:center; gap:10px; min-width:0; border-radius:14px; }
.brand-mark {
  display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:13px;
  background:var(--pill); color:var(--on-pill); font-weight:700; font-size:13px; letter-spacing:-.02em;
}
.brand-mark--lg { width:56px; height:56px; border-radius:18px; font-size:17px; }
.brand-text { display:grid; line-height:1.2; min-width:0; }
.brand-text b { font-size:17px; font-weight:700; letter-spacing:-.02em; white-space:nowrap; }
.brand-text small { font-size:12px; }
.avatar-ring { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--rim); }
.avatar { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; background:var(--primary-soft); color:var(--text); font-weight:700; font-size:12px; letter-spacing:.02em; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { --nav-w:104px; position:relative; max-width:100rem; margin:0 auto; min-height:100dvh; }
.shell.nav-open { --nav-w:252px; }
.topbar {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:22px 28px 18px calc(var(--nav-w) + 0px); transition:padding .45s var(--ease);
  animation:fade-down .7s var(--ease) both;
}
.topbar-right { display:flex; align-items:center; gap:10px; }
.main { min-width:0; padding:0 28px 48px var(--nav-w); transition:padding .45s var(--ease); }
.page-head { display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; min-height:48px; margin-bottom:20px; }
.page-title { font-size:clamp(28px,2.4vw,38px); font-weight:600; line-height:1.04; letter-spacing:-.025em; white-space:nowrap; }
.page-title .w { display:inline-block; overflow:hidden; padding-bottom:.08em; margin-bottom:-.08em; vertical-align:top; }
.page-title .ch { display:inline-block; animation:rise .8s var(--ease) both; animation-delay:calc(var(--n) * 20ms); }
.live-pill {
  margin-left:auto; display:inline-flex; align-items:center; gap:8px; height:36px; padding:0 15px 0 13px;
  border-radius:999px; background:var(--glass-3); box-shadow:inset 0 0 0 1px var(--line); font-weight:600; font-size:13.5px;
}
.live-pill:hover { background:var(--float); }
.ping { position:relative; width:7px; height:7px; border-radius:50%; background:currentColor; }
.ping::after { content:''; position:absolute; inset:-4px; border-radius:50%; border:1.5px solid currentColor; opacity:0; animation:ping 2.2s cubic-bezier(.2,.6,.3,1) infinite; }
.live-pill.is-loading .ping::after { animation-duration:.9s; }

/* ── Dock (Navigation) ──────────────────────────────────────────────────── */
.dock-wrap { position:fixed; z-index:40; left:max(20px,calc((100vw - 100rem) / 2 + 20px)); top:0; bottom:0; display:flex; align-items:center; pointer-events:none; }
.dock {
  pointer-events:auto; position:relative; display:flex; flex-direction:column; gap:4px; padding:8px;
  border-radius:30px; background:var(--dock); color:var(--on-dock);
  box-shadow:0 20px 40px -18px rgba(10,20,30,.5); width:60px; transition:width .45s var(--ease),border-radius .45s var(--ease);
  animation:pop-in .7s var(--ease) .1s both;
}
:root[data-theme="dark"] .dock { box-shadow:inset 0 0 0 1px var(--line),0 20px 40px -18px rgba(0,0,0,.6); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
.shell.nav-open .dock { width:212px; border-radius:26px; }
.dock-btn {
  position:relative; display:flex; align-items:center; gap:12px; height:44px; min-width:44px; padding:0 13px;
  border-radius:22px; color:inherit; opacity:.74; transition:opacity .2s,background-color .2s; white-space:nowrap; overflow:hidden;
}
.dock-btn:hover,.dock-btn:focus-visible,.dock-btn[aria-current="page"] { opacity:1; background:rgba(255,255,255,.13); }
.dock-btn:focus-visible { outline-color:var(--on-dock); }
.dock-btn[aria-current="page"]::after { content:''; position:absolute; right:5px; top:50%; width:5px; height:5px; margin-top:-2.5px; border-radius:50%; background:#fff; }
:root[data-theme="dark"] .dock-btn[aria-current="page"]::after { background:var(--on-dock); }
.dock-label { font-size:14px; font-weight:600; opacity:0; transform:translateX(-6px); transition:opacity .25s,transform .35s var(--ease); pointer-events:none; }
.shell.nav-open .dock-label { opacity:1; transform:none; }
.dock-sep { height:1px; margin:4px 10px; background:rgba(255,255,255,.15); }
:root[data-theme="dark"] .dock-sep { background:var(--line-2); }
.dock-toggle .ic { transition:transform .45s var(--ease); }
.shell.nav-open .dock-toggle .ic { transform:rotate(180deg); }
.dock-tip {
  padding:6px 10px; border-radius:10px; background:var(--float); color:var(--text);
  box-shadow:var(--shadow-pop); font-size:12.5px; font-weight:600; white-space:nowrap; pointer-events:none; opacity:0; transition:opacity .18s;
}
.ic-sun { display:none; }
:root[data-theme="dark"] .ic-sun { display:block; }
:root[data-theme="dark"] .ic-moon { display:none; }

/* Tooltip neben dem eingeklappten Dock */
.dock-btn .dock-tip { position:absolute; left:calc(100% + 18px); top:50%; translate:0 -50%; }
.dock-btn { overflow:visible; }
.dock-btn .dock-label { overflow:hidden; }
.shell:not(.nav-open) .dock-btn:hover .dock-tip,
.shell:not(.nav-open) .dock-btn:focus-visible .dock-tip { opacity:1; }

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; animation:fade-up .6s var(--ease) .15s both; }
.toolbar-group { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.seg { position:relative; display:inline-grid; grid-auto-flow:column; grid-auto-columns:1fr; padding:3px; border-radius:999px; background:var(--well); }
.seg-pill { position:absolute; top:3px; bottom:3px; left:3px; border-radius:999px; background:var(--glass-3); box-shadow:0 2px 8px rgba(20,40,56,.1); transition:transform .5s var(--ease); pointer-events:none; }
:root[data-theme="dark"] .seg-pill { background:rgba(255,255,255,.15); }
.seg button { position:relative; z-index:1; height:32px; padding:0 14px; border-radius:999px; font-size:12.5px; font-weight:600; color:var(--muted); white-space:nowrap; transition:color .2s; }
.seg button[aria-pressed="true"],.seg button[aria-selected="true"] { color:var(--text); }
.seg button:hover { color:var(--text); }
.seg--sm button { height:28px; padding:0 11px; font-size:12px; }

.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip {
  height:32px; padding:0 13px; border-radius:999px; font-size:12.5px; font-weight:600; color:var(--muted);
  background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line); transition:background-color .2s,color .2s;
}
.chip:hover { color:var(--text); }
.chip.active { background:var(--pill); color:var(--on-pill); box-shadow:none; }

.period { position:relative; display:inline-flex; align-items:center; gap:6px; color:var(--faint); font-size:12.5px; }
.period select {
  appearance:none; -webkit-appearance:none; height:34px; padding:0 30px 0 12px; border:0; border-radius:999px;
  background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line-2); color:var(--text); font-weight:600; font-size:12.5px; cursor:pointer;
}
.period::after { content:''; position:absolute; right:12px; top:50%; width:6px; height:6px; margin-top:-5px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:rotate(45deg); pointer-events:none; }
.month-input { height:34px; padding:0 12px; border:0; border-radius:999px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line-2); font-weight:600; font-size:12.5px; }

/* ── Dashboard-Raster ───────────────────────────────────────────────────── */
.dash { container-type:inline-size; }
.grid12 { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:16px; }
.kpis { grid-column:span 12; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.span-12 { grid-column:span 12; }
@container (min-width:760px) { .kpis { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@container (min-width:1100px) {
  .span-4 { grid-column:span 4; } .span-8 { grid-column:span 8; }
  .span-7 { grid-column:span 7; } .span-5 { grid-column:span 5; }
}
.pane-pad { padding:20px; }
.pane-head { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-height:32px; margin-bottom:14px; }
.pane-title { display:flex; align-items:center; gap:6px; font-size:15px; font-weight:600; }
.pane-sub { font-size:12.5px; color:var(--faint); }
.pane-head .seg { margin-left:auto; }

.land { animation:land .9s var(--ease) both; animation-delay:calc(50ms + var(--i, 0) * 70ms); }

/* KPI-Kacheln */
.tile {
  --text:#121212; --muted:rgba(18,18,18,.74); --faint:rgba(18,18,18,.66);
  --well:rgba(18,18,18,.08); --line:rgba(18,18,18,.12); --line-2:rgba(18,18,18,.2);
  --surface:rgba(255,255,255,.7); --up:#1b5e4a; --up-soft:rgba(255,255,255,.55); --down:#8f3220; --down-soft:rgba(255,255,255,.55);
  --primary:#121212; --c1:#121212; --c2:rgba(18,18,18,.3); --c3:#121212;
  position:relative; display:grid; gap:12px; min-width:0; padding:18px 20px 16px; border-radius:22px; color:var(--text);
  animation:fade-up .6s var(--calm) both; animation-delay:calc(270ms + var(--i, 0) * 80ms);
  transition:transform .45s var(--calm);
}
.tile:hover { transform:translateY(-3px); }
.tile--ink { background:var(--t-ink); } .tile--white { background:var(--t-white); }
.tile--stone { background:var(--t-stone); } .tile--sand { background:var(--t-sand); }
:root:not([data-theme="dark"]) .tile--ink,
.ocean {
  --text:#f3f3f1; --muted:rgba(243,243,241,.78); --faint:rgba(243,243,241,.7);
  --well:rgba(255,255,255,.12); --line:rgba(255,255,255,.14); --line-2:rgba(255,255,255,.24);
  --surface:var(--ocean); --up:#8fe3c4; --up-soft:rgba(143,227,196,.16); --down:#ffb3a1; --down-soft:rgba(255,179,161,.16);
  --primary:#f3f3f1; --primary-ink:#f3f3f1; --c1:var(--oc-1); --c2:var(--oc-2); --c4:var(--oc-3); --rim:rgba(255,255,255,.1);
  color:var(--text);
}
:root:not([data-theme="dark"]) .tile--white { box-shadow:inset 0 0 0 1px rgba(18,18,18,.05),0 22px 44px -32px rgba(0,0,0,.25); }
.tile-label { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--muted); }
.tile-body { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.tile-figs { display:grid; gap:8px; min-width:0; }
.tile-value { font-size:26px; font-weight:600; line-height:1.1; letter-spacing:-.025em; white-space:nowrap; }
.tile-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:12.5px; color:var(--faint); }
.tile-viz { display:flex; align-items:flex-end; justify-content:flex-end; width:84px; height:44px; flex:none; }
.tile-more {
  display:inline-flex; width:100%; align-items:center; gap:6px; padding-top:10px; border-top:1px dashed var(--line-2);
  text-align:left; font-size:12.5px; font-weight:600; color:var(--muted);
  text-decoration:underline; text-decoration-color:var(--line-2); text-underline-offset:3px;
}
.tile-more:hover { text-decoration-color:currentColor; }

/* Mini-Grafiken in den Kacheln */
.minibars { display:flex; align-items:stretch; gap:5px; height:42px; }
.minibars span, .eq span { position:relative; overflow:hidden; background:var(--well); }
.minibars span { width:13px; border-radius:5px; }
.minibars i, .eq i { position:absolute; inset:0; border-radius:inherit; background:var(--c2); transform:translateY(100%); transition:transform 1s var(--ease); }
.minibars i.is-last, .eq i.is-last { background:var(--primary); }
.eq { display:flex; align-items:stretch; gap:3px; height:42px; }
.eq span { width:5px; border-radius:3px; }
.spark { width:84px; height:40px; overflow:visible; }
.spark .line { fill:none; stroke:var(--c1); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:1; stroke-dashoffset:1; transition:stroke-dashoffset 1.3s var(--ease-io) .45s; }
.spark .area { fill:var(--c1); opacity:0; transition:opacity .8s 1s; }
.spark .end { fill:var(--surface); stroke:var(--c1); stroke-width:2.2; transform-box:fill-box; transform-origin:center; transform:scale(0); transition:transform .5s var(--calm) 1.5s; }
.spark.on .line { stroke-dashoffset:0; } .spark.on .area { opacity:.14; } .spark.on .end { transform:scale(1); }
.ring { position:relative; width:46px; height:46px; }
.ring svg { width:100%; height:100%; transform:rotate(-90deg); }
.ring .track { fill:none; stroke:var(--well); stroke-width:5; }
.ring .val { fill:none; stroke:var(--c3); stroke-width:5; stroke-linecap:round; stroke-dasharray:0 100; transition:stroke-dasharray 1.4s var(--ease-io) .45s; }
.ring b { position:absolute; inset:0; display:grid; place-items:center; font-size:11px; font-weight:600; }

/* Setting-Quote (dunkles Feld mit Tacho) */
.ocean { background:var(--ocean); border-radius:22px; padding:20px; display:flex; flex-direction:column; }
@container (min-width:700px) and (max-width:1099.98px) {
  .ocean { display:grid; grid-template-columns:1fr 1fr; align-items:center; column-gap:24px; }
  .ocean .pane-head { grid-column:span 2; }
}
.gauge { position:relative; width:100%; max-width:290px; margin:2px auto 0; }
.gauge svg { display:block; width:100%; height:auto; overflow:visible; }
.gauge .tick { stroke:var(--primary); stroke-width:2; stroke-linecap:round; opacity:.14; transition:opacity .25s; }
.gauge .tick.lit { opacity:.85; }
.gauge .track { fill:none; stroke:var(--well); stroke-width:16; stroke-linecap:round; }
.gauge .arc { fill:none; stroke-width:16; stroke-linecap:round; }
.gauge .knob { fill:var(--surface); stroke:var(--primary); stroke-width:3; }
.gauge .knob-dot { fill:var(--primary); }
.gauge-read { position:absolute; inset:auto 0 0; display:grid; justify-items:center; gap:2px; }
.gauge-read p { display:flex; align-items:center; gap:6px; }
.gauge-read b { font-size:34px; font-weight:600; line-height:1; letter-spacing:-.035em; }
.gauge-read small { font-size:12px; color:var(--faint); }
.ocean-note { margin-top:16px; display:grid; gap:4px; }
.ocean-note h3 { font-size:14px; font-weight:600; }
.ocean-note p { font-size:12.5px; color:var(--muted); }
.ocean-link {
  margin-top:auto; padding-top:14px; display:inline-flex; align-items:center; gap:6px; align-self:flex-start;
  font-size:12.5px; font-weight:600; text-decoration:underline; text-decoration-color:var(--line-2); text-underline-offset:3px;
}
.ocean-link:hover { text-decoration-color:currentColor; }

/* Balken: Leads pro Monat */
.bars { position:relative; padding-bottom:28px; }
.bars-plot { position:relative; height:238px; }
.bars-grid { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:space-between; pointer-events:none; }
.bars-grid div { position:relative; height:0; padding-left:44px; }
.bars-grid i { display:block; border-top:1px dashed var(--line-2); transform-origin:left; animation:grow-x 1.1s var(--ease) both; animation-delay:calc(550ms + var(--k) * 60ms); }
.bars-grid span { position:absolute; left:0; top:-8px; width:36px; text-align:right; font-size:11px; color:var(--faint); }
.bars-avg { position:absolute; left:44px; right:0; top:0; height:0; border-top:1.5px dashed var(--c4); z-index:2; pointer-events:none; transition:transform 1s var(--ease); }
.bars-avg span { position:absolute; right:0; top:-21px; padding:1px 7px; border-radius:6px; background:var(--sea-soft); color:var(--sea); font-size:11px; font-weight:600; }
.bars-cols { position:absolute; inset:0 0 0 44px; display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); }
.bar-col { position:relative; display:flex; justify-content:center; height:100%; border-radius:10px; }
.bar-col:focus-visible { outline-offset:-2px; }
.bar-cap { position:relative; width:min(30px,66%); height:100%; overflow:hidden; border-radius:999px; }
.bar-fill { position:absolute; inset:0; border-radius:999px; transform:translateY(100%); transition:transform 1.1s var(--ease); }
.hatch { background:repeating-linear-gradient(-45deg,var(--hatch) 0 2px,transparent 2px 7px),var(--hatch-bg); }
.hatch-open { border:1.5px dashed color-mix(in srgb,var(--primary) 45%,transparent); background:repeating-linear-gradient(-45deg,color-mix(in srgb,var(--hatch) 50%,transparent) 0 2px,transparent 2px 7px); }
.bar-month { position:absolute; bottom:-25px; font-size:11px; color:var(--faint); transition:color .2s; }
.bar-col.is-shown .bar-month { color:var(--text); font-weight:600; }
.lens { position:absolute; inset:0 auto 0 0; width:calc(100% / 12); display:flex; justify-content:center; pointer-events:none; z-index:1; transition:transform .55s var(--ease); }
.lens .bar-cap { overflow:hidden; }
.lens-fill { position:absolute; inset:0; border-radius:999px; background:linear-gradient(180deg,var(--primary-2),var(--primary) 40%,var(--primary-ink)); box-shadow:inset 0 1px 0 rgba(255,255,255,.35); transform:translateY(100%); transition:transform .6s var(--ease); }
.lens-fill::after { content:''; position:absolute; left:50%; top:7px; width:10px; height:10px; margin-left:-5px; border-radius:50%; background:#fff; box-shadow:0 0 0 4px rgba(255,255,255,.3); }
:root[data-theme="dark"] .lens-fill::after { background:#111; box-shadow:0 0 0 4px rgba(0,0,0,.25); }
.bars-tip {
  position:absolute; top:0; left:0; z-index:3; min-width:172px; padding:10px 12px; border-radius:12px;
  background:var(--pill); color:var(--on-pill); box-shadow:var(--shadow-pop); font-size:12px; pointer-events:none;
  transition:transform .55s var(--ease),opacity .3s;
}
.bars-tip p { display:flex; justify-content:space-between; gap:8px; margin-bottom:7px; font-weight:600; }
.bars-tip dl { display:grid; gap:4px; }
.bars-tip dl div { display:flex; justify-content:space-between; gap:18px; }
.bars-tip dt { opacity:.7; } .bars-tip dd { font-weight:600; }
.bars-tip .is-up { color:#5ee6b4; } .bars-tip .is-down { color:#ff9ea2; }
:root[data-theme="dark"] .bars-tip .is-up { color:#08775a; } :root[data-theme="dark"] .bars-tip .is-down { color:#c22d34; }
.bars-tip em { padding:1px 6px; border-radius:5px; background:rgba(255,255,255,.18); font-size:11px; font-style:normal; }

/* Heatmap */
.heat-legend { margin-left:auto; display:flex; align-items:center; gap:4px; font-size:11px; color:var(--faint); }
.heat-legend i { width:14px; height:14px; border-radius:4px; }
.heat { display:grid; grid-template-columns:72px repeat(7,minmax(0,1fr)); align-items:center; gap:7px; }
.heat-day { text-align:center; font-size:11px; color:var(--faint); }
.heat-row { font-size:11px; color:var(--faint); white-space:nowrap; }
.heat-cell { height:32px; }
.heat-cell i {
  display:block; height:100%; border-radius:10px; transform:scale(.3); opacity:0;
  animation:cell .7s var(--calm) forwards; animation-delay:calc(600ms + var(--k) * 22ms); transition:background-color .35s,box-shadow .2s;
}
.heat-cell:hover i { box-shadow:0 0 0 2px var(--surface),0 0 0 3.5px var(--primary); }
.heat-tip, .donut-tip {
  position:absolute; z-index:3; padding:7px 11px; border-radius:10px; background:var(--pill); color:var(--on-pill);
  box-shadow:var(--shadow-pop); font-size:12px; white-space:nowrap; pointer-events:none; transform:translate(-50%,-100%); opacity:0; transition:opacity .2s;
}
.heat-tip b { display:block; font-weight:600; } .heat-tip span { opacity:.7; }

/* Donut */
.donut-wrap { display:grid; grid-template-columns:minmax(0,1fr) 168px; align-items:center; gap:18px; }
.donut-total { font-size:26px; font-weight:600; line-height:1.1; letter-spacing:-.025em; }
.donut-list { list-style:none; display:grid; gap:2px; margin-top:14px; }
.donut-list button { display:flex; width:100%; align-items:center; gap:9px; margin-left:-8px; padding:6px 8px; border-radius:9px; text-align:left; transition:background-color .2s,opacity .2s; }
.donut-list button:hover { background:var(--well); }
.donut-list.has-focus button:not(.is-focus) { opacity:.4; }
.donut-list i { width:10px; height:10px; flex:none; border-radius:3px; }
.donut-list span { flex:1; font-size:12.5px; color:var(--muted); }
.donut-list b { font-size:12.5px; font-weight:600; }
.donut { position:relative; width:168px; aspect-ratio:1; }
.donut svg { display:block; width:100%; height:100%; overflow:visible; }
.donut circle.seg-arc { fill:none; stroke-width:20; transform-origin:50% 50%; transition:stroke-dasharray 1s var(--ease-io),opacity .45s,transform .45s var(--calm); cursor:pointer; }
.donut-center { position:absolute; inset:0; display:grid; place-content:center; text-align:center; pointer-events:none; }
.donut-center b { font-size:26px; font-weight:600; line-height:1.1; letter-spacing:-.03em; }
.donut-center small { font-size:12px; color:var(--faint); }

/* Tools & Portale */
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.portal {
  display:grid; gap:14px; padding:18px 20px; border-radius:22px; background:var(--glass); box-shadow:inset 0 0 0 1px var(--rim),var(--shadow);
  transition:transform .45s var(--calm),background-color .2s;
}
.portal:hover { transform:translateY(-3px); background:var(--glass-2); }
.portal-top { display:flex; align-items:center; gap:12px; }
.portal-ico { display:grid; place-items:center; width:42px; height:42px; flex:none; border-radius:13px; background:var(--pill); color:var(--on-pill); font-weight:700; font-size:13px; }
.portal-top b { display:block; font-size:15px; font-weight:600; }
.portal-top small { font-size:12.5px; color:var(--faint); }
.portal-go { display:flex; align-items:center; justify-content:space-between; padding-top:10px; border-top:1px dashed var(--line-2); font-size:12.5px; font-weight:600; color:var(--muted); }
.empty { display:grid; place-items:center; gap:8px; padding:56px 20px; text-align:center; }
.empty-ico { display:grid; place-items:center; width:52px; height:52px; border-radius:16px; background:var(--pill); color:var(--on-pill); margin-bottom:6px; }
.empty b { font-size:17px; font-weight:600; }
.slots { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; margin-top:16px; }
.slot { height:110px; border-radius:18px; border:1.5px dashed var(--line-2); }

/* ── Sales-Statistiken ──────────────────────────────────────────────────── */
.persons-wrap { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:16px; }
.persons-wrap.single { grid-template-columns:1fr; max-width:760px; margin:0 auto; }
.person-col { display:flex; flex-direction:column; gap:12px; min-width:0; padding:20px; container-type:inline-size; }
.person-col-header { display:flex; align-items:center; gap:12px; }
.person-avatar { display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:50%; background:var(--pill); color:var(--on-pill); font-weight:700; font-size:12px; }
.person-name { font-size:17px; font-weight:600; letter-spacing:-.01em; }
.person-subtitle { font-size:12.5px; color:var(--faint); }
.section-title { margin-top:8px; font-size:12px; font-weight:600; color:var(--muted); }
.kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.kpi-card { min-width:0; padding:12px 14px; border-radius:16px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line); }
.kpi-card:first-child { background:var(--pill); color:var(--on-pill); box-shadow:none; }
.kpi-card:first-child .kpi-card__label,.kpi-card:first-child .kpi-card__sub { color:color-mix(in srgb,var(--on-pill) 72%,transparent); }
.kpi-card__label { margin-bottom:6px; font-size:12px; font-weight:600; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kpi-card__value { font-size:24px; font-weight:600; line-height:1.05; letter-spacing:-.025em; }
.kpi-card__sub { margin-top:4px; font-size:11.5px; color:var(--faint); }

.week-chart { position:relative; min-height:200px; padding:10px 6px 4px; border-radius:16px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line); }
.week-chart svg { display:block; overflow:visible; touch-action:pan-y; }
.week-chart__empty { padding:72px 16px; text-align:center; font-size:12.5px; color:var(--faint); }
.wc-grid { stroke:var(--line-2); stroke-width:1; stroke-dasharray:3 4; }
.wc-base { stroke:var(--line-2); stroke-width:1; }
.wc-axis { fill:var(--faint); font-size:11px; font-family:var(--font); font-variant-numeric:tabular-nums; }
.wc-line { fill:none; stroke:var(--primary); stroke-width:2.2; stroke-linejoin:round; stroke-linecap:round; }
.wc-dot { fill:var(--surface); stroke:var(--primary); stroke-width:2.2; }
.wc-dot--hover { pointer-events:none; fill:var(--primary); }
.wc-label { fill:var(--text); font-size:12px; font-weight:700; font-family:var(--font); }
.wc-cross { stroke:var(--faint); stroke-width:1; stroke-dasharray:3 3; pointer-events:none; }
.week-chart__tip {
  position:absolute; top:0; left:0; z-index:5; padding:8px 11px; border-radius:11px; background:var(--pill); color:var(--on-pill);
  box-shadow:var(--shadow-pop); font-size:12px; line-height:1.4; white-space:nowrap; pointer-events:none; opacity:0; transition:opacity .12s ease-out;
}
.week-chart__tip-head { font-size:11px; opacity:.7; }
.week-chart__tip-val { font-size:16px; font-weight:700; }

.funnel-table { overflow:hidden; border-radius:16px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line); }
.funnel-row { display:grid; grid-template-columns:1fr 48px 88px 106px 88px; align-items:center; gap:8px; padding:10px 16px; border-bottom:1px solid var(--line); transition:background-color .15s; }
.funnel-row:last-child { border-bottom:0; }
.funnel-row:hover { background:var(--surface-2); }
.funnel-row__stage { font-size:13px; font-weight:500; }
.funnel-row__count { text-align:right; font-size:15px; font-weight:700; letter-spacing:-.02em; }
.funnel-row__pct { text-align:right; font-size:12px; color:var(--faint); }
.funnel-row__pct.green { color:var(--up); font-weight:600; }
.funnel-row__pct.red { color:var(--down); font-weight:600; }
.funnel-row__pct--na { opacity:.45; }
.funnel-row--indent { background:var(--well); }
.funnel-row--indent .funnel-row__stage { color:var(--faint); font-style:italic; }
.funnel-row--header { background:var(--surface-2); }
.funnel-row--header > div { font-size:11.5px; font-weight:600; color:var(--muted); }

.revenue-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.rev-card { padding:14px 16px; border-radius:16px; background:var(--t-stone); color:#121212; }
.rev-card + .rev-card { background:var(--t-sand); }
.rev-card__label { margin-bottom:8px; font-size:12px; font-weight:600; color:rgba(18,18,18,.72); }
.rev-card__value { font-size:22px; font-weight:600; letter-spacing:-.025em; }
.rev-card__sub { margin-top:4px; font-size:11.5px; color:rgba(18,18,18,.66); }

.gesamt-section { margin-top:28px; }
.gesamt-divider { display:flex; align-items:center; gap:14px; margin-bottom:16px; font-size:12px; font-weight:600; color:var(--muted); }
.gesamt-divider::before,.gesamt-divider::after { content:''; flex:1; border-top:1px dashed var(--line-2); }
.warm-section { margin-top:28px; padding:20px; }
.warm-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:6px; margin-top:12px; }
.warm-item { display:flex; justify-content:space-between; align-items:baseline; gap:8px; padding:8px 12px; border-radius:12px; background:var(--glass-2); box-shadow:inset 0 0 0 1px var(--line); font-size:12.5px; }
.warm-item__label { color:var(--muted); }
.warm-item__value { font-weight:600; white-space:nowrap; }

/* Laden / Fehler / Hinweise */
.dash-loading { display:flex; align-items:center; justify-content:center; gap:10px; height:300px; color:var(--faint); }
.spinner { width:18px; height:18px; border:2px solid var(--line-2); border-top-color:var(--text); border-radius:50%; animation:spin .7s linear infinite; }
.dash-error { max-width:480px; margin:40px auto; padding:20px; border-radius:18px; background:var(--down-soft); color:var(--down); text-align:center; font-weight:600; }
.toasts { position:fixed; inset:auto 12px 18px; z-index:90; display:grid; justify-items:center; gap:8px; pointer-events:none; }
.toast {
  display:flex; align-items:center; gap:10px; max-width:min(400px,calc(100vw - 36px)); padding:10px 16px 10px 10px; border-radius:999px;
  background:var(--pill); color:var(--on-pill); box-shadow:var(--shadow-pop); font-size:13.5px; font-weight:600; animation:toast .45s var(--calm) both;
}
.toast span { display:grid; place-items:center; width:26px; height:26px; flex:none; border-radius:50%; background:#fff; color:#121212; }
:root[data-theme="dark"] .toast span { background:#121212; color:#fff; }
.toast span svg { width:14px; height:14px; stroke-width:2.4; }

/* ── Bewegung ───────────────────────────────────────────────────────────── */
@keyframes land { from { opacity:0; transform:translateY(26px) scale(.985); } to { opacity:1; transform:none; } }
@keyframes fade-up { from { opacity:0; translate:0 14px; } to { opacity:1; translate:none; } }
@keyframes fade-down { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:none; } }
@keyframes pop-in { from { opacity:0; transform:scale(.9); } to { opacity:1; transform:none; } }
@keyframes rise { from { transform:translateY(110%); } to { transform:none; } }
@keyframes grow-x { from { transform:scaleX(0); } to { transform:none; } }
@keyframes cell { to { transform:none; opacity:1; } }
@keyframes ping { 0% { transform:scale(.4); opacity:.9; } 80%,100% { transform:scale(1.5); opacity:0; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes toast { from { opacity:0; transform:translateY(16px) scale(.96); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; animation-delay:0ms !important; transition-duration:.01ms !important; transition-delay:0ms !important; }
}

/* ── Tablet & Handy: Navigation unten als dunkle Leiste ─────────────────── */
@media (max-width:1023.98px) {
  .shell, .shell.nav-open { --nav-w:0px; }
  .topbar { padding:16px 20px 12px; }
  .main { padding:0 20px 120px; }
  .dock-wrap { left:0; right:0; top:auto; bottom:max(12px,env(safe-area-inset-bottom)); justify-content:center; }
  .dock, .shell.nav-open .dock { flex-direction:row; width:auto; padding:6px; border-radius:999px; }
  .dock-toggle, .dock-sep--toggle, .dock-label, .dock-tip { display:none; }
  .dock-sep { width:1px; height:auto; margin:10px 4px; }
  .dock-btn { width:44px; justify-content:center; padding:0; }
  .dock-btn[aria-current="page"]::after { right:auto; left:50%; top:auto; bottom:3px; margin:0 0 0 -2.5px; }
  .toasts { bottom:92px; }
}
@media (max-width:640px) {
  .topbar { padding:14px 16px 10px; }
  .main { padding:0 16px 116px; }
  .page-head { margin-bottom:14px; }
  .page-title { font-size:28px; }
  .live-pill { height:32px; font-size:12.5px; }
  .brand-text small { display:none; }
  .grid12, .kpis { gap:10px; }
  .tile { gap:8px; padding:14px; }
  .tile-value { font-size:22px; }
  .tile-viz, .tile-meta .vs { display:none; }
  .tile-more { font-size:12px; }
  .pane-pad, .ocean { padding:16px; }
  .bars-plot { height:210px; }
  .bars-grid div { padding-left:38px; } .bars-grid span { width:32px; }
  .bars-cols, .bars-avg { left:38px; }
  .heat { grid-template-columns:44px repeat(7,minmax(0,1fr)); gap:5px; }
  .heat-cell { height:26px; } .heat-cell i { border-radius:7px; }
  .donut-wrap { grid-template-columns:1fr; }
  .donut { grid-row:1; justify-self:center; width:160px; }
  .toolbar { gap:8px; }
  .toolbar-group { width:100%; }
  .toolbar .seg { width:100%; }
  .toolbar .cb-btn { flex:1; }
  .person-col { padding:14px; }
}

/* Schmale Personenspalten (z. B. 3 nebeneinander) */
@container (max-width:600px) {
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .funnel-row { grid-template-columns:minmax(0,1fr) 30px 62px 78px 56px; gap:6px; padding:10px 12px; }
  .funnel-row--header > div { font-size:10.5px; line-height:1.25; }
}
