/* ==========================================================================
   SALESROCKER OS – Designsystem Variante B
   „Ruhig & präzise“: Graphit-Navigation, warme Neutraltöne, Petrol als Akzent,
   Bernstein ausschließlich für den geschützten Finanzbereich.
   ========================================================================== */
:root {
  /* Flächen */
  --bg: #F4F3EF;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --surface-sunken: #EEEDE8;
  --nav: #15181F;
  --nav-2: #1D212A;
  --nav-text: #A8ADB8;
  --nav-text-strong: #F2F3F5;
  /* Text */
  --ink: #171A21;
  --ink-2: #4A4F5C;
  --ink-3: #7A7F8C;
  --line: #E4E2DC;
  --line-strong: #D3D0C8;
  /* Akzent */
  --accent: #0E7068;
  --accent-hover: #0A5C55;
  --accent-soft: #E3F1EF;
  --accent-ink: #0A4F49;
  /* Finanzbereich */
  --vault: #9A6412;
  --vault-soft: #FBF2E2;
  --vault-line: #EBD3A8;
  /* Status */
  --ok: #2F7D4F; --ok-soft: #E5F2EA;
  --warn: #A1660B; --warn-soft: #FBF0DC;
  --bad: #B03A3A; --bad-soft: #F8E6E4;
  --info: #3B5BA9; --info-soft: #E7ECF7;
  --neutral-soft: #ECEBE6;
  /* Typografie */
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px;
  /* Form */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(23, 26, 33, .05);
  --shadow-2: 0 8px 28px rgba(23, 26, 33, .10), 0 2px 6px rgba(23, 26, 33, .05);
  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; }
.right { text-align: right; }
.pos { color: var(--ok); }
.neg { color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--nav) var(--sidebar-w), transparent 0); }
.sidebar {
  background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #232833; display: grid; place-items: center; }
.brand-name { color: var(--nav-text-strong); font-weight: 700; letter-spacing: .06em; font-size: 13px; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; letter-spacing: .02em; color: var(--nav-text); font-size: 11px; margin-top: 2px; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6E7380; padding: 14px 12px 6px; display: flex; align-items: center; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--nav-text);
  font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a:hover { background: var(--nav-2); color: var(--nav-text-strong); }
.nav a.active { background: #262B36; color: var(--nav-text-strong); }
.nav a.active svg { color: #7FD3C9; opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; background: #2D3340; color: #D5D8DE; padding: 1px 7px; border-radius: 99px; }
.nav.vault a.active svg { color: #E7B86A; }
.nav.vault .nav-label { color: #B78F4F; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 2px; border-top: 1px solid #262A33; font-size: 11.5px; line-height: 1.45; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; color: #C9CDD4; font-weight: 600; }
.demo-pill::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: #E7B86A; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: rgba(244, 243, 239, .85);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 460px; }
.search input {
  width: 100%; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
  padding: 0 12px 0 36px; font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--ink-3); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; display: none; }
.search-results.open { display: block; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--ink); }
.search-results a:hover, .search-results a.focus { background: var(--surface-2); }
.search-results .type { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); width: 64px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.badge-demo { font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border: 1px solid #F0DDB8; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 99px; border: 1px solid transparent; background: none; cursor: pointer; }
.user-chip:hover { background: var(--surface); border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); flex: none; }
.avatar.tobias { background: #2E3440; }
.avatar.natalie { background: #0E7068; }
.avatar.jonas { background: #5B5F97; }
.avatar.flo { background: #8A5A1C; }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who b { font-size: 13px; font-weight: 600; display: block; }
.user-chip .who span { font-size: 11.5px; color: var(--ink-3); }
.menu { position: absolute; right: 24px; top: 54px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; min-width: 220px; z-index: 30; }
.menu button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.menu button:hover { background: var(--surface-2); }
.menu .meta { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12.5px; color: var(--ink-3); }

.content { padding: 28px 28px 56px; max-width: 1360px; width: 100%; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.eyebrow.vault { color: var(--vault); }
h1 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -.015em; margin: 0; font-weight: 650; }
h2 { font-size: var(--fs-lg); margin: 0; font-weight: 620; letter-spacing: -.005em; }
h3 { font-size: var(--fs-md); margin: 0; font-weight: 600; }
.page-sub { color: var(--ink-2); margin: 6px 0 0; max-width: 720px; }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: #C3C0B7; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.vault { background: var(--vault); border-color: var(--vault); color: #fff; }
.btn.vault:hover { background: #82540F; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-sunken); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { background: var(--surface-sunken); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Karten & Raster ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 4px 18px 18px; }
.card-body.flush { padding: 0; }
.card.vault { border-color: var(--vault-line); }
.card.vault .card-head { background: linear-gradient(180deg, var(--vault-soft), transparent); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section-gap { margin-top: 16px; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.vault { background: linear-gradient(180deg, #FFFCF6, #fff); border-color: var(--vault-line); }
.kpi.vault .label { color: var(--vault); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid #EFEDE8; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: #FBFAF7; }
.t .right, .t th.right { text-align: right; }
.t td.cell-main b { font-weight: 600; display: block; }
.t td.cell-main span { font-size: 12.5px; color: var(--ink-3); }
.t tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); }
.card > .table-wrap .t th:first-child, .card > .table-wrap .t td:first-child { padding-left: 18px; }
.card > .table-wrap .t th:last-child, .card > .table-wrap .t td:last-child { padding-right: 18px; }

/* ---------- Status-Badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 99px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .7; }
.tag.plain::before { display: none; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag.vault { background: var(--vault-soft); color: var(--vault); }

/* ---------- Toolbar / Filter ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-sunken); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.input, .select, textarea.input {
  height: 36px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 11px; background: var(--surface); font-size: 13.5px; min-width: 0;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Detail-Elemente ---------- */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid #EFEDE8; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12.5px; color: var(--ink-3); }
.file-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink-2); font-size: 10px; font-weight: 700; letter-spacing: .03em; flex: none; }
.file-ico.pdf { background: #F7E7E4; color: #A23A2C; }
.file-ico.img { background: #E6EEF7; color: #3B5BA9; }
.file-ico.xls { background: #E4F1E8; color: #2F7D4F; }
.file-ico.lock { background: var(--vault-soft); color: var(--vault); }
.progress { height: 6px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.checklist label { display: flex; gap: 10px; align-items: center; padding: 9px 18px; border-top: 1px solid #EFEDE8; cursor: pointer; }
.checklist label:first-child { border-top: 0; }
.checklist input { width: 16px; height: 16px; accent-color: var(--accent); }
.checklist .done span { color: var(--ink-3); text-decoration: line-through; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.note.vault { background: var(--vault-soft); border-color: var(--vault-line); color: #6B4709; }
.note.warn { background: var(--warn-soft); border-color: #F0DDB8; color: #6E4706; }
.note.ok { background: var(--ok-soft); border-color: #C9E3D3; color: #1F5A37; }
.note.info { background: var(--info-soft); border-color: #CDD8EE; color: #2C4581; }

/* CSD-Karten */
.csd-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.csd-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.csd-city { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.csd-stripe { height: 4px; border-radius: 99px; background: linear-gradient(90deg, #C9504A, #D98C3F, #D9B941, #4E9A63, #3E73B5, #7A5AA6); opacity: .75; }
.csd-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }

/* Diagramm */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 110px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Leerer Zustand / Sperre */
.empty { padding: 36px 18px; text-align: center; color: var(--ink-3); }
.locked { max-width: 520px; margin: 60px auto; text-align: center; padding: 40px 32px; }
.locked .ico { width: 54px; height: 54px; border-radius: 14px; background: var(--vault-soft); color: var(--vault); display: grid; place-items: center; margin: 0 auto 16px; }
.locked .ico svg { width: 26px; height: 26px; }

/* Dropzone */
.drop { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 26px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--vault); background: var(--vault-soft); }
.drop svg { width: 26px; height: 26px; color: var(--vault); }
.formats { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

/* Ordnerbaum */
.tree { padding: 8px; }
.tree button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--ink-2); }
.tree button:hover { background: var(--surface-2); }
.tree button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tree button.vault.on { background: var(--vault-soft); color: var(--vault); }
.tree button svg { width: 16px; height: 16px; flex: none; }
.tree button .count { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.tree .indent { padding-left: 28px; }

/* Konfidenz */
.conf { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.conf .progress { flex: 1; height: 5px; }
.conf.low .progress > i { background: var(--warn); }
.conf.vlow .progress > i { background: var(--bad); }

/* ---------- Modal & Toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(21, 24, 31, .38); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-2); width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .18s ease-out; }
.modal-head { padding: 20px 22px 6px; display: flex; justify-content: space-between; gap: 12px; }
.modal-body { padding: 12px 22px 8px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); margin-top: 8px; align-items: center; }
.split-row { display: grid; grid-template-columns: 160px 1fr 130px 30px; gap: 8px; margin-bottom: 8px; align-items: center; }
.split-sum { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); font-size: 13px; margin-top: 6px; }
.split-sum.ok { background: var(--ok-soft); color: var(--ok); }
.split-sum.bad { background: var(--bad-soft); color: var(--bad); }
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--nav); color: #F2F3F5; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-2); font-size: 13.5px; max-width: 380px; animation: rise .18s ease-out; }
.toast.err { background: #7E2626; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { background: var(--nav); color: #C9CDD4; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { color: #F5F6F8; font-size: 34px; letter-spacing: -.02em; max-width: 440px; line-height: 1.15; }
.login-art p { max-width: 420px; color: #A8ADB8; }
.login-art .stripe { position: absolute; right: -60px; bottom: 90px; width: 380px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #C9504A, #D98C3F, #D9B941, #4E9A63, #3E73B5, #7A5AA6); opacity: .55; transform: rotate(-18deg); }
.login-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; font-size: 13.5px; }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li svg { width: 16px; height: 16px; color: #7FD3C9; }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: min(400px, 100%); }
.user-pick { display: grid; gap: 10px; margin: 20px 0; }
.user-pick button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.user-pick button:hover { border-color: #BDB9AF; }
.user-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.user-pick .r { margin-left: auto; }

/* ---------- Responsiv ---------- */
.docs-grid { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; gap: 4px; }
  .sidebar .brand { padding: 4px 8px; width: 100%; }
  .sidebar .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar .nav-label, .sidebar-foot { display: none; }
  .topbar { padding: 0 16px; }
  .topbar .user-chip .who, .badge-demo { display: none; }
  .content { padding: 20px 16px 48px; }
  .g-3, .g-2, .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .card-head { flex-wrap: wrap; }
  .seg { max-width: 100%; overflow-x: auto; }
  #dpath { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .dl { grid-template-columns: 1fr; } }

/* ==========================================================================
   Phase 2 – Ergänzungen im bestehenden Designsystem (keine neuen Farben)
   ========================================================================== */
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); max-height: 200px; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Aufgabenlisten */
.task-list li { gap: 12px; }
.task-check { width: 17px; height: 17px; accent-color: var(--accent); flex: none; cursor: pointer; }
.task-row.done .title { color: var(--ink-3); text-decoration: line-through; }
.task-row .grow:hover .title { color: var(--accent); }
.due { font-weight: 600; }
.due.over { color: var(--bad); }
.due.today { color: var(--accent); }
.due.soon { color: var(--warn); }
.card-over { border-color: #EBC9C5; }
.card-over .card-head h2 { color: var(--bad); }

/* Termine */
.date-badge { width: 40px; height: 42px; border-radius: 9px; background: var(--surface-sunken); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1.05; }
.date-badge b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.date-badge span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.date-badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.ms-done .title { color: var(--ink-3); text-decoration: line-through; }

/* Projektstatus-Leiste (Dashboard) */
.status-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-strip > div { background: var(--surface-2); padding: 10px 14px; display: flex; flex-direction: column; }
.status-strip b { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.status-strip span { font-size: 12px; color: var(--ink-3); }

/* CSD-Karten: Fakten */
.csd-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.csd-facts span { display: inline-flex; align-items: center; gap: 5px; }
.csd-facts svg { width: 14px; height: 14px; color: var(--ink-3); }
.btn.danger.ghost:hover { background: var(--bad-soft); }

@media (max-width: 900px) {
  .status-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Phase 3 – Notizen, Historie, Wiedervorlagen, Glocke, Kontaktvorschläge
   (ausschließlich bestehende Farb-Tokens)
   ========================================================================== */
.chip-sm { font-size: 11px; padding: 1px 7px; }
.chips .chip-sm { margin: 0; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 3px 11px; font-size: 12px; font-weight: 550; cursor: pointer; }
.chipbtn:hover { border-color: var(--line-strong); }
.chipbtn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

/* Glocke */
.bell { position: relative; width: 36px; height: 36px; border-radius: 99px; border: 1px solid transparent; background: none; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.bell:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.bell svg { width: 19px; height: 19px; }
.bell.has-overdue svg { color: var(--bad); }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.bell.has-overdue .bell-count { background: var(--bad); }
.bell-panel { width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 0; right: 70px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bell-sec { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px 4px; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; border-top: 1px solid #EFEDE8; }
.bell-item.read { opacity: .6; }
.bell-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); margin-top: 6px; flex: none; }
.bell-dot.over { background: var(--bad); }
.bell-item.read .bell-dot { background: var(--line-strong); }
.bell-acts { display: flex; gap: 2px; flex: none; align-items: center; }
.bell-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); position: sticky; bottom: 0; }

/* Erinnerungsfrage – dezent, nicht blockierend */
#prompt-root { position: fixed; left: calc(var(--sidebar-w) + 24px); bottom: 22px; z-index: 55; }
.ask { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow-2); padding: 14px 14px 14px 16px; width: min(560px, calc(100vw - 32px)); animation: rise .2s ease-out; }
.ask-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ask-ico svg { width: 18px; height: 18px; }
.ask-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Kennzahlenleiste Kunde/Kontakt */
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.summary-strip > div { background: var(--surface); padding: 12px 16px; display: flex; flex-direction: column; min-width: 0; }
.summary-strip span { font-size: 11.5px; color: var(--ink-3); font-weight: 550; }
.summary-strip b { font-size: 15px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; }
.summary-strip em { font-style: normal; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip .is-over b { color: var(--bad); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0 8px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 33px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { display: flex; gap: 12px; padding: 10px 18px; position: relative; }
.tl-item.is-note { cursor: pointer; }
.tl-item.is-note:hover { background: var(--surface-2); }
.tl-dot { width: 30px; height: 30px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-3); flex: none; z-index: 1; }
.tl-dot svg { width: 14px; height: 14px; }
.tl-dot.k-Telefonat, .tl-dot.k-PersönlichesMeeting, .tl-dot.k-Videokonferenz { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tl-dot.k-Wiedervorlage, .tl-dot.k-Nachfassaktion { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tl-dot.k-Angebot { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tl-head { font-size: 13.5px; }
.tl-text { font-size: 13px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; }

/* Wiedervorlagen-Zeilen */
.fu-row.done .title { color: var(--ink-3); text-decoration: line-through; }
.fu-row .grow:hover .title { color: var(--accent); }
.task-check-done { width: 17px; height: 17px; color: var(--ok); flex: none; }
.task-check-done svg { width: 15px; height: 15px; }
.list li.sep { padding: 8px 18px 4px; background: var(--surface-2); }
.contact-off .title a { color: var(--ink-3); }

/* Kontaktvorschläge */
.sug-list { display: grid; gap: 12px; padding: 16px 18px 18px; }
.sug { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sug.is-update { border-left: 3px solid var(--info); }
.sug-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #EFEDE8; }
.sug-body { padding: 10px 14px; display: grid; gap: 8px; }
.sug-data { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.sug-data em { font-style: normal; color: var(--ink-3); margin-right: 6px; font-size: 12px; }
.sug-note { padding: 8px 10px; }
.sug-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid #EFEDE8; background: var(--surface-2); border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.upd-list, .assign { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.assign .check { align-items: center; }
pre.sig { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; margin: 6px 0 0; color: var(--ink-2); }
details.hist { margin-top: 12px; font-size: 13px; }
details.hist summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }

/* Notizen in Aufgaben */
.task-notes { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.tn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

@media (max-width: 1180px) { .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  #prompt-root { left: 12px; right: 12px; bottom: 12px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bell-panel { right: 8px; }
  .topbar .badge-demo { display: none; }
}
#fu-tabs { flex-wrap: wrap; max-width: 100%; }
#fu-tabs button { padding: 5px 9px; }
.fu-row .title, .task-row .title { white-space: normal; }
@media (max-width: 900px) {
  .page-head > div, .page-head .actions { min-width: 0; max-width: 100%; }
  .toolbar > * { max-width: 100%; }
  .toolbar .seg { overflow-x: auto; }
  .sug-head { flex-wrap: wrap; }
  .sug-head .right { text-align: left; width: 100%; }
  .sug-data span, .sug-body { word-break: break-word; min-width: 0; }
}
.sug-list { grid-template-columns: minmax(0, 1fr); }
.sug-head .grow { min-width: 0; }
.sug-body { grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.chips .tag { white-space: normal; max-width: 100%; }

/* ==========================================================================
   Phase 4A – E-Mail-Client, Ablage, mobile Tab-Leiste (bestehende Design-Tokens)
   ========================================================================== */
.content:has(.mail) { max-width: none; padding: 0; }
.mail { display: grid; grid-template-columns: 236px minmax(300px, 380px) minmax(0, 1fr); height: calc(100vh - 60px); background: var(--surface); border-top: 0; }
.m-side { background: var(--surface-2); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.m-new { justify-content: center; margin: 0 4px 10px; }
.m-sec { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-box, .m-folder { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; min-height: 36px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.m-box:hover, .m-folder:hover { background: var(--surface-sunken); color: var(--ink); }
.m-box.on, .m-folder.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.m-box small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.m-box b { font-weight: 600; }
.m-box svg, .m-folder svg { width: 16px; height: 16px; flex: none; }
.m-box .grow { min-width: 0; }
.m-folder.drop { outline: 2px dashed var(--accent); }
.m-side .count { font-size: 11px; background: var(--accent); color: #fff; padding: 0 7px; border-radius: 99px; font-weight: 650; }
.m-side .count.warn { background: var(--warn); }
.m-add { color: var(--ink-3); }
.m-sync { margin-top: auto; padding: 12px 10px 2px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--line); }
.m-sync svg { width: 13px; height: 13px; vertical-align: -2px; }
.m-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.m-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; background: var(--surface); }
.m-title { display: flex; align-items: center; gap: 8px; }
.m-title h1 { font-size: 18px; }
.m-search { position: relative; display: flex; gap: 6px; }
.m-search > svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--ink-3); }
.m-search input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px 0 32px; background: var(--surface-2); min-width: 0; }
.m-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.m-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.m-filters .input { height: 32px; flex: 1 1 130px; }
.m-filters .select { height: 32px; }
.m-bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--accent-soft); border-radius: 9px; }
.m-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.m-item { display: flex; gap: 8px; padding: 10px 14px 10px 10px; border-bottom: 1px solid #EFEDE8; cursor: pointer; position: relative; }
.m-item:hover { background: var(--surface-2); }
.m-item.open { background: var(--accent-soft); }
.m-item.sel { background: #EAF4F2; }
.m-check { display: grid; place-items: center; width: 28px; min-height: 28px; flex: none; }
.m-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.m-item .grow { min-width: 0; }
.m-l1 { display: flex; gap: 6px; align-items: baseline; }
.m-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--ink-2); }
.m-item.unread .m-from, .m-item.unread .m-l2 { font-weight: 650; color: var(--ink); }
.m-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.m-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-tc { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.m-l2 { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.m-l3 { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.m-l3 svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; color: var(--vault); }
.m-l4 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.m-l4:empty { display: none; }
.m-att { font-size: 11.5px; color: var(--ink-3); }
.m-att svg { width: 12px; height: 12px; vertical-align: -2px; }
.m-flag { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.m-none { padding: 30px 16px; color: var(--ink-3); text-align: center; }
.m-more { margin: 10px auto; }
.m-read { overflow-y: auto; min-width: 0; background: var(--surface); }
.m-empty { height: 100%; display: grid; place-content: center; text-align: center; color: var(--ink-3); gap: 4px; }
.m-empty svg { width: 40px; height: 40px; margin: 0 auto; opacity: .5; }
.m-only { display: none; }
.r-head { padding: 16px 18px 10px; display: grid; gap: 10px; position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--line); }
.r-head h2 { font-size: 18px; line-height: 1.3; }
.r-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r-flag { height: 30px; font-size: 12.5px; }
.r-crm { margin: 12px 18px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.r-crm > svg { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; flex: none; }
.r-crm.warn { background: var(--warn-soft); border-color: #F0DDB8; }
.r-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 18px 0; align-items: center; }
.r-sep { flex: 1; }
.ai-box { margin: 10px 18px 0; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.ai-box ul { margin: 6px 0 8px; padding-left: 18px; }
.ai-engine { margin-top: 8px; }
.ai-engine svg { width: 12px; height: 12px; vertical-align: -2px; }
.ai-tasks { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.ai-tasks li { display: flex; gap: 8px; align-items: center; }
.r-msgs { padding: 14px 18px 40px; display: grid; gap: 10px; }
.r-msg { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.r-msg-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.r-msg-head .grow { min-width: 0; }
.r-msg-head .muted { word-break: break-word; }
.r-msg-body { display: none; padding: 4px 14px 14px 54px; }
.r-msg.open .r-msg-body { display: block; }
.r-text { font-size: 14px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.r-html { width: 100%; border: 0; min-height: 120px; background: #fff; }
.r-blocked { padding: 6px 10px; border-radius: 8px; background: var(--info-soft); color: var(--info); margin-bottom: 10px; }
.r-blocked svg { width: 13px; height: 13px; vertical-align: -2px; }
.r-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.att-chip .grow { min-width: 0; display: flex; flex-direction: column; }
.att-chip b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip em { font-style: normal; color: var(--ink-3); font-size: 11.5px; }
.att-chip svg { width: 14px; height: 14px; }
.att-chip .file-ico { width: 30px; height: 30px; }
.att-chip.danger { border-color: #EBC9C5; background: var(--bad-soft); }
.att-chip.locked { border-color: var(--vault-line); background: var(--vault-soft); color: var(--vault); }
/* Verfassen */
.compose { display: grid; gap: 8px; }
.c-row { display: flex; gap: 8px; align-items: center; }
.c-row label { width: 64px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.c-row .input, .c-row .select { flex: 1; min-width: 0; }
.c-text { width: 100%; font-family: var(--font); font-size: 14px; line-height: 1.55; min-height: 260px; }
.c-att { display: flex; flex-wrap: wrap; gap: 6px; }
.c-att:empty { display: none; }
.c-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Ablage */
.tree-box { padding: 6px 10px 12px; font-size: 13px; overflow-x: auto; }
.tree-d summary { cursor: pointer; padding: 4px 2px; list-style: none; display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.tree-d summary svg { width: 14px; height: 14px; }
.tree-d.vault > summary { color: var(--vault); font-weight: 600; }
.tree-c { padding-left: 14px; border-left: 1px dashed var(--line); margin-left: 6px; }
.tree-f { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.tree-f .file-ico { width: 24px; height: 24px; font-size: 8px; }
.a-form { margin-top: 6px; }
.sug.is-fin { border-left: 3px solid var(--vault); }
.sync-box { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }
.sync-log { max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 6px; }
/* Mobile Tab-Leiste */
.tabbar { display: none; }
@media (max-width: 900px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index: 70; flex-direction: column; flex-wrap: nowrap; overflow-y: auto; padding: 16px; }
  .sidebar.open .nav { display: flex; flex-direction: column; }
  .sidebar.open .nav a { min-height: 48px; font-size: 16px; }
  .sidebar.open .nav-label { display: flex; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--nav); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #262A33; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--nav-text); font-size: 11px; position: relative; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: #7FD3C9; }
  .tab-count { position: absolute; top: 4px; right: calc(50% - 22px); background: var(--accent); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
  #toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; right: 12px; }
  #prompt-root { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .icon-btn { width: 40px; height: 40px; }
  .input, .select { height: 42px; font-size: 16px; }
  textarea.input { font-size: 16px; }
  .content:has(.mail) { padding: 0; }
  .mail { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 60px - 64px - env(safe-area-inset-bottom)); height: calc(100dvh - 60px - 64px - env(safe-area-inset-bottom)); position: relative; }
  .m-only { display: inline-flex; }
  .m-side { display: none; position: absolute; inset: 0; z-index: 5; }
  .mail.side-open .m-side { display: flex; }
  .mail.has-thread .m-list { display: none; }
  .mail:not(.has-thread) .m-read { display: none; }
  .m-item { padding: 12px 12px 12px 6px; min-height: 64px; }
  .m-check { width: 40px; }
  .m-check input { width: 20px; height: 20px; }
  .m-box, .m-folder { min-height: 46px; font-size: 15px; }
  .r-head { padding: 10px 12px; }
  .r-actions .btn.sm { padding: 0 10px; }
  .r-msg-body { padding: 4px 12px 14px; }
  .r-msgs { padding: 12px 10px 30px; }
  .r-crm, .ai-box { margin-left: 10px; margin-right: 10px; }
  .r-tools { padding: 10px 10px 0; }
  .modal { max-height: 100dvh; height: 100dvh; width: 100%; border-radius: 0; }
  .overlay { padding: 0; }
  .c-row { flex-wrap: wrap; }
  .c-row label { width: 100%; }
  .bell-panel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
  .topbar-right { gap: 6px; }
}
[hidden] { display: none !important; }
.docs-grid > .card { min-width: 0; }
.tree-f .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .r-crm .muted.small { display: none; } .tree-box { overflow-x: hidden; } }
.tree-d summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { main.content { overflow-x: clip; } .sug-actions, .toolbar { flex-wrap: wrap; } }
@media (max-width: 900px) {
  .overlay { z-index: 90; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  #toast-root, #prompt-root { z-index: 95; }
}

/* ---------- Phase 4A.2: Rechnungsarchiv, Export, Benutzer ---------- */
.inv-mode { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px 4px; }
.inv-badge { display: flex; gap: 10px; align-items: center; background: var(--vault-soft); border: 1px solid var(--vault-line); color: #6B4709; border-radius: 10px; padding: 8px 12px; }
.inv-badge svg { width: 18px; height: 18px; flex: none; }
.inv-badge b { display: block; font-size: 13.5px; }
.inv-badge span { display: block; font-size: 12px; opacity: .85; }
.inv-filters .select, .inv-filters .input { height: 34px; }
.inv-filters #f-q { width: 220px; }
.inv-amount { display: inline-flex; align-items: center; gap: 4px; }
.inv-amount .input { width: 96px; text-align: right; }
.inv-unclear { padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.inv-kpis { padding: 12px 18px 0; }
.inv-kpis .summary-strip { margin-bottom: 10px; }
.inv-bulkbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 18px 10px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.inv-bulkbar.on { background: var(--accent-soft); border-color: #C6E2DE; }
.inv-bulkbar .grow { flex: 1; }
.inv-table tr.sel td { background: #F3FAF8; }
.inv-file { display: flex; align-items: center; gap: 6px; min-width: 0; }
.inv-file .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.inv-file .file-ico { width: 24px; height: 24px; font-size: 8.5px; }
.inv-file.bad { color: var(--bad); }
.inv-acts { display: inline-flex; gap: 4px; white-space: nowrap; }
.inv-cards { display: none; }
.inv-card { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.inv-card .grow { flex: 1; min-width: 0; }
.inv-card-top { display: flex; justify-content: space-between; gap: 10px; }
.inv-card-top b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.inv-card-sel { padding-top: 2px; }
.inv-card-sel input, .inv-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.inv-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.inv-h { font-size: 13.5px; font-weight: 650; margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.inv-detail section > .inv-h:first-child { margin-top: 0; }
.inv-pay { align-items: flex-start !important; }
.inv-sugg-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px dashed #C6E2DE; background: #F7FBFA; border-radius: 9px; margin-bottom: 6px; }
.inv-sugg-row .grow { flex: 1; min-width: 0; }
.inv-payacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.inv-hist { max-height: 260px; overflow: auto; }
.inv-txlist { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.inv-tx { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.inv-tx:first-child { border-top: 0; }
.inv-tx.on { background: var(--accent-soft); }
.inv-tx .grow { flex: 1; min-width: 0; }
.inv-radio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inv-opt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; position: relative; }
.inv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.inv-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.inv-prev { margin-top: 14px; }
.inv-prev-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.inv-prev-head svg { width: 20px; height: 20px; flex: none; }
.inv-prev-head b { display: block; }
.inv-prev-head span { display: block; word-break: break-all; }
.inv-prev-head.ok { background: var(--ok-soft); color: #1F5A37; }
.inv-prev-head.bad { background: var(--bad-soft); color: #7A2323; }
.inv-prev-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; margin-bottom: 0; }
@media (max-width: 900px) {
  .inv-table { display: none; }
  .inv-cards { display: block; }
  .inv-filters { gap: 8px; }
  .inv-filters .select, .inv-filters #f-q { flex: 1 1 45%; min-width: 0; width: auto; height: 40px; }
  .inv-amount { flex: 1 1 100%; } .inv-amount .input { flex: 1; width: auto; height: 40px; }
  .inv-unclear { flex: 1 1 100%; min-height: 40px; }
  .inv-mode .seg { display: flex; width: 100%; } .inv-mode .seg button { flex: 1; padding: 8px 4px; font-size: 12.5px; }
  .inv-mode > div { width: 100%; }
  .inv-detail { grid-template-columns: 1fr; }
  .inv-radio { grid-template-columns: 1fr; }
  .inv-prev-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .inv-bulkbar .btn { flex: 1 1 100%; justify-content: center; min-height: 40px; }
  .inv-acts .btn { min-height: 36px; }
  .hide-sm { display: none; }
}
/* Feinschliff 4A.2 */
.inv-table .hide-sm { display: none; }
.inv-table .inv-acts .btn { padding: 0 8px; }
.inv-file .grow { max-width: 170px; }
.modal.inv-wide { width: min(1080px, 100%) !important; }
.inv-detail .field, .inv-detail section { min-width: 0; }
.inv-detail .input, .inv-detail .select { width: 100%; min-width: 0; }
.inv-detail .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inv-sugg-row { flex-direction: column; align-items: stretch; }
.inv-sugg-row .btn { align-self: flex-end; }
.inv-prev-kpis { display: flex !important; flex-wrap: wrap; }
.inv-prev-kpis > div { flex: 1 1 150px; }
@media (max-width: 900px) {
  .inv-mode .seg button { min-width: 0; font-size: 12px; padding: 8px 2px; overflow: hidden; text-overflow: ellipsis; }
  .inv-detail .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inv-sugg-row .btn { align-self: stretch; justify-content: center; }
}
/* Phase 4C: Wiederherstellungscodes */
.rc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.rc-grid span { padding: 4px 6px; background: var(--surface); border-radius: 6px; text-align: center; }

/* Phase 5 – CSD-Zentrale, Trucks, Sponsoring, Dateien */
.ev-tabs { display: flex; flex-wrap: wrap; max-width: 100%; }
@media (max-width: 760px) { .ev-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; } }
.checklist label .icon-btn { width: 26px; height: 26px; opacity: .55; }
.checklist label .icon-btn:hover { opacity: 1; }
.select.sm { padding: 4px 26px 4px 8px; font-size: 12.5px; min-height: 0; height: auto; }
.t tr.sub-row > td { padding: 0 0 6px 24px; background: var(--surface-sunken); }
.t tr.sub-row .t td { font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
.t tr.is-over td { background: color-mix(in srgb, var(--bad, #c0392b) 6%, transparent); }

.dropzone { margin: 0 18px 12px; padding: 14px; border: 1.5px dashed var(--line, #d9d4cb); border-radius: 10px; text-align: center; color: var(--ink-2); font-size: 13px; }
.dropzone svg { width: 16px; height: 16px; vertical-align: -3px; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.gal-item { border: 1px solid var(--line, #e5e0d8); background: var(--surface); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.gal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-sunken); }
.gal-ico { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--surface-sunken); }
.gal-ico svg { width: 28px; height: 28px; }
.gal-cap { font-size: 12px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Phase 7: KI-Assistent ---------- */
.ai-label { background: var(--accent-soft); color: var(--accent-ink); gap: 4px; }
.ai-label svg { width: 12px; height: 12px; }
.ai-top { gap: 6px; }
.ai-top svg { width: 15px; height: 15px; color: var(--accent); }
.ai-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.ai-hist .list li.active { background: var(--accent-soft); }
.ai-hist .list a { color: inherit; text-decoration: none; min-width: 0; }
.ai-hist .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat { display: flex; flex-direction: column; min-height: 520px; }
.ai-thread { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: calc(100vh - 290px); min-height: 380px; }
.ai-q { align-self: flex-end; max-width: 80%; }
.ai-q span { display: inline-block; background: var(--nav-2); color: var(--nav-text-strong); padding: 9px 13px; border-radius: 14px 14px 4px 14px; font-size: var(--fs-md); overflow-wrap: anywhere; }
.ai-answer { align-self: stretch; border: 1px solid var(--line); background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ai-answer.pending { color: var(--ink-3); flex-direction: row; align-items: center; }
.ai-answer.pending svg { width: 16px; height: 16px; color: var(--accent); }
.ai-answer.denied { border-color: var(--line-strong); background: var(--surface-sunken); }
.ai-answer-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.ai-text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.ai-items { margin: 0 -14px; border-top: 1px solid var(--line); background: var(--surface); }
.ai-items li { padding: 9px 14px; }
.ai-items a { color: inherit; text-decoration: none; min-width: 0; }
.ai-items a:hover .title { color: var(--accent); }
.ai-items .meta { overflow-wrap: anywhere; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-actions .small { width: 100%; }
.ai-actions .btn { max-width: 100%; white-space: normal; height: auto; min-height: 30px; text-align: left; }
.ai-draft { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 10px 12px; }
.ai-draft pre { white-space: pre-wrap; font-family: var(--font); font-size: var(--fs-sm); margin: 4px 0 0; color: var(--ink-2); }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-examples button { cursor: pointer; border: 1px solid var(--line); background: var(--surface); text-align: left; white-space: normal; }
.ai-examples button:hover { border-color: var(--accent); color: var(--accent-ink); }
.ai-welcome { text-align: center; margin: auto; max-width: 560px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ai-welcome .ai-examples { justify-content: center; }
.ai-welcome-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ai-welcome-ico svg { width: 22px; height: 22px; }
.ai-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-input .input { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .ai-layout { grid-template-columns: minmax(0, 1fr); }
  .ai-hist { order: 2; }
  .ai-thread { max-height: none; min-height: 300px; padding: 12px; }
  .ai-q { max-width: 92%; }
  .ai-top span { display: none; }
}
.ai-items .title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.ai-analysis .dl { margin: 8px 0; }
.ai-pre { white-space: pre-wrap; font-family: var(--font); font-size: var(--fs-sm); margin: 0; }
.ai-tasks li .muted { overflow-wrap: anywhere; }
.section-gap-b { margin-bottom: 16px; }
.today-card .card-head { border-bottom: 1px solid var(--line); }
.today-list li a { color: inherit; text-decoration: none; min-width: 0; }
.today-list li a:hover .title { color: var(--accent); }
.today-list .meta { overflow-wrap: anywhere; }
.auto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.auto-rule .card-head { align-items: flex-start; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) { .auto-grid { grid-template-columns: minmax(0, 1fr); } .auto-rule .card-head { flex-wrap: wrap; } }
.ai-form { grid-template-columns: minmax(0, 1fr) !important; }
.ai-form .field, .ai-form .input, .ai-form .select { min-width: 0; max-width: 100%; }
.ai-form .check span { overflow-wrap: anywhere; }

/* ==========================================================================
   Phase 8B – Mobile Nutzung (iPhone/iPad) und PWA – bestehendes Design fortgeführt
   ========================================================================== */
.update-banner { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 120; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--nav); color: var(--nav-text-strong); padding: 10px 12px 10px 16px; border-radius: 12px; box-shadow: var(--shadow-2); font-size: 13.5px; max-width: calc(100vw - 24px); }
.update-banner svg { width: 15px; height: 15px; vertical-align: -2px; color: #7FD3C9; }
.update-banner .btn.ghost { color: var(--nav-text); }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 119; background: var(--warn); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
.install-steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.install-steps svg { width: 14px; height: 14px; vertical-align: -2px; }
.cam-only { display: none; }
.touch .cam-only { display: inline-flex; }
/* Installierte App: Statusleiste (iPhone-Notch) berücksichtigen */
.standalone .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
@media (max-width: 900px) {
  /* Eingabefelder mit 16 px: verhindert das automatische Hineinzoomen von iOS */
  .input, .select, textarea.input, .search input { font-size: 16px; }
  .input, .select { min-height: 44px; }
  .btn { min-height: 42px; }
  .btn.sm { min-height: 36px; padding: 0 12px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  .seg button, .seg a { min-height: 38px; }
  .seg { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > * { scroll-snap-align: start; flex: none; }
  .toolbar .input, .toolbar .select { flex: 1 1 140px; width: auto !important; max-width: 100%; }
  .page-head .actions { flex-wrap: wrap; }
  .list li { min-height: 48px; }
  .modal { max-height: calc(100dvh - 24px); }
}
/* Tabellen werden auf dem iPhone zu Karten: jede Zeile ein Block, Spaltennamen als Beschriftung */
@media (max-width: 640px) {
  table.t.sr-cards thead { display: none; }
  table.t.sr-cards, table.t.sr-cards tbody, table.t.sr-cards tr, table.t.sr-cards td { display: block; width: 100%; }
  table.t.sr-cards tr { padding: 10px 16px; border-top: 1px solid var(--line); }
  table.t.sr-cards tr:first-child { border-top: 0; }
  table.t.sr-cards td { border: 0 !important; padding: 3px 0 3px 38% !important; text-align: left !important; position: relative; min-height: 22px; overflow-wrap: anywhere; }
  table.t.sr-cards td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 35%; color: var(--ink-3); font-size: 12px; font-weight: 550; line-height: 1.3; }
  table.t.sr-cards td:not([data-label]), table.t.sr-cards td[data-label=""] { padding-left: 0 !important; }
  table.t.sr-cards td:not([data-label])::before, table.t.sr-cards td[data-label=""]::before { content: none; }
  /* erste Spalte = Titel der Karte: volle Breite, ohne Beschriftung */
  table.t.sr-cards td:first-child { padding-left: 0 !important; font-weight: 600; font-size: 15px; }
  table.t.sr-cards td:first-child::before { content: none; }
  table.t.sr-cards td:first-child:has(input[type=checkbox]:only-child) { display: none; }
  table.t.sr-cards td[colspan] { display: block; text-align: center !important; }
  .table-wrap { overflow-x: visible; }
}
.perm-matrix .t th, .perm-matrix .t td { white-space: nowrap; }
.perm-matrix { overflow-x: auto; }
.t .center, .t th.center { text-align: center; }

/* Icons in Listen (z. B. Aktivitätsverlauf, Export-Liste): feste Größe, nicht dehnbar */
.list li > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ink-3); }

/* ---------- Getränkemanagement ---------- */
.dr-table td { vertical-align: top; }
.dr-table .input.sm, .dr-free { height: 32px; font-size: 13px; padding: 0 8px; }
.dr-free { margin-top: 6px; width: 100%; }
.dr-num { width: 84px; text-align: right; }
.dr-lock svg { width: 13px; height: 13px; vertical-align: -2px; color: var(--ink-3); }
.dr-pick { position: relative; min-width: 200px; }
.dr-pick .input { width: 100%; height: 34px; }
.dr-pick-list { position: fixed; z-index: 60; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2, 0 8px 24px rgba(0,0,0,.12)); padding: 4px; }
.dr-pick-cat { font-size: 11px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px 4px; }
.dr-pick-opt { display: flex; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.dr-pick-opt:hover, .dr-pick-opt.on { background: var(--accent-soft); }
.dr-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dr-sum { display: grid; gap: 3px; text-align: right; font-size: 13.5px; margin-left: auto; }
.dr-internal { background: var(--vault-soft); border-radius: 10px; }
.dr-kv { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font-size: 13px; align-items: baseline; }
.dr-kv b { margin-right: 14px; }
.dr-kv span { color: var(--ink-3); }
.dr-hist summary { cursor: pointer; color: var(--ink-2); }
.dr-sup { border-top: 1px solid var(--line); }
.dr-sup-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.dr-sup-head .grow { flex: 1; }
.kpi-warn .value { color: var(--warn); }
/* Vorschau Kundenportal (mobil) */
.pp-frame { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-1); }
.pp-head { padding: 18px; background: var(--surface-sunken); }
.pp-proj { font-size: 20px; font-weight: 700; }
.pp-body { padding: 18px; display: grid; gap: 10px; }
.pp-body h3 { margin: 0; font-size: 16px; }
.pp-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pp-total { display: flex; justify-content: space-between; gap: 10px; }
.pp-step { display: inline-flex; align-items: center; gap: 10px; }
.pp-step .icon-btn { width: 36px; height: 36px; font-size: 18px; font-weight: 600; }
.pp-add { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.pp-big { width: 100%; height: 46px; justify-content: center; }
@media (max-width: 820px) {
  .dr-num { width: 100%; }
  .dr-table .input { width: 100%; max-width: 100%; box-sizing: border-box; }
  .dr-pick { min-width: 0; }
  .dr-sum { text-align: left; margin-left: 0; }
}

/* Sprachbefehle: Mikrofon-Knopf und Aufnahme-Anzeige */
.voice-fab { position: fixed; right: 22px; bottom: 22px; z-index: 85; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer; }
.voice-fab svg { width: 24px; height: 24px; }
.voice-fab:hover { filter: brightness(1.08); }
.voice-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.voice-live { display: grid; gap: 10px; justify-items: center; }
.voice-live .field { width: 100%; }
.voice-orb { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent-soft, #E3F1EF); color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.voice-orb svg { width: 34px; height: 34px; }
.voice-orb.on { background: var(--accent); color: #fff; animation: voicePulse 1.4s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(14,112,104,.45); } 50% { box-shadow: 0 0 0 16px rgba(14,112,104,0); } }
@media (prefers-reduced-motion: reduce) { .voice-orb.on { animation: none; } }
@media (min-width: 901px) { #view { padding-bottom: 88px; } }
@media (max-width: 900px) { .voice-fab { display: none; } .tabbar.has-voice { grid-template-columns: repeat(6, 1fr); } .tabbar [data-voice] svg { color: #7FD3C9; } }
@media print { .voice-fab { display: none; } }

/* Projektkalkulation */
.calc-card .table, .calc-totals { width: 100%; border-collapse: collapse; }
.calc-totals { max-width: 560px; }
.calc-card .table th, .calc-card .table td, .calc-totals th, .calc-totals td { padding: 8px 10px; vertical-align: top; }
.calc-card .table td.right, .calc-card .table th.right, .calc-totals .right { text-align: right; white-space: nowrap; }
.calc-card tr.group td { background: var(--surface-2); padding-top: 10px; }
.calc-card tr.muted td { color: var(--muted, #8a8f98); text-decoration: line-through; }
.calc-totals tr.strong td { font-weight: 700; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .calc-card .table th:nth-child(3), .calc-card .table td:nth-child(3) { display: none; } }
.calc-ov td.num { white-space: nowrap; }
@media (max-width: 900px) { .calc-ov th:nth-child(2), .calc-ov td:nth-child(2), .calc-ov th:nth-child(6), .calc-ov td:nth-child(6), .calc-ov th:nth-child(7), .calc-ov td:nth-child(7) { display: none; } .calc-ov td, .calc-ov th { padding: 8px 6px; font-size: 14px; } }
