/* ============================================================
   VENTAIX Planer – Aussehen
   Datei 5 von 9
   ============================================================ */

/* ------------------------------------------------------------
   1. Farben und Grundwerte (hell / dunkel automatisch)
   ------------------------------------------------------------ */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --line: #dde1e6;
  --text: #1c2026;
  --text-2: #5b6470;
  --accent: #1f5fa8;
  --accent-soft: #e3edf8;
  --green: #2e8b57;  --green-soft: #e2f3ea;
  --yellow: #c48a00; --yellow-soft: #fbf1d6;
  --red: #c23b32;    --red-soft: #f9e3e1;
  --gray-soft: #eceef1;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.06);
  --radius: 10px;
  --top-h: 56px;
  --side-w: 236px;
  --tab-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --surface: #1f2227;
    --surface-2: #272b31;
    --line: #343941;
    --text: #e8eaed;
    --text-2: #9aa3ad;
    --accent: #5b9be0;
    --accent-soft: #1f3550;
    --green: #4cb57d;  --green-soft: #1d3a2b;
    --yellow: #e0aa2e; --yellow-soft: #3d3218;
    --red: #e3675e;    --red-soft: #46221f;
    --gray-soft: #2c3036;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.25);
  }
}

/* ------------------------------------------------------------
   2. Grundlagen
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { padding: 28px 12px; text-align: center; color: var(--text-2); }
.spacer { flex: 1; }

/* ------------------------------------------------------------
   3. Kopfleiste mit Logo (immer sichtbar)
   ------------------------------------------------------------ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--top-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 1.1rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { margin-left: auto; display: flex; align-items: center; height: 100%; padding: 8px 0; min-width: 0; }
.brand img { max-height: 38px; max-width: 160px; width: auto; height: auto; object-fit: contain; }
.brand span { font-weight: 650; color: var(--text-2); white-space: nowrap; }
.timer-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 6px 12px;
  background: var(--red-soft); color: var(--red); font: 600 .9rem var(--font);
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ------------------------------------------------------------
   4. Menü (PC: links fest, iPhone: ausklappbar)
   ------------------------------------------------------------ */
.sidebar {
  position: fixed; z-index: 30; left: 0;
  top: calc(var(--top-h) + var(--safe-top)); bottom: 0; width: var(--side-w);
  overflow-y: auto; padding: 12px 10px 24px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.nav-group { margin-bottom: 14px; }
.nav-label { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 6px 12px; }
.sidebar a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-weight: 500;
}
.sidebar a svg { color: var(--text-2); }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar a.active svg { color: var(--accent); }
.side-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.35); }

/* ------------------------------------------------------------
   5. Inhaltsbereich
   ------------------------------------------------------------ */
.view {
  margin-left: var(--side-w);
  padding: calc(var(--top-h) + var(--safe-top) + 20px) 24px 40px;
  max-width: calc(1280px + var(--side-w));
  outline: none;
}
.view.wide { max-width: none; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { font-size: 1.3rem; }
.section-title { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 22px 0 8px; }

/* ------------------------------------------------------------
   6. Untere Leiste (iPhone)
   ------------------------------------------------------------ */
.only-mobile { display: none !important; }
.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--text-2); font: 500 .68rem var(--font); padding: 6px 0; cursor: pointer;
}
.tabbar a.active { color: var(--accent); }
.tabbar svg { width: 23px; height: 23px; }
.tabbar .tab-timer {
  flex: 0 0 auto; width: 54px; height: 54px; margin-top: -18px; border-radius: 50%;
  background: var(--accent); color: #fff; justify-content: center; box-shadow: var(--shadow);
}
.tabbar .tab-timer svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar .tab-timer.running { background: var(--red); }

/* ------------------------------------------------------------
   7. Knöpfe und Eingabefelder
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 550 .92rem var(--font); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: 0; background: none; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 16px var(--font); /* 16px verhindert Zoomen auf dem iPhone */
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 3px; height: 40px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }

/* Umschalter (z. B. Woche / Monat / Quartal) */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; color: var(--text-2); font: 550 .86rem var(--font); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 140px; }

/* ------------------------------------------------------------
   8. Karten, Listen, Tabellen
   ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.card-head h3 { flex: 1; }
.card-body { padding: 14px 16px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.cards .card { margin-bottom: 0; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--accent); }
.color-bar { height: 4px; border-radius: var(--radius) var(--radius) 0 0; }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--surface-2); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 550; overflow-wrap: anywhere; }
.item-sub { font-size: .84rem; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.item-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.item.done .item-title { text-decoration: line-through; color: var(--text-2); }
.item.sub { padding-left: 44px; background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.item .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: none; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; padding: 0; color: #fff; }
.tick svg { width: 14px; height: 14px; stroke-width: 3; }
.tick.on { background: var(--green); border-color: var(--green); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .78rem; font-weight: 650; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 650; border-top: 2px solid var(--line); }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table input { min-height: 34px; padding: 4px 8px; }

/* ------------------------------------------------------------
   9. Kennzeichen: Status, Ampel, Fortschritt
   ------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.red { background: var(--red-soft); color: var(--red); }
.ampel { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ampel.gruen { background: var(--green); } .ampel.gelb { background: var(--yellow); } .ampel.rot { background: var(--red); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.progress.green > span { background: var(--green); }

/* Kennzahlen-Kacheln */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: .8rem; color: var(--text-2); font-weight: 550; }
.kpi-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.kpi.alert .kpi-value { color: var(--red); }

/* ------------------------------------------------------------
   10. Stoppuhr, Checkliste, Kommentare
   ------------------------------------------------------------ */
.timer-big { font-size: 2.6rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 6px 0 14px; }
.timer-card { border-left: 4px solid var(--red); }

.check-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.check-item span { flex: 1; overflow-wrap: anywhere; }
.check-item.done span { text-decoration: line-through; color: var(--text-2); }
.check-add { display: flex; gap: 8px; margin-top: 8px; }

.comment { padding: 9px 0; border-bottom: 1px solid var(--line); }
.comment-head { font-size: .8rem; color: var(--text-2); margin-bottom: 2px; display: flex; gap: 8px; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Schwebender Plus-Knopf (iPhone) */
.fab {
  position: fixed; z-index: 35; right: 18px; bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px);
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
  display: none; align-items: center; justify-content: center;
}
.fab svg { width: 26px; height: 26px; }

/* ------------------------------------------------------------
   11. Fenster (Formulare) und Meldungen
   ------------------------------------------------------------ */
.modal {
  border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(10,14,20,.45); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px 18px 6px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.modal.wide { width: min(860px, calc(100vw - 24px)); }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--safe-bottom) + 24px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 550; box-shadow: var(--shadow); transition: .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }

/* ------------------------------------------------------------
   12. Anmeldeseite
   ------------------------------------------------------------ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 16px 24px; }
.auth-box { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { max-width: 220px; max-height: 80px; object-fit: contain; margin-bottom: 12px; }
.auth-brand h1 { font-size: 1.3rem; }
.auth .btn.primary { width: 100%; min-height: 44px; margin-top: 4px; }
.auth .error { color: var(--red); font-size: .9rem; margin-bottom: 10px; }

/* ------------------------------------------------------------
   13. Gantt-Diagramm (Inhalt erzeugt gantt.js)
   ------------------------------------------------------------ */
.gantt { position: relative; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100dvh - var(--top-h) - var(--safe-top) - 170px); }
.g-inner { position: relative; }
.g-head { position: sticky; top: 0; z-index: 4; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-head-label { position: sticky; left: 0; z-index: 5; flex: 0 0 var(--g-label); background: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px; font-size: .78rem; font-weight: 650; color: var(--text-2); display: flex; align-items: flex-end; }
.g-scale { position: relative; height: 44px; }
.g-scale .g-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); font-size: .72rem; color: var(--text-2); padding: 3px 4px; white-space: nowrap; overflow: hidden; }
.g-scale .g-tick.major { font-weight: 650; color: var(--text); }
.g-scale .g-tick.low { top: 22px; }
.g-row { display: flex; height: 34px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.g-row.group { background: var(--surface-2); }
.g-label {
  position: sticky; left: 0; z-index: 3; flex: 0 0 var(--g-label); background: inherit; background-color: var(--surface);
  border-right: 1px solid var(--line); padding: 0 10px; display: flex; align-items: center; gap: 6px;
  font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.g-row.group .g-label { background-color: var(--surface-2); font-weight: 650; }
.g-row.sub .g-label { padding-left: 30px; color: var(--text-2); }
.g-label .g-toggle { width: 16px; color: var(--text-2); font-size: .7rem; flex-shrink: 0; }
.g-label .g-name { overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; flex: 1 0 auto; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); pointer-events: none; }
.g-grid.weekend { border-left: 0; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.g-bar {
  position: absolute; top: 7px; height: 20px; border-radius: 5px; background: var(--accent);
  color: #fff; font-size: .74rem; font-weight: 600; padding: 0 6px; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; touch-action: pan-y; z-index: 1;
}
.g-bar .g-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.28); pointer-events: none; }
.g-bar span { position: relative; }
.g-bar.project { top: 9px; height: 16px; line-height: 16px; opacity: .85; border-radius: 3px; }
.g-bar.sub { top: 10px; height: 14px; line-height: 14px; font-size: .68rem; opacity: .9; }
.g-bar.done { opacity: .45; }
.g-bar.roadmap { background: #7a5cb8; }
.g-bar.drag { opacity: .7; outline: 2px solid var(--text); }
.g-bar .g-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.g-bar .g-handle.l { left: 0; } .g-bar .g-handle.r { right: 0; }
.g-milestone { position: absolute; top: 9px; width: 16px; height: 16px; transform: translateX(-8px) rotate(45deg); background: var(--yellow); border-radius: 2px; cursor: pointer; z-index: 1; }
.g-milestone.done { opacity: .45; }
.g-event { position: absolute; top: 8px; width: 6px; height: 18px; border-radius: 3px; background: var(--green); cursor: pointer; z-index: 1; }
.g-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); margin-top: 8px; }
.g-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Auslastung */
.load-cell { text-align: center; border-radius: 6px; padding: 6px 4px; font-size: .82rem; font-variant-numeric: tabular-nums; }
.load-cell.ok { background: var(--green-soft); color: var(--green); }
.load-cell.high { background: var(--yellow-soft); color: var(--yellow); }
.load-cell.over { background: var(--red-soft); color: var(--red); }
.load-cell.none { color: var(--text-2); }

/* Einfaches Balkendiagramm (Finanzen) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 8px 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 40%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--accent-soft); min-height: 2px; }
.bar.actual { background: var(--accent); }
.bar.cost { background: var(--red); opacity: .7; }
.bar-label { font-size: .72rem; color: var(--text-2); }

/* ------------------------------------------------------------
   14. iPhone und schmale Bildschirme
   ------------------------------------------------------------ */
@media (max-width: 899px) {
  .only-mobile { display: flex !important; }
  .only-desktop { display: none !important; }
  .topbar { padding-left: 8px; padding-right: 14px; gap: 6px; }
  .brand img { max-height: 32px; max-width: 120px; }
  .sidebar {
    top: 0; padding-top: calc(var(--safe-top) + 16px); width: min(290px, 84vw); z-index: 50;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .side-backdrop { z-index: 49; }
  .view { margin-left: 0; padding: calc(var(--top-h) + var(--safe-top) + 14px) 14px calc(var(--tab-h) + var(--safe-bottom) + 90px); }
  .fab { display: flex; }
  .page-head .btn.primary.hide-mobile { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid2.keep { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .item { padding: 11px 14px; }
  .item.sub { padding-left: 36px; }
  .toolbar select, .toolbar input { flex: 1 1 100%; min-width: 0; }
  .toolbar input[type=date] { flex: 1 1 40%; }
  .tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex-shrink: 0; }
  .modal { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .modal-inner { max-height: 94dvh; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .left { flex: 0 0 auto; }
  .gantt { max-height: calc(100dvh - var(--top-h) - var(--safe-top) - var(--tab-h) - var(--safe-bottom) - 150px); }
  .kpi-value { font-size: 1.3rem; }
}

/* Druckansicht: nur Inhalt */
@media print {
  .topbar, .sidebar, .tabbar, .fab, .toolbar .btn { display: none !important; }
  .view { margin: 0; padding: 0; }
  .card { box-shadow: none; }
}
