:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(17, 24, 39, 0.9);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5eefb;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-2: #22c55e;
  --danger: #f87171;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.22), transparent 30%),
    linear-gradient(180deg, #111827 0%, #020617 100%);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(12px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 48ch;
}

.stats {
  display: flex;
  gap: 12px;
}

.stats div {
  min-width: 92px;
  text-align: center;
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.stats span {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
}

.stats small,
.empty-state {
  color: var(--muted);
}

.todo-form {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input, button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
}

input:focus {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  font-weight: 700;
}

button.ghost,
.filter {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.toolbar {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter.active {
  border-color: rgba(96, 165, 250, 0.8);
  color: #bfdbfe;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--muted);
}

.todo-check {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-2);
}

.todo-text {
  overflow-wrap: anywhere;
}

.delete-btn {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.18);
}

.empty-state {
  margin: 18px 0 0;
  text-align: center;
}

@media (max-width: 640px) {
  .card { padding: 20px; }
  .header-row { flex-direction: column; }
  .stats { width: 100%; }
  .stats div { flex: 1; }
  .todo-form { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
}
