:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #677085;
  --border: #dce3ef;
  --accent: #1f5eff;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.topbar { height:64px; display:flex; align-items:center; justify-content:space-between; padding:0 24px; background:#fff; border-bottom:1px solid var(--border); }
.brand { font-weight:800; font-size:24px; color:var(--text); letter-spacing:-.03em; }
nav { display:flex; align-items:center; gap:16px; }
.inline-form { display:inline; }
.inline-form button { background:transparent; color:var(--accent); border:0; cursor:pointer; font:inherit; }
.container { max-width:1120px; margin:32px auto; padding:0 20px; }
.container.wide { max-width:1440px; }
.container.narrow { max-width:720px; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:24px; }
h1 { margin:0 0 8px; font-size:32px; }
h2 { margin:0 0 16px; font-size:20px; }
.muted { color:var(--muted); margin-top:0; }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:20px; margin-bottom:20px; box-shadow:0 1px 3px rgba(16,24,40,.04); }
.button, button { background:var(--accent); color:#fff; border:0; border-radius:10px; padding:10px 14px; font-weight:700; cursor:pointer; }
input, select, textarea { width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font:inherit; background:#fff; }
textarea { min-height:100px; }
.form-grid { display:grid; grid-template-columns: 160px 1fr; gap:12px; align-items:center; }
.form-grid button { grid-column:2; width:max-content; }
.task-form { display:grid; grid-template-columns: 2fr 180px 160px 160px auto; gap:12px; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--border); vertical-align:top; }
th { color:var(--muted); font-size:13px; }
.badge { display:inline-flex; padding:6px 10px; border-radius:999px; background:#e8efff; color:#1f4ed8; font-weight:700; }
.notice { padding:14px 16px; background:#fff7e6; border:1px solid #ffd591; border-radius:12px; margin-bottom:20px; }
.alert { padding:14px 16px; background:#fff1f0; border:1px solid #ffa39e; color:var(--danger); border-radius:12px; margin-bottom:16px; }
.login-body { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:100%; max-width:420px; background:#fff; border:1px solid var(--border); border-radius:18px; padding:32px; box-shadow:0 10px 30px rgba(16,24,40,.08); }
.login-card h1 { font-size:42px; letter-spacing:-.06em; }
.login-card form { display:grid; gap:10px; }
.gantt-placeholder { min-height:180px; border:1px dashed var(--border); border-radius:12px; display:grid; place-items:center; color:var(--muted); background:#fafcff; }
.footer { max-width:1120px; margin:40px auto; color:var(--muted); padding:0 20px; }
pre { margin:0; white-space:pre-wrap; font-size:12px; }
@media (max-width: 800px) { .task-form, .form-grid { grid-template-columns:1fr; } .form-grid button { grid-column:1; } .page-head { flex-direction:column; } }

/* planwerk 1.1.1 */
.button.secondary, button.secondary { background:#eef2f7; color:#1d2433; }
.button.danger, button.danger, .danger { background:var(--danger); color:#fff; }
.button-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.inline-grid { display:grid; gap:12px; align-items:center; }
.inline-grid.three { grid-template-columns: 1fr 1.5fr auto; }
.task-form.expanded { grid-template-columns: 1.8fr 180px 160px 150px 150px 150px 90px auto; }
.actions { white-space:nowrap; }
.small-link { font-size:13px; font-weight:700; }
.small-text { font-size:13px; margin-top:4px; }
.small, button.small { font-size:12px; padding:6px 9px; border-radius:8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.success { background:#ecfdf3; border-color:#abefc6; color:#067647; }
.danger-zone { border-color:#fecdca; }
.chip-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.chip { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--border); border-radius:999px; padding:6px 10px; background:#f8fafc; }
.chip-delete { background:transparent; color:var(--danger); padding:0; border:0; font-size:18px; line-height:1; }
.alert.mini { margin-top:8px; padding:8px 10px; font-size:12px; }
.checkline { display:flex; align-items:center; gap:8px; }
.checkline input { width:auto; }
.live-notice { position:fixed; right:20px; bottom:20px; background:#1d2433; color:#fff; border-radius:12px; padding:14px 16px; box-shadow:0 10px 30px rgba(0,0,0,.2); z-index:9999; display:flex; gap:12px; align-items:center; }
.live-notice button { background:#fff; color:#1d2433; padding:7px 10px; }
.status-blocked td { background:#fff7e6; }
.status-done td { background:#f6fef9; }
@media (max-width: 1100px) { .task-form.expanded, .inline-grid.three { grid-template-columns:1fr; } }

/* planwerk 1.1.2 gantt */
.gantt-toolbar-info { display:flex; gap:18px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.gantt-root { overflow:auto; border:1px solid var(--border); border-radius:12px; background:#fff; max-height:70vh; }
.gantt-shell { --label-width: 330px; --row-height: 42px; display:grid; grid-template-columns: var(--label-width) auto; position:relative; min-width:max-content; }
.gantt-head-left, .gantt-head-timeline { position:sticky; top:0; z-index:5; background:#f8fafc; border-bottom:1px solid var(--border); font-weight:700; }
.gantt-head-left { left:0; z-index:8; padding:12px; border-right:1px solid var(--border); }
.gantt-head-timeline { display:flex; height:44px; overflow:hidden; }
.gantt-day-head { width:var(--day-width); min-width:var(--day-width); height:44px; display:flex; align-items:center; justify-content:center; border-right:1px solid #edf1f7; font-size:11px; color:#475467; }
.gantt-day-head.weekend, .gantt-day.weekend { background:#f6f7f9; }
.gantt-day-head.today, .gantt-day.today { background:#fff7cc; }
.gantt-task-label { position:sticky; left:0; z-index:4; height:42px; padding:7px 10px; border-right:1px solid var(--border); border-bottom:1px solid #eef2f7; background:#fff; overflow:hidden; }
.gantt-task-label small { display:block; color:#667085; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gantt-row { position:relative; display:flex; height:42px; border-bottom:1px solid #eef2f7; }
.gantt-day { width:var(--day-width); min-width:var(--day-width); height:42px; border-right:1px solid #edf1f7; }
.gantt-bar { position:absolute; top:8px; height:26px; border-radius:8px; background:#246bfd; color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; cursor:grab; box-shadow:0 2px 8px rgba(36,107,253,.25); user-select:none; overflow:hidden; }
.gantt-bar.dragging { opacity:.75; cursor:grabbing; }
.gantt-bar.status-done { background:#12b76a; }
.gantt-bar.status-blocked { background:#f79009; }
.gantt-bar.type-summary { background:#344054; }
.gantt-bar.type-buffer { background:#7a5af8; }
.gantt-bar.type-external_date { background:#0086c9; }
.gantt-bar.milestone { width:24px !important; height:24px; transform:rotate(45deg); border-radius:4px; justify-content:center; }
.gantt-resize-handle { position:absolute; right:0; top:0; width:10px; height:100%; cursor:ew-resize; background:rgba(255,255,255,.25); }
.gantt-lines { position:absolute; left:var(--label-width); top:44px; pointer-events:none; z-index:3; overflow:visible; }
.gantt-dependency { fill:none; stroke:#475467; stroke-width:1.5; opacity:.9; }
.gantt-dependency.soft { stroke-dasharray:5 4; opacity:.75; }
.gantt-dependency.documentation { stroke-dasharray:2 4; opacity:.6; }
.gantt-lines marker path { fill:#475467; }
.dependency-form { display:grid; grid-template-columns: 1.4fr auto 1.4fr 150px 140px 110px 110px auto; gap:10px; align-items:center; }
.warning-card { border-color:#fedf89; }
.warning-list { margin:0; padding-left:18px; }
.warning-list li { margin:6px 0; }
.severity-error { color:#b42318; }
.severity-warning { color:#b54708; }
.severity-info { color:#175cd3; }
@media (max-width: 1200px) { .dependency-form { grid-template-columns:1fr; } .gantt-shell { --label-width: 260px; } }

/* planwerk 1.1.3 critical path / analysis */
.kpi-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap:14px; margin:18px 0; }
.kpi-card { background:#fff; border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow:0 8px 22px rgba(16,24,40,.04); }
.kpi-card span { display:block; color:#667085; font-size:13px; margin-bottom:8px; }
.kpi-card strong { display:block; font-size:28px; line-height:1; color:#101828; }
.kpi-card.warning { border-color:#fedf89; background:#fffcf5; }
.kpi-card.critical { border-color:#fecdca; background:#fffbfa; }
.kpi-card.critical strong, .critical-row td:first-child, .critical-row strong { color:#b42318; }
.critical-row { background:#fffbfa; }
.gantt-bar.critical { background:#d92d20; box-shadow:0 2px 8px rgba(217,45,32,.30); }
.gantt-bar.critical.status-done { background:#12b76a; }
.split-card { display:grid; grid-template-columns: 1.4fr .8fr; gap:24px; align-items:start; }
.warning-list.large li { margin:10px 0; }
.plain-list { margin:0; padding-left:20px; }
.plain-list li { margin:8px 0; }
@media (max-width: 900px) { .split-card { grid-template-columns:1fr; } }

/* planwerk 1.1.3 hotfix: kritischen Pfad im Gantt deutlich anzeigen */
.gantt-bar.critical:not(.status-done),
.gantt-bar[data-critical="1"]:not(.status-done) {
  background: #d92d20 !important;
  border: 2px solid #7a271a !important;
  box-shadow: 0 0 0 2px rgba(217,45,32,.18), 0 3px 10px rgba(217,45,32,.35) !important;
}
.gantt-task-label:has(+ .gantt-row .gantt-bar[data-critical="1"]) strong {
  color: #b42318;
}

/* planwerk dependency line alignment hotfix */
.gantt-lines {
  pointer-events: none;
  overflow: visible;
}
.gantt-dependency {
  vector-effect: non-scaling-stroke;
}

/* planwerk gantt drag save hotfix */
.gantt-bar.saving {
  opacity: .72;
  cursor: progress !important;
}
.gantt-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
  font-weight: 700;
}
.gantt-toast.ok { background: #166534; }
.gantt-toast.error { background: #991b1b; }
.gantt-toast.saving { background: #1d4ed8; }
.gantt-toast[hidden] { display: none; }

/* planwerk gantt date-offset v4 */
.gantt-bar.critical:not(.status-done):not(.status-cancelled) {
  background: #c62828 !important;
  border-color: #8e0000 !important;
}
.gantt-bar.saving {
  opacity: 0.72;
}
#ganttToast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  font-size: 14px;
}
#ganttToast.ok { background: #1b5e20; }
#ganttToast.error { background: #b71c1c; }
#ganttToast.saving { background: #374151; }

/* planwerk 1.1.4 reports exports */
.button-row.wrap { flex-wrap: wrap; gap: 10px; }
.vertical-actions { display:flex; flex-direction:column; align-items:flex-start; }
.print-toolbar { display:flex; justify-content:space-between; gap:12px; margin:18px 0; }
.report-page { background:#fff; }
.report-header { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin:18px 0 24px; border-bottom:2px solid var(--border); padding-bottom:16px; }
.report-header h1 { margin-bottom:4px; }
.report-header h2 { margin:0; font-size:22px; }
.report-meta { min-width:220px; font-size:14px; line-height:1.7; }
.report-section { margin:16px 0; }
.compact-table { font-size:13px; }
.compact-table th, .compact-table td { padding:7px 8px; }
.no-page-break { page-break-inside: avoid; }
.page-break-before { page-break-before: always; }
.print-gantt-card { overflow-x:auto; }
.print-gantt { display:grid; grid-template-columns: 280px 1fr; align-items:stretch; border:1px solid var(--border); border-radius:12px; overflow:auto; background:#fff; }
.print-gantt-head { position:sticky; top:0; z-index:2; background:#f8fafc; border-bottom:1px solid var(--border); font-weight:700; }
.task-label-head { padding:8px 10px; border-right:1px solid var(--border); }
.timeline-head { display:grid; min-width:max-content; }
.print-day-head { width:18px; min-width:18px; text-align:center; font-size:10px; padding:8px 0; border-left:1px solid #eef2f6; }
.print-day-head.weekend, .print-day.weekend { background:#f2f4f7; }
.print-day-head.today, .print-day.today { background:#d1e9ff; }
.print-task-label { min-height:28px; padding:6px 8px; border-right:1px solid var(--border); border-bottom:1px solid #eef2f6; font-size:12px; }
.print-task-label small { display:block; color:#667085; margin-top:2px; }
.critical-text { color:#b42318; font-weight:700; }
.print-task-row { display:grid; position:relative; min-width:max-content; min-height:28px; border-bottom:1px solid #eef2f6; }
.print-day { width:18px; min-width:18px; border-left:1px solid #f2f4f7; }
.print-bar { align-self:center; height:12px; border-radius:8px; background:#2e90fa; z-index:1; margin:0 2px; text-align:center; color:#fff; font-size:10px; line-height:12px; }
.print-bar.critical { background:#d92d20; }
.print-bar.status-done { background:#12b76a; }
.print-bar.type-milestone { background:transparent; color:#7a271a; font-size:16px; line-height:16px; height:16px; }
.print-note { margin-top:10px; }
@media print {
  body { background:#fff !important; color:#000; }
  .no-print, .app-header, .footer, header.site-header, nav { display:none !important; }
  .container, .container.wide { max-width:none; width:100%; padding:0; margin:0; }
  .card, .kpi-card { box-shadow:none !important; border-color:#999 !important; }
  .report-header { border-bottom-color:#333; }
  a { color:#000; text-decoration:none; }
  table { page-break-inside:auto; }
  tr { page-break-inside:avoid; page-break-after:auto; }
  .report-section { page-break-inside:auto; }
  .print-gantt { overflow:visible; font-size:11px; }
  .print-gantt-card { overflow:visible; }
  @page { size: A4 landscape; margin: 10mm; }
}
