
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1f2937;
  --muted: #64748b;
  --line: #dbe3ec;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5eefb;
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.brand-sub { color: #94a3b8; font-size: .92rem; margin-bottom: 22px; }

.nav-group { margin: 24px 0 10px; }
.nav-group h4 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; }
.nav-link {
  display: block;
  color: #dbeafe;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  transition: background .15s ease;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(59, 130, 246, 0.16);
  text-decoration: none;
}
.sidebar-footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(148,163,184,.25); font-size: .92rem; color: #cbd5e1; }

.main { padding: 28px 32px 44px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.page-title { font-size: 1.9rem; font-weight: 800; margin: 0; }
.page-subtitle { color: var(--muted); margin-top: 4px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button, button, input[type=submit] {
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}
.button.secondary, .button.gray {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}
.button.danger {
  background: var(--danger);
}
.button.link-like {
  background: transparent;
  color: var(--primary);
  padding: 0;
}
button.small, .button.small { padding: 6px 10px; font-size: .88rem; }
button:hover, .button:hover { filter: brightness(0.98); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }

.kpi {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.kpi-label { color: var(--muted); font-size: .92rem; margin-bottom: 6px; }
.kpi-value { font-weight: 800; font-size: 1.55rem; }
.kpi-note { margin-top: 8px; font-size: .85rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tbody tr:hover { background: #fafcff; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: .92rem;
  font-weight: 700;
}
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: .84rem; margin-top: 5px; }
.error { color: var(--danger); font-size: .84rem; margin-top: 5px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 10px; padding-top: 28px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: #eef2f7; color: #475569; }
.badge.info { background: var(--primary-soft); color: var(--primary); }

.flash {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flash.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.searchbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.searchbar .field { min-width: 220px; flex: 1 1 220px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, #dbeafe, #f3f5f8 38%, #f3f5f8 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 460px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin-top: 0; margin-bottom: 6px; }
.login-card p { color: var(--muted); }

.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }

.stats-list {
  margin: 0;
  padding-left: 18px;
}
.stats-list li { margin-bottom: 8px; }

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.meta-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
}
.meta-box div:nth-child(odd) {
  color: var(--muted);
  font-weight: 700;
}

.small-note {
  font-size: .84rem;
  color: var(--muted);
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
}
@media (max-width: 860px) {
  .main { padding: 20px 16px 34px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5, .grid.cols-6,
  .form-grid {
    grid-template-columns: 1fr;
  }
}


.form-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}
.form-section h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}
.form-section p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.hint-box {
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.hint-box code {
  background: rgba(255,255,255,.7);
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 2px 6px;
}
.mail-meta {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin: 16px 0 20px;
}
.mail-meta div:nth-child(odd) {
  color: var(--muted);
  font-weight: 700;
}
.preview-document {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 24px;
}
.preview-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.document-body {
  margin-top: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.letter-document {
  min-height: 520px;
}
.letter-header {
  margin-bottom: 24px;
}
.letter-address {
  margin-bottom: 24px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.letter-date {
  text-align: right;
  margin-bottom: 18px;
  color: var(--muted);
}
.letter-footer {
  margin-top: 24px;
  white-space: pre-wrap;
}
.letter-signature {
  margin-top: 18px;
  font-weight: 700;
}
.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: .85rem;
}
.badge.soft {
  background: #f8fafc;
  color: #475569;
}
@media print {
  .sidebar,
  .topbar,
  .actions,
  .button,
  button,
  .flash {
    display: none !important;
  }
  .layout {
    display: block;
  }
  .main {
    padding: 0;
  }
  .card,
  .preview-document {
    box-shadow: none;
    border: 0;
  }
}


.hint-box {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
}

.readonly-field {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.scope-switcher select {
  min-width: 240px;
}

.scope-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(59,130,246,.14);
  border: 1px solid rgba(148,163,184,.22);
}

.scope-banner {
  border-left: 5px solid var(--primary);
}

.muted-light {
  color: #cbd5e1;
}

.row-deadline-warn td {
  background: #fff9e9;
}

.row-deadline-danger td {
  background: #fff1f2;
}

.row-linked-task td:first-child {
  border-left: 4px solid var(--primary);
}

.scope-switcher {
  gap: 8px;
}


.highlight-card {
  border-left: 5px solid var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.nav-group:first-of-type {
  margin-top: 18px;
}

.scope-card strong {
  display: inline-block;
  margin-bottom: 4px;
}

.project-header .actions {
  align-items: flex-start;
}

.nav-group {
  margin: 16px 0 0;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: '▸';
  font-size: .9rem;
  transition: transform .15s ease;
}

.nav-group[open] summary::after {
  transform: rotate(90deg);
}

.nav-group-links {
  padding: 0 10px 10px;
}

.phase-card {
  margin-top: 10px;
  background: rgba(29,78,216,.18);
}

.phase-switcher select {
  min-width: 270px;
}

.journal-link-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
}

.journal-link-block .table-wrap {
  margin-top: 12px;
}

.journal-link-block .button {
  white-space: nowrap;
}

.setting-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.setting-group summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
}

.setting-group-body {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.setting-picklist {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 12px;
}

.setting-picklist textarea {
  min-height: 120px;
}

select[multiple] {
  min-height: 140px;
}

.filter-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

@media (max-width: 860px) {
  .setting-group-body,
  .dashboard-intro-grid {
    grid-template-columns: 1fr;
  }

  .phase-switcher select,
  .scope-switcher select {
    min-width: 0;
    width: 100%;
  }
}


.repeater-card {
  border-left: 5px solid #c7d2fe;
}

.diary-repeater {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.diary-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
}

.diary-row-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.diary-row-grid .full {
  grid-column: 1 / -1;
}

.diary-row-grid .span-2 {
  grid-column: span 2;
}

.diary-row-grid .span-3 {
  grid-column: span 3;
}

.diary-row-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.repeater-card .help {
  margin-top: 4px;
}

.repeater-card textarea {
  min-height: 90px;
}

@media (max-width: 860px) {
  .diary-row-grid {
    grid-template-columns: 1fr;
  }

  .diary-row-grid .span-2,
  .diary-row-grid .span-3,
  .diary-row-grid .full {
    grid-column: auto;
  }
}

.project-form-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 16px;
  overflow: hidden;
}

.project-form-section > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  list-style: none;
  background: #f8fafc;
}

.project-form-section > summary::-webkit-details-marker {
  display: none;
}

.project-form-section-body,
.project-form-section-open {
  padding: 18px;
}

.compact-meta-box {
  grid-template-columns: 220px 1fr;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1f3a8a;
  font-size: 13px;
  font-weight: 600;
}

.trade-list {
  display: grid;
  gap: 10px;
}

.trade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.trade-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.trade-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.time-entry-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.time-entry-grid .checkbox-cell {
  display: flex;
  align-items: center;
  min-height: 48px;
}

.time-entry-grid .checkbox-cell label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.performance-card .grid {
  margin-top: 16px;
}

.performance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin: 14px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.legend-swatch.plan {
  background: #3b82f6;
}

.legend-swatch.ist {
  background: #f59e0b;
}

.progress-compare {
  display: grid;
  gap: 10px;
}

.progress-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-track-top {
  background: #fef3c7;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
}

.progress-plan {
  background: #3b82f6;
}

.progress-ist {
  background: #f59e0b;
}

.controlling-graphic-cell {
  min-width: 190px;
}

@media (max-width: 980px) {
  .time-entry-grid,
  .trade-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .compact-meta-box {
    grid-template-columns: 1fr;
  }

  .trade-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.photo-thumb {
  width: 150px;
  display: grid;
  gap: 6px;
}

.photo-thumb a {
  display: block;
  text-decoration: none;
}

.photo-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.photo-remove {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.photo-remove input {
  margin: 0;
}

@media (max-width: 980px) {
  .photo-thumb {
    width: calc(50% - 6px);
  }
}

@media (max-width: 640px) {
  .photo-thumb {
    width: 100%;
  }
}

.report-screen-controls {
  position: sticky;
  top: 0;
  z-index: 3;
}
.report-print-area {
  background: #fff;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.report-metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}
.report-metric-label {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 4px;
}
.report-metric-value {
  font-size: 1.2rem;
  font-weight: 700;
}
.report-entry {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.report-entry:first-of-type {
  border-top: 0;
}
.report-entry h3 {
  margin: 0 0 10px;
}
.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
  color: var(--muted);
}
.report-block {
  margin: 10px 0 0;
}
.report-block-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.report-block-text {
  white-space: pre-wrap;
}
.report-list {
  margin: 6px 0 0 18px;
}
.report-list li {
  margin: 0 0 6px;
}
.report-subentry {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 8px 0 0;
  background: #fff;
}
.report-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.report-photo {
  width: 180px;
  margin: 0;
}
.report-photo img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.report-photo figcaption {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
}

.meeting-protocol-header {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: #f8fafc;
  margin-bottom: 14px;
}
.meeting-protocol-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.meeting-protocol-subtitle {
  color: var(--muted);
  margin-bottom: 12px;
}
.meeting-protocol-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}
.meeting-participant-list {
  display: grid;
  gap: 8px;
}
.meeting-participant-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.meeting-participant-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.meeting-participant-company {
  font-weight: 700;
}
.meeting-participant-detail {
  color: var(--muted);
}
.meeting-protocol-table th,
.meeting-protocol-table td {
  vertical-align: top;
}
.meeting-protocol-table td.nowrap {
  white-space: nowrap;
}
.meeting-protocol-section td {
  background: #eef2ff;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
@media (max-width: 860px) {
  .meeting-participant-row {
    grid-template-columns: 1fr;
  }
}
@media print {
  .report-screen-controls {
    display: none !important;
  }
  .report-entry {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-metric,
  .report-subentry,
  .report-photo img {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Angebotsmodul / Vorlagen */
#offer-lines textarea {
  min-height: 74px;
  resize: vertical;
}
#offer-lines input,
#offer-lines textarea {
  min-width: 100%;
}
#offer-lines td {
  vertical-align: top;
}
#offer-lines .offer-line-total {
  white-space: nowrap;
  font-weight: 700;
}
.template-compose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.template-compose-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.template-compose-box h3 {
  margin-top: 0;
}
.offer-preview-table td,
.offer-preview-table th {
  vertical-align: top;
}
@media (max-width: 860px) {
  .template-compose-grid {
    grid-template-columns: 1fr;
  }
}
.offer-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.offer-calc-table td,
.offer-calc-table th {
  vertical-align: top;
}
.offer-calc-table td:first-child,
.offer-preview-table td:first-child {
  white-space: nowrap;
  font-weight: 700;
}
@media (max-width: 860px) {
  .offer-calc-grid {
    grid-template-columns: 1fr;
  }
}

/* --- K3 CI / Sidebar Toggle Erweiterung --- */
.layout {
  transition: grid-template-columns .22s ease;
}

.sidebar {
  transition: transform .22s ease, opacity .22s ease, padding .22s ease;
  z-index: 20;
}

.layout.sidebar-hidden {
  grid-template-columns: 0 1fr;
}

.layout.sidebar-hidden .sidebar {
  transform: translateX(-104%);
  opacity: 0;
  pointer-events: none;
  padding-left: 0;
  padding-right: 0;
}

.topbar-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-toggle-button {
  white-space: nowrap;
  align-self: flex-start;
}

.ci-card {
  border-top: 6px solid var(--primary);
}

.performance-card .kpi {
  box-shadow: none;
}

@media (max-width: 1180px) {
  .layout.sidebar-hidden {
    grid-template-columns: 1fr;
  }

  .layout.sidebar-hidden .sidebar {
    display: none;
  }
}

/* --- Baubetreuung König CI Refresh / Versionierung --- */
:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-2: #faf5ef;
  --text: #26323d;
  --muted: #66717c;
  --line: #e6ddd2;
  --primary: #ed7d31;
  --primary-dark: #cc671e;
  --primary-soft: #fff1e7;
  --accent: #44546A;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --shadow: 0 18px 38px rgba(68, 84, 106, 0.08);
  --radius: 18px;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

.layout {
  grid-template-columns: 318px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--accent) 0%, #2f3945 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-lockup {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
}

.brand-kicker {
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8d4b7;
}

.brand-claim {
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff8f2;
}

.brand-claim-sub {
  margin-top: 4px;
  font-size: 0.92rem;
  color: #f8d4b7;
}

.brand-version-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 18px rgba(237, 125, 49, 0.18);
}

.sidebar-footer-version {
  margin-bottom: 10px;
  color: #fbd8bf;
  font-weight: 700;
}

.sidebar-footer .muted {
  color: #cfd8e3;
}

.scope-card {
  background: rgba(237, 125, 49, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

.phase-card {
  background: rgba(237, 125, 49, 0.18);
}

.nav-group {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.045);
}

.nav-group summary {
  color: #fff6ef;
}

.nav-link {
  color: #f8fafc;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(237, 125, 49, 0.22);
}

.muted-light {
  color: #f4dac5;
}

.button,
button,
input[type=submit] {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: 1px solid #d96f1b;
  box-shadow: 0 10px 18px rgba(237, 125, 49, 0.18);
}

.button.secondary,
.button.gray {
  background: #fff;
  color: var(--accent);
  border: 1px solid #dccdbf;
  box-shadow: none;
}

.button.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar {
  background: linear-gradient(180deg, #fff 0%, #fff8f2 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.topbar-title-wrap {
  min-width: 0;
}

.topbar-heading {
  align-items: flex-start;
  gap: 14px;
}

.topbar-mark-wrap {
  width: 54px;
  min-width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
  border: 1px solid #ffd8bf;
}

.topbar-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.topbar-overline {
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  color: var(--accent);
  letter-spacing: -0.03em;
}

.page-subtitle {
  max-width: 980px;
  color: #5c6670;
  line-height: 1.45;
}

.card {
  border: 1px solid var(--line);
  border-top: 4px solid rgba(237, 125, 49, 0.24);
  box-shadow: var(--shadow);
}

.ci-card,
.version-card,
.highlight-card,
.scope-banner {
  border-top: 6px solid var(--primary);
}

.scope-banner,
.highlight-card,
.kpi {
  background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
}

.hint-box {
  background: linear-gradient(180deg, #fff4ea 0%, #ffffff 100%);
  border-color: #ffd6b8;
  color: var(--accent);
}

.login-shell {
  background: radial-gradient(circle at top left, #fff1e7 0%, #f8f2ed 42%, #eef1f5 100%);
}

.login-card {
  border-top: 6px solid var(--primary);
}

.login-brand {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.login-lockup {
  width: 100%;
  max-width: 360px;
  height: auto;
  object-fit: contain;
}

.login-intro {
  margin-top: 0;
  color: var(--accent);
  font-weight: 700;
}

.version-card .version-hero {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.changelog-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.changelog-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
  border-radius: 18px;
  padding: 16px 18px;
}

.changelog-item.current {
  border-color: #f3b485;
  box-shadow: 0 12px 28px rgba(237, 125, 49, 0.12);
}

.changelog-item-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.changelog-item h3 {
  margin: 10px 0 0;
  font-size: 1.04rem;
  color: var(--accent);
}

.changelog-summary {
  margin: 8px 0 0;
}

.table-wrap table th {
  background: #faf5ef;
  color: #6b7280;
}

tbody tr:hover {
  background: #fffbf7;
}

.count-chip {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.sidebar-toggle-button {
  min-width: 110px;
}

@media (max-width: 1180px) {
  .topbar {
    padding: 16px;
  }

  .brand-panel {
    margin-bottom: 10px;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .changelog-item-top {
    flex-direction: column;
  }

  .topbar-heading {
    flex-wrap: wrap;
  }

  .topbar-mark-wrap {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }
}
