:root {
  --bg0: #0b1020;
  --bg1: #0f172a;
  --card: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --accent: #7c3aed;
  --accent2: #22d3ee;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(124,58,237,.22), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(34,211,238,.15), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* ── Layout ──────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 18px; }
.center-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: clip;
  backdrop-filter: blur(10px);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-header h2 {
  margin: 0; font-size: 13px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .3px;
  color: rgba(255,255,255,.75);
}
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input[type="search"] {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px; font-size: 13px;
  outline: none;
}
input[type="search"]:focus { border-color: var(--accent); }

/* ── Login Card ───────────────────────────────────────────── */
.login-card { width: 100%; max-width: 400px; padding: 36px 32px; }
.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 28px;
}
.dot-big {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

/* ── Form ─────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.cb-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 6px 10px;
  transition: background .15s;
}
.cb-label:hover { background: rgba(255,255,255,.1); }
.cb-label input[type="checkbox"] { width: 14px; height: 14px; accent-color: #818cf8; flex-shrink: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px; font-size: 14px;
  outline: none; width: 100%;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: #1e293b; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ── Modal Form-Hilfsklassen ──────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.form-input { /* inherits global input/select/textarea styles above */ }

/* ── Buttons: secondary ──────────────────────────────── */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border); color: var(--muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: rgba(255,255,255,.12); color: var(--text); }
.btn-primary:not(.btn) {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--accent); border: none; color: #fff;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-primary:not(.btn):hover { opacity: .88; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px 20px 0; }
.todo-form { padding-bottom: 16px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: rgba(255,255,255,.3); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Alert ────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 10px; }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }

/* ── Details/Collapsibles (Optionen, Rollen) ────────────────── */
details.menu-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  overflow: clip;
  margin-bottom: 12px;
}
details.menu-section summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  color: rgba(255,255,255,.85);
  font-weight: 650;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .2px;
  transition: background .15s;
}
details.menu-section summary::-webkit-details-marker { display: none; }
details.menu-section summary:hover {
  background: rgba(255,255,255,.05);
}
details.menu-section summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(124,58,237,.4);
  border-radius: 6px;
}

.chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}
.chevron::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid rgba(255,255,255,.7);
  border-bottom: 2px solid rgba(255,255,255,.7);
  transform: translate(-50%, -65%) rotate(45deg);
  transform-origin: center;
  transition: transform .25s ease;
}
details.menu-section[open] > summary .chevron::before {
  transform: translate(-50%, -35%) rotate(225deg);
}

details.menu-section > div {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Responsive: Collapsibles für Mobile ─────────────────── */
@media (max-width: 600px) {
  details.menu-section summary {
    font-size: 12px;
    padding: 10px 14px;
  }
  details.menu-section > div {
    padding: 10px 14px;
  }
  /* Form Grids auf Mobile zu 1 Spalte */
  details.menu-section > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11,16,32,.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.header-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.header-nav { display: flex; align-items: center; gap: 14px; }

/* ── Todo List ────────────────────────────────────────────── */
main { padding: 24px 0 48px; }
.todo-list { padding: 8px 0; }
.loading { padding: 32px; text-align: center; color: var(--muted); }

.todo-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .12s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: rgba(255,255,255,.03); }
.todo-item.done { opacity: .45; }
.todo-checkbox {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.todo-checkbox.checked { background: var(--green); border-color: var(--green); }
.todo-checkbox.checked::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; }

.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 15px; font-weight: 600; }
.todo-item.done .todo-title { text-decoration: line-through; }
.todo-desc { font-size: 13px; color: var(--muted); margin-top: 3px; }
.todo-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12px; color: var(--muted);
}
.badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-hoch     { background: rgba(239,68,68,.2);  color: #fca5a5; }
.badge-mittel   { background: rgba(234,179,8,.2);  color: #fde047; }
.badge-niedrig  { background: rgba(34,197,94,.2);  color: #86efac; }

.todo-actions { display: flex; gap: 8px; }
.btn-delete {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 16px; padding: 4px; border-radius: 6px;
  transition: color .15s;
}
.btn-delete:hover { color: var(--red); }

.no-todos { padding: 40px; text-align: center; color: var(--muted); }

.toggle-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ── Mobile Bottom Navigation ─────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(15,23,42,.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 99;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-top: 8px;
}

.bottom-nav-items {
  display: flex; justify-content: space-around; align-items: center;
  max-width: 1100px; margin: 0 auto;
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; padding: 8px; cursor: pointer;
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 600;
  border-radius: 10px; transition: all .15s;
  min-height: 56px; justify-content: center;
}

.nav-item.active {
  color: var(--accent); 
  background: rgba(124,58,237,.1);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}

.nav-icon { font-size: 20px; }

.nav-label { font-size: 11px; }

/* ── Desktop Navigation ───────────────────────────────────── */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.desk-nav-item { position: relative; }

.desk-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.desk-nav-btn:hover {
  background: rgba(255,255,255,.06);
  border-color: var(--border);
  color: var(--text);
}
.desk-nav-btn.active {
  background: rgba(124,58,237,.15);
  border-color: rgba(124,58,237,.35);
  color: var(--accent);
}

/* Chevron im Dropdown-Button */
.desk-chev {
  display: inline-block; width: 12px; height: 12px;
  position: relative; flex-shrink: 0;
}
.desk-chev::before {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); top: 2px;
  transition: transform .15s;
}
.desk-nav-btn.active .desk-chev::before {
  transform: rotate(225deg);
  top: 5px;
}

/* Dropdown-Menü */
.desk-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px;
  background: rgba(15,23,42,.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
  padding: 6px;
  z-index: 9000;
  animation: ddFadeIn .15s ease;
}
.desk-dropdown.open { display: block; }

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.desk-dd-item {
  display: block; width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: none; border: none;
  cursor: pointer; text-align: left;
  text-decoration: none;
  transition: background .12s, color .12s;
  font-family: inherit;
}
.desk-dd-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
}
.desk-dd-item.danger { color: #fca5a5; }
.desk-dd-item.danger:hover { background: rgba(239,68,68,.12); color: #fca5a5; }

.desk-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Backdrop für Dropdown */
.dropdown-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 8999;
}
.dropdown-backdrop.open { display: block; }

/* ── Karten-Trennlinie ────────────────────────────────────── */
.card-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Neue-Aufgabe Details (in Karte) ──────────────────────── */
.create-details { margin: 0; border-radius: 0; border-left: none; border-right: none; border-top: none; }
.create-details > summary { background: rgba(124,58,237,.05); }

/* ── Zuweisung-Modus Tabs ─────────────────────────────────── */
.assign-mode-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 0 12px;
}
.assign-tab {
  padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.assign-tab:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.assign-tab.active {
  background: rgba(124,58,237,.25);
  border-color: rgba(124,58,237,.55);
  color: #c4b5fd;
}

.assign-panel { margin-top: 0; }

/* ── Role- und User-Badges in Todo-Liste ──────────────────── */
.role-badge {
  display: inline-block;
  background: rgba(124,58,237,.2);
  color: #a78bfa;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 4px;
}
.assign-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 4px;
}
.user-badge  { background: rgba(34,211,238,.15); color: #67e8f9; }
.all-badge   { background: rgba(255,255,255,.08); color: var(--muted); }

/* Anzeige-Box gewählter Rollen */
.assign-display {
  padding: 8px 10px;
  background: rgba(124,58,237,.1);
  border-radius: 6px;
  min-height: 30px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}

/* ── Responsive: Mobile Layout ───────────────────────────── */
@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .desktop-nav { display: none; }
  main { padding: 24px 0 calc(80px + 24px); }
  .btn { padding: 8px 14px; font-size: 13px; }
  .card { margin: 0 0 16px; border-radius: 12px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 12px; }
  .form-row { padding: 12px 16px 0; flex-direction: column; }
  .field { flex: 1 !important; }
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
  input[type="date"], input[type="time"], select { padding: 12px; font-size: 16px; }
  .btn { padding: 12px 16px; font-size: 14px; }
  .card-header { padding: 12px 16px; }
  .todo-item { padding: 12px 16px; }
  main { padding: 16px 0 calc(80px + 16px); }
  details.menu-section > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .assign-mode-tabs { gap: 4px; }
  .assign-tab { padding: 6px 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .header-brand span { display: none; }
  .header-inner { padding: 10px 8px; }
  .nav-label { display: none; }
  .card-header h2 { font-size: 13px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
  input[type="date"], input[type="time"], select { font-size: 16px; padding: 12px; }
  .toolbar { flex-direction: column; gap: 8px; }
  .toolbar input[type="search"] { width: 100%; }
}

/* ── Todo: Status-Badges ──────────────────────────────────── */
.status-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
  flex-shrink: 0;
}
.status-offen     { background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid rgba(255,255,255,.1); }
.status-in_arbeit { background: rgba(234,179,8,.15);   color: #fde047;      border: 1px solid rgba(234,179,8,.25); }
.status-erledigt  { background: rgba(34,197,94,.12);   color: #86efac;      border: 1px solid rgba(34,197,94,.2); }

/* ── Todo: Titelzeile mit Status ──────────────────────────── */
.todo-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ── Todo: Footer (Erstellt / Claimed / Erledigt) ─────────── */
.todo-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.todo-meta-info           { font-size: 11px; color: var(--muted); }
.todo-meta-info.claimed   { color: #fde047; }
.todo-meta-info.done-info { color: #86efac; }
.todo-meta-info.due       { color: #f87171; }

/* ── Annehmen / Freigeben Button ──────────────────────────── */
.btn-claim {
  padding: 3px 10px;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.4);
  color: #c4b5fd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
  margin-left: auto;
}
.btn-claim:hover   { background: rgba(124,58,237,.38); }
.btn-unclaim       { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: var(--muted); }
.btn-unclaim:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* ── Todo-Item: Farbakzent je Status ─────────────────────── */
.todo-item.status-item.in_arbeit { border-left: 3px solid rgba(234,179,8,.55); }
.todo-item.status-item.erledigt  { opacity: .55; }
/* ═══════════════════════════════════════════════════════════
   EDIT MODAL
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface2, #1e1e2e);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  width: 100%; max-width: 540px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(.94) translateY(10px); }
  to   { opacity:1; transform: scale(1)  translateY(0);     }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.modal-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background .15s, color .15s;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); }
.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.modal-form-row .form-group { flex: 1; min-width: 140px; }

/* ═══════════════════════════════════════════════════════════
   DRAG & DROP
═══════════════════════════════════════════════════════════ */
.drag-handle {
  cursor: grab; font-size: 16px; color: var(--muted);
  padding: 4px 6px; border-radius: 6px; transition: color .15s, background .15s;
  flex-shrink: 0; align-self: flex-start; margin-top: 2px; user-select: none;
}
.drag-handle:hover  { color: var(--text); background: rgba(255,255,255,.08); }
.drag-handle:active { cursor: grabbing; }
.todo-item.dragging {
  opacity: .4; border: 2px dashed var(--accent, #a78bfa);
}
.todo-item.drag-over {
  border: 2px solid var(--accent, #a78bfa);
  background: rgba(124,58,237,.1);
}

/* ═══════════════════════════════════════════════════════════
   DONE ANIMATION
═══════════════════════════════════════════════════════════ */
@keyframes todoDone {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0   rgba(124,58,237,.6); }
  30%  { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(124,58,237,.3); }
  60%  { transform: scale(.99);  box-shadow: 0 0 0 20px rgba(124,58,237,.0); }
  100% { transform: scale(1);    box-shadow: none; }
}
.todo-done-anim {
  animation: todoDone .7s ease forwards;
}

/* ═══════════════════════════════════════════════════════════
   AKTION-BUTTONS (Bearbeiten / Löschen)
═══════════════════════════════════════════════════════════ */
.todo-actions {
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: flex-start;
  padding-left: 8px; flex-shrink: 0;
}
.btn-action {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: var(--muted); border-radius: 8px;
  width: 34px; height: 34px; padding: 0;
  font-size: 15px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  line-height: 1; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-action:hover { background: rgba(255,255,255,.12); color: var(--text); }
.btn-edit:hover   { border-color: #60a5fa; color: #60a5fa; }
.btn-attach:hover { border-color: #34d399; color: #34d399; }
.btn-delete:hover { border-color: #f87171; color: #f87171; }

/* ═══════════════════════════════════════════════════════════
   DATEI-ANHAENGE
═══════════════════════════════════════════════════════════ */
.todo-attachments {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.attachment-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 4px 10px;
  font-size: 12px; color: var(--text); text-decoration: none;
  transition: background .15s;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attachment-chip:hover { background: rgba(255,255,255,.13); }
.att-del {
  cursor: pointer; color: var(--muted); margin-left: 4px;
  font-size: 10px; padding: 1px 3px; border-radius: 3px;
}
.att-del:hover { color: #f87171; background: rgba(248,113,113,.1); }

/* ═══════════════════════════════════════════════════════════
   TODO-ITEM LAYOUT (drag-handle + actions)
═══════════════════════════════════════════════════════════ */
.todo-item {
  display: flex; gap: 0; align-items: flex-start;
}
.todo-check-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex-shrink: 0; padding-right: 8px; padding-top: 2px;
}
.todo-check-col .todo-spinner {
  margin-top: 6px;
}
.todo-check-wrap { display: flex; align-items: flex-start; flex-shrink: 0; }
.todo-body { flex: 1; min-width: 0; }

/* ── Fälligkeit-Warnung ──────────────────────────────── */
.due-info { color: var(--muted); }
.due-soon {
  background: rgba(234,179,8,.12);
  border: 1px solid rgba(234,179,8,.35);
  color: #fde047;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  animation: duePulse 1.4s ease-in-out infinite;
}
.due-very-soon {
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
  animation: duePulse .8s ease-in-out infinite;
}
@keyframes duePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

/* ── Kompakt-Datum mit Tooltip ───────────────────────── */
.todo-meta-date {
  cursor: help;
  border-bottom: 1px dotted rgba(255,255,255,.25);
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE MODAL (Bottom-Sheet)
═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box     {
    max-width: 100%; border-radius: 18px 18px 0 0;
    max-height: 90vh; animation: sheetIn .22s ease;
  }
  @keyframes sheetIn {
    from { transform: translateY(100%); }
    to   { transform: translateY(0);    }
  }
  .modal-form-row { flex-direction: column; }
  .modal-footer { justify-content: stretch; }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary { flex: 1; }
}

/* ══════════════════════════════════════════════════════════════
   KREISLADEBALKEN (In Arbeit)
══════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.todo-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(255,255,255,.1);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin .9s linear infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   DRAG-HANDLE VERSTECKEN (Funktion bleibt, Symbol weg)
══════════════════════════════════════════════════════════════ */
.drag-handle { display: none !important; }
.todo-item[draggable="true"] { cursor: default; }
.todo-item[draggable="true"]:not(:has(input:focus)):not(:has(button:focus)) {
  cursor: grab;
}
.todo-item.dragging { cursor: grabbing !important; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD HUB
══════════════════════════════════════════════════════════════ */
.dash-welcome {
  padding: 32px 0 24px;
}
.dash-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  color: var(--text);
}
.dash-sub {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding-bottom: 32px;
}

.hub-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 20px 18px;
  text-decoration: none;
  color: var(--text);
  transition: background .18s, border-color .18s, transform .15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.hub-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(130deg, rgba(124,58,237,.06), transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.hub-card:hover { background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.05)); border-color: rgba(124,58,237,.45); transform: translateY(-2px); }
.hub-card:hover::before { opacity: 1; }
.hub-card:active { transform: scale(.98); }

.hub-card-soon { cursor: default; opacity: .55; }
.hub-card-soon:hover { transform: none; border-color: rgba(255,255,255,.1); }
.hub-card-soon::before { display: none; }

.hub-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06);
  border-radius: 12px;
}
.hub-card-body { flex: 1; min-width: 0; }
.hub-card-title {
  font-size: 16px; font-weight: 650;
  color: var(--text); margin-bottom: 4px;
}
.hub-card-meta {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hub-card-arrow {
  font-size: 22px; color: var(--muted);
  flex-shrink: 0; transition: color .15s;
}
.hub-card:hover .hub-card-arrow { color: var(--accent); }
.hub-card-badge {
  font-size: 11px; font-weight: 700;
  background: rgba(234,179,8,.15);
  border: 1px solid rgba(234,179,8,.3);
  color: #fde047;
  padding: 3px 8px; border-radius: 20px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .hub-grid { grid-template-columns: 1fr; }
  .dash-welcome { padding: 20px 0 16px; }
}

/* -- ANHANG-VORSCHAU -------------------------------------- */
.att-thumb {
  width: 36px; height: 36px;
  object-fit: cover; border-radius: 5px;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.12);
}
.attachment-chip.att-has-thumb {
  align-items: center; gap: 8px; padding: 4px 10px 4px 6px;
}
.att-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}

/* -- PREVIEW MODAL ---------------------------------------- */
.preview-modal-box {
  max-width: 860px;
}
.preview-body {
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); border-radius: 0 0 16px 16px;
  min-height: 200px;
}
.preview-body img {
  max-width: 100%; max-height: 70vh; border-radius: 8px;
}
.preview-body iframe {
  width: 100%; height: 70vh; border: none; border-radius: 8px;
}
@media (max-width: 600px) {
  .preview-modal-box { max-width: 100%; }
  .att-name { max-width: 100px; }
}

/* ══ DATEI-DROPZONE ══════════════════════════════════════════ */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(255,255,255,.2);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 2;
}
.drop-zone .dz-label {
  font-size: 13px; color: var(--muted); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.drop-zone:hover, .drop-zone.dz-active {
  border-color: var(--accent);
  background: rgba(167,139,250,.07);
}
.drop-zone.dz-active .dz-label { color: var(--text); }

/* Aufgabenkarte als Ziel beim Datei-Droppen */
.todo-item.file-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  background: rgba(167,139,250,.09);
}
