:root {
  /* Spacing */
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Tailwind gray palette */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* Brand primary palette */
  --primary-25:  #f0f0ff;
  --primary-50:  #e8e8ff;
  --primary-100: #d4d4fe;
  --primary-200: #b3b3fc;
  --primary-300: #8585f9;
  --primary-400: #5252f4;
  --primary-500: #2323e0;
  --primary-600: #0000c4;
  --primary-700: #000097;
  --primary-800: #00006e;
  --primary-900: #00004a;

  /* Semantic color tokens (mapped to gray) */
  --color-text:          var(--gray-800);
  --color-text-muted:    var(--gray-500);
  --color-border:        var(--gray-300);
  --color-border-light:  var(--gray-200);
  --color-border-subtle: var(--gray-100);
  --color-bg-subtle:     var(--gray-100);
  --color-bg-faint:      var(--gray-50);
  --color-white:         white;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-white);
  color: var(--color-text);
}

/* ─── Lucide icon sizing ────────────────────────────────────────────────────── */

.icon-sm {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-xs {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Utility classes */

.text-muted {
  color: var(--color-text-muted);
  font-size: 14px;
}

.form-description {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: var(--space-24);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.task-form-group {
  margin-bottom: 0;
}

.form-summary-line {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-16);
}

/* Layout */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-32) var(--space-24);
}

.header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-16) var(--space-24);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.header-title {
  font-size: 18px;
  font-weight: 500;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

.breadcrumb-link {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--primary-600);
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: var(--space-32);
  margin-top: var(--space-24);
}

.form-group {
  margin-bottom: var(--space-24);
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--space-8);
  color: var(--color-text);
}

label .required {
  color: #d14343;
}

/* ─── Custom select (shadcn-style, replaces native <select>) ────────────── */

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 var(--space-12);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
}

.custom-select-trigger:hover {
  border-color: var(--gray-300);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.custom-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-value.is-placeholder {
  color: var(--gray-400);
}

.select-arrow {
  color: var(--gray-500);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}

.custom-select.open .select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.1);
  z-index: 300;
  padding: 4px;
  min-width: 100%;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px var(--space-8);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text);
  gap: var(--space-8);
  transition: background 0.1s;
}

.custom-select-option:hover {
  background: var(--gray-100);
}

.custom-select-option.selected {
  color: var(--primary-600);
  font-weight: 500;
}

.custom-select-option.selected .check-icon {
  display: flex;
}

.check-icon {
  display: none;
  flex-shrink: 0;
  color: var(--primary-600);
}

/* ─── Base form controls (shadcn-style) ──────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-12);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  height: auto;
  padding: var(--space-8) var(--space-12);
  resize: vertical;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

/* Disabled placeholder option in select */
select option[disabled] {
  color: var(--gray-400);
}

/* Hover */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
textarea:hover,
select:hover {
  border-color: var(--gray-300);
}

/* Focus */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* Disabled */
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-50);
}

/* Error state */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #ef4444;
}

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15);
}

/* Select custom chevron */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
  cursor: pointer;
}

.companies-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-12);
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: var(--color-white);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.companies-trigger:hover {
  border-color: var(--gray-400);
}

.filter-dropdown.open .companies-trigger {
  border-color: var(--gray-800);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.companies-chips-inline {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  overflow: hidden;
}

.companies-placeholder {
  flex: 1;
  font-size: 14px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.companies-more {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--gray-100);
  border-radius: 99px;
  padding: 1px 7px;
}

.company-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--primary-50);
  color: var(--primary-700);
  border: 1px solid var(--primary-200);
  border-radius: 99px;
  padding: 2px 6px 2px 9px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 160px;
}

.company-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-400);
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.chip-remove:hover {
  color: var(--primary-700);
}


.button-group {
  display: flex;
  gap: var(--space-12);
  justify-content: flex-end;
  margin-top: var(--space-32);
}

.btn {
  padding: 10px var(--space-24);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-sm {
  padding: var(--space-6) var(--space-12);
  font-size: 13px;
}

.btn-primary {
  background: var(--primary-600);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-200);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-subtle);
}

.btn-danger {
  background: #d14343;
  color: var(--color-white);
}

.btn-danger:hover {
  background: #b33535;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.task-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-20);
}

.task-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.task-number {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}

.task-title {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.task-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
}

.table-container {
  background: var(--color-white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.table th {
  padding: var(--space-12) var(--space-16);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-100);
}

.table td {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 14px;
}

.table tbody tr {
  cursor: pointer;
  transition: background 0.2s;
}

.table tbody tr:hover {
  background: var(--color-bg-faint);
}

.status-badge {
  display: inline-block;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-not-started {
  background: #fcebeb;
  color: #a32d2d;
}

.status-in-progress {
  background: #faeeda;
  color: #854f0b;
}

.status-completed {
  background: #e6f1fb;
  color: #185fa5;
}

.progress-circles {
  display: flex;
  gap: var(--space-6);
}

.progress-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-white);
}

.progress-circle.filled {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.workflow-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-32);
}

.workflow-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
  margin-bottom: var(--space-32);
  padding-bottom: var(--space-24);
  border-bottom: 1px solid var(--color-border-subtle);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.meta-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.meta-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

.workflow-diagram {
  background: var(--color-bg-faint);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-32);
  margin-bottom: var(--space-32);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Workflow diagram with zoom controls ──────────────────────────────────── */

.wf-diagram-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  overflow: hidden;
  margin-bottom: var(--space-32);
  background: var(--color-bg-faint);
}

.wf-diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-12) var(--space-16);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-white);
}

.wf-zoom-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.wf-zoom-label {
  font-size: 12px;
  color: var(--color-text-muted);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wf-zoom-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.wf-zoom-btn:hover {
  background: var(--color-bg-subtle);
}

.wf-zoom-reset-btn {
  font-size: 11px;
  width: auto;
  padding: 0 var(--space-8);
}

.wf-diagram-scroll {
  overflow: auto;
  height: 420px;
  background: var(--color-bg-faint);
}

#wfSizeAdjuster {
  position: relative;
  /* width + height driven by JS so the scroll container tracks the visual size */
}

#wfdesigner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  transition: transform 0.15s ease;
}

.diagram-placeholder {
  text-align: center;
  color: var(--color-text-muted);
}

.diagram-caption {
  margin-top: var(--space-16);
  font-size: 13px;
  color: var(--color-text-muted);
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: var(--space-16);
  color: var(--color-text);
}

.task-detail-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: var(--space-16);
  margin-bottom: var(--space-12);
}

.task-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-12);
}

.task-detail-title {
  font-size: 15px;
  font-weight: 500;
}

.task-detail-meta {
  display: flex;
  gap: var(--space-24);
  font-size: 13px;
  color: var(--color-text-muted);
}

.hidden {
  display: none !important;
}

.page-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: var(--space-8);
}

/* ─── Step indicator (wizard progress) ──────────────────────────────────────── */

.step-indicator {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-24);
  padding-bottom: var(--space-24);
  border-bottom: 1px solid var(--color-border-light);
}

.step-indicator-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-shrink: 0;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--color-white);
  color: var(--gray-400);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
}

.step-indicator-item--active .step-circle {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: white;
}

.step-indicator-item--active .step-label {
  color: var(--gray-800);
}

.step-indicator-item--completed .step-circle {
  border-color: var(--primary-600);
  background: var(--primary-50);
  color: var(--primary-600);
}

.step-indicator-item--completed .step-label {
  color: var(--gray-500);
}

.step-indicator-divider {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 var(--space-16);
  min-width: var(--space-32);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: var(--space-16);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.back-button:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

/* Filter panel */

.filter-panel {
  margin-top: 0;
  margin-bottom: var(--space-16);
  padding: var(--space-20) var(--space-24);
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-16);
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.filter-dropdown {
  position: relative;
}

.filter-trigger {
  width: 100%;
  padding: 0 var(--space-12);
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--color-text);
}

.filter-trigger:focus {
  outline: none;
  border-color: var(--gray-800);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.filter-arrow {
  color: var(--color-text-muted);
  margin-left: var(--space-8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.filter-dropdown.open .filter-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  padding: var(--space-8);
  min-width: 220px;
}

.filter-search {
  width: 100%;
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-text);
  box-sizing: border-box;
  background-image: none;
  padding-right: var(--space-8);
}

.filter-search:focus {
  outline: none;
  border-color: var(--gray-800);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
  color: var(--color-text);
  margin-bottom: 0;
}

.filter-option:hover {
  background: var(--color-bg-subtle);
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: var(--space-8);
  align-items: flex-end;
  flex-shrink: 0;
  padding-bottom: 0;
}

/* ─── Notion-style view tab bar ─────────────────────────────────────────────── */

.db-view-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-16);
}

.db-view-tabs {
  display: flex;
  align-items: center;
}

.db-view-tab {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-12);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}

.db-view-tab:hover {
  color: var(--gray-800);
  background: var(--gray-100);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.db-view-tab--active {
  color: var(--gray-800);
  border-bottom-color: var(--gray-800);
}

/* Bulk action toolbar */

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  background: #e6f1fb;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-12);
}

.bulk-count {
  font-size: 14px;
  font-weight: 500;
  color: #185fa5;
  flex: 1;
}

/* Kanban board */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-16);
  margin-top: 0;
}

.kanban-col {
  background: var(--color-bg-subtle);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: var(--space-16);
  min-height: 400px;
}

.kanban-col-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

.kanban-col-count {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary-600);
  border-radius: 10px;
  padding: 1px var(--space-6);
  font-size: 11px;
  margin-left: var(--space-6);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-height: 50px;
}

.kanban-cards.drag-over {
  background: rgba(44,44,42,0.04);
  border-radius: var(--radius-md);
}

.kanban-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-16);
  cursor: grab;
  transition: box-shadow 0.15s, opacity 0.15s;
}

.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kanban-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.kanban-card-company {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.kanban-card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

/* Expandable task cards */

.task-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
  overflow: hidden;
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.task-card-header:hover {
  background: var(--color-bg-subtle);
}

.task-card-num {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}

.task-card-title {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.task-card-chevron {
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.task-card.expanded .task-card-chevron {
  transform: rotate(180deg);
}

.task-card-body {
  display: none;
  padding: var(--space-16);
  padding-top: 0;
  border-top: 1px solid var(--color-border-subtle);
}

.task-card.expanded .task-card-body {
  display: block;
}

.task-card-meta-row {
  display: flex;
  gap: var(--space-24);
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-12);
  padding-top: var(--space-12);
  flex-wrap: wrap;
}

.task-type-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--gray-100);
  border-radius: 99px;
  padding: 2px 10px;
  flex-shrink: 0;
}

.task-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  padding-top: var(--space-12);
}

.task-form-group--check {
  display: flex;
  align-items: center;
}

/* ─── Task timeline (detail view) ─────────────────────────────────────────── */

.task-progress-summary {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-20);
}

.task-progress-label {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.task-progress-track {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  background: var(--primary-600);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.task-progress-pct {
  font-size: 12px;
  color: var(--color-text-muted);
  min-width: 32px;
  text-align: right;
}

.task-timeline {
  display: flex;
  flex-direction: column;
}

.task-timeline-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: var(--space-12);
  align-items: flex-start;
}

.task-timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 3px;
}

.task-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-timeline-dot--completed   { background: #22c55e; }
.task-timeline-dot--in-progress { background: #f97316; }
.task-timeline-dot--not-started { background: var(--gray-300); border: 2px solid var(--gray-300); }

.task-timeline-connector {
  width: 2px;
  flex: 1;
  min-height: 24px;
  background: var(--gray-200);
  margin: 4px 0;
}

.task-timeline-content {
  padding-bottom: var(--space-16);
}

.task-timeline-main {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.task-timeline-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.task-timeline-meta {
  display: flex;
  gap: var(--space-16);
  font-size: 13px;
  color: var(--color-text-muted);
  align-items: center;
  flex-wrap: wrap;
}

.task-timeline-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-timeline-right {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding-top: 1px;
  flex-shrink: 0;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

/* Toast notifications */

.toast-container {
  position: fixed;
  top: var(--space-24);
  right: var(--space-24);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toast-in 0.2s ease-out;
}

.toast.toast-out {
  animation: toast-out 0.2s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

.toast-success { background: #e6f1fb; color: #185fa5; border: 1px solid #b3d4f5; }
.toast-error   { background: #fcebeb; color: #a32d2d; border: 1px solid #f5b3b3; }
.toast-warning { background: #faeeda; color: #854f0b; border: 1px solid #f5d9a3; }
.toast-info    { background: #f0f0ee; color: var(--color-text); border: 1px solid var(--color-border); }

.toast-message { flex: 1; }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  color: inherit;
}

.toast-close:hover { opacity: 1; }

/* Empty states */

.empty-state {
  text-align: center;
  padding: 64px var(--space-32);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--space-16);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.empty-state-desc {
  font-size: 14px;
  margin-bottom: var(--space-24);
}

/* Loading skeletons */

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.skeleton {
  background: #e5e5e0;
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-row td {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-border-subtle);
}

.skeleton-cell {
  height: 14px;
  border-radius: var(--radius-sm);
  background: #e5e5e0;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
