:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --text: #222;
  --muted: #666;
  --accent: #4f46e5;
  --danger: #e11d48;
  --shadow: 0 6px 18px rgba(32, 33, 36, 0.06);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  padding: 24px;
}

/* Dark theme */
body.dark {
  --bg: #0b1221;
  --panel: #0f1724;
  --text: #e6eef8;
  --muted: #9aa7bf;
  --accent: #7c3aed;
  --danger: #fb7185;
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}

.app {
  width: 100%;
  max-width: 720px;
  background: transparent;
}

.todo-panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}
.theme-toggle {
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.04);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.theme-toggle:focus,
.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

body.dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.04);
}

.todo-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.todo-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}
body.dark .todo-input {
  border-color: rgba(255, 255, 255, 0.04);
}
.add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* List */
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}
.todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
body.dark .todo-list li {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border-color: rgba(255, 255, 255, 0.03);
}

.todo-list li .todo-text {
  flex: 1;
  word-break: break-word;
}
.completed .todo-text {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.6;
}

/* Completed tasks: force SVG stroke + opacity */
.todo-list li.completed svg {
  stroke: var(--muted) !important;
  opacity: 0.6 !important;
}

.actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
}
.actions button {
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.actions button:hover {
  background: rgba(0, 0, 0, 0.04);
}
body.dark .actions button:hover {
  background: rgba(255, 255, 255, 0.02);
}

.todo-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}
.filters {
  display: flex;
  gap: 8px;
}
.filter-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
.hint {
  font-size: 0.85rem;
  opacity: 0.9;
}

.dragging {
  opacity: 0.5;
}
.drag-over {
  outline: 2px dashed rgba(79, 70, 229, 0.18);
  border-radius: 8px;
}

/* Small screens */
@media (max-width: 480px) {
  .title {
    font-size: 1rem;
  }
  .add-btn {
    padding: 9px;
  }
}
