:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --line: #2a3542;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d8bfd;
  --doing: #2f9e6b;
  --idle: #9a7b3c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a3d, var(--bg));
  color: var(--text);
  min-height: 100vh;
  padding: 24px clamp(16px, 3vw, 40px) 60px;
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
}
h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 650; }
.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
}
.stats .doing b { color: var(--doing); }
.stats .idle b { color: var(--idle); }
.logout { margin-left: 8px; }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.filters a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.filters a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.list {
  display: grid;
  gap: 14px;
  max-width: 920px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 14px;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease;
}
.card.removing {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
.card.status-doing { border-left: 3px solid var(--doing); }
.card.status-not_doing { border-left: 3px solid var(--idle); }
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 600;
}
.badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.doing { background: rgba(47,158,107,.18); color: #6ddeb0; }
.badge.not_doing { background: rgba(154,123,60,.2); color: #e0c280; }
.desc { margin: 10px 0; color: #c5d0db; line-height: 1.45; }
.source { margin: 8px 0; color: var(--muted); font-size: 0.9rem; }
.source pre {
  white-space: pre-wrap;
  background: #121820;
  border-radius: 8px;
  padding: 10px;
  color: #b7c4d2;
  font-size: 0.85rem;
}
.meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 8px 0 12px;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
button, .primary {
  border: 1px solid var(--line);
  background: #243041;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
button.primary, .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.danger {
  background: transparent;
  border-color: #6a3038;
  color: #ff8f9a;
}
button.danger:hover {
  background: rgba(180, 60, 70, 0.2);
  border-color: #c45a66;
}
.progress-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.progress-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}
.progress-form input[type=range] { width: 140px; }
.progress-form output { min-width: 2ch; color: var(--text); font-weight: 600; }
.bar {
  margin-top: 12px;
  height: 6px;
  background: #121820;
  border-radius: 999px;
  overflow: hidden;
}
.bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5ad1a0);
}
.client-progress {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}
.client-progress b { color: var(--text); }

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}
.login-box {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  display: grid;
  gap: 12px;
}
.login-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121820;
  color: var(--text);
  font: inherit;
}
.error { color: #ff8f8f; margin: 0; }

@media (max-width: 640px) {
  .controls { flex-direction: column; align-items: stretch; }
  .progress-form { justify-content: space-between; }
}
