:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); margin-top: .5rem; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary-hover); }
.stat-label { color: var(--muted); font-size: .85rem; }

.add-form {
  display: flex;
  gap: .6rem;
  margin-bottom: 2rem;
}
.add-form input[type="text"] {
  flex: 1;
  padding: .8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}
.add-form select {
  padding: .8rem;
  border-radius: 10px;
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
}
.add-form button {
  padding: .8rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.add-form button:hover { background: var(--primary-hover); }

.task-list { display: flex; flex-direction: column; gap: .7rem; }
.loading { color: var(--muted); text-align: center; padding: 2rem; }

.task {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-left: 4px solid var(--surface-2);
  border-radius: 12px;
  padding: .9rem 1rem;
  transition: transform .15s, opacity .2s;
}
.task:hover { transform: translateX(3px); }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.task.prio-high { border-left-color: var(--red); }
.task.prio-medium { border-left-color: var(--yellow); }
.task.prio-low { border-left-color: var(--green); }

.task-check {
  width: 22px; height: 22px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.task-title { flex: 1; }
.task-badge {
  font-size: .7rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  text-transform: uppercase;
}
.task-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color .2s;
}
.task-del:hover { color: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 2rem; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 1.5rem;
}

@media (max-width: 520px) {
  .add-form { flex-wrap: wrap; }
  .add-form input[type="text"] { flex: 1 1 100%; }
}
