/* ============================================
   vOCUS.BM - Immo Living AG
   Styles nach Schweizer Best Practice
   ============================================ */

/* CSS Variables für Theming */
:root {
  /* Light Theme – ruhiger, professioneller, kontrastreicher */
  --bg: #F3F5F8;
  --bg-alt: #E9EEF5;
  --bg-secondary: #EEF2F7;
  --card: #FFFFFF;
  --card-hover: #FBFCFE;
  --border: #D8E0EA;
  --text: #132033;
  --text-muted: #5E6B7A;
  --text-light: #8C97A6;

  /* Surface-Staffelung */
  --surface-1: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EEF3F8;
  --border-soft: rgba(19,32,51,0.06);
  --border-mid: rgba(19,32,51,0.12);

  /* Accent – sachlich statt aggressiv */
  --accent: #A61E2D;
  --accent-hover: #8D1725;
  --accent-light: rgba(166, 30, 45, 0.10);
  --accent-bg: rgba(166, 30, 45, 0.07);

  /* Status Colors */
  --success: #0F8A5F;
  --success-bg: rgba(15, 138, 95, 0.10);
  --warning: #B86A12;
  --warning-bg: rgba(184, 106, 18, 0.10);
  --error: #C43D3D;
  --error-bg: rgba(196, 61, 61, 0.10);
  --info: #2E63D6;
  --info-bg: rgba(46, 99, 214, 0.10);
  --purple: #6E59CF;
  --purple-bg: rgba(110, 89, 207, 0.10);

  /* Typography */
  --fs-xs:   0.71rem;
  --fs-sm:   0.79rem;
  --fs-base: 0.86rem;
  --fs-md:   0.93rem;
  --fs-lg:   1rem;
  --fs-xl:   1.14rem;
  --fs-2xl:  1.29rem;
  --fs-3xl:  1.43rem;
  --fs-4xl:  1.71rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* Layout */
  --sidebar-width: 252px;
  --header-height: 56px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --table-padding-x: 18px;

  /* Kachel-Schriftgrössen */
  --kachel-typ-size:   0.68rem;
  --kachel-title-size: 0.95rem;
  --kachel-meta-size:  0.8rem;
  --kachel-sub-size:   0.72rem;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
}

/* Dark Theme – weniger schwarz, besser lesbar */
[data-theme="dark"] {
  --bg:           #0F141C;
  --bg-alt:       #151C26;
  --bg-secondary: #18212C;
  --card:         #1A2330;
  --card-hover:   #212D3B;
  --border:       #2A3645;
  --text:         #E7EDF5;
  --text-muted:   #A8B3C2;
  --text-light:   #748194;

  --surface-1:    #1A2330;
  --surface-2:    #202B38;
  --surface-3:    #273444;
  --border-soft:  rgba(255,255,255,0.06);
  --border-mid:   rgba(255,255,255,0.12);
}

html {
  font-size: 14px; /* Basis: 1rem = 14px */
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Loading Screen */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 9999;
  gap: 20px;
}

#loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#loading .txt {
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--text-muted);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* App Layout */
.app-layout,
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--card) 0%, var(--surface-2) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
}

.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  box-shadow: 0 10px 18px rgba(166, 30, 45, 0.20);
}

.sidebar-logo-text {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-logo-text span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-light);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-light) 0%, rgba(255,255,255,0) 100%);
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

[data-theme="dark"] .nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.79rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius);
  min-width: 16px;
  text-align: center;
}

/* ── Demo-Badge in Sidebar ─────────────────────────────────── */
.nav-demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-light);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  margin-left: auto;
  flex-shrink: 0;
}

/* Light-Mode */
:root:not([data-theme="dark"]) .nav-demo-badge {
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

/* Dark-Mode: gedämpft grau */
[data-theme="dark"] .nav-demo-badge {
  color: var(--text-muted);
  opacity: 0.65;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Main Content */
.main-content,
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* Header - Kompakt */
.header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 28px 32px;
}

/* Cards - Kompakt */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow);
}

.card.cursor-pointer {
  cursor: pointer;
}

.card.cursor-pointer:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 0.80rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

/* Nur für echte Warnungen / kritische Panels */
.card-title--danger {
  color: var(--error);
  border-left-color: var(--error);
}

.card-title--warning {
  color: var(--warning);
  border-left-color: var(--warning);
}

.card-body {
  padding: 18px 20px;
}

/* KPI Cards - Vertikal Layout mit farbiger Topline */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 3px solid transparent;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: box-shadow 0.2s, transform 0.15s;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 1.71rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--text);
}

.kpi-label {
  font-size: var(--fs-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-trend {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-top: 4px;
}

.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--error); }

/* ── StatCard: einheitlich für alle Module ──────────────────── */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.stat-card__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-card__value {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-card--success .stat-card__value { color: var(--success); }
.stat-card--warning .stat-card__value { color: var(--warning); }
.stat-card--error   .stat-card__value { color: var(--error); }
.stat-card--accent  .stat-card__value { color: var(--accent); }
.stat-card--muted   .stat-card__value { color: var(--text-muted); }

/* Tables - Kompakt */
.table-container {
  overflow-x: auto;
}

.table-container table {
  min-width: 800px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

thead th {
  text-align: left;
  padding: 10px var(--table-padding-x) 10px var(--table-padding-x);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr {
  transition: background 0.12s;
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

tbody tr:hover {
  background: var(--bg);
}

tbody td {
  padding: 13px var(--table-padding-x) 13px var(--table-padding-x);
  font-size: var(--fs-sm);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.td-nowrap {
  white-space: nowrap;
}

/* Badges - Kompakt, eckig */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-default {
  background: var(--border);
  color: var(--text);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.badge-accent {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-muted {
  background: var(--border);
  color: var(--text-muted);
}

/* Badge Grössen */
.badge--sm {
  padding: 1px 5px;
  font-size: 0.7rem;
}

/* Buttons - Kompakt */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
  box-shadow: 0 10px 18px rgba(166, 30, 45, 0.18);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(166, 30, 45, 0.24);
}

.btn-secondary {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-mid);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.86rem;
}

.btn-icon {
  padding: 6px;
  border-radius: var(--radius);
}

/* Inputs - Kompakt */
.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.input-group input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--text);
}

.input-group input::placeholder {
  color: var(--text-light);
}

select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Tabs - Kompakt */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: none;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab {
  padding: 9px 14px;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  font-weight: 800;
  color: var(--accent);
  background: var(--surface-1);
  border-color: rgba(166, 30, 45, 0.22);
  box-shadow: inset 0 0 0 1px rgba(166, 30, 45, 0.05);
}

.tab-count {
  margin-left: 6px;
  font-size: 0.93rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border);
}

.tab.active .tab-count {
  background: var(--accent-light);
  color: var(--accent);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.2s;
}

.modal.wide {
  max-width: 800px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.29rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--success);
  transition: width 0.6s;
}

/* Avatar - weniger rund */
.avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.86rem;
  color: white;
  flex-shrink: 0;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  opacity: 0.8;
}

.form-value {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Inline-Edit: Feldwert klickbar */
.form-value-editable {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px 2px 4px;
  margin: -2px -6px -2px -4px;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-value-editable:hover {
  background: var(--bg-alt, rgba(255,255,255,0.05));
}

.form-value-editable::after {
  content: '✏';
  font-size: 0.64rem;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--text-muted);
}

.form-value-editable:hover::after {
  opacity: 1;
}

/* Projektdaten Label-Value Zeilen (Inline-Edit) */
.form-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.form-row:last-child { border-bottom: none; }

.form-row .form-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  white-space: nowrap;
}

/* Wert im Anzeigemodus */
.form-row-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 4px;
  padding: 3px 6px;
  margin: 0 -6px;
  transition: background 0.12s;
  min-height: 28px;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
}
.form-row-value:hover {
  background: rgba(255,255,255,0.05);
}

/* Stift-Icon rechts – immer reserviert, nur bei hover sichtbar */
.form-row-value .edit-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}
.form-row-value:hover .edit-hint { opacity: 1; }

/* Stift SVG im hint */
.edit-hint svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Input im Bearbeitungsmodus */
.form-row-input {
  width: 100%;
}
.form-row-input .form-input,
.form-row-input select.form-input {
  padding: 4px 8px;
  font-size: var(--fs-base);
}

.form-row .form-value,
.form-row .form-value-editable {
  font-size: var(--fs-base);
  color: var(--text);
  font-weight: 500;
}

.form-row .form-input,
.form-row select.form-input {
  width: 100%;
  padding: 4px 8px;
  margin: 0;
}

.form-row-full {
  grid-column: span 2;
}

.form-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-family: inherit;
  font-size: 0.93rem;
  color: var(--text);
  transition: border-color 0.15s;
}

.form-input:focus,
.form-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Date input calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Empty State → see improved version at bottom of file */

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.86rem; }
.font-semibold { font-weight: 600; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cursor-pointer { cursor: pointer; }
.bg-secondary { background: var(--bg-alt); }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }

  .header {
    padding: 0 16px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Breadcrumbs als Titel - Kompakt */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
}
.breadcrumb-item {
  color: var(--text);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s;
  white-space: nowrap;
}
.breadcrumb-item:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-muted); font-size: 0.9rem; margin: 0 4px; }
.breadcrumb-item.active {
  color: var(--text);
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}

/* Legacy breadcrumb classes (compatibility) */
.breadcrumb-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumb-link:hover { color: var(--accent); }
.breadcrumb-separator {
  color: var(--text-muted);
  margin: 0 8px;
  font-size: 1rem;
  font-weight: 400;
}
.breadcrumb-current {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* Page Header mit Breadcrumbs */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-header-actions {
  display: flex;
  gap: 12px;
}

/* Page Actions (Buttons above content) */
.page-actions {
  margin-bottom: 16px;
}

/* Detail Page Layout */
.detail-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.detail-actions {
  display: flex;
  gap: 12px;
}

/* Detail Card - Kompakt */
.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-card-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-card-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Metrics Grid - Kompakt */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.metric-item {
  text-align: center;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.metric-value {
  font-size: 1.29rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.metric-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: var(--kachel-sub-size);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: var(--kachel-meta-size);
  font-weight: 600;
  color: var(--text);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker,
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-content {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
}

.timeline-date {
  font-size: 0.93rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-meta {
  font-size: 0.93rem;
  color: var(--text-light);
}

.timeline-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-time {
  font-size: 0.93rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Status Indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--error); }
.status-dot.info { background: var(--info); }

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.activity-meta {
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* Quick Stats */
.quick-stats {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.quick-stat {
  flex: 1;
  text-align: center;
}

.quick-stat-value {
  font-size: 1.71rem;
  font-weight: 700;
}

.quick-stat-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Print */
@media print {
  .sidebar, .header {
    display: none;
  }

  .main-content {
    margin: 0;
  }
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  padding: 20px;
}

.login-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.0rem;
  font-weight: bold;
  font-style: italic;
}

.login-logo-text {
  font-size: 2.0rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-logo-v {
  color: var(--accent);
}

.login-logo-bm {
  color: var(--text-muted);
  font-weight: 500;
}

.login-title {
  font-size: 1.71rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

.login-error {
  background: var(--error-bg);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.login-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form .form-group {
  margin-bottom: 0;
}

.login-form .form-input {
  height: 44px;
  font-size: 1.07rem;
}

.login-btn {
  height: 44px;
  font-size: 1.07rem;
  font-weight: 600;
  margin-top: 8px;
}

.login-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.93rem;
  color: var(--text-light);
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════════════════
   ZEITPLAN TIMELINE - Neue saubere Komponente
   ══════════════════════════════════════════════════════════════════════════ */

.zt-root {
  /* Verwendet bestehende CSS-Variablen */
}

/* ── Card ── */
.zt-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.zt-section-label {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Progress Bar ── */
.zt-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.zt-progress-status {
  font-size: 0.93rem;
  color: var(--text-muted);
}

.zt-progress-pct {
  font-family: monospace;
  font-size: 1.57rem;
  font-weight: 600;
  color: var(--accent);
}

.zt-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.zt-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
}

/* ── Timeline ── */
.zt-timeline-scroll {
  overflow-x: auto;
}

.zt-timeline-inner {
  min-width: 600px;
}

.zt-month-row {
  display: flex;
  margin-bottom: 6px;
}

.zt-month-cell {
  flex: 1;
  text-align: center;
  font-family: monospace;
  font-size: 0.86rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.zt-tl-track {
  position: relative;
  height: 140px;
  margin: 0 16px;
  overflow: visible;
}

.zt-tl-line {
  position: absolute;
  top: 29px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}

.zt-tl-done {
  position: absolute;
  top: 29px;
  left: 0;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
}

.zt-today-line {
  position: absolute;
  bottom: 23px;        /* knapp über Monatsachse starten */
  width: 2px;
  height: 72px;        /* reicht von unten bis in den Balken hinein */
  background: linear-gradient(to top, transparent, var(--warning) 30%, var(--warning));
  border-radius: 1px;
  transform: translateX(-50%);
  z-index: 3;
}

/* ── Milestone Pin ── */
.zt-ms-pin {
  position: absolute;
  top: 20px;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 2;
}

.zt-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.79rem;
  font-family: monospace;
  color: var(--text-muted);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.zt-dot-done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.zt-dot-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.zt-dot-late {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.zt-ms-pin:hover .zt-dot {
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(79,142,247,0.2);
  border-color: var(--accent);
}

/* ── Tooltip ── */
.zt-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  white-space: nowrap;
  font-size: 0.86rem;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  min-width: 180px;
}

.zt-tooltip-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.zt-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: monospace;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.zt-tooltip-val {
  color: var(--text);
}

.zt-tooltip-pct {
  color: var(--accent);
  font-weight: 600;
}

/* ── Table ── */
.zt-table {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.zt-table-head {
  display: grid;
  grid-template-columns: 2fr 50px 120px 120px 90px 40px;
  padding: 12px 20px;
  background: var(--bg);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  gap: 8px;
}

.zt-table-row {
  display: grid;
  grid-template-columns: 2fr 50px 120px 120px 90px 40px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.zt-table-row:hover {
  background: rgba(255,255,255,0.02);
}

.zt-row-done {
  opacity: 0.5;
}

.zt-ms-name {
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.zt-ms-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zt-ms-pct {
  font-family: monospace;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: right;
}

.zt-ms-date {
  font-family: monospace;
  font-size: 0.86rem;
  color: var(--text);
}

.zt-ms-date-empty {
  font-family: monospace;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Badges ── */
.zt-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.zt-badge-pending {
  background: rgba(90,98,112,0.2);
  color: var(--text-muted);
}

.zt-badge-active {
  background: rgba(79,142,247,0.15);
  color: var(--accent);
}

.zt-badge-done {
  background: rgba(62,207,142,0.15);
  color: var(--success);
}

.zt-badge-late {
  background: rgba(224,92,92,0.15);
  color: var(--error);
}

/* ── Warning Box ── */
.zt-warn {
  margin-top: 20px;
  border: 1px solid rgba(245,166,35,0.3);
  background: rgba(245,166,35,0.06);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.93rem;
  color: var(--warning);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

/* ============================================
   SCHRIFTGRÖSSE-VARIANTEN
   JS setzt: document.documentElement.style.fontSize = 'Xpx'
   Alle rem-Werte skalieren automatisch – keine px-Overrides nötig.
   ============================================ */

body.font-klein      { /* html = 12px via JS */ }
body.font-mittel     { /* html = 14px – Standard */ }
body.font-gross      { /* html = 16px via JS */ }
body.font-extragross { /* html = 18px via JS */ }

/* Zahlen-Pfeile (Spinners) global entfernen */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ── List-Header (Icon + Titel + Toolbar auf einer Zeile) ── */
.list-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.list-header__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 220px;
  padding-right: 16px;
  margin-right: 4px;
}
.list-header__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Alle Elemente in list-header gleich hoch (34px) */
.list-header .input-group {
  padding: 6px 12px;
  height: 34px;
  border-radius: 6px;
  max-width: 220px;
}
.list-header .input-group input {
  font-size: var(--fs-sm);
}
.list-header select {
  padding: 0 10px;
  height: 34px;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.list-header .spacer {
  flex: 1;
}
.list-header .btn {
  height: 34px;
  padding: 0 12px;
  font-size: var(--fs-sm);
  border-radius: 6px;
  white-space: nowrap;
}
.list-header .reset-btn {
  padding: 0 8px;
  height: 34px;
  font-size: var(--fs-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.list-header .reset-btn:hover {
  color: var(--text);
}

/* ── List-Toolbar (einheitlich für alle Listen) ──────────── */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.list-toolbar .spacer {
  flex: 1;
}
.list-toolbar select {
  padding: 0 10px;
  height: 34px;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.list-toolbar select.muted {
  color: var(--text-muted);
}
.list-toolbar .reset-btn {
  padding: 0 8px;
  height: 34px;
  font-size: var(--fs-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.list-toolbar .reset-btn:hover {
  color: var(--text);
}
.list-toolbar .divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}
.list-toolbar .input-group {
  height: 34px;
  padding: 0 10px;
  border-radius: 3px;
  gap: 6px;
  max-width: 220px;
}
.list-toolbar .input-group input {
  font-size: var(--fs-sm);
}

/* ── Sub-Header Titelzeile ───────────────────────────────── */
.page-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 0 20px;
  gap: 12px;
  flex-shrink: 0;
}
.page-titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.page-titlebar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.page-titlebar .page-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.projekt-card-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   OBJEKT-KARTE – Universelles System für alle Kachelansichten
   Gilt für: Projekte (.pk), Mandate (.mk), Liegenschaften (.lk),
             Kontakte (.kk)
   ============================================================ */

/* Gemeinsame Basis */
.ok {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.ok__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px 12px;
}

.ok__identity { min-width: 0; flex: 1; }

.ok__title {
  margin: 0 0 3px;
  font-size: var(--kachel-title-size, 0.95rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ok__subtitle {
  font-size: var(--kachel-sub-size, 0.72rem);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ok__tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.ok__type {
  font-size: var(--kachel-typ-size, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
}

.ok__status {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.ok__status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ok__status-label {
  font-size: var(--kachel-sub-size, 0.72rem);
  color: var(--text-muted);
}

.ok__meta-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Divider zwischen Sections */
.ok__divider {
  height: 1px;
  background: var(--border);
  margin: 0 18px;
}

/* Meta-Grid 2×2 */
.ok__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 18px;
}

.ok__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  min-width: 0;
}

.ok__meta-item:nth-child(odd)  { padding-right: 16px; border-right: 1px solid var(--border); }
.ok__meta-item:nth-child(even) { padding-left: 16px; }
.ok__meta-item:not(:nth-last-child(-n+2)) { border-bottom: 1px solid var(--border); }

.ok__meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ok__meta-value {
  font-size: var(--kachel-meta-size, 0.8rem);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ok__meta-value--accent   { color: var(--accent); }
.ok__meta-value--success  { color: var(--success); }
.ok__meta-value--warning  { color: var(--warning); }
.ok__meta-value--muted    { color: var(--text-muted); font-weight: 400; }
.ok__meta-value--truncate { max-width: 180px; }

/* Footer */
.ok__footer {
  padding: 12px 18px 14px;
}

/* Progress */
.ok__progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ok__progress-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ok__progress-value {
  font-size: var(--kachel-sub-size, 0.72rem);
  font-weight: 700;
  color: var(--text);
}

.ok__progress-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.ok__progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 0.3s ease;
}

.ok__progress-fill--warn { background: var(--warning); }
.ok__progress-fill--done { background: var(--success); }

/* Issue-Chips */
.ok__issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ok__issue-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

/* Kontakt-Avatar-Header */
.ok__avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}

.ok__avatar-info { min-width: 0; flex: 1; }

.ok__avatar-actions {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
}

.ok__action-link {
  font-size: var(--kachel-sub-size, 0.72rem);
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: all 0.12s;
}

.ok__action-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ============================================================
   PROJEKT COCKPIT V2
   ============================================================ */

/* Hauptgitter: Links 1.35fr / Rechts 0.95fr */
.pd-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

/* Stack in jeder Spalte */
.pd-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 2×2 Info-Gruppen-Grid (innerhalb linker Card) */
.pd-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Einzelne Info-Gruppe (Mini-Card) */
.pd-group {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pd-group__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Info-Row innerhalb einer Gruppe */
.pd-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.pd-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pd-row:first-of-type {
  padding-top: 0;
}

.pd-row__label {
  font-size: var(--fs-base);
  color: var(--text-muted);
  line-height: 1.4;
}

.pd-row__value {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-row__value--success { color: var(--success); }
.pd-row__value--warning { color: var(--warning); }
.pd-row__value--error   { color: var(--error); }
.pd-row__value--muted   { color: var(--text-muted); font-weight: 400; }

/* Klickbarer Row (InlineField in View-Modus) */
.pd-row--editable {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
}

.pd-row--editable:hover {
  background: var(--bg-alt);
}

.pd-row--editable:hover .pd-row__value {
  color: var(--accent);
}

/* Rechte Spalte: Section-Label */
.pd-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Offene Punkte */
.pd-issue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd-issue {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg);
}

.pd-issue--critical { border-left-color: var(--error); }
.pd-issue--warning  { border-left-color: var(--warning); }
.pd-issue--info     { border-left-color: var(--info); }

.pd-issue__title {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.pd-issue__text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Nächste Schritte Chips */
.pd-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pd-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.pd-step::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.5;
}

/* Dokument-Stat */
.pd-dok-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
}

.pd-dok-stat__value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.pd-dok-stat__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Card-Titel neutraler (kein Rot für normale Sections) */
.card-title--neutral {
  color: var(--text-muted);
  border-left-color: var(--border);
}

/* ── Detail-Cockpit: 2-Spalten-Layout für alle Moduldetails ─── */
.cockpit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.cockpit-left,
.cockpit-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cockpit-group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ── InfoGroup Mini-Card ─────────────────────────────────────── */
.info-group {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.info-group__title {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.info-group__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-soft);
}

.info-group__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-group__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.info-group__value {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  padding: 2px 6px;
}

.info-group__value--success { color: var(--success); }
.info-group__value--warning { color: var(--warning); }
.info-group__value--error   { color: var(--error);   }
.info-group__value--muted   { color: var(--text-muted); }
.info-group__value--accent  { color: var(--accent);  }

/* ── InlineEdit ─────────────────────────────────────────────── */
/* Kein doppeltes Padding wenn InlineEdit in info-group__value */
.info-group__value .inline-edit-value {
  margin: -2px -6px;
}

.inline-edit-value:hover {
  background: var(--surface-2, rgba(0,0,0,0.04));
}
.inline-edit-value:hover .inline-edit-pencil {
  opacity: 1 !important;
}

/* ── Zeitstrahl: Phase-Bänder ───────────────────────────────── */
.zt-phase-bands {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zt-phase-band {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0.06;
  border-right: 1px solid var(--border);
}

.zt-phase-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  opacity: 0.4;
}

/* ── Zeitstrahl: Monatsachse ────────────────────────────────── */
.zt-month-axis {
  position: relative;
  height: 20px;
  border-bottom: 1px solid var(--border);
}

.zt-month-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

.zt-month-tick-line {
  width: 1px;
  height: 8px;
  background: var(--border);
  margin-right: 4px;
}

.zt-month-tick-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── data-table: ruhiger, luftiger, fluider ───────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: calc(var(--fs-base) + 2px);
}

.data-table th {
  text-align: left;
  padding: 6px 24px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: hidden;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Datumszellen: genug Luft + nicht abschneiden */
.data-table td.td-date {
  overflow: visible;
  white-space: nowrap;
  padding: 8px 12px;
}

/* Checkbox-Spalte linksbündig mit Status */
.data-table td.td-check,
.data-table th.th-check {
  text-align: left;
  padding-left: 18px;
  padding-right: 10px;
}

.data-table td.td-check .milestone-checkbox {
  margin: 0;
}

/* Prozent rechtsbündig mit etwas Luft */
.data-table td.td-percent,
.data-table th.th-percent {
  text-align: right;
  padding-right: 18px;
  white-space: nowrap;
}

/* Statusspalte etwas kompakter, aber nicht gequetscht */
.data-table td.td-status,
.data-table th.th-status {
  white-space: nowrap;
  padding-right: 16px;
}

/* Aktionsspalte nie ganz am Rand kleben lassen */
.data-table td.td-actions,
.data-table th.th-actions {
  padding-right: 20px;
  white-space: nowrap;
}

/* Wichtig: Meilenstein-Zelle soll den Restplatz sauber nutzen */
.data-table td.td-milestone,
.data-table th.th-milestone {
  width: auto;
  min-width: 0;
}

/* Anzeige-Text im Meilenstein schöner */
.milestone-label {
  display: block;
  min-width: 0;
  line-height: 1.35;
  padding-right: 8px;
  white-space: normal;
  word-break: break-word;
}

/* Edit-Layout in der Meilenstein-Spalte */
.milestone-edit-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.milestone-edit-wrap .milestone-text-input {
  flex: 1 1 auto;
  min-width: 0;
}

.milestone-edit-wrap .milestone-phase-select {
  flex: 0 0 220px;
}

/* Checkbox linksbündig mit Status-Spalte */
.milestone-checkbox {
  display: inline-block;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ── hover-row: klickbare Zeilen ────────────────────────────── */
.hover-row {
  border-radius: var(--radius);
  transition: background 0.15s;
}

.hover-row:hover {
  background: var(--bg-alt);
}

/* ── Quick Action Buttons ── */
.qa-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  cursor: grab;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  min-height: 84px;
  box-shadow: var(--shadow-sm);
}

.qa-btn:hover {
  background: var(--card-hover);
  border-color: var(--border-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Icon-Container */
.qa-btn svg {
  flex-shrink: 0;
  color: var(--accent);
  width: 18px;
  height: 18px;
  opacity: 1;
}

.qa-btn__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.qa-btn__label {
  font-size: 0.90rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.qa-btn__sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  opacity: 0.95;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* Primary-Button — gleich wie alle anderen, kein Sonderstil */
.qa-btn--primary {
}

/* Drag & Drop States */
.qa-btn--dragging {
  opacity: 0.35;
  transform: scale(0.97);
  cursor: grabbing;
  box-shadow: none;
}

.qa-btn--over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

.qa-btn:active {
  cursor: grabbing;
  transform: scale(0.98);
}

/* ── KPI-Zeile ── */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.db-kpi-tile {
  cursor: grab;
  transition: opacity 0.15s, transform 0.1s;
}

/* ── Gantt (volle Breite) ── */
.db-gantt-row {
  margin-bottom: 16px;
}

/* ── 2-Spalten-Bereich ── */
.db-cols {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.db-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.db-col--over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Drop-Platzhalter am Spaltenende */
.db-col-placeholder {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.db-col-placeholder--active {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(79, 142, 247, 0.06);
  color: var(--accent);
}

.db-tile {
  position: relative;
  cursor: grab;
  transition: opacity 0.15s, transform 0.1s;
}

.db-tile:active {
  cursor: grabbing;
}

.db-tile--dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.db-tile--over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ── Dashboard Widget Drag & Drop (Legacy) ── */
.db-widget {
  position: relative;
  transition: opacity 0.15s;
}

.db-widget__handle {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0;
  cursor: grab;
  transition: opacity 0.15s, background 0.15s;
  pointer-events: all;
}

.db-widget:hover .db-widget__handle {
  opacity: 1;
}

.db-widget__handle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.db-widget--dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.db-widget--over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ── KPI Card Drag & Drop ── */
.kpi-card-wrapper {
  cursor: grab;
  transition: opacity 0.15s, transform 0.15s;
  min-width: 0; /* fluid innerhalb grid */
}

.kpi-card-wrapper .kpi-card {
  height: 100%;
  margin: 0;
}

.kpi-card-wrapper:active {
  cursor: grabbing;
}

.kpi-card--dragging {
  opacity: 0.4;
  transform: scale(0.95);
  cursor: grabbing;
}

.kpi-card--dragging .kpi-card {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.kpi-card--over {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── KPI Compact (bottom zone) ── */
.kpi-card--compact {
  padding: 8px 12px;
}

.kpi-value--compact {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ── KPI Zonen ── */
.kpi-zone {
  transition: background 0.15s;
}

.kpi-zone--empty {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.kpi-zone--bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.kpi-zone--bottom:empty {
  display: none;
}

.kpi-zone--active {
  border-color: var(--accent);
  background: rgba(79,142,247,0.05);
}

/* Drop Placeholder */
.kpi-drop-placeholder {
  border: 2px dashed var(--accent);
  border-radius: 8px;
  background: rgba(79,142,247,0.06);
  min-height: 80px;
  animation: kpi-pulse 1s infinite;
}

.kpi-drop-placeholder--compact {
  min-height: 50px;
}

@keyframes kpi-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ── Projekt-Auswahl Popup ── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.projekt-popup {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.projekt-popup__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.projekt-popup__title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
}

.projekt-popup__sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.projekt-popup__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.projekt-popup__close:hover {
  color: var(--text);
}

.projekt-popup__search-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.projekt-popup__search {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  outline: none;
}

.projekt-popup__search:focus {
  border-color: var(--accent);
}

.projekt-popup__list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}

.projekt-popup__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  font-size: var(--fs-sm);
}

.projekt-popup__item:hover {
  background: var(--bg-secondary);
}

.projekt-popup__item-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projekt-popup__item-phase {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.projekt-popup__empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ── Projekt Übersicht Tab ── */
.proj-overview-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}


/* ── Redesign Ergänzungen 2026 ─────────────────────────────── */
.header {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
}
[data-theme="dark"] .header {
  background: rgba(15,20,28,0.72);
}

.kpi-card {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.kpi-icon {
  border-radius: 12px;
}
.table-container,
.detail-card,
.info-group,
.user-card {
  box-shadow: var(--shadow-sm);
}
.user-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
}
thead th {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody td {
  font-size: var(--fs-base);
}
tbody tr:hover {
  background: var(--surface-2);
}
.badge,
.nav-item-badge,
.nav-demo-badge {
  letter-spacing: 0.04em;
}
.db-col-placeholder {
  border-radius: 14px;
  background: rgba(255,255,255,0.35);
}
[data-theme="dark"] .db-col-placeholder {
  background: rgba(255,255,255,0.02);
}
@media (max-width: 1280px) {
  .db-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-cols {
    flex-direction: column;
  }
}
@media (max-width: 900px) {
  .content {
    padding: 18px 16px 24px;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ══════════════════════════════════════════════════════════════
   Ausbaustufe 2 — UX/Flow Patterns
   ══════════════════════════════════════════════════════════════ */

/* ── Context-Summary-Bar ─────────────────────────────────────── */
.context-summary {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.context-summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.context-summary-label {
  color: var(--text-muted);
}
.context-summary-value {
  color: var(--text);
  font-weight: 500;
}
.context-summary-value--link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.context-summary-value--link:hover {
  color: var(--accent-hover);
}
.context-summary-divider {
  color: var(--border);
  user-select: none;
}

/* ── Related-Items Section ───────────────────────────────────── */
.related-section {
  margin-top: var(--space-5);
}
.related-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.related-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: var(--space-3);
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.related-card {
  padding: var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.related-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.related-card__title {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--text);
  margin-bottom: 4px;
}
.related-card__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.related-card__meta {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ── Quick-Entry-Bar (Zeiterfassung) ─────────────────────────── */
.quick-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: end;
  margin-bottom: var(--space-4);
}
.quick-entry .form-group {
  flex: 1;
  margin: 0;
}
.quick-entry .form-group--narrow {
  flex: 0 0 100px;
}
.quick-entry .form-group--wide {
  flex: 2;
}
.quick-entry input,
.quick-entry select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  background: var(--bg);
  color: var(--text);
}
.quick-entry input:focus,
.quick-entry select:focus {
  outline: none;
  border-color: var(--accent);
}
.quick-entry .btn {
  flex-shrink: 0;
}

/* ── Empty State (verbessert) ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-3);
  background: var(--surface-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.empty-state-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.empty-state-text {
  font-size: var(--fs-base);
  margin-bottom: var(--space-4);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state .btn {
  margin-top: var(--space-2);
}

/* ── Clickable Table Row (Hover-Effekt) ──────────────────────── */
tbody tr.clickable-row {
  cursor: pointer;
}
tbody tr.clickable-row:hover {
  background: var(--accent-light);
}

/* ── Compact KPI Row (für dezentere Statistiken) ─────────────── */
.kpi-row-compact {
  display: flex;
  gap: var(--space-4);
  padding: 0;
  margin-bottom: 0;
}
.kpi-row-compact .kpi-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.kpi-row-compact .kpi-item__value {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
}
.kpi-row-compact .kpi-item__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ── Status-Filter-Tabs (inline in Toolbar) ──────────────────── */
.filter-tabs-inline {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.filter-tabs-inline button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: all 0.15s;
}
.filter-tabs-inline button:hover {
  color: var(--text);
}
.filter-tabs-inline button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Back Button (shared across all detail views) ──────────── */
.back-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.93rem;
  font-weight: 700;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.16s;
  white-space: nowrap;
}
.back-btn:hover {
  color: var(--text);
}

/* ── Detail Toolbar (shared layout for detail view headers) ── */
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Wochenleiste (Zeiterfassung) ────────────────────────────── */
.week-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.week-bar__day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}
.week-bar__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
}
.week-bar__bar-track {
  width: 100%;
  height: 48px;
  background: var(--surface-2);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.week-bar__bar-fill {
  width: 100%;
  background: var(--accent-light);
  border-radius: 4px;
  min-height: 2px;
  transition: height 0.3s;
}
.week-bar__day--today .week-bar__bar-fill {
  background: var(--accent);
}
.week-bar__day--today .week-bar__label {
  color: var(--accent);
  font-weight: 600;
}
.week-bar__hours {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}
.week-bar__day--today .week-bar__hours {
  color: var(--accent);
}

/* ── Kompakte Filter-Tabs (für Toolbars) ─────────────────── */
.tabs--compact {
  gap: 4px;
  margin-bottom: 0;
}
.tabs--compact .tab {
  padding: 5px 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 6px;
  height: 34px;
  display: flex;
  align-items: center;
}
.tabs--compact .tab-count {
  font-size: var(--fs-xs);
  padding: 1px 6px;
  margin-left: 4px;
}

/* ── Toolbar SearchInput kompakt ─────────────────────────── */
.list-toolbar .input-group {
  padding: 6px 12px;
  height: 34px;
  border-radius: 6px;
}
.list-toolbar .input-group input {
  font-size: var(--fs-sm);
}

/* ══ Cockpit Widget-Klassen (Phase 2) ══════════════════════════ */

/* Budget Hero */
.ck-budget-hero { text-align: center; padding: 8px 0 12px; }
.ck-budget-hero__value { font-size: var(--fs-2xl); font-weight: 800; color: var(--text); }
.ck-budget-hero__label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Budget Bar */
.ck-budget-bar { margin-bottom: 12px; }
.ck-budget-bar__labels { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 4px; }

/* Budget Grid */
.ck-budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ck-budget-cell { padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius); }
.ck-budget-cell__label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 2px; }
.ck-budget-cell__value { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.ck-budget-cell__value--warning { color: var(--warning); }
.ck-budget-cell__value--error { color: var(--error); }
.ck-budget-cell__value--success { color: var(--success); }

/* Meilensteine */
.ck-ms-progress-label { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.ck-ms-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ck-ms-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius); font-size: var(--fs-sm); border-left: 3px solid var(--border); }
.ck-ms-item--overdue { border-left-color: var(--error); }
.ck-ms-item__name { font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-ms-item--overdue .ck-ms-item__name { color: var(--error); }
.ck-ms-item__date { font-size: var(--fs-xs); color: var(--text-muted); margin-left: 12px; white-space: nowrap; }
.ck-ms-item--overdue .ck-ms-item__date { color: var(--error); }

/* Team / Beteiligte */
.ck-team { display: flex; flex-direction: column; gap: 12px; }
.ck-team-member { display: flex; align-items: center; gap: 12px; }
.ck-team-member__info { min-width: 0; }
.ck-team-member__name { font-weight: 600; font-size: var(--fs-sm); }
.ck-team-member__role { font-size: var(--fs-xs); color: var(--text-muted); }

/* Standort */
.ck-standort-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ck-standort-cell__label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 2px; }
.ck-standort-cell__value { font-size: var(--fs-sm); font-weight: 600; }

/* Beschreibung */
.ck-beschreibung { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }

/* Tone-Helpers */
.ck-tone-success { color: var(--success); font-weight: 600; }
.ck-tone-warning { color: var(--warning); font-weight: 600; }
.ck-tone-error { color: var(--error); font-weight: 600; }
.ck-tone-muted { color: var(--text-muted); }

/* Empty Hint */
.ck-empty-hint { font-size: var(--fs-sm); color: var(--text-muted); padding: 12px 0; text-align: center; }

/* ══ Cockpit Widget-Klassen (Phase 3) ══════════════════════════ */

/* Datenqualität */
.ck-dq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ck-dq-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius); font-size: var(--fs-sm); }
.ck-dq-item__icon { width: 16px; height: 16px; flex-shrink: 0; }
.ck-dq-item__icon--ok { color: var(--success); }
.ck-dq-item__icon--missing { color: var(--text-muted); opacity: 0.5; }
.ck-dq-item__label { color: var(--text); }
.ck-dq-item--missing .ck-dq-item__label { color: var(--text-muted); }
.ck-dq-summary { display: flex; justify-content: center; align-items: baseline; gap: 6px; padding: 10px 0 4px; }
.ck-dq-summary__value { font-size: var(--fs-xl); font-weight: 800; }
.ck-dq-summary__value--good { color: var(--success); }
.ck-dq-summary__value--warn { color: var(--warning); }
.ck-dq-summary__value--bad { color: var(--error); }
.ck-dq-summary__label { font-size: var(--fs-sm); color: var(--text-muted); }

/* Dokumente */
.ck-doc-list { display: flex; flex-direction: column; gap: 6px; }
.ck-doc-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius); font-size: var(--fs-sm); cursor: pointer; transition: background 0.15s; }
.ck-doc-item:hover { background: var(--surface-3); }
.ck-doc-item__icon { color: var(--text-muted); flex-shrink: 0; }
.ck-doc-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-doc-item__date { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.ck-doc-more { font-size: var(--fs-sm); color: var(--accent); cursor: pointer; margin-top: 4px; padding-left: 2px; }
.ck-doc-more:hover { text-decoration: underline; }
.ck-doc-empty { text-align: center; padding: 16px 0; }
.ck-doc-empty__text { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 12px; }
