/* ============ TaskQuest — Deliverables (DM backlog + PM intake) ============ */

/* page header controls */
.dlv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* DM summary: 4 KPI cards; performance & points live in the scoreboard toggle below */
.dlv-summary { grid-template-columns: repeat(4, 1fr) !important; }
@media (max-width: 1100px) { .dlv-summary { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 560px) { .dlv-summary { grid-template-columns: 1fr !important; } }
/* DM team scoreboard sits full-width under the KPI row */
.dlv-summary + .lb-card { grid-column: 1 / -1; margin-bottom: 24px; }
.scoreboard-headline { margin: 14px 0 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.scoreboard-num { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); display: inline-flex; align-items: baseline; }
.scoreboard-num .unit { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.scoreboard-cap { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--muted); }

/* DM primary tabs (Backlog / Team Scoreboard) */
.dm-tabs { display: flex; margin: 4px 0 18px; }
.dm-tabs-toggle { padding: 4px; }
.dm-tabs-toggle button { height: 34px; padding: 0 16px; font-size: 13px; }
.dm-tab-count { margin-left: 7px; font-size: 11px; font-weight: 700; color: var(--faint);
  background: var(--surface-3); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; }
.dm-tabs-toggle button.on .dm-tab-count { color: var(--accent); background: var(--accent-soft, var(--surface-3)); }
.dlv-head .section-label { margin: 0; }
.dlv-head-spacer { flex: 1; }
.dlv-count { font-size: 12px; font-weight: 600; color: var(--faint); background: var(--surface-3); height: 20px; min-width: 20px; padding: 0 7px; border-radius: 6px; display: inline-grid; place-items: center; }

/* segmented view toggle (List / Board) */
.view-toggle { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); }
.view-toggle button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: calc(var(--radius-sm) - 3px); background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 600; transition: background .14s, color .14s;
}
.view-toggle button:hover { color: var(--text); }
.view-toggle button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.18); }

/* ---- priority + status chips ---- */
.prio-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.prio-dot { width: 6px; height: 6px; border-radius: 50%; }
.dlv-status {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.dlv-status .sdot { width: 7px; height: 7px; border-radius: 50%; }

/* ---- progress ---- */
.dlv-prog { display: flex; align-items: center; gap: 9px; }
.dlv-prog-track { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.dlv-prog-fill { height: 100%; border-radius: 6px; transition: width .7s var(--ease); }
.dlv-prog-num { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============ Card grid layout ============ */
.dlv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.dlv-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 17px; box-shadow: var(--shadow-sm); cursor: pointer; position: relative; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .12s var(--ease);
  display: flex; flex-direction: column; gap: 12px;
}
.dlv-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dlv-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.dlv-card-top { display: flex; align-items: center; gap: 8px; }
.dlv-id { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .02em; }
.dlv-card-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; color: var(--text); }
.dlv-card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dlv-card-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.dlv-pm { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dlv-pm-label { font-size: 10px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dlv-due { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.dlv-due.overdue { color: var(--red); }
.dlv-proj { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--faint); }
.dlv-proj .pdot { width: 7px; height: 7px; border-radius: 50%; }

/* small action button on a card */
.dlv-mini-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 600; white-space: nowrap; transition: border-color .14s, background .14s, color .14s;
}
.dlv-mini-btn:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.dlv-mini-btn.accept:hover { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }

/* ============ Table layout ============ */
.dlv-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.dlv-trow {
  display: grid; grid-template-columns: minmax(220px, 2.2fr) 150px 110px 1.1fr 130px 36px;
  align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.dlv-trow:last-child { border-bottom: none; }
.dlv-trow:hover { background: var(--hover); }
.dlv-trow.head { cursor: default; background: var(--surface-2); padding-top: 10px; padding-bottom: 10px; }
.dlv-trow.head:hover { background: var(--surface-2); }
.dlv-th { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.dlv-tname { min-width: 0; }
.dlv-tname-t { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlv-tname-s { font-size: 11px; color: var(--faint); font-weight: 600; margin-top: 2px; }
.dlv-tcell { min-width: 0; }
.dlv-tchevron { color: var(--faint); display: flex; justify-content: flex-end; }
@media (max-width: 1080px) {
  .dlv-trow { grid-template-columns: 2fr 1fr 100px; }
  .dlv-th.hide-sm, .dlv-tcell.hide-sm, .dlv-tchevron { display: none; }
}

/* ============ Status board layout ============ */
.dlv-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1080px) { .dlv-board { grid-template-columns: repeat(2, 1fr); } }
.dlv-bcol { background: var(--column-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 7px; display: flex; flex-direction: column; min-height: 160px; }
.dlv-bcol-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 9px; }
.dlv-bcol-name { font-weight: 600; font-size: 13px; }
.dlv-bcol-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--faint); background: var(--surface-3); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; }
.dlv-bcol-list { display: flex; flex-direction: column; gap: 8px; padding: 2px 3px 6px; }
.dlv-bcard {
  background: var(--tile-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 13px; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: 9px;
  transition: border-color .14s, box-shadow .14s, transform .1s; animation: tile-in .25s var(--ease);
}
.dlv-bcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.dlv-bcard-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text); }
.dlv-bcard-meta { display: flex; align-items: center; gap: 8px; }
.dlv-bcol-empty { font-size: 12px; color: var(--faint); text-align: center; padding: 16px 8px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); margin: 2px 3px; }

/* ============ PM intake strip ============ */
.pm-intake { margin-bottom: 24px; }
.pm-intake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.pm-intake-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 15px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 11px; position: relative; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.pm-intake-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.pm-intake-top { display: flex; align-items: flex-start; gap: 9px; }
.pm-intake-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; cursor: pointer; }
.pm-intake-title:hover { color: var(--accent); }
.pm-intake-foot { display: flex; align-items: center; gap: 9px; }
.pm-intake-empty { font-size: 13px; color: var(--muted); padding: 22px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); }

/* ============ Deliverable detail modal ============ */
.dlv-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dlv-meta { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 13px; }
.dlv-meta-k { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.dlv-meta-v { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.dlv-desc-box { font-size: 13px; line-height: 1.55; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 18px; }

.dlv-subtask { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dlv-subtask:last-child { border-bottom: none; }
.dlv-subtask-t { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.dlv-subtask-t:hover { color: var(--accent); }
.dlv-subtask-due { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.dlv-subtask-due.overdue { color: var(--red); }
.dlv-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.dlv-subtasks-empty { font-size: 12.5px; color: var(--faint); text-align: center; padding: 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); }

/* priority option picker in create modal */
.prio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prio-opt {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .14s, background .14s;
}
.prio-opt:hover { border-color: var(--border-strong); }
.prio-opt.sel { background: var(--surface); }

/* parent-deliverable chip on a task tile */
.tile-deliv { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--accent); margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

