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

/* ── Theme variables ── */
:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface2: #f0efec;
  --border: rgba(0,0,0,0.10);
  --border-light: rgba(0,0,0,0.06);
  --text: #1c1c1a;
  --text-secondary: #666;
  --text-muted: #aaa;
  --accent: #1785D8;
  --accent-hover: #1270b8;
  --success-bg: #f0fdf9;
  --success-border: #0f6e56;
  --success-text: #0f6e56;
  --mod-done-bg: rgba(15,110,86,0.04);
  --hover: rgba(0,0,0,0.025);
  --track-bg: #e8e8e4;
  --badge-bg: #e6f1fb;
  --badge-text: #185fa5;
  --shadow: 0 1px 3px rgba(0,0,0,0.07);
  --error-bg: #fef2f2;
  --error-border: #e24b4a;
  --error-text: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a18;
    --surface: #2a2a28;
    --surface2: #323230;
    --border: rgba(255,255,255,0.10);
    --border-light: rgba(255,255,255,0.06);
    --text: #e8e8e4;
    --text-secondary: #999;
    --text-muted: #666;
    --accent: #3399e8;
    --accent-hover: #2880c8;
    --success-bg: #04342c;
    --success-border: #1d9e75;
    --success-text: #5dcaa5;
    --mod-done-bg: rgba(29,158,117,0.06);
    --hover: rgba(255,255,255,0.04);
    --track-bg: #3a3a38;
    --badge-bg: #0c447c;
    --badge-text: #85b7eb;
    --shadow: none;
    --error-bg: #3b1111;
    --error-border: #e24b4a;
    --error-text: #f87171;
  }
}

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

/* ── Badge ── */
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Loading / empty ── */
.loading { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); font-size: 14px; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 14px; }

/* ── User bar ── */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 0.75rem;
  font-size: 12px;
  color: var(--text-muted);
}
.user-email { font-weight: 500; color: var(--text-secondary); }
.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.logout-btn:hover { background: var(--hover); color: var(--text); }

/* ── Header ── */
.hdr { padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.hdr-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.course-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.course-name { font-size: 22px; font-weight: 600; color: var(--text); }
