:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e5e8ee;
  --border-strong: #d6dbe4;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #7c3aed;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --muted: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, 0.14);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-3);
}

/* ---------- Header / nav ---------- */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  position: relative;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.nav-username {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
}

.nav-user-trigger:hover {
  background: var(--surface-2);
}

.chevron {
  font-size: 11px;
  color: var(--text-3);
  transition: transform 0.15s;
}

.nav-user-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
}

.user-menu[hidden] {
  display: none;
}

.user-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--surface-2);
}

.user-menu-item-danger {
  color: var(--danger);
}

.user-menu-item-danger:hover {
  background: var(--danger-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: 13px;
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---------- Landing ---------- */
.hero {
  padding: 80px 0 60px;
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(124, 58, 237, 0.08), transparent),
    radial-gradient(800px 400px at 10% 10%, rgba(79, 70, 229, 0.08), transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #e0e7ff;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-2);
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-points {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.hero-points span::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
  margin-right: 6px;
}

.hero-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

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

.mini-col {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px;
}

.mini-col-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
}

.mini-card .mini-pts {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 1px 6px;
  margin-top: 6px;
}

.section {
  padding: 72px 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-head h2 {
  font-size: 34px;
  font-weight: 800;
}

.section-head p {
  font-size: 17px;
  color: var(--text-2);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  text-align: center;
  padding: 8px;
}

.step-num {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
}

.step p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
}

.cta-band {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  padding: 56px;
  text-align: center;
  color: #fff;
}

.cta-band h2 {
  font-size: 32px;
  color: #fff;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 24px;
}

.cta-band .btn {
  background: #fff;
  color: var(--primary);
}

.cta-band .btn:hover {
  background: #eef2ff;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Auth ---------- */
.auth-wrap {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------- Dashboard ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: block;
  color: var(--text);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #c7d2fe;
}

.project-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.project-card p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.new-project-card {
  border: 2px dashed var(--border-strong);
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  min-height: 180px;
}

.new-project-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.new-project-card .plus {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

/* ---------- Project shell ---------- */
.project-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 8px;
  flex-wrap: wrap;
}

.project-head h1 {
  font-size: 28px;
}

.project-desc {
  color: var(--text-2);
  font-size: 15px;
  max-width: 720px;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.chart-box {
  position: relative;
  height: 280px;
}

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.points-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 4px 8px;
}

/* ---------- Tasks list ---------- */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.list-toolbar .input {
  max-width: 280px;
}

.task-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.task-row {
  display: grid;
  grid-template-columns: 1fr 150px 90px 130px 120px;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.task-row:last-child {
  border-bottom: none;
}

.task-row:hover {
  background: var(--surface-2);
}

.task-row-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row .assignee {
  font-size: 13px;
  color: var(--text-2);
}

.select-status {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

/* ---------- Board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.board-col {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 420px;
  transition: background 0.15s;
  min-width: 210px;
}

.board-col.drag-over {
  background: var(--primary-soft);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.board-col-head .badge {
  font-size: 11px;
  padding: 3px 8px;
}

.board-col-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}

.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.1s;
}

.board-card:hover {
  box-shadow: var(--shadow);
}

.board-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.board-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  word-break: break-word;
}

.board-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.board-card-assignee {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-add {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}

.board-add:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface);
}

/* ---------- Members ---------- */
.member-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.member-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.member-item .name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}

.member-item .remove {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}

.member-item .remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ---------- Progress (epics) ---------- */
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

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

.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-top: 6px;
}

/* ---------- Reports ---------- */
.range-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.range-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
}

.range-tab.active {
  background: var(--primary);
  color: #fff;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.report-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.report-table tr:last-child td {
  border-bottom: none;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 28px;
}

/* ---------- Task detail ---------- */
.task-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.task-detail-head .badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-detail-actions {
  display: flex;
  gap: 8px;
}

.task-title {
  font-size: 22px;
  margin-bottom: 10px;
}

.task-meta-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ---------- Markdown ---------- */
.markdown-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 18px;
  overflow-wrap: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin: 1.2em 0 0.5em;
}

.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.15em; }

.markdown-body p {
  margin: 0 0 1em;
}

.markdown-body ul, .markdown-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.markdown-body code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.88em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.markdown-body pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 1em;
}

.markdown-body pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

.markdown-body blockquote {
  border-left: 3px solid var(--border-strong);
  padding-left: 14px;
  color: var(--text-2);
  margin: 0 0 1em;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
}

.markdown-body table {
  border-collapse: collapse;
  margin: 0 0 1em;
  width: 100%;
}

.markdown-body th, .markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #111827;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Spinner / states ---------- */
.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px;
  color: var(--text-2);
  font-size: 14px;
}

.spinner::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  text-align: center;
  padding: 60px 20px;
}

.error-state h3 {
  font-size: 18px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .member-layout { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 1fr 120px 80px; }
  .task-row .assignee, .task-row .updated { display: none; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 34px; }
  .feature-grid, .steps, .project-grid, .stat-grid { grid-template-columns: 1fr; }
  .nav-username { display: none; }
}

/* ---------- Shared (read-only) view ---------- */
.share-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.share-banner-icon {
  font-size: 20px;
  line-height: 1;
}

.share-banner div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-2);
}

.share-banner strong {
  font-size: 14px;
  color: var(--text);
}
