:root {
  --bg: #0b1020;
  --card: #141b2f;
  --border: #253052;
  --text: #e8ecf7;
  --muted: #8f9bb8;
  --accent: #4ade80;
  --accent-ink: #06230f;
  --danger: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(70rem 40rem at 15% -10%, #1b2a5a 0%, transparent 60%),
    radial-gradient(50rem 30rem at 110% 10%, #123d33 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 40px 20px 64px;
}

.wrap { width: min(760px, 100%); margin: 0 auto; }

.head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

.stats { display: flex; gap: 8px; }
.pill {
  background: #16203a;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.pill b { color: var(--text); font-variant-numeric: tabular-nums; }

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

.form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }

input {
  width: 100%;
  background: #0e1428;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: #64708f; }
input:focus { border-color: #4a5c96; box-shadow: 0 0 0 3px #4a5c962e; }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

#submit {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 11px 20px;
  white-space: nowrap;
}

.filters { display: flex; gap: 8px; margin: 20px 0 12px; }
.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 500;
}
.chip.is-active { background: #1d2a4d; border-color: #3b4f85; color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  animation: pop 0.18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.check {
  appearance: none;
  width: 22px; height: 22px;
  margin: 2px 0 0;
  border: 1.5px solid #4a5c96;
  border-radius: 7px;
  background: #0e1428;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after { content: "✓"; color: var(--accent-ink); font-size: 14px; font-weight: 900; }

.note-title { font-weight: 600; word-break: break-word; }
.note-body { margin: 3px 0 0; color: var(--muted); font-size: 0.9rem; word-break: break-word; }
.item.is-done .note-title { color: var(--muted); text-decoration: line-through; }

.del {
  background: transparent;
  border: 1px solid transparent;
  color: #71393f;
  padding: 4px 8px;
  font-size: 1.05rem;
  line-height: 1;
}
.item:hover .del { color: var(--danger); border-color: #4a2530; }

.empty { text-align: center; color: var(--muted); padding: 34px 0; }

.foot {
  margin-top: 26px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #6b779a;
  font-size: 0.8rem;
}
.dot::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #64708f;
}
.dot.ok::before { background: var(--accent); box-shadow: 0 0 8px #4ade8088; }
.dot.bad::before { background: var(--danger); }
.foot .ver { margin-left: auto; font-variant-numeric: tabular-nums; color: #8f9bb8; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(8px);
  background: #2b1a1d;
  border: 1px solid #5d2c33;
  color: #ffd9d9;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .form { grid-template-columns: 1fr; }
  #submit { width: 100%; }
}
