/* ═══════════════════════════════════════════════════════════════
   PROJECTS — Notion-style Kanban (loads last — highest priority)
═══════════════════════════════════════════════════════════════ */

/* ── View containers ─────────────────────────────────────────── */
#view-projects.portal-view--active,
#view-membership.portal-view--active {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  height: 100% !important;
}

/* ── Screens ─────────────────────────────────────────────────── */
.pv-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════
   BOARD LIST
═══════════════════════════════════════════════════════════════ */

#proj-list-screen {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.pvl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.pvl-header-left { display: flex; align-items: center; gap: 12px; }

.pvl-title {
  font-size: 28px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  margin: 0 0 3px;
  letter-spacing: -0.02em;
}
.pvl-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  margin: 0;
}

.pvl-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #C8A96E;
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms;
}
.pvl-new-btn:hover { background: #d4b97e; }

/* Board grid */
.pvl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Empty state */
.pvl-empty {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
}
.pvl-empty-cta {
  margin-top: 4px;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.pvl-empty-cta:hover { border-color: #C8A96E; color: #C8A96E; }

/* Board card */
.pvl-card {
  background: #1c1c1f;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 180ms, transform 180ms, box-shadow 180ms;
}
.pvl-card:hover { border-color: rgba(200,169,110,0.5); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.pvl-card-cover { height: 60px; }
.pvl-card-archive-btn:hover { background: rgba(239,68,68,0.7) !important; border-color: rgba(239,68,68,0.8) !important; color: #fff !important; }
.pvl-card-body  { padding: 12px 14px 16px; }
.pvl-card-icon  { font-size: 28px; display: block; margin-top: -20px; margin-bottom: 8px; line-height: 1; }
.pvl-card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pvl-card-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}
.pvl-card-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; }
.pvl-card-bar-fill { height: 100%; background: #C8A96E; border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   BOARD TOPBAR
═══════════════════════════════════════════════════════════════ */

#proj-board-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pvb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  gap: 12px;
}
.pvb-topbar-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pvb-topbar-right { display: flex; gap: 6px; flex-shrink: 0; }

.pvb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 120ms, background 120ms;
}
.pvb-back:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }
.pvb-sep { color: rgba(255,255,255,0.2); font-size: 13px; flex-shrink: 0; }

.pvb-board-icon { font-size: 16px; flex-shrink: 0; }

.pvb-board-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  outline: none;
  min-width: 40px;
  max-width: 400px;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.pvb-board-title:empty::before { content: attr(data-placeholder); color: rgba(255,255,255,0.25); }
.pvb-board-title:focus { background: rgba(255,255,255,0.06); }

.pvb-action {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 120ms;
}
.pvb-action:hover { border-color: #ef4444; color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════════════════════════════════ */

.pvb-kanban {
  display: flex;
  gap: 12px;
  padding: 20px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}

/* Column */
.pvb-col {
  flex: 0 0 270px;
  width: 270px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 10px;
}

.pvb-col-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px 10px;
}
.pvb-col-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pvb-col-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  flex: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pvb-col-count {
  font-size: 11px;
  font-family: monospace;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

/* Column body — scrollable */
.pvb-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.pvb-col-loading {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  padding: 8px 4px;
  text-align: center;
}

/* Task card */
.pvb-task-card {
  background: #222225;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 120ms;
}
.pvb-task-card:hover {
  border-color: rgba(200,169,110,0.35);
  background: #272729;
  transform: translateY(-1px);
}
.pvb-task-title {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 6px;
}
.pvb-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pvb-task-priority {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pvb-task-due { font-size: 11px; color: rgba(255,255,255,0.35); }
.pvb-task-due--overdue { color: #f87171 !important; }

/* Add task */
.pvb-add-task {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 7px 4px;
  background: none;
  border: none;
  border-radius: 5px;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 120ms, background 120ms;
}
.pvb-add-task:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.05); }

/* ═══════════════════════════════════════════════════════════════
   TASK DETAIL PANEL
═══════════════════════════════════════════════════════════════ */

.pvt-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 360px;
  background: #1a1a1d;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.16,1,0.3,1);
}
.pvt-panel--open { transform: translateX(0) !important; }

.pvt-panel-inner {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.pvt-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 16px;
}
.pvt-close, .pvt-delete {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 120ms;
}
.pvt-close:hover  { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.25); }
.pvt-delete:hover { color: #ef4444; border-color: #ef4444; }

.pvt-title {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.01em;
  outline: none;
  line-height: 1.3;
  min-height: 1.3em;
  word-break: break-word;
  margin-bottom: 16px;
}
.pvt-title:empty::before { content: attr(data-placeholder); color: rgba(255,255,255,0.2); font-weight: 400; }

.pvt-props {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.pvt-prop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pvt-prop:last-child { border-bottom: none; }
.pvt-prop-label {
  width: 68px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.pvt-prop-select, .pvt-prop-date {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  padding: 0;
  flex: 1;
}
.pvt-prop-select option { background: #222225; }
.pvt-prop-date { color-scheme: dark; }

.pvt-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 16px 0 12px; }
.pvt-desc-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pvt-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  outline: none;
  min-height: 120px;
  word-break: break-word;
}
.pvt-desc:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,0.2);
  pointer-events: none;
}

/* ── Drag & Drop ─────────────────────────────────────────────── */

.pvb-task-card--dragging {
  opacity: 0.35;
  transform: rotate(1.5deg) scale(0.97);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  cursor: grabbing;
}

.pvb-col--drag-over {
  background: rgba(200,169,110,0.07) !important;
  outline: 1.5px dashed rgba(200,169,110,0.45);
  outline-offset: -2px;
}
.pvb-col--drag-over .pvb-col-name { color: rgba(200,169,110,0.8); }

/* ═══════════════════════════════════════════════════════════════
   CLIENT PROJECTS — Board / Budget / Time tabs
═══════════════════════════════════════════════════════════════ */

#cp-list-screen {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

#cp-detail-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tab bar */
.cp-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  padding: 10px 18px;
  margin-bottom: -1px;
  transition: color 180ms, border-color 180ms;
  letter-spacing: 0.01em;
}
.cp-tab:hover { color: rgba(255,255,255,0.75); }
.cp-tab--active {
  color: rgba(255,255,255,0.92);
  border-bottom-color: #C8A96E;
}

/* Tab pane */
.cp-tab-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* Board pane — full height kanban */
#cpPane-board {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
#cpPane-board .pvb-kanban {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
}

/* pvl-empty-btn */
.pvl-empty-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: rgba(200,169,110,0.12);
  border: 1px solid rgba(200,169,110,0.3);
  border-radius: 6px;
  color: #C8A96E;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms;
}
.pvl-empty-btn:hover { background: rgba(200,169,110,0.22); }

/* pvl-title-wrap inline edit */
.pvt-title-wrap { margin-bottom: 12px; }

/* ── Inline card creation ────────────────────────────────────── */

.pvb-inline-create {
  background: #2a2a2e;
  border: 1px solid rgba(200,169,110,0.4);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.pvb-inline-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
}
.pvb-inline-input::placeholder { color: rgba(255,255,255,0.3); }

.pvb-inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pvb-inline-save {
  padding: 4px 12px;
  background: #C8A96E;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms;
}
.pvb-inline-save:hover { background: #d4b97e; }
.pvb-inline-cancel {
  padding: 4px 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 120ms;
}
.pvb-inline-cancel:hover { color: rgba(255,255,255,0.8); }
