@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ───── CSS Custom Properties ───── */
:root {
  /* Light mode (default) */
  --bg-primary: #ECEDE7;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-column: #F4F5F0;
  --bg-header: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-modal-overlay: rgba(16, 26, 40, 0.4);
  --bg-badge: #F0F1EB;
  --bg-tooltip: #101A28;

  --text-primary: #101A28;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;
  --text-tooltip: #ECEDE7;

  --border-primary: #D1D5DB;
  --border-subtle: #E5E7EB;

  --shadow-sm: 0 1px 2px rgba(16, 26, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 26, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 26, 40, 0.12);
  --shadow-card: 0 1px 3px rgba(16, 26, 40, 0.06);
  --shadow-card-hover: 0 8px 20px rgba(16, 26, 40, 0.1);

  /* Brand accents (same in both modes) */
  --green: #13D77A;
  --green-hover: #10C06D;
  --green-subtle: rgba(19, 215, 122, 0.1);
  --coral: #FFA987;
  --coral-subtle: rgba(255, 169, 135, 0.12);
  --aqua: #80D7DB;
  --aqua-subtle: rgba(128, 215, 219, 0.12);
  --yellow: #F7EE6C;
  --yellow-subtle: rgba(247, 238, 108, 0.15);
  --navy: #101A28;

  /* Category colors */
  --cat-cs-intelligence: #13D77A;
  --cat-devops: #80D7DB;
  --cat-cs-enablement: #13D77A;
  --cat-reliability: #FFA987;
  --cat-measurement: #F7EE6C;
  --cat-documentation: #80D7DB;
  --cat-governance: #FFA987;
  --cat-product-intelligence: #13D77A;
  --cat-infrastructure: #101A28;
  --cat-infrastructure-text: #FFFFFF;
  --cat-knowledge-mgmt: #80D7DB;
  --cat-uncategorized: #E5E7EB;
  --cat-uncategorized-text: #4B5563;

  /* Layout */
  --header-height: 64px;
  --controls-height: 64px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --transition: 0.3s ease;
}

/* ───── Dark Mode ───── */
body.dark {
  --bg-primary: #101A28;
  --bg-secondary: #1A2738;
  --bg-card: #1A2738;
  --bg-column: #141E2D;
  --bg-header: #1A2738;
  --bg-input: #1A2738;
  --bg-modal-overlay: rgba(0, 0, 0, 0.6);
  --bg-badge: #243040;
  --bg-tooltip: #ECEDE7;

  --text-primary: #ECEDE7;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-inverse: #101A28;
  --text-tooltip: #101A28;

  --border-primary: #2D3A4A;
  --border-subtle: #243040;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 20px rgba(0, 0, 0, 0.35);

  --cat-infrastructure: #ECEDE7;
  --cat-infrastructure-text: #101A28;
  --cat-uncategorized: #374151;
  --cat-uncategorized-text: #D1D5DB;
}

/* ───── Reset & Base ───── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ───── Header ───── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.header__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  transition: color var(--transition);
  white-space: nowrap;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__updated {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--transition);
  white-space: nowrap;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  color: var(--text-primary);
}

.theme-toggle:hover {
  border-color: var(--green);
  background: var(--green-subtle);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.theme-toggle .icon {
  display: inline-block;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

/* ───── Controls Bar ───── */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition), border-color var(--transition);
  flex-wrap: wrap;
}

.controls__search {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  position: relative;
}

.controls__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--transition);
}

.controls__search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  transition: all var(--transition);
}

.controls__search input::placeholder {
  color: var(--text-muted);
}

.controls__search input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-subtle);
}

.controls select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.controls select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-subtle);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--green);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--green-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn--outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-badge);
}

.btn--danger {
  background: transparent;
  color: var(--coral);
  border: 1px solid var(--coral);
}

.btn--danger:hover {
  background: var(--coral-subtle);
}

.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--danger-fill {
  background: var(--coral);
  color: #FFFFFF;
  border: none;
}

.btn--danger-fill:hover {
  background: #FF916A;
}

.btn--loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #FFFFFF;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ───── Kanban Board ───── */
.kanban {
  display: flex;
  gap: 16px;
  padding: 20px 24px 24px;
  overflow-x: auto;
  min-height: calc(100vh - var(--header-height) - var(--controls-height) - 60px);
}

.kanban__column {
  flex: 0 0 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - var(--controls-height) - 60px);
}

.kanban__column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-column);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}

.kanban__column-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.kanban__column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--bg-badge);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.kanban__cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
  padding-bottom: 16px;
}

.kanban__cards::-webkit-scrollbar {
  width: 4px;
}

.kanban__cards::-webkit-scrollbar-track {
  background: transparent;
}

.kanban__cards::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: var(--radius-full);
}

/* ───── Card ───── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-primary);
}

.card:active {
  cursor: grabbing;
}

.card.dragging {
  opacity: 0.5;
  transform: rotate(2deg) scale(0.97);
  box-shadow: var(--shadow-lg);
  cursor: grabbing;
}

.card.card--fade-out {
  opacity: 0;
  transform: scale(0.95);
  max-height: 0;
  padding: 0 14px;
  margin: 0;
  overflow: hidden;
  border-width: 0;
  transition: all 0.35s ease;
}

.card.card--loading {
  position: relative;
  pointer-events: none;
}

.card.card--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  opacity: 0.6;
  border-radius: var(--radius-md);
}

/* ───── Drag-drop zones ───── */
.kanban__cards.drag-over {
  border: 2px dashed var(--green);
  background: var(--green-subtle);
  border-radius: var(--radius-md);
  min-height: 60px;
}

.drop-placeholder {
  border: 2px dotted var(--green);
  border-radius: var(--radius-md);
  height: 48px;
  background: var(--green-subtle);
  transition: all 0.2s ease;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card__id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-badge);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}

.card__priority {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
  transition: color var(--transition);
}

.card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: #FFFFFF;
  white-space: nowrap;
}

.card__category--dark-text {
  color: #101A28;
}

.card__owner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ───── Overdue indicator ───── */
.card__overdue {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #DC2626;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.08);
  margin-bottom: 4px;
}

body.dark .card__overdue {
  color: #FCA5A5;
  background: rgba(252, 165, 165, 0.12);
}

.detail__value--overdue {
  color: #DC2626;
  font-weight: 600;
}

body.dark .detail__value--overdue {
  color: #FCA5A5;
}

/* ───── Status-specific column accents ───── */
.kanban__column[data-status="DONE"] .kanban__column-count {
  background: var(--green-subtle);
  color: var(--green);
}

.kanban__column[data-status="NEXT"] .kanban__column-count {
  background: var(--aqua-subtle);
  color: var(--aqua);
}

body.dark .kanban__column[data-status="NEXT"] .kanban__column-count {
  color: #5EC4C8;
}

.kanban__column[data-status="IN_PROGRESS"] .kanban__column-count {
  background: var(--yellow-subtle);
  color: #C4A800;
}

.kanban__column[data-status="PLANNED"] .kanban__column-count {
  background: var(--coral-subtle);
  color: var(--coral);
}

/* ───── Modal Overlay ───── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-modal-overlay);
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(16, 26, 40, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), border-color var(--transition);
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .modal { animation: none; }
}

.modal__header {
  display: flex;
  flex-direction: column;
  padding: 32px 32px 0;
  position: relative;
}

.modal__header-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  padding-right: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}

.modal__header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 8px;
}

.modal__close {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: var(--bg-badge);
  color: var(--text-primary);
  transform: scale(1.1);
}

.modal__body {
  padding: 0 32px 32px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 32px;
  border-top: 1px solid var(--border-subtle);
  transition: border-color var(--transition);
}

/* Detail badge */
.detail__badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.detail__badge--status {
  background: var(--bg-badge);
  color: var(--text-secondary);
}

/* ───── Hero Section (description with label) ───── */
.detail__hero {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
  transition: border-color var(--transition);
}

.detail__hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 6px;
  transition: color var(--transition);
}

.detail__hero .detail__field-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

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

/* ───── Smart Context Chips ───── */
.detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-badge);
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
}

.detail__chip-icon {
  font-size: 14px;
  line-height: 1;
}

.detail__chip--warn {
  background: rgba(247, 238, 108, 0.2);
  color: #92700c;
}

body.dark .detail__chip--warn {
  background: rgba(247, 238, 108, 0.12);
  color: #F7EE6C;
}

.detail__chip--overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

body.dark .detail__chip--overdue {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.detail__chip--done {
  background: rgba(19, 215, 122, 0.1);
  color: #059669;
}

body.dark .detail__chip--done {
  background: rgba(19, 215, 122, 0.12);
  color: #13D77A;
}

.detail__chip--muted {
  color: var(--text-muted);
}

/* ───── Alerts ───── */
.detail__alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: background-color var(--transition), color var(--transition);
}

.detail__alert--warning {
  background: rgba(247, 238, 108, 0.15);
  color: #92800A;
}

body.dark .detail__alert--warning {
  background: rgba(247, 238, 108, 0.1);
  color: #F7EE6C;
}

.detail__alert--overdue {
  background: rgba(255, 169, 135, 0.15);
  color: #C0513A;
}

body.dark .detail__alert--overdue {
  background: rgba(255, 169, 135, 0.1);
  color: #FFA987;
}

.detail__alert-action {
  margin-left: auto;
  background: none;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.detail__alert-action:hover {
  opacity: 1;
}

/* ───── Collapsible Sections ───── */
.detail__collapsible {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.detail__collapsible-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background-color 0.15s ease, color var(--transition);
}

.detail__collapsible-header:hover {
  background: var(--bg-badge);
}

.detail__collapsible-arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.detail__collapsible-arrow--open {
  transform: rotate(90deg);
}

.detail__collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.detail__collapsible-body--open {
  max-height: 800px;
  padding: 0 16px 16px;
}

.detail__field {
  margin-bottom: 16px;
}

.detail__field:last-child {
  margin-bottom: 0;
}

.detail__field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  transition: color var(--transition);
}

.detail__field-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.5;
  transition: color var(--transition);
}

.detail__field-value--muted {
  color: var(--text-muted);
  font-style: italic;
}

.detail__field-inline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.detail__field-inline-item {
  font-size: 14px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.detail__field-inline-item span {
  font-weight: 600;
}

/* ───── Activity Log ───── */
.detail__activity {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.detail__activity-header {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  transition: color var(--transition);
}

.detail__activity-log {
  background: var(--bg-badge);
  border-radius: 12px;
  padding: 16px;
  transition: background-color var(--transition);
}

.detail__activity-entry {
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color var(--transition);
}

.detail__activity-entry + .detail__activity-entry {
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
  padding-top: 12px;
}

.detail__activity-user {
  font-weight: 600;
}

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

.detail__activity-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  padding-left: 20px;
}

.detail__activity-more {
  display: block;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--green);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.detail__activity-more:hover {
  text-decoration: underline;
}

.detail__activity-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.detail__activity-note-placeholder {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--border-primary);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Legacy detail support */
.detail__meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-badge);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.detail__meta-badge--muted {
  border: 1px dashed var(--border-primary);
  background: transparent;
  color: var(--text-muted);
  font-style: italic;
}

/* ───── Inline Editable Fields ───── */
.editable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background-color 0.15s ease;
  position: relative;
}

.editable:hover {
  background: var(--bg-badge);
}

.editable:hover::after {
  content: '\270E';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
}

.editable--active:hover::after,
.editable--saving:hover::after,
.modal__header-badges .editable:hover::after {
  content: none;
}

.editable:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.editable--active {
  background: transparent;
  cursor: default;
}

.editable--active:hover {
  background: transparent;
}

.editable--saving {
  opacity: 0.7;
  pointer-events: none;
}

.editable__input,
.editable__textarea,
.editable__select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 0 0 3px var(--green-subtle);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.editable__textarea {
  min-height: 60px;
  resize: vertical;
}

.editable__select {
  cursor: pointer;
}

.editable__spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.editable__saving-indicator {
  display: flex;
  align-items: center;
}

/* ───── Trash Icon Button ───── */
.btn--icon-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--coral);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn--icon-danger:hover {
  background: var(--coral-subtle);
  color: #e05a3a;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255, 169, 135, 0.2);
}

.btn--icon-danger:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ───── Quick-Add Modal Form ───── */
.form__group {
  margin-bottom: 16px;
}

.form__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color var(--transition);
}

.form__label .required {
  color: var(--green);
  margin-left: 2px;
}

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  transition: all var(--transition);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--text-muted);
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-subtle);
}

.form__textarea {
  min-height: 80px;
  resize: vertical;
}

.form__row {
  display: flex;
  gap: 12px;
}

.form__row > .form__group {
  flex: 1;
}

/* ───── Toast Notifications ───── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastSlideIn 0.3s ease;
  transition: all var(--transition);
  max-width: 360px;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast--success {
  border-left: 4px solid var(--green);
}

.toast--error {
  border-left: 4px solid var(--coral);
}

.toast__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast__dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 0 0 8px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}

.toast__dismiss:hover {
  color: var(--text-primary);
}

/* ───── Loading Spinner ───── */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ───── Confirmation Dialog ───── */
.confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-modal-overlay);
  border-radius: var(--radius-lg);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.confirm-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.confirm-dialog__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color var(--transition);
}

.confirm-dialog__message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
  transition: color var(--transition);
}

.confirm-dialog__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ───── Form validation errors ───── */
.form__error {
  font-size: 12px;
  color: var(--coral);
  margin-top: 2px;
  font-weight: 400;
}

.form__input--error,
.form__textarea--error,
.form__select--error {
  border-color: var(--coral);
}

.form__input--error:focus,
.form__textarea--error:focus,
.form__select--error:focus {
  box-shadow: 0 0 0 3px var(--coral-subtle);
  border-color: var(--coral);
}

/* ───── Empty State ───── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
}

.empty-state__icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state__text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--transition);
}

/* ───── Responsive ───── */
@media (max-width: 1024px) {
  .kanban {
    flex-direction: column;
    overflow-x: visible;
  }

  .kanban__column {
    flex: none;
    min-width: unset;
    max-height: none;
  }

  .kanban__cards {
    overflow-y: visible;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 0 16px;
    gap: 8px;
  }

  .header__title {
    font-size: 16px;
  }

  .header__updated {
    display: none;
  }

  .controls {
    padding: 12px 16px;
    gap: 8px;
  }

  .controls__search {
    min-width: 100%;
  }

  .kanban {
    padding: 16px;
  }

  .modal {
    max-height: 95vh;
  }

  .detail__row {
    flex-direction: column;
    gap: 0;
  }

  .form__row {
    flex-direction: column;
    gap: 0;
  }
}

/* ───── Screen Reader Only ───── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
