/* Skanban — Stylesheet
   Ein einziges Blatt, nach Bereichen sortiert. Farben und Abstände als
   Custom Properties, damit sich das Erscheinungsbild an einer Stelle drehen
   lässt. Durchgehend helles Erscheinungsbild. */

:root {
  /* Hintergrund minimal warm statt kaltblau — wirkt weniger technisch. */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eef1f6;
  --border: #e8ebf0;
  --border-firm: #d5dae3;
  --text: #101828;
  --text-soft: #4a5568;
  --text-mute: #98a2b3;
  --primary: #177bdf;
  --primary-dark: #177bdf;
  --primary-soft: #eef1ff;
  --danger: #e84d4f;
  --danger-soft: #fdeced;
  --warn: #f2c758;
  --warn-soft: #fdf3e3;
  --ok: #4aa467;
  --ok-soft: #e6f7f1;

  --radius-lg: 0;
  --radius: 5px;
  --radius-sm: 0px;
  --gap: 16px;

  /* Mehrstufige, sehr weiche Schatten statt einer harten Kante. */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 8px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 8px 16px rgba(16, 24, 40, 0.06), 0 24px 56px rgba(16, 24, 40, 0.14);
  --ring: 0 0 0 3px rgba(51, 85, 255, 0.16);

  --column-w: 300px;
  --column-min: 232px;
  --lane-w: 132px;
  --sidebar-w: 244px;
  --crumbbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Auch bei dunkler Systemeinstellung helle Steuerelemente erzwingen. */
html {
  color-scheme: light;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 620;
  letter-spacing: -0.018em;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 13px;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* — Kopfleiste ————————————————————————————————— */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
  flex: none;
}
.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background: linear-gradient(140deg, #4d6bff, #2440e0);
  box-shadow: 0 1px 3px rgba(51, 85, 255, 0.35);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px 5px;
  border-left: 3px solid #fff;
  border-right: 3px solid rgba(255, 255, 255, 0.55);
}
.brand-mark-lg {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.brand-mark-lg::after {
  inset: 8px 7px;
  border-left-width: 4px;
  border-right-width: 4px;
}

.topnav {
  display: flex;
  gap: 2px;
  margin-right: auto;
}
.topnav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 500;
  transition:
    background 0.14s,
    color 0.14s;
}
.topnav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.topnav a.is-active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 550;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-mute);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.icon-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  flex: none;
  user-select: none;
}
.avatar-link:hover {
  text-decoration: none;
  filter: brightness(1.08);
}
.avatar-sm {
  width: 21px;
  height: 21px;
  font-size: 9px;
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar-more {
  background: var(--border-firm);
  color: var(--text-soft);
}

.side-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

/* — Unternavigation im Einstellungsbereich ————— */

.subnav {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.subnav a {
  padding: 8px 13px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 13.5px;
}
.subnav a:hover {
  color: var(--text);
  text-decoration: none;
}
.subnav a.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* — Ansichtsumschalter Liste / Board ————————————— */

/* Projektbezogene Links stehen links vom Ansichtsumschalter. */
.toolbar-links { display: flex; gap: 6px; margin-left: auto; }
.toolbar-links + .view-switch { margin-left: 0; }

.view-switch {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-left: auto;
  flex: none;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  color: var(--text-mute);
  transition:
    background 0.12s,
    color 0.12s;
}
.view-btn svg {
  width: 17px;
  height: 17px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.view-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.view-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* — Grundelemente ————————————————————————————— */

.main {
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 530;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.14s,
    border-color 0.14s,
    box-shadow 0.14s,
    transform 0.08s;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--text-mute);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 2px 8px rgba(51, 85, 255, 0.24);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #c92b35;
  border-color: #c92b35;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.inline {
  display: inline;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="datetime-local"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 9px 8px;
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.14s,
    box-shadow 0.14s;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-mute);
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--text-mute);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  /* border-color: var(--primary);
  box-shadow: var(--ring); */
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Der native Farbwähler bringt einen harten Rahmen mit — wegblenden,
   damit er zu den übrigen Feldern passt. */
.color-input {
  padding: 3px;
  height: 38px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}
.color-input::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}

label {
  display: block;
  font-weight: 500;
  margin: 14px 0 5px;
  font-size: 13px;
}
label:first-of-type {
  margin-top: 0;
}
.optional {
  color: var(--text-mute);
  font-weight: 400;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.checkbox input {
  width: auto;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-soft);
}
.tag-muted {
  background: var(--border);
}

/* — Meldungen ————————————————————————————————— */

.flashes {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 500;
  animation: flash-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.flash-success {
  background: var(--ok-soft);
  color: #05714f;
  border: 1px solid #b4e6d4;
}
.flash-error {
  background: var(--danger-soft);
  color: #b0242e;
  border: 1px solid #f6c9cc;
}

.flash-close {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  margin-left: auto;
  padding: 0;
}
.flash-close:hover {
  opacity: 1;
}

/* — Anmeldung ————————————————————————————————— */

.body-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-panel {
  width: 100%;
  max-width: 390px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand h1 {
  font-size: 19px;
}

.auth-intro {
  margin: 0 0 20px;
  color: var(--text-soft);
}
.auth-form .btn-block {
  margin-top: 20px;
}

.centered-panel {
  text-align: center;
  max-width: 440px;
  margin: 80px auto;
}
.error-code {
  font-size: 52px;
  color: var(--text-mute);
}
.error-message {
  color: var(--text-soft);
  margin: 8px 0 24px;
}

.card-panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* — Projektübersicht ————————————————————————— */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-sub {
  margin: 3px 0 0;
  color: var(--text-mute);
}
.page-sub.mb {
  margin: 0 0 16px;
}

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

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  overflow: hidden;
  transition:
    box-shadow 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
.project-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
  border-color: var(--border-firm);
  transform: translateY(-2px);
}

.project-stripe {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
}
.project-desc {
  margin: 7px 0 0;
  color: var(--text-soft);
}
.project-meta {
  margin: 14px 0 0;
  color: var(--text-mute);
  font-size: 13px;
}

.project-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px dashed var(--border-firm);
  border-radius: var(--radius);
}
.empty-state p {
  margin: 0 0 16px;
}

/* — Board ————————————————————————————————————— */

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.board-toolbar .board-search {
  width: 260px;
  flex: none;
}
.board-search {
  width: 260px;
  flex: none;
  line-height: 19px !important;
}
.board-select {
  width: auto;
  flex: none;
}

.board {
  overflow-x: auto;
  padding-bottom: 8px;
}

.swimlane {
  margin-bottom: 18px;
}

.lane-head {
  margin-bottom: 8px;
}

.lane-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px 2px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
}
.lane-toggle:hover {
  color: var(--text);
}

.lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: none;
}

.chevron {
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s;
  transform: rotate(90deg);
  flex: none;
}
.is-collapsed .chevron {
  transform: rotate(0deg);
}

.lane-body {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  /* Die Spalten teilen sich die volle Breite — bei vier Spalten also je
     ein Viertel. Unterschreiten sie --column-min, wächst die Bahn über den
     Rand hinaus und das Board scrollt waagerecht.
     Kein min-width nötig: die Mindestbreite der Spalten erzwingt das
     Überlaufen von selbst, ein zusätzliches max-content addiert dagegen
     die Rahmen mit und liesse schon vorher einen Scrollbalken erscheinen. */
  width: 100%;
}
.is-collapsed .lane-body {
  display: none;
}

/* Jede Spalte ist ein eigener, flächiger Container. */
.column {
  /* Gleicher Anteil für jede Spalte; die Basis 0 sorgt dafür, dass der
     Inhalt die Aufteilung nicht verzerrt. */
  flex: 1 1 0;
  min-width: var(--column-min);
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 140px;
  max-height: calc(100vh - var(--crumbbar-h) - 150px);
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  flex: none;
}
.column-head.is-over-limit {
  color: var(--danger);
}

.column-name {
  letter-spacing: -0.01em;
}

.column-count {
  color: var(--text-mute);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-right: auto;
}
.is-over-limit .column-count {
  color: var(--danger);
}

.column-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-mute);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}
.column-add:hover {
  background: var(--surface-3);
  color: var(--text);
}

.cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 40px;
}
/* Beim Ziehen wird die ganze Spalte markiert — Kopfzeile eingeschlossen,
   damit klar ist, wo die Karte landet. */
.column.is-drop-target {
  background: var(--primary-soft);
  border-color: var(--primary);
  border-style: dashed;
}
.column.is-drop-target .column-head {
  color: var(--primary-dark);
}

.cell-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
  flex: none;
}
.cell-add:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* — Karte ————————————————————————————————————— */

.card {
  position: relative;
  padding: 11px 13px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    box-shadow 0.14s,
    border-color 0.14s,
    opacity 0.12s;
  flex: none;
}
.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-firm);
}
/* Farbiger Balken links: zeigt im gemeinsamen Board, zu welchem Projekt
   eine Karte gehört. */
.card.has-project {
  border-left: 3px solid var(--project);
  padding-left: 11px;
}
.card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--primary);
}
.card.is-dragging {
  opacity: 0.5;
}
.card.is-hidden {
  display: none;
}
.card.is-done .card-title {
  color: var(--text-mute);
  text-decoration: line-through;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  min-width: 0;
}
.card-top .prio {
  flex: none;
}

/* Kennung wie "Coroo-1" — Projektname plus Nummer. Lange Projektnamen
   werden gekürzt, damit die Priorität rechts nicht verdrängt wird. */
.card-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Priorität: Punkt plus Wort, heller Grund statt Vollfarbe. */
.prio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--prio, #94a3b8) 12%, #fff);
  color: color-mix(in srgb, var(--prio, #94a3b8) 78%, #000);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.prio-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--prio, currentColor);
  flex: none;
}
.prio-due {
  --prio: #94a3b8;
}
.prio-due.is-soon {
  --prio: var(--warn);
}
.prio-due.is-overdue {
  --prio: var(--danger);
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  min-height: 21px;
}

.card-context {
  color: var(--text-soft);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.meta-chip {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.meta-chip.is-complete {
  background: var(--ok-soft);
  color: var(--ok);
}
.meta-chip.is-soon {
  background: var(--warn-soft);
  color: var(--warn);
}
.meta-chip.is-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.meta-icon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.meta-icon svg {
  width: 13px;
  height: 13px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-avatars {
  display: flex;
}
.card-avatars .avatar + .avatar {
  margin-left: -6px;
}

/* — Aufgabenliste (projektübergreifend) ———————— */

.task-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-check {
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
}
/* Die Suche steht neben den Auswahlfeldern, nicht in eigener Zeile. */
.task-filters .board-search {
  width: 240px;
  flex: none;
}
.task-count {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 13px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.task-group.is-hidden {
  display: none;
}

.task-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 8px;
  font-size: 13px;
  font-weight: 600;
}
.task-group-head a {
  color: var(--text);
}
.task-group-count {
  color: var(--text-mute);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-width: 0;
  color: var(--text);
  transition: background 0.12s;
}
.task-row:first-of-type {
  border-top-width: 1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.task-row:last-of-type {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.task-row:only-of-type {
  border-radius: var(--radius-sm);
}
.task-row:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.task-row.is-hidden {
  display: none;
}
.task-row.is-done .task-title {
  color: var(--text-mute);
  text-decoration: line-through;
}

.task-key {
  flex: none;
  width: 132px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .task-key {
    width: 92px;
  }
}

.task-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-column {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

@media (max-width: 720px) {
  .task-column {
    display: none;
  }
}

/* — Dialoge ————————————————————————————————— */

.dialog {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 92vw;
}
.dialog[open] {
  animation: dialog-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}
.dialog::backdrop {
  background: rgba(16, 24, 40, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog-form {
  padding: 24px;
  width: min(440px, 92vw);
}
.dialog-form h2 {
  margin-bottom: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.dialog-x {
  background: none;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--text-mute);
  cursor: pointer;
  padding: 0 4px;
}
.dialog-x:hover {
  color: var(--text);
}

/* — Kartendetail ————————————————————————————— */

.dialog-card {
  width: min(940px, 94vw);
  /* Der Dialog selbst begrenzt die Höhe — sonst addieren sich Kopfzeile
     und Ränder auf die Körperhöhe und der Rahmen läuft aus dem Bild. */
  max-height: 88vh;
  overflow: hidden;
}
/* display nur im geöffneten Zustand setzen: ein <dialog> ohne [open] ist
   allein durch sein voreingestelltes display:none verborgen — ein
   unbedingtes display:flex würde ihn dauerhaft sichtbar machen. */
.dialog-card[open] {
  display: flex;
  flex-direction: column;
}
.card-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.detail-title {
  border: 1px solid transparent;
  background: none;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.015em;
  padding: 6px 9px;
}
.detail-title:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  padding: 20px;
  min-height: 0;
  overflow-y: auto;
}

.detail-body::-webkit-scrollbar {
  width: 10px;
}
.detail-body::-webkit-scrollbar-thumb {
  background: var(--border-firm);
  border: 3px solid var(--surface);
  border-radius: 999px;
}
.detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.detail-section {
  margin-bottom: 24px;
}
.detail-section h3 {
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  margin-bottom: 9px;
}

/* — Editor für die Beschreibung ————————————————— */

.editor {
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .14s, box-shadow .14s;
}
.editor:focus-within { border-color: var(--primary); box-shadow: var(--ring); }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border);
}

.editor-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.editor-btn svg { width: 15px; height: 15px; stroke-linecap: round; stroke-linejoin: round; }
.editor-btn:hover { background: var(--surface-2); color: var(--text); }
/* Aktiver Zustand: zeigt, ob der Cursor gerade in fettem Text steht. */
.editor-btn.is-active { background: var(--primary-soft); color: var(--primary); }

.editor-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--border);
}

.editor-area {
  padding: 10px 12px;
  min-height: 110px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  word-break: break-word;
}
/* Platzhalter, solange nichts geschrieben wurde. */
.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-mute);
  pointer-events: none;
}

.editor-area p { margin: 0 0 8px; }
.editor-area p:last-child { margin-bottom: 0; }
.editor-area ul, .editor-area ol { margin: 0 0 8px; padding-left: 22px; }
.editor-area li { margin-bottom: 3px; }
.editor-area a { color: var(--primary); text-decoration: underline; }
/* Mit gedrückter ⌘-Taste wird der Link anklickbar — der Zeiger zeigt das an. */
.editor-area.is-link-mode a { cursor: pointer; }
.editor-area.is-link-mode a:hover { background: var(--primary-soft); border-radius: 3px; }
.editor-area h3, .editor-area h4 { margin: 12px 0 6px; }
.editor-area h3 { font-size: 15px; }
.editor-area h4 { font-size: 14px; }
.editor-area code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}
.editor-area pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  overflow-x: auto;
}
.editor-area blockquote {
  margin: 0 0 8px;
  padding-left: 12px;
  border-left: 3px solid var(--border-firm);
  color: var(--text-soft);
}

.subtask-progress {
  color: var(--text-mute);
  text-transform: none;
  letter-spacing: 0;
}

.subtask-list,
.comment-list,
.activity-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
}
.subtask-item input {
  width: auto;
}
.subtask-item.is-done .subtask-text {
  color: var(--text-mute);
  text-decoration: line-through;
}
.subtask-text {
  flex: 1;
  word-break: break-word;
}

.subtask-add,
.comment-add {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.comment-item:first-child {
  border-top: 0;
}
.comment-body {
  flex: 1;
}
.comment-meta {
  color: var(--text-mute);
  font-size: 12px;
  margin-bottom: 2px;
}
.comment-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-list li {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-soft);
  font-size: 13px;
}
.activity-when {
  color: var(--text-mute);
  flex: none;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.attachment {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.attachment img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
}
.attachment-file {
  display: block;
  padding: 14px 10px;
  text-align: center;
}
.attachment-name {
  display: block;
  padding: 5px 7px;
  font-size: 11.5px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.attachment:hover .attachment-remove {
  opacity: 1;
}

.dropzone {
  padding: 16px;
  border: 1px dashed var(--border-firm);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.dropzone {
  transition:
    border-color 0.14s,
    background 0.14s;
}
.dropzone.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone p {
  margin: 0;
}
.dropzone kbd {
  padding: 1px 5px;
  border: 1px solid var(--border-firm);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
}

.detail-side {
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.side-group {
  margin-bottom: 18px;
}
.side-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 13px;
}
.side-danger {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.assignee-picker,
.label-picker {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.picker-item {
  transition: background 0.12s;
}
.picker-item:hover {
  background: var(--surface-2);
}
.picker-item input {
  width: auto;
}

/* — Lightbox für Bildanhänge ——————————————————— */

.lightbox {
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(16, 24, 40, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-in 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

.lightbox-image {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: var(--surface);
}

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.14s;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
}

/* Die Pfeile erscheinen nur, wenn es mehr als ein Bild gibt. */
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 30px;
  line-height: 1;
  display: none;
}
.lightbox.has-nav .lightbox-nav {
  display: flex;
}
.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
  .lightbox-prev {
    left: 10px;
  }
  .lightbox-next {
    right: 10px;
  }
}

/* — Tabellen (Verwaltung) ————————————————————— */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
/* Name plus Avatar bleiben zusammen auf einer Zeile. */
td .avatar {
  vertical-align: middle;
  margin-right: 6px;
}
th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  font-weight: 600;
}
tbody tr {
  transition: background 0.12s;
}
.table-wrap tbody tr:hover {
  background: var(--surface-2);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.actions {
  text-align: right;
  white-space: nowrap;
}

.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: var(--gap);
}
.section-block h2 {
  margin-bottom: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: var(--gap);
  align-items: start;
}

.stat-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.stat-value {
  font-size: 22px;
  font-weight: 650;
}
.stat-label {
  color: var(--text-mute);
  font-size: 12.5px;
}

.row-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row-form label {
  margin: 0;
  white-space: nowrap;
}
.row-form .grow {
  flex: 1 1 130px;
  min-width: 0;
}
/* Der Zeilen-Umbruch soll erst greifen, wenn es wirklich eng wird. */
.row-form .checkbox {
  white-space: nowrap;
}
.row-form input[type="number"] {
  flex: none;
}

/* Tabellenzeilen in den Einstellungen: Formular füllt die Zelle. */
.section-block td {
  padding: 8px 0;
}
.section-block td:first-child {
  width: 100%;
}
.section-block td.actions {
  padding-left: 12px;
}
.section-block table {
  margin-bottom: 4px;
}
/* Die Spaltenzeile ist die längste — ihr Namensfeld darf schrumpfen. */
.section-block .row-form .grow {
  flex: 1 1 90px;
}

.muted {
  color: var(--text-mute);
}
.mt {
  margin-top: 16px;
}

@media (max-width: 860px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
  .detail-side {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 18px 0 0;
  }
}
