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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3352;
  --accent: #6366f1;
  --accent-hover: #4f52d9;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
}

.logo-icon { font-size: 20px; }

.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-loading { background: var(--surface2); color: var(--text-muted); }
.badge-ok { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-error { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

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

.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

.form-row {
  display: flex;
  gap: 10px;
}

input[type="text"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}

input[type="text"]:focus { border-color: var(--accent); }
input[type="text"]::placeholder { color: var(--text-muted); }

select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

.btn {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.task-header h2 { margin-bottom: 0; }

.filters { display: flex; gap: 6px; }

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.filter-btn:hover { color: var(--text); border-color: var(--text-muted); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

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

.task-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .15s;
}

.task-item:hover { border-color: #3e4570; }

.task-title {
  flex: 1;
  font-size: 14px;
}

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

.tag {
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.tag-todo { background: rgba(59,130,246,.15); color: var(--blue); }
.tag-in-progress { background: rgba(234,179,8,.15); color: var(--yellow); }
.tag-done { background: rgba(34,197,94,.15); color: var(--green); }

.tag-high { background: rgba(239,68,68,.12); color: var(--red); }
.tag-medium { background: rgba(234,179,8,.12); color: var(--yellow); }
.tag-low { background: rgba(34,197,94,.12); color: var(--green); }

.task-actions { display: flex; gap: 6px; }

.status-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.empty-msg { text-align: center; color: var(--text-muted); padding: 32px 0; font-size: 14px; }
.hidden { display: none; }

@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-wrap: wrap; }
  .task-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
