:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 520px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 28px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Add Form */
.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.add-form input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-form input[type="text"]:focus {
  border-color: var(--primary);
}

.add-form input[type="number"] {
  width: 64px;
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  text-align: center;
  outline: none;
}

.add-form input[type="number"]:focus {
  border-color: var(--primary);
}

.btn-add {
  padding: 12px 20px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--primary-hover);
}

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn, .btn-clear {
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover, .btn-clear:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-clear {
  margin-left: auto;
  color: var(--danger);
  border-color: var(--border);
}

.btn-clear:hover {
  background: var(--danger-hover);
  color: #fff;
  border-color: var(--danger-hover);
}

/* List */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  animation: slideIn 0.3s ease;
}

.list-item:hover {
  background: var(--surface-hover);
}

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

/* Checkbox */
.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkbox:hover {
  border-color: var(--primary);
}

.list-item.done .checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.list-item.done .checkbox::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.item-name {
  flex: 1;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.item-qty {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

/* Empty State */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 40px 0;
  list-style: none;
}

/* Stats */
.stats {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Animations */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.list-item.removing {
  animation: slideOut 0.25s ease forwards;
}

@keyframes slideOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* Responsive */
@media (max-width: 480px) {
  body { padding: 12px; }
  header h1 { font-size: 1.6rem; }
  .add-form input[type="number"] { width: 52px; }
}
