/* ===== BOUNTY — GAMIFIED JOB BOARD ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg: #0b0c14;
  --surface: #13151f;
  --surface-2: #1a1d2e;
  --surface-3: #20243a;
  --border: #252840;
  --text: #e8eaf8;
  --text-dim: #8890c4;
  --text-faint: #454a72;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --accent-3: #f59e0b;
  --accent-ink: #ffffff;
  --accent-soft: #1e1545;
  --accent-glow: rgba(124,58,237,0.35);
  --green: #10b981;
  --green-soft: #052e1c;
  --amber: #f59e0b;
  --amber-soft: #3d1f02;
  --red: #ef4444;
  --red-soft: #3c0a0a;
  --gray-soft: #1a1d2e;
  --pts-low: #60a5fa;    --pts-low-soft: #0c1f3f;
  --pts-mid: #10b981;    --pts-mid-soft: #052e1c;
  --pts-high: #f59e0b;   --pts-high-soft: #3d1f02;
  --pts-top: #ef4444;    --pts-top-soft: #3c0a0a;
  --shadow: 0 2px 8px rgba(0,0,0,0.6), 0 8px 32px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 24px rgba(124,58,237,0.25), 0 20px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(124,58,237,0.25);
  --radius: 14px;
  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

/* Light mode override */
:root[data-theme="light"] {
  --bg: #f0eff8;
  --surface: #ffffff;
  --surface-2: #f5f3ff;
  --surface-3: #ede9ff;
  --border: #ddd8f5;
  --text: #1a1535;
  --text-dim: #4e4780;
  --text-faint: #8b85b8;
  --accent: #6d28d9;
  --accent-soft: #ede9ff;
  --accent-glow: rgba(109,40,217,0.18);
  --green: #059669;
  --green-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --gray-soft: #ede9ff;
  --pts-low: #2563eb;    --pts-low-soft: #dbeafe;
  --pts-mid: #059669;    --pts-mid-soft: #d1fae5;
  --pts-high: #b45309;   --pts-high-soft: #fef3c7;
  --pts-top: #dc2626;    --pts-top-soft: #fee2e2;
  --shadow: 0 1px 4px rgba(80,40,180,0.08), 0 6px 24px rgba(80,40,180,0.10);
  --shadow-hover: 0 4px 16px rgba(80,40,180,0.18), 0 20px 48px rgba(80,40,180,0.14);
  --shadow-glow: 0 0 24px rgba(109,40,217,0.18);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f0eff8; --surface: #ffffff; --surface-2: #f5f3ff; --surface-3: #ede9ff;
    --border: #ddd8f5; --text: #1a1535; --text-dim: #4e4780; --text-faint: #8b85b8;
    --accent: #6d28d9; --accent-soft: #ede9ff; --accent-glow: rgba(109,40,217,0.18);
    --green: #059669; --green-soft: #d1fae5; --amber: #b45309; --amber-soft: #fef3c7;
    --red: #dc2626; --red-soft: #fee2e2; --gray-soft: #ede9ff;
    --pts-low: #2563eb; --pts-low-soft: #dbeafe; --pts-mid: #059669; --pts-mid-soft: #d1fae5;
    --pts-high: #b45309; --pts-high-soft: #fef3c7; --pts-top: #dc2626; --pts-top-soft: #fee2e2;
    --shadow: 0 1px 4px rgba(80,40,180,0.08), 0 6px 24px rgba(80,40,180,0.10);
    --shadow-hover: 0 4px 16px rgba(80,40,180,0.18), 0 20px 48px rgba(80,40,180,0.14);
    --shadow-glow: 0 0 24px rgba(109,40,217,0.18);
  }
}

/* ── Reset + Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Layout ── */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 60px; }

.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ── Header ── */
.top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  transition: background var(--transition);
}
@media (max-width: 680px) { .top { flex-direction: column; gap: 12px; } }

.top h1 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sub {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 4px;
}
.board-meta-row { margin-top: 6px; }
.identity-line {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.identity-line b { color: var(--text); }
#changeNameBtn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
  font-family: inherit;
}

/* ── Stats Bar ── */
.stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  min-width: 70px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stat:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.stat .n {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat .l { font-size: 10px; color: var(--text-faint); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Banner ── */
.banner {
  display: none;
  background: linear-gradient(90deg, var(--amber-soft), transparent);
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}
.banner.show { display: block; }

/* ── Board Tabs ── */
.board-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.board-tab {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.board-tab:hover { border-color: var(--accent); color: var(--text); }
.board-tab.active {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.board-tab-add {
  background: rgba(124, 58, 237, 0.12) !important;
  border: 1px dashed var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
.board-tab-add:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filter-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
#sortSelect {
  margin-left: auto;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
#sortSelect:hover { border-color: var(--accent); }

/* ── Vertical Bar ── */
.vertical-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.vb-label { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; align-self: center; }
.vertical-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
}
.vertical-pill:hover { border-color: var(--accent); color: var(--text); }
.vertical-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ── Legend ── */
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-faint);
}
.legend span { display: flex; align-items: center; gap: 5px; }
.legend span span { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Board Grid ── */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 15px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.card:hover::before { opacity: 1; }

/* Card tier variants */
.card.pts-low-card { border-left: 3px solid var(--pts-low); }
.card.pts-mid-card { border-left: 3px solid var(--pts-mid); }
.card.pts-high-card { border-left: 3px solid var(--pts-high); }
.card.pts-top-card {
  border-left: 3px solid var(--pts-top);
  box-shadow: var(--shadow), 0 0 20px rgba(239,68,68,0.12);
}
.card.pb-applied-card { border-left: 3px solid var(--text-faint); opacity: 0.7; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-top h3 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}
.desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  white-space: pre-wrap;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.assignee-line {
  font-size: 12px;
  color: var(--text-faint);
}
.assignee-line b { color: var(--text-dim); }
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Points Badges ── */
.points-badge {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.points-badge.pending { background: var(--gray-soft); color: var(--text-faint); border: 1px solid var(--border); }
.points-badge.pts-low { background: var(--pts-low-soft); color: var(--pts-low); border: 1px solid var(--pts-low); }
.points-badge.pts-mid { background: var(--pts-mid-soft); color: var(--pts-mid); border: 1px solid var(--pts-mid); }
.points-badge.pts-high { background: var(--pts-high-soft); color: var(--pts-high); border: 1px solid var(--pts-high); }
.points-badge.pts-top {
  background: linear-gradient(135deg, var(--pts-top-soft), #4a0a0a);
  color: var(--pts-top);
  border: 1px solid var(--pts-top);
  box-shadow: 0 0 10px rgba(239,68,68,0.3);
  animation: pulse-red 2s ease-in-out infinite;
}
.points-badge.sb-badge {
  background: linear-gradient(135deg, #2d1b69, #1e1545);
  color: #a78bfa;
  border: 1px solid #7c3aed;
  box-shadow: 0 0 10px rgba(124,58,237,0.35);
  animation: pulse-purple 2s ease-in-out infinite;
}

/* ── Status Pills ── */
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.status-open { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.status-claimed { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.status-done { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }

/* ── Timer Chips ── */
.sb-timer, .pb-timer {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sb-timer { background: var(--accent-soft); color: #a78bfa; border: 1px solid #4c1d95; }
.sb-timer.floor { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.sb-timer.urgent { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); animation: pulse-red 1s ease-in-out infinite; }
.pb-timer { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); }
.pb-timer.urgent { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); animation: pulse-red 1s ease-in-out infinite; }
.pb-timer.applied { background: var(--red-soft); color: var(--red); border: 1px solid var(--red); }

/* ── Vertical Chip ── */
.vchip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.vchip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.chip.rec {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
}

/* ── Buttons ── */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 4px 18px var(--accent-glow); filter: brightness(1.1); }
.btn-error-state {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
  animation: btnShake 0.4s ease-in-out;
}
@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.btn-green {
  background: linear-gradient(135deg, var(--green), #065f46);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}
.btn-green:hover { filter: brightness(1.1); box-shadow: 0 4px 18px rgba(16,185,129,0.4); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.btn-sm { font-size: 11px; padding: 5px 10px; border-radius: 7px; }

/* ── Dropdown Menu ── */
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item:active { background: var(--surface-3); }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 24px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.4);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 32px var(--accent-glow), 0 12px 40px rgba(0,0,0,0.4); }
.fab:active { transform: scale(0.97); }

/* ── Sub-tasks ── */
.subtask-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subtask-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.subtask-progress-bar {
  height: 5px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.subtask-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}
.st-title { flex: 1; color: var(--text-dim); font-size: 12px; }
.st-pts { font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.st-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Comments ── */
.comment-thread {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.comment-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.comment-author { font-size: 12px; font-weight: 700; color: var(--accent); }
.comment-time { font-size: 11px; color: var(--text-faint); }
.comment-text { font-size: 13px; color: var(--text-dim); }
.comment-empty { font-size: 12px; color: var(--text-faint); text-align: center; padding: 8px; }
.comment-input-row { display: flex; gap: 8px; align-items: center; }
.comment-input, .comment-input-row input {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.comment-input:focus, .comment-input-row input:focus { border-color: var(--accent); }

/* ── Sidebar ── */
.sidebar-stack { display: flex; flex-direction: column; gap: 16px; }
.leaderboard, .discussion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.leaderboard h2, .discussion h2 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lb-scope {
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  margin-bottom: 12px;
  outline: none;
  cursor: pointer;
}
.lb-empty { font-size: 12px; color: var(--text-faint); text-align: center; padding: 16px; }
.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}
.lb-row:hover { border-color: var(--accent); }
.lb-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.lb-rank {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--text-faint);
}
.lb-rank.gold { background: linear-gradient(135deg,#f59e0b,#92400e); color:#fff; box-shadow:0 0 8px rgba(245,158,11,0.5); }
.lb-rank.silver { background: linear-gradient(135deg,#94a3b8,#475569); color:#fff; box-shadow:0 0 8px rgba(148,163,184,0.4); }
.lb-rank.bronze { background: linear-gradient(135deg,#cd7c2d,#7c3d12); color:#fff; box-shadow:0 0 8px rgba(205,124,45,0.4); }
.lb-pts { font-family: var(--font-head); font-size: 14px; font-weight: 800; color: var(--accent); }
.discussion-hint { font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.discussion-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }

/* ── Modals ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeInOverlay 0.15s ease; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.1);
  animation: slideUpModal 0.2s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 20px 20px 0 0;
}
.modal h2 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; font-size: 14px; color: var(--text-dim); }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); margin-top: 2px; cursor: pointer; }
.sb-fields { display: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.sb-fields.show { display: block; }
.sb-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.budget-note { font-size: 12px; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.confirm-modal { text-align: center; }
.confirm-modal p { color: var(--text-dim); margin-bottom: 8px; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }

/* ── Animations ── */
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 16px rgba(239,68,68,0.6); }
}
@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 8px rgba(124,58,237,0.35); }
  50% { box-shadow: 0 0 18px rgba(124,58,237,0.65); }
}
@keyframes fadeInOverlay {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: cardIn 0.25s ease both; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Mobile ── */
@media (max-width: 600px) {
  .wrap { padding: 0 12px 80px; }
  .stats { gap: 4px; }
  .stat { padding: 8px 10px; min-width: 56px; }
  .stat .n { font-size: 1.2rem; }
  .board { grid-template-columns: 1fr; }
  .fab { bottom: 20px; right: 16px; padding: 12px 20px; }
  .modal { padding: 20px; border-radius: 16px; }
  .sb-fields-grid { grid-template-columns: 1fr; }
}

/* ── Streamlined Fullstack Layout Helpers ── */
.header-main { display: flex; flex-direction: column; gap: 6px; }
.header-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.search-sort-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  min-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.form-row { display: flex; gap: 14px; }
.flex-1 { flex: 1; }
.required { color: var(--red); margin-left: 2px; }
.btn-danger-ghost {
  background: transparent;
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger-ghost:hover {
  background: var(--red-soft);
  border-color: var(--red);
}
.job-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.job-meta-badge.pts {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-glow);
}
.job-meta-badge.claimed {
  background: var(--amber-soft);
  color: var(--amber);
}
.job-meta-badge.done {
  background: var(--green-soft);
  color: var(--green);
}
.subtask-add-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
}
.subtask-add-box h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

/* ── Team Members & User Select ── */
.modal-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.modal-select:focus {
  border-color: var(--accent);
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: border-color var(--transition), transform var(--transition);
}
.user-item:hover {
  border-color: var(--accent-glow);
  transform: translateY(-1px);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-role-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.user-active-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
}

/* ── Live DB Connection Status & Banner ── */
.db-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
  transition: all var(--transition);
}
.db-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  transition: background 0.2s, box-shadow 0.2s;
}
.db-status-badge.syncing .db-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: dbPulse 1s infinite alternate;
}
.db-status-badge.error .db-dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}
.db-status-badge.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}
@keyframes dbPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.db-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #ef4444;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #fca5a5;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  word-break: break-word;
}
.db-alert-banner strong {
  color: #fff;
}
.db-alert-banner button {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Demo banner ─────────────────────────────────────────────────────────── */
.demo-banner {
  background: rgba(245,158,11,0.12);
  border: 1px solid var(--amber);
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 14px;
  color: var(--amber);
  font-size: 12.5px;
}
.demo-label {
  font-size: 10px;
  font-weight: 700;
  background: rgba(245,158,11,0.18);
  color: var(--amber);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  letter-spacing: .04em;
}

/* ── Kanban board ────────────────────────────────────────────────────────── */
.kanban-wrap {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 16px;
}
.kanban-col {
  flex: 0 0 220px;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 14px;
}
@media (max-width: 600px) {
  .kanban-col { flex: 0 0 82vw; }
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.kanban-col-count {
  background: var(--surface-3);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-faint);
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.kanban-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
}
.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  margin-bottom: 4px;
}
.diff-tag { border-radius: 5px; padding: 1px 7px; font-weight: 600; }
.diff-Easy   { background: var(--green-soft); color: var(--green); }
.diff-Medium { background: var(--amber-soft); color: var(--amber); }
.diff-Hard   { background: var(--red-soft);   color: var(--red); }
.deadline-tag {
  font-size: 11px;
  color: var(--text-faint);
}
.deadline-tag.overdue { color: var(--red); font-weight: 600; }
.kanban-card-claimer {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 3px;
}

/* column header colours */
.kcol-Open       .kanban-col-header { color: var(--green); }
.kcol-Claimed    .kanban-col-header { color: var(--accent-2); }
.kcol-Submitted  .kanban-col-header { color: var(--amber); }
.kcol-Approved   .kanban-col-header { color: var(--accent); }
.kcol-Rejected   .kanban-col-header { color: var(--red); }
.kcol-Paid       .kanban-col-header { color: var(--green); }

/* ── Detail panel ────────────────────────────────────────────────────────── */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.5);
}
.detail-overlay.show { display: flex; justify-content: flex-end; }
.detail-panel {
  width: min(480px, 100vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 20px 32px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
}
.detail-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.detail-section {
  margin-bottom: 14px;
}
.detail-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.detail-action-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.detail-action-group h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Live points preview ─────────────────────────────────────────────────── */
.pts-preview {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.pts-preview strong { color: var(--accent); }
