/* NF CRM — Designsystem der NF-App-Familie („Dark Glass“ wie Hub und OS), Akzent NATURFACTOR-Grün.
   Hub = Rot, OS = Blau, CRM = Grün. Radien 14 / 18 / 24, System-Sans, fette Titel, Verlaufs-Buttons mit Glow.
   Klassennamen bleiben stabil, damit alle Ansichten mitziehen. */

:root {
  --bg: #060907;
  --surface: rgba(255, 255, 255, 0.038);
  --surface-2: rgba(255, 255, 255, 0.024);
  --surface-3: rgba(255, 255, 255, 0.012);
  --surface-input: rgba(0, 0, 0, 0.34);
  --popup-bg: #111814;
  --bar-bg: rgba(6, 9, 7, 0.86);

  --border: rgba(255, 255, 255, 0.078);
  --border-mid: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(255, 255, 255, 0.3);

  --text: #eef4f0;
  --text-2: rgba(238, 244, 240, 0.74);
  --text-sub: rgba(238, 244, 240, 0.56);
  --muted: rgba(238, 244, 240, 0.48);
  --text-dim: rgba(238, 244, 240, 0.34);
  --placeholder: rgba(238, 244, 240, 0.3);

  --accent: #34a35c;
  --accent-bright: #6fd394;
  --accent-glow: rgba(52, 163, 92, 0.32);
  --accent-soft: rgba(52, 163, 92, 0.14);
  --accent-dim: rgba(52, 163, 92, 0.07);
  --btn-from: #63c283;
  --btn-mid: #2f9a55;
  --btn-to: #1b5e34;
  --btn-text: #f3fff6;
  --fill: linear-gradient(90deg, #2f9a55 0%, #6fd394 100%);
  --track: rgba(255, 255, 255, 0.07);

  --sage: #8fd3a5;
  --teal: #7fd1c4;
  --amber: #e5b567;
  --rose: #f08a8f;
  --blue: #8fb3ef;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-2xl: 24px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 22px 50px rgba(0, 0, 0, 0.42), 0 6px 18px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 40px 80px rgba(0, 0, 0, 0.7), 0 12px 32px rgba(0, 0, 0, 0.5);
  --ease: 180ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-enter: 440ms cubic-bezier(0.22, 1, 0.36, 1);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  --side: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Alt-Namen (Inline-Styles in den Ansichten) */
  --line: var(--border);
  --line-hi: var(--border-mid);
  --glass: var(--surface-2);
  --glass-hi: var(--surface);
  --silver-flat: var(--text-sub);
  --forest: var(--accent-soft);
  --forest-hi: var(--accent);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef2f0;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(255, 255, 255, 0.55);
  --surface-3: rgba(255, 255, 255, 0.35);
  --surface-input: rgba(255, 255, 255, 0.95);
  --popup-bg: #ffffff;
  --bar-bg: rgba(238, 242, 240, 0.88);
  --border: rgba(20, 40, 32, 0.1);
  --border-mid: rgba(20, 40, 32, 0.2);
  --border-focus: rgba(20, 40, 32, 0.34);
  --text: #13201a;
  --text-2: rgba(19, 32, 26, 0.8);
  --text-sub: rgba(19, 32, 26, 0.62);
  --muted: rgba(19, 32, 26, 0.54);
  --text-dim: rgba(19, 32, 26, 0.42);
  --placeholder: rgba(19, 32, 26, 0.36);
  --accent: #2a8a4c;
  --accent-bright: #1f7a41;
  --accent-glow: rgba(42, 138, 76, 0.24);
  --accent-soft: rgba(42, 138, 76, 0.11);
  --accent-dim: rgba(42, 138, 76, 0.06);
  --fill: linear-gradient(90deg, #2f9a55 0%, #4fb877 100%);
  --track: rgba(20, 40, 32, 0.09);
  --sage: #2f7a45;
  --teal: #1f7a70;
  --amber: #94650f;
  --rose: #b33a3f;
  --blue: #2f5a8a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 10px 30px rgba(20, 40, 32, 0.07), 0 2px 6px rgba(20, 40, 32, 0.05);
  --shadow-pop: 0 30px 70px rgba(20, 40, 32, 0.18), 0 8px 24px rgba(20, 40, 32, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 110% 65% at 50% -6%, rgba(46, 150, 76, 0.15) 0%, transparent 62%),
    radial-gradient(ellipse 52% 32% at 50% 0%, rgba(120, 200, 140, 0.06) 0%, transparent 42%),
    radial-gradient(ellipse 170% 65% at 50% 46%, rgba(24, 64, 44, 0.05) 0%, transparent 72%),
    radial-gradient(ellipse 85% 58% at 50% 100%, rgba(10, 40, 22, 0.07) 0%, transparent 62%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 var(--sans);
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 110% 65% at 50% -6%, rgba(46, 150, 76, 0.12) 0%, transparent 62%),
    radial-gradient(ellipse 85% 58% at 50% 100%, rgba(28, 47, 34, 0.05) 0%, transparent 62%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(111, 211, 148, 0.3); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 6px; }

/* ---------- Typografie ---------- */
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-sub); }
.eyebrow.silver { color: var(--accent-bright); }
h1.display, .display { font-family: var(--sans); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; font-size: clamp(26px, 3.2vw, 32px); margin: 6px 0 0; }
h2 { font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-sub); margin: 0; }
h3 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
/* Früher Didot — jetzt die fette Sans der App-Familie (Größen aus den Ansichten bleiben) */
.serif { font-family: var(--sans) !important; font-weight: 800 !important; letter-spacing: -0.025em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Rahmen ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 18px;
  background: var(--surface-2); border-right: 1px solid var(--border);
  backdrop-filter: blur(40px) saturate(160%); -webkit-backdrop-filter: blur(40px) saturate(160%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand img { width: 34px; height: 34px; opacity: 0.92; }
:root[data-theme="light"] .brand img, :root[data-theme="light"] .topbar img { filter: brightness(0.55) contrast(1.2); }
.brand .t { line-height: 1.2; }
.brand .t .eyebrow { font-size: 8.5px; letter-spacing: 0.24em; }
.brand .t b { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; display: block; }
.searchbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface-input); color: var(--placeholder); cursor: pointer; text-align: left; font-size: 13.5px;
  transition: border-color var(--ease), color var(--ease);
}
.searchbtn:hover { border-color: var(--border-mid); color: var(--text-sub); }
.searchbtn kbd { margin-left: auto; font: 11px var(--sans); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text-dim); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r); color: var(--text-sub);
  font-size: 14px; font-weight: 500; transition: background var(--ease), color var(--ease);
}
.nav a svg { width: 16px; height: 16px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent-bright); font-weight: 600; }
.nav a .badge { margin-left: auto; padding: 0 7px; font-size: 11px; border: 0; background: var(--surface); color: var(--text-2); }
.nav a .badge.bad { background: rgba(240, 138, 143, 0.14); color: var(--rose); }
.nav a.on .badge { background: var(--accent-soft); color: var(--accent-bright); }
.nav .sep { height: 1px; background: var(--border); margin: 10px 8px; }
.side .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; padding: 0 4px; }

main { min-width: 0; }
main > .wrap { max-width: 1280px; margin: 0 auto; padding: 30px clamp(16px, 3vw, 40px) 80px; animation: enter var(--ease-enter) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar, .tabbar { display: none; }

/* ---------- Karten & Raster ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-2xl); box-shadow: var(--shadow);
  padding: 20px 22px; min-width: 0;
}
.card.flat { background: var(--surface-2); box-shadow: none; border-radius: var(--r-lg); }
a.card:hover { border-color: var(--border-mid); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .r { display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1180px) { .main-side { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--border); margin: 14px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; min-height: 38px;
  border-radius: var(--r); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--text);
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.005em; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background var(--ease), border-color var(--ease), filter var(--ease), transform 100ms ease;
}
/* :where() hält die Spezifität bei 0, damit .btn.primary / .btn.ghost im Hellmodus gewinnen */
:where(:root[data-theme="light"]) .btn { background: rgba(255, 255, 255, 0.7); }
.btn:hover { background: rgba(255, 255, 255, 0.075); border-color: var(--border-mid); }
:where(:root[data-theme="light"]) .btn:hover { background: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.forest {
  border: 0; color: var(--btn-text); font-weight: 700;
  background: linear-gradient(180deg, var(--btn-from) 0%, var(--btn-mid) 52%, var(--btn-to) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 -1px 0 rgba(0, 0, 0, 0.25) inset, 0 8px 24px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.btn.primary:hover, .btn.forest:hover { filter: brightness(1.07); background: linear-gradient(180deg, var(--btn-from) 0%, var(--btn-mid) 52%, var(--btn-to) 100%); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-sub); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn.sm { padding: 5px 10px; min-height: 31px; font-size: 12.5px; border-radius: 11px; }
.btn.lg { padding: 12px 20px; min-height: 48px; font-size: 14.5px; border-radius: var(--r); }
.btn.danger { color: var(--rose); }
.btn.icon { padding: 0; width: 36px; min-height: 36px; border-radius: 12px; }
.btn.icon.sm { width: 31px; min-height: 31px; border-radius: 10px; }
.btn[disabled], .btn.disabled { opacity: 0.42; pointer-events: none; }
.btn svg, .ic { width: 16px; height: 16px; flex: none; }
.btn.lg svg { width: 18px; height: 18px; }

/* ---------- Chips, Badges, Score ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-sub); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; min-height: 34px;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.chip:hover { border-color: var(--border-mid); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: rgba(111, 211, 148, 0.35); color: var(--accent-bright); font-weight: 600; }
:root[data-theme="light"] .chip.on { border-color: rgba(42, 138, 76, 0.35); }
.chip.big { padding: 10px 16px; min-height: 46px; font-size: 14px; border-radius: var(--r); color: var(--text); }
.chip.big.good { border-color: rgba(111, 211, 148, 0.4); }
.chip.big.bad { border-color: rgba(240, 138, 143, 0.35); }
.chip.big.on { color: var(--accent-bright); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); white-space: nowrap; line-height: 1.55;
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.s-neu { color: var(--blue); }
.badge.s-kontaktiert { color: var(--text-sub); }
.badge.s-gespraech { color: var(--teal); }
.badge.s-muster { color: var(--sage); }
.badge.s-angebot { color: var(--amber); }
.badge.s-partner, .badge.s-aktiv { color: var(--accent-bright); background: var(--accent-soft); border-color: transparent; }
.badge.a-verloren, .badge.a-passt_nicht { color: var(--rose); }
.badge.a-wiedervorlage { color: var(--amber); }
.badge.a-dublette, .badge.a-beendet { color: var(--text-dim); }
.badge.warn { color: var(--amber); }
.badge.bad { color: var(--rose); }
.badge.good { color: var(--sage); }
.badge.solid { background: var(--accent-soft); color: var(--accent-bright); border-color: transparent; }
.score { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 8px; font-size: 12px; font-weight: 800; border: 1px solid var(--border-mid); color: var(--text-2); font-variant-numeric: tabular-nums; }
.score.s9, .score.s10 { background: linear-gradient(180deg, var(--btn-from), var(--btn-mid)); color: var(--btn-text); border: 0; }
.score.s8 { border-color: rgba(111, 211, 148, 0.5); color: var(--accent-bright); }
.score.u { color: var(--text-dim); border-style: dashed; font-weight: 500; }

/* ---------- Formulare ---------- */
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=date], input[type=time], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-input);
  color: var(--text); min-height: 42px; outline: none; transition: border-color var(--ease), box-shadow var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3.5px var(--accent-glow); }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%), linear-gradient(135deg, var(--text-sub) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-sub); font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
label.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.form { display: grid; gap: 16px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Listen & Tabellen ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--border); min-width: 0; flex-wrap: wrap; row-gap: 8px; }
.item:first-child { border-top: 0; }
.item .main { flex: 1 1 200px; min-width: 0; }
.item .main .t { font-weight: 600; display: flex; gap: 8px; align-items: center; min-width: 0; }
.item .main .s { font-size: 13px; color: var(--muted); margin-top: 1px; }
.item .acts { display: flex; gap: 6px; flex: none; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.item.link { cursor: pointer; border-radius: 12px; transition: background var(--ease); }
.list > .item { border-top: 0; position: relative; }
.list > .item + .item::before { content: ""; position: absolute; left: 6px; right: 6px; top: 0; height: 1px; background: var(--border); }
.item.top { align-items: flex-start; }
.item.top > .muted:first-child { padding-top: 2px; }
.item.link:hover { background: var(--surface-2); }
.due { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.over { color: var(--rose); }
.due.today { color: var(--amber); }
.due.later { color: var(--text-dim); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--surface-2); }
.tbl td.r, .tbl th.r { text-align: right; }

.empty { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .serif, .empty .t { font-size: 17px !important; font-weight: 700; color: var(--text-2); display: block; margin-bottom: 4px; letter-spacing: -0.015em; }
.empty .act { margin-top: 14px; }

/* ---------- Kennzahlen ---------- */
.stat { padding: 16px 18px; border-radius: var(--r-lg); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 4px; letter-spacing: 0; }
.bar { height: 6px; border-radius: 6px; background: var(--track); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--fill); border-radius: 6px; box-shadow: 0 0 12px var(--accent-glow); }
.goal { display: flex; align-items: center; gap: 22px; padding: 18px 22px; flex-wrap: wrap; }
.goal .g { flex: 1; min-width: 220px; }
.goal .g .row { justify-content: space-between; }

/* Stufen-Pfeile */
.pfeile { display: flex; gap: 3px; margin-top: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pfeil {
  flex: 1 0 auto; padding: 8px 14px 8px 18px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--surface-2); color: var(--text-dim); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
  white-space: nowrap; text-align: center;
}
.pfeil:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: 12px; border-radius: 10px 0 0 10px; }
.pfeil.done { background: var(--accent-soft); color: var(--accent-bright); }
.pfeil.on { background: linear-gradient(180deg, var(--btn-from), var(--btn-mid)); color: var(--btn-text); }
button.pfeil { border: 0; font-family: inherit; cursor: pointer; transition: filter .15s ease; }
button.pfeil:hover:not(.on) { filter: brightness(1.18); color: var(--text); }
button.pfeil:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: -2px; }
.pfeile-info { margin-top: 6px; }
.pfeile-info button.lnk { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pcard[draggable="true"] { cursor: grab; }
.pcard.ziehend { opacity: .45; }
.leerlauf-uhr { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); padding: 4px 6px; border-radius: 8px; white-space: nowrap; }
.leerlauf-uhr[hidden] { display: none; }
.leerlauf-uhr svg { width: 14px; height: 14px; }
.leerlauf-uhr.knapp { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.board .col.drop-ziel { outline: 2px dashed var(--accent-bright); outline-offset: -4px; border-radius: 14px; background: var(--accent-soft); }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.kachel { padding: 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.kachel:hover { border-color: var(--border-mid); background: var(--surface); }
.kachel .n { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kachel .m { font-size: 12px; color: var(--text-dim); }

/* Pipeline-Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 12px; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding: 2px 4px; }
.col-head .n { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pcard { padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 8px; background: var(--surface); cursor: pointer; transition: border-color var(--ease), transform var(--ease); }
.pcard:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.pcard .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pcard .s { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Verlauf */
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 30px 1fr; gap: 11px; padding: 11px 0; border-top: 1px solid var(--border); }
.tl:first-child { border-top: 0; }
.tl .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-sub); }
.tl .ico svg { width: 14px; height: 14px; }
.tl .h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl .h b { font-weight: 600; font-size: 14px; }
.tl .h .when { font-size: 12px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }
.tl .b { font-size: 14px; color: var(--text-2); white-space: pre-wrap; margin-top: 2px; word-break: break-word; }
.tl .x { opacity: 0; transition: opacity var(--ease); }
.tl:hover .x { opacity: 1; }

/* Akte */
.akte-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.akte-head .title { min-width: 0; flex: 1; }
.actionbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.kv { display: grid; grid-template-columns: 124px 1fr; gap: 7px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-dim); font-size: 12.5px; padding-top: 2px; }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.brief { font-size: 14px; color: var(--text-2); }
.brief .held { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--text); line-height: 1.35; margin: 4px 0 12px; }
.brief ol { margin: 6px 0 0; padding-left: 18px; }
.brief li { margin: 5px 0; }
.brief .ew { margin-top: 10px; padding: 11px 13px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface-2); }
.brief .ew b { color: var(--text); }

/* Anrufliste */
.dialer { max-width: 900px; margin: 0 auto; }
.dial-card { padding: 26px 28px; }
.dial-card .name { font-size: clamp(26px, 4.2vw, 36px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 8px 0 6px; }
.callbtn { width: 100%; margin-top: 20px; font-size: 16px; min-height: 58px; border-radius: 16px; }
.progress { display: flex; gap: 3px; margin: 14px 0 22px; }
.progress i { flex: 1; height: 4px; background: var(--track); border-radius: 4px; }
.progress i.done { background: var(--accent); opacity: 0.55; }
.progress i.cur { background: var(--accent-bright); box-shadow: 0 0 10px var(--accent-glow); }

/* ---------- Dialoge, Toasts ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fade .15s ease; }
:root[data-theme="light"] .scrim { background: rgba(20, 40, 32, 0.28); }
.sheet {
  width: min(620px, 100%); max-height: 84vh; overflow: auto; background: var(--popup-bg); border: 1px solid var(--border-mid);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-pop); padding: 22px 24px; animation: rise .2s cubic-bezier(0.22, 1, 0.36, 1);
}
.sheet.wide { width: min(860px, 100%); }
.sheet-head > div { min-width: 0; }
.sheet-title { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin: 4px 0 0; overflow-wrap: anywhere; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.99); } }
.toasts { position: fixed; right: 20px; bottom: 92px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--popup-bg); border: 1px solid var(--border-mid); border-radius: var(--r); padding: 11px 14px; box-shadow: var(--shadow-pop); display: flex; gap: 14px; align-items: center; font-size: 14px; animation: rise .2s ease; max-width: 420px; }
.toast.err { border-color: rgba(240, 138, 143, 0.5); }
.toast button { background: none; border: 0; color: var(--accent-bright); font-weight: 700; cursor: pointer; font-size: 13px; padding: 4px 2px; }

.search-box input { font-size: 17px; padding: 14px 16px; min-height: 52px; border-radius: var(--r); }
.search-results { margin-top: 10px; }
.search-results .grp { margin-top: 16px; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text-sub); border-radius: 10px; white-space: nowrap; cursor: pointer; transition: background var(--ease), color var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--accent-soft); color: var(--accent-bright); }
.tabs a .n { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: 0.62; }

.note { padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.note.ok { border-left-color: var(--accent); }
.note.info { border-left-color: var(--blue); }
.note.bad { border-left-color: var(--rose); }
.liste { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
[aria-invalid="true"] { border-color: var(--rose) !important; }
/* Eingaben in Formular-Labels nicht fett erben */
label.f > input, label.f > select, label.f > textarea, label.f .xs, label.f .small { font-weight: 400; }
/* SELLINA-Bubble nicht über offenen Fenstern (Eingabe, Speichern-Leiste) */
body:has(.scrim) .sl-wurzel:not(.offen) { display: none; }
pre.mail { white-space: pre-wrap; font: 14px/1.55 var(--sans); background: var(--surface-input); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin: 0; max-height: 46vh; overflow: auto; }

.hbars .r { display: grid; grid-template-columns: 170px 1fr 54px; gap: 12px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.hbars .r .b { height: 10px; background: var(--track); border-radius: 6px; overflow: hidden; }
.hbars .r .b i { display: block; height: 100%; background: var(--fill); border-radius: 6px; }
.vbars { display: flex; gap: 8px; align-items: flex-end; height: 150px; padding-top: 10px; }
.vbars .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.vbars .c .b { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; }
.vbars .c .b i { display: block; }
.vbars .c .l { font-size: 11px; color: var(--text-dim); }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.hide { display: none !important; }

/* ---------- Gemeinsame Bausteine (aus dem Design-Review) ---------- */
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; flex-wrap: wrap; -webkit-tap-highlight-color: transparent; }
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }
details:not(.disclosure) > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--text-sub); border-bottom: 1.6px solid var(--text-sub); transform: rotate(-45deg); transition: transform var(--ease); flex: none; margin-right: 2px; }
details:not(.disclosure)[open] > summary::before { transform: rotate(45deg); }
details.disclosure > summary { min-height: 44px; }
.lnk { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-dim); transition: text-decoration-color var(--ease); }
.lnk:hover { text-decoration-color: currentColor; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.fill { flex: 1; min-width: 0; }
.goal .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.goal .v small { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 4px; letter-spacing: 0; }
.hbars .r.flow { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 5px; padding: 6px 0; }
.hbars .r.flow .l { flex: 1 0 12.5em; min-width: 0; line-height: 1.3; overflow-wrap: break-word; }
.hbars .r.flow .l small { display: block; font-size: 12px; color: var(--muted); }
.hbars .r.flow .v { flex: none; width: 3.2em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars .r.flow .v.wide { width: 4.8em; }
.hbars .r.flow .p { flex: none; width: 3.6em; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbars .r.flow .b { flex: 999 1 8em; }
.hbars .r.flow .v.wide ~ .b { flex-basis: 11em; }
a.r.flow { border-radius: var(--r-sm); }
a.r.flow:hover { background: var(--surface-2); }
.dial-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dial-layout > .dial-main { flex: 999 1 440px; min-width: 0; }
.dial-layout > .dial-aside { flex: 1 1 360px; min-width: 0; }
.dial-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.dial-pair .btn { min-width: 0; padding-left: 12px; padding-right: 12px; }
.dial-more { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dial-more .btn { flex: 1 1 auto; min-height: 40px; }
.dial-card .name { overflow-wrap: break-word; }
.dial-card .name.long { font-size: clamp(22px, 2.6vw, 28px); }

/* ---------- SELLINA (KI-Assistenz) ---------- */
.sl-wurzel { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.sl-bubble {
  display: flex; align-items: center; gap: 9px; height: 56px; padding: 0 20px 0 17px; border: 0; border-radius: 999px; cursor: pointer;
  color: var(--btn-text); font: 700 14px var(--sans); letter-spacing: 0.06em;
  background: linear-gradient(180deg, var(--btn-from) 0%, var(--btn-mid) 52%, var(--btn-to) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 -1px 0 rgba(0, 0, 0, 0.25) inset, 0 10px 30px var(--accent-glow), 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform var(--ease), filter var(--ease);
}
.sl-bubble svg { width: 20px; height: 20px; }
.sl-bubble:hover { filter: brightness(1.07); transform: translateY(-1px); }
.sl-wurzel.offen .sl-bubble { display: none; }
.sl-panel {
  position: absolute; right: 0; bottom: 0; width: min(420px, calc(100vw - 44px)); height: min(640px, calc(100vh - 44px));
  display: none; flex-direction: column; background: var(--popup-bg); border: 1px solid var(--border-mid); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-pop); overflow: hidden; animation: rise .22s cubic-bezier(0.22, 1, 0.36, 1);
}
.sl-wurzel.offen .sl-panel { display: flex; }
.sl-kopf { display: flex; align-items: center; gap: 11px; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.sl-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: var(--btn-text); background: linear-gradient(180deg, var(--btn-from), var(--btn-to)); box-shadow: 0 6px 16px var(--accent-glow); flex: none; }
.sl-titel { flex: 1; min-width: 0; line-height: 1.25; }
.sl-titel b { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.08em; }
.sl-titel span { font-size: 12px; color: var(--text-sub); }
.sl-kontext { padding: 8px 16px 0; }
.sl-kontext:empty { display: none; }
.sl-kontext .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sl-nachrichten { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.sl-leer { color: var(--text-2); font-size: 14px; }
.sl-hallo { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin: 6px 0 4px; }
.sl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sl-chips .chip { font-size: 12.5px; min-height: 32px; padding: 5px 11px; white-space: normal; text-align: left; }
.sl-msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.sl-msg p { margin: 0 0 6px; }
.sl-msg p:last-child { margin-bottom: 0; }
.sl-msg ul { margin: 4px 0 8px; padding-left: 18px; }
.sl-msg li { margin: 2px 0; }
.sl-ich { align-self: flex-end; background: var(--accent-soft); color: var(--text); border-bottom-right-radius: 6px; }
.sl-sie { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; max-width: 100%; }
.sl-sag { font-size: 15.5px; font-weight: 600; color: var(--text); padding: 8px 10px 8px 12px; margin: -2px -4px 8px !important; border-left: 3px solid var(--accent-bright); background: var(--accent-dim); border-radius: 8px; }
.sl-achtung { color: var(--amber); font-size: 13px; }
.sl-quellen { color: var(--text-dim); font-size: 12px; }
.sl-fehler { border-color: rgba(240, 138, 143, 0.4); color: var(--rose); }
.sl-aktionen { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.sl-tippt { display: inline-flex; gap: 4px; padding: 4px 0; }
.sl-tippt i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-sub); animation: tippt 1.2s infinite ease-in-out; }
.sl-tippt i:nth-child(2) { animation-delay: .15s; } .sl-tippt i:nth-child(3) { animation-delay: .3s; }
@keyframes tippt { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.sl-eingabe { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; border-top: 1px solid var(--border); }
.sl-eingabe textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 14px; padding: 11px 13px; line-height: 1.4; }
.sl-eingabe .btn.icon { width: 44px; min-height: 44px; border-radius: 14px; flex: none; }
.sl-hinweis { font-size: 11px; color: var(--text-dim); padding: 0 16px 10px; }

/* ---------- iPhone ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
    background: var(--bar-bg); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); border-bottom: 1px solid var(--border);
  }
  .topbar img { width: 28px; height: 28px; opacity: 0.92; }
  .topbar b { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 4px 4px calc(var(--safe-b) + 4px); background: var(--bar-bg); backdrop-filter: blur(32px) saturate(160%); -webkit-backdrop-filter: blur(32px) saturate(160%);
    border-top: 1px solid var(--border);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 10px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.03em; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent-bright); }
  .tabbar a .badge { position: absolute; top: 2px; left: 54%; padding: 0 5px; font-size: 10px; line-height: 16px; background: var(--accent); color: var(--btn-text); border: 0; }
  main > .wrap { padding: 18px 14px calc(160px + var(--safe-b)); }
  .shell { align-content: start; }
  .btn { min-height: 42px; }
  .btn.sm { min-height: 36px; }
  .btn.icon { width: 40px; min-height: 40px; }
  .btn.icon.sm { width: 38px; min-height: 38px; }
  .item .acts .btn.sm { min-height: 40px; padding: 8px 12px; font-size: 13.5px; border-radius: 12px; }
  .item .acts .btn.icon.sm { width: 40px; min-height: 40px; padding: 0; }
  .pagehead .actions { width: 100%; }
  .actionbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
  .actionbar > .btn:nth-child(-n+2) { min-height: 48px; font-size: 14.5px; }
  .actionbar > .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tabs { width: 100%; }
  .tabs a { flex: 1 0 auto; text-align: center; padding: 10px 8px; min-height: 40px; }
  .chips .chip { min-height: 40px; }
  .sheet .sheet-foot { position: sticky; bottom: calc(-18px - var(--safe-b)); margin: 20px -18px calc(-18px - var(--safe-b)); padding: 12px 18px calc(12px + var(--safe-b)); background: var(--popup-bg); border-top: 1px solid var(--border); z-index: 1; }
  .sheet .sheet-foot .btn { flex: 1 1 0; min-height: 48px; font-size: 15px; }
  .goal .v { font-size: 26px; }
  .sl-wurzel { right: 14px; bottom: calc(74px + var(--safe-b)); }
  .sl-bubble { height: 52px; padding: 0 16px 0 14px; }
  .sl-wurzel.offen { inset: 0; right: 0; bottom: 0; }
  .sl-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: var(--safe-b); animation: up .24s cubic-bezier(0.22, 1, 0.36, 1); }
  .sl-eingabe textarea { font-size: 16px; }
  .g2, .g3, .main-side { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 16px; border-radius: 20px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 25px; margin-top: 6px; }
  .stat .eyebrow { letter-spacing: 0.16em; font-size: 9.5px; }
  .goal { padding: 14px 16px; gap: 14px; }
  .pagehead { margin-bottom: 16px; }
  .pagehead .actions .btn.lg { width: 100%; }
  .scrim { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up .24s cubic-bezier(0.22, 1, 0.36, 1); }
  .sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--border-mid); margin: -6px auto 12px; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
  .toasts { left: 12px; right: 12px; bottom: calc(78px + var(--safe-b)); }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { display: inline; border: 0; padding: 0 6px 0 0; }
  .tbl.cards td.t { display: block; font-weight: 600; margin-bottom: 4px; }
  .tbl.cards td.hide-m { display: none; }
  .hbars .r { grid-template-columns: 110px 1fr 44px; }
  .form .two { grid-template-columns: 1fr; }
  .dial-card { padding: 20px 18px; }
  .kv { grid-template-columns: 104px 1fr; }
  .hide-m { display: none !important; }
  input[type=text], input[type=email], input[type=tel], input[type=url], input[type=search], input[type=number], input[type=password], select, textarea { font-size: 16px; } /* kein iOS-Zoom */
}
@media (min-width: 901px) { .only-m { display: none !important; } }
@media (max-width: 520px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Login (Familie der NF-Logins: Hub rot, OS blau, CRM grün) ---------- */
body.lg-body {
  background: #060a07;
  background-image:
    radial-gradient(110% 65% at 50% -6%, rgba(46, 150, 76, 0.18) 0%, transparent 62%),
    radial-gradient(52% 32% at 50% 0, rgba(120, 200, 140, 0.08) 0%, transparent 42%),
    radial-gradient(170% 65% at 50% 46%, rgba(24, 64, 44, 0.06) 0%, transparent 72%),
    radial-gradient(85% 58% at 50% 100%, rgba(10, 40, 22, 0.08) 0%, transparent 62%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  --lg-text: #eef4f0; --lg-sub: rgba(238, 244, 240, 0.72); --lg-dim: rgba(238, 244, 240, 0.4);
  --lg-card: rgba(255, 255, 255, 0.04); --lg-border: rgba(255, 255, 255, 0.08); --lg-input: rgba(0, 0, 0, 0.34);
  --lg-err: #f08a8f;
}
:root[data-theme="light"] body.lg-body {
  background: #e9eeed;
  background-image:
    radial-gradient(110% 65% at 50% -6%, rgba(46, 150, 76, 0.16) 0%, transparent 62%),
    radial-gradient(85% 58% at 50% 100%, rgba(28, 47, 34, 0.06) 0%, transparent 62%);
  --lg-text: #141e1a; --lg-sub: rgba(20, 30, 26, 0.68); --lg-dim: rgba(20, 30, 26, 0.42);
  --lg-card: rgba(255, 255, 255, 0.72); --lg-border: rgba(20, 40, 32, 0.1); --lg-input: rgba(255, 255, 255, 0.9);
  --lg-err: #b33a3f;
}
.lg-main { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.lg-card {
  width: 100%; max-width: 400px; text-align: center; padding: 28px; border-radius: 28px; color: var(--lg-text);
  background: var(--lg-card); border: 1px solid var(--lg-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 40px 80px rgba(0, 0, 0, 0.7), 0 12px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
:root[data-theme="light"] .lg-card { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 30px 60px rgba(20, 40, 32, 0.12), 0 8px 24px rgba(20, 40, 32, 0.08); }
.lg-logo { display: block; height: 56px; width: 56px; margin: 0 auto 1.1rem; opacity: 0.92; }
:root[data-theme="light"] .lg-logo { filter: brightness(0.55) contrast(1.2); }
.lg-brand { margin: 0; font-size: 9px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--lg-sub); }
.lg-title { margin: 6px 0; font-size: 30.4px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.5; color: var(--lg-text); font-family: inherit; }
.lg-sub { margin: 0; font-size: 15px; color: var(--lg-sub); line-height: 1.45; }
.lg-sub strong { color: var(--lg-text); }
.lg-form { display: grid; gap: 12px; text-align: left; }
.lg-form input {
  width: 100%; min-height: 49px; padding: 12.8px 16px; border-radius: 14px; border: 1px solid var(--lg-border);
  background: var(--lg-input); color: var(--lg-text); font: inherit; font-size: 16px; outline: none; box-shadow: none;
  transition: border-color 180ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lg-form input::placeholder { color: var(--lg-dim); }
.lg-form input:focus { border-color: rgba(120, 200, 140, 0.55); box-shadow: 0 0 0 3px rgba(46, 150, 76, 0.18); }
.lg-form input.lg-code { text-align: center; letter-spacing: 0.35em; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lg-btn {
  min-height: 47px; padding: 12.8px 17.6px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.01em; color: #f3fff6;
  background: linear-gradient(#5fbf7c 0%, #2e9650 52%, #1c5f34 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 -1px 0 rgba(0, 0, 0, 0.25) inset, 0 8px 28px rgba(46, 150, 76, 0.3), 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: filter 180ms ease, transform 100ms ease, opacity 180ms ease;
}
.lg-btn:hover { filter: brightness(1.06); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn[disabled] { opacity: 0.55; cursor: default; filter: none; transform: none; }
.lg-links { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lg-ghost {
  background: none; border: 1px solid var(--lg-border); border-radius: 14px; padding: 0.55rem 1rem; font: inherit; font-size: 13px;
  color: var(--lg-sub); cursor: pointer;
}
.lg-ghost[disabled] { color: var(--lg-dim); cursor: default; }
.lg-err { margin: 2px 0 0; font-size: 13px; color: var(--lg-err); text-align: center; }
.lg-foot { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 11.5px; color: var(--lg-dim); }
.lg-foot a { color: var(--lg-sub); opacity: 0.8; }
.lg-foot a:hover { opacity: 1; text-decoration: underline; }

/* Leerlauf: Hinweis vor der automatischen Abmeldung */
.leerlauf-hinweis { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b, 0px)); transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); font-size: 14px; animation: fade .15s ease; }
.leerlauf-hinweis .fill { flex: 1; min-width: 0; }
.lg-info { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; }
@media (max-width: 900px) { .leerlauf-hinweis { bottom: calc(84px + var(--safe-b, 0px)); flex-wrap: wrap; } }

/* Absatzziel (Heute): Farbe am zeitanteiligen Soll, Strich = Soll bis heute */
.bar { position: relative; }
.bar > b.soll { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.55; }
.bar.gelb > i { background: var(--amber); box-shadow: none; }
.bar.rot > i { background: var(--rose); box-shadow: none; }
.absatz-zeile .bar { margin-top: 8px; }
.absatz-zeile.gross .bar { height: 12px; border-radius: 8px; }
.absatz-zeile.gross .num { font-size: 22px; font-weight: 800; }
.absatz-zeile .row { gap: 8px; align-items: baseline; }
.absatz-teile { gap: 14px 22px; }
.absatz-jahr { padding-top: 14px; border-top: 1px solid var(--border); }
.absatz-lager { padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.lager-teile { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.lager-teil { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

