:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #172b4d;
  --accent: #0052cc;
  --muted: #6b778c;
  --danger: #de350b;
  --ok: #00875a;
  --warn: #ff991f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
}

.brand { font-weight: 700; font-size: 1.1rem; }

#main-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  margin-right: 1rem;
}
#main-nav a.active { color: #fff; font-weight: 600; text-decoration: underline; }

#app { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.loading { color: var(--muted); font-style: italic; }

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.column {
  background: var(--panel);
  border-radius: 8px;
  padding: 0.75rem;
  border: 1px solid #dfe1e6;
}
.column h2 { font-size: 0.9rem; text-transform: uppercase; color: var(--muted); margin: 0.25rem 0 0.75rem; }

.task-card {
  background: var(--bg);
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.task-card:hover { border-color: var(--accent); }
.task-card .title { font-weight: 600; margin: 0 0 0.25rem; }
.task-card .meta { font-size: 0.75rem; color: var(--muted); display: flex; gap: 0.5rem; flex-wrap: wrap; }

.priority { border-radius: 3px; padding: 0 0.4rem; color: #fff; font-size: 0.7rem; }
.priority.high { background: var(--danger); }
.priority.medium { background: var(--warn); }
.priority.low { background: var(--ok); }

.tag-chip { background: #dfe1e6; border-radius: 999px; padding: 0 0.5rem; }

.new-task-form, .detail-panel, .settings-panel, .stats-panel {
  background: var(--panel);
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.field { margin-bottom: 0.75rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #c1c7d0;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-box {
  flex: 1 1 160px;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-align: center;
}
.stat-box .num { font-size: 1.8rem; font-weight: 700; }
.stat-box .label { color: var(--muted); font-size: 0.8rem; }

.bar { height: 10px; background: #dfe1e6; border-radius: 5px; overflow: hidden; margin-top: 0.25rem; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.error-panel { color: var(--danger); }
