/* Life OS · Projects Module Stylesheet (Pixel Fold Horizontal-First & Desktop) */

#panel-projects {
  padding: 0;
  gap: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* 1. TOP HORIZONTAL SELECTOR STRIPS */
.projects-priority-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 7px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin: 0 0 6px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
}

.projects-priority-strip::-webkit-scrollbar {
  display: none;
}

.priority-tabs-scroll {
  display: flex;
  align-items: center;
  background: var(--bg-card-elevated, #fbf9f4);
  padding: 3px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-subtle, #e7e2d9);
  gap: 3px;
  flex-shrink: 0;
}

.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #596677);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.priority-chip:hover {
  background: var(--accent-indigo-soft, rgba(108, 122, 224, 0.08));
  color: var(--text-primary, #0f172a);
}

.priority-chip.active {
  background: var(--accent-indigo, #6c7ae0);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(108, 122, 224, 0.30);
}

.priority-chip .p-icon {
  font-size: 11px;
  display: inline-block;
  line-height: 1;
}

.priority-chip .p-label {
  font-weight: 600;
  font-size: 0.82rem;
}

.priority-chip .p-badge {
  font-size: 10px;
  padding: 0 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.07);
  color: inherit;
  font-weight: 700;
  line-height: 15px;
}

.priority-chip.active .p-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-new-project-compact {
  padding: 4px 10px;
  font-size: 0.80rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
}

/* 1. HORIZONTAL PROJECT TABS STRIP (PRETTY FOLDER TABS PATTERN) */
.projects-tabs-bar-container {
  padding: 2px 0 0 0;
  background: transparent;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 5;
  margin-bottom: -1.5px;
  box-sizing: border-box;
}

.projects-tabs-bar-container::-webkit-scrollbar {
  display: none;
}

.projects-items-strip {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-width: min-content;
  position: relative;
  z-index: 6;
}

/* Inactive Folder Tab */
.project-folder-tab,
.project-item-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px 8px 18px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border: 1.5px solid var(--border-subtle, #cbd5e1);
  border-bottom: 1.5px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface-muted, #f8fafc);
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: -1.5px;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  outline: none;
  font-family: inherit;
}

.project-folder-tab:hover,
.project-item-chip:hover {
  background: #f1f5f9;
  color: var(--text-primary, #1e293b);
  z-index: 2;
}

/* Active Folder Tab - Seamlessly Opens into the Workspace Card Below */
.project-folder-tab.active,
.project-item-chip.active {
  background: var(--bg-surface, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1.5px solid var(--border-subtle, #cbd5e1);
  border-bottom: 2.5px solid var(--bg-surface, #ffffff) !important;
  font-weight: 700;
  padding: 10px 20px 9px 20px;
  margin-bottom: -2px;
  position: relative;
  z-index: 8;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.03);
}

.project-folder-tab:not(.is-master).active,
.project-item-chip:not(.is-master).active {
  border-top: 3.5px solid #3b82f6;
  padding-top: 8px;
  color: #1d4ed8;
}

/* Master Project Tab Styling */
.project-folder-tab.is-master.active,
.project-item-chip.is-master.active {
  border-top: 3.5px solid #8b5cf6;
  padding-top: 8px;
  color: #6d28d9;
}

/* "+ Project" Action Button (A standalone button, distinctly NOT a folder tab) */
.btn-project-new-action,
.btn-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin-left: 12px;
  margin-bottom: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  font-family: inherit;
  outline: none;
}

.btn-project-new-action:hover,
.btn-chip-add:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

/* 2. PROJECT WORKSPACE BODY (THE FOLDER CARD) */
.project-workspace-body {
  margin: 0 0 24px 0;
  background: var(--bg-surface, #ffffff);
  border: 1.5px solid var(--border-subtle, #cbd5e1);
  border-radius: 0 12px 12px 12px;
  padding: 22px 11px;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.project-header-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: none;
}

.project-header-card.is-master-header {
  border-left: 4px solid #8b5cf6;
  padding-left: 12px;
}

.project-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-header-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-main-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  word-break: break-word;
  line-height: 1.3;
}

.project-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.project-badge-pill.master {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.project-badge-pill.project {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.project-badge-pill.parent-link {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.project-badge-pill.parent-link:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.project-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-desc-text {
  font-size: 13px;
  color: var(--text-secondary, #475569);
  line-height: 1.5;
  margin: 0;
}

.project-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 3. SUB-TABS NAVIGATION (PILL CONTAINER STYLE SIMILAR TO PRIORITY BAR) */
.project-subnav-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card-elevated, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 8px;
  padding: 3px;
  margin-top: 6px;
  margin-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: fit-content;
  max-width: 100%;
}

.project-subnav-strip::-webkit-scrollbar {
  display: none;
}

.project-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #596677);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.project-subnav-btn:hover {
  background: var(--accent-indigo-soft, rgba(108, 122, 224, 0.08));
  color: var(--text-primary, #0f172a);
}

.project-subnav-btn.active {
  background: var(--accent-indigo, #6c7ae0);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(108, 122, 224, 0.28);
}

/* 4. WBS BREAKDOWN (DELIVERABLES -> PACKAGES -> TASKS) */
.wbs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wbs-deliverable-card,
.wbs-milestone-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.wbs-deliverable-header,
.wbs-milestone-header {
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wbs-deliverable-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.wbs-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.deliverable-tag-index {
  font-size: 14px;
  font-weight: 700;
  color: #3b82f6;
  flex-shrink: 0;
}

.deliverable-tasks-count {
  font-size: 11px;
  color: #16a34a;
  font-weight: 700;
  white-space: nowrap;
}

.clickable-wbs-item {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.clickable-wbs-item:hover .wbs-deliverable-title,
.clickable-wbs-item:hover .wbs-package-title {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.clickable-wbs-item:hover .task-title:not(.done) {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wbs-deliverable-title-wrap,
.wbs-milestone-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
}

/* In expanded mode (default): do NOT truncate */
.wbs-deliverable-title,
.wbs-milestone-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  min-width: 40px;
}

.wbs-deliverable-actions,
.wbs-milestone-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wbs-packages-list,
.wbs-chunks-list {
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wbs-package-card,
.wbs-chunk-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.wbs-package-header,
.wbs-chunk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.wbs-package-header:hover,
.wbs-chunk-header:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.wbs-package-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.wbs-package-title-wrap,
.wbs-chunk-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
}

/* In expanded mode (default): do NOT truncate */
.wbs-package-title,
.wbs-chunk-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  white-space: normal;
  word-break: break-word;
  min-width: 40px;
}

.wbs-package-header-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.package-horizon-pill,
.chunk-horizon-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  flex-shrink: 0;
}

.wbs-steps-list,
.wbs-tasks-list,
.wbs-slices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 4px;
  border-left: 2px solid #e2e8f0;
}

.wbs-step-row,
.wbs-task-row,
.wbs-slice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 6px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  transition: all 0.15s ease;
  flex-wrap: nowrap;
}

.wbs-step-row:hover,
.wbs-task-row:hover,
.wbs-slice-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.wbs-step-left,
.wbs-task-left,
.wbs-slice-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
}

.wbs-step-title-wrap,
.wbs-task-title-wrap,
.wbs-slice-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  flex: 0 0 auto;
}

/* In expanded mode (default): do NOT truncate */
.step-title,
.task-title,
.slice-title {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* Collapsed Header compact single-line rules */
.wbs-deliverable-card.is-collapsed .wbs-deliverable-header {
  border-bottom: none;
  padding: 4px 8px;
}
.wbs-deliverable-card.is-collapsed .wbs-deliverable-header-left {
  flex-wrap: nowrap !important;
  overflow: hidden;
}
.wbs-deliverable-card.is-collapsed .wbs-deliverable-title-wrap {
  flex-wrap: nowrap !important;
  overflow: hidden;
  min-width: 100px !important;
  flex: 1 1 auto;
}
.wbs-deliverable-card.is-collapsed .wbs-deliverable-title,
.wbs-milestone-card.is-collapsed .wbs-milestone-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 80px !important;
  flex: 1 1 auto;
}
.wbs-deliverable-card.is-collapsed .wbs-deliverable-actions {
  display: none !important;
}

.wbs-package-card.is-collapsed {
  padding: 4px 6px;
  gap: 0;
}
.wbs-package-card.is-collapsed .wbs-package-header {
  padding: 3px 6px;
}
.wbs-package-card.is-collapsed .wbs-package-header-left {
  flex-wrap: nowrap !important;
  overflow: hidden;
}
.wbs-package-card.is-collapsed .wbs-package-title-wrap {
  flex-wrap: nowrap !important;
  overflow: hidden;
  min-width: 100px !important;
  flex: 1 1 auto;
}
.wbs-package-card.is-collapsed .wbs-package-title,
.wbs-chunk-card.is-collapsed .wbs-chunk-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 80px !important;
  flex: 1 1 auto;
}
.wbs-package-card.is-collapsed .wbs-package-header-right {
  display: none !important;
}

.step-title.done,
.task-title.done,
.slice-title.done {
  text-decoration: line-through;
  color: #94a3b8;
}

.step-energy-badge,
.task-energy-badge,
.slice-energy-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.step-energy-badge.core,
.task-energy-badge.core,
.slice-energy-badge.core {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.step-energy-badge.light,
.task-energy-badge.light,
.slice-energy-badge.light {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #86efac;
}

.step-energy-badge.starter,
.task-energy-badge.starter,
.slice-energy-badge.starter {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.wbs-step-actions,
.wbs-task-actions,
.wbs-slice-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-step-action,
.btn-task-action,
.btn-slice-action {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-step-action:hover,
.btn-task-action:hover,
.btn-slice-action:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}

/* WBS Collapsible & Chevrons */
.wbs-collapse-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}
.wbs-collapse-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.collapsed-hidden {
  display: none !important;
}

/* WBS Drag & Drop Reordering */
.wbs-drag-handle,
.wbs-step-drag-handle,
.wbs-task-drag-handle {
  color: #94a3b8;
  cursor: grab;
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.wbs-drag-handle:hover,
.wbs-step-drag-handle:hover,
.wbs-task-drag-handle:hover {
  opacity: 1;
  color: #3b82f6;
}
.wbs-deliverable-title-wrap,
.wbs-package-title-wrap,
.wbs-step-left,
.wbs-task-left {
  cursor: grab;
}
.wbs-deliverable-title-wrap:active,
.wbs-package-title-wrap:active,
.wbs-step-left:active,
.wbs-task-left:active {
  cursor: grabbing;
}
.wbs-deliverable-card.is-dragging,
.wbs-package-card.is-dragging,
.wbs-step-row.is-dragging,
.wbs-task-row.is-dragging {
  opacity: 0.45 !important;
  background: #f1f5f9 !important;
}
.wbs-deliverable-card.drag-over-top,
.wbs-package-card.drag-over-top,
.wbs-step-row.drag-over-top,
.wbs-task-row.drag-over-top {
  border-top: 3px solid #3b82f6 !important;
}
.wbs-deliverable-card.drag-over-bottom,
.wbs-package-card.drag-over-bottom,
.wbs-step-row.drag-over-bottom,
.wbs-task-row.drag-over-bottom {
  border-bottom: 3px solid #3b82f6 !important;
}

/* WBS Deliverable Status & Target Pills */
.deliverable-status-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 700;
  white-space: nowrap;
}
.deliverable-status-pill.status-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.deliverable-status-pill.status-in-progress {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.deliverable-status-pill.status-done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.deliverable-target-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

/* Cost Chips and Stats Bar */
.wbs-cost-chips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap !important;
  flex-shrink: 0;
  white-space: nowrap;
}
.cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
}
.cost-chip-time {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.cost-chip-budget-time {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.cost-chip-planned-time {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.cost-chip-actual-time {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.cost-chip-spent-time {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #86efac;
  font-weight: 700;
}
.cost-chip-budget-money {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.cost-chip-spent-money {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.cost-chip-linked-tasks {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.cost-chip-linked-tasks:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.cost-chip-money {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.cost-chip-money.cost-chip-yellow,
.cost-chip-yellow {
  background: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #fde047 !important;
}
.cost-chip-cog {
  background: transparent !important;
  border: none !important;
  padding: 0 2px;
  font-size: 11.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  user-select: none;
}
.cost-chip-cog.core,
.cost-chip-cog.intense,
.cost-chip-cog.light,
.cost-chip-cog.engaged,
.cost-chip-cog.starter,
.cost-chip-cog.autopilot {
  background: transparent !important;
  border: none !important;
}
.cost-chip-cog.engaged {
  color: #15803d;
  filter: drop-shadow(0 0.5px 0.5px rgba(0, 0, 0, 0.15)) brightness(0.42) saturate(2) contrast(1.2);
}

/* Cognitive load 3-bar meter - normal bar graph */
.cog-bars-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: help;
}

.cog-bars-group {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 18px;
}

.cog-bar-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 18px;
  box-sizing: border-box;
  background: transparent !important;
  border-radius: 3px;
  overflow: hidden;
  user-select: none;
  transition: opacity 0.15s ease;
}

/* Base outline/track for each bar column */
.cog-bar-autopilot {
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.cog-bar-engaged {
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.cog-bar-intense {
  border: 1px solid rgba(239, 68, 68, 0.45);
}

/* Zero count bar column */
.cog-bar-item.is-zero {
  border-color: #cbd5e1;
  opacity: 0.4;
}

/* Vertical stacking fill - rises from bottom like a normal bar graph (serves as background) */
.cog-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
  transition: height 0.2s ease;
}

.cog-bar-autopilot .cog-bar-fill {
  background: #fef08a; /* Light yellow background */
}

.cog-bar-engaged .cog-bar-fill {
  background: #dcfce7; /* Very light green background */
}

.cog-bar-intense .cog-bar-fill {
  background: #ffe4e6; /* Very light pink background */
}

/* Icon brought to the top layer so fill acts as background */
.cog-bar-icon {
  position: relative;
  z-index: 10; /* Top layer above fill */
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 0.5px 0.5px rgba(0, 0, 0, 0.15));
}

/* Engaged icon made dark green */
.cog-bar-engaged .cog-bar-icon {
  color: #15803d;
  filter: drop-shadow(0 0.5px 0.5px rgba(0, 0, 0, 0.15)) brightness(0.42) saturate(2) contrast(1.2);
}

.cog-bar-item:hover {
  filter: brightness(0.92);
}

.btn-task-action.primary-pull,
.btn-slice-action.primary-pull {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.btn-task-action.primary-pull:hover,
.btn-slice-action.primary-pull:hover {
  background: #bfdbfe;
  color: #1e40af;
  border-color: #60a5fa;
}

/* 5. MASTER PROJECT SPECIFIC VIEW */
.master-pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.master-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card .kpi-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-card .kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.kpi-card .kpi-sub {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
}

.master-subprojects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.subproject-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.subproject-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.subproject-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subproject-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.subproject-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #f1f5f9;
  overflow: hidden;
}

.subproject-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 6. EXECUTION REPORT (ORTHOGONAL TO TIME LOGGER) */
.report-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-ortho-notice {
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.4;
}

.report-tasks-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  font-size: 13px;
}

.report-tasks-table th,
.report-tasks-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.report-tasks-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

/* 7. RESOURCES & ROI VIEW */
.roi-overview-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.roi-stat-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roi-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}

.roi-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: #15803d;
}

/* 8. BADGE PROJECT LINK IN PLANNER TASK CARDS */
.badge-project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-project-link:hover {
  background: #bae6fd;
  color: #0284c7;
}

/* 9. MODALS & FORMS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card,
.project-modal-card {
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.20);
  background: var(--bg-surface, #ffffff);
  margin: auto;
}

.project-modal-card form,
.modal-card form {
  padding: 22px 26px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-card-elevated, #fbf9f4);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  flex-shrink: 0;
}

/* Cost inputs bar in task modal */
.task-cost-inputs-bar {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
  background: var(--bg-card, #f8fafc);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
}

@media (max-width: 600px) {
  .task-cost-inputs-bar {
    grid-template-columns: 1fr;
  }
}

.project-desc-text.clickable-desc {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed transparent;
  transition: all 0.16s ease;
  color: var(--text-secondary, #475569);
  display: block;
}

.project-desc-text.clickable-desc:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.project-desc-text.clickable-desc.is-empty {
  font-style: italic;
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.form-input, .form-select, .form-textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.stat-calc-box {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  color: #16a34a;
}

.form-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Responsive adjustment for Fold and mobile devices */
@media (max-width: 768px) {
  /* Deliverables & Packages: Row 1 = Controls + Title + Action button, Row 2 = Cost Chips */
  .wbs-deliverable-card:not(.is-collapsed) .wbs-deliverable-header-left,
  .wbs-package-card:not(.is-collapsed) .wbs-package-header-left {
    flex-wrap: wrap !important;
  }
  .wbs-deliverable-card:not(.is-collapsed) .wbs-cost-chips,
  .wbs-package-card:not(.is-collapsed) .wbs-cost-chips {
    width: 100%;
    padding-left: 24px;
    margin-top: 3px;
  }

  .btn-task-action {
    padding: 3px 6px;
    font-size: 10.5px;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .project-header-top {
    flex-direction: column;
  }
}

/* WBS Step Linked Planner Tasks (Inline expandable sub-list) */
.wbs-step-linked-tasks {
  margin-top: 4px;
  margin-left: 20px;
  margin-bottom: 4px;
  padding: 6px 8px;
  background: #fdfefe;
  border: 1px solid #e0e7ff;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.linked-tasks-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 2px;
}
.linked-task-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  font-size: 11.5px;
  transition: all 0.12s ease;
}
.linked-task-subitem:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.linked-task-subitem-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.linked-task-title {
  color: #1e293b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.linked-task-title:hover {
  color: #2563eb;
  text-decoration: underline;
}
.linked-task-title.done {
  text-decoration: line-through;
  color: #94a3b8;
}
.linked-task-date-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}
.linked-task-subitem-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.btn-unlink-planner-task {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
}
.btn-unlink-planner-task:hover {
  color: #ef4444;
  background: #fee2e2;
}

