/* DEV Performance dashboard */
.devperf-view { padding: 24px; overflow-y: auto; }
.devperf-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.devperf-tabs { display: flex; gap: 4px; }
.devperf-tabs .tab {
  background: transparent; border: none;
  padding: 8px 16px; font-size: 13px; cursor: pointer;
  color: var(--fg-2); border-bottom: 2px solid transparent;
}
.devperf-tabs .tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
  font-weight: 600;
}
.devperf-period { display: flex; gap: 4px; }
.period-btn {
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 5px 12px; font-size: 13px; cursor: pointer;
  color: var(--fg-2); border-radius: 4px;
}
.period-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.devperf-loading { padding: 60px; text-align: center; color: var(--fg-3); }

/* Leaderboard */
.leaderboard-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.leaderboard-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
}
.leaderboard-table thead th {
  font-size: 13px; font-weight: 600; color: var(--fg-2);
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.leaderboard-table tbody td {
  padding: 10px 12px; font-size: 14px; border-bottom: 1px solid var(--line);
}
.leaderboard-row { cursor: pointer; }
.leaderboard-row:hover { background: var(--bg); }
.lb-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 11px; font-weight: 600; color: white; margin-right: 8px;
  vertical-align: middle;
}
.lb-name { vertical-align: middle; }
.lb-perf { display: flex; flex-direction: column; gap: 4px; min-width: 80px; }
.lb-perf-num { font-weight: 700; }
.lb-perf-bar { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.lb-perf-fill { height: 100%; background: var(--accent); }
.tone-good { color: oklch(0.70 0.16 155); }
.tone-warn { color: oklch(0.72 0.14 80); }
.tone-bad  { color: oklch(0.65 0.18 25); }
.mini-dist-bar {
  height: 8px; width: 100px;
  border-radius: 4px; overflow: hidden;
  display: flex; background: var(--bg);
}
.mini-dist-seg { height: 100%; }

/* Per-DEV detail */
.perdev-view { display: flex; flex-direction: column; gap: 20px; }
.perdev-header { display: flex; align-items: center; gap: 12px; }
.perdev-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: white;
}
.perdev-header h2 { margin: 0; font-size: 18px; }
.perdev-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.perdev-kpi {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px;
}
.perdev-kpi-label { font-size: 13px; color: var(--fg-3); }
.perdev-kpi-value { font-size: 28px; font-weight: 700; color: var(--fg); margin: 4px 0; }
.perdev-kpi-sub { font-size: 13px; color: var(--fg-3); }
.perdev-section {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px;
}
.perdev-section h3 { font-size: 13px; font-weight: 600; margin: 0 0 12px 0; display: flex; align-items: center; gap: 8px; }

.sparkline { display: flex; align-items: flex-end; gap: 12px; height: 80px; }
.sparkline-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.sparkline-bar { width: 24px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.sparkline-num { font-size: 12px; color: var(--fg-3); }
.scatter { background: var(--bg); border-radius: 6px; }

.unrated-list { display: flex; flex-direction: column; gap: 6px; }
.unrated-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; cursor: pointer;
  font-size: 13px;
}
.unrated-row:hover, .unrated-row.focused { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--bg)); }
.unrated-title { flex: 1; }
.unrated-date { color: var(--fg-3); font-size: 13px; }
.cx-pill {
  background: var(--bg-soft); padding: 1px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.unrated-actions { display: flex; gap: 4px; }
.unrated-rate-btn {
  width: 26px; height: 26px; border-radius: 4px;
  background: transparent; border: 1px solid;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.unrated-rate-btn:hover { background: color-mix(in oklab, currentColor 15%, transparent); }

.recent-rated-list { display: flex; flex-direction: column; gap: 6px; }
.recent-rated-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 13px;
  flex-wrap: wrap;
}
.recent-rated-title { flex: 1; min-width: 200px; }
.recent-rated-note { color: var(--fg-2); font-style: italic; flex-basis: 100%; font-size: 13px; }
.recent-rated-date { color: var(--fg-3); font-size: 13px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }

.empty { color: var(--fg-3); font-size: 14px; padding: 12px; text-align: center; }

/* Slot ↔ Tasks linkage */
.slot-tasks-section { display: flex; flex-direction: column; gap: 8px; }
.slot-tasks-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--fg-2);
}
.slot-tasks-head strong { color: var(--fg); font-size: 13px; }
.slot-tasks-list { display: flex; flex-direction: column; gap: 4px; }
.slot-task-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font-size: 13px;
}
.slot-task-title {
  flex: 1; text-align: left;
  background: transparent; border: none;
  color: var(--fg); cursor: pointer; font-size: 13px;
  padding: 0;
}
.slot-task-title:hover { color: var(--accent); text-decoration: underline; }
.x-mini {
  background: transparent; border: none;
  color: var(--fg-3); cursor: pointer; padding: 0;
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.x-mini:hover { background: oklch(0.65 0.18 25); color: white; }

.btn.small { padding: 4px 10px; font-size: 13px; }

.my-tasks-hint {
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-soft));
  border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line));
  border-radius: 6px;
  padding: 8px 12px; font-size: 14px; color: var(--fg-2);
  margin-bottom: 16px;
}

/* Link task picker modal */
.link-task-modal { max-width: 560px; }
.link-task-context {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px; color: var(--fg-2);
  display: flex; flex-direction: column; gap: 4px;
}
.link-task-search {
  width: 100%; box-sizing: border-box;
  padding: 8px 12px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--fg);
  font-family: inherit;
  margin-bottom: 12px;
}
.link-task-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 50vh; overflow-y: auto;
}
.link-task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 12px;
  cursor: pointer; text-align: left;
  font-family: inherit; color: var(--fg);
  font-size: 13px;
}
.link-task-row:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--bg)); }
.link-task-title { flex: 1; }
.link-task-due { font-size: 13px; color: var(--fg-3); }

/* Open Board chip button (in ProjectBottomSection) */
.proj-chip-board {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--line));
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, transform 0.05s;
}
.proj-chip-board:hover {
  background: color-mix(in oklab, var(--accent) 28%, transparent);
}
.proj-chip-board:active { transform: scale(0.96); }

/* Locked project field in NewTaskModal (when opened from a board) */
.project-locked {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 6px);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--fg);
  min-height: 34px;
  box-sizing: border-box;
  cursor: not-allowed;
  opacity: 0.95;
}
.project-locked-name { flex: 1; }
.project-locked-icon { color: var(--fg-3); font-size: 13px; }

/* Inline field hints (under inputs) */
.field-hint {
  font-size: 14px;
  color: var(--fg-3);
  margin-top: 3px;
  line-height: 1.4;
  display: block;
}
.field-hint.accent {
  color: var(--accent);
  font-weight: 500;
}

/* Performance help collapsible panel */
.perf-help-panel {
  margin-top: 16px;
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-soft));
  border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line));
  border-radius: 8px;
  overflow: hidden;
}
.perf-help-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}
.perf-help-toggle:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.perf-help-body {
  padding: 12px 14px 14px;
  border-top: 1px solid color-mix(in oklab, var(--accent) 18%, var(--line));
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
}
.perf-help-body p { margin: 0 0 10px 0; }
.perf-help-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.perf-help-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
}
.perf-help-key {
  font-weight: 600;
  color: var(--fg);
}
.perf-help-val {
  color: var(--fg-2);
}
.perf-help-val b {
  color: var(--fg);
}
.perf-help-note {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.7;
}
.perf-help-note b {
  color: var(--fg);
}

/* Wider modal for New Task & Report Bug forms (more breathing room for 3-col grid) */
.new-task-modal { max-width: 860px; }
.report-bug-modal { max-width: 720px; }

/* Self-estimate widget (DEV-only) */
.self-est-section {
  background: color-mix(in oklab, var(--accent) 5%, var(--bg));
  border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--line));
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.self-est-section strong { font-size: 13px; color: var(--fg); }
.self-est-pill {
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
}
.self-est-help {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--fg-3);
  margin-top: 4px;
}
.self-est-help-inline {
  font-size: 14px;
  color: var(--fg-3);
}
.self-est-picker {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.self-est-btn {
  width: 36px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.self-est-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.self-est-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.self-est-btn:disabled { opacity: 0.5; cursor: wait; }

.my-stats-help {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--fg-2);
  background: color-mix(in oklab, var(--accent) 5%, var(--bg));
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--line));
  border-radius: 6px;
  line-height: 1.6;
}
.my-stats-help b { color: var(--fg); }

/* ─────────────────────────────────────────
   Subtasks
   ───────────────────────────────────────── */
.sub-section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sub-section-head {
  display: flex; justify-content: space-between; align-items: center;
}
.sub-section-head strong { font-size: 13px; color: var(--fg); }
.sub-list {
  display: flex; flex-direction: column;
  gap: 3px;
}
.sub-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.sub-row:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 5%, var(--bg-soft)); }
.sub-row.status-done { opacity: 0.65; }
.sub-row.status-cancelled { opacity: 0.5; }
.sub-row.status-bug { border-left: 3px solid oklch(0.65 0.18 25); }
.sub-check {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--fg-3);
  flex: none;
}
.sub-check:hover { border-color: var(--accent); }
.sub-check.checked {
  background: oklch(0.70 0.16 155);
  color: white;
  border-color: oklch(0.70 0.16 155);
}
.sub-check.cancelled {
  background: var(--fg-3);
  color: white;
  border-color: var(--fg-3);
}
.sub-title { flex: 1; color: var(--fg); }
.sub-add-form {
  background: var(--bg-soft);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.sub-add-form input {
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 10px; font-size: 13px; color: var(--fg);
  font-family: inherit; outline: none;
}
.sub-add-form input:focus { border-color: var(--accent); }
.sub-add-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sub-kind-toggle { display: flex; gap: 4px; }
.sub-kind-btn {
  flex: 1;
  padding: 4px 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer;
  color: var(--fg-2); font-family: inherit;
}
.sub-kind-btn.active { background: color-mix(in oklab, var(--accent) 15%, var(--bg)); border-color: var(--accent); color: var(--accent); }
.sub-kind-btn.bug.active { background: color-mix(in oklab, oklch(0.65 0.18 25) 15%, var(--bg)); border-color: oklch(0.65 0.18 25); color: oklch(0.65 0.18 25); }
.sub-empty { font-size: 14px; color: var(--fg-3); text-align: center; padding: 6px; font-style: italic; }
.task-sub { color: var(--accent); font-size: 10.5px; }
.task-sub-of { color: var(--fg-3); font-size: 10.5px; }

.parent-link {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--fg-2);
  cursor: pointer;
}
.parent-link:hover { border-color: var(--accent); color: var(--accent); }
.parent-link strong { color: var(--fg); }

/* ─────────────────────────────────────────
   Drag animation polish (Kanban board)
   ───────────────────────────────────────── */
.tb-card-wrap {
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.18s ease,
              box-shadow 0.18s ease,
              filter 0.18s ease;
  will-change: transform;
  cursor: grab;
}
.tb-card-wrap:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.18); }

/* Expanded subtask add form */
.sub-add-form.expanded {
  gap: 8px;
  padding: 12px;
}
.sub-add-form .sub-add-title {
  font-size: 13px;
  font-weight: 500;
}
.sub-add-form .sub-add-desc {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  outline: none;
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}
.sub-add-form .sub-add-desc:focus { border-color: var(--accent); }
.sub-add-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.sub-add-points {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--fg-2);
}
.sub-add-points select {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 6px;
  font-size: 13px; color: var(--fg);
  font-family: 'JetBrains Mono', monospace;
}
.sub-add-help {
  font-size: 14px;
  color: var(--fg-3);
  flex: 1;
  min-width: 0;
}

/* Severity picker (used in ReportBugModal, SubtasksSection bug mode, StatusPicker bug transition) */
.severity-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.severity-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: var(--bg);
  border: 1.5px solid;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s;
}
.severity-btn:hover:not(:disabled) { transform: translateY(-1px); }
.severity-btn:disabled { opacity: 0.5; cursor: wait; }
.severity-btn.active {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor;
}
.severity-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700;
  line-height: 1;
}
.severity-lbl {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.severity-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.severity-badge.lg { font-size: 13px; padding: 3px 9px; }

/* Severity menu (in StatusPicker when transitioning to bug) */
.severity-menu {
  width: 320px !important;
  padding: 10px !important;
}
.severity-menu-head {
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
}
.severity-menu-hint {
  font-size: 14px;
  color: var(--fg-3);
  display: block;
  margin-top: 6px;
}

/* Sub-add severity layout in subtask form */
.sub-add-severity {
  display: flex; flex-direction: column; gap: 6px;
}
.sub-add-severity-label {
  font-size: 13px; color: var(--fg-2); font-weight: 500;
}

/* ─────────────────────────────────────────
   Lightbox (full-screen image/video viewer)
   ───────────────────────────────────────── */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 10, 18, 0.92);
  display: flex; align-items: center; justify-content: center;
  animation: lbFade 0.15s ease-out;
}
@keyframes lbFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 26px; line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background 0.1s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-counter {
  position: absolute; top: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  z-index: 5;
}

.lightbox-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 80px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  font-size: 38px; line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.1s;
  z-index: 5;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

.lightbox-stage {
  max-width: 92vw;
  max-height: 78vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-video {
  max-width: 100%;
  max-height: 78vh;
  background: black;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-other {
  background: var(--bg-soft);
  padding: 30px 50px;
  border-radius: 10px;
  text-align: center;
  color: var(--fg);
}

.lightbox-caption {
  position: absolute; bottom: 80px;
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-caption .lightbox-size { color: rgba(255,255,255,0.5); }
.lightbox-caption .lightbox-download {
  color: var(--accent);
  text-decoration: none;
}
.lightbox-caption .lightbox-download:hover { text-decoration: underline; }

.lightbox-thumbs {
  position: absolute; bottom: 16px;
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
  background: rgba(0,0,0,0.4);
  padding: 6px 8px;
  border-radius: 8px;
  max-width: 90vw;
  overflow-x: auto;
}
.lightbox-thumb {
  width: 50px; height: 50px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex: none;
}
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-thumb.active { border-color: var(--accent); }
.lightbox-thumb .thumb-vid, .lightbox-thumb .thumb-doc {
  color: white; font-size: 18px;
}

/* Video thumbnail in attachment list (with play overlay) */
.video-thumb {
  position: relative;
  display: inline-block;
  background: black;
  border-radius: 4px;
  overflow: hidden;
}
.video-thumb video {
  display: block;
  max-width: 120px; max-height: 80px;
  width: 120px; height: 80px;
  object-fit: cover;
}
.video-thumb .play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  pointer-events: none;
}
button.att-thumb {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ─── Forecast (burn-rate) — chart + KPI cards + insight ──────────────── */
.forecast-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.forecast-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-3);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.forecast-empty-err {
  color: #c0392b;
  border-color: #f3c8c2;
  background: #fdf2f0;
}
.forecast-meta {
  font-size: 13px;
  color: var(--fg-3);
  text-align: center;
  padding-top: 4px;
}

/* KPI cards */
.forecast-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.forecast-kpi {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.forecast-kpi-label {
  font-size: 10.5px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.forecast-kpi-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}
.forecast-kpi-pos { color: #16a34a; }
.forecast-kpi-neg { color: #dc2626; }
.forecast-kpi-status {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}
.forecast-kpi-sub {
  font-size: 10.5px;
  color: var(--fg-3);
  margin-top: 1px;
}
.forecast-status-safe   { background: #f0fdf4; border-color: #bbf7d0; }
.forecast-status-warn   { background: #fffbeb; border-color: #fde68a; }
.forecast-status-danger { background: #fef2f2; border-color: #fecaca; }
.forecast-status-empty  { background: var(--bg-soft); }

/* Insight banner */
.forecast-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
}
.forecast-insight-icon { flex: none; font-size: 14px; line-height: 1.3; }
.forecast-insight-safe   { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.forecast-insight-warn   { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.forecast-insight-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.forecast-insight-info   { background: var(--bg-soft); border-color: var(--line); color: var(--fg-2); }

/* Chart */
.forecast-chart-wrap {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.forecast-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  user-select: none;
}
.forecast-grid-line {
  stroke: var(--line-soft);
  stroke-width: 1;
}
.forecast-axis-label {
  font-size: 12px;
  fill: var(--fg-3);
  font-family: var(--font-mono, monospace);
}
.forecast-ref-line {
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  fill: none;
}
.forecast-ref-revenue { stroke: #94a3b8; }
.forecast-ref-budget  { stroke: #16a34a; }
.forecast-ref-label {
  font-size: 12px;
  fill: #94a3b8;
  font-weight: 600;
}
.forecast-ref-label-budget { fill: #16a34a; }
.forecast-today-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}
.forecast-today-label {
  font-size: 12px;
  fill: var(--accent);
  font-weight: 700;
}
.forecast-end-line {
  stroke: #16a34a;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}
.forecast-end-label {
  font-size: 12px;
  fill: #15803d;
  font-weight: 700;
}
.forecast-slip-zone {
  fill: #fef3c7;
  opacity: 0.30;
}
.forecast-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.forecast-line-actual   { stroke: #2563eb; }
.forecast-line-forecast { stroke: #f97316; stroke-dasharray: 6 4; }
.forecast-point-actual  { fill: #2563eb; stroke: #fff; stroke-width: 1; }
.forecast-hover-line {
  stroke: var(--fg-3);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.6;
}
.forecast-hover-dot {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2;
}

/* Tooltip */
.forecast-tooltip {
  position: absolute;
  transform: translate(-50%, -120%);
  background: var(--fg);
  color: #fff;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 11.5px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 5;
}
.forecast-tooltip-date {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 13px;
  opacity: 0.85;
}
.forecast-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.5;
}
.forecast-tooltip-row.sub {
  opacity: 0.75;
  font-size: 10.5px;
  margin-top: 2px;
}
.forecast-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.forecast-dot-actual   { background: #2563eb; }
.forecast-dot-forecast { background: #f97316; }

/* Legend */
.forecast-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--fg-2);
}
.forecast-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.forecast-swatch {
  display: inline-block;
  width: 18px; height: 3px;
  border-radius: 2px;
}
.forecast-swatch-actual   { background: #2563eb; }
.forecast-swatch-forecast { background: #f97316; height: 0; border-top: 3px dashed #f97316; }
.forecast-swatch-budget   { background: #16a34a; height: 0; border-top: 3px dashed #16a34a; }
.forecast-swatch-revenue  { background: #94a3b8; height: 0; border-top: 3px dashed #94a3b8; }

/* Responsive: stack KPI cards on narrow */
@media (max-width: 720px) {
  .forecast-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Quote Checklist (left column under PM) ─────────────────────────── */
.qc-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qc-doc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  min-height: 32px;
}
.qc-doc-link {
  flex: 1;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.qc-doc-link:hover { color: var(--accent); text-decoration: underline; }
.qc-doc-empty {
  color: var(--fg-3);
  font-style: italic;
  font-size: 14px;
}
.qc-doc-remove {
  flex: none;
  padding: 3px 5px;
  font-size: 12px;
  color: var(--fg-3);
}
.qc-doc-remove:hover { color: #dc2626; }

.qc-actions-row {
  display: flex;
  gap: 6px;
}
.qc-action {
  flex: 1;
  font-size: 11.5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  white-space: nowrap;
}
.qc-action:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.qc-action:disabled { opacity: 0.5; cursor: not-allowed; }

/* Progress bar */
.qc-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.qc-progress-bar {
  height: 8px;
  background: var(--line-soft);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.qc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.qc-progress-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.qc-progress-pct {
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  font-family: var(--font-mono, monospace);
}
.qc-progress-detail {
  color: var(--fg-3);
}
.qc-stat-doing { color: #2563eb; }
.qc-stat-issue { color: #dc2626; font-weight: 600; }

/* Checklist rows */
.qc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.qc-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-3);
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  line-height: 1.5;
}
.qi-row {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
}
.qi-row.qi-done { border-left-color: #16a34a; opacity: 0.78; background: #f0fdf4; }
.qi-row.qi-doing { border-left-color: #2563eb; background: #eff6ff; }
.qi-row.qi-issue { border-left-color: #dc2626; background: #fef2f2; }
.qi-row.qi-todo  { border-left-color: #94a3b8; }

.qi-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qi-status-btn {
  flex: none;
  width: 22px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--fg-2);
}
.qi-status-btn:hover:not(:disabled) { border-color: var(--accent); }
.qi-status-btn:disabled { cursor: default; }
.qi-row.qi-done   .qi-status-dot { color: #16a34a; }
.qi-row.qi-doing  .qi-status-dot { color: #2563eb; }
.qi-row.qi-issue  .qi-status-dot { color: #dc2626; }
.qi-row.qi-todo   .qi-status-dot { color: var(--fg-3); }

.qi-title {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--fg);
  min-width: 0;
}
.qi-title-static {
  flex: 1;
  padding: 4px 2px;
  color: var(--fg);
}
.qi-row.qi-done .qi-title,
.qi-row.qi-done .qi-title-static {
  text-decoration: line-through;
  color: var(--fg-3);
}
.qi-expand, .qi-del {
  flex: none;
  width: 20px; height: 22px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 13px;
  display: grid;
  place-items: center;
  border-radius: 3px;
}
.qi-expand:hover { background: var(--bg-soft); color: var(--fg); }
.qi-del:hover    { background: #fef2f2; color: #dc2626; }

.qi-row-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding-left: 28px;
}
.qi-chip {
  font-size: 10.5px;
  background: var(--bg-soft);
  color: var(--fg-2);
  padding: 1px 6px;
  border-radius: 99px;
}
.qi-chip-note { background: #fef9c3; color: #854d0e; }

.qi-row-body {
  margin-top: 6px;
  padding: 6px 4px 4px 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qi-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.qi-meta-row-note { align-items: flex-start; }
.qi-meta-label {
  flex: none;
  width: 78px;
  color: var(--fg-3);
  font-size: 13px;
}
.qi-meta-input {
  flex: 1;
  padding: 4px 6px;
  font-size: 11.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg);
  outline: none;
}
.qi-meta-input:focus { border-color: var(--accent); }
.qi-note-input {
  resize: vertical;
  min-height: 38px;
  font-family: inherit;
}
.qi-meta-static {
  flex: 1;
  color: var(--fg-2);
  font-size: 11.5px;
}

.qc-add-btn {
  align-self: flex-start;
  font-size: 11.5px;
  padding: 5px 10px;
  margin-top: 4px;
  color: var(--fg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
}
.qc-add-btn:hover {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.qc-saving-hint {
  font-size: 14px;
  color: var(--fg-3);
  text-align: right;
  font-style: italic;
}

