:root {
  --bg: #12151c;
  --panel: #1c2230;
  --card: #232c3f;
  --text: #e8ecf3;
  --muted: #a8b3c7;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --danger: #ef4444;
  --border: #2f3a52;
  /* Höhere Spezifität als "html" aus theme-common.css, darum gewinnt
     das trotz früherer Ladeposition gegen "html { overflow: hidden }". */
  overflow-y: auto;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

/* "body " erhöht die Spezifität, damit diese Regeln gegen die später
   geladenen theme-*.css gewinnen (gleiche Elementselektoren dort). */
body button, body select {
  font: inherit;
}

body button {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

body button:hover { background: var(--accent-dark); }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body button.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

body button.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

main { padding: 1.5rem; }

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

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

.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 200px;
}

.column h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
}

.column ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 120px;
  border-radius: 6px;
}

.column ul.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.card.dragging { opacity: 0.5; }

.card h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.card p.description {
  margin: 0 0 0.5rem 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.status-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

body select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}

/* theme-common.css setzt "option { color: black }", das auf dunklem
   Popup-Hintergrund unsichtbar ist. Hohe Spezifität, damit es auch gegen
   später geladene theme-*.css gewinnt (bitte Hard-Reload im Browser:
   Strg+Shift+R, sonst liegt altes CSS im Cache). */
html body select option {
  color: var(--text);
  background-color: var(--bg);
}

dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  width: min(420px, 90vw);
  /* Das UA-Stylesheet zentriert <dialog> per margin: auto.
     theme-common.css setzt "* { margin: 0 }", das gewinnt ohne diese
     Zeile und klebt den Dialog links oben fest. */
  margin: auto;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.6); }

.field { display: flex; flex-direction: column; gap: 0.3rem; }

/* theme-common.css löscht per "* { margin: 0 }" alle Browser-Standardabstände.
   Darum bekommt der Dialog-Inhalt hier eigene Abstände. */
#dialog-title { margin: 0 0 0.75rem 0; font-size: 1.2rem; }
dialog .field { margin: 0 0 0.75rem 0; }

body input, body textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
}

.error { color: #fca5a5; margin: 0.5rem 0; }

.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
