/* ================= Kontor – Gestaltung ================= */
:root {
  --bg: #f4f2ef;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --ink: #1b1a18;
  --ink-2: #55524d;
  --muted: #8b877f;
  --line: #e6e2dc;
  --accent: #c45a14;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --accent-ink: color-mix(in srgb, var(--accent) 72%, black);
  --side: #182129;
  --side-2: #212c35;
  --side-ink: #c9d3da;
  --bar: #2a78d6;
  --good: #0c8a0c;
  --warn: #b7791f;
  --bad: #c0362c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 1px 1px rgba(20, 20, 20, .03);
  --shadow-lg: 0 14px 40px rgba(20, 24, 28, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.screen[hidden] { display: none !important; }
#app-screen { display: flex; min-height: 100vh; }
svg { width: 18px; height: 18px; flex: none; }
a { color: #1f5fae; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.3px; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.1px; }
.sub { color: var(--ink-2); margin: 0 0 22px; }
.hint { font-size: 12px; color: var(--muted); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.ok { color: var(--good); font-weight: 600; }

/* ---------- Seitenleiste ---------- */
.sidebar {
  width: 236px; flex: none; background: linear-gradient(180deg, var(--side), #141b22); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 18px 0 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.back { display: block; color: #8597a3; text-decoration: none; font-size: 12.5px; padding: 0 20px 14px; }
.back:hover { color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 18px 16px; color: #fff; }
.brand #ws-name { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; }
.brand small { display: block; font-size: 10.5px; color: color-mix(in srgb, var(--accent) 50%, white); letter-spacing: 1.3px; text-transform: uppercase; margin-top: 2px; }
.ws-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent); flex: none; }
.ws-icon svg { width: 22px; height: 22px; }
.side-search { margin: 0 14px 12px; display: flex; align-items: center; gap: 8px; background: var(--side-2); color: #9fb0bb; border: 1px solid #2c3944; border-radius: 9px; padding: 8px 10px; font-size: 13px; text-align: left; }
.side-search:hover { color: #fff; border-color: #3a4a57; background: #26323c; }
.side-search kbd { margin-left: auto; font: 11px inherit; color: #7c8e9a; border: 1px solid #3a4854; border-radius: 4px; padding: 0 5px; }
nav { display: grid; gap: 2px; padding: 0 10px; }
nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--side-ink); text-decoration: none; border-radius: 9px; font-size: 14px;
}
nav a svg { opacity: .75; }
nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav a.active { background: color-mix(in srgb, var(--accent) 26%, transparent); color: #fff; }
nav a.active svg { opacity: 1; color: color-mix(in srgb, var(--accent) 40%, white); }
.navbadge { display: inline-block; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11.5px; font-weight: 650; line-height: 18px; margin-left: auto; }
h2 .navbadge { margin-left: 6px; vertical-align: 2px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; }
.savestate { padding: 0 20px; font-size: 12px; color: #7f909b; }
.savestate.err { color: #ff8a80; }
.savestate.version { color: #5f717c; }
.side-user { padding: 0 20px; font-size: 12.5px; color: var(--side-ink); }
.side-user a { color: #8597a3; }

main { flex: 1; padding: 30px 40px 70px; min-width: 0; max-width: 1500px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .sub { margin: 0; }

/* ---------- Karten & Kennzahlen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px 20px; box-shadow: var(--shadow); overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); opacity: .85; }
.kpi .l { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.kpi .s { color: var(--muted); font-size: 12px; }
.welcome { border-color: color-mix(in srgb, var(--accent) 35%, white); background: linear-gradient(120deg, var(--accent-soft), #fff 70%); }
.welcome p { margin: 0 0 14px; max-width: 760px; }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tr.click { cursor: pointer; }
tfoot td { font-weight: 650; border-bottom: none; }
.empty { color: var(--muted); padding: 26px 10px; text-align: center; }
.table-wrap { overflow-x: auto; }

/* ---------- Bedienelemente ---------- */
button, .btn {
  font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
button:hover, .btn:hover { border-color: #cdc6bc; background: var(--surface-2); }
a.btn { text-decoration: none; display: inline-block; color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); }
button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
button.danger { color: var(--bad); }
button.small, .btn.small { padding: 3px 10px; font-size: 12.5px; border-radius: 7px; }
button.ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e8eef2; }
button.ghost:hover { background: rgba(255,255,255,.16); }
button.wide { width: 100%; padding: 11px; font-size: 15px; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d9d3cb; border-radius: 8px;
  padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, white); border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form.one { grid-template-columns: 1fr; }
.form .full { grid-column: 1 / -1; }
.form .check { display: flex; gap: 8px; align-items: center; }
.form .check input { width: auto; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters > div { min-width: 170px; }
.who { font-size: 11.5px; color: var(--muted); margin-top: 12px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; background: #eeebe7; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.badge.good { background: #e2f3e2; color: var(--good); }
.badge.warn { background: #fbefd9; color: var(--warn); }
.badge.bad { background: #fbe3e0; color: var(--bad); }
.badge.info { background: #e3edfb; color: #1f5fae; }

/* ---------- Balken, Belegung, Kalender ---------- */
.bars { display: grid; grid-template-columns: minmax(110px, auto) 1fr auto; gap: 8px 12px; align-items: center; }
.bars .lbl { color: var(--ink-2); font-size: 13px; }
.bars .track { height: 14px; }
.bars .bar { height: 14px; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .val { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.occ { height: 6px; background: #ece8e2; border-radius: 3px; margin-top: 5px; width: 120px; }
.occ i { display: block; height: 6px; background: var(--accent); border-radius: 3px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head strong { min-width: 150px; text-align: center; font-size: 15px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 88px; padding: 4px; font-size: 12px; }
.cal .dow { min-height: 0; font-weight: 600; color: var(--ink-2); text-align: center; background: var(--surface-2); }
.cal .other { background: #fbfaf8; color: #bbb; }
.cal .today .d { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal .d { display: inline-block; margin-bottom: 3px; }
.chip { display: block; background: var(--accent-soft); color: var(--accent-ink); border-left: 3px solid var(--accent); padding: 1px 5px; margin-bottom: 2px; border-radius: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.storno { background: #eee; color: #888; border-left-color: #aaa; text-decoration: line-through; }

/* ---------- Dialoge ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16, 20, 24, .5); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal-bg[hidden] { display: none; }
.modal { background: var(--surface); border-radius: 16px; width: min(800px, 100%); padding: 24px 26px; box-shadow: var(--shadow-lg); border-top: 5px solid var(--accent); }
.modal h2 { font-size: 19px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.posrow { display: grid; grid-template-columns: 1fr 80px 110px 100px 32px; gap: 8px; margin-bottom: 6px; align-items: center; }
.posrow .sum { text-align: right; font-variant-numeric: tabular-nums; }
.zrow { display: grid; grid-template-columns: 140px 110px 150px 1fr 32px; gap: 8px; margin-bottom: 6px; align-items: center; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--side); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 20; box-shadow: var(--shadow-lg); }
.toast[hidden] { display: none; }
.calc-out .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.calc-out .row.big { font-size: 18px; font-weight: 650; border-bottom: none; }
.calc-out .row span:last-child { font-variant-numeric: tabular-nums; }
.vorlage-text { min-height: 260px; font-size: 13.5px; line-height: 1.5; }

/* ---------- Anhänge ---------- */
.dropzone { border: 2px dashed #d9d3cb; border-radius: 10px; padding: 10px; background: var(--surface-2); transition: border-color .12s, background .12s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-hint { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.belege { display: flex; flex-wrap: wrap; gap: 8px; }
.belege:not(:empty) { margin-bottom: 10px; }
.beleg { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); padding: 4px; border-radius: 8px; max-width: 280px; }
.beleg img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.beleg .ficon { width: 40px; height: 40px; display: grid; place-items: center; background: #f1eee9; border-radius: 6px; font-size: 18px; }
.beleg .bname { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; font-size: 13px; }

/* ---------- Suche ---------- */
.suche-input { font-size: 17px; padding: 12px 14px; border-radius: 10px; }
.suche-res { margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.suche-grp { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 12px 4px 4px; }
.suche-hit { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; border: none; border-radius: 8px; padding: 9px 10px; background: none; }
.suche-hit:hover { background: var(--accent-soft); }

/* ---------- Anmeldung ---------- */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #2d5166 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #7a3a5c 0%, transparent 55%), #141b22; }
.login-card { background: var(--surface); border-radius: 18px; padding: 34px 32px 30px; width: min(410px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.logo-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #f0a46e, #c45a14); color: #fff; font-weight: 800; font-size: 17px; margin-right: 10px; box-shadow: 0 4px 12px rgba(196, 90, 20, .4); }
.logo-mark.big { width: 52px; height: 52px; font-size: 28px; border-radius: 15px; margin: 0 0 14px; }
.logo-big { font-size: 30px; font-weight: 750; letter-spacing: -.3px; }
.logo-big::after, .logo::after { content: "."; color: #f0a46e; }
.login-err { color: var(--bad); min-height: 22px; margin: 8px 0; font-size: 13px; }

/* ---------- Startseite ---------- */
.hero { background: radial-gradient(900px 400px at 0% 0%, #2b4a5c 0%, transparent 60%), radial-gradient(700px 380px at 100% 0%, #5c3150 0%, transparent 60%), linear-gradient(180deg, #182129, #1d2832); color: #fff; padding: 18px 0 70px; }
.hero-in { max-width: 1240px; margin: 0 auto; padding: 0 36px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 38px; }
.hero .logo { font-size: 22px; font-weight: 750; display: flex; align-items: center; }
.hero h1 { font-size: 34px; letter-spacing: -.6px; }
.hero-date { color: #a9bac5; margin: 0 0 22px; font-size: 15px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: #dbe4ea; font-size: 13.5px; margin-right: 4px; }
.user-chip .hint { color: #8fa3b0; }
.avatar { width: 28px; height: 28px; border-radius: 99px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #f0a46e, #b0417a); color: #fff; font-weight: 700; font-size: 13px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hs { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 16px; min-width: 120px; backdrop-filter: blur(4px); }
.hs b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.hs span { color: #a9bac5; font-size: 12.5px; }
.hs.bad b { color: #ff9b8f; }
.home-body { max-width: 1240px; margin: -46px auto 0; padding: 0 36px 60px; }
h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 30px 2px 12px; font-weight: 650; }
.home-body h2.sec:first-child { color: #c3d0d8; margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.tile { --accent: #2f6f8f; position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 6px 24px rgba(20, 24, 28, .08); transition: box-shadow .18s, transform .18s; }
.tile:hover { box-shadow: 0 16px 40px rgba(20, 24, 28, .16); transform: translateY(-3px); }
.tile-top { display: flex; gap: 14px; align-items: center; padding: 18px 20px 16px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #1b1a18)); color: #fff; }
.tile-icon { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.tile-icon svg { width: 26px; height: 26px; }
.tile-title { min-width: 0; flex: 1; }
.tile h2 { font-size: 20px; margin: 0; color: #fff; }
.tile .type { font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 600; opacity: .8; }
.tile-badge { align-self: flex-start; background: rgba(255,255,255,.2); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.tile-badge.bad { background: #fff; color: var(--bad); }
.tile-badge.ok { background: rgba(255,255,255,.16); }
.tile-hero { padding: 16px 20px 6px; }
.tile-hero .big { font-size: 28px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.tile .facts { display: grid; gap: 6px; padding: 8px 20px 4px; flex: 1; align-content: start; }
.tile .fact { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 13.5px; }
.tile .fact span { color: var(--ink-2); }
.tile .fact b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.tile .fact.alert b { color: var(--bad); }
.tile-foot { display: flex; justify-content: space-between; padding: 12px 20px 14px; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.tile-foot span:last-child { transition: transform .18s; }
.tile:hover .tile-foot span:last-child { transform: translateX(3px); }
.tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed #cfc8bf; color: var(--ink-2); font-size: 16px; min-height: 250px; background: rgba(255,255,255,.55); box-shadow: none; font-weight: 600; }
.tile.add:hover { background: #fff; border-color: #b9b0a5; }
.tile.add .plus { width: 46px; height: 46px; border-radius: 99px; display: grid; place-items: center; background: #ece7e0; font-size: 26px; font-weight: 400; margin-bottom: 6px; }
.today { padding: 6px 8px; }
.today-row { display: grid; grid-template-columns: 150px 1fr 170px 110px; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.today-row:last-child { border-bottom: none; }
.today-row:hover { background: var(--surface-2); }
.today-row .tb { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.today-row .tb::before { content: ""; width: 9px; height: 9px; border-radius: 99px; background: var(--accent); flex: none; }
.today-row .tt { display: flex; flex-direction: column; min-width: 0; }
.today-row .tt .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-row .td { font-size: 13px; color: var(--ink-2); }
.today-row .tv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { width: 30px; height: 30px; border-radius: 99px; cursor: pointer; margin: 0; border: 3px solid transparent; }
.colors input { display: none; }
.colors input:checked + label { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.tpl-pick { display: grid; gap: 10px; }
.tpl-pick label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--ink); font-size: 14px; }
.tpl-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tpl-pick input { width: auto; margin-top: 3px; }
.tpl-pick small { display: block; color: var(--muted); }

/* ---------- Kooperations-Board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(175px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #ece8e2; border-radius: 12px; padding: 10px; min-height: 260px; }
.col.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.col h3 { font-size: 12.5px; margin: 2px 4px 10px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.col h3 span { display: block; font-weight: 500; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.kcard { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); cursor: grab; border-left: 3px solid var(--accent); transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1); transform: translateY(-1px); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .m { font-weight: 650; }
.kcard .t { color: var(--ink-2); font-size: 13px; margin: 2px 0 6px; }
.kcard .f { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12.5px; flex-wrap: wrap; }
.kcard .g { font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  #app-screen { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  main { padding: 20px 16px 60px; }
  .hero-in, .home-body { padding-left: 16px; padding-right: 16px; }
  .today-row { grid-template-columns: 1fr; gap: 4px; }
  .form { grid-template-columns: 1fr; }
  .zrow { grid-template-columns: 1fr 1fr; }
}

/* ---------- Version 5 ---------- */
.lockbar { background: #eef3fb; color: #1f4f8f; border: 1px solid #cfdcf0; border-radius: 9px; padding: 8px 12px; font-size: 13px; margin: -6px 0 14px; }
.lockbar.draft { background: #fbf4e6; color: #8a5a12; border-color: #efdcb4; }
.chip.ext { background: #e9eef3; color: #3d5466; border-left-color: #6d8597; }
.chip.rechnung { background: #fbe9e6; color: #9b2c22; border-left-color: var(--bad); }
.chip.aufgabe { background: #e8f1e8; color: #276127; border-left-color: var(--good); }
.agenda-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.agenda-row.click { cursor: pointer; }
.agenda-row:hover { background: var(--surface-2); }
.agenda-row .ad { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.mini { width: 160px; display: grid; gap: 2px; }
.mini i { display: block; height: 6px; border-radius: 0 3px 3px 0; min-width: 1px; }
.mini i.e, .legend.e { background: var(--bar); }
.mini i.a, .legend.a { background: #e0884a; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
tr.done td { opacity: .5; }

/* ---------- Dunkelmodus ---------- */
[data-theme="dark"] {
  --bg: #10151a; --surface: #182028; --surface-2: #1f2832; --ink: #e6ebee; --ink-2: #b3c0c8; --muted: #8796a1; --line: #2b3640;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, #182028);
  --accent-ink: color-mix(in srgb, var(--accent) 75%, white);
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 14px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #121920; border-color: #33404b; color: var(--ink); }
[data-theme="dark"] button:hover, [data-theme="dark"] .btn:hover { border-color: #46525c; }
[data-theme="dark"] .badge { background: #26313b; }
[data-theme="dark"] .badge.good { background: #163319; color: #6fd06f; }
[data-theme="dark"] .badge.warn { background: #3a2c12; color: #f0bc5e; }
[data-theme="dark"] .badge.bad { background: #3d1c19; color: #ff8b80; }
[data-theme="dark"] .badge.info { background: #182c45; color: #8cb8f0; }
[data-theme="dark"] .pos { color: #6fd06f; }
[data-theme="dark"] .neg { color: #ff8b80; }
[data-theme="dark"] .col { background: #141b22; }
[data-theme="dark"] .occ, [data-theme="dark"] .tile.add .plus { background: #2b3640; }
[data-theme="dark"] .cal .other { background: #141a20; color: #56626c; }
[data-theme="dark"] .beleg { background: var(--surface-2); }
[data-theme="dark"] .beleg .ficon { background: #26313b; }
[data-theme="dark"] .tile.add { background: rgba(255,255,255,.03); border-color: #34414c; }
[data-theme="dark"] .tile.add:hover { background: var(--surface); }
[data-theme="dark"] .welcome { background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); }
[data-theme="dark"] .lockbar { background: #172537; color: #9cc0ee; border-color: #26405f; }
[data-theme="dark"] .lockbar.draft { background: #2e2513; color: #e8c27a; border-color: #4a3b1a; }
[data-theme="dark"] .chip.ext { background: #22303b; color: #b7c8d4; }
[data-theme="dark"] .chip.rechnung { background: #3a1d1a; color: #ffaaa1; }
[data-theme="dark"] .chip.aufgabe { background: #19301b; color: #9fdc9f; }
[data-theme="dark"] .login-card { background: var(--surface); }
[data-theme="dark"] .dropzone { border-color: #34414c; }
[data-theme="dark"] .home-body h2.sec:first-child { color: #9fb0bb; }

.zbel { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.zchip { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.zchip.ok { background: #e2f3e2; color: var(--good); border-color: #c4e5c4; }
.zchip.voll { background: #fbe3e0; color: var(--bad); border-color: #f2c4bf; }
.zchip.offen { background: #fbefd9; color: var(--warn); border-color: #f0dbb1; }
.prow { display: grid; grid-template-columns: 70px 1.2fr 1.2fr 70px 1fr 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.pday { font-weight: 600; font-size: 13px; line-height: 1.2; }
button.danger-bg { background: var(--bad); border-color: var(--bad); }

.metriken { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.fb { padding: 4px 0; font-size: 13px; }

/* ================= v6: Bedienkomfort ================= */
.toast { display: flex; align-items: center; gap: 14px; }
.toast[hidden] { display: none; }
.toast-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); font-weight: 600; }
.toast-btn:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.side-quick { display: flex; gap: 8px; margin: 0 14px 12px; }
.side-quick .side-search { margin: 0; flex: 1; min-width: 0; }
.side-neu { background: var(--accent); color: #fff; border: none; border-radius: 9px; padding: 8px 12px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.side-neu:hover { background: var(--accent-ink); color: #fff; }

kbd { font: 11px/1.4 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface-2); color: var(--ink-2); }

.einrichtung { border-left: 4px solid var(--accent); }
.fortschritt { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: -2px 0 14px; }
.fortschritt i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.schritte { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.schritt { white-space: normal; min-width: 0; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 400; line-height: 1.35; }
.schritt:hover { border-color: var(--accent); background: var(--accent-soft); }
.schritt .haken { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--line); color: var(--ink-2); }
.schritt.ok { opacity: .62; }
.schritt.ok .haken { background: var(--good); border-color: var(--good); color: #fff; }
.schritt.ok strong { text-decoration: line-through; text-decoration-color: var(--muted); }
@keyframes blink { 0%, 100% { box-shadow: var(--shadow); } 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); } }
.blink { animation: blink 1.2s ease 2; }

main { position: relative; }
.hilfe-btn { position: absolute; top: 30px; right: 40px; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-weight: 700; font-size: 15px; color: var(--ink-2); z-index: 2; }
.hilfe-btn:hover { color: var(--accent); border-color: var(--accent); }
main > .head, main > div > .head:first-child { padding-right: 46px; }
.hilfe-text { font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-line; }

.table-wrap th { cursor: pointer; user-select: none; }
.table-wrap th:empty { cursor: default; }
.table-wrap th[data-sort]::after { content: " ▲"; font-size: 9px; color: var(--accent); }
.table-wrap th[data-sort="ab"]::after { content: " ▼"; }

.neu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.neu-item { display: flex; align-items: center; gap: 10px; padding: 14px; font-size: 14px; font-weight: 600; text-align: left; border-radius: 10px; }
.neu-item .plus { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 18px; flex: none; }
.neu-item:hover { border-color: var(--accent); }

.logo-zeile { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-vorschau { max-width: 180px; max-height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.logo-leer { width: 180px; height: 90px; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }

code.url { font: 12px/1.4 ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; word-break: break-all; color: var(--ink); }
#flink { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.url-box { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.url-box code.url { flex: 1; }
.anleitung { padding-left: 20px; line-height: 1.6; }
.anleitung li { margin-bottom: 6px; }
.h3 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .4px; }
.geplant { margin: 0; padding-left: 20px; color: var(--ink-2); line-height: 1.7; }
.geplant li::marker { content: "◷  "; color: var(--muted); }

@media (max-width: 760px) { .hilfe-btn { top: 16px; right: 16px; } }
[data-theme="dark"] .logo-vorschau { background: #e9edf0; }
[data-theme="dark"] .toast { background: #2a3540; }
tr.aktiv td { background: var(--accent-soft); }

/* Team-Übersicht */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 30px; }
.team-karte { margin: 0; display: flex; flex-direction: column; }
.team-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-kopf .avatar { width: 40px; height: 40px; font-size: 17px; flex: none; }
.team-kopf .avatar.leer { background: var(--surface-2); color: var(--muted); border: 2px dashed var(--line); }
.team-kopf .team-neu { margin-left: auto; }
.team-liste { display: grid; gap: 6px; }
.team-auf { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; font-weight: 400; background: var(--surface); }
.team-auf i { width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); flex: none; }
.team-auf .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; white-space: normal; }
.team-auf .tt .hint { font-size: 11.5px; }
.team-auf:hover { border-color: var(--accent); }
.team .empty { padding: 14px 4px; color: var(--muted); font-size: 13px; }
.today-row .tt .badge { align-self: flex-start; }
