:root {
  /* Backgrounds – elevated dark-blue palette (heller als zuvor) */
  --bg: #1a1c2e;
  --surface: #22263a;
  --surface2: #2a2f49;
  --border: #363c5e;
  --border2: #444b6e;

  /* Text – stärkere Kontrast-Hierarchie */
  --text: #e8ecff;
  --text2: #9aa4c8;
  --text3: #6270a0;

  /* Accent */
  --accent: #7aa9ff;
  --accent2: #4070dd;

  /* Status-Farben – lebendiger und zugänglicher */
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --grey: #6270a0;
  --orange: #fb923c;

  /* Spacing-Scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Typografie-Scale */
  --text-xs:   10px;
  --text-sm:   11px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   18px;

  /* Border-Radius-Scale */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Focus-Ring für Keyboard-Navigation (Basis-A11y) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Interaktive Elemente ohne sichtbaren Fokus-Ring bei Mausnutzung */
:focus:not(:focus-visible) { outline: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  padding: 24px 32px 16px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-email {
  font-size: 0.78rem;
  color: var(--text2);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-link {
  font-size: 0.78rem;
  color: var(--accent, #3b82f6);
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid var(--accent, #3b82f6);
  border-radius: 4px;
}
.header-link:hover { background: rgba(59,130,246,.12); }

.header-btn {
  font-family: inherit;
  font-size: 0.78rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.header-btn:hover { border-color: var(--accent, #3b82f6); color: var(--accent, #3b82f6); }

header h1 {
  font-family: var(--mono);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kw-badge {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--accent);
  background: rgba(122,169,255,0.1);
  border: 1px solid rgba(122,169,255,0.2);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
}

.kw-badge:hover { background: rgba(122,169,255,0.18); }

.save-indicator {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  opacity: 0;
  transition: opacity 0.3s;
}

.save-indicator.show { opacity: 1; }

main {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Section headers ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-label {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text2);
}

.section-count {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--accent);
  background: rgba(122,169,255,0.1);
  border: 1px solid rgba(122,169,255,0.18);
  border-radius: var(--radius-lg);
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
  margin-left: -4px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.add-btn,
.copy-btn {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text2);
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.add-btn:hover,
.copy-btn:hover {
  color: var(--accent);
  border-color: rgba(122,169,255,0.4);
  background: rgba(122,169,255,0.07);
}

.copy-btn:disabled {
  color: var(--green);
  border-color: rgba(74,222,128,0.4);
  background: rgba(74,222,128,0.07);
  cursor: default;
}

/* ── Teams grid ──────────────────────────────────────────── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.teams-grid.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.team-card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.team-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s;
}

.status-dot:hover { transform: scale(1.4); }
.status-green { background: var(--green); box-shadow: 0 0 6px rgba(74,222,128,0.4); }
.status-yellow { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.status-red { background: var(--red); box-shadow: 0 0 6px rgba(248,113,113,0.4); }
.status-grey { background: var(--grey); }

.team-name {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text);
  outline: none;
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--sans);
}

.team-name:focus { color: var(--accent); }

.field-row {
  margin-top: 8px;
}

.field-label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.field-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--text-base);
  outline: none;
  resize: none;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.45;
}

.field-input:focus {
  border-color: rgba(122,169,255,0.3);
  color: var(--text);
}

.field-input::placeholder { color: var(--text3); }

.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  align-items: center;
  gap: 4px;
}

.team-card:hover .card-actions { display: flex; }

.card-actions-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.icon-btn:hover { color: var(--red); background: rgba(248,113,113,0.1); }
.icon-btn.cycle:hover { color: var(--accent); background: rgba(122,169,255,0.1); }
.icon-btn.team-detail-btn:hover { color: var(--accent); background: rgba(122,169,255,0.1); }

/* ── Filter bar ──────────────────────────────────────────── */
#ini-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

#ini-filters input {
  width: 150px;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color 0.15s, color 0.15s;
}

#ini-filters input:focus {
  border-color: rgba(122,169,255,0.35);
  color: var(--text);
}

#ini-filters input::placeholder { color: var(--text3); }

.filter-select-wrap {
  position: relative;
}

.filter-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--text3);
  pointer-events: none;
}

#ini-filters select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 24px 4px 8px;
  font-family: var(--mono);
  font-size: var(--text-sm);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

#ini-filters select:focus {
  border-color: rgba(122,169,255,0.35);
  color: var(--text);
}

#ini-filters select option { background: var(--surface2); color: var(--text); }

#filter-reset {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: var(--text-sm);
  padding: 4px 8px;
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
  transition: all 0.15s;
  margin-left: 2px;
}

#filter-reset.active {
  opacity: 1;
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
  pointer-events: auto;
  cursor: pointer;
}

#filter-reset.active:hover {
  background: rgba(248,113,113,0.08);
}

#toggle-teams {
  background: none;
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 5px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: var(--text-sm);
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.2s ease;
}

#toggle-teams:hover {
  border-color: var(--accent);
  color: var(--text);
}

#toggle-teams.collapsed {
  transform: rotate(-90deg);
}

#toggle-fertig {
  background: none;
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 5px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: var(--text-sm);
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 2px;
}

#toggle-fertig:hover {
  border-color: var(--accent);
  color: var(--text);
}

#toggle-fertig.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56,189,248,0.06);
}

/* ── Initiatives table ──────────────────────────────────── */
.ini-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ini-table th {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 6px 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.ini-table th.sortable {
  cursor: pointer;
}

.ini-table th.sortable:hover { color: var(--text2); }

.ini-table th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
.ini-table th.sort-desc::after { content: ' ↓'; color: var(--accent); }

/* ── Überfällige Meilensteine ───────────────────────────── */
.overdue-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.overdue-table th {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 6px 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.overdue-row td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  vertical-align: middle;
}

.overdue-row:last-child td {
  border-bottom: none;
}

.overdue-frist {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--danger, #f87171);
  font-weight: 500;
}

.overdue-ini-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: var(--text-sm);
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.overdue-ini-btn:hover {
  color: var(--text1);
}

/* ── Initiatives pagination ─────────────────────────────── */
.ini-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 4px;
  min-height: 36px;
}

.pagination-info {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  letter-spacing: 0.04em;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pagination-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-size: var(--text-base);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text1);
}

.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-dots {
  font-size: var(--text-base);
  color: var(--text3);
  padding: 0 3px;
  user-select: none;
}

.ini-row { transition: background 0.1s; }
.ini-row:hover { background: var(--surface); }

.ini-row td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ini-row td:last-child { width: 32px; }

.ini-cell {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--text-base);
  outline: none;
  transition: color 0.15s;
}

.ini-cell:focus { color: var(--text); }
.ini-cell::placeholder { color: var(--text3); }

input[type="date"].ini-frist-date {
  color-scheme: dark;
  cursor: pointer;
}
input[type="date"].ini-frist-date::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

.ini-name {
  font-weight: 500;
  color: var(--text);
  resize: none;
  field-sizing: content;
  overflow: hidden;
}
.ini-name:focus { color: var(--accent); }
.ini-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
}

.ini-name-wrap .ini-name {
  flex: 1;
  min-width: 0;
}

.ini-name-detail-btn {
  flex-shrink: 0;
  opacity: 0.7;
}


.ini-select {
  display: block;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ini-select:focus { color: var(--text); }

.ini-select option {
  background: var(--surface2);
  color: var(--text);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: var(--text-xs);
  pointer-events: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-family: var(--mono);
  white-space: nowrap;
  border: 1px solid transparent;
  margin: 0;
}

.pill-green { background: rgba(74,222,128,0.1); color: var(--green); border-color: rgba(74,222,128,0.2); }
.pill-yellow { background: rgba(251,191,36,0.1); color: var(--yellow); border-color: rgba(251,191,36,0.2); }
.pill-red { background: rgba(248,113,113,0.1); color: var(--red); border-color: rgba(248,113,113,0.2); }
.pill-grey { background: rgba(98,112,160,0.15); color: var(--text3); border-color: rgba(98,112,160,0.2); }

.pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-select-wrap {
  position: relative;
  padding: 6px 12px;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--text-sm);
  padding: 3px 22px 3px 9px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.status-select.s-fertig { background: rgba(74,222,128,0.1); color: var(--green); border-color: rgba(74,222,128,0.2); }
.status-select.s-yellow { background: rgba(251,191,36,0.1); color: var(--yellow); border-color: rgba(251,191,36,0.2); }
.status-select.s-grey { background: rgba(98,112,160,0.15); color: var(--text3); border-color: rgba(98,112,160,0.2); }
.status-select.s-ungeplant { background: rgba(248,113,113,0.1); color: var(--red); border-color: rgba(248,113,113,0.2); }

.status-select.ps-ok { background: rgba(74,222,128,0.08); color: var(--green); border-color: rgba(74,222,128,0.2); }
.status-select.ps-kritisch { background: rgba(248,113,113,0.12); color: var(--red); border-color: rgba(248,113,113,0.3); font-weight: 500; }

.status-select option { background: var(--surface2); color: var(--text); }

.status-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  pointer-events: none;
}

.status-select-wrap.s-fertig::after,
.status-select-wrap.ps-ok::after { color: var(--green); }
.status-select-wrap.s-yellow::after { color: var(--yellow); }
.status-select-wrap.s-grey::after { color: var(--text3); }
.status-select-wrap.s-red::after,
.status-select-wrap.s-ungeplant::after,
.status-select-wrap.ps-kritisch::after { color: var(--red); }

.team-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--text-xs);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(122,169,255,0.08);
  color: var(--accent);
  border: 1px solid rgba(122,169,255,0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ini-notiz,
.ini-schritt {
  resize: none;
  overflow: hidden;
  line-height: 1.45;
  min-height: 36px;
}

.del-row-btn {
  background: none;
  border: none;
  color: var(--red);
  opacity: 0.35;
  cursor: pointer;
  font-size: var(--text-md);
  padding: 4px 8px;
  transition: opacity 0.15s;
}

.ini-row:hover .del-row-btn { opacity: 1; }

/* ── Nicht vergessen ──────────────────────────────────────── */
.nv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.nv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nv-card:hover .card-actions { display: flex; }

.nv-title {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 500;
  outline: none;
  margin-bottom: 6px;
}

.nv-title:focus { color: var(--accent); }
.nv-title::placeholder { color: var(--text3); }

.nv-body {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  resize: none;
  line-height: 1.5;
}

.nv-body:focus { color: var(--text); }
.nv-body::placeholder { color: var(--text3); }

/* ── Status cycle tooltip ────────────────────────────────── */
.status-hint {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  margin-top: 10px;
  text-align: right;
}

@media (max-width: 700px) {
  main { padding: 16px; }
  header { padding: 16px 16px 12px; }
  .teams-grid { grid-template-columns: 1fr; }
  .ini-table th:nth-child(3),
  .ini-table td:nth-child(3),
  .ini-table th:nth-child(4),
  .ini-table td:nth-child(4) { display: none; }
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.footer-left {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-actions {
  display: flex;
  gap: 8px;
}

.footer-btn {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.footer-btn:hover {
  color: var(--accent);
  border-color: rgba(122,169,255,0.3);
  background: rgba(122,169,255,0.05);
}

.footer-back-link {
  color: var(--text2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.footer-back-link:hover {
  color: var(--accent);
}

/* ── Detail-Modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text3);
  font-size: var(--text-md);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.08);
}

.modal-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  outline: none;
  transition: border-color 0.15s;
}

.detail-input:focus {
  border-color: rgba(122,169,255,0.4);
}

.detail-input::placeholder { color: var(--text3); }

textarea.detail-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.detail-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 28px;
}

select.detail-input option {
  background: var(--surface2);
  color: var(--text);
}

input[type="date"].detail-input {
  color-scheme: dark;
  cursor: pointer;
}
input[type="date"].detail-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

.detail-select-wrap {
  position: relative;
}

.detail-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: var(--text-xs);
  color: var(--text3);
  pointer-events: none;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .modal { width: 100%; border-radius: 14px 14px 0 0; }
  .detail-row { grid-template-columns: 1fr; }
}

/* ── Detail-Button in Tabellenzeile ───────────────────────── */
.detail-btn,
.risk-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: var(--text-base);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  opacity: 0.4;
  transition: all 0.15s;
}

.risk-btn { position: relative; }

.ini-row:hover .detail-btn,
.ini-row:hover .risk-btn { opacity: 1; }

.detail-btn:hover,
.risk-btn:hover {
  color: var(--accent);
  background: rgba(122,169,255,0.1);
}

/* ── WSJF ─────────────────────────────────────────────────── */
.wsjf-value {
  font-family: var(--mono);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text2);
  text-align: right;
  display: block;
}

.wsjf-empty {
  color: var(--text3);
  font-weight: 400;
}

.detail-divider {
  border-top: 1px solid var(--border);
  margin: 4px 0 2px;
}

.detail-section-title {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Risiko-Detailseite ───────────────────────────────────── */
.risk-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.risk-page-header-bar {
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 57px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.risk-back-btn,
.dp-back-btn {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.risk-back-btn:hover,
.dp-back-btn:hover { color: var(--accent); }

.risk-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  min-width: 0;
  flex: 1;
}

.risk-breadcrumb-sep {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  opacity: 0.5;
  flex-shrink: 0;
}

.risk-breadcrumb-ini {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.risk-breadcrumb-cur {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.risk-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 32px 48px;
  width: 100%;
}

.risk-ini-summary {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.risk-ini-title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.risk-ini-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}

.risk-ini-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.risk-ini-value {
  font-family: var(--sans);
  font-size: var(--text-base);
  color: var(--text2);
}

.risk-ini-notiz {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.risk-ini-notiz p {
  font-size: var(--text-base);
  color: var(--text2);
  margin-top: 4px;
  line-height: 1.5;
}

.risk-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* ── Risiko-Karten ────────────────────────────────────────── */
.risk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.risk-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.risk-bezeichnung {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  font-weight: 500;
  outline: none;
}

.risk-bezeichnung:focus { color: var(--accent); }
.risk-bezeichnung::placeholder { color: var(--text3); }

.risk-beschreibung {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--text-base);
  outline: none;
  resize: none;
  line-height: 1.5;
}

.risk-beschreibung:focus { color: var(--text); }
.risk-beschreibung::placeholder { color: var(--text3); }

.risk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.risk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.risk-badge {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.risk-low {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}

.risk-medium {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}

.risk-high {
  background: rgba(251, 146, 60, 0.15);
  color: var(--orange);
}

.risk-critical {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
}

.risk-delete {
  color: var(--text3);
  opacity: 0.4;
  transition: all 0.15s;
}

.risk-card:hover .risk-delete { opacity: 1; }

.risk-card .risk-delete:hover {
  color: var(--red);
}

/* ── ROAM-Section ─────────────────────────────────────────── */
.roam-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

.risk-roam-notiz {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: var(--text-base);
  outline: none;
  resize: none;
  overflow: hidden;
  min-height: 2.4em;
  line-height: 1.5;
}

.risk-roam-notiz:focus { color: var(--text); }
.risk-roam-notiz::placeholder { color: var(--text3); }

.roam-badge {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.roam-resolved {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}

.roam-owned {
  background: rgba(122, 169, 255, 0.15);
  color: var(--accent);
}

.roam-accepted {
  background: rgba(154, 164, 200, 0.15);
  color: var(--text2);
}

.roam-mitigated {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}



.risk-empty {
  font-family: var(--sans);
  font-size: var(--text-md);
  color: var(--text3);
  text-align: center;
  padding: 24px 0;
}

.risk-badge-mini {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: var(--radius-md);
  margin-left: 2px;
  vertical-align: top;
  background: var(--border);
  color: var(--text2);
}

.risk-badge-mini.risk-low {
  background: rgba(74, 222, 128, 0.2);
  color: var(--green);
}

.risk-badge-mini.risk-medium {
  background: rgba(251, 191, 36, 0.2);
  color: var(--yellow);
}

.risk-badge-mini.risk-high {
  background: rgba(251, 146, 60, 0.2);
  color: var(--orange);
}

.risk-badge-mini.risk-critical {
  background: rgba(248, 113, 113, 0.2);
  color: var(--red);
}

@media (max-width: 700px) {
  .risk-content { padding: 16px; }
  .risk-page-header-bar { padding: 0 16px; }
  .risk-row { grid-template-columns: 1fr; }
  .risk-ini-details { grid-template-columns: 1fr 1fr; }
}

/* ── Loading-Banner ───────────────────────────────────────── */
.loading-banner {
  text-align: center;
  padding: var(--space-xl) var(--space-xl);
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  letter-spacing: 0.06em;
  animation: loading-pulse 1.4s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

/* ── Aktive-Filter-Hervorhebung ───────────────────────────── */
#ini-filters.has-active-filters {
  background: rgba(122,169,255,0.04);
  border-color: rgba(122,169,255,0.22);
}

#ini-filters input:not(:placeholder-shown) {
  border-color: rgba(122,169,255,0.35);
  background: rgba(122,169,255,0.07);
  color: var(--text);
}

/* ── Tabellen-Optimierung ─────────────────────────────────── */
.ini-row:nth-child(even) {
  background: rgba(255,255,255,0.018);
}

.ini-row:hover,
.ini-row:nth-child(even):hover {
  background: var(--surface);
}

.ini-table thead tr {
  border-bottom: 2px solid var(--border2);
}

/* ── Team-Stats Badge Verbesserung ────────────────────────── */
.team-stats-badge {
  margin-top: 12px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: var(--text-base);
  color: var(--text2);
  font-family: var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── WSJF-Preview im Detail-Modal ────────────────────────── */
.wsjf-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(122,169,255,0.06);
  border: 1px solid rgba(122,169,255,0.15);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 4px;
}

.wsjf-formula-text {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
  letter-spacing: 0.03em;
}

.wsjf-equals {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text3);
}

.wsjf-calc {
  font-family: var(--mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-left: auto;
}

/* ── Risk-Card Level-Indikator (linker Rand) ──────────────── */
.risk-card[data-level="risk-low"]      { border-left: 3px solid var(--green); }
.risk-card[data-level="risk-medium"]   { border-left: 3px solid var(--yellow); }
.risk-card[data-level="risk-high"]     { border-left: 3px solid var(--orange); }
.risk-card[data-level="risk-critical"] { border-left: 4px solid var(--red); }

/* ══════════════════════════════════════════════════════════
   DETAIL-SEITE (Full-Page: Initiative + Risiken)
   ══════════════════════════════════════════════════════════ */

.detail-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header-Bar ───────────────────────────────────────────── */
.dp-header-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  height: 57px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dp-title-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.dp-title-input:focus { color: var(--accent); }
.dp-title-input::placeholder { color: var(--text3); }

.dp-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dp-wsjf-header-badge {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--text2);
  background: rgba(122,169,255,0.08);
  border: 1px solid rgba(122,169,255,0.18);
  border-radius: 12px;
  padding: 2px 10px;
}

/* ── Content Area ─────────────────────────────────────────── */
.dp-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 60px;
  display: grid;
  grid-template-columns: 30fr 70fr;
  gap: 24px;
  align-items: start;
}

/* Linke Spalte — Stammdaten + WSJF gestapelt */
.dp-left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Rechte Hauptfläche — Risiken */
.dp-right-col {
  min-width: 0;
}

.dp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.dp-section-title {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.dp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── WSJF-Karte ───────────────────────────────────────────── */
.dp-wsjf-score-wrap {
  text-align: center;
  padding: 16px 0 20px;
}

.dp-wsjf-score {
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  display: block;
  transition: color 0.2s;
}

.dp-wsjf-score-empty  { color: var(--text3); }
.dp-wsjf-score-low    { color: var(--text2); }
.dp-wsjf-score-medium { color: var(--accent); }
.dp-wsjf-score-high   { color: var(--green); }

.dp-wsjf-score-label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-top: 8px;
}

.dp-wsjf-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: rgba(122,169,255,0.06);
  border: 1px solid rgba(122,169,255,0.12);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.dp-wsjf-formula-part {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  letter-spacing: 0.02em;
}

.dp-wsjf-formula-op {
  font-family: var(--mono);
  font-size: var(--text-md);
  color: var(--accent);
  font-weight: 600;
}

.dp-wsjf-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Risiko-Sektion ───────────────────────────────────────── */
.dp-risks-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

/* ── Risiko-Zusammenfassungs-Leiste ───────────────────────── */
.dp-risk-summary-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dp-risk-seg {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 12px;
}

.dp-risk-seg.risk-critical {
  background: rgba(248,113,113,0.15);
  color: var(--red);
}

.dp-risk-seg.risk-high {
  background: rgba(251,146,60,0.15);
  color: var(--orange);
}

.dp-risk-seg.risk-medium {
  background: rgba(251,191,36,0.15);
  color: var(--yellow);
}

.dp-risk-seg.risk-low {
  background: rgba(74,222,128,0.15);
  color: var(--green);
}

/* ── Risiko-Karten (Detail-Page) ──────────────────────────── */
#dp-risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-risk-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: border-color 0.15s;
}

.dp-risk-card:hover {
  border-color: var(--border2);
}

.dp-risk-card[data-level="risk-low"]      { border-left: 3px solid var(--green); }
.dp-risk-card[data-level="risk-medium"]   { border-left: 3px solid var(--yellow); }
.dp-risk-card[data-level="risk-high"]     { border-left: 3px solid var(--orange); }
.dp-risk-card[data-level="risk-critical"] { border-left: 4px solid var(--red); }

.dp-risk-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dp-risk-bezeichnung {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  font-weight: 500;
  outline: none;
}

.dp-risk-bezeichnung:focus { color: var(--accent); }
.dp-risk-bezeichnung::placeholder { color: var(--text3); }

.dp-risk-dropdowns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.dp-risk-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dp-risk-notes-left,
.dp-risk-notes-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}





.dp-risk-beschreibung,
.dp-risk-roam-notiz {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2em;
}

.dp-risk-beschreibung:focus,
.dp-risk-roam-notiz:focus { color: var(--text); }
.dp-risk-beschreibung::placeholder,
.dp-risk-roam-notiz::placeholder { color: var(--text3); }

.dp-risk-card .detail-input {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 5px;
}

.dp-risk-card .detail-select-wrap::after {
  bottom: 7px;
  right: 8px;
}

.dp-risk-card select.detail-input {
  padding-right: 22px;
}

.dp-risk-card .detail-label {
  font-size: 9px;
}

.dp-risk-card .detail-field {
  gap: 2px;
}

.dp-risk-delete {
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.dp-risk-card:hover .dp-risk-delete { opacity: 1; }

.dp-risk-card .dp-risk-delete:hover {
  color: var(--red);
  background: rgba(248,113,113,0.1);
  opacity: 1;
}

/* ── Leerer Zustand (Risiken / Meilensteine) ─────────────── */
.dp-risk-empty,
.dp-milestone-empty {
  text-align: center;
  padding: 40px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dp-risk-empty-icon,
.dp-milestone-empty-icon {
  font-size: 28px;
  opacity: 0.25;
}

.dp-risk-empty p,
.dp-milestone-empty p {
  font-family: var(--sans);
  font-size: var(--text-md);
  color: var(--text3);
}

/* ── Meilensteine ─────────────────────────────────────────── */
.dp-milestones-wrap {
  margin-top: 32px;
}

#dp-milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Table header row ─────────────────────────────────────── */
.dp-ms-header-row {
  display: grid;
  grid-template-columns: 1fr 120px 130px 130px 1fr 28px;
  gap: 8px;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

/* ── Compact milestone row ────────────────────────────────── */
.dp-milestone-row {
  display: grid;
  grid-template-columns: 1fr 120px 130px 130px 1fr 28px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background 0.12s;
}

.dp-milestone-row:hover {
  background: rgba(255,255,255,0.03);
}

.dp-milestone-row[data-ms-status="offen"]           { border-left-color: var(--text3); }
.dp-milestone-row[data-ms-status="in_bearbeitung"]  { border-left-color: var(--accent); }
.dp-milestone-row[data-ms-status="erledigt"]        { border-left-color: var(--green); }
.dp-milestone-row[data-ms-status="blockiert"]       { border-left-color: var(--red); }

/* ── Row field inputs ─────────────────────────────────────── */
.dp-ms-aufgabe,
.dp-ms-owner,
.dp-ms-bemerkung {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-base);
  outline: none;
  padding: 4px 2px;
  min-width: 0;
}

.dp-ms-aufgabe {
  font-weight: 500;
  resize: none;
  field-sizing: content;
  overflow: hidden;
}
.dp-ms-bemerkung {
  resize: none;
  field-sizing: content;
  overflow: hidden;
}
.dp-ms-aufgabe:focus,
.dp-ms-owner:focus,
.dp-ms-bemerkung:focus { color: var(--accent); }
.dp-ms-aufgabe::placeholder,
.dp-ms-owner::placeholder,
.dp-ms-bemerkung::placeholder { color: var(--text3); }

.dp-ms-frist {
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  padding: 4px 2px;
  min-width: 0;
}

.dp-ms-frist:focus { color: var(--accent); }

.dp-ms-status-wrap {
  position: relative;
}

.dp-ms-status {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  width: 100%;
}

.dp-ms-status.ms-status-offen          { color: var(--text3); background: rgba(148,163,184,0.12); }
.dp-ms-status.ms-status-in-bearbeitung { color: var(--accent); background: rgba(96,165,250,0.12); }
.dp-ms-status.ms-status-erledigt       { color: var(--green); background: rgba(74,222,128,0.12); }
.dp-ms-status.ms-status-blockiert      { color: var(--red); background: rgba(248,113,113,0.12); }

/* Options must always be readable regardless of the select's status color */
.dp-ms-status option {
  color: var(--text);
  background: var(--surface2);
  font-weight: 500;
}

.dp-ms-delete {
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  font-size: 12px;
  padding: 2px;
}

.dp-milestone-row:hover .dp-ms-delete { opacity: 0.5; }

.dp-milestone-row .dp-ms-delete:hover {
  color: var(--red);
  opacity: 1;
}

/* ── Team-Detailseite: Form-Elemente ─────────────────────── */

.dp-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dp-select {
  appearance: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  padding: 8px 32px 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236270a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.dp-select:hover,
.dp-select:focus {
  border-color: var(--accent);
  outline: none;
}

.dp-select option {
  background: var(--surface2);
  color: var(--text);
}

.dp-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  padding: 10px;
  resize: vertical;
  transition: border-color 0.15s;
  line-height: 1.5;
}

.dp-textarea:hover,
.dp-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.dp-textarea::placeholder { color: var(--text3); }

/* ── tdp-content: Team-Detailseite hat 40/60 split ─────── */
.tdp-content {
  grid-template-columns: 38fr 62fr;
}

/* ── Team-Status-Badge in Stammdaten ────────────────────── */
.tdp-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tdp-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tdp-status-dot.status-green  { background: var(--green); }
.tdp-status-dot.status-yellow { background: var(--yellow); }
.tdp-status-dot.status-grey   { background: var(--grey); }
.tdp-status-dot.status-blue   { background: var(--accent); }

/* ── Freigaben-Liste ────────────────────────────────────── */
.tdp-shares-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-height: 0;
}

.tdp-share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s;
}

.tdp-share-row:hover { border-color: var(--border2); }

.tdp-share-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent2);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.tdp-share-email {
  flex: 1;
  font-size: var(--text-md);
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tdp-share-owner-badge {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--text3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.tdp-share-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  opacity: 0;
}

.tdp-share-row:hover .tdp-share-remove { opacity: 0.6; }
.tdp-share-remove:hover { color: var(--red) !important; background: rgba(248,113,113,0.1); opacity: 1 !important; }

.tdp-shares-empty {
  text-align: center;
  color: var(--text3);
  font-size: var(--text-sm);
  padding: 20px 0 8px;
  font-style: italic;
}

/* ── Freigabe hinzufügen ────────────────────────────────── */
.tdp-shares-add {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

.tdp-shares-add-label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tdp-search-wrap {
  position: relative;
}

.tdp-user-search {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--text-md);
  padding: 9px 12px 9px 36px;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236270a0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.tdp-user-search:hover,
.tdp-user-search:focus {
  border-color: var(--accent);
  outline: none;
}

.tdp-user-search::placeholder { color: var(--text3); }

.tdp-user-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  list-style: none;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}

.tdp-suggestion-item {
  padding: 10px 14px;
  font-size: var(--text-md);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tdp-suggestion-item::before {
  content: '+';
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.tdp-suggestion-item:hover { background: var(--surface); color: var(--accent); }

/* ── team-detail-btn: Hover-Farbe via icon-btn.team-detail-btn:hover oben */

/* ── Responsive tdp ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .tdp-content { grid-template-columns: 1fr; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dp-content {
    grid-template-columns: 1fr;
  }
  .dp-left-col {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .dp-left-col .dp-section {
    flex: 1 1 280px;
  }
}

@media (max-width: 960px) {
  .dp-risk-dropdowns { grid-template-columns: 1fr; }
  .dp-risk-notes { grid-template-columns: 1fr; }
  .dp-milestone-row { grid-template-columns: 1fr 100px 110px 110px 120px 28px; font-size: 12px; }
  .dp-ms-header-row { grid-template-columns: 1fr 100px 110px 110px 120px 28px; }
}

@media (max-width: 700px) {
  .dp-header-bar { padding: 0 16px; gap: 10px; }
  .dp-content { padding: 16px 16px 40px; }
  .dp-header-badges { display: none; }
  .dp-section { padding: 16px; }
  .dp-risks-wrap { padding: 16px; }
  .dp-milestones-wrap { padding: 16px; }
  .dp-left-col { flex-direction: column; }
}

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: var(--text-base);
  padding: 10px 24px;
  border-radius: var(--radius-md);
  z-index: 9999;
  pointer-events: none;
  animation: toast-fade 4s ease-in-out forwards;
}

@keyframes toast-fade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  8%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Deep-Link copy button ─────────────────────────────── */
.dp-copy-link-btn {
  font-size: var(--text-md);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.dp-copy-link-btn:hover {
  background: var(--surface2);
}

/* ── blockiert-Badge ───────────────────────────────────── */
.ini-blocked-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.85em;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 4px;
  cursor: default;
}

/* ─── blockedBy-Typeahead-Widget ─────────────────────────── */

.bb-widget {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.bb-chips-empty {
  font-size: var(--text-xs);
  color: var(--text3);
  align-self: center;
}

.bb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.4;
}

.bb-chip-gone {
  opacity: 0.55;
  border-style: dashed;
}

.bb-chip-remove {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

.bb-chip-remove:hover {
  color: var(--danger, #e55);
}

.bb-input-wrap {
  position: relative;
}

.bb-search-input {
  width: 100%;
  box-sizing: border-box;
}

.bb-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  z-index: 200;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  max-height: 200px;
  overflow-y: auto;
}

.bb-suggestion-item {
  padding: 7px 12px;
  font-size: var(--text-xs);
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}

.bb-suggestion-item:hover {
  background: var(--surface3, rgba(255, 255, 255, 0.08));
}

/* ═══════════════════════════════════════════════════════════════
   ROADMAP PAGE – Scoped under body.roadmap
   ═══════════════════════════════════════════════════════════════ */

body.roadmap {
  /* Alias roadmap short-vars → cockpit palette */
  --surf: var(--surface);
  --surf2: var(--surface2);
  --bd: var(--border);
  --bd2: var(--border2);
  --tx: var(--text);
  --mu: var(--text3);
  --di: var(--text2);
  --ac: var(--accent);
  --gr: var(--green);
  --am: var(--yellow);
  --re: var(--red);
  --gy: var(--grey);

  /* Roadmap-only vars (no cockpit equivalent) */
  --gr-bg: rgba(74,222,128,.12);
  --am-bg: rgba(251,191,36,.12);
  --re-bg: rgba(248,113,113,.12);
  --gy-bg: rgba(98,112,160,.25);
  --ac-bg: rgba(122,169,255,.12);
  --vi: #a78bfa;
  --to: #818cf8;
  --lw: 300px;

  font-family: var(--sans);
  font-size: var(--text-md);
}

/* Header */
body.roadmap .hdr{padding:13px 28px;border-bottom:1px solid var(--bd);display:flex;align-items:center;gap:12px;background:var(--surf);position:sticky;top:0;z-index:20}
body.roadmap .hdr-logo{font-size:var(--text-sm);font-weight:700;letter-spacing:.15em;text-transform:uppercase;color:var(--mu)}
body.roadmap .hdr-title{font-size:var(--text-lg);font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--ac)}
body.roadmap .kw{font-size:var(--text-sm);color:var(--mu);background:var(--surf2);border:1px solid var(--bd);padding:3px 10px;border-radius:var(--radius-sm);font-weight:600;letter-spacing:.06em}

/* Tabs */
body.roadmap .tabs{display:flex;background:var(--surf);border-bottom:1px solid var(--bd);padding:0 28px;position:sticky;top:49px;z-index:19}
body.roadmap .tab{padding:11px 18px;cursor:pointer;font-size:12px;font-weight:600;color:var(--mu);border-bottom:2px solid transparent;letter-spacing:.06em;text-transform:uppercase;transition:all .15s;display:flex;align-items:center;gap:var(--space-sm);white-space:nowrap}
body.roadmap .tab:hover{color:var(--tx)}
body.roadmap .tab.on{color:var(--tx);border-bottom-color:var(--ac)}
body.roadmap .pip{width:7px;height:7px;border-radius:50%;flex-shrink:0}
body.roadmap .tab-group-label{font-size:var(--text-xs);font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--mu);padding:0 10px 0 4px;display:flex;align-items:center;opacity:.6;white-space:nowrap}
body.roadmap .tab-sep{width:1px;background:var(--bd2);margin:10px var(--space-sm);flex-shrink:0}

/* Main content */
body.roadmap .main{padding:var(--space-lg) 28px}
body.roadmap .pnl{display:none}
body.roadmap .pnl.on{display:block}

/* Timeline wrapper */
body.roadmap .tlw{background:var(--surf);border:1px solid var(--bd);border-radius:var(--radius-md);overflow:hidden}
body.roadmap .tlh{display:flex;border-bottom:1px solid var(--bd);background:var(--surf2)}
body.roadmap .tlhl{width:var(--lw);flex-shrink:0;padding:var(--space-sm) var(--space-md);font-size:var(--text-xs);font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--mu);border-right:1px solid var(--bd);display:flex;align-items:center}
body.roadmap .mos{flex:1;display:flex}
body.roadmap .mo{flex:1;text-align:center;padding:var(--space-sm) 2px;font-size:var(--text-xs);font-weight:600;color:var(--mu);letter-spacing:.07em;text-transform:uppercase;border-right:1px solid var(--bd)}
body.roadmap .mo:last-child{border-right:none}
body.roadmap .mo.cur{color:var(--to);font-weight:700}

/* Rows */
body.roadmap .row{display:flex;border-bottom:1px solid var(--bd);min-height:58px;transition:background .1s}
body.roadmap .row:last-child{border-bottom:none}
body.roadmap .row:hover{background:rgba(30,45,69,.4)}
body.roadmap .rl{width:var(--lw);flex-shrink:0;padding:10px var(--space-md);border-right:1px solid var(--bd);display:flex;flex-direction:column;justify-content:center;gap:3px}
body.roadmap .rn{font-weight:600;font-size:var(--text-base);color:var(--tx);line-height:1.3}
body.roadmap .rm{display:flex;gap:5px;align-items:center;flex-wrap:wrap}
body.roadmap .badge{font-size:var(--text-xs);font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:2px 7px;border-radius:3px}
body.roadmap .rs{font-size:var(--text-sm);color:var(--mu);font-style:italic;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:268px}
body.roadmap .team-chip{font-size:var(--text-xs);font-weight:600;padding:2px 6px;border-radius:3px;letter-spacing:.04em;border:1px solid}

/* Timeline area */
body.roadmap .rtl{flex:1;position:relative;overflow:hidden}
body.roadmap .gl{position:absolute;top:0;bottom:0;width:1px;background:var(--bd);pointer-events:none}
body.roadmap .tln{position:absolute;top:0;bottom:0;width:2px;background:var(--to);opacity:.35;pointer-events:none}

/* Milestone dots */
body.roadmap .ms{position:absolute;top:50%;transform:translate(-50%,-50%);width:11px;height:11px;border-radius:50%;border:2px solid;cursor:pointer;z-index:5;transition:transform .12s}
body.roadmap .ms:hover{transform:translate(-50%,-50%) scale(1.6);z-index:10}

/* Frist diamonds */
body.roadmap .fr{position:absolute;top:50%;transform:translate(-50%,-50%) rotate(45deg);width:12px;height:12px;border:2.5px solid;cursor:pointer;z-index:6;transition:transform .12s}
body.roadmap .fr:hover{transform:translate(-50%,-50%) rotate(45deg) scale(1.5);z-index:10}

/* Legend */
body.roadmap .leg{display:flex;gap:18px;padding:10px var(--space-md);border-top:1px solid var(--bd);background:var(--surf2);flex-wrap:wrap;align-items:center}
body.roadmap .li{display:flex;align-items:center;gap:6px;font-size:var(--text-xs);color:var(--mu);text-transform:uppercase;letter-spacing:.06em;font-weight:600}
body.roadmap .ldot{width:9px;height:9px;border-radius:50%;border:2px solid;flex-shrink:0}
body.roadmap .ldia{width:9px;height:9px;border:2px solid;transform:rotate(45deg);flex-shrink:0}

/* Tooltip */
body.roadmap .tip{position:fixed;background:var(--surf2);border:1px solid var(--bd2);color:var(--tx);padding:10px 14px;border-radius:7px;font-size:12px;max-width:300px;z-index:9999;pointer-events:none;opacity:0;transition:opacity .12s;box-shadow:0 10px 30px rgba(0,0,0,.6);line-height:1.65;top:0;left:0}
body.roadmap .tip.show{opacity:1}
body.roadmap .tt{font-weight:700;font-size:var(--text-base);margin-bottom:var(--space-xs)}
body.roadmap .ts{color:var(--mu);font-size:var(--text-sm)}

/* Empty state */
body.roadmap .empty{padding:var(--space-2xl);text-align:center;color:var(--mu)}

/* Overdue animations */
@keyframes rm-pulse-ring{0%{box-shadow:0 0 0 0 rgba(248,113,113,.5)}70%{box-shadow:0 0 0 5px rgba(248,113,113,0)}100%{box-shadow:0 0 0 0 rgba(248,113,113,0)}}
body.roadmap .overdue-fr{animation:rm-pulse-ring 1.6s ease-out infinite}
body.roadmap .ms.overdue{animation:rm-pulse-ring 1.6s ease-out infinite}
