/* Customer-Template-Stylesheet. Farben sind neutrale Vorgaben; die Instanz setzt sie zur Laufzeit
   aus branding.colors (instance.json). Keine kundenspezifischen Werte in dieser Datei. */
:root {
  --bg: #0f0f10; --surface: #18181b; --surface-2: #212125; --line: #2d2d32;
  --text: #ecebe7; --muted: #9a988f; --accent: #c8c8c8; --accent-ink: #111;
  --red: #d9534f; --orange: #e8913a; --grey: #8d8c88; --green: #6fae7f;
  --radius: 10px; --radius-s: 6px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --side-w: 232px; --top-h: 60px; --bottom-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: .01em; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; margin: .75rem 0 .35rem; }
a { color: inherit; }
p { margin: .4rem 0; }
code { font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.hint { color: var(--muted); font-size: .85rem; }
.warn { color: var(--orange); }
.over { color: var(--red); }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.break { word-break: break-all; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; color: var(--accent); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; min-height: 32px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; z-index: 100; background: var(--surface); padding: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wordmark { font-family: var(--serif); letter-spacing: .28em; font-size: 1rem; color: var(--accent); text-transform: uppercase; white-space: nowrap; }
.logo { max-height: 32px; max-width: 180px; }

/* ------------------------------ Layout ------------------------------ */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.side-brand { height: var(--top-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--muted); min-height: 40px; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); }
.side-nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top { position: sticky; top: 0; z-index: 15; margin-left: var(--side-w); height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-brand { display: none; }
.main { margin-left: var(--side-w); padding: 24px 28px 48px; max-width: 1500px; outline: none; }
.main[aria-busy=true] { opacity: .7; transition: opacity .2s .15s; }
.bottom { display: none; }

.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; }
.search-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 70vh; overflow-y: auto; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 6px; z-index: 30; }
.sr-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 8px 10px 4px; }
.sr { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 9px 10px; border-radius: var(--radius-s); text-decoration: none; min-height: 44px; }
.sr:hover, .sr:focus { background: var(--surface-2); }
.sr-empty { padding: 10px; color: var(--muted); }

.page-head { margin-bottom: 18px; }
.page-head .back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 6px; font-size: .9rem; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap, .wrap { flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 420px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }

/* ------------------------------ Bausteine ------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.grid-2 > .card, .grid-dash > .card { margin-bottom: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-h h3 { color: var(--text); }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }
.sub-h { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sub-h.over { color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 500 .92rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn-block { width: 100%; }
.icon-btn { min-width: 40px; min-height: 40px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: var(--radius-s); cursor: pointer; font-size: 1rem; }
.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
.icon-btn:disabled { opacity: .3; }

input, select, textarea { font: 16px/1.3 var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 11px; min-height: 42px; width: 100%; max-width: 100%; }
textarea { resize: vertical; min-height: 64px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field-l { font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.field-h { font-size: .78rem; color: var(--muted); }
.field.inline, label.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .85rem; }
label.inline input { width: auto; }
.check { display: flex; gap: 10px; align-items: center; margin: 6px 0 10px; min-height: 40px; cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.pill.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.pill.no { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.pill.warn { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.banner.warn { border-color: color-mix(in srgb, var(--orange) 50%, var(--line)); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.scroll { max-height: 55vh; overflow: auto; word-break: break-word; }
.banner { padding: 10px 14px; border-radius: var(--radius-s); border: 1px solid color-mix(in srgb, var(--red) 50%, var(--line)); background: color-mix(in srgb, var(--red) 10%, var(--surface)); margin-bottom: 12px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--bg); }
.seg.wrap { flex-wrap: wrap; }
.seg-b, .seg-i span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; background: transparent; border: 0; color: var(--muted); font: 500 .85rem var(--sans); cursor: pointer; }
.seg.small .seg-b { min-height: 32px; padding: 4px 10px; }
.seg-b.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg-i { position: relative; }
.seg-i input { position: absolute; opacity: 0; pointer-events: none; }
.seg-i input:checked + span { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.seg-i.prio-high input:checked + span { box-shadow: inset 0 -2px 0 var(--red); color: var(--red); }
.seg-i.prio-medium input:checked + span { box-shadow: inset 0 -2px 0 var(--orange); color: var(--orange); }
.seg-i.prio-low input:checked + span { box-shadow: inset 0 -2px 0 var(--grey); }
.seg-i input:focus-visible + span { outline: 2px solid var(--accent); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input { width: auto; min-width: 140px; }
.filter-wrap { margin-bottom: 14px; }
.filter-wrap summary { cursor: pointer; color: var(--muted); padding: 6px 0; min-height: 36px; }
.filter-wrap[open] summary { margin-bottom: 8px; }

/* Sterne */
.stars { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; flex: none; }
.star { color: #4a4945; font-size: 1.25rem; line-height: 1; background: none; border: 0; padding: 0 1px; }
button.star { cursor: pointer; min-width: 32px; min-height: 36px; font-size: 1.45rem; }
.star.on { color: var(--accent); }
.stars.xs .star { font-size: .8rem; }
.stars-none { color: var(--muted); font-size: .75rem; margin-left: 6px; }

/* Prioritaet / Faelligkeit / Phase */
.prio { flex: none; white-space: nowrap; display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 4px; font-weight: 600; letter-spacing: .02em; border: 1px solid currentColor; }
.prio-high { color: var(--red); }
.prio-medium { color: var(--orange); }
.prio-low { color: var(--grey); }
.due { font-size: .82rem; color: var(--muted); }
.due.today { color: var(--orange); font-weight: 600; }
.due.over { color: var(--red); font-weight: 600; }
.due.none { font-style: italic; }
.stage-badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.stage-badge.role-won { color: var(--green); }
.stage-badge.role-lost { color: var(--muted); text-decoration: line-through; }
.stage-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stage-bar select { width: auto; min-width: 200px; }

/* Ziele & Kennzahlen */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.goal.year { grid-column: span 2; }
.goal-l { font-size: .78rem; color: var(--muted); min-height: 2.4em; }
.goal-v { font-family: var(--serif); margin: 4px 0 8px; }
.goal-v .ist { font-size: 1.7rem; }
.goal-v .soll { color: var(--muted); }
.goal.reached .ist { color: var(--accent); }
progress.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--surface-2); }
progress.bar::-webkit-progress-value { background: var(--accent); }
progress.bar::-moz-progress-bar { background: var(--accent); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface-2); border-radius: var(--radius-s); padding: 12px; min-width: 0; }
.kpi-l { font-size: .78rem; color: var(--muted); }
.kpi-v { font-family: var(--serif); font-size: 1.3rem; margin-top: 2px; overflow-wrap: anywhere; }
.kpi-s { font-size: .75rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list-i { display: flex; justify-content: space-between; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 4px; min-height: 44px; }
.list-i:last-child { border-bottom: 0; }
.list-i:hover { background: var(--surface-2); }
.list-i > div { min-width: 0; }
.list-i > .right { flex: 0 0 auto; white-space: nowrap; } /* Betrag nie in die Zeile quetschen (sonst ragt er bei schmalen Viewports ueber den Rand) */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; color: var(--accent-ink); cursor: pointer; position: relative; }
.task-check::before { content: ""; position: absolute; inset: -8px; }
.task.done .task-check { background: var(--accent); border-color: var(--accent); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.task.done .task-title span:last-child { text-decoration: line-through; color: var(--muted); }
.task-sub { font-size: .82rem; color: var(--muted); }
.tasks.big .task { padding: 12px 4px; }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tfoot td { border-bottom: 0; border-top: 1px solid var(--line); }
.table.compact td { padding: 6px 8px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.inactive td { opacity: .55; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; margin: 10px 0; }
.st-duplicate td, .st-duplicate_in_file td { background: color-mix(in srgb, var(--orange) 6%, transparent); }
.st-invalid td { background: color-mix(in srgb, var(--red) 7%, transparent); }
details > summary { cursor: pointer; }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.col { flex: 0 0 272px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-snap-align: start; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.col.role-won { border-top: 2px solid var(--green); }
.col.role-lost { opacity: .85; }
.col-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 500; }
.col-h > span:first-child { flex: 1 1 100%; font-family: var(--serif); }
.col-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -4px; color: inherit; }
.deal-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 11px; cursor: grab; display: flex; flex-direction: column; gap: 4px; }
.deal-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.deal-card.dragging { opacity: .45; }
.deal-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.deal-card-top strong { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.stars.xs .stars-none { font-size: .68rem; margin-left: 3px; }
.deal-card-sub { font-size: .82rem; color: var(--muted); }
.deal-card-meta { display: flex; justify-content: space-between; font-size: .85rem; font-variant-numeric: tabular-nums; }
.deal-card-next { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 4px; }
.deal-card-next.warn { color: var(--orange); }

/* Timeline / Verlauf */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.tl { position: relative; padding: 0 0 14px 12px; }
.tl::before { content: ""; position: absolute; left: -19px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--muted); }
.tl-meeting::before { border-color: var(--accent); background: var(--accent); }
.tl-status::before { border-color: var(--line); }
.tl-h { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.tl-type { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.tl-b { margin-top: 2px; overflow-wrap: anywhere; }
.tl-status .tl-b { color: var(--muted); font-size: .88rem; }
.tl-m, .tl-o { font-size: .85rem; margin-top: 4px; }
.history { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.history li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.outreach { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.stage-list { list-style: none; margin: 0 0 10px; padding: 0; }
.stage-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stage-list li > .muted { flex: 1; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; letter-spacing: .08em; background: var(--bg); padding: 10px; border-radius: var(--radius-s); border: 1px solid var(--line); overflow-wrap: anywhere; }

/* Dialoge */
.dlg-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.dlg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.dlg-wide { width: min(860px, 100%); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.dlg-body { padding: 16px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dlg-err { margin: 0 20px 10px; padding: 8px 12px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: #f1b5b3; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.more-nav { display: flex; flex-direction: column; gap: 4px; }
.more-nav a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-s); text-decoration: none; min-height: 48px; background: var(--surface-2); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 10px 14px; border-radius: var(--radius-s); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast-err { border-left-color: var(--red); }
.toast-warn { border-left-color: var(--orange); }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .wordmark { font-size: 1.25rem; }
.login-err { color: #f1b5b3; font-size: .9rem; }

/* ------------------------------ Mobil (iPhone) ------------------------------ */
@media (max-width: 860px) {
  .side { display: none; }
  .top { margin-left: 0; padding: 0 12px; gap: 8px; padding-top: env(safe-area-inset-top, 0px); height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); }
  .top-brand { display: none; }
  .top-add .lbl { display: none; }
  .top-add { min-width: 44px; min-height: 44px; font-size: 1.3rem; padding: 0 12px; }
  .main { margin-left: 0; padding: 16px 14px calc(var(--bottom-h) + var(--safe-b) + 24px); }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  .bottom a, .bottom button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bottom-h); text-decoration: none; color: var(--muted); background: none; border: 0; font: 500 .68rem var(--sans); cursor: pointer; }
  .bottom a.active { color: var(--accent); }
  h1 { font-size: 1.45rem; }
  .row2 { grid-template-columns: 1fr; }
  .grid-dash, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .goals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .goal { padding: 10px 12px; }
  .goal.year { grid-column: 1 / -1; }
  .goal-v .ist { font-size: 1.45rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 14px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  .filters select, .filters input { flex: 1 1 140px; min-width: 0; }
  .filters label.inline { flex: 1 1 100%; }
  .col { flex-basis: 84vw; max-height: none; }
  .stage-bar select { width: 100%; }
  .stage-bar .field.inline { flex: 1 1 100%; }
  .dlg-backdrop { align-items: flex-end; padding: 0; }
  .dlg, .dlg-wide { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .dlg-foot .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--bottom-h) + var(--safe-b) + 12px); max-width: none; }
  .table th, .table td { padding: 8px 6px; }
  .page-head .row-between, .page-head.row-between { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Angebote, Auftraege, Zahlungen, Fulfillment */
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pills .pill { margin: 0; }
.stack > * + * { margin-top: 14px; }
.qi-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 4px; margin-bottom: 10px; background: var(--surface-2); }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-check { flex: 0 0 auto; width: 30px; height: 30px; min-height: 30px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--accent-ink); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.step.done .step-check { background: var(--accent); border-color: var(--accent); }
.step-check:disabled { cursor: not-allowed; opacity: .55; }
.actions-end { margin-top: 18px; justify-content: flex-end; }
.table tr.inactive td { text-decoration: line-through; opacity: .6; }
.table tr.inactive td .over { text-decoration: none; }

/* P1-B: Provisionen, Werke, Kommission */
.strike { text-decoration: line-through; }
.filters { align-items: center; gap: 12px; margin: 0 0 12px; }
.filters select { max-width: 100%; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.pills .pill { white-space: normal; }

/* AP5: Berichte, Rechner, Integrationen, Benutzer */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tabs .seg-i { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); cursor: pointer; min-height: 40px; }
.tabs .seg-i.on { border-color: var(--accent); color: var(--accent); }
.field-inline { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.field-inline input { width: auto; }
.pill.small { font-size: .68rem; padding: 0 6px; }
.kpi-s.def { opacity: .8; font-size: .7rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; }
.pad { padding: 14px; margin-bottom: 14px; }
details > summary { cursor: pointer; padding: 6px 0; min-height: 36px; }
fieldset.field { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; margin: 0 0 12px; }
@media (max-width: 760px) { .tabs { overflow-x: auto; flex-wrap: nowrap; } .tabs .seg-i { white-space: nowrap; } }
