/* Modern color theme */
.pipeline-board {
  --background: #f8fafc;
  --column-bg: #ffffff;
  --column-border: #e2e8f0;
  --kanban-column-width: 380px;
  --kanban-summary-column-min-width: 250px;
  --kanban-summary-column-max-width: 360px;
  --header-bg: #f1f5f9;
  --header-text: #111827;
  --muted-text: #6b7280;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --accent: #3b82f6;
  --card-hover-bg: #f0f8ff;
  --card-selected-bg: #e6f7ff;
  background: var(--background);
  color: var(--header-text);
}

body.dark-mode .pipeline-board {
  --background: #1e293b;
  --column-bg: #334155;
  --column-border: #475569;
  --header-bg: #475569;
  --header-text: #f1f5f9;
  --muted-text: #94a3b8;
  --card-bg: #334155;
  --card-border: #475569;
  --accent: #3b82f6;
  --card-hover-bg: #1e3a8a;
  --card-selected-bg: #1e40af;
}

body.dark-mode .pipeline-board .pipeline-table__status-pill.is-open {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

body.dark-mode .pipeline-board .pipeline-table__status-pill.is-closed {
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

body.dark-mode .pipeline-board .pipeline-table__row:hover td {
  background: rgba(51, 65, 85, 0.88);
}

body.dark-mode .pipeline-board .pipeline-table__row.is-selected td {
  background: rgba(30, 64, 175, 0.36);
}

.pipeline-board a {
  color: var(--accent);
}

.pipeline-board a:hover {
  color: #2563eb;
}

body.dark-mode .pipeline-board a {
  color: #9ec5fe;
}

body.dark-mode .pipeline-board a:hover {
  color: #6ea8fe;
}

.pipeline-board__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

/* ------------------------------
   Kanban Board Styles
------------------------------ */
.pipeline-board #boardContainer {
  flex-grow: 1;
  overflow: hidden; /* Don't force a scrollbar here */
  display: flex;
  flex-direction: column;
}

.pipeline-board .pipeline-table {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
  height: 100%;
}

.pipeline-board .pipeline-table__meta {
  font-size: 0.78rem;
  color: var(--muted-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pipeline-board .pipeline-table__scroll {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  max-height: 70vh;
  padding: 0.35rem 0.45rem 0.65rem;
}

body.dark-mode .pipeline-board .pipeline-table__scroll {
  border-color: rgba(148, 163, 184, 0.3);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.94) 100%);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.45);
}

.pipeline-summary .pipeline-board .pipeline-table__scroll {
  max-height: 60vh;
}

.pipeline-board .pipeline-table__table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 0.42rem;
  color: var(--header-text);
  font-size: 0.84rem;
}

.pipeline-board .pipeline-table__table th,
.pipeline-board .pipeline-table__table td {
  padding: 0.56rem 0.7rem;
  vertical-align: middle;
  border: 0;
}

.pipeline-board .pipeline-table__table thead th {
  position: sticky;
  z-index: 3;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  color: var(--header-text);
  font-weight: 600;
  white-space: nowrap;
}

body.dark-mode .pipeline-board .pipeline-table__table thead th {
  background: rgba(15, 23, 42, 0.82);
}

.pipeline-board .pipeline-table__sort-row th {
  top: 0;
  z-index: 4;
  padding-top: 0.38rem;
  padding-bottom: 0.3rem;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pipeline-board .pipeline-table__filter-row th {
  top: 2.45rem;
  z-index: 3;
  padding: 0.2rem 0.32rem 0.35rem;
}

.pipeline-board .pipeline-table__table thead th:first-child {
  width: 2.6rem;
  text-align: center;
}

.pipeline-board .pipeline-table__table thead th:nth-child(2),
.pipeline-board .pipeline-table__table tbody td:nth-child(2) {
  width: 3.1rem;
  text-align: center;
}

.pipeline-board .pipeline-table__table thead th:nth-child(2) .pipeline-table__header-label {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.pipeline-board .pipeline-table__sort-button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  width: 100%;
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font: inherit;
  font-weight: inherit;
  padding: 0.38rem 0.48rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pipeline-board .pipeline-table__header-label {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  padding: 0.38rem 0.48rem;
  color: rgba(100, 116, 139, 0.9);
}

body.dark-mode .pipeline-board .pipeline-table__header-label {
  color: rgba(203, 213, 225, 0.85);
}

.pipeline-board .pipeline-table__sort-button:hover {
  background: rgba(148, 163, 184, 0.16);
}

body.dark-mode .pipeline-board .pipeline-table__sort-button:hover {
  background: rgba(71, 85, 105, 0.35);
}

.pipeline-board .pipeline-table__sort-button.is-active {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.pipeline-board .pipeline-table__sort-indicator {
  opacity: 0.76;
  font-size: 0.74rem;
  line-height: 1;
}

.pipeline-board .pipeline-table__sort-button.is-active .pipeline-table__sort-indicator {
  opacity: 1;
}

.pipeline-board .pipeline-table__filter-input {
  width: 100%;
  min-width: 96px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  padding: 0.28rem 0.56rem;
  font-size: 0.76rem;
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.88);
}

body.dark-mode .pipeline-board .pipeline-table__filter-input {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.78);
  color: #e2e8f0;
}

.pipeline-board .pipeline-table__filter-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}

.pipeline-board .pipeline-table__row td {
  background: var(--column-bg);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.pipeline-board .pipeline-table__row td:first-child {
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px 0 0 12px;
}

.pipeline-board .pipeline-table__row td:last-child {
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0 12px 12px 0;
}

body.dark-mode .pipeline-board .pipeline-table__row td {
  border-top-color: rgba(148, 163, 184, 0.22);
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .pipeline-board .pipeline-table__row td:first-child {
  border-left-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .pipeline-board .pipeline-table__row td:last-child {
  border-right-color: rgba(148, 163, 184, 0.22);
}

.pipeline-board .pipeline-table__row:hover td {
  background: rgba(219, 234, 254, 0.8);
  border-top-color: rgba(96, 165, 250, 0.42);
  border-bottom-color: rgba(96, 165, 250, 0.42);
}

.pipeline-board .pipeline-table__row.is-selected td {
  background: rgba(191, 219, 254, 0.72);
  border-top-color: rgba(59, 130, 246, 0.5);
  border-bottom-color: rgba(59, 130, 246, 0.5);
}

.pipeline-board .pipeline-table__row-select,
.pipeline-board .pipeline-table__select-all {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.pipeline-board .pipeline-table__link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.pipeline-board .pipeline-table__link-button:hover,
.pipeline-board .pipeline-table__link-button:focus-visible {
  color: #1d4ed8;
  outline: none;
}

.pipeline-board .pipeline-table__link-button--primary {
  color: var(--header-text);
  font-weight: 700;
}

body.dark-mode .pipeline-board .pipeline-table__link-button--primary {
  color: #f8fafc;
}

.pipeline-board .pipeline-table__icon-button {
  width: 30px;
  height: 30px;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(59, 130, 246, 0.26);
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  padding: 0;
}

.pipeline-board .pipeline-table__icon-button-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pipeline-board .pipeline-table__candidate-preview {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  cursor: zoom-in;
}

.pipeline-table__image-tooltip {
  position: fixed;
  z-index: 12000;
  width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pipeline-table__image-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pipeline-table__image-tooltip-image {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: rgba(148, 163, 184, 0.2);
}

.pipeline-table__image-tooltip-label {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #475569;
}

body.dark-mode .pipeline-table__image-tooltip {
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.55);
}

body.dark-mode .pipeline-table__image-tooltip-label {
  color: #cbd5e1;
}

.pipeline-board .pipeline-table__icon-button i {
  font-size: 0.92rem;
  line-height: 1;
}

.pipeline-board .pipeline-table__icon-button--recruiter {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

.pipeline-board .pipeline-table__icon-button--recruiter .recruiter-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.pipeline-board .pipeline-table__icon-button--recruiter:hover,
.pipeline-board .pipeline-table__icon-button--recruiter:focus-visible {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(14, 165, 233, 0.5);
}

.pipeline-board .pipeline-table__icon-button:hover,
.pipeline-board .pipeline-table__icon-button:focus-visible {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: #1d4ed8;
}

body.dark-mode .pipeline-board .pipeline-table__icon-button {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

body.dark-mode .pipeline-board .pipeline-table__icon-button--recruiter {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.22);
}

body.dark-mode .pipeline-board .pipeline-table__icon-button:hover,
body.dark-mode .pipeline-board .pipeline-table__icon-button:focus-visible {
  background: rgba(56, 189, 248, 0.28);
  color: #bae6fd;
}

.pipeline-board .pipeline-table__list-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.16rem 0.58rem;
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(241, 245, 249, 0.95);
}

.pipeline-board .pipeline-table__cell-muted {
  color: var(--muted-text);
}

.pipeline-board .pipeline-table__date {
  font-variant-numeric: tabular-nums;
  color: var(--muted-text);
}

.pipeline-board .pipeline-table__date--overdue {
  color: #b91c1c;
  font-weight: 600;
}

.pipeline-board .pipeline-table__date--done {
  color: #15803d;
  font-weight: 600;
}

.pipeline-board .pipeline-table__status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.69rem;
  padding: 0.18rem 0.52rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pipeline-board .pipeline-table__status-pill.is-open {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.pipeline-board .pipeline-table__status-pill.is-closed {
  background: rgba(100, 116, 139, 0.2);
  color: #475569;
}

.pipeline-board .pipeline-table__empty-row td {
  text-align: center;
  color: var(--muted-text);
  font-style: italic;
  padding: 1rem 0.75rem;
  background: transparent !important;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
}

/* The board remains a single horizontal line */
.pipeline-board #kanbanBoard {
  display: flex;
  gap: 0; /* Minimal gap */
  overflow-x: auto;
  padding: 0;
  margin: 0;
}

/* Collapse card container when column is collapsed */
.pipeline-board .kanban-column.collapsed .kanban-card-container {
  display: none;
}

/* Responsive: stack columns vertically on narrow screens */
@media (max-width: 600px) {
  .pipeline-board #kanbanBoard {
    flex-direction: column;
    overflow-x: hidden;
  }
  .pipeline-board .kanban-column,
  .pipeline-board .kanban-column.empty-list {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
  }

  .pipeline-board .kanban-card-container,
  .pipeline-board .clusterize-scroll,
  .pipeline-board .pipeline-table__scroll,
  .pipeline-board #boardContainer,
  .pipeline-summary .pipeline-board #boardContainer,
  .pipeline-summary .pipeline-board .kanban-card-container,
  .pipeline-summary .pipeline-board .clusterize-scroll,
  .pipeline-summary .pipeline-board .pipeline-table__scroll {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
  }
}

.pipeline-board #kanbanBoard.hide-closed .kanban-card.closed-card {
  display: none !important;
}

/* Base styling for all columns (active ones fill available space) */
.pipeline-board .kanban-column {
  box-sizing: border-box;
  background: var(--column-bg);
  border: 1px solid var(--column-border);
  flex: 0 0 var(--kanban-column-width);
  max-width: var(--kanban-column-width);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  position: relative;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Standard header styles */
.pipeline-board .kanban-column-header {
  display: flex;
  align-items: center;   /* Vertically center children */
  justify-content: center;
  gap: 4px;              /* Space between children */
  background: var(--header-bg);
  margin-right: 4px;
  padding: 2px 6px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  color: var(--header-text);
  min-width: 0;
  box-sizing: border-box;
}

.pipeline-board .kanban-column-header .list-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 4px;
  border-radius: 4px;
}

  /* Hide card container in empty columns */
  .pipeline-board .kanban-column.empty-list .kanban-card-container {
  display: none !important;
  }

  /* Collapsed header as a flex container */
  .pipeline-board .kanban-column.empty-list .kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 100%;
  background: var(--header-bg);
  overflow: hidden;
  position: relative;
  }

  /* Rotated header text */
  .pipeline-board .kanban-column.empty-list .kanban-column-header .rotated-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 9px;
  font-weight: normal;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  }
/* Only add a small gap between non-empty columns */
.pipeline-board .kanban-column:not(.empty-list) + .kanban-column:not(.empty-list) {
  margin-left: 1px;
  margin-right: 1px;
}

/* ------------------------------
   Empty Column Aggregation & Responsive Expansion
------------------------------ */
/* Empty columns default to a very narrow width */
  .pipeline-board .kanban-column.empty-list {
  flex: 0 0 auto;
  width: 20px;             /* Minimal width for an empty column */
  margin: 0;
  padding: 0;
  position: relative;
  transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  }

  /* When dragging over an empty column, expand it, change its background, and add a shadow */
.pipeline-board .kanban-column.empty-list.dragover {
  width: 100px;
  background-color: var(--background); /* Light highlight */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* ------------------------------
   End of the Road Action Menu
------------------------------ */
.pipeline-end-of-road-menu {
  position: absolute;
  z-index: 2000;
  display: none;
  background: var(--column-bg, #ffffff);
  color: var(--header-text, #111827);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  padding: 10px 0;
  min-width: 220px;
  max-width: 280px;
  font-size: 0.875rem;
}

body.dark-mode .pipeline-end-of-road-menu {
  background: rgba(30, 41, 59, 0.98);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.5);
}

.pipeline-end-of-road-menu__title {
  font-weight: 600;
  padding: 0 16px 4px;
}

.pipeline-end-of-road-menu__helper {
  padding: 0 16px 10px;
  color: rgba(15, 23, 42, 0.65);
  font-size: 0.8rem;
}

body.dark-mode .pipeline-end-of-road-menu__helper {
  color: rgba(226, 232, 240, 0.7);
}

.pipeline-end-of-road-menu__option-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.pipeline-end-of-road-menu__option-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.pipeline-end-of-road-menu__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 4px;
  border-left: 3px solid transparent;
  border-radius: 6px;
}

.pipeline-end-of-road-menu__group-title {
  padding: 6px 16px 2px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.7);
  font-weight: 700;
}

body.dark-mode .pipeline-end-of-road-menu__group-title {
  color: rgba(226, 232, 240, 0.75);
}

.pipeline-end-of-road-menu__group-list {
  display: flex;
  flex-direction: column;
}

.pipeline-end-of-road-menu__group[data-group="candidate"] {
  border-color: rgba(34, 197, 94, 0.6);
}

.pipeline-end-of-road-menu__group[data-group="client"] {
  border-color: rgba(59, 130, 246, 0.6);
}

.pipeline-end-of-road-menu__group[data-group="other"] {
  border-color: rgba(148, 163, 184, 0.7);
}

.pipeline-end-of-road-menu__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  font: inherit;
}

.pipeline-end-of-road-menu__option:hover,
.pipeline-end-of-road-menu__option:focus {
  background: rgba(59, 130, 246, 0.1);
  outline: none;
}

body.dark-mode .pipeline-end-of-road-menu__option:hover,
body.dark-mode .pipeline-end-of-road-menu__option:focus {
  background: rgba(59, 130, 246, 0.18);
}

.pipeline-end-of-road-menu__option:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: -2px;
}

.pipeline-end-of-road-menu__label {
  flex: 1;
}

.pipeline-end-of-road-menu__check {
  opacity: 0;
  font-weight: 600;
  color: var(--accent, #3b82f6);
  transition: opacity 0.15s ease;
}

.pipeline-end-of-road-menu__option--selected .pipeline-end-of-road-menu__check {
  opacity: 1;
}

.pipeline-end-of-road-status {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: right;
  color: rgba(33, 37, 41, 0.75);
}

.pipeline-end-of-road-status--visible {
  display: block;
}

.pipeline-end-of-road-status[data-variant="success"] {
  color: #0f5132;
}

.pipeline-end-of-road-status[data-variant="error"] {
  color: #842029;
}

body.dark-mode .pipeline-end-of-road-status {
  color: rgba(248, 249, 250, 0.72);
}

body.dark-mode .pipeline-end-of-road-status[data-variant="success"] {
  color: #6dd9a0;
}

body.dark-mode .pipeline-end-of-road-status[data-variant="error"] {
  color: #ffb3b3;
}

body.dark-mode .pipeline-end-of-road-modal__helper {
  color: rgba(226, 232, 240, 0.75);
}

.pipeline-end-of-road-modal__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 8px 0 0;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.pipeline-end-of-road-modal__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: start;
  width: 100%;
}

.pipeline-end-of-road-modal__options {
  min-width: 0;
  width: 100%;
}

.pipeline-end-of-road-modal__reason {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pipeline-end-of-road-modal__reason-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.pipeline-end-of-road-modal__reason-input {
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: inherit;
  font: inherit;
  resize: vertical;
}

body.dark-mode .pipeline-end-of-road-modal__reason-input {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.45);
}

.pipeline-end-of-road-modal__reason-input:focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}

.pipeline-end-of-road-modal__helper {
  margin: 0;
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.95rem;
}

.pipeline-end-of-road-modal__option-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pipeline-end-of-road-modal__option {
  width: 100%;
}

/* Share template modal */
body.share-template-modal-open {
  overflow: hidden;
}

.share-template-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}

.share-template-modal {
  background: #ffffff;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

body.dark-mode .share-template-modal {
  background: #1e293b;
  color: #f1f5f9;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.share-template-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-template-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.share-template-modal__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.share-template-modal__close:hover,
.share-template-modal__close:focus {
  background: rgba(15, 23, 42, 0.08);
  transform: scale(1.05);
}

body.dark-mode .share-template-modal__close:hover,
body.dark-mode .share-template-modal__close:focus {
  background: rgba(148, 163, 184, 0.2);
}

.share-template-modal__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-template-modal__option {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.share-template-modal__option:hover,
.share-template-modal__option:focus {
  background: #eff6ff;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.18);
  transform: translateY(-1px);
}

.share-template-modal__option:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.share-template-modal__option:disabled:hover,
.share-template-modal__option:disabled:focus {
  background: #e2e8f0;
  box-shadow: none;
  transform: none;
  outline: none;
}

.share-template-modal__option:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

body.dark-mode .share-template-modal__option {
  background: #243044;
  border-color: #334155;
}

body.dark-mode .share-template-modal__option:hover,
body.dark-mode .share-template-modal__option:focus {
  background: #1e3a8a;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.32);
}

body.dark-mode .share-template-modal__option:disabled {
  background: #1f2937;
  border-color: #334155;
  color: #64748b;
  box-shadow: none;
}

body.dark-mode .share-template-modal__option:disabled:hover,
body.dark-mode .share-template-modal__option:disabled:focus {
  background: #1f2937;
  box-shadow: none;
  transform: none;
  outline: none;
}

body.package-modal-open {
  overflow: hidden;
}

.package-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10000;
}

body.dark-mode .package-modal-overlay {
  background: rgba(15, 23, 42, 0.7);
}

.package-modal {
  width: min(96vw, 1400px);
  max-height: 90vh;
  --accent: #3b82f6;
  --header-text: #0f172a;
  --muted-text: #64748b;
  background: #ffffff;
  color: var(--header-text);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dark-mode .package-modal {
  --accent: #60a5fa;
  --header-text: #f1f5f9;
  --muted-text: #cbd5f5;
  background: #1f2937;
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
}


.package-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 12px;
}

.package-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.package-modal__subtitle {
  flex: 1;
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-top: 4px;
}

body.dark-mode .package-modal__subtitle {
  color: var(--muted-text);
}

.package-modal__close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted-text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.package-modal__close:hover,
.package-modal__close:focus {
  color: var(--header-text);
  background: rgba(15, 23, 42, 0.08);
  outline: none;
}

body.dark-mode .package-modal__close:hover,
body.dark-mode .package-modal__close:focus {
  background: rgba(148, 163, 184, 0.2);
}

.package-modal__body {
  flex: 1;
  padding: 0 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.package-modal__loading {
  text-align: center;
  color: var(--muted-text);
  padding: 48px 0;
  font-style: italic;
}

.package-modal__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.package-modal__label {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  color: var(--header-text);
}

.package-modal__label--inline {
  margin-top: 12px;
}

.package-modal__columns {
  display: flex;
  gap: 24px;
}

.package-modal__column {
  flex: 1 1 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark-mode .package-modal__column {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

.package-modal__column-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.package-modal__textarea,
.package-modal__input,
.package-modal__select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  padding: 10px 12px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.package-modal__textarea:focus,
.package-modal__input:focus,
.package-modal__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

body.dark-mode .package-modal__textarea,
body.dark-mode .package-modal__input,
body.dark-mode .package-modal__select {
  background: rgba(15, 23, 42, 0.9);
  color: var(--header-text);
  border-color: rgba(148, 163, 184, 0.4);
}

.package-modal__textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.package-modal__textarea--comment {
  min-height: 80px;
  font-size: 0.9rem;
}

.package-modal__textarea[disabled],
.package-modal__input[disabled] {
  background: #e2e8f0;
  color: rgba(15, 23, 42, 0.6);
}

body.dark-mode .package-modal__textarea[disabled],
body.dark-mode .package-modal__input[disabled] {
  background: rgba(30, 41, 59, 0.7);
  color: rgba(226, 232, 240, 0.6);
}

.package-modal__comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.package-modal__comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.package-modal__comment-type-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.package-modal__comment-type-pill {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muted-text);
  background: rgba(248, 250, 252, 0.8);
  cursor: pointer;
}

.package-modal__comment-type-pill.is-selected {
  color: var(--header-text);
  border-color: rgba(13, 110, 253, 0.45);
  background: rgba(13, 110, 253, 0.12);
}

.package-modal__comment-type-pill.is-partial {
  border-style: dashed;
}

body.dark-mode .package-modal__comment-type-pill {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.9);
}

body.dark-mode .package-modal__comment-type-pill.is-selected {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(96, 165, 250, 0.7);
  color: #eaf2ff;
}

.package-modal__text-button--inline {
  padding: 4px 10px;
  font-size: 0.85rem;
}

.package-modal__comment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #f8fafc;
}

.package-modal__comment--disabled {
  opacity: 0.6;
}

.package-modal__comment--collapsed .package-modal__textarea--comment {
  display: none;
}

.package-modal__comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-modal__comment-expand {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.package-modal__comment-expand:hover {
  color: var(--header-text);
}

body.dark-mode .package-modal__comment {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(148, 163, 184, 0.35);
}

.package-modal__comment-toggle {
  align-self: flex-start;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.package-modal__comment-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--header-text);
}

.package-modal__comment-preview {
  font-size: 0.86rem;
  color: var(--muted-text);
  max-height: 7.2rem;
  overflow: hidden;
}

.package-modal__comment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.package-modal__comment-preview .machine-comment {
  margin: 0;
}

.package-modal__comment-preview .machine-comment__body,
.package-modal__comment-preview .machine-comment__transcript pre {
  max-height: 6rem;
  overflow: auto;
}

.package-modal__empty {
  padding: 16px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted-text);
  text-align: center;
}

.package-modal__model-select {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.package-modal__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.package-modal__primary-button,
.package-modal__success-button,
.package-modal__text-button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.package-modal__primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.3);
}

.package-modal__primary-button:hover,
.package-modal__primary-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.35);
  outline: none;
}

.package-modal__success-button {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}

.package-modal__success-button:hover,
.package-modal__success-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(22, 163, 74, 0.35);
  outline: none;
}

.package-modal__text-button {
  background: transparent;
  color: var(--muted-text);
  padding-left: 12px;
  padding-right: 12px;
}

.package-modal__text-button:hover,
.package-modal__text-button:focus {
  color: var(--header-text);
  text-decoration: underline;
  outline: none;
}

.package-modal__primary-button[disabled],
.package-modal__success-button[disabled],
.package-modal__text-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.package-modal__status {
  padding: 0 24px;
  margin-top: 4px;
  font-size: 0.95rem;
  display: none;
}

.package-modal__status[data-variant='info'] {
  color: var(--muted-text);
}

.package-modal__status[data-variant='success'] {
  color: #15803d;
}

.package-modal__status[data-variant='error'] {
  color: #dc2626;
}

.package-modal__status[data-variant='warning'] {
  color: #d97706;
}

body.dark-mode .package-modal__status[data-variant='success'] {
  color: #34d399;
}

body.dark-mode .package-modal__status[data-variant='error'] {
  color: #f87171;
}

body.dark-mode .package-modal__status[data-variant='warning'] {
  color: #facc15;
}

@media (max-width: 960px) {
  .package-modal {
    width: 95%;
  }
}

@media (max-width: 720px) {
  .package-modal__columns {
    flex-direction: column;
  }

  .package-modal__column {
    width: 100%;
  }

  .package-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .package-modal__model-select {
    width: 100%;
  }

  .package-modal__primary-button,
  .package-modal__success-button,
  .package-modal__text-button {
    width: 100%;
  }
}
  /* Keep the header size stable during dragover */
  .pipeline-board .kanban-column.empty-list.dragover .kanban-column-header {
  transition: background-color 0.3s ease;
  }

  /* Show header text in normal orientation when an empty column is expanded */
  .pipeline-board .kanban-column.empty-list.dragover .kanban-column-header .rotated-header {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  font-size: 1em;
  font-weight: bold;
  color: inherit;
  padding: 0;
  }

/* When hovering over or dragging over an empty list, apply the same styles */

/* Collapse consecutive empty columns.
   (This rule hides an empty column if it immediately follows another.)
*/
.pipeline-board
  .kanban-column.empty-list
  + .kanban-column.empty-list:not(.empty-list--always-visible) {
  display: none;
}

/* Optionally, if supported, add a vertical line indicator to the first in a group */
.pipeline-board .kanban-column.empty-list:has(+ .kanban-column.empty-list)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--column-border);
}

/* Mobile overrides for empty columns */
@media (max-width: 600px) {
  .pipeline-board .kanban-column.empty-list {
  flex: 0 0 auto;
  max-width: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }
  .pipeline-board .kanban-column.empty-list.dragover {
  width: 100%;
  }
  .pipeline-board .kanban-column.empty-list .kanban-column-header {
  width: 100%;
  margin-right: 0;
  height: auto;
  }
  .pipeline-board .kanban-column.empty-list .kanban-column-header .rotated-header {
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
  font-size: 1em;
  font-weight: bold;
  color: inherit;
  padding: 0;
  }
}

/* ------------------------------
   Card Container and Card Styles
------------------------------ */
.pipeline-board .kanban-card-container {
  flex-grow: 1;
  margin: 0;
  padding: 2px;
  min-height: 10px;
  overflow-y: auto;
}

.pipeline-summary .pipeline-board #boardContainer {
  max-height: 60vh;
}

.pipeline-summary .pipeline-board .kanban-column:not(.empty-list) {
  flex: 0 0 var(--kanban-summary-column-min-width);
  min-width: var(--kanban-summary-column-min-width);
  max-width: var(--kanban-summary-column-max-width);
  overflow: hidden;
}

.pipeline-summary .pipeline-board .kanban-card {
  max-width: none;
}

.pipeline-summary .pipeline-board .card-content {
  overflow: hidden;
}

.pipeline-summary .pipeline-board .kanban-card-container {
  max-height: 60vh;
  min-height: 200px;
}

.pipeline-summary .pipeline-board .clusterize-scroll {
  max-height: 60vh;
}

@media (max-width: 600px) {
  .pipeline-board .kanban-column {
    flex: 0 0 auto;
  }
  .pipeline-summary .pipeline-board .kanban-column:not(.empty-list) {
    flex: 0 0 auto;
    max-width: none;
  }
  .pipeline-board .kanban-card-container,
  .pipeline-board .clusterize-scroll,
  .pipeline-board .pipeline-table__scroll,
  .pipeline-summary .pipeline-board #boardContainer,
  .pipeline-summary .pipeline-board .kanban-card-container,
  .pipeline-summary .pipeline-board .clusterize-scroll,
  .pipeline-summary .pipeline-board .pipeline-table__scroll {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
  }
}

.pipeline-board .kanban-card {
  background: transparent;
  margin: 6px 2px;
  padding: 0;
  width: 100%;
  max-width: 360px;
  margin-right: auto;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pipeline-board .kanban-card.glass-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.7));
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #0f172a;
  --header-text: #0f172a;
  --muted-text: rgba(30, 41, 59, 0.65);
}

.pipeline-board .kanban-card.glass-card .glass-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.7));
  color: inherit;
  text-shadow: none;
}

body.dark-mode .pipeline-board .kanban-card.glass-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.78), rgba(51, 65, 85, 0.52));
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffffff;
  --header-text: #f8fafc;
  --muted-text: rgba(226, 232, 240, 0.78);
}

body.dark-mode .pipeline-board .kanban-card.glass-card .glass-content {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.62));
  color: inherit;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.7);
}

.pipeline-board .kanban-card.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.pipeline-board .kanban-card.closed-card {
  opacity: 0.55;
  filter: grayscale(0.3);
}

/* ------------------------------
   List Select Button Styles
------------------------------ */
  .pipeline-board .list-select-button {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  box-sizing: border-box;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  margin-right: 4px;
  margin-bottom: 4px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-size: 0;
  }

  .pipeline-board .list-select-button.selected {
  background: var(--accent);
  border-color: var(--accent);
  }

.pipeline-board .list-select-button.selected::after {
  content: '✓';
  font-size: 10px;
  line-height: 12px;
  display: block;
  text-align: center;
  color: #fff;
}

/* Optionally, style the list name */
.pipeline-board .list-name {
  vertical-align: middle;
  font-size: 1em;
}

/* ------------------------------
   Card Action Buttons & Content
------------------------------ */
.pipeline-board .control-button {
  margin: 10px 10px 5px 0;
  padding: 4px 8px;
  font-size: 0.9em;
  cursor: pointer;
  position: relative;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  background: var(--header-bg);
  color: var(--header-text);
  border: 1px solid var(--column-border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pipeline-board .control-button .control-button__label {
  white-space: nowrap;
}

.pipeline-board #pipelineDialSmileButton {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.pipeline-board #pipelineDialSmileButton[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.14);
  border-color: var(--accent);
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.pipeline-board #pipelineDialSmileButton[aria-pressed="true"] i {
  color: inherit;
}

body.dark-mode .pipeline-board #pipelineDialSmileButton[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #bae6fd;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.26);
}

.pipeline-board .control-button.refreshing::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border: 2px solid var(--accent);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}
.pipeline-board .control-button.hidden-button {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  display: none;
}

@media (max-width: 640px) {
  .pipeline-board .control-button {
    padding: 4px;
    gap: 0;
  }

  .pipeline-board .control-button .control-button__label {
    display: none;
  }

  .pipeline-board .control-button i {
    margin-right: 0 !important;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card content container */
.pipeline-board .card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px;
  border-radius: 10px;
}

.pipeline-board .card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.pipeline-board .card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.pipeline-board .card-related-preview {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.pipeline-board .card-related-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pipeline-board .card-related-preview__fallback {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-text);
  position: relative;
  z-index: 1;
}

.pipeline-board .card-related-preview--loaded .card-related-preview__image {
  opacity: 1;
}

.pipeline-board .card-related-preview--loaded .card-related-preview__fallback {
  display: none;
}

.pipeline-board .card-related-preview--empty {
  opacity: 0.7;
}

.pipeline-board .card-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.pipeline-board .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--header-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-board .card-stage {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-text);
}

.pipeline-board .card-meta-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}

.pipeline-board .card-meta-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.pipeline-board .card-meta-controls .card-select-button {
  flex-shrink: 0;
}

.pipeline-board .card-package-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.08);
  color: var(--header-text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pipeline-board .card-package-button i {
  font-size: 0.75rem;
}

.pipeline-board .card-package-button:hover,
.pipeline-board .card-package-button:focus-visible {
  background: var(--accent);
  color: #fff;
}

.pipeline-board .card-package-button:disabled,
.pipeline-board .card-package-button.card-package-button--loading {
  opacity: 0.6;
  cursor: not-allowed;
}

body.dark-mode .pipeline-board .card-package-button {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

body.dark-mode .pipeline-board .card-package-button:hover,
body.dark-mode .pipeline-board .card-package-button:focus-visible {
  color: #fff;
}

.pipeline-board .card-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.1;
  background: rgba(15, 23, 42, 0.06);
  color: var(--header-text);
  white-space: nowrap;
  margin-left: auto;
  border: none;
  cursor: pointer;
  appearance: none;
}

.pipeline-board .card-meta-row > .card-date-pill:first-child {
  margin-left: 0;
}

body.dark-mode .pipeline-board .card-date-pill {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.pipeline-board .card-date-pill[data-variant="due-overdue"] {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.pipeline-board .card-date-pill[data-variant="due-soon"] {
  background: rgba(249, 115, 22, 0.18);
  color: #b45309;
}

.pipeline-board .card-date-pill[data-variant="due-upcoming"] {
  background: rgba(15, 23, 42, 0.08);
  color: var(--header-text);
}

.pipeline-board .card-date-pill[data-variant="due-complete"] {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.pipeline-board .card-date-pill:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

body.dark-mode .pipeline-board .card-date-pill:focus-visible {
  outline-color: #93c5fd;
}

body.dark-mode .pipeline-board .card-date-pill[data-variant="due-overdue"] {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

body.dark-mode .pipeline-board .card-date-pill[data-variant="due-soon"] {
  background: rgba(249, 115, 22, 0.24);
  color: #fdba74;
}

body.dark-mode .pipeline-board .card-date-pill[data-variant="due-upcoming"] {
  background: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

body.dark-mode .pipeline-board .card-date-pill[data-variant="due-complete"] {
  background: rgba(34, 197, 94, 0.26);
  color: #bbf7d0;
}

.pipeline-board .card-date-pill[data-variant="activity"] {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

body.dark-mode .pipeline-board .card-date-pill[data-variant="activity"] {
  background: rgba(96, 165, 250, 0.2);
  color: #bfdbfe;
}

.pipeline-board .card-date-icon {
  font-size: 0.85rem;
}

.pipeline-board .card-related-row {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.pipeline-board .card-related-icon-button {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.5);
  color: var(--header-text);
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body.dark-mode .pipeline-board .card-related-icon-button {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
}

.pipeline-board .card-related-icon-button:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.55);
  transform: translateY(-1px);
}

.pipeline-board .card-related-icon-button i {
  font-size: 0.65rem;
}

.pipeline-board .card-related-row > button {
  margin: 0;
  vertical-align: middle;
}

.pipeline-board .card-select-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.65rem;
  color: var(--header-text);
  margin: 0;
}

.pipeline-board .card-select-button.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pipeline-board .card-select-button.selected::after {
  content: '✓';
  line-height: 1;
}

body.dark-mode .pipeline-board .card-select-button {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(148, 163, 184, 0.4);
  color: #e2e8f0;
}

/* ------------------------------
   Override Empty List Hover & Dragover to Appear Non-Empty
------------------------------ */
/* Only apply these styles during dragover (keep collapsed columns readable on hover). */
.pipeline-board .kanban-column.empty-list.dragover .kanban-column-header {
  position: static !important; /* Remove absolute positioning */
  height: 40px !important;       /* Fixed height to avoid overlapping cards */
  max-height: 40px !important;
  width: auto !important;
  padding: 4px;                  /* Add padding like non-empty headers */
  overflow: hidden;
}

.pipeline-board .kanban-column.empty-list.dragover .kanban-card-container {
  display: block !important;
  margin-top: 4px; /* Space below the fixed header */
}
/* Additional UI Effects for Dragover on Empty Columns */
  .pipeline-board .kanban-column.empty-list.dragover {
  background-color: var(--background) !important;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2) !important;
  transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease !important;
  }


  /* Keep header stable when column expands during dragover */
  .pipeline-board .kanban-column.empty-list.dragover > .kanban-column-header {
  transition: background-color 0.3s ease !important;
  }


/* ------------------------------
   Delta card modal
------------------------------ */
body.delta-card-modal-open {
  overflow: hidden;
}

.delta-card-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  z-index: 10000;
}

body.dark-mode .delta-card-modal-overlay {
  background: rgba(15, 23, 42, 0.75);
}

.delta-card-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 90vw);
  height: min(720px, 85vh);
  min-width: 320px;
  min-height: 240px;
  max-width: 100%;
  max-height: 100%;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  resize: both;
}

body.dark-mode .delta-card-modal {
  background: rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

.delta-card-modal--fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  resize: none;
}

.delta-card-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  gap: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(226, 232, 240, 0.45));
}

body.dark-mode .delta-card-modal__header {
  border-color: rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.65));
}

.delta-card-modal__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.delta-card-modal .app-modal__title {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta-card-modal__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.delta-card-modal__button {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.8rem;
  background: rgba(59, 130, 246, 0.12);
  color: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.delta-card-modal__button:hover {
  background: rgba(59, 130, 246, 0.22);
  transform: translateY(-1px);
}

body.dark-mode .delta-card-modal__button {
  background: rgba(59, 130, 246, 0.18);
}

body.dark-mode .delta-card-modal__button:hover {
  background: rgba(148, 163, 184, 0.25);
}

.delta-card-modal__frame {
  flex: 1;
  border: none;
  background: #f8fafc;
}

body.dark-mode .delta-card-modal__frame {
  background: #0f172a;
}

@media (max-width: 768px) {
  .delta-card-modal-overlay {
    padding: 1rem;
  }

  .delta-card-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    resize: none;
  }
}
