:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-2: #16213a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --done: #22c55e;
  --border: #334155;
  --radius: 14px;

  /* dataviz: validated categorical slots against --bg (#0f172a), dark mode */
  --series-1: #3987e5; /* Andrija */
  --series-2: #199e70; /* Luka */
  --chart-grid: #2c2c2a;
  --chart-goal: #c3c2b7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
  border-bottom: 1px solid var(--border);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 1rem;
}
.chip {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
}
.progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}
.sync-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- main ---------- */
main { padding: 16px; max-width: 640px; margin: 0 auto; }
.section-title { font-size: 1.1rem; margin: 4px 0 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.btn-primary { background: var(--primary); color: white; }
.btn-done { background: var(--done); color: #06280f; }
.btn-copy { background: transparent; border: 1px solid var(--border); color: var(--text); margin-top: 8px; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.navbtn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  font-size: 0.72rem;
  cursor: pointer;
}
.navicon { font-size: 1.25rem; line-height: 1; }
.navbtn.active { color: var(--text); }
.navbtn.active .navicon { transform: scale(1.08); }

/* ---------- who screen ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
}
.overlay-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  width: 100%;
  max-width: 360px;
}
.who-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.who-btn { width: 100%; padding: 16px; font-size: 1.1rem; }

/* ---------- activity tab ---------- */
.activity-chart {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
}
.activity-chart svg { width: 100%; height: auto; display: block; }
.activity-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.85rem;
}
.activity-legend .legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.activity-caption { margin-top: 6px; min-height: 1.2em; }

.activity-table { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.activity-table-header, .activity-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 8px;
  align-items: center;
}
.activity-table-header { color: var(--muted); font-size: 0.8rem; padding: 0 4px; }
.activity-row {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.activity-row.is-today { border-color: var(--primary); }
.activity-date { font-size: 0.9rem; }
.activity-input {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 1rem;
  text-align: center;
}

/* ---------- card lists (New / In progress / Done) ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.filters input, .filters select {
  flex: 1;
  min-width: 120px;
}
input[type="search"] {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 1rem;
}

.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-title { font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions .btn { flex: 1; min-width: 90px; padding: 10px 12px; font-size: 0.9rem; }
