/* Übersichtsseite — Grundlagen aus base.css. */

.ov-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ov-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  animation: fadeSlideIn 0.45s ease both;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.ov-tile:hover { border-color: rgba(255, 67, 38, 0.35); transform: translateY(-1px); }
.ov-tile-label { font-size: 12.5px; color: var(--text-tertiary); font-weight: 500; margin-bottom: 8px; }
.ov-tile-value { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1; }
.ov-tile-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.ov-tile.alert .ov-tile-value { color: var(--danger); }
.ov-tile.alert { border-color: rgba(255, 67, 38, 0.3); }

.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ov-grid > .card { margin: 0; min-width: 0; } /* FLYD-409: sonst dehnt der Zeitstrahl die Spalte */
.ov-span-2 { grid-column: span 2; }
.admin-only[hidden] { display: none; }
.ov-system { grid-column: span 2; }
.is-admin .ov-system { grid-column: auto; }
.card-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.card-link:hover { color: var(--brand); }

/* Personen mit ihren Aufgaben */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.person { background: #0F0F0F; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 12px 14px; }
.person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.person-name { font-weight: 600; font-size: 14px; }
.person-count { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #262626; color: var(--text-primary);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Aufgaben-Zeilen */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-row {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border-soft);
  font-size: 13.5px; text-decoration: none; color: var(--text-primary); min-height: 36px;
}
.task-list li:first-child .task-row { border-top: none; }
.task-row:hover .task-row-title { color: var(--brand); }
.task-row-key { color: var(--text-tertiary); font-variant-numeric: tabular-nums; font-size: 12px; flex-shrink: 0; }
.task-row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-row-meta { font-size: 12px; color: var(--text-tertiary); flex-shrink: 0; max-width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-meta.overdue { color: var(--danger); font-weight: 600; }
.task-row-meta.stale { color: var(--warning); }

/* Review nach PR */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-items: start; }
.pr-block { border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px 12px; background: #0F0F0F; }
.pr-block-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pr-block-head a { color: var(--text-primary); text-decoration: none; }
.pr-block-head a:hover { color: var(--brand); }
.pr-block-head span { color: var(--text-tertiary); font-weight: 500; font-size: 12px; white-space: nowrap; }
.pr-block-people { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sub-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); margin: 14px 0 4px; }
.sub-title:first-child { margin-top: 0; }

/* Kennzahl-Listen */
.stat-list { display: flex; flex-direction: column; }
.stat-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 14px; color: var(--text-secondary);
  text-decoration: none;
}
.stat-row:first-child { border-top: none; padding-top: 0; }
a.stat-row:hover { color: var(--text-primary); }
.stat-row strong { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text-primary); }
.stat-row strong.alert { color: var(--danger); }

/* System-Status */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sys-item { display: flex; gap: 10px; align-items: flex-start; background: #0F0F0F; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 12px 14px; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--text-tertiary); }
.sys-dot.ok { background: var(--success); }
.sys-dot.warn { background: var(--warning); }
.sys-dot.bad { background: var(--danger); }
.sys-name { font-weight: 600; font-size: 14px; }
.sys-detail { font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.45; }
.sys-detail a { color: var(--text-secondary); }

@media (max-width: 860px) {
  .ov-tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ov-tile { padding: 14px; }
  .ov-tile-value { font-size: 26px; }
  .ov-grid { grid-template-columns: 1fr; }
  .ov-span-2, .ov-system { grid-column: auto; }
  .people { grid-template-columns: 1fr; }
}

/* FLYD-122: gerade aktiv */
.row-active {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; align-self: center;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}

/* ---- Erledigt im Team (FLYD-138) ---- */
.ov-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 -4px; }
.ov-section-head h2 { font-size: 19px; margin: 0; }
.seg-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.seg-switch button {
  border: none; background: transparent; color: var(--text-tertiary); font-size: 13px; font-weight: 600;
  padding: 6px 12px; min-height: 32px; border-radius: 6px; cursor: pointer;
}
.seg-switch button:hover { color: var(--text-secondary); }
.seg-switch button[aria-pressed="true"] { background: #262626; color: var(--text-primary); }

.tc-root { position: relative; }
.tc-plot { position: relative; }
.tc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tc-grid { stroke: #222; stroke-width: 1; }
.tc-base { stroke: #333; stroke-width: 1; }
.tc-tick { fill: var(--text-tertiary); font-size: 11px; font-variant-numeric: tabular-nums; }
.tc-cap { fill: var(--text-secondary); font-size: 12px; font-weight: 600; }
.tc-col { transition: opacity 0.15s ease; }
.tc-col.dim { opacity: 0.35; }
.tc-hit { fill: transparent; cursor: default; outline: none; }
.tc-hit:focus-visible { stroke: var(--text-secondary); stroke-width: 1; }

.tc-tip {
  position: absolute; top: 0; z-index: 5; pointer-events: none; min-width: 170px; max-width: 280px;
  background: #1C1C1C; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  font-size: 12.5px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.tc-tip-head { color: var(--text-tertiary); margin-bottom: 6px; }
.tc-tip-row { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.tc-tip-row strong { color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 14px; }
.tc-key { width: 12px; height: 2px; border-radius: 1px; flex-shrink: 0; }
.tc-tip-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); color: var(--text-secondary); }
.tc-tip-task { color: var(--text-tertiary); font-size: 11.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--text-secondary); }
.tc-legend li { display: flex; align-items: center; gap: 7px; }
.tc-legend strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tc-table { margin-top: 12px; font-size: 13px; }
.tc-table summary { cursor: pointer; color: var(--text-tertiary); min-height: 32px; display: flex; align-items: center; }
.tc-table summary:hover { color: var(--text-secondary); }
.tc-table table { margin-top: 6px; font-size: 13px; }
.tc-table td, .tc-table th { padding: 6px 8px; }

@media (max-width: 860px) {
  .ov-section-head { margin: 4px 0 0; }
}

/* Fortschritt in „Wer arbeitet woran“ (FLYD-139) */
.row-progress { display: flex; align-items: center; gap: 6px; flex-shrink: 0; align-self: center; }
.row-progress-track { width: 44px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.row-progress-track span { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.row-progress-val { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* ---- Für dich (FLYD-294) ---- */
.mine-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 6px 28px; align-items: start; }
.mine-group .sub-title { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.mine-count {
  font-size: 11px; font-weight: 700; letter-spacing: 0; color: var(--text-secondary); background: #262626;
  border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.mine-row { align-items: flex-start; }
.mine-row .task-row-key, .mine-row .task-row-meta { padding-top: 1px; }
.mine-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mine-wait { font-size: 12px; color: var(--text-tertiary); overflow-wrap: anywhere; line-height: 1.4; }
.mine-row.blocked .task-row-title { color: var(--text-secondary); }
.mine-more summary { cursor: pointer; font-size: 12.5px; color: var(--text-tertiary); min-height: 32px; display: flex; align-items: center; }
.mine-more summary:hover { color: var(--text-secondary); }
@media (max-width: 860px) {
  .mine-groups { grid-template-columns: 1fr; }
  /* Alter/Blockiert als eigene Zeile unter dem Text, damit der Titel Platz hat. */
  .mine-row { flex-wrap: wrap; row-gap: 2px; }
  .mine-row .task-row-key { min-width: 62px; }
  .mine-row .task-row-meta { flex-basis: 100%; max-width: none; padding: 0 0 0 70px; white-space: normal; }
}

/* ---- Meilensteine als Zeitstrahl (FLYD-409) ---- */
.ms-card-wrap .card-head { justify-content: flex-start; align-items: center; flex-wrap: wrap; row-gap: 6px; }
.ms-card-wrap .ms-add { margin-left: auto; }
.ms-add[hidden] { display: none; }

.ms-track {
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  margin: 0 -24px; padding: 0 24px 6px; scroll-padding: 0 24px;
}
.ms-track:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-md); }
.ms-list { --ms-gap: 14px; list-style: none; margin: 0; padding: 0; display: flex; gap: var(--ms-gap); }
.ms-list > li { scroll-snap-align: start; }

/* Ein Meilenstein: Punkt auf der Linie, darunter Datum und Karte. */
.ms { position: relative; flex: 1 0 248px; max-width: 360px; padding-top: 26px; display: flex; flex-direction: column; }
.ms::before, .ms-now::before, .ms-older::before {
  content: ''; position: absolute; top: 8px; left: 0; right: calc(-1 * var(--ms-gap)); height: 2px; background: var(--border);
}
.ms-list > li:first-child::before { left: 9px; }
.ms-list > li:last-child::before { right: auto; width: 9px; }
.ms-list > li:only-child::before { display: none; }
.ms.is-past::before { background: #333; }

.ms-dot {
  position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid #4a4a4a; box-sizing: border-box; z-index: 1;
}
.ms.is-past .ms-dot { background: #4a4a4a; }
.ms.is-done .ms-dot { background: var(--success); border-color: var(--success); }
.ms.is-next .ms-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 5px var(--brand-glow); }

.ms-when { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12.5px; white-space: nowrap; }
.ms-when time { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-count { color: var(--text-tertiary); }
.ms.is-next .ms-count { color: var(--brand-text); font-weight: 600; }
.ms-count.late { color: var(--danger); font-weight: 600; }

.ms-card {
  flex: 1; background: #0F0F0F; border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.ms.is-next .ms-card { border-color: rgba(255, 67, 38, 0.35); background: linear-gradient(180deg, var(--brand-glow-soft), #0F0F0F 70%); }
.ms.is-past .ms-card { opacity: 0.72; }
.ms.is-past .ms-card:hover, .ms.is-past .ms-card:focus-within { opacity: 1; }
.ms-card-head { display: flex; align-items: flex-start; gap: 6px; }
.ms-title { margin: 0; flex: 1; min-width: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ms-edit {
  flex-shrink: 0; margin: -6px -8px 0 0; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; color: var(--text-tertiary); cursor: pointer;
}
.ms-edit:hover, .ms-edit:focus-visible { color: var(--text-primary); background: var(--surface-raised); }
.ms-desc {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line;
}
.ms-none { margin: 0; font-size: 12.5px; color: var(--text-tertiary); }

.ms-progress { display: flex; align-items: center; gap: 8px; }
.ms-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ms-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width 0.4s ease; }
.ms.is-done .ms-bar span { background: var(--success); }
.ms-progress-val { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ms.is-done .ms-progress-val { color: var(--success); font-weight: 600; }

.ms-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ms-tasks a {
  display: flex; align-items: baseline; gap: 7px; padding: 5px 0; min-height: 30px; box-sizing: border-box;
  border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--text-primary); text-decoration: none;
}
.ms-tasks li:first-child a { border-top: none; }
.ms-tasks a:hover .ms-task-title { color: var(--brand); }
.ms-key { color: var(--text-tertiary); font-size: 11.5px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ms-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-st { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; align-self: center; background: #555; }
.ms-st.st-in_progress { background: var(--brand); }
.ms-st.st-review { background: var(--warning); }
.ms-st.st-done { background: var(--success); }
.ms-more {
  align-self: flex-start; background: none; border: none; padding: 4px 0; min-height: 28px; cursor: pointer;
  font-size: 12.5px; color: var(--text-tertiary);
}
.ms-more:hover { color: var(--text-primary); }

/* „Heute“-Markierung zwischen Vergangenem und Kommendem. */
.ms-now { position: relative; flex: 0 0 auto; padding-top: 26px; display: flex; flex-direction: column; gap: 2px; min-width: 52px; }
.ms-now-tick { position: absolute; top: 0; left: 8px; width: 2px; height: 18px; border-radius: 1px; background: var(--text-primary); z-index: 1; }
.ms-now-label { font-size: 12px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; }
.ms-now-date { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.ms-older { position: relative; flex: 0 0 auto; padding-top: 26px; }
.ms-older-btn {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-round); color: var(--text-secondary);
  font-size: 12.5px; padding: 6px 12px; min-height: 32px; cursor: pointer; white-space: nowrap;
}
.ms-older-btn:hover { color: var(--text-primary); border-color: var(--text-tertiary); }

.ms-empty { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ms-empty p { margin: 0; flex: 1 1 320px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

/* Fenster */
.ms-modal {
  background: #111; border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; padding: 22px 24px 24px; box-sizing: border-box;
}
.ms-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ms-modal-head h2 { margin: 0; font-size: 20px; }
.ms-form { display: flex; flex-direction: column; gap: 14px; }
.ms-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ms-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ms-field-grow { flex: 1 1 240px; }
.ms-field label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.02em; }
.ms-optional { font-weight: 400; }
.ms-field input, .ms-field textarea { width: 100%; box-sizing: border-box; }
.ms-field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chips[hidden], .ms-results[hidden], .ms-error[hidden], .ms-actions [hidden] { display: none; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-round);
  padding: 2px 2px 2px 10px; font-size: 12.5px;
}
.ms-chip.done .ms-chip-title { color: var(--text-tertiary); text-decoration: line-through; }
.ms-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.ms-chip button {
  width: 26px; height: 26px; border-radius: 50%; border: none; background: none; color: var(--text-tertiary);
  font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.ms-chip button:hover { color: var(--text-primary); background: var(--border); }
.ms-results {
  list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.ms-results button {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-radius: 8px;
  padding: 8px 10px; min-height: 36px; color: var(--text-primary); font-size: 13.5px; cursor: pointer;
}
.ms-results button:hover, .ms-results button:focus-visible { background: var(--surface-raised); }
.ms-res-meta { font-size: 12px; color: var(--text-tertiary); flex-shrink: 0; }
.ms-res-empty { padding: 8px 10px; font-size: 13px; color: var(--text-tertiary); }
.ms-error { margin: 0; font-size: 13px; color: var(--danger); }
.ms-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.ms-actions #msDelete { margin-right: auto; }

@media (max-width: 860px) {
  .ms-track { margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 0 16px; }
  .ms { flex-basis: 78vw; max-width: 300px; }
  .ms-modal { max-width: none; min-height: 100%; border-radius: 0; border: none; padding: 18px 16px 24px; }
}
