/* ═══════════════════════════════════════════════════════════
   R2 Eksamensplan – Dark theme stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:        #0f1117;
  --card-bg:   #1a1d27;
  --card-bg2:  #21253a;
  --border:    #2a2f45;
  --accent:    #6c63ff;
  --accent-lt: #8c85ff;
  --success:   #2ecc71;
  --warning:   #f39c12;
  --danger:    #e74c3c;
  --text:      #e8eaf6;
  --text-muted:#8892a4;
  --text-dim:  #5a6175;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --transition:0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 2rem;
  background: rgba(26, 29, 39, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav-logo {
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
}

.nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.nav-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover { color: var(--text); background: var(--card-bg2); }
.nav-link.active { color: var(--accent); background: rgba(108, 99, 255, 0.12); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.7rem;
}

.countdown-num { font-size: 1.2rem; font-weight: 800; color: var(--accent-lt); line-height: 1.2; }
.countdown-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.nav-user {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-logout {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: color var(--transition);
}

.nav-logout:hover { color: var(--danger); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0.3rem;
}

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  gap: 0.25rem;
}

.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu .nav-link { padding: 0.6rem 0.85rem; }

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ══════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════ */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-lt), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.page-sub {
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-size: 1rem;
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.card:hover { border-color: rgba(108, 99, 255, 0.3); }
.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-lt); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--accent-lt);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(108,99,255,0.12); }

.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-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════ */
.progress-wrap { margin-top: 1rem; }

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar.big { height: 14px; border-radius: 7px; }

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.full-width { grid-column: 1 / -1; }

/* ══════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════ */
.flash {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.flash-error { background: rgba(231, 76, 60, 0.2); color: #ff7675; border-bottom: 1px solid rgba(231,76,60,0.4); }
.flash-success { background: rgba(46, 204, 113, 0.2); color: #55efc4; border-bottom: 1px solid rgba(46,204,113,0.4); }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  min-width: 220px;
}

.toast.success { border-left: 3px solid var(--success); color: #55efc4; }
.toast.error   { border-left: 3px solid var(--danger);  color: #ff7675; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(1rem); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container { width: 100%; max-width: 420px; padding: 1.5rem; }

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-icon {
  font-size: 3.5rem;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-lt), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 1.1rem;
  color: var(--text);
  margin-top: 0.25rem;
  font-weight: 500;
}

.login-exam-date {
  font-size: 0.85rem;
  color: var(--accent-lt);
  margin: 0.4rem 0 1.5rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.login-form { text-align: left; display: flex; flex-direction: column; gap: 1rem; }

.login-footer {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ══════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════ */

/* Countdown hero */
.countdown-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: linear-gradient(135deg, #1a1d27 0%, #1e1a3a 100%);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.1);
}

.countdown-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(108, 99, 255, 0.12);
  border: 2px solid rgba(108, 99, 255, 0.4);
  border-radius: 50%;
  width: 140px;
  height: 140px;
  justify-content: center;
  flex-shrink: 0;
}

.countdown-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-lt);
  line-height: 1;
}

.countdown-big-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.countdown-meta { flex: 1; }

.countdown-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.countdown-quote {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Level card */
.level-card { text-align: center; }

.level-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
  color: #fff;
}

.level-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-lt);
  margin: 0.25rem 0 0.1rem;
}

.level-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.level-controls {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.level-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.level-btn:hover { border-color: var(--accent); color: var(--accent-lt); }
.level-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Emne summary */
.emne-summary-card { display: flex; flex-direction: column; gap: 1rem; }

.emne-dots {
  display: flex;
  gap: 1rem;
  justify-content: space-around;
  flex: 1;
}

.emne-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.dot-count {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.dot-label { font-size: 0.75rem; color: var(--text-muted); }

.emne-dot.red .dot-count   { color: var(--danger); }
.emne-dot.yellow .dot-count { color: var(--warning); }
.emne-dot.green .dot-count  { color: var(--success); }

/* Weekly grid */
.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.week-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  transition: all var(--transition);
}

.week-chip.current { border-color: var(--accent); background: rgba(108,99,255,0.08); }
.week-chip.done    { border-color: var(--success); background: rgba(46,204,113,0.06); }

.week-chip-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.week-chip-num { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.week-chip-pct { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.week-chip.done .week-chip-pct { color: var(--success); }
.week-chip.current .week-chip-pct { color: var(--accent-lt); }

.week-chip-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.week-chip-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.week-chip.done .week-chip-fill { background: var(--success); }

.week-chip-count { font-size: 0.7rem; color: var(--text-dim); }

/* Recent activity */
.recent-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.recent-check {
  color: var(--success);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }

.recent-short {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-dato {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.recent-time { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }

.empty-card { text-align: center; color: var(--text-muted); }
.empty-card a { color: var(--accent-lt); }

/* ══════════════════════════════════════════
   PLAN PAGE
══════════════════════════════════════════ */
.week-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color var(--transition);
}

.week-block:hover { border-color: rgba(108,99,255,0.25); }
.week-block.week-current { border-color: rgba(108,99,255,0.5); }
.week-block.week-done { border-color: rgba(46,204,113,0.4); }
.week-block.week-future { opacity: 0.75; }

.week-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  gap: 1rem;
}

.week-summary::-webkit-details-marker { display: none; }

.week-summary:hover { background: rgba(255,255,255,0.02); }

.week-summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.week-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.week-badge.done    { background: rgba(46,204,113,0.15); color: var(--success); }
.week-badge.current { background: rgba(108,99,255,0.2); color: var(--accent-lt); }
.week-badge.future  { background: rgba(90,97,117,0.2); color: var(--text-dim); }
.week-badge.partial { background: rgba(243,156,18,0.15); color: var(--warning); }

.week-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.week-date-range {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.week-summary-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.week-progress-text { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

.week-mini-bar {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.week-mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.week-block.week-done .week-mini-fill { background: var(--success); }

/* Task rows */
.week-tasks {
  border-top: 1px solid var(--border);
  padding: 0.5rem;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  position: relative;
}

.task-row:hover { background: rgba(255,255,255,0.025); }
.task-row.task-done { opacity: 0.65; }
.task-row.task-done:hover { opacity: 0.85; }

/* Checkbox */
.task-check-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
}

.task-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.task-checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: all var(--transition);
  cursor: pointer;
}

.task-checkbox:checked + .task-checkmark {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox:checked + .task-checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.task-check-wrap:hover .task-checkmark {
  border-color: var(--success);
}

/* Task body */
.task-body { flex: 1; min-width: 0; }

.task-header-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.task-dato {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.task-short {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
}

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

.task-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
  line-height: 1.5;
}

.task-tips {
  font-size: 0.82rem;
  color: var(--warning);
  margin: 0.35rem 0;
  font-style: italic;
}

.task-note-wrap { margin-top: 0.4rem; }

.task-note-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
  width: 100%;
  transition: border-color var(--transition);
}

.task-note-input:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
}

.task-note-input::placeholder { color: var(--text-dim); }

.task-done-mark {
  color: var(--success);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   KARTLEGGING
══════════════════════════════════════════ */
.kartlegging-overview {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.ko-left { flex-shrink: 0; text-align: center; }

.ko-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
}

.ko-num.green { color: var(--success); }

.ko-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ko-bar-wrap { flex: 1; }

/* Emne groups */
.emne-group { padding: 1.25rem 1.5rem; }

.emne-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.emne-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-lt);
}

.emne-group-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.emne-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: all var(--transition);
  flex-wrap: wrap;
}

.emne-row:hover { background: rgba(255,255,255,0.025); }

.emne-status-ikke_startet { border-left-color: var(--danger); }
.emne-status-jobber       { border-left-color: var(--warning); }
.emne-status-kan          { border-left-color: var(--success); background: rgba(46,204,113,0.04); }

.emne-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
  min-width: 180px;
}

.emne-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-selector { display: flex; gap: 0.3rem; }

.status-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
  background: var(--bg);
  color: var(--text-muted);
}

.status-btn:hover { color: var(--text); }

.status-btn.red.active   { background: rgba(231,76,60,0.15); color: var(--danger);  border-color: var(--danger); }
.status-btn.yellow.active { background: rgba(243,156,18,0.15); color: var(--warning); border-color: var(--warning); }
.status-btn.green.active  { background: rgba(46,204,113,0.15); color: var(--success); border-color: var(--success); }

.emne-note-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.15rem 0.3rem;
  width: 160px;
  transition: border-color var(--transition);
}

.emne-note-input:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text);
}

/* ══════════════════════════════════════════
   EKSAMENSSETT
══════════════════════════════════════════ */
.eksamen-grid {
  display: grid;
  gap: 1.25rem;
}

.eksamen-card { padding: 1.5rem; }

.eksamen-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.eksamen-navn {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.eksamen-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.eksamen-score {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.score-green { background: rgba(46,204,113,0.12); border: 1px solid rgba(46,204,113,0.3); }
.score-yellow { background: rgba(243,156,18,0.12); border: 1px solid rgba(243,156,18,0.3); }
.score-red { background: rgba(231,76,60,0.12); border: 1px solid rgba(231,76,60,0.3); }

.score-big {
  font-size: 1.8rem;
  font-weight: 800;
}

.score-green .score-big { color: var(--success); }
.score-yellow .score-big { color: var(--warning); }
.score-red .score-big { color: var(--danger); }

.score-label { font-size: 0.82rem; color: var(--text-muted); }

.eksamen-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.eksamen-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.eksamen-updated {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
  }

  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-hamburger { display: block; }

  .main-content { padding: 1.25rem 1rem 3rem; }

  .page-title { font-size: 1.5rem; }

  .countdown-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .countdown-circle { width: 100px; height: 100px; align-self: center; }
  .countdown-big { font-size: 2rem; }

  .stats-row { grid-template-columns: 1fr; }

  .weeks-grid { grid-template-columns: repeat(3, 1fr); }

  .week-summary { flex-wrap: wrap; gap: 0.5rem; }
  .week-summary-right { order: 3; width: 100%; }
  .week-mini-bar { flex: 1; }

  .kartlegging-overview { flex-direction: column; gap: 1rem; }

  .emne-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .eksamen-form-grid { grid-template-columns: 1fr; }
  .eksamen-card-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .weeks-grid { grid-template-columns: repeat(2, 1fr); }
  .status-selector { flex-wrap: wrap; }
  .status-btn { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
}

/* ══════════════════════════════════════════
   GAMING / LEVEL UP / BOUNTIES / CHARTS
══════════════════════════════════════════ */

/* Countdown ring */
.countdown-hero { position: relative; }
.countdown-circle { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.countdown-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg  { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
             transition: stroke-dashoffset 1s ease; }
.countdown-inner { position: absolute; inset: 0; display: flex; flex-direction: column;
                   align-items: center; justify-content: center; }

/* Level display */
.level-display { display: flex; align-items: center; gap: 1.2rem; margin: 0.75rem 0 1rem; }
.level-badge-big { width: 72px; height: 72px; border-radius: 50%; display: flex;
                   flex-direction: column; align-items: center; justify-content: center;
                   font-weight: 800; box-shadow: 0 0 24px rgba(108,99,255,0.4);
                   flex-shrink: 0; }
.level-emoji { font-size: 1.6rem; line-height: 1; }
.level-num-big { font-size: 0.75rem; font-weight: 700; opacity: 0.8; }

.level-color-0 { background: linear-gradient(135deg, #3a3d4e, #2a2d3e); }
.level-color-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.level-color-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.level-color-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.level-color-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.level-color-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.level-color-6 { background: linear-gradient(135deg, #ffd700, #ff8c00);
                 box-shadow: 0 0 32px rgba(255,215,0,0.5); animation: glow 2s ease-in-out infinite alternate; }

@keyframes glow {
  from { box-shadow: 0 0 16px rgba(255,215,0,0.4); }
  to   { box-shadow: 0 0 40px rgba(255,215,0,0.8); }
}

.level-name-big  { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.level-desc-small { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.bounty-badge { margin-top: 6px; font-size: 0.75rem; color: var(--warning);
                background: rgba(243,156,18,0.12); border: 1px solid rgba(243,156,18,0.3);
                border-radius: 20px; padding: 3px 10px; display: inline-block; }

/* Level selector */
.level-selector { display: flex; align-items: center; gap: 6px; margin-top: 1rem; flex-wrap: wrap; }
.level-selector-label { font-size: 0.75rem; color: var(--text-muted); }
.level-btn { background: var(--card-bg2); border: 1px solid var(--border); color: var(--text-muted);
             border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 0.75rem;
             transition: all 0.2s; }
.level-btn:hover { border-color: var(--accent); color: var(--text); }
.level-btn.active { background: var(--accent); border-color: var(--accent); color: #fff;
                    box-shadow: 0 0 12px rgba(108,99,255,0.4); }

/* Progress bar animated */
.progress-fill.animated { transition: width 1s cubic-bezier(.4,0,.2,1); }

/* Charts */
.chart-card  { min-width: 0; }
.chart-wrap-sm   { height: 180px; display: flex; align-items: center; justify-content: center; }
.chart-wrap-full { height: 220px; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .charts-row { grid-template-columns: 1fr; } }

/* Emne legend */
.emne-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
               font-size: 0.8rem; margin-top: 10px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot.green  { background: #2ecc71; }
.legend-dot.yellow { background: #f39c12; }
.legend-dot.red    { background: #e74c3c; }

/* Bounties grid */
.bounties-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
                 gap: 0.75rem; margin-top: 0.5rem; }
.bounty-card { border-radius: var(--radius); padding: 1rem; border: 1px solid var(--border);
               background: var(--card-bg2); transition: all 0.2s; }
.bounty-card.unlocked { border-color: var(--success); background: rgba(46,204,113,0.06); }
.bounty-card.locked   { opacity: 0.55; }
.bounty-card.unlocked:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(46,204,113,0.15); }
.bounty-level  { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.bounty-title  { font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.bounty-reward { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.bounty-status.earned    { font-size: 0.75rem; color: var(--success); font-weight: 600; }
.bounty-status.locked-txt{ font-size: 0.75rem; color: var(--text-dim); }

/* ── Level-up overlay ──────────────────────────────────────── */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.levelup-box {
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  z-index: 10000;
  box-shadow: 0 0 80px rgba(108,99,255,0.4);
  animation: popIn 0.5s cubic-bezier(.34,1.56,.64,1);
  max-width: 360px; width: 90%;
}
@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.levelup-emoji { font-size: 4rem; margin-bottom: 0.5rem; animation: bounce 0.8s ease infinite alternate; }
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}
.levelup-text  { font-size: 1rem; font-weight: 700; letter-spacing: 4px;
                 color: var(--accent); text-transform: uppercase; margin-bottom: 0.5rem; }
.levelup-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.levelup-bounty { font-size: 0.9rem; color: var(--warning); background: rgba(243,156,18,0.1);
                  border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 1.5rem; }

/* Confetti */
.confetti-container { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9998; }
.confetti-piece {
  position: absolute; top: -20px;
  width: 10px; height: 10px; border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Readonly banner */
.readonly-banner {
  background: rgba(243,156,18,0.12);
  border-bottom: 1px solid rgba(243,156,18,0.3);
  color: var(--warning);
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
}
