
: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);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.05);
  --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;
  min-width: 0;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid > * {
  min-width: 0;
}
.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;
}

.auto-card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.auto-kpi-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.auto-kpi-grid > * {
  min-width: 0;
}

.summary-card {
  min-width: 0;
}

.summary-card > * {
  min-width: 0;
}

.summary-card h2,
.summary-card .help,
.summary-card .small-note {
  overflow-wrap: anywhere;
}

.summary-meta-grid {
  display: grid;
  grid-template-columns: minmax(116px, 136px) minmax(0, 1fr);
  gap: 10px 14px;
}

.summary-meta-grid > * {
  min-width: 0;
}

.summary-meta-grid div:nth-child(odd) {
  color: var(--muted);
  font-weight: 700;
}

.summary-meta-grid div:nth-child(even) {
  overflow-wrap: anywhere;
}

.summary-card .badge {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.summary-actions .button,
.summary-actions button,
.summary-actions input[type=submit] {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

@media (max-width: 1320px) {
  .summary-meta-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .summary-meta-grid div:nth-child(odd):not(:first-child) {
    margin-top: 4px;
  }
}

@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%;
  }
}

@media (max-width: 620px) {
  .auto-card-grid,
  .auto-kpi-grid {
    grid-template-columns: 1fr;
  }

  .summary-actions .button,
  .summary-actions button,
  .summary-actions input[type=submit] {
    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%;
  width: var(--progress-width, 0%);
  border-radius: 999px;
  transition: width .18s ease;
}

.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(--line);
  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-subtable-wrap {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}
.report-subtable {
  font-size: .92rem;
}
.report-subtable th {
  white-space: nowrap;
}
.report-subtable td {
  vertical-align: top;
}
.report-subtable .report-block-text {
  white-space: pre-wrap;
}
.report-subtable .report-photo-grid {
  margin-top: 0;
}
.report-subtable .report-photo {
  width: 120px;
}
.report-subtable .report-photo img {
  height: 85px;
}
.report-subtable tr.report-row-current td,
.report-protocol-table tr.report-row-current td {
  color: #111827;
}
.report-subtable tr.report-row-previous td,
.report-protocol-table tr.report-row-previous td {
  color: #374151;
}
.meeting-subpoints {
  display: grid;
  gap: 0.28rem;
}
.meeting-subpoint span {
  font-weight: 700;
  margin-right: 0.35rem;
}
.meeting-subpoint-current {
  color: #111827;
  font-weight: 650;
}
.meeting-subpoint-previous {
  color: #374151;
}
.report-protocol-table td:nth-child(3) {
  min-width: 220px;
}
.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;
  }
}
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  .report-screen-controls {
    display: none !important;
  }
  .report-entry {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-subtable-wrap,
  .report-subtable tr,
  .report-metric,
  .report-subentry,
  .report-photo img {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-print-area,
  .meeting-protocol-header,
  .report-brand-panel,
  .report-block,
  .report-subtable-wrap {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .report-subtable-wrap {
    overflow: visible;
  }
  .report-subtable,
  .report-protocol-table,
  .report-meeting-participants-table {
    width: 100%;
    table-layout: fixed;
    font-size: .72rem;
  }
  .report-subtable th,
  .report-subtable td,
  .report-protocol-table th,
  .report-protocol-table td,
  .report-meeting-participants-table th,
  .report-meeting-participants-table td {
    padding: 4px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .report-protocol-table th:nth-child(1),
  .report-protocol-table td:nth-child(1) { width: 10%; }
  .report-protocol-table th:nth-child(2),
  .report-protocol-table td:nth-child(2) { width: 13%; }
  .report-protocol-table th:nth-child(3),
  .report-protocol-table td:nth-child(3) { width: 27%; }
  .report-protocol-table th:nth-child(4),
  .report-protocol-table td:nth-child(4) { width: 12%; }
  .report-protocol-table th:nth-child(5),
  .report-protocol-table td:nth-child(5) { width: 9%; }
  .report-protocol-table th:nth-child(6),
  .report-protocol-table td:nth-child(6) { width: 8%; }
  .report-protocol-table th:nth-child(7),
  .report-protocol-table td:nth-child(7) { width: 11%; }
  .report-protocol-table th:nth-child(8),
  .report-protocol-table td:nth-child(8) { width: 10%; }
  .report-meeting-participants-table th:nth-child(1),
  .report-meeting-participants-table td:nth-child(1) { width: 22%; }
  .report-meeting-participants-table th:nth-child(2),
  .report-meeting-participants-table td:nth-child(2) { width: 22%; }
  .report-meeting-participants-table th:nth-child(3),
  .report-meeting-participants-table td:nth-child(3) { width: 18%; }
  .report-meeting-participants-table th:nth-child(4),
  .report-meeting-participants-table td:nth-child(4) { width: 12%; }
  .report-meeting-participants-table th:nth-child(5),
  .report-meeting-participants-table td:nth-child(5) { width: 26%; }
  .report-photo {
    width: 82px;
  }
  .report-photo img {
    height: 58px;
  }
}

/* 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;
}

.user-pill,
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.user-pill {
  color: #475569;
  font-weight: 600;
}

.session-pill-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.session-pill.warning {
  border-color: #fbbf24;
  background: #fffbeb;
}

.session-pill.danger {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.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;
  }
}


/* --- Phase 3: anpinnbare Sidebar / Rail-Navigation --- */
.layout { position: relative; }
.sidebar-rail { position: fixed; inset: 0 auto 0 0; width: 28px; display: none; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--accent) 0%, #2f3945 100%); color: #fff8f2; border: 0; border-right: 1px solid rgba(255,255,255,.14); z-index: 42; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset; }
.sidebar-rail-text { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.layout.sidebar-collapsed { grid-template-columns: 0 1fr; }
.layout.sidebar-collapsed .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 318px; transform: translateX(calc(-100% + 28px)); opacity: 1; pointer-events: auto; box-shadow: 0 22px 40px rgba(15, 23, 42, .16); }
.layout.sidebar-collapsed .sidebar.is-hover-open { transform: translateX(0); }
.layout.sidebar-collapsed .sidebar-rail { display: inline-flex; }
.layout.sidebar-pinned .sidebar { position: sticky; width: auto; transform: none; box-shadow: none; }
.sidebar-user-card { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; }
.sidebar-user-card strong { font-size: .98rem; }
.sidebar-user-card .muted-light { color: #f4dac5; font-size: .82rem; }
.current-user-pill { min-width: 220px; }
@media (max-width: 1180px) { .topbar-actions { width: 100%; } .current-user-pill { min-width: 0; width: 100%; } }
@media (max-width: 860px) { .sidebar-rail { display: none !important; } .layout.sidebar-collapsed .sidebar { transform: none; position: static; width: auto; box-shadow: none; } }

/* --- v2.16.3 Layout-/Menü-Reparatur: stabile Grid-Zuordnung + echtes Pin/Rail-Verhalten --- */
.layout {
  position: relative;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  grid-column: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
}

.main {
  grid-column: 2;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.layout.sidebar-pinned {
  grid-template-columns: 318px minmax(0, 1fr);
}

.layout.sidebar-pinned .sidebar {
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  width: auto;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  box-shadow: none;
}

.layout.sidebar-pinned .sidebar-rail {
  display: none;
}

.layout.sidebar-collapsed {
  grid-template-columns: 28px minmax(0, 1fr);
}

.layout.sidebar-collapsed .main {
  grid-column: 2;
}

.layout.sidebar-collapsed .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 318px;
  max-width: 318px;
  transform: translateX(calc(-100% + 28px));
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 22px 40px rgba(15, 23, 42, .18);
}

.layout.sidebar-collapsed .sidebar.is-hover-open {
  transform: translateX(0);
  pointer-events: auto;
}

.layout.sidebar-collapsed .sidebar-rail {
  display: inline-flex;
}

.sidebar-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--accent) 0%, #2f3945 100%);
  color: #fff8f2;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.14);
  z-index: 42;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}

.sidebar-rail-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.topbar-title-wrap,
.topbar-heading,
.page-subtitle,
.actions {
  min-width: 0;
}

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

.actions {
  justify-content: flex-end;
  align-content: flex-start;
}

.scope-switcher,
.scope-switcher.phase-switcher {
  max-width: 100%;
}

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

#sidebar-pin {
  min-width: 146px;
}

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

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

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

@media (max-width: 980px) {
  .layout,
  .layout.sidebar-pinned,
  .layout.sidebar-collapsed,
  .layout.sidebar-mobile-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .main,
  .layout.sidebar-pinned .main,
  .layout.sidebar-collapsed .main {
    grid-column: 1;
    padding: 16px;
  }

  .sidebar,
  .layout.sidebar-pinned .sidebar,
  .layout.sidebar-collapsed .sidebar {
    grid-column: 1;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(92vw, 340px);
    max-width: min(92vw, 340px);
    transform: translateX(-104%);
    pointer-events: none;
    box-shadow: 0 22px 40px rgba(15, 23, 42, .22);
  }

  .layout.sidebar-mobile-open .sidebar,
  .layout.sidebar-pinned.sidebar-mobile-open .sidebar,
  .layout.sidebar-collapsed.sidebar-mobile-open .sidebar,
  .layout .sidebar.is-mobile-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .layout.sidebar-mobile-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .34);
    z-index: 29;
  }

  .sidebar-rail {
    display: none !important;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }

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


/* --- v2.16.4 Responsive-Optimierung für Formulare / Topbar --- */
.form-grid,
.form-grid > *,
.setting-group-body,
.setting-group-body > *,
.template-compose-grid,
.template-compose-grid > *,
.diary-row-grid,
.diary-row-grid > *,
.time-entry-grid,
.time-entry-grid > *,
.trade-checkbox-grid,
.trade-checkbox-grid > *,
.checkbox-grid,
.checkbox-grid > *,
.meta-box,
.mail-meta,
.compact-meta-box,
.searchbar,
.searchbar .field,
.actions,
.actions > *,
.scope-switcher,
.phase-switcher,
.scope-switcher select,
.phase-switcher select,
.project-header,
.project-header > * {
  min-width: 0;
}

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,
.readonly-field {
  max-width: 100%;
}

.checkbox-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

.checkbox-row input {
  margin-top: 4px;
  flex: 0 0 auto;
}

.checkbox-row label {
  min-width: 0;
}

@media (max-width: 1180px) {
  .form-grid,
  .setting-group-body,
  .template-compose-grid,
  .meta-box,
  .mail-meta,
  .compact-meta-box {
    grid-template-columns: 1fr;
  }

  .diary-row-grid,
  .time-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-checkbox-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 980px) {
  .main {
    padding: 16px;
  }

  .form-grid,
  .setting-group-body,
  .template-compose-grid,
  .dashboard-intro-grid,
  .diary-row-grid,
  .time-entry-grid,
  .trade-checkbox-grid,
  .checkbox-grid,
  .meta-box,
  .mail-meta,
  .compact-meta-box {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    gap: 12px;
  }

  .actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .actions .scope-switcher,
  .actions .phase-switcher,
  .actions .button,
  .actions button,
  .actions input[type=submit] {
    width: 100%;
  }

  .actions .inline {
    width: 100%;
    justify-content: flex-start;
  }

  .scope-switcher,
  .phase-switcher,
  .searchbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  form .mt-2.inline,
  form .mt-3.inline {
    flex-direction: column;
    align-items: stretch;
  }

  form .mt-2.inline .button,
  form .mt-2.inline button,
  form .mt-2.inline input[type=submit],
  form .mt-3.inline .button,
  form .mt-3.inline button,
  form .mt-3.inline input[type=submit] {
    width: 100%;
  }

  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 {
    font-size: 16px;
  }

  .checkbox-row {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 14px;
  }

  .card,
  .project-form-section-body,
  .project-form-section-open,
  .diary-row {
    padding: 12px;
  }

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

  .page-title {
    font-size: 1.55rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

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

/* --- v2.16.6 responsive forms, pagination and async relation lookup --- */
.session-keeper {
  display: none !important;
}

.inline-form {
  display: inline-block;
}

.inline-form-spaced {
  margin-right: 8px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.sticky-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 14;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(243,245,248,0) 0%, rgba(243,245,248,.95) 18%, rgba(243,245,248,.98) 100%);
}

.stack-between,
.stack-between-start,
.stack-between-center {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stack-between {
  align-items: center;
}

.stack-between-start {
  align-items: flex-start;
}

.stack-between-center {
  align-items: center;
}

.push-right {
  margin-left: auto;
}

.pt-28 {
  padding-top: 28px;
}

.card-plain {
  box-shadow: none;
}

.w-50 {
  width: 50px;
}

.muted-light-note {
  color: #cbd5e1;
}

.year-input {
  width: 120px;
  max-width: 100%;
}

.mb-14 {
  margin-bottom: 14px;
}

.offer-doc-title {
  margin: 18px 0 6px 0;
}

.offer-doc-meta-table {
  width: 420px;
  margin-left: auto;
  margin-top: 16px;
}

.meeting-protocol-col-ref {
  width: 140px;
}

.meeting-protocol-col-note {
  width: 280px;
}

.form-section {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.form-section h3 {
  margin: 0 0 8px;
}

.checkbox-row {
  align-items: center;
}

.checkbox-row-label {
  margin: 0;
}

.checkbox-row-end {
  align-items: flex-end;
}

.readonly-field {
  min-height: 44px;
  display: flex;
  align-items: center;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.relation-combobox-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08);
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 14px;
}

.pagination-summary {
  color: var(--muted);
  font-size: .92rem;
}

.pagination-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.pagination-link:hover {
  text-decoration: none;
}

.pagination-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination-link.disabled {
  opacity: .45;
  pointer-events: none;
}

.pagination-gap {
  padding: 8px 4px;
  color: var(--muted);
}

.relation-combobox {
  position: relative;
}

.relation-combobox-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.relation-combobox-input {
  flex: 1 1 auto;
}

.relation-combobox-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
}

.relation-combobox-item {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
}

.relation-combobox-item:hover,
.relation-combobox-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.relation-combobox-item-title {
  display: block;
  font-weight: 700;
}

.relation-combobox-item-meta {
  display: block;
  margin-top: 3px;
  font-size: .82rem;
  color: var(--muted);
}

.relation-combobox-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: .9rem;
}

.relation-selected-note {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--muted);
}

.relation-selected-note.is-empty {
  color: var(--muted);
}

.relation-clear[hidden] {
  display: none !important;
}

.customer-company-fields[hidden],
.customer-private-fields[hidden] {
  display: none !important;
}

.diary-row-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.trade-row form {
  margin: 0;
}

@media (max-width: 1180px) {
  .diary-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .sticky-form-actions {
    margin: 14px -4px 0;
    padding: 12px;
    border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    backdrop-filter: blur(10px);
  }

  .sticky-form-actions .button,
  .sticky-form-actions button,
  .sticky-form-actions input[type="submit"] {
    width: 100%;
  }

  .stack-between,
  .stack-between-start,
  .stack-between-center,
  .relation-combobox-toolbar,
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-links {
    justify-content: flex-start;
  }

  .push-right {
    margin-left: 0;
  }

  .year-input,
  .offer-doc-meta-table {
    width: 100%;
  }

  .diary-row-actions .button,
  .diary-row-actions button {
    width: 100%;
  }

  .meeting-protocol-col-ref,
  .meeting-protocol-col-note {
    width: auto;
  }
}


@media (max-width: 860px) {
  .table-card-mobile table,
  .table-card-mobile thead,
  .table-card-mobile tbody,
  .table-card-mobile tr,
  .table-card-mobile th,
  .table-card-mobile td {
    display: block;
  }

  .table-card-mobile thead {
    display: none;
  }

  .table-card-mobile tbody {
    display: grid;
    gap: 12px;
  }

  .table-card-mobile tbody tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    padding: 10px 12px;
  }

  .table-card-mobile tbody tr + tr {
    margin-top: 0;
  }

  .table-card-mobile td.table-cell {
    display: grid;
    grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border: 0;
    white-space: normal;
  }

  .table-card-mobile td.table-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .table-card-mobile td.table-cell.nowrap {
    white-space: normal;
  }

  .table-card-mobile td.table-cell .inline-form,
  .table-card-mobile td.table-cell .button,
  .table-card-mobile td.table-cell button {
    max-width: 100%;
  }

  .table-card-mobile td.table-cell .button,
  .table-card-mobile td.table-cell button,
  .table-card-mobile td.table-cell input[type="submit"] {
    width: 100%;
    margin-top: 6px;
  }
}


/* --- v2.17.1 Darstellungs-Reparatur: Topbar entkoppelt, Steuerleiste stabilisiert --- */
.topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.topbar-head,
.topbar-toolbar,
.topbar-actions {
  width: 100%;
  min-width: 0;
}

.topbar-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
}

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

.topbar-overline,
.page-title,
.page-subtitle {
  overflow-wrap: anywhere;
}

.topbar-toolbar {
  display: flex;
  justify-content: flex-start;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.topbar-actions > * {
  flex: 0 1 auto;
  min-width: 0;
}

.topbar-control {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.topbar-control select {
  width: 100%;
  min-width: 0;
}

.topbar-phase-switcher select {
  width: min(420px, 32vw);
  min-width: 300px;
  max-width: 420px;
}

.topbar-project-switcher select {
  width: min(500px, 38vw);
  min-width: 340px;
  max-width: 500px;
}

.topbar-control-submit,
.topbar-logout {
  white-space: nowrap;
}

.topbar-logout {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

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

@media (max-width: 1480px) {
  .topbar-phase-switcher select {
    width: min(360px, 100%);
    min-width: 260px;
  }

  .topbar-project-switcher select {
    width: min(420px, 100%);
    min-width: 300px;
  }
}

@media (max-width: 1180px) {
  .topbar {
    gap: 14px;
  }

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

  .topbar-actions {
    align-items: stretch;
  }

  .topbar-control {
    flex: 1 1 360px;
  }

  .topbar-logout {
    margin-inline-start: 0;
    flex: 0 0 auto;
  }
}

@media (max-width: 860px) {
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-control,
  .topbar-project-clear {
    width: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-phase-switcher select,
  .topbar-project-switcher select,
  .topbar-control select,
  .topbar-logout {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .topbar-control-submit,
  .topbar-project-clear .button,
  .topbar-logout {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 14px;
  }

  .topbar-heading {
    gap: 12px;
  }

  .sidebar-toggle-button {
    width: 100%;
  }

  .topbar-copy {
    width: 100%;
  }
}


/* --------------------------------------------------------------------------
   Phase 3: form UX, validation summaries, section navigation
   -------------------------------------------------------------------------- */

.form-error-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 116, 27, 0.28);
  border-left: 4px solid var(--accent, #e1741b);
  border-radius: 16px;
  background: rgba(255, 247, 241, 0.95);
  box-shadow: 0 10px 24px rgba(23, 43, 77, 0.06);
}

.form-error-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 10px;
  color: var(--text-strong, #1f3553);
}

.form-error-summary-count {
  font-size: 0.92rem;
  color: var(--muted, #64758a);
}

.form-error-summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.form-error-summary-list li {
  min-width: 0;
}

.form-error-summary-list a,
.form-error-summary-list span {
  overflow-wrap: anywhere;
}

.form-error-summary-list a {
  color: inherit;
  text-decoration: none;
}

.form-error-summary-list a:hover {
  text-decoration: underline;
}

.form-error-summary-label {
  font-weight: 700;
}

.form-error-summary-sep {
  color: var(--muted, #64758a);
}

.form-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.form-section-chip {
  appearance: none;
  border: 1px solid var(--line, rgba(31, 53, 83, 0.14));
  background: #fff;
  color: var(--text-strong, #1f3553);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  max-width: 100%;
  box-shadow: 0 6px 18px rgba(23, 43, 77, 0.05);
}

.form-section-chip:hover,
.form-section-chip:focus-visible {
  border-color: rgba(224, 116, 27, 0.35);
  box-shadow: 0 10px 24px rgba(23, 43, 77, 0.08);
  outline: none;
}

.form-section-chip-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-section-chip.has-errors {
  border-color: rgba(209, 63, 63, 0.28);
  background: rgba(255, 244, 244, 0.96);
}

.form-section-chip-count,
.form-section-error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.form-section-chip-count,
.form-section-error-badge {
  background: rgba(209, 63, 63, 0.12);
  color: #b23a2a;
}

.entity-form-section,
.project-form-section,
.repeater-card {
  min-width: 0;
}

.entity-form-section,
.project-form-section {
  margin-bottom: 18px;
  border: 1px solid rgba(31, 53, 83, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  overflow: clip;
}

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

.entity-form-section > summary,
.project-form-section > summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
}

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

.entity-form-section > summary::after,
.project-form-section > summary::after {
  content: '▾';
  font-size: 0.95rem;
  color: var(--muted, #64758a);
  transition: transform 0.18s ease;
}

.entity-form-section[open] > summary::after,
.project-form-section[open] > summary::after {
  transform: rotate(180deg);
}

.entity-form-section.has-errors,
.project-form-section.has-errors {
  border-color: rgba(209, 63, 63, 0.2);
}

.entity-form-section-body,
.project-form-section-body {
  min-width: 0;
  padding: 0 18px 18px;
}

.entity-form-section-open > .entity-form-section-body,
.project-form-section-open > .project-form-section-body {
  padding: 0;
}

.entity-form-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.entity-form-section-head h3,
.entity-form-section-head .small-note,
.form-section-summary-copy,
.form-section-summary-note,
.form-section-summary-meta {
  min-width: 0;
}

.form-section-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-section-title {
  font-weight: 700;
  color: var(--text-strong, #1f3553);
}

.form-section-summary-note {
  font-size: 0.92rem;
  color: var(--muted, #64758a);
  overflow-wrap: anywhere;
}

.form-section-summary-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.form-section-count {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: rgba(31, 53, 83, 0.07);
  color: var(--muted, #64758a);
  font-size: 0.82rem;
  font-weight: 700;
}

.form-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.form-actions-buttons > * {
  flex: 0 0 auto;
}

.form-save-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(31, 53, 83, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted, #64758a);
}

.form-save-state strong {
  color: var(--text-strong, #1f3553);
  font-size: 0.92rem;
}

.form-save-state span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-save-state.is-dirty {
  border-color: rgba(224, 116, 27, 0.28);
  background: rgba(255, 247, 241, 0.95);
  color: #9d5a1a;
}

.form-save-state.is-saving {
  border-color: rgba(68, 114, 196, 0.24);
  background: rgba(245, 248, 255, 0.96);
  color: #38588b;
}

.repeater-card .card-head,
.repeater-card .card-body,
.repeater-card .diary-row,
.repeater-card .diary-row-grid {
  min-width: 0;
}

.repeater-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.repeater-row-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(31, 53, 83, 0.07);
  color: var(--text-strong, #1f3553);
  font-size: 0.82rem;
  font-weight: 700;
}

[data-form-section-target] {
  scroll-margin-top: 100px;
}

textarea[data-autogrow="1"] {
  overflow: hidden;
  resize: vertical;
}

@media (max-width: 980px) {
  .form-section-nav {
    gap: 8px;
  }

  .form-section-chip {
    width: 100%;
    justify-content: space-between;
    text-align: left;
  }

  .entity-form-section > summary,
  .project-form-section > summary,
  .entity-form-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .form-section-summary-meta,
  .form-actions-buttons {
    justify-content: flex-start;
  }

  .form-save-state {
    width: 100%;
    border-radius: 18px;
  }
}

@media (max-width: 640px) {
  .entity-form-section-body,
  .project-form-section-body,
  .entity-form-section > summary,
  .project-form-section > summary,
  .entity-form-section-open,
  .project-form-section-open {
    padding-left: 14px;
    padding-right: 14px;
  }

  .entity-form-section-body,
  .project-form-section-body {
    padding-bottom: 14px;
  }

  .form-actions-buttons > * {
    width: 100%;
  }

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

/* --- v2.18.1 Phase 3 Protokoll- und Bericht-Follow-up --- */
.diary-row-grid,
.project-meeting-item-grid,
.meeting-participant-row .diary-row-grid {
  align-items: start;
}

.diary-row-grid > div,
.project-meeting-item-grid > div,
.meeting-participant-row .diary-row-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  min-width: 0;
}

.diary-row-grid label,
.project-meeting-item-grid label,
.meeting-participant-row label {
  display: block;
  min-width: 0;
}

.diary-row-grid input:not([type="checkbox"]):not([type="radio"]),
.diary-row-grid select,
.diary-row-grid textarea,
.project-meeting-item-grid input:not([type="checkbox"]):not([type="radio"]),
.project-meeting-item-grid select,
.project-meeting-item-grid textarea,
.meeting-participant-row input:not([type="checkbox"]):not([type="radio"]),
.meeting-participant-row select,
.meeting-participant-row textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.diary-row-grid input[type="file"],
.project-meeting-item-grid input[type="file"] {
  width: 100%;
}

.diary-row .readonly-field,
.project-meeting-item-grid .readonly-field {
  width: 100%;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
}

.diary-row-actions {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.repeater-card .stack-between-center,
.repeater-card .stack-between-start {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.repeater-card .stack-between-center > *,
.repeater-card .stack-between-start > * {
  min-width: 0;
}

.repeater-card .repeater-add,
.repeater-card .repeater-add-inline,
.repeater-card .repeater-duplicate,
.repeater-card .repeater-remove {
  white-space: nowrap;
}

.report-record-selector {
  margin-top: 1rem;
  border-top: 1px solid rgba(31, 53, 83, 0.08);
  padding-top: 1rem;
}

.report-selector-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.report-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.7rem;
}

.report-record-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(31, 53, 83, 0.12);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.report-record-chip input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.report-record-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-brand-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(31, 53, 83, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  margin-bottom: 1rem;
}

.report-brand-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.report-brand-logo {
  flex: 0 0 auto;
}

.report-brand-logo img {
  width: 150px;
  max-width: 100%;
  height: auto;
  display: block;
}

.report-brand-company {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-strong, #1f3553);
}

.report-brand-app {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--muted, #64758a);
  margin-top: 0.15rem;
}

.report-brand-meta {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  color: var(--muted, #64758a);
}

.report-brand-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.report-section-break {
  margin: 1rem 0 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(31, 53, 83, 0.09);
  font-size: 1rem;
}

.report-protocol-item {
  margin-top: 0.8rem;
}

.report-protocol-item-head {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.report-protocol-item-ref {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(224, 116, 27, 0.1);
  color: #a55b12;
  font-weight: 700;
}

.report-protocol-item-title {
  font-weight: 700;
  color: var(--text-strong, #1f3553);
}

@media (max-width: 1180px) {
  .project-meeting-item-grid,
  .meeting-participant-row .diary-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .report-brand-panel {
    grid-template-columns: 1fr;
  }
}

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

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

  .report-record-grid {
    grid-template-columns: 1fr;
  }
}


.plan-viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.plan-viewer-main,
.plan-viewer-side,
.plan-page-card,
.plan-page-stage,
.plan-toolbar,
.plan-filter-form,
.plan-marker-list-item,
.plan-marker-editor,
.plan-marker-selection {
  min-width: 0;
}

.plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.plan-filter-form {
  display: flex;
  gap: 0.65rem;
  align-items: end;
  flex-wrap: wrap;
}

.plan-page-card {
  margin-bottom: 1rem;
}

.plan-page-stage {
  position: relative;
  border: 1px solid rgba(31, 53, 83, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  cursor: crosshair;
}

.plan-page-stage.is-selected {
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.22);
  border-color: rgba(43, 108, 176, 0.45);
}

.plan-page-image {
  display: block;
  width: 100%;
  height: auto;
}

.plan-page-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plan-marker {
  position: absolute;
  left: var(--marker-left, 0%);
  top: var(--marker-top, 0%);
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--marker-color, #1f3553);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
}

.plan-marker:hover,
.plan-marker:focus-visible {
  outline: none;
  filter: brightness(0.96);
  transform: translate(-50%, -50%) scale(1.05);
}

.plan-marker-selection {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(219, 234, 254, 0.35);
  border: 1px dashed rgba(43, 108, 176, 0.3);
  margin-bottom: 0.9rem;
  color: var(--text-strong, #1f3553);
}

.plan-marker-list {
  display: grid;
  gap: 0.8rem;
}

.plan-marker-list-item {
  border: 1px solid rgba(31, 53, 83, 0.1);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.plan-marker-list-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.plan-marker-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--marker-color, #1f3553);
  color: #fff;
  font-weight: 800;
}

.plan-print-legend {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.plan-print-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

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

@media (max-width: 860px) {
  .plan-toolbar,
  .plan-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-marker {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }
}


/* --- v2.19.1 Formular- und Navigations-Hotfix --- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field > label {
  margin-bottom: 0;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea,
.form-field .readonly-field,
.form-field .relation-combobox,
.form-field .repeater-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.form-field .help,
.form-field .error {
  margin-top: 0;
}

.form-field.checkbox-field .checkbox-row {
  padding-top: 0;
}

.topbar-actions {
  align-items: flex-start;
}

.topbar-control.topbar-phase-switcher,
.topbar-control.topbar-project-switcher {
  flex: 0 1 560px;
  width: min(100%, 560px);
  max-width: 560px;
}

.topbar-phase-switcher select,
.topbar-project-switcher select,
.topbar-control select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

.topbar-control-submit {
  min-width: 130px;
  justify-content: center;
}

@media (max-width: 1180px) {
  .topbar-control.topbar-phase-switcher,
  .topbar-control.topbar-project-switcher {
    width: min(100%, 560px);
    max-width: 560px;
  }
}

@media (max-width: 860px) {
  .topbar-control.topbar-phase-switcher,
  .topbar-control.topbar-project-switcher,
  .topbar-project-clear,
  .topbar-logout {
    width: 100%;
    max-width: none;
  }
}


/* --- v2.20.0 Adressbuch-, Formular- und Topbar-Hotfix --- */
.form-grid > div,
.form-grid > section,
.form-grid > article,
.form-grid > aside,
.form-grid > fieldset,
.searchbar > div,
.searchbar > form > div,
.time-entry-grid > div {
  min-width: 0;
}

.form-grid > div:not(.checkbox-row):not(.inline),
.searchbar > div,
.searchbar form > div,
.time-entry-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid > div > label,
.searchbar > div > label,
.time-entry-grid > div > label {
  margin-bottom: 0;
}

.form-grid > div > input:not([type="checkbox"]):not([type="radio"]),
.form-grid > div > select,
.form-grid > div > textarea,
.form-grid > div > .readonly-field,
.form-grid > div > .relation-combobox,
.searchbar > div > input:not([type="checkbox"]):not([type="radio"]),
.searchbar > div > select,
.searchbar > div > textarea,
.time-entry-grid > div > input:not([type="checkbox"]):not([type="radio"]),
.time-entry-grid > div > select,
.time-entry-grid > div > textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.topbar-actions {
  align-items: stretch;
}

.topbar-control.topbar-phase-switcher,
.topbar-control.topbar-project-switcher {
  display: grid;
  grid-template-columns: minmax(0, 420px) auto;
  align-items: start;
  gap: 10px;
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}

.topbar-control.topbar-phase-switcher select,
.topbar-control.topbar-project-switcher select {
  width: 420px;
  min-width: 0;
  max-width: 420px;
}

.topbar-control-submit {
  min-width: 124px;
}

@media (max-width: 1180px) {
  .topbar-control.topbar-phase-switcher,
  .topbar-control.topbar-project-switcher {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100%;
  }

  .topbar-control.topbar-phase-switcher select,
  .topbar-control.topbar-project-switcher select {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 860px) {
  .topbar-control.topbar-phase-switcher,
  .topbar-control.topbar-project-switcher {
    grid-template-columns: 1fr;
  }

  .topbar-control-submit,
  .topbar-logout {
    width: 100%;
  }
}

.project-address-page-head {
  gap: 1rem;
}

.project-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}

.project-address-card {
  min-width: 0;
}

.project-address-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-address-card-meta {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: .45rem .9rem;
  margin-top: .9rem;
}

.project-address-card-meta > div:nth-child(odd) {
  font-weight: 700;
  color: var(--muted);
}

.project-address-actions {
  gap: .5rem;
  flex-wrap: wrap;
}

.project-address-contact-table {
  margin-top: .85rem;
}

.project-address-contact-table td,
.project-address-contact-table th {
  vertical-align: top;
}

.project-address-contact-table .button,
.project-address-actions .button,
.project-address-actions .small,
.project-address-actions button {
  white-space: nowrap;
}

.project-address-empty {
  margin-top: .9rem;
  padding: .9rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  color: var(--muted);
}

[data-project-contact-form] .form-grid {
  align-items: start;
}

[data-project-contact-form] .form-field {
  min-width: 0;
}

[data-project-contact-form] .inline {
  flex-wrap: wrap;
  gap: .5rem;
}

@media (max-width: 1024px) {
  .project-address-card-head {
    flex-direction: column;
  }

  .project-address-card-meta {
    grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .project-address-grid {
    grid-template-columns: 1fr;
  }

  .project-address-card-meta {
    grid-template-columns: 1fr;
  }

  .project-address-card-meta > div:nth-child(odd) {
    margin-top: .35rem;
  }

  .project-address-page-head .project-address-actions,
  .project-address-card-head .project-address-actions {
    width: 100%;
  }
}

/* Phase 3 – Projektadressbuch verschachtelt */
.project-addressbook-card {
  overflow: visible;
}

.project-addressbook-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.project-addressbook-main,
.project-addressbook-sidebar,
.project-addressbook-company-body,
.project-addressbook-contact-actions,
.project-addressbook-inline-form,
.project-addressbook-sidebar-panel,
.project-addressbook-company-heading,
.project-addressbook-company-summary-meta,
.project-addressbook-contact-main {
  min-width: 0;
}

.project-addressbook-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.project-addressbook-sidebar-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.project-addressbook-company {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.project-addressbook-company + .project-addressbook-company {
  margin-top: 16px;
}

.project-addressbook-company > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.project-addressbook-company > summary::-webkit-details-marker {
  display: none;
}

.project-addressbook-company-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-addressbook-company-title,
.project-addressbook-company-title a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.project-addressbook-company-title a:hover {
  text-decoration: underline;
}

.project-addressbook-company-summary-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.project-addressbook-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-addressbook-badges .tag {
  margin: 0;
}

.project-addressbook-company-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 16px;
}

.project-addressbook-company-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.project-addressbook-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.65);
}

.project-addressbook-contact-list {
  display: grid;
  gap: 12px;
}

.project-addressbook-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.9);
}

.project-addressbook-contact-link {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.project-addressbook-contact-link.static {
  display: block;
}

.project-addressbook-contact-link:hover {
  text-decoration: underline;
}

.project-addressbook-contact-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

.project-addressbook-inline-form {
  display: grid;
  gap: 10px;
}

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

.project-addressbook-form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.project-addressbook-form-grid label > span {
  font-size: 0.9rem;
}

.project-addressbook-form-grid input:not([type="checkbox"]):not([type="radio"]),
.project-addressbook-form-grid select,
.project-addressbook-form-grid textarea {
  width: 100%;
}

.project-addressbook-form-grid label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 30px;
  font-weight: 600;
}

.project-addressbook-form-grid label.checkbox > span {
  font-size: 0.95rem;
}

.project-addressbook-company-form,
.project-addressbook-contact-add-form {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.project-addressbook-contact-actions .inline,
.project-addressbook-company-body .inline,
.project-addressbook-sidebar .inline {
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .project-addressbook-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .project-addressbook-contact-row {
    grid-template-columns: 1fr;
  }

  .project-addressbook-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .project-addressbook-company > summary,
  .project-addressbook-company-body,
  .project-addressbook-sidebar-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .project-addressbook-form-grid {
    grid-template-columns: 1fr;
  }

  .project-addressbook-form-grid label.checkbox {
    padding-top: 4px;
  }

  .project-addressbook-company-heading,
  .project-addressbook-company-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* v2.22.3 Systemdiagnose */
.badge.badge-ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.badge.badge-warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.warning-text {
  color: #b45309;
  font-weight: 700;
}
.diagnostic-log {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  background: #172033;
  color: #f8fafc;
  border-radius: 14px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.45;
}

/* v2.23.1 – Adressbuch Feinschliff */
.project-addressbook-quick-create {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.project-addressbook-quick-create > summary,
.address-migration-create-contact > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
}
.project-addressbook-form-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.address-migration-create-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.88);
  min-width: min(100%, 520px);
}
.address-migration-create-contact {
  max-width: 540px;
}
.inline.wrap {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .address-migration-create-form .project-addressbook-form-grid {
    grid-template-columns: 1fr;
  }
}
.card-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 12px);
  padding: 14px;
  background: rgba(255,255,255,0.72);
}

/* v2.24.0 – Journal & offene Punkte */
.open-items-filter-card .searchbar,
.open-items-filters {
  align-items: end;
}
.open-items-hero .actions {
  flex-wrap: wrap;
}
.open-items-kpis .kpi,
.open-items-group,
.open-items-hero {
  min-width: 0;
}
.open-items-table td,
.open-items-table th {
  vertical-align: top;
}
.open-item-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .82rem;
  font-weight: 700;
  border: 1px solid var(--border, #e8d7c8);
  background: #fff8f0;
  white-space: nowrap;
}
.open-item-status-overdue {
  background: #ffe8e8;
  border-color: #f4b7b7;
  color: #9f1f1f;
}
.open-item-status-today,
.open-item-status-due7 {
  background: #fff2d9;
  border-color: #e8c26f;
  color: #7a4b00;
}
.open-item-status-done {
  background: #e8f6ec;
  border-color: #9ed7ac;
  color: #1f6b35;
}
.open-item-row.open-item-overdue td:first-child {
  font-weight: 800;
  color: #9f1f1f;
}
.open-item-row.open-item-done {
  opacity: .76;
}
@media (max-width: 900px) {
  .open-items-filters {
    grid-template-columns: 1fr;
  }
  .open-item-status {
    white-space: normal;
  }
}
@media print {
  .sidebar,
  .sidebar-rail,
  .topbar,
  .scope-banner,
  .open-items-filter-card,
  .flash,
  .button,
  .actions {
    display: none !important;
  }
  .layout,
  .main {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card {
    box-shadow: none !important;
    break-inside: avoid;
    border-color: #ddd !important;
  }
  .open-items-group {
    page-break-inside: avoid;
  }
}

/* v2.25.0 – Berichtscenter und Projektverteiler */
.report-hub-selector {
  align-items: end;
  margin-top: 1rem;
}
.report-hub-selector label {
  min-width: min(100%, 360px);
}
.report-hub-grid,
.report-hub-card,
.project-distribution-tools,
.project-distribution-print {
  min-width: 0;
}
.report-hub-card .actions,
.project-distribution-tools .actions {
  flex-wrap: wrap;
}
.mini-kpi {
  min-width: 48px;
  text-align: center;
  padding: .35rem .6rem;
}
.project-distribution-tools textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92rem;
}
.project-distribution-table td,
.project-distribution-table th {
  vertical-align: top;
}
.report-distribution-summary {
  border: 1px solid rgba(31, 53, 83, 0.1);
  border-radius: 16px;
  padding: 1rem;
  margin: 0 0 1rem;
  background: #fbfdff;
}
.report-distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem 1rem;
  margin-top: .75rem;
}
.report-distribution-grid > div {
  border: 1px solid rgba(31, 53, 83, 0.08);
  border-radius: 12px;
  padding: .75rem;
  background: #fff;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-signature-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(31, 53, 83, 0.12);
  page-break-inside: avoid;
}
.report-signature-line {
  height: 2.8rem;
  border-bottom: 1px solid #1f3553;
  margin-bottom: .55rem;
}
.report-print-top {
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .report-hub-selector {
    grid-template-columns: 1fr;
  }
  .report-signature-footer {
    grid-template-columns: 1fr;
  }
}
@media print {
  .report-hub-hero,
  .project-distribution-tools,
  .project-distribution-selection .actions,
  .report-print-top {
    display: none !important;
  }
  .report-print-area {
    border: 0 !important;
    box-shadow: none !important;
  }
  .report-signature-footer {
    break-inside: avoid;
  }
}


/* --- v2.26.0 Mobile Baustellenbedienung & Repeater-Komfort --- */
.mobile-form-progress {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0 0.3rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(31, 53, 83, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-soft, 0 8px 22px rgba(15, 23, 42, 0.05));
}
.mobile-form-progress-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.mobile-form-progress-label { font-weight: 800; color: var(--text, #1f2937); }
.mobile-form-progress-text { color: var(--muted, #64748b); font-weight: 700; }
.mobile-form-progress-track {
  position: relative;
  overflow: hidden;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}
.mobile-form-progress-bar {
  display: block;
  width: var(--k3-form-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--primary, #1d4ed8);
  transition: width 0.18s ease;
}
.image-input-preview {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.7rem;
  border: 1px dashed rgba(31, 53, 83, 0.18);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
}
.image-input-preview[hidden] { display: none !important; }
.image-input-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
  font-weight: 700;
}
.image-input-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.55rem;
}
.image-input-preview-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(31, 53, 83, 0.12);
  background: #fff;
  aspect-ratio: 1 / 1;
}
.image-input-preview-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.image-input-preview-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.25rem 0.35rem;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repeater-row-summary {
  min-width: 0;
  color: var(--muted, #64748b);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.repeater-row-summary[hidden] { display: none !important; }
.form-section-nav { scrollbar-width: thin; }

@media (max-width: 1024px) {
  .main { padding-bottom: 120px; }
  .form-section-nav {
    position: sticky;
    top: 8px;
    z-index: 15;
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.55rem;
    margin: 0.6rem -0.35rem 1rem;
    border: 1px solid rgba(31, 53, 83, 0.08);
    border-radius: 16px;
    background: rgba(246, 248, 251, 0.94);
    box-shadow: var(--shadow-soft, 0 8px 22px rgba(15, 23, 42, 0.05));
    backdrop-filter: blur(10px);
  }
  .form-section-chip {
    flex: 0 0 auto;
    min-height: 44px;
    max-width: min(74vw, 320px);
    justify-content: center;
  }
  .form-grid,
  .project-addressbook-form-grid,
  .project-addressbook-form-grid-wide,
  .time-entry-grid { gap: 14px; }
}

@media (max-width: 860px) {
  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 {
    min-height: 48px;
    font-size: 16px;
  }
  textarea { min-height: 128px; }
  input[type="file"] {
    min-height: 48px;
    padding: 0.7rem;
    border: 1px dashed rgba(31, 53, 83, 0.22);
    border-radius: 12px;
    background: #fff;
  }
  .button,
  button,
  input[type=submit] { min-height: 44px; }
  button.small,
  .button.small {
    min-height: 40px;
    padding: 0.55rem 0.75rem;
  }
  .sticky-form-actions {
    left: 0;
    right: 0;
    margin-left: -8px;
    margin-right: -8px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border: 1px solid rgba(31, 53, 83, 0.08);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.09);
  }
  .form-actions-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    width: 100%;
  }
  .form-save-state { width: 100%; }
  .mobile-form-progress { margin-top: 0.75rem; }
  .repeater-card { border-radius: 18px; }
  .repeater-card .card-head,
  .repeater-card .stack-between-center,
  .repeater-card .stack-between-start { gap: 0.75rem; }
  .repeater-card .repeater-add { width: 100%; }
  .diary-row {
    border: 1px solid rgba(31, 53, 83, 0.1);
    border-radius: 18px;
    background: #fff;
    padding: 0.85rem;
    box-shadow: var(--shadow-soft, 0 8px 22px rgba(15, 23, 42, 0.05));
  }
  .diary-row + .diary-row { margin-top: 0.85rem; }
  .repeater-row-meta {
    position: sticky;
    top: 4px;
    z-index: 3;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin: -0.25rem -0.25rem 0.75rem;
    padding: 0.45rem 0.5rem;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(31, 53, 83, 0.08);
  }
  .repeater-row-badge { min-height: 2rem; }
  .diary-row-grid,
  .project-meeting-item-grid,
  .meeting-participant-row .diary-row-grid { gap: 0.85rem; }
  .diary-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 0.85rem;
  }
  .diary-row-actions .button,
  .diary-row-actions button {
    width: 100%;
    justify-content: center;
  }
  .image-input-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-card-mobile td.table-cell {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .searchbar .field,
  .searchbar > div,
  .searchbar form > div {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .image-input-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-section-chip { max-width: 82vw; }
}


/* v2.27.0 Fristen-Center */
.deadline-hero { border-left: 5px solid var(--accent, #c76b2a); }
.deadline-kpis { margin-top: 1rem; }
.deadline-filter-card .deadline-filters { align-items: end; }
.deadline-table .deadline-title { font-weight: 700; }
.deadline-table .deadline-note { margin-top: .25rem; }
.deadline-status { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .25rem .55rem; font-size: .82rem; font-weight: 700; border: 1px solid rgba(0,0,0,.12); background: #f7f7f7; white-space: nowrap; }
.deadline-status-overdue { background: #fff0f0; border-color: #f2b6b6; color: #a42121; }
.deadline-status-today { background: #fff4e6; border-color: #f1c68e; color: #9a5600; }
.deadline-status-due7 { background: #fffbe8; border-color: #ead777; color: #705b00; }
.deadline-status-done { background: #edf8ef; border-color: #aacfb1; color: #246b32; }
.deadline-status-open { background: #eef5ff; border-color: #b9cff2; color: #254d87; }
.deadline-status-reminder { background: #f0ecff; border-color: #c7baf2; color: #48328a; }
tr.deadline-row-overdue { background: rgba(188, 40, 40, .06); }
tr.deadline-row-today { background: rgba(220, 137, 24, .07); }
tr.deadline-row-due7 { background: rgba(198, 165, 20, .06); }
.deadline-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.deadline-actions form { display: inline-flex; margin: 0; }
.deadline-mini-list { display: grid; gap: .65rem; }
.deadline-mini-row { display: grid; grid-template-columns: minmax(88px, auto) 1fr auto; gap: .75rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--border, #e5ded6); border-radius: .85rem; background: #fff; }
.deadline-reminder-note { color: #6d5a44; font-size: .85rem; }
@media (max-width: 760px) {
  .deadline-mini-row { grid-template-columns: 1fr; }
  .deadline-actions { flex-direction: column; align-items: stretch; }
  .deadline-actions .button, .deadline-actions button { width: 100%; }
}
@media print {
  .deadline-actions, .deadline-filter-card, .no-print { display: none !important; }
  .deadline-hero { border: 0; box-shadow: none; }
}


/* v2.28.0 – Projektkommunikation */
.communication-hero .searchbar,
.report-hub-selector {
    align-items: end;
}
.communication-grid {
    align-items: start;
}
.communication-compose-card textarea,
.communication-compose textarea {
    min-height: 9rem;
}
.communication-recipient-card .table-wrap {
    max-height: 520px;
    overflow: auto;
}
.communication-recipient-table td,
.communication-recipient-table th {
    vertical-align: top;
}
.communication-kpis .card {
    min-width: 0;
}
.communication-history-card td {
    vertical-align: top;
}
@media (max-width: 900px) {
    .communication-grid {
        grid-template-columns: 1fr !important;
    }
    .communication-recipient-card .table-wrap {
        max-height: none;
    }
}
@media print {
    .communication-compose-card,
    .communication-recipient-card,
    .communication-hero {
        box-shadow: none;
    }
}


.maintenance-action-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.maintenance-action-card {
    border: 1px solid var(--border, #e8d7c8);
    border-radius: 16px;
    padding: 1rem;
    background: var(--surface-soft, #fffaf4);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-width: 0;
}
.maintenance-action-card button {
    align-self: flex-start;
}
.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.inline-form {
    display: inline-flex;
    margin: 0;
}
@media (max-width: 720px) {
    .maintenance-action-card button {
        width: 100%;
    }
    .inline-form {
        width: 100%;
    }
    .inline-form button {
        width: 100%;
    }
}


/* v2.30.0: Punkte tabellarisch */
.point-table-hero,
.point-table-filter-card,
.point-table-group {
  break-inside: avoid;
}
.point-table th,
.inline-point-table th {
  white-space: nowrap;
}
.point-table-title {
  font-weight: 800;
}
.point-table-note {
  max-width: 620px;
}
.point-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .24rem .56rem;
  font-size: .82rem;
  font-weight: 800;
  border: 1px solid rgba(24, 49, 83, .12);
  background: #f7f3ee;
  color: #183153;
}
.point-status-badge-overdue {
  background: #fff1f0;
}
.point-status-badge-due7 {
  background: #fff8e6;
}
.point-status-badge-done {
  background: #edf7ed;
}
.point-table-row.point-status-overdue td {
  background: rgba(176, 51, 36, .045);
}
.point-table-row.point-status-due7 td {
  background: rgba(196, 135, 24, .055);
}
.repeater-table-preview {
  margin: 1rem 0 1.1rem;
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 14px;
  background: #fffaf5;
  padding: .7rem .85rem;
}
.repeater-table-preview summary {
  cursor: pointer;
  font-weight: 800;
  color: #183153;
}
.inline-point-table {
  margin-top: .75rem;
}
.inline-point-table td,
.inline-point-table th {
  vertical-align: top;
}
@media (min-width: 780px) {
  .point-table-filters {
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(170px, .8fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(170px, .8fr) auto auto auto;
  }
  .repeater-table-preview {
    margin-left: .15rem;
    margin-right: .15rem;
  }
}
@media (max-width: 779px) {
  .point-table-filter-card,
  .point-table-filter-card form,
  .point-table-filter-card form > div {
    width: 100%;
  }
  .point-table-group {
    padding: .85rem;
  }
}
@media print {
  .point-table-filter-card,
  .sidebar,
  .topbar,
  .toast-stack,
  .scope-banner .actions {
    display: none !important;
  }
  .point-table-group,
  .point-table-hero {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* Kontext-Hilfe und globale Bedienungsanleitung */
.help-trigger {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.12rem;
  line-height: 1;
}
.help-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 2px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}
.help-page h2 { font-size: 1.45rem; }
.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
}
.help-hero-copy p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
}
.help-hero-art,
.help-illustration-card {
  min-width: 0;
}
.help-svg {
  width: 100%;
  height: auto;
  display: block;
}
.help-steps {
  padding-left: 22px;
}
.help-steps li {
  margin: 0 0 10px;
  line-height: 1.55;
}
.help-global-grid,
.help-topic-grid,
.help-check-grid {
  align-items: stretch;
}
.help-mini-card ul,
.help-topic-grid ul {
  padding-left: 20px;
}
.help-mini-card li,
.help-topic-grid li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.help-flow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.help-flow-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-2);
  min-height: 122px;
}
.help-flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.help-flow-step strong,
.help-flow-step small {
  display: block;
}
.help-flow-step small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.35;
}
.help-module-index {
  display: grid;
  gap: 20px;
}
.help-module-group h3 {
  margin-bottom: 10px;
}
.help-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.help-module-grid a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-2);
  color: var(--text);
  min-height: 112px;
}
.help-module-grid a:hover {
  text-decoration: none;
  border-color: #93c5fd;
  background: #f8fbff;
}
.help-module-grid a span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}
.help-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 1180px) {
  .help-flow-strip,
  .help-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .help-hero,
  .help-global-grid,
  .help-topic-grid,
  .help-check-grid,
  .help-module-grid,
  .help-flow-strip {
    grid-template-columns: 1fr;
  }
  .help-flow-step {
    min-height: 0;
  }
}


/* v2.33.0: tabellarische Baubesprechungs-Teilnehmer und Protokollpunkte */
.k3-table-repeater .diary-repeater {
  display: grid;
  gap: .75rem;
}

.k3-table-header {
  display: grid;
  gap: .5rem;
  margin: 1rem 0 .35rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.k3-participant-table-header,
.k3-participant-table-row {
  grid-template-columns: minmax(240px, 2.1fr) minmax(110px, .65fr) minmax(130px, .8fr) minmax(180px, 1.35fr) minmax(84px, .45fr);
}

.protocol-mainpoint-table-header,
.protocol-mainpoint-grid {
  grid-template-columns: minmax(96px, .55fr) minmax(100px, .6fr) minmax(240px, 2.2fr) minmax(145px, .85fr) minmax(105px, .65fr) minmax(110px, .65fr) minmax(84px, .45fr);
}

.k3-participant-row,
.protocol-mainpoint-row {
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 12px;
  background: var(--card, #fff);
  padding: .75rem;
}

.k3-participant-table-row,
.protocol-mainpoint-grid,
.protocol-subpoint-row {
  display: grid;
  gap: .6rem;
  align-items: start;
}

.k3-participant-row .repeater-row-meta,
.protocol-mainpoint-row .repeater-row-meta {
  display: none;
}

.k3-hidden-meta[hidden] {
  display: none !important;
}

.k3-cell label,
.protocol-subpoint-row label {
  display: block;
  margin-bottom: .2rem;
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.k3-cell input,
.k3-cell select,
.k3-cell textarea {
  width: 100%;
  min-width: 0;
}

.k3-cell-action {
  text-align: right;
}

.protocol-subpoints-panel {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--border, #dbe3ef);
}

.protocol-subpoints-title {
  margin-bottom: .5rem;
  font-weight: 700;
}

.protocol-subpoints-list {
  display: grid;
  gap: .7rem;
}

.protocol-subpoint-row {
  grid-template-columns: minmax(90px, .55fr) minmax(260px, 2fr) minmax(120px, .75fr) minmax(115px, .7fr) minmax(210px, 1.4fr) minmax(210px, 1.35fr) minmax(84px, .45fr);
  padding: .7rem;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 10px;
  background: var(--surface, #f8fafc);
}

.protocol-subpoint-actions {
  margin-top: .75rem;
  display: flex;
  justify-content: flex-end;
}

.meeting-subpoint-meta {
  margin-top: .25rem;
  font-size: .82rem;
  color: var(--muted, #64748b);
}

.meeting-subpoint-photos {
  margin-top: .35rem;
}

.k3-distribution-selector .k3-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .45rem;
  max-height: 240px;
  overflow: auto;
  padding: .35rem;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 10px;
  background: var(--surface, #f8fafc);
}

.k3-distribution-selector .check-card {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  padding: .45rem .55rem;
  border-radius: 8px;
  background: var(--card, #fff);
}

@media (max-width: 1180px) {
  .protocol-mainpoint-table-header,
  .k3-participant-table-header {
    display: none;
  }

  .protocol-mainpoint-grid {
    grid-template-columns: minmax(90px, .7fr) minmax(110px, .8fr) minmax(220px, 2fr) minmax(135px, 1fr);
  }

  .k3-participant-table-row {
    grid-template-columns: minmax(220px, 2fr) minmax(110px, .8fr) minmax(130px, 1fr);
  }

  .protocol-subpoint-row {
    grid-template-columns: minmax(90px, .7fr) minmax(240px, 2fr) minmax(120px, .8fr);
  }

  .k3-cell-description,
  .k3-cell-photos,
  .k3-cell-contact,
  .k3-cell-remarks,
  .k3-cell-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .protocol-mainpoint-grid,
  .protocol-subpoint-row,
  .k3-participant-table-row {
    grid-template-columns: 1fr;
  }

  .k3-cell-action,
  .protocol-subpoint-actions {
    text-align: left;
    justify-content: flex-start;
  }
}

/* v2.34 Importvorschau und Protokoll-Projektkontakte */
.google-import-preview-table tr.import-status-new td { background: rgba(22, 163, 74, 0.06); }
.google-import-preview-table tr.import-status-update td { background: rgba(37, 99, 235, 0.06); }
.google-import-preview-table tr.import-status-warning td { background: rgba(245, 158, 11, 0.08); }
.google-import-preview-table tr.import-status-error td { background: rgba(220, 38, 38, 0.08); }
.import-status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.18rem 0.55rem; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--border-color, #e0d5cc); }
.import-status-pill-new { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.import-status-pill-update { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.import-status-pill-warning { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.import-status-pill-error { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.project-protocol-flag-grid label.checkbox { min-width: 12rem; }
.compact-stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* v2.35 Journalfilter, Folgeprotokoll und PDF-Ausgaben */
.k3-followup-box {
  border-left: 4px solid var(--primary, #1f6feb);
  background: rgba(37, 99, 235, 0.06);
}
.k3-followup-box a {
  font-weight: 700;
}
.report-variant-selector {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border: 1px solid rgba(31, 53, 83, 0.12);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
}
.report-variant-selector label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}
.report-variant-selector select {
  min-width: 240px;
}
.report-protocol-responsibility-table td:first-child {
  font-weight: 700;
}
.report-protocol-variant-photos .report-photo-grid {
  margin-top: 0.35rem;
}
.searchbar input[name="journal_responsible"] {
  min-width: 190px;
}
@media print {
  .report-variant-selector {
    display: none !important;
  }
}


/* v2.36 Aufgaben-Cockpit, Fristenampel, Rückmeldelisten und Protokollversand */
.deadline-days { display:inline-flex; align-items:center; border-radius:999px; padding:.25rem .55rem; background:#f8fafc; border:1px solid #dbe3ec; font-weight:700; white-space:nowrap; }
.deadline-days-overdue { background:#fff1f2; border-color:#fecdd3; }
.deadline-days-today { background:#fff7ed; border-color:#fed7aa; }
.deadline-days-week, .deadline-days-due7 { background:#fefce8; border-color:#fde68a; }
.deadline-days-done { background:#ecfdf5; border-color:#bbf7d0; }
.deadline-photo-badge { white-space:nowrap; }
.deadline-export-card .actions, .protocol-dispatch-box .actions { gap:.45rem; }
.protocol-dispatch-box { margin:1rem 0; padding:1rem; border:1px solid #dbe3ec; border-radius:16px; background:#f8fafc; }
.protocol-dispatch-box h4 { margin:.1rem 0 .65rem; }
.dashboard-kpi-link { color:inherit; text-decoration:none; transition:transform .15s ease, box-shadow .15s ease; }
.dashboard-kpi-link:hover { transform:translateY(-1px); box-shadow:0 14px 32px rgba(15,23,42,.10); }
.deadline-dashboard-kpis { margin:1rem 0; }
.report-feedback-table th, .report-feedback-table td { vertical-align:top; }
.report-feedback-table td:nth-last-child(-n+3) { min-width:120px; height:52px; }
@media print { .deadline-export-card, .protocol-dispatch-box.no-print { display:none !important; } .report-feedback-table td:nth-last-child(-n+3) { height:64px; } }

/* v2.36.1 – Projekt-Hotfix: Speichern oben sichtbar halten */
.project-form-top-actions {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border-color, #e3e6eb);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.project-form-top-actions .form-actions-buttons {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* v2.37 – Systemdiagnose, Update-Sicherheit und Projekt-Assistent */
.v37-module-check-table td {
  vertical-align: top;
}
.v37-module-check-table td:nth-child(2) {
  min-width: 110px;
}
.v37-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}
.v37-contact-picklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .35rem .75rem;
  max-height: 260px;
  overflow: auto;
  padding: .75rem;
  border: 1px solid var(--border-color, #e3e6eb);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}
.v37-contact-picklist label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

/* v2.38 – Rückmeldungen von Firmen und externe Aufgabenlisten */
.external-feedback-share-card input[readonly] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.external-feedback-items {
  margin: .5rem 0 0;
  padding-left: 1rem;
}
.external-feedback-items li {
  margin-bottom: .35rem;
}
.public-feedback-body {
  background: #f6f2ee;
}
.public-feedback-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}
.public-feedback-header h1 {
  margin: .45rem 0;
}
.external-feedback-public-table textarea {
  min-width: 220px;
}
@media (max-width: 760px) {
  .external-feedback-public-table,
  .external-feedback-public-table thead,
  .external-feedback-public-table tbody,
  .external-feedback-public-table tr,
  .external-feedback-public-table th,
  .external-feedback-public-table td {
    display: block;
  }
  .external-feedback-public-table thead {
    display: none;
  }
  .external-feedback-public-table tr {
    border: 1px solid var(--border-color, #e3e6eb);
    border-radius: 12px;
    padding: .75rem;
    margin-bottom: .75rem;
    background: #fff;
  }
  .external-feedback-public-table td {
    border: 0;
    padding: .35rem 0;
  }
  .external-feedback-public-table select,
  .external-feedback-public-table input,
  .external-feedback-public-table textarea {
    width: 100%;
  }
}

/* v2.38.1 – Projektadressbuch: tabellarische Schnellpflege ohne Scrollsprung */
.project-addressbook-stay-anchor {
  scroll-margin-top: 115px;
}
.project-addressbook-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.project-addressbook-contact-table-compact {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}
.project-addressbook-contact-table-compact th,
.project-addressbook-contact-table-compact td {
  vertical-align: top;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}
.project-addressbook-contact-table-compact thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.98);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.project-addressbook-contact-table-compact tbody tr:last-child td {
  border-bottom: 0;
}
.project-addressbook-contact-table-compact tbody tr:target,
.project-addressbook-contact-table-compact tbody tr.is-scroll-restored {
  outline: 2px solid rgba(234, 88, 12, 0.35);
  outline-offset: -2px;
  background: rgba(255, 247, 237, 0.82);
}
.project-addressbook-contact-table-compact .project-addressbook-add-row td {
  background: rgba(248, 250, 252, 0.72);
}
.project-addressbook-contact-table-compact input[type="text"],
.project-addressbook-contact-table-compact input[type="number"],
.project-addressbook-contact-table-compact select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.project-addressbook-contact-table-compact input[name="role"] {
  min-width: 160px;
}
.project-addressbook-contact-table-compact input[name="trade_or_area"] {
  min-width: 140px;
}
.project-addressbook-contact-table-compact input[name="display_order"] {
  width: 72px;
  min-width: 72px;
}
.project-addressbook-contact-table-compact select[name="contact_id"] {
  min-width: 230px;
}
.project-addressbook-contact-table-compact select[name="communication_type"],
.project-addressbook-contact-table-compact select[name="protocol_status"] {
  min-width: 110px;
}
.project-addressbook-contact-table-compact .center {
  text-align: center;
}
.project-addressbook-contact-table-compact .center input[type="checkbox"] {
  margin-top: 7px;
}
.project-addressbook-contact-name-cell {
  min-width: 240px;
}
.project-addressbook-contact-meta.compact {
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.32;
}
.project-addressbook-table-actions {
  min-width: 180px;
}
.project-addressbook-table-actions form,
.project-addressbook-table-actions a.button {
  margin-bottom: 4px;
}
.project-addressbook-empty.compact {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
}
@media (max-width: 860px) {
  .project-addressbook-contact-table-compact {
    min-width: 1040px;
  }
  .project-addressbook-contact-table-compact input[type="text"],
  .project-addressbook-contact-table-compact input[type="number"],
  .project-addressbook-contact-table-compact select {
    min-height: 40px;
    font-size: 16px;
  }
}

/* v2.38.2 – Baubesprechung: Unterpunkte, Schnellpflege und professionelle Druckausgabe */
.protocol-mainpoint-row.is-collapsed .protocol-subpoints-panel[hidden] {
  display: none !important;
}
.protocol-subpoint-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.45rem;
  margin-right: .35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: .78rem;
  font-weight: 800;
}
.protocol-subpoint-row.is-draft-subpoint {
  border-style: dashed;
  background: #fffdf8;
}
.protocol-subpoint-row.is-draft-subpoint .readonly-field small {
  display: block;
  margin-top: .18rem;
  font-size: .72rem;
  font-weight: 600;
}
.k3-participants-repeater .diary-repeater {
  gap: .35rem;
}
.k3-participants-repeater .k3-participant-row {
  border-radius: 0;
  border-width: 0 0 1px;
  padding: .42rem .25rem;
  box-shadow: none;
}
.k3-participants-repeater .k3-participant-row:first-child {
  border-top: 1px solid var(--border, #dbe3ef);
}
.k3-participants-repeater .k3-participant-table-row {
  align-items: end;
}
.k3-participants-repeater .k3-cell label {
  display: none;
}
.k3-participants-repeater .k3-cell-action label {
  display: none;
}
.k3-participants-repeater input,
.k3-participants-repeater select {
  min-height: 2.1rem;
  padding-top: .35rem;
  padding-bottom: .35rem;
}
@media (max-width: 1180px) {
  .k3-participants-repeater .k3-cell label,
  .k3-participants-repeater .k3-cell-action label {
    display: block;
  }
  .k3-participants-repeater .k3-participant-row {
    border: 1px solid var(--border, #dbe3ef);
    border-radius: 12px;
    padding: .75rem;
  }
}

.report-print-area {
  color: #111827;
}
.report-brand-panel {
  gap: 1rem;
}
.report-brand-company {
  letter-spacing: .01em;
}
.report-entry > h3,
.meeting-protocol-title {
  color: #0f172a;
}
.report-protocol-table .meeting-subpoints {
  gap: .42rem;
}
.report-protocol-table .meeting-subpoint {
  padding: .22rem 0 .3rem;
  border-bottom: 1px solid #eef2f7;
}
.report-protocol-table .meeting-subpoint:last-child {
  border-bottom: 0;
}
.report-protocol-table .meeting-subpoint span {
  display: inline-block;
  min-width: 3.8rem;
  color: #0f172a;
}
.report-protocol-table .meeting-subpoint-meta {
  margin-left: 4rem;
  color: #475569;
}
.report-protocol-table td:nth-child(1) { width: 7%; }
.report-protocol-table td:nth-child(2) { width: 18%; }
.report-protocol-table td:nth-child(3) { width: 39%; }
.report-protocol-table td:nth-child(4) { width: 15%; }
.report-protocol-table td:nth-child(5) { width: 8%; }
.report-protocol-table td:nth-child(6) { width: 8%; }

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm 12mm 10mm;
  }
  html, body {
    background: #fff !important;
    color: #111827 !important;
    font-size: 9.4pt;
    line-height: 1.28;
  }
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  main,
  .content,
  .page,
  .card.report-print-area {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  .report-brand-panel {
    display: grid !important;
    grid-template-columns: 1.35fr 1fr;
    gap: 8mm;
    margin: 0 0 6mm !important;
    padding: 0 0 5mm !important;
    border: 0 !important;
    border-bottom: 1.4pt solid #0f2a4a !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  .report-brand-main {
    gap: 4mm;
    align-items: center;
  }
  .report-brand-logo img {
    max-width: 32mm !important;
    max-height: 18mm !important;
    object-fit: contain;
  }
  .report-brand-company {
    font-size: 16pt !important;
    line-height: 1.05;
    margin: 0 0 1mm;
  }
  .report-brand-app {
    font-size: 10.5pt !important;
    font-weight: 700;
  }
  .report-brand-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1mm;
    font-size: 8.5pt;
    line-height: 1.22;
  }
  .report-entry {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }
  .report-entry > h3,
  .meeting-protocol-title {
    margin: 0 0 3mm !important;
    padding: 0 0 2mm !important;
    border-bottom: 1pt solid #d8dee8;
    font-size: 16pt !important;
    line-height: 1.1;
  }
  .meeting-protocol-subtitle {
    margin: 0 0 3mm !important;
    font-size: 9pt;
  }
  .meeting-protocol-header,
  .report-block,
  .report-subtable-wrap {
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 0 5mm !important;
  }
  .meeting-protocol-meta,
  .report-meta-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.3mm 7mm;
    margin: 0 0 4mm !important;
    font-size: 9pt;
  }
  .report-block-title {
    margin: 4mm 0 1.8mm !important;
    padding: 0 0 1mm !important;
    border-bottom: 1pt solid #d8dee8;
    color: #0f172a;
    font-size: 10.2pt;
    text-transform: none;
  }
  .report-subtable,
  .report-protocol-table,
  .report-meeting-participants-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 8.2pt !important;
  }
  .report-subtable thead,
  .report-protocol-table thead,
  .report-meeting-participants-table thead {
    display: table-header-group;
  }
  .report-subtable th,
  .report-subtable td,
  .report-protocol-table th,
  .report-protocol-table td,
  .report-meeting-participants-table th,
  .report-meeting-participants-table td {
    padding: 2.2mm 1.6mm !important;
    border: 0.6pt solid #d8dee8 !important;
    vertical-align: top !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: auto;
  }
  .report-subtable th,
  .report-protocol-table th,
  .report-meeting-participants-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 7.6pt !important;
    line-height: 1.12;
    text-transform: uppercase;
    letter-spacing: .02em;
  }
  .report-protocol-table th:nth-child(1),
  .report-protocol-table td:nth-child(1) { width: 8% !important; }
  .report-protocol-table th:nth-child(2),
  .report-protocol-table td:nth-child(2) { width: 18% !important; }
  .report-protocol-table th:nth-child(3),
  .report-protocol-table td:nth-child(3) { width: 40% !important; }
  .report-protocol-table th:nth-child(4),
  .report-protocol-table td:nth-child(4) { width: 15% !important; }
  .report-protocol-table th:nth-child(5),
  .report-protocol-table td:nth-child(5) { width: 9% !important; }
  .report-protocol-table th:nth-child(6),
  .report-protocol-table td:nth-child(6) { width: 10% !important; }
  .report-protocol-table th:nth-child(n+7),
  .report-protocol-table td:nth-child(n+7) { display: none !important; }
  .report-meeting-participants-table th:nth-child(1),
  .report-meeting-participants-table td:nth-child(1) { width: 24% !important; }
  .report-meeting-participants-table th:nth-child(2),
  .report-meeting-participants-table td:nth-child(2) { width: 24% !important; }
  .report-meeting-participants-table th:nth-child(3),
  .report-meeting-participants-table td:nth-child(3) { width: 18% !important; }
  .report-meeting-participants-table th:nth-child(4),
  .report-meeting-participants-table td:nth-child(4) { width: 13% !important; }
  .report-meeting-participants-table th:nth-child(5),
  .report-meeting-participants-table td:nth-child(5) { width: 21% !important; }
  .meeting-subpoint {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-protocol-table .meeting-subpoint span {
    min-width: 9mm;
  }
  .report-protocol-table .meeting-subpoint-meta {
    margin-left: 0;
    margin-top: 1mm;
    font-size: 7.8pt;
  }
  .report-signature-footer {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10mm;
    margin-top: 12mm !important;
    padding-top: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-signature-line {
    height: 12mm !important;
    border-bottom: 1pt solid #0f2a4a !important;
    margin-bottom: 2mm !important;
  }
  .report-distribution-summary {
    break-before: auto;
    page-break-before: auto;
  }
}

/* v2.39.0 – Baubesprechung Pro: Editor, Fortschreibungen und Drucklayout */
.k3-participant-table-header,
.k3-participant-table-row {
  grid-template-columns: minmax(230px, 1.8fr) minmax(180px, 1.1fr) minmax(130px, .8fr) minmax(108px, .58fr) minmax(180px, 1.15fr) minmax(84px, .4fr);
}
.k3-participant-table-header span:nth-child(2)::before { content: ''; }
.k3-participant-table-header span:nth-child(2) { font-size: 0; }
.k3-participant-table-header span:nth-child(2)::after { content: 'Firma'; font-size: .78rem; }
.k3-cell-company .readonly-field { min-height: 38px; display: flex; align-items: center; }
.protocol-subpoints-empty { padding: .65rem .75rem; border: 1px dashed var(--border, #dbe3ef); border-radius: 10px; background: #fff; }
.k3-meeting-template-box .button { margin: .25rem .25rem .25rem 0; }
.meeting-report-print-area { max-width: 210mm; margin-left: auto; margin-right: auto; }
.meeting-document-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 3px solid #1f3553;
}
.meeting-document-brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.meeting-document-brand img { width: 122px; max-height: 60px; object-fit: contain; }
.meeting-document-company { font-size: 1.55rem; line-height: 1.05; font-weight: 850; color: #1f3553; }
.meeting-document-app { font-size: .98rem; font-weight: 700; color: #64748b; margin-top: .15rem; }
.meeting-document-docno { text-align: right; min-width: 210px; }
.meeting-document-docno strong { display: block; font-size: .98rem; color: #0f172a; }
.meeting-document-docno span { display: block; margin-top: .2rem; color: #64748b; font-size: .85rem; }
.meeting-protocol-header.report-brand-header {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: start;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: #fff;
}
.meeting-protocol-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meeting-protocol-meta > div { border-bottom: 1px solid #eef2f7; padding-bottom: .25rem; }
.meeting-protocol-meta strong { display: block; color: #475569; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.meeting-protocol-meta span { display: block; color: #111827; font-weight: 650; overflow-wrap: anywhere; }
.meeting-distribution-list { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .9rem; }
.meeting-distribution-list span::after { content: ';'; }
.meeting-distribution-list span:last-child::after { content: ''; }
.report-protocol-table.report-protocol-variant-complete td,
.report-protocol-table.report-protocol-variant-open td,
.report-protocol-table.report-protocol-variant-changes td { line-height: 1.32; }
.report-protocol-table .meeting-subpoint-current { font-weight: 600; }

@media (max-width: 1180px) {
  .k3-participant-table-row { grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(130px, 1fr); }
  .k3-cell-company { grid-column: auto; }
}
@media (max-width: 860px) {
  .meeting-document-head,
  .meeting-protocol-header.report-brand-header { display: block; }
  .meeting-document-docno { text-align: left; margin-top: 10px; }
  .meeting-protocol-meta { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 10mm 14mm 10mm; }
  .meeting-report-print-area {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .meeting-document-head {
    display: flex !important;
    padding: 0 0 4mm !important;
    margin: 0 0 5mm !important;
    border-bottom: 1.6pt solid #1f3553 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .meeting-document-brand img { width: 28mm !important; max-height: 16mm !important; }
  .meeting-document-company { font-size: 15pt !important; line-height: 1.05 !important; }
  .meeting-document-app { font-size: 9pt !important; }
  .meeting-document-docno { font-size: 8pt !important; min-width: 52mm !important; }
  .meeting-protocol-header.report-brand-header {
    display: grid !important;
    grid-template-columns: 52mm 1fr !important;
    gap: 5mm !important;
    padding: 0 0 4mm !important;
    margin: 0 0 5mm !important;
    border: 0 !important;
    border-bottom: 0.9pt solid #d8dee8 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
  .meeting-protocol-title { font-size: 15pt !important; border: 0 !important; padding: 0 !important; margin: 0 0 2mm !important; }
  .meeting-protocol-subtitle { font-size: 8.8pt !important; margin: 0 !important; }
  .meeting-protocol-meta {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.2mm 5mm !important;
    font-size: 8.2pt !important;
    margin: 0 !important;
  }
  .meeting-protocol-meta > div { border-bottom: .4pt solid #e5e7eb !important; padding-bottom: .8mm !important; }
  .meeting-protocol-meta strong { font-size: 6.6pt !important; }
  .meeting-protocol-meta span { font-size: 8.2pt !important; font-weight: 600 !important; }
  .report-block { break-inside: auto; page-break-inside: auto; }
  .report-block-title { break-after: avoid; page-break-after: avoid; }
  .report-protocol-table { font-size: 7.8pt !important; }
  .report-protocol-table th:nth-child(1), .report-protocol-table td:nth-child(1) { width: 10% !important; }
  .report-protocol-table th:nth-child(2), .report-protocol-table td:nth-child(2) { width: 20% !important; }
  .report-protocol-table th:nth-child(3), .report-protocol-table td:nth-child(3) { width: 39% !important; }
  .report-protocol-table th:nth-child(4), .report-protocol-table td:nth-child(4) { width: 14% !important; }
  .report-protocol-table th:nth-child(5), .report-protocol-table td:nth-child(5) { width: 8% !important; }
  .report-protocol-table th:nth-child(6), .report-protocol-table td:nth-child(6) { width: 9% !important; }
  .meeting-distribution-list { font-size: 8pt !important; gap: .8mm 2mm !important; }
  .meeting-subpoint { break-inside: avoid; page-break-inside: avoid; }
  .report-signature-footer { margin-top: 10mm !important; }
}
.k3-participant-table-header span:nth-child(2) { font-size: .78rem; }
.k3-participant-table-header span:nth-child(2)::before,
.k3-participant-table-header span:nth-child(2)::after { content: none; }

/* v2.40 Baustellenmodus / Fotodokumentation */
.site-mode-hero {
  border-top: 4px solid var(--accent, #f28c28);
}
.site-mode-project-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: end;
  margin-top: 1rem;
}
.site-mode-project-picker label {
  font-weight: 700;
  display: block;
  width: 100%;
}
.site-mode-project-picker select {
  min-width: min(420px, 100%);
}
.site-mode-project-note {
  margin-top: .75rem;
  padding: .65rem .85rem;
  border-radius: 12px;
  background: #fff7ef;
  border: 1px solid #f2d4b8;
}
.site-mode-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}
.site-mode-main,
.site-mode-side,
.site-recent-list,
.site-mode-shortcuts {
  display: grid;
  gap: 1rem;
}
.site-quick-card {
  background: #fff;
  border: 1px solid #eadfd5;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 10px 22px rgba(24, 49, 83, .06);
}
.site-quick-card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.site-quick-card h3 {
  margin: .3rem 0 .15rem;
}
.site-mode-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .78rem;
  font-weight: 800;
  background: #eef5ff;
  color: #183153;
  border: 1px solid #dbe8f7;
}
.site-mode-pill.warning {
  background: #fff4e8;
  color: #9c4f00;
  border-color: #f1c492;
}
.site-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.site-mode-grid .full,
.site-photo-upload.full {
  grid-column: 1 / -1;
}
.site-photo-upload {
  border: 1px dashed #d8c6b8;
  border-radius: 14px;
  padding: .85rem;
  background: #fffaf5;
}
.site-recent-item {
  display: block;
  padding: .8rem;
  border: 1px solid #eadfd5;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.site-recent-item:hover {
  border-color: #f28c28;
  box-shadow: 0 8px 18px rgba(24, 49, 83, .08);
}
.site-recent-type {
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #b45c00;
  margin-bottom: .25rem;
}
.site-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.site-photo-figure {
  margin: 0;
  border: 1px solid #eadfd5;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.site-photo-figure img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #f4f0ec;
}
.site-photo-figure figcaption {
  padding: .7rem;
  font-size: .86rem;
  line-height: 1.35;
}
.site-photo-figure figcaption span {
  color: #687386;
}
@media (max-width: 980px) {
  .site-mode-layout {
    grid-template-columns: 1fr;
  }
  .site-mode-side {
    order: -1;
  }
}
@media (max-width: 680px) {
  .site-mode-grid {
    grid-template-columns: 1fr;
  }
  .site-quick-card {
    padding: .85rem;
  }
  .site-photo-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media print {
  .site-mode-hero,
  .site-mode-side,
  .site-mode-main,
  .topbar,
  .sidebar,
  .scope-banner {
    display: none !important;
  }
  .site-photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .site-photo-figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* K3 v2.41 – Abrechnung Pro / Leistungsnachweis */
.commercial-hero {
    border-color: rgba(244, 111, 31, .35);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,247,237,.92));
}
.commercial-kpis .kpi { min-height: 86px; }
.commercial-table td, .commercial-table th { vertical-align: top; }
.compact-table td.num, .compact-table th.num,
.commercial-table td.num, .commercial-table th.num { text-align: right; white-space: nowrap; }
.compact-table td.center, .compact-table th.center { text-align: center; }
.time-quick-table th, .time-quick-table td { white-space: nowrap; }
.time-quick-table input[type="text"] { min-width: 260px; }
.time-quick-table select { min-width: 160px; }
.time-quick-table input[type="number"] { width: 86px; }
.time-quick-table input[type="time"] { width: 104px; }
.time-quick-table input[type="date"] { width: 138px; }
.print-document-body { background: #f3f4f6; margin: 0; color: #0f172a; }
.k3-print-document { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; padding: 18mm 16mm; box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; font-size: 10.5pt; line-height: 1.35; }
.k3-print-header { display: grid; grid-template-columns: 52mm 1fr; gap: 10mm; align-items: start; border-bottom: 2px solid #183153; padding-bottom: 8mm; margin-bottom: 9mm; }
.k3-print-logo { max-width: 48mm; max-height: 25mm; object-fit: contain; }
.k3-print-title h1 { margin: 0 0 2mm; font-size: 22pt; line-height: 1.05; color: #183153; }
.k3-print-title p { margin: 0; font-size: 11pt; }
.print-meta-grid { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 5mm; margin: 0 0 8mm; }
.print-meta-grid > div, .invoice-address-block > div { border: 1px solid #e5e7eb; border-radius: 8px; padding: 4mm; }
.k3-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 5mm 0 7mm; }
.k3-print-table th { background: #f8fafc; color: #183153; border-top: 1px solid #183153; border-bottom: 1px solid #d1d5db; text-align: left; padding: 2.2mm 2mm; font-size: 9.5pt; }
.k3-print-table td { border-bottom: 1px solid #e5e7eb; padding: 2.2mm 2mm; vertical-align: top; overflow-wrap: anywhere; }
.k3-print-table tfoot th { border-top: 2px solid #183153; background: #fff; }
.k3-print-table .num, .k3-print-table td.num, .k3-print-table th.num { text-align: right; white-space: nowrap; }
.commercial-worklog-print th:nth-child(1) { width: 20mm; }
.commercial-worklog-print th:nth-child(2) { width: 28mm; }
.commercial-worklog-print th:nth-child(3) { width: 36mm; }
.commercial-worklog-print th:nth-child(5) { width: 20mm; }
.commercial-worklog-print th:nth-child(6) { width: 14mm; }
.commercial-worklog-print th:nth-child(7) { width: 22mm; }
.invoice-address-block { display: grid; grid-template-columns: 1.1fr .9fr; gap: 8mm; margin-bottom: 10mm; }
.invoice-meta { line-height: 1.65; }
.invoice-print-table th:nth-child(1) { width: 14mm; }
.invoice-print-table th:nth-child(3) { width: 22mm; }
.invoice-print-table th:nth-child(4), .invoice-print-table th:nth-child(5) { width: 28mm; }
.invoice-total-block { display: flex; justify-content: flex-end; margin: 5mm 0 9mm; }
.invoice-total-block table { border-collapse: collapse; min-width: 70mm; }
.invoice-total-block th, .invoice-total-block td { padding: 2.5mm 3mm; border-bottom: 1px solid #e5e7eb; text-align: right; }
.invoice-total-block .total th, .invoice-total-block .total td { font-size: 13pt; border-top: 2px solid #183153; font-weight: 800; }
.invoice-footer-note { margin-top: 12mm; }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18mm; margin-top: 18mm; }
.signature-grid > div { border-top: 1.5px solid #183153; padding-top: 3mm; min-height: 22mm; }
.k3-print-footer { display: flex; justify-content: space-between; gap: 8mm; border-top: 1px solid #e5e7eb; padding-top: 4mm; margin-top: 12mm; font-size: 8.5pt; color: #64748b; }
@media print {
    .print-document-body { background: #fff; }
    .k3-print-document { width: auto; min-height: 0; margin: 0; padding: 0; }
    .k3-print-header, .k3-print-table tr, .invoice-address-block, .signature-grid { break-inside: avoid; page-break-inside: avoid; }
    .k3-print-footer { position: running(footer); }
}


/* v2.42.0 Login-Verwaltung und interner Chat */
.login-metrics .metric-card {
  min-height: 110px;
}

.metric-card .metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-card .metric-label {
  margin-top: .35rem;
  color: var(--muted, #667085);
  font-size: .92rem;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #b45c00;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  vertical-align: middle;
}

.chat-card {
  overflow: hidden;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 58vh;
  min-height: 320px;
  overflow-y: auto;
  padding: .75rem;
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .66);
}

.chat-message {
  width: min(760px, 92%);
  padding: .85rem 1rem;
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 49, 83, .06);
}

.chat-message.own {
  align-self: flex-end;
  background: #fff8ef;
  border-color: rgba(180, 92, 0, .24);
}

.chat-message.deleted {
  opacity: .72;
  background: #f7f7f7;
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .45rem;
  color: var(--muted, #667085);
  font-size: .84rem;
}

.chat-message-body {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.chat-delete-form {
  margin-top: .6rem;
}

.chat-compose textarea {
  width: 100%;
  resize: vertical;
}

.chat-online-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chat-online-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .65rem;
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 999px;
  background: #fff;
  font-size: .9rem;
}

.online-dot {
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.permission-table th,
.permission-table td {
  vertical-align: top;
}

.permission-table .center {
  text-align: center;
}

.permission-overrides {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(24, 49, 83, .10);
  border-radius: 14px;
  padding: .65rem;
  background: rgba(255, 255, 255, .62);
}

.permission-override-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: .7rem;
  padding: .55rem .6rem;
  border-bottom: 1px solid rgba(24, 49, 83, .08);
}

.permission-override-row:last-child {
  border-bottom: 0;
}

.permission-override-row small {
  display: block;
  color: var(--muted, #667085);
  font-size: .78rem;
  margin-top: .15rem;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.notification-item {
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 6px 18px rgba(24, 49, 83, .05);
}

.notification-item.is-read {
  opacity: .72;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  color: var(--muted, #667085);
  font-size: .84rem;
}

.notification-item h3 {
  margin: .45rem 0 .25rem;
}

.prebox {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(24, 49, 83, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  padding: 1rem;
  line-height: 1.5;
}


/* K3 v2.43.2-r48 – flexible Aktionsleisten und globales Ladefeedback */
.k3-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.k3-action-row .button,
.k3-action-row button {
  margin: 0;
  white-space: nowrap;
}
.k3-dashboard-action-row {
  max-width: 100%;
}
.customer-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.customer-contact-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 14px;
}
.customer-contact-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.customer-contact-meta {
  display: grid;
  grid-template-columns: 88px minmax(0,1fr);
  gap: 5px 10px;
  font-size: .9rem;
}
.customer-contact-meta div:nth-child(odd) {
  color: var(--muted);
  font-weight: 700;
}
.customer-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.customer-contact-actions form {
  display: inline-flex;
}
.k3-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(2px);
}
.k3-loading-overlay.is-visible {
  display: flex;
}
.k3-loading-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.k3-loading-title {
  font-weight: 800;
  font-size: 1.12rem;
  margin-bottom: 6px;
}
.k3-loading-message {
  color: var(--muted);
  margin-bottom: 6px;
}
.k3-loading-detail {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 14px;
}
.k3-loading-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}
.k3-loading-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-soft), var(--primary));
  transition: width .18s ease;
}
.k3-loading-overlay.is-indeterminate .k3-loading-bar-inner {
  position: absolute;
  left: -45%;
  width: 45%;
  animation: k3-loading-sweep 1.25s ease-in-out infinite;
}
.k3-loading-elapsed {
  margin-top: 8px;
  text-align: right;
  font-size: .86rem;
  font-weight: 700;
  color: var(--muted);
}
@keyframes k3-loading-sweep {
  0% { left: -45%; }
  100% { left: 100%; }
}
button[disabled],
input[type=submit][disabled] {
  opacity: .7;
  cursor: wait;
}
@media (max-width: 420px) {
  .k3-action-row .button,
  .k3-action-row button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .customer-contact-meta {
    grid-template-columns: 1fr;
  }
}

/* v2.43.3-r49 Bautagebuch & Bericht */
.protocol-subpoint-row.is-initial-subpoint {
  border-left: 3px solid rgba(242, 140, 40, 0.45);
}
.protocol-subpoint-row.is-initial-subpoint .readonly-field small {
  display: block;
  margin-top: .2rem;
}
.report-print-footer {
  display: none;
}
@media print {
  @page { size: A4 portrait; margin: 12mm 10mm 18mm 10mm; }
  .report-print-area a[href]::after,
  .meeting-report-print-area a[href]::after {
    content: none !important;
  }
  .report-photo-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .report-photo img {
    object-fit: contain !important;
    background: #fff !important;
  }
  .report-print-footer {
    position: fixed;
    left: 10mm;
    right: 10mm;
    bottom: 5mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: .4pt solid #d8dee8;
    padding-top: 2mm;
    font-size: 8pt;
    color: #44546a;
    background: #fff;
  }
  .report-print-page-number::after {
    content: " " counter(page);
  }
}

/* K3 v2.43.4-r50 – Baubesprechung Startnummer */
.k3-inline-details summary { cursor: pointer; list-style: none; }
.k3-inline-details summary::-webkit-details-marker { display: none; }
.k3-clickable-summary { border-style: dashed; }
.k3-inline-edit-box { margin-top: .5rem; padding: .75rem; border: 1px solid var(--border, #e8d7c8); border-radius: 12px; background: #fffaf5; display: grid; gap: .5rem; }
.k3-meeting-sequence-field input[type="number"] { max-width: 180px; }


/* r52 Baubesprechung Bedienung */
.k3-repeater-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  justify-content: flex-start;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px dashed rgba(120, 94, 70, .25);
}
.k3-protocol-repeater .stack-between-center .actions.wrap {
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .k3-protocol-repeater .stack-between-center .actions.wrap,
  .k3-repeater-bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .k3-protocol-repeater .stack-between-center .actions.wrap .button,
  .k3-repeater-bottom-actions .button {
    width: 100%;
  }
}

/* r53 Akquise */
.acq-kpis .kpi { min-height: 88px; }
.acq-table td { vertical-align: top; }
.acq-row-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.acq-status,
.acq-followup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .28rem .62rem;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.15;
    border: 1px solid rgba(15, 23, 42, .12);
    white-space: nowrap;
}
.acq-status-info { background: #eef5ff; border-color: #bfdbfe; color: #1d4ed8; }
.acq-status-blue { background: #e0f2fe; border-color: #bae6fd; color: #0369a1; }
.acq-status-warning { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.acq-status-purple { background: #f3e8ff; border-color: #e9d5ff; color: #6b21a8; }
.acq-status-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.acq-status-muted { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.acq-status-danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.acq-status-gray { background: #f8fafc; border-color: #cbd5e1; color: #334155; }
.acq-followup { background: #f8fafc; color: #334155; }
.acq-followup-overdue { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.acq-followup-today { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.acq-row-success td { background: rgba(22, 163, 74, .035); }
.acq-row-warning td { background: rgba(245, 158, 11, .045); }
.acq-row-danger td { background: rgba(220, 38, 38, .04); }
.acq-transfer-panel { border-top: 1px solid var(--border-color, #e0d5cc); padding-top: 1rem; }
.acq-dashboard-card .stats-list li { margin-bottom: .45rem; }
@media (max-width: 760px) {
    .acq-table th:nth-child(4), .acq-table td:nth-child(4),
    .acq-table th:nth-child(6), .acq-table td:nth-child(6) { display: none; }
}

/* r54 Akquise Plus */
.acq-stars { display: inline-flex; gap: .06rem; white-space: nowrap; font-size: 1.05rem; letter-spacing: .02em; }
.acq-star { color: #cbd5e1; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.acq-star.is-filled { color: #e68a1a; }
.acq-followup-form { display: flex; flex-wrap: wrap; gap: .28rem; align-items: center; margin: 0 0 .3rem; }
.acq-followup-form input[type="date"] { min-width: 9.8rem; padding: .42rem .5rem; font-size: .9rem; }
.acq-mail-card { border-left: 4px solid #e87522; }
.acq-report { background: #fff; }
.acq-report-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #ead6c4; padding-bottom: 1rem; margin-bottom: 1rem; }
.acq-report-header h1 { margin-bottom: .2rem; }
.acq-report-meta { text-align: right; color: #64748b; }
.acq-report-table th, .acq-report-table td { vertical-align: top; }
@media print {
  .print-hide, .app-sidebar, .topbar, .flash-stack, .breadcrumb, .actions { display: none !important; }
  body { background: #fff !important; }
  .card, .acq-report { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .acq-report-table { font-size: 9pt; }
  .acq-report-table th, .acq-report-table td { border-bottom: 1px solid #ddd; padding: 5px; }
}
@media (max-width: 900px) {
    .acq-table th:nth-child(6), .acq-table td:nth-child(6),
    .acq-table th:nth-child(8), .acq-table td:nth-child(8) { display: none; }
}
@media (max-width: 680px) {
    .acq-table th:nth-child(2), .acq-table td:nth-child(2),
    .acq-table th:nth-child(5), .acq-table td:nth-child(5) { display: none; }
    .acq-report-header { display: block; }
    .acq-report-meta { text-align: left; margin-top: .5rem; }
}

/* r56 Professioneller Akquisebericht */
.acq-report-document {
    width: min(100%, 210mm);
    margin: 1.5rem auto 3rem;
    background: #fff;
    color: #172033;
    border: 1px solid #e5e7eb;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .12);
    padding: 18mm 16mm;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}
.acq-report-doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12mm;
    border-bottom: 2px solid #183153;
    padding-bottom: 7mm;
    margin-bottom: 8mm;
}
.acq-report-brand {
    display: flex;
    align-items: center;
    gap: 8mm;
}
.acq-report-brand img {
    width: 42mm;
    max-height: 22mm;
    object-fit: contain;
}
.acq-report-brand strong {
    display: block;
    color: #183153;
    font-size: 14pt;
    line-height: 1.1;
}
.acq-report-brand span {
    display: block;
    margin-top: 1mm;
    color: #64748b;
    font-size: 9.5pt;
}
.acq-report-doc-meta {
    display: grid;
    grid-template-columns: auto auto;
    gap: 1.5mm 5mm;
    text-align: left;
    font-size: 9pt;
    color: #334155;
}
.acq-report-doc-meta strong {
    color: #183153;
}
.acq-report-title-panel {
    background: linear-gradient(135deg, #183153 0%, #1f4a75 70%, #e87522 100%);
    color: #fff;
    border-radius: 14px;
    padding: 8mm 9mm;
    margin-bottom: 8mm;
}
.acq-report-title-panel h1 {
    margin: 1mm 0 3mm;
    color: #fff;
    font-size: 23pt;
    line-height: 1.08;
}
.acq-report-title-panel p {
    margin: 0;
    max-width: 155mm;
    color: rgba(255,255,255,.92);
}
.acq-report-eyebrow {
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 8.5pt;
    font-weight: 800;
    color: rgba(255,255,255,.78) !important;
}
.acq-report-filter-line {
    margin-top: 5mm;
    padding-top: 4mm;
    border-top: 1px solid rgba(255,255,255,.24);
    font-size: 9.5pt;
}
.acq-report-kpi-panel {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3mm;
    margin: 0 0 8mm;
}
.acq-report-kpi {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fafc;
    padding: 4mm 3.5mm;
    min-height: 24mm;
}
.acq-report-kpi span,
.acq-report-kpi small {
    display: block;
    color: #64748b;
    font-size: 8.5pt;
}
.acq-report-kpi strong {
    display: block;
    margin: 1mm 0;
    color: #183153;
    font-size: 20pt;
    line-height: 1;
}
.acq-report-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5mm;
    margin-bottom: 8mm;
}
.acq-report-box,
.acq-report-section {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    padding: 5mm;
    break-inside: avoid;
    page-break-inside: avoid;
}
.acq-report-box h2,
.acq-report-section h2 {
    margin: 0;
    color: #183153;
    font-size: 13pt;
}
.acq-report-section { margin-bottom: 7mm; }
.acq-report-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6mm;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 3mm;
    margin-bottom: 4mm;
}
.acq-report-section-title span {
    color: #64748b;
    font-size: 8.5pt;
}
.acq-report-mini-table,
.acq-report-priority-table,
.acq-report-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.acq-report-mini-table td,
.acq-report-priority-table th,
.acq-report-priority-table td,
.acq-report-detail-table th,
.acq-report-detail-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 2.4mm 2mm;
    vertical-align: top;
}
.acq-report-priority-table th,
.acq-report-detail-table th {
    color: #183153;
    background: #f8fafc;
    text-align: left;
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.acq-report-detail-table,
.acq-report-priority-table { font-size: 9pt; }
.acq-report-detail-table small,
.acq-report-priority-table small { color: #64748b; }
.acq-report-mini-table .num,
.acq-report-detail-table .num,
.acq-report-priority-table .num { text-align: right; white-space: nowrap; }
.acq-report-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4mm;
}
.acq-report-opportunity {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #e87522;
    border-radius: 10px;
    padding: 4mm;
    background: #fffaf5;
    break-inside: avoid;
    page-break-inside: avoid;
}
.acq-report-opportunity p { margin: 2mm 0 0; font-size: 9pt; color: #334155; }
.acq-report-opportunity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3mm;
    color: #183153;
}
.acq-report-empty {
    grid-column: 1 / -1;
    padding: 6mm;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    text-align: center;
}
.acq-report-doc-footer {
    display: flex;
    justify-content: space-between;
    gap: 8mm;
    border-top: 1px solid #e5e7eb;
    padding-top: 4mm;
    margin-top: 10mm;
    color: #64748b;
    font-size: 8.5pt;
}
.nowrap { white-space: nowrap; }
@media (max-width: 980px) {
    .acq-report-document { padding: 1rem; }
    .acq-report-kpi-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acq-report-two-col, .acq-report-card-grid { grid-template-columns: 1fr; }
    .acq-report-doc-header { display: block; }
    .acq-report-doc-meta { margin-top: 1rem; }
}
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    .print-hide, .app-sidebar, .topbar, .flash-stack, .breadcrumb, .actions { display: none !important; }
    body { background: #fff !important; color: #172033 !important; }
    .app-shell, .main-content, .content-area { display: block !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
    .card:not(.acq-report-document) { box-shadow: none !important; }
    .acq-report-document {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
    .acq-report-title-panel {
        border-radius: 0;
        background: #183153 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .acq-report-kpi,
    .acq-report-box,
    .acq-report-section,
    .acq-report-opportunity,
    .acq-report-priority-table th,
    .acq-report-detail-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .acq-report-kpi-panel { grid-template-columns: repeat(6, 1fr); }
    .acq-report-two-col { grid-template-columns: 1fr 1fr; }
    .acq-report-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .acq-report-section,
    .acq-report-box,
    .acq-report-opportunity,
    .acq-report-priority-table tr,
    .acq-report-detail-table tr { break-inside: avoid; page-break-inside: avoid; }
    .acq-stars { font-size: 9pt; }
    a[href]::after { content: "" !important; }
}

/* r57 Akquise Übersicht: kompakte, mehrzeilige Liste und Rücksprung zur Zeile */
.acq-table-compact {
    table-layout: fixed;
    width: 100%;
    min-width: 980px;
}
.acq-table-compact th,
.acq-table-compact td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.32;
}
.acq-table-compact .acq-col-status { width: 135px; }
.acq-table-compact .acq-col-followup { width: 165px; }
.acq-table-compact .acq-col-company { width: 250px; }
.acq-table-compact .acq-col-project { width: 165px; }
.acq-table-compact .acq-col-contact { width: 185px; }
.acq-table-compact .acq-col-note { width: 220px; }
.acq-table-compact .acq-col-action { width: 110px; }
.acq-table-compact .acq-cell-stack,
.acq-table-compact .acq-company-cell {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    min-width: 0;
}
.acq-table-compact .acq-cell-label {
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.acq-table-compact .acq-category-line,
.acq-table-compact .acq-address-line {
    display: block;
}
.acq-table-compact .acq-followup-form {
    gap: .25rem;
}
.acq-table-compact .acq-followup-form input[type="date"] {
    min-width: 0;
    width: 100%;
    max-width: 9.4rem;
}
.acq-table-compact .acq-row-actions {
    align-items: stretch;
}
.acq-table-compact .acq-row-actions .button {
    width: 100%;
    justify-content: center;
}
.acq-table-compact tr[id] {
    scroll-margin-top: 110px;
}
.acq-table-compact tr[id]:target td {
    animation: k3-acq-row-target 2.2s ease-out 1;
}
@keyframes k3-acq-row-target {
    0% { box-shadow: inset 0 0 0 9999px rgba(232, 117, 34, .18); }
    100% { box-shadow: inset 0 0 0 9999px rgba(232, 117, 34, 0); }
}
@media (max-width: 900px) {
    .acq-table-compact th,
    .acq-table-compact td {
        display: table-cell !important;
    }
    .acq-table-compact {
        min-width: 900px;
    }
}
@media (max-width: 680px) {
    .acq-table-compact th,
    .acq-table-compact td {
        display: table-cell !important;
    }
}


/* r69 – kompakte Projekt-Navigation und Bautagebuch-UX */
.scope-banner-compact .project-header {
  gap: 1rem;
  align-items: flex-start;
}
.scope-banner-primary-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.k3-project-nav {
  margin-top: .75rem;
}
.k3-project-nav-details {
  border: 1px solid rgba(195, 141, 92, .32);
  border-radius: 14px;
  background: rgba(255, 250, 245, .82);
}
.k3-project-nav-details > summary {
  cursor: pointer;
  list-style: none;
  padding: .7rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #30445d;
}
.k3-project-nav-details > summary::-webkit-details-marker { display: none; }
.k3-project-nav-details > summary strong {
  color: #b85d10;
  font-size: .88rem;
}
.k3-project-nav-panel {
  border-top: 1px solid rgba(195, 141, 92, .22);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: .85rem;
  padding: .9rem;
}
.k3-project-nav-group-title {
  font-weight: 800;
  color: #293b52;
  margin-bottom: .35rem;
}
.k3-project-nav-links {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.k3-project-nav-links a {
  display: block;
  padding: .42rem .55rem;
  border-radius: 10px;
  text-decoration: none;
  color: #30445d;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(226, 210, 196, .75);
}
.k3-project-nav-links a:hover,
.k3-project-nav-links a:focus {
  border-color: rgba(232, 118, 33, .55);
  color: #9a4c0b;
  background: #fff;
}
.k3-project-nav-strip {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  padding: .65rem .75rem;
  border: 1px solid rgba(195, 141, 92, .22);
  border-radius: 14px;
  background: rgba(255, 250, 245, .7);
}
.k3-project-nav-strip-head {
  display: flex;
  gap: .45rem;
  align-items: baseline;
  margin-right: .25rem;
}
.k3-project-nav-strip-links,
.k3-project-nav-more-grid {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.k3-project-nav-more {
  position: relative;
}
.k3-project-nav-more > summary {
  cursor: pointer;
  border: 1px solid #e4d1c1;
  background: #fff;
  border-radius: 999px;
  padding: .38rem .75rem;
  font-weight: 700;
  color: #30445d;
  list-style: none;
}
.k3-project-nav-more > summary::-webkit-details-marker { display: none; }
.k3-project-nav-more-grid {
  margin-top: .4rem;
  padding: .5rem;
  border: 1px solid #e4d1c1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 42, 55, .11);
}
.k3-r69-copy-hint {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .scope-banner-primary-actions { justify-content: flex-start; }
  .k3-project-nav-strip { align-items: flex-start; }
  .k3-project-nav-strip-head { width: 100%; }
  .k3-project-nav-panel { grid-template-columns: 1fr; }
}

/* r72 Akquise: Anruf-/Kontaktverlauf */
.acq-contact-history {
    border-top: 1px solid var(--border-color, #e0d5cc);
    padding-top: 1.1rem;
}
.acq-contact-log-new {
    border: 1px solid rgba(24, 49, 83, .12);
    border-radius: 14px;
    background: rgba(248, 250, 252, .72);
    padding: 1rem;
}
.acq-contact-log-new h3,
.acq-contact-timeline-wrap h3 {
    margin-top: 0;
}
.acq-contact-timeline {
    list-style: none;
    padding: 0;
    margin: .75rem 0 0;
    display: grid;
    gap: .75rem;
}
.acq-contact-timeline li {
    position: relative;
    padding-left: 1.25rem;
}
.acq-contact-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .45rem;
    width: .6rem;
    height: .6rem;
    border-radius: 999px;
    background: #e87522;
    box-shadow: 0 0 0 4px rgba(232, 117, 34, .12);
}
.acq-contact-timeline-card {
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    background: #fff;
    padding: .85rem 1rem;
}
.acq-contact-timeline-head .small-note,
.acq-last-action span {
    display: block;
}
.acq-contact-timeline-card p {
    margin: .55rem 0 0;
    white-space: normal;
}
.acq-last-action {
    border: 1px solid rgba(232, 117, 34, .22);
    border-radius: 10px;
    background: rgba(255, 247, 237, .72);
    padding: .48rem .55rem;
    margin-bottom: .45rem;
    font-size: .86rem;
    line-height: 1.28;
}
.acq-last-action.empty {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, .1);
}
.acq-last-action strong {
    display: block;
    color: #183153;
}
.acq-table-compact .acq-col-action { width: 210px; }
@media (max-width: 720px) {
    .acq-contact-timeline-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .acq-contact-timeline-head form,
    .acq-contact-timeline-head button {
        width: 100%;
    }
}

/* r73 Akquise: Word-/Outlook-Anschreiben und Standard-Firmenvorstellungen */
.acq-attachment-options {
    display: grid;
    gap: .45rem;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 12px;
    background: rgba(248, 250, 252, .72);
    padding: .65rem .75rem;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-weight: 700;
    line-height: 1.25;
}
.check-row input[type="checkbox"] {
    margin-top: .16rem;
}
.check-row span {
    overflow-wrap: anywhere;
}
.acq-attachment-options .check-row small {
    display: block;
    color: #64748b;
    font-weight: 500;
    margin-top: .1rem;
}
.acq-mail-card .actions button {
    white-space: normal;
}

/* v2.44.0-r75 – Projektadressbuch: Zuordnung oben, volle Breite und kontaktfreundliche Tabellen */
.project-addressbook-assignment-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}
.project-addressbook-main-full {
  width: 100%;
  margin-top: 18px;
}
.project-addressbook-assignment-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(170px, 0.8fr) minmax(150px, 0.7fr) minmax(105px, 0.45fr) minmax(190px, 0.75fr);
  gap: 12px;
  align-items: end;
}
.project-addressbook-assignment-grid label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.project-addressbook-assignment-select select[multiple] {
  min-height: 138px;
}
.project-addressbook-assignment-actions {
  display: grid;
  gap: 8px;
  align-items: start;
}
.project-addressbook-assignment-actions label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-weight: 600;
}
.project-addressbook-help-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.74);
  padding: 12px 14px;
}
.project-addressbook-help-panel > summary {
  cursor: pointer;
  font-weight: 700;
}
.project-addressbook-table-wrap {
  overflow-x: visible;
}
.project-addressbook-contact-table-compact {
  min-width: 0;
  table-layout: fixed;
}
.project-addressbook-contact-table-compact th:nth-child(1) { width: 24%; }
.project-addressbook-contact-table-compact th:nth-child(2) { width: 14%; }
.project-addressbook-contact-table-compact th:nth-child(3) { width: 15%; }
.project-addressbook-contact-table-compact th:nth-child(4) { width: 15%; }
.project-addressbook-contact-table-compact th:nth-child(5) { width: 11%; }
.project-addressbook-contact-table-compact th:nth-child(6) { width: 13%; }
.project-addressbook-contact-table-compact th:nth-child(7) { width: 8%; }
.project-addressbook-contact-table-compact th:nth-child(8) { width: 5%; }
.project-addressbook-contact-table-compact input[name="role"],
.project-addressbook-contact-table-compact input[name="trade_or_area"],
.project-addressbook-contact-table-compact input[name="display_order"],
.project-addressbook-contact-table-compact select[name="contact_id"],
.project-addressbook-contact-table-compact select[name="contact_ids[]"],
.project-addressbook-contact-table-compact select[name="communication_type"],
.project-addressbook-contact-table-compact select[name="protocol_status"] {
  min-width: 0;
  max-width: 100%;
}
.project-addressbook-contact-table-compact select[multiple] {
  min-height: 98px;
}
.project-addressbook-contact-table-compact input[name="display_order"] {
  width: 100%;
}
.project-addressbook-flags-cell {
  line-height: 1.45;
}
.project-addressbook-flags-cell label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px 4px 0;
  white-space: nowrap;
  font-size: 0.86rem;
}
.project-addressbook-table-actions {
  min-width: 0;
  white-space: normal;
}
.project-addressbook-table-actions form,
.project-addressbook-table-actions a.button {
  display: inline-flex;
  margin: 0 4px 4px 0;
  vertical-align: middle;
}

@media (max-width: 1160px) {
  .project-addressbook-assignment-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 1fr) minmax(150px, 0.8fr);
  }
  .project-addressbook-assignment-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
}

@media (max-width: 920px) {
  .project-addressbook-table-wrap {
    border: 0;
    background: transparent;
  }
  .project-addressbook-contact-table-compact,
  .project-addressbook-contact-table-compact thead,
  .project-addressbook-contact-table-compact tbody,
  .project-addressbook-contact-table-compact tr,
  .project-addressbook-contact-table-compact th,
  .project-addressbook-contact-table-compact td {
    display: block;
    width: 100%;
  }
  .project-addressbook-contact-table-compact thead {
    display: none;
  }
  .project-addressbook-contact-table-compact tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    margin-bottom: 12px;
    overflow: hidden;
  }
  .project-addressbook-contact-table-compact td {
    border-bottom: 1px solid var(--line);
    padding: 9px 10px;
  }
  .project-addressbook-contact-table-compact td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .project-addressbook-contact-table-compact tr td:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .project-addressbook-assignment-grid {
    grid-template-columns: 1fr;
  }
  .project-addressbook-assignment-panel {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* K3 v2.44.04-r77 Baubesprechung Autosave, Ausblenden und schnelleres Speichern */
.form-save-state.is-new{border-color:#f1b3ae;background:#fff4f2;color:#8a1f16}.form-save-state.is-saved{border-color:#b7dfbd;background:#f1fff3;color:#176b2c}.form-save-state.is-error{border-color:#f1b3ae;background:#fff4f2;color:#8a1f16}.form-save-state.is-saving{border-color:#f2d28e;background:#fff9e8;color:#8a5f00}.k3-r76-autosave-top-status{margin:10px 0 14px;display:inline-flex;align-items:center;gap:8px}.k3-cell-report-toggle{min-width:190px}.k3-report-hide-check{display:flex;align-items:center;gap:6px;margin-bottom:8px}.k3-subpoint-vob-letter{display:inline-flex;margin-top:4px}.k3-vob-compose-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.k3-vob-compose-grid .form-field{min-width:0}.protocol-subpoint-row .k3-cell-report-toggle label:first-child{display:block;font-weight:700;margin-bottom:6px}

/* K3 2.45.06-r84: Baubesprechung Kontaktprüfung nicht mehr blockierend, sondern sichtbar markiert */
.k3-row-warning {
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid #f2b84b;
  border-radius: 8px;
  background: #fff8e6;
  color: #7a4a00;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}
.has-contact-warning {
  outline: 2px solid rgba(217, 119, 6, .45);
  outline-offset: 2px;
}
.protocol-mainpoint-row.has-contact-warning {
  border-color: #f2b84b;
}
.protocol-subpoint-row.has-contact-warning {
  background: #fffaf0;
  border-color: #f2b84b;
}
.has-contact-warning select[data-project-contact-select],
.has-contact-warning input[data-project-contact-name-input] {
  border-color: #d97706 !important;
  background: #fffaf0;
}
