/* ==========================================================================
   Project Manager — Kanban workspace styles.
   ========================================================================== */

/* ── Workspace shell ─────────────────────────────────────── */

.pm-workspace { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 46px); overflow: hidden; }
.pm-loading  { padding: 32px; color: var(--o-muted); text-align: center; }
.pm-error    { padding: 32px; color: var(--o-danger); text-align: center; }
.pm-empty    { padding: 48px; color: var(--o-muted); text-align: center; font-size: 15px; }

/* ── Control panel ───────────────────────────────────────── */

.pm-control-panel {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--o-border-light);
  background: var(--o-sheet); flex-shrink: 0; min-height: 46px;
}
.pm-cp-left   { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pm-cp-center { flex: 1; min-width: 0; }
.pm-cp-right  { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pm-breadcrumb     { color: var(--o-brand); cursor: pointer; font-size: 13px; text-decoration: none; white-space: nowrap; }
.pm-breadcrumb:hover { text-decoration: underline; }
.pm-breadcrumb-sep { color: var(--o-muted); font-size: 12px; }
.pm-breadcrumb-current { font-weight: 600; font-size: 14px; color: var(--o-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

.pm-search {
  width: 100%; max-width: 320px; padding: 5px 10px;
  border: 1px solid var(--o-border); border-radius: var(--o-radius);
  font: 13px var(--o-font); outline: none; background: var(--o-ground);
  color: var(--o-text);
}
.pm-search:focus { border-color: var(--o-brand); box-shadow: 0 0 0 2px rgba(49,84,64,.12); }

/* ── Buttons ─────────────────────────────────────────────── */

.pm-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border: 1px solid var(--o-border); border-radius: var(--o-radius);
  font: 13px var(--o-font); cursor: pointer; background: var(--o-sheet);
  color: var(--o-text); white-space: nowrap; transition: background .15s;
}
.pm-btn:hover { background: var(--o-ground); }
.pm-btn-primary { background: var(--o-brand); color: #fff; border-color: var(--o-brand); }
.pm-btn-primary:hover { background: var(--o-brand-dark); }
.pm-btn-ghost { border-color: transparent; background: transparent; }
.pm-btn-ghost:hover { background: var(--o-ground); }
.pm-btn-sm { padding: 3px 8px; font-size: 12px; }

/* ── Layout switcher ─────────────────────────────────────── */

.pm-layout-switcher { display: flex; gap: 2px; }
.pm-layout-btn {
  width: 30px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--o-radius); background: transparent;
  cursor: pointer; color: var(--o-muted); transition: background .15s;
}
.pm-layout-btn:hover { background: var(--o-ground); color: var(--o-text); }
.pm-layout-btn.active { background: var(--o-brand); color: #fff; }
.pm-layout-btn svg { width: 16px; height: 16px; }

/* ── Project grid ────────────────────────────────────────── */

.pm-header { padding: 20px 24px 12px; }
.pm-page-title { margin: 0; font-size: 20px; color: var(--o-text-strong); }

.pm-project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; padding: 0 24px 24px;
}
.pm-project-card {
  padding: 20px; border-radius: 8px; background: var(--o-sheet);
  border: 1px solid var(--o-border-light); cursor: pointer;
  transition: box-shadow .2s, border-color .2s;
}
.pm-project-card:hover { border-color: var(--o-brand); box-shadow: var(--o-shadow); }
.pm-project-name  { font-weight: 600; font-size: 15px; color: var(--o-text-strong); margin-bottom: 4px; }
.pm-project-count { font-size: 13px; color: var(--o-muted); }

/* ── Board layout ────────────────────────────────────────── */

.pm-body { flex: 1; overflow: auto; }
.pm-layout-board { overflow-x: auto; }

.pm-board {
  display: flex; gap: 12px; padding: 12px 16px;
  min-height: 100%; align-items: flex-start;
}
.pm-board-col {
  flex: 0 0 280px; min-width: 280px;
  background: var(--o-ground); border-radius: 8px;
  display: flex; flex-direction: column; max-height: calc(100vh - 120px);
}
.pm-board-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-weight: 600; font-size: 13px;
  color: var(--o-text-strong);
}
.pm-board-col-count {
  background: var(--o-border-light); border-radius: 10px;
  padding: 1px 8px; font-size: 11px; color: var(--o-muted); font-weight: 500;
}
.pm-board-cards {
  flex: 1; overflow-y: auto; padding: 0 8px 8px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 60px; transition: background .15s;
}
.pm-board-cards.pm-drag-over { background: rgba(49,84,64,.06); border-radius: 6px; }

.pm-board-card {
  background: var(--o-sheet); border: 1px solid var(--o-border-light);
  border-radius: 6px; padding: 10px 12px; cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.pm-board-card:hover { border-color: var(--o-brand); box-shadow: var(--o-shadow); }
.pm-board-card.pm-dragging { opacity: .5; }

.pm-card-title { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.4; color: var(--o-text-strong); }
.pm-card-state { flex-shrink: 0; margin-top: 2px; }
.pm-card-state svg { display: block; }
.pm-card-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }

.pm-board-add { padding: 4px 6px; }
.pm-board-add-btn {
  width: 100%; padding: 6px; border: 1px dashed var(--o-border);
  border-radius: var(--o-radius); background: transparent;
  color: var(--o-muted); font-size: 12px; cursor: pointer; text-align: center;
}
.pm-board-add-btn:hover { border-color: var(--o-brand); color: var(--o-brand); }

/* ── Chips ───────────────────────────────────────────────── */

.pm-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; line-height: 1.4; white-space: nowrap;
}
.pm-chip svg { display: block; }
.pm-chip-priority svg { width: 12px; height: 12px; }
.pm-chip-due { background: var(--o-ground); color: var(--o-muted); }
.pm-due-overdue { background: var(--o-danger-bg) !important; color: var(--o-danger-text) !important; }
.pm-due-today  { background: var(--o-warning-bg) !important; color: var(--o-warning-text) !important; }
.pm-due-soon   { background: #fff8e1; color: #795548; }
.pm-due-ok     { color: var(--o-muted); }
.pm-chip-label { border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.pm-chip-sub   { background: var(--o-ground); color: var(--o-muted); font-size: 11px; }
.pm-avatars    { display: inline-flex; gap: -4px; }
.pm-avatars svg, .pm-avatars span { display: block; }

/* ── List layout ─────────────────────────────────────────── */

.pm-layout-list { overflow-y: auto; }

.pm-list-group { border-bottom: 1px solid var(--o-border-light); }
.pm-list-group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600; color: var(--o-text-strong);
}
.pm-list-group-header:hover { background: var(--o-ground); }
.pm-list-group-arrow { font-size: 12px; color: var(--o-muted); transition: transform .15s; }
.pm-list-group-header.collapsed .pm-list-group-arrow { transform: rotate(-90deg); }
.pm-list-group-count { font-size: 11px; color: var(--o-muted); font-weight: 400; }
.pm-list-group-body.collapsed { display: none; }
.pm-list-group-title { flex: 1; }

.pm-list-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 32px; cursor: pointer;
  border-top: 1px solid transparent; transition: background .1s;
}
.pm-list-row:hover { background: var(--o-ground); }
.pm-list-state     { flex-shrink: 0; }
.pm-list-state svg { display: block; }
.pm-list-name      { flex: 1; font-size: 13px; color: var(--o-text-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-list-chips     { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.pm-list-add     { padding: 4px 16px 8px 32px; }
.pm-list-add-btn { border: none; background: none; color: var(--o-muted); font-size: 12px; cursor: pointer; padding: 4px 0; }
.pm-list-add-btn:hover { color: var(--o-brand); }

/* ── Calendar layout ────────────────────────────────────────── */

.pm-layout-calendar { overflow-y: auto; padding: 12px 16px; }

.pm-cal-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.pm-cal-month { font-size: 16px; font-weight: 600; color: var(--o-text-strong); min-width: 180px; text-align: center; }

.pm-cal-headers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 1px; }
.pm-cal-header  { text-align: center; font-size: 11px; font-weight: 600; color: var(--o-muted); padding: 6px 0; }

.pm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--o-border-light); border: 1px solid var(--o-border-light); border-radius: 6px; overflow: hidden; }
.pm-cal-day  {
  background: var(--o-sheet); min-height: 90px; padding: 4px 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.pm-cal-day-out  { background: var(--o-ground); }
.pm-cal-day-today { background: #f0f7f2; }
.pm-cal-day-num  { font-size: 12px; font-weight: 500; color: var(--o-muted); padding: 2px; }
.pm-cal-day-today .pm-cal-day-num { color: var(--o-brand); font-weight: 700; }

.pm-cal-item {
  font-size: 11px; padding: 2px 4px; border-radius: 3px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--o-ground); color: var(--o-text);
}
.pm-cal-item:hover { background: var(--o-border-light); }
.pm-cal-item.pm-sg-started    { border-left: 3px solid var(--o-brand); }
.pm-cal-item.pm-sg-completed  { border-left: 3px solid var(--o-success); opacity: .7; }
.pm-cal-item.pm-sg-cancelled  { border-left: 3px solid var(--o-danger); opacity: .5; text-decoration: line-through; }
.pm-cal-more { font-size: 10px; color: var(--o-muted); padding: 2px 4px; }

.pm-cal-no-due { margin-top: 16px; padding: 12px; background: var(--o-ground); border-radius: 6px; }
.pm-cal-no-due-title { font-size: 13px; font-weight: 600; color: var(--o-muted); margin-bottom: 6px; }

/* ── Spreadsheet layout ──────────────────────────────────── */

.pm-layout-spreadsheet { overflow: auto; }
.pm-sheet-wrap { padding: 12px 16px; overflow-x: auto; }

.pm-sheet {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.pm-sheet th {
  text-align: left; padding: 8px 10px; font-weight: 600; font-size: 12px;
  color: var(--o-muted); border-bottom: 2px solid var(--o-border);
  background: var(--o-ground); position: sticky; top: 0;
}
.pm-sheet td {
  padding: 6px 10px; border-bottom: 1px solid var(--o-border-light);
  color: var(--o-text); vertical-align: middle;
}
.pm-sheet-row { cursor: pointer; }
.pm-sheet-row:hover td { background: var(--o-ground); }
.pm-sheet-name { font-weight: 500; color: var(--o-text-strong); }
.pm-sheet-name svg { display: inline; vertical-align: middle; margin-right: 4px; }

/* ── Timeline layout ─────────────────────────────────────── */

.pm-layout-timeline { overflow: auto; padding: 12px 16px; }

.pm-timeline-header {
  display: flex; border-bottom: 1px solid var(--o-border-light);
  margin-bottom: 8px;
}
.pm-timeline-week {
  flex: 1; text-align: center; font-size: 11px; color: var(--o-muted);
  padding: 4px 0; white-space: nowrap;
}
.pm-timeline-rows { position: relative; }
.pm-timeline-row  {
  display: flex; align-items: center; height: 32px;
  border-bottom: 1px solid var(--o-border-light);
}
.pm-timeline-label {
  flex: 0 0 180px; font-size: 12px; color: var(--o-text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 8px; cursor: pointer;
}
.pm-timeline-label:hover { color: var(--o-brand); }
.pm-timeline-track { flex: 1; position: relative; height: 100%; }
.pm-timeline-bar   {
  position: absolute; top: 6px; height: 20px;
  border-radius: 4px; opacity: .8; cursor: pointer;
  transition: opacity .15s;
}
.pm-timeline-bar:hover { opacity: 1; }
.pm-timeline-today {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--o-danger); opacity: .5; z-index: 1;
}

/* ── Peek panel ──────────────────────────────────────────── */

.pm-peek {
  position: fixed; right: 0; top: 46px; bottom: 0;
  width: 420px; max-width: 100vw;
  background: var(--o-sheet); border-left: 1px solid var(--o-border);
  box-shadow: -4px 0 12px rgba(0,0,0,.08);
  overflow-y: auto; z-index: 100;
  animation: pm-peek-in .2s ease;
}
@keyframes pm-peek-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.pm-peek-loading { padding: 32px; color: var(--o-muted); text-align: center; }
.pm-peek-error   { padding: 32px; color: var(--o-danger); text-align: center; }

.pm-peek-header {
  display: flex; justify-content: flex-end; gap: 4px;
  padding: 8px 12px; border-bottom: 1px solid var(--o-border-light);
}
.pm-peek-expand, .pm-peek-close {
  width: 28px; height: 28px; border: none; background: transparent;
  font-size: 16px; cursor: pointer; border-radius: var(--o-radius);
  color: var(--o-muted); display: flex; align-items: center; justify-content: center;
}
.pm-peek-expand:hover, .pm-peek-close:hover { background: var(--o-ground); color: var(--o-text); }

.pm-peek-title {
  display: block; width: 100%; border: none; padding: 12px 16px;
  font: 600 17px var(--o-font); color: var(--o-text-strong);
  background: transparent; outline: none;
}
.pm-peek-title:focus { background: var(--o-ground); }

.pm-peek-props { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.pm-peek-prop {
  display: flex; align-items: center; min-height: 32px;
}
.pm-peek-prop-label {
  flex: 0 0 100px; font-size: 12px; color: var(--o-muted);
}
.pm-peek-prop-value { flex: 1; min-width: 0; }

.pm-peek-chip {
  border: none; background: var(--o-ground); padding: 3px 10px;
  border-radius: var(--o-radius); font: 12px var(--o-font);
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  color: var(--o-text);
}
.pm-peek-chip:hover { background: var(--o-border-light); }
.pm-peek-chip svg   { display: inline; vertical-align: middle; }

.pm-peek-assignees, .pm-peek-labels { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pm-peek-chip-add {
  width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--o-border);
  background: transparent; color: var(--o-muted); cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.pm-peek-chip-add:hover { border-color: var(--o-brand); color: var(--o-brand); }

/* ── Peek sections ───────────────────────────────────────── */

.pm-peek-section { padding: 12px 16px; border-top: 1px solid var(--o-border-light); }
.pm-peek-section-title { font-size: 12px; font-weight: 600; color: var(--o-text-strong); margin-bottom: 8px; }

.pm-peek-desc {
  width: 100%; border: 1px solid var(--o-border-light); border-radius: var(--o-radius);
  padding: 8px; font: 13px var(--o-font); color: var(--o-text);
  resize: vertical; min-height: 60px; background: transparent;
}
.pm-peek-desc:focus { border-color: var(--o-brand); outline: none; }

/* ── Sub-items ───────────────────────────────────────────── */

.pm-subitems { display: flex; flex-direction: column; gap: 4px; }
.pm-subitem  {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--o-text);
}
.pm-subitem input[type="checkbox"] { accent-color: var(--o-brand); }
.pm-subitem-done { text-decoration: line-through; color: var(--o-muted); }
.pm-subitem-add  {
  width: 100%; border: none; border-bottom: 1px solid var(--o-border-light);
  padding: 6px 0; font: 13px var(--o-font); outline: none; background: transparent;
  color: var(--o-text);
}
.pm-subitem-add::placeholder { color: var(--o-muted); }

/* ── Activity / comments ─────────────────────────────────── */

.pm-comment-composer { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pm-comment-input {
  width: 100%; border: 1px solid var(--o-border-light); border-radius: var(--o-radius);
  padding: 8px; font: 13px var(--o-font); resize: none; min-height: 48px;
  color: var(--o-text); background: transparent;
}
.pm-comment-input:focus { border-color: var(--o-brand); outline: none; }

.pm-activity-list  { display: flex; flex-direction: column; gap: 12px; }
.pm-activity-empty { font-size: 12px; color: var(--o-muted); }
.pm-activity-row   { border-left: 2px solid var(--o-border-light); padding-left: 10px; }
.pm-activity-author { font-size: 12px; font-weight: 600; color: var(--o-text-strong); }
.pm-activity-date   { font-size: 11px; color: var(--o-muted); }
.pm-activity-body   { font-size: 13px; color: var(--o-text); margin-top: 2px; white-space: pre-wrap; }

/* ── Inline create ───────────────────────────────────────── */

.pm-inline-create { padding: 0 2px; }
.pm-inline-input  {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--o-brand); border-radius: var(--o-radius);
  font: 13px var(--o-font); outline: none; background: var(--o-sheet);
  box-shadow: 0 0 0 2px rgba(49,84,64,.12); color: var(--o-text);
}

/* ── Popover ─────────────────────────────────────────────── */

.pm-popover {
  background: var(--o-sheet); border: 1px solid var(--o-border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  overflow: hidden; max-height: 360px; overflow-y: auto;
}

/* ── Option list ─────────────────────────────────────────── */

.pm-option-list   { display: flex; flex-direction: column; }
.pm-option-search {
  width: 100%; border: none; border-bottom: 1px solid var(--o-border-light);
  padding: 8px 12px; font: 13px var(--o-font); outline: none;
  color: var(--o-text); background: transparent;
}
.pm-option-items { max-height: 280px; overflow-y: auto; }
.pm-option-item  {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; padding: 7px 12px;
  font: 13px var(--o-font); cursor: pointer; text-align: left;
  color: var(--o-text);
}
.pm-option-item:hover  { background: var(--o-ground); }
.pm-option-item.selected { background: rgba(49,84,64,.06); }
.pm-option-icon  { flex-shrink: 0; display: flex; align-items: center; }
.pm-option-icon svg { display: block; }
.pm-option-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pm-option-label { flex: 1; }
.pm-option-check { color: var(--o-brand); font-size: 12px; flex-shrink: 0; }
.pm-option-create { color: var(--o-brand); font-weight: 500; }

/* ── Date picker ─────────────────────────────────────────── */

.pm-date-picker  { padding: 8px; }
.pm-date-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pm-date-preset  {
  border: 1px solid var(--o-border); border-radius: var(--o-radius);
  padding: 4px 10px; font: 12px var(--o-font); background: var(--o-sheet);
  cursor: pointer; color: var(--o-text);
}
.pm-date-preset:hover  { border-color: var(--o-brand); }
.pm-date-preset.active { background: var(--o-brand); color: #fff; border-color: var(--o-brand); }
.pm-date-input { width: 100%; border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 6px 8px; font: 13px var(--o-font); }

/* ── Filter panel ────────────────────────────────────────── */

.pm-filter-panel, .pm-display-panel { padding: 12px; }
.pm-filter-section { margin-bottom: 10px; }
.pm-filter-section:last-child { margin-bottom: 0; }
.pm-filter-label { font-size: 11px; font-weight: 600; color: var(--o-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.pm-filter-chip  {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--o-border); border-radius: var(--o-radius);
  padding: 3px 8px; margin: 2px; font: 12px var(--o-font);
  background: var(--o-sheet); cursor: pointer; color: var(--o-text);
}
.pm-filter-chip:hover  { border-color: var(--o-brand); }
.pm-filter-chip.active { background: var(--o-brand); color: #fff; border-color: var(--o-brand); }
.pm-filter-chip svg    { display: inline; vertical-align: middle; }
.pm-filter-clear       { margin-top: 6px; }

.pm-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--o-text); padding: 3px 0; cursor: pointer;
}
.pm-toggle input { accent-color: var(--o-brand); }

/* ── Full item page ──────────────────────────────────────── */

.pm-item-page-header {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; border-bottom: 1px solid var(--o-border-light);
}
.pm-item-page-body { padding: 0; }
.pm-item-page-body .pm-peek {
  position: static; width: 100%; max-width: 720px; margin: 0 auto;
  border-left: none; box-shadow: none; animation: none;
}

/* ── State-group color indicators ────────────────────────── */

.pm-sg-backlog    { opacity: .6; }
.pm-sg-completed  { opacity: .7; }
.pm-sg-cancelled  { opacity: .5; }

/* ── Modal ────────────────────────────────────────────────── */

.pm-modal-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center;
}
.pm-modal {
  background: var(--o-sheet); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18); width: 400px; max-width: 90vw;
}
.pm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--o-border-light);
}
.pm-modal-header h3 { margin: 0; font: 600 16px var(--o-font); color: var(--o-text); }
.pm-modal-close {
  background: none; border: none; font-size: 20px; color: var(--o-muted);
  cursor: pointer; padding: 0; line-height: 1;
}
.pm-modal-close:hover { color: var(--o-text); }
.pm-modal-body { padding: 16px 20px; }
.pm-modal-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--o-border);
  border-radius: 6px; font: 14px var(--o-font); color: var(--o-text);
  background: var(--o-ground); outline: none; box-sizing: border-box;
}
.pm-modal-input:focus { border-color: var(--o-brand); box-shadow: 0 0 0 2px rgba(49,84,64,.15); }
.pm-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px 16px;
}

/* ── Dark mode ───────────────────────────────────────────── */

html[data-theme="dark"] .pm-board-card { box-shadow: 0 1px 3px rgba(0,0,0,.2); }
html[data-theme="dark"] .pm-popover { box-shadow: 0 4px 16px rgba(0,0,0,.4); }
html[data-theme="dark"] .pm-cal-day-today { background: rgba(49,84,64,.15); }
html[data-theme="dark"] .pm-due-soon { background: #3a2a0a; color: #d4a574; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 720px) {
  .pm-peek { width: 100%; left: 0; }
  .pm-board { flex-direction: column; }
  .pm-board-col { flex: none; min-width: 100%; max-width: 100%; }
  .pm-control-panel { flex-wrap: wrap; }
  .pm-search { max-width: 100%; }
  .pm-timeline-label { flex: 0 0 120px; }
  .pm-breadcrumb-current { max-width: 120px; }
}

/* ── Shell: the Plane-style project sidebar beside every Projects page (ported from the NW console) ── */
.pm-shell { display: flex; align-items: stretch; height: calc(100vh - 46px); min-height: 0; }
.pm-shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pm-shell-main > .pm-workspace { height: 100%; }
.pm-shell-main > .pm-landing { overflow: auto; }
.pm-sidebar {
  width: 232px; flex: none; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 8px 24px; overflow-y: auto;
  background: var(--o-ground); color: var(--o-text); border-right: 1px solid var(--o-border-light);
}
.pm-side-head { display: flex; align-items: center; gap: 6px; padding: 2px 8px 8px; }
.pm-side-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--o-muted); }
.pm-side-group { display: flex; flex-direction: column; gap: 1px; }
.pm-side-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 3px 8px;
  border: 0; border-radius: 6px; background: none; color: var(--o-text); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer;
}
.pm-side-row:hover { background: rgba(0,0,0,.05); }
.pm-side-row-on { background: color-mix(in srgb, var(--o-brand) 12%, transparent); color: var(--o-brand-dark); font-weight: 600; }
.pm-side-icon { display: inline-flex; width: 18px; justify-content: center; color: var(--o-muted); }
.pm-side-row-on .pm-side-icon { color: var(--o-brand-dark); }
.pm-side-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-side-count { color: var(--o-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pm-side-glyph {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px;
  background: hsl(var(--pm-hue, 140) 45% 42%); color: #fff; font-size: 11px; font-weight: 700;
}
.pm-side-star {
  display: inline-flex; align-items: center; border: 0; background: none; padding: 0 2px; cursor: pointer;
  color: var(--o-muted); opacity: 0; font-size: 15px; line-height: 1;
}
.pm-side-row:hover .pm-side-star, .pm-side-star.on, .pm-project-card .pm-side-star { opacity: 1; }
.pm-side-star.on { color: #d4a017; }
.pm-side-section {
  display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 10px; padding: 4px 8px;
  border: 0; background: none; color: var(--o-muted); font: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; text-align: left; cursor: pointer; border-radius: 6px;
}
.pm-side-section > span:nth-child(2) { flex: 1; }
.pm-side-section:hover { color: var(--o-text); background: rgba(0,0,0,.05); }
.pm-side-note { margin: 0; padding: 6px 8px; font-size: 12px; color: var(--o-muted); }

/* Projects landing: Your / Team sections */
.pm-landing-section { padding: 8px 24px 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--o-muted); }
.pm-landing-note { padding: 0 24px 16px; margin: 0; font-size: 13px; color: var(--o-muted); }
.pm-project-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pm-project-card-top .pm-project-name { flex: 1; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-project-why { margin-top: 4px; font-size: 12px; color: var(--o-brand-dark); }

/* My work: tabs, project/parent context, activities */
.pm-tabs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--o-ground); }
.pm-tab { border: 0; background: none; padding: 4px 10px; border-radius: 5px; font: inherit; font-size: 13px; color: var(--o-text); cursor: pointer; }
.pm-tab.active { background: var(--o-sheet); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 600; }
.pm-item-context { display: block; margin-top: 2px; font-size: 11.5px; color: var(--o-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-card-title + .pm-item-context { margin: -2px 0 6px 20px; }
.pm-activities-body { padding: 12px 16px 32px; overflow: auto; }
.pm-activities-body .pm-landing-note { padding: 0 0 12px; }
.pm-act-row { cursor: default; gap: 10px; }
.pm-act-row .pm-list-name { min-width: 0; }
.pm-act-row a.pm-btn { text-decoration: none; }

/* Process cards (e.g. the Edens boards): one line on the card, a section in the peek panel */
.pm-process-line { margin-top: 4px; font-size: 12px; color: var(--o-muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pm-process-hold { color: var(--o-danger); font-weight: 500; }
.pm-process-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--o-danger);
  margin-right: 5px; vertical-align: 1px; }
.pm-list-name .pm-process-line { -webkit-line-clamp: 1; }
.pm-process-summary { margin: 0 0 8px; color: var(--o-text-strong); font-size: 13px; }
.pm-process-holdbox { border: 1px solid var(--o-danger); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px;
  background: rgba(220, 53, 69, 0.06); color: var(--o-danger); font-size: 13px; }
.pm-process-holdbox ul { margin: 4px 0 0; padding-left: 18px; }
.pm-process-next { font-size: 13px; margin-bottom: 8px; }
.pm-process-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pm-process-links a.pm-btn { text-decoration: none; }
.pm-process-link { background: none; border: 0; padding: 0; color: var(--o-brand); cursor: pointer; font-size: 13px;
  text-decoration: none; text-align: left; }
.pm-process-link:hover { text-decoration: underline; }
.pm-process-sub { margin-top: 6px; }
.pm-process-blocked { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; }
.pm-process-done, .pm-process-done .pm-process-link { color: var(--o-muted); text-decoration: line-through; }
.pm-process-proj { color: var(--o-muted); font-size: 12px; }
.pm-process-issues { font-size: 12px; color: var(--o-danger); margin: 4px 0 0; }

@media (max-width: 900px) {
  .pm-sidebar { display: none; }
}
