/* ═══════════════════════════════════════════════════════════════════
   Signum Board — Premium SaaS UI
   Inspired by: Trello · Linear · ClickUp · Notion
   Themes: dark (deep navy) · light (clean enterprise)
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. BOARD PAGE SHELL ──────────────────────────────────────────── */
.board-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  width: 100%;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition: background 0.4s ease;
}

/* Default dark: rich navy gradient */
[data-theme="dark"]  .board-page[data-bg="default"] {
  background: #0D1117;
}
[data-theme="light"] .board-page[data-bg="default"] {
  background: #F0F2F5;
}

/* Named backgrounds */
.board-page[data-bg="ocean"]    { background: linear-gradient(160deg,#0f2444,#0e4d6e); }
.board-page[data-bg="forest"]   { background: linear-gradient(160deg,#0a2e1a,#1a5c2e); }
.board-page[data-bg="sunset"]   { background: linear-gradient(160deg,#3b1060,#7c2d12); }
.board-page[data-bg="rose"]     { background: linear-gradient(160deg,#4c0519,#881337); }
.board-page[data-bg="midnight"] { background: linear-gradient(160deg,#0f0c29,#302b63); }
.board-page[data-bg="slate"]    { background: linear-gradient(160deg,#0a0f1a,#1e293b); }
.board-page[data-bg="lemon"]    { background: linear-gradient(160deg,#451a03,#92400e); }

/* ── 2. BOARD HEADER ─────────────────────────────────────────────── */
.board-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: 52px;
  min-height: 52px;
  flex-shrink: 0;
  z-index: 20;
  background: rgba(13,17,23,0.70);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background 0.3s;
}
[data-theme="light"] .board-header {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
[data-theme="dark"] .board-header {
  background: rgba(13,17,23,0.72);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.bh-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }
.bh-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; position: relative; }
.bh-center { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }

/* Back arrow */
.bh-back {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  color: rgba(255,255,255,0.65); text-decoration: none;
  flex-shrink: 0; transition: background 0.15s, color 0.15s;
}
.bh-back:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.95); }
[data-theme="light"] .bh-back { color: var(--text-secondary); }
[data-theme="light"] .bh-back:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Board title */
.bh-title {
  font-size: 15px; font-weight: 700;
  color: rgba(255,255,255,0.92);
  padding: 4px 7px; border-radius: 6px;
  border: 2px solid transparent;
  cursor: text; outline: none;
  white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis;
  font-family: inherit; margin: 0;
  transition: background 0.15s, border-color 0.15s;
}
.bh-title:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); }
.bh-title:focus { background: var(--bg-surface); border-color: var(--accent);
  color: var(--text-primary); white-space: normal; overflow: visible;
  box-shadow: 0 0 0 3px var(--accent-muted); }
[data-theme="light"] .bh-title { color: var(--text-primary); }
[data-theme="light"] .bh-title:hover { background: var(--bg-hover); border-color: var(--border); }

/* Star button */
.bh-star-btn {
  width: 28px; height: 28px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer;
  color: rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.bh-star-btn:hover { color: #FBBF24; background: rgba(251,191,36,0.12); }
.bh-star-btn.starred, #board-star-btn.starred { color: #FBBF24; }
.bh-star-btn.starred svg, #board-star-btn.starred svg { fill: #FBBF24; stroke: #FBBF24; }
[data-theme="light"] .bh-star-btn { color: var(--text-muted); }
[data-theme="light"] .bh-star-btn:hover { color: #D97706; }

/* Breadcrumb separator + workspace link */
.bh-separator { color: rgba(255,255,255,0.22); font-size: 16px; margin: 0 2px; user-select: none; flex-shrink: 0; }
[data-theme="light"] .bh-separator { color: var(--border); }
.bh-ws-link { flex-shrink: 0; }
.bh-ws-anchor {
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.55); text-decoration: none;
  padding: 3px 7px; border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}
.bh-ws-anchor:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.85); }
[data-theme="light"] .bh-ws-anchor { color: var(--text-muted); }
[data-theme="light"] .bh-ws-anchor:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Member avatars — header */
.bh-avatars { display: flex; align-items: center; }
.bh-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#3B82F6,#7C3AED);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px; border: none;
  box-shadow: 0 0 0 2px rgba(13,17,23,0.80);
  cursor: pointer; position: relative; z-index: 1;
  transition: transform 0.15s ease; user-select: none; flex-shrink: 0;
}
[data-theme="light"] .bh-avatar { box-shadow: 0 0 0 2px #FFFFFF; }
.bh-avatar:first-child { margin-left: 0; }
.bh-avatar:hover { transform: translateY(-3px) scale(1.12); z-index: 10; }
.bh-avatar-more {
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.75);
  font-size: 9px; cursor: default; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(13,17,23,0.80);
}
[data-theme="light"] .bh-avatar-more { background: #E2E8F0; color: #626F86; box-shadow: 0 0 0 2px #fff; }
.bh-avatar-more:hover { transform: none; }

/* Invite button — icon-only, square */
.bh-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 6px;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.16);
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.90);
  cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.bh-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.28); }
[data-theme="light"] .bh-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .bh-btn:hover { background: var(--bg-active); color: var(--text-primary); }
.bh-btn svg { flex-shrink: 0; }
.bh-btn-invite {
  width: 30px; height: 30px;
  padding: 0;
  justify-content: center;
}

/* Tool buttons — now icon-only, kept for legacy compat */
.bh-tool-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 6px;
  background: transparent; border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.65); cursor: pointer;
  white-space: nowrap; font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bh-tool-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.95);
}
[data-theme="light"] .bh-tool-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .bh-tool-btn:hover { background: var(--bg-active); color: var(--text-primary); }

/* Theme / icon-only button */
.bh-icon-btn {
  width: 30px; height: 30px; border-radius: 6px;
  background: transparent; border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s; font-family: inherit;
}
.bh-icon-btn:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.22); }
[data-theme="light"] .bh-icon-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .bh-icon-btn:hover { background: var(--bg-active); color: var(--accent); border-color: var(--accent); }

/* Share button */
.bh-share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 30px; border-radius: 6px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.95); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.bh-share-btn:hover { background: rgba(255,255,255,0.28); border-color: rgba(255,255,255,0.4); }
[data-theme="light"] .bh-share-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="light"] .bh-share-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Divider line in header right */
.bh-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.12); flex-shrink: 0; }
[data-theme="light"] .bh-divider { background: var(--border); }
.bh-stats { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.bh-stat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 20px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10);
  font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.65); white-space: nowrap;
}
.bh-stat-pill strong { font-weight: 700; color: rgba(255,255,255,0.90); }
[data-theme="light"] .bh-stat-pill { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .bh-stat-pill strong { color: var(--text-primary); }

/* Board search box */
.bh-search-wrap { position: relative; display: flex; align-items: center; }
.bh-search-input-wrap {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.10);
  border: none;
  border-radius: 7px;
  padding: 0 6px 0 10px;
  transition: background 0.15s, border-color 0.15s;
}
.bh-search-input-wrap:focus-within {
  background: rgba(255,255,255,0.18);
  border-color: transparent;
}
[data-theme="light"] .bh-search-input-wrap {
  background: rgba(0,0,0,0.05);
  border-color: transparent;
}
[data-theme="light"] .bh-search-input-wrap:focus-within {
  background: rgba(255,255,255,0.95);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}
.bh-search-input {
  height: 28px; width: 160px; padding: 0 4px;
  border: none; border-radius: 0;
  background: transparent; color: rgba(255,255,255,0.92);
  font-size: 12px; font-family: inherit; outline: none;
  transition: width 0.2s;
}
.bh-search-input::placeholder { color: rgba(255,255,255,0.45); }
[data-theme="light"] .bh-search-input { color: var(--text-primary); }
[data-theme="light"] .bh-search-input::placeholder { color: var(--text-muted); }
.bh-search-close {
  width: 20px; height: 20px; border: none; background: rgba(255,255,255,0.10);
  border-radius: 4px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: rgba(255,255,255,0.55); transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.bh-search-close:hover { background: rgba(255,255,255,0.20); color: rgba(255,255,255,0.90); }
[data-theme="light"] .bh-search-close { background: rgba(0,0,0,0.06); color: var(--text-muted); }
[data-theme="light"] .bh-search-close:hover { background: rgba(0,0,0,0.12); color: var(--text-primary); }

/* Sprint pill */
.bh-sprint-pill {
  background: rgba(56,189,248,0.12); border-color: rgba(56,189,248,0.25);
  color: var(--accent); font-weight: 600; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.bh-sprint-pill:hover { background: rgba(56,189,248,0.20); border-color: var(--accent); }
.bh-sprint-pill svg { width: 12px; height: 12px; }

/* ── 3. BOARD STATS BAR ──────────────────────────────────────────── */
.bsb {
  display: flex; align-items: center;
  height: 34px; min-height: 34px;
  padding: 0 20px;
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0; z-index: 19;
}
[data-theme="light"] .bsb {
  background: rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.bsb-inner { display: flex; align-items: center; gap: 0; }
.bsb-item  { display: flex; align-items: baseline; gap: 5px; padding: 0 16px; }
.bsb-item:first-child { padding-left: 0; }
.bsb-val {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.90); line-height: 1;
  transition: color 0.2s;
  font-variant-numeric: tabular-nums;
}
[data-theme="light"] .bsb-val { color: var(--text-primary); }
.bsb-val-done   { color: #34D399 !important; }
.bsb-val-active { color: #FBBF24 !important; }
[data-theme="light"] .bsb-val-done   { color: #059669 !important; }
[data-theme="light"] .bsb-val-active { color: #D97706 !important; }
.bsb-lbl {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.38);
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
[data-theme="light"] .bsb-lbl { color: var(--text-muted); }
.bsb-sep { width: 1px; height: 12px; background: rgba(255,255,255,0.10); flex-shrink: 0; }
[data-theme="light"] .bsb-sep { background: var(--border); }

/* ── 4. BOARD CANVAS & COLUMNS SCROLL AREA ───────────────────────── */
.board-canvas {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  padding: 16px 20px 24px;
  box-sizing: border-box;
  scroll-behavior: smooth;
}
.board-canvas::-webkit-scrollbar { height: 8px; }
.board-canvas::-webkit-scrollbar-track { background: rgba(0,0,0,0.10); border-radius: 4px; }
.board-canvas::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.board-canvas::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.30); }
[data-theme="light"] .board-canvas::-webkit-scrollbar-track { background: rgba(0,0,0,0.06); }
[data-theme="light"] .board-canvas::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }

.board-columns {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: max-content;
  height: 100%;
}

/* ── 5. LIST COLUMN (KOL) ────────────────────────────────────────── */
.kol {
  width: 300px; min-width: 300px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: rgba(22,27,34,0.92);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  max-height: calc(100vh - var(--topbar-h) - 140px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.30);
  position: relative; overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  animation: kolIn 0.20s ease both;
}
[data-theme="light"] .kol {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
}
.kol:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.40);
  border-color: rgba(255,255,255,0.12);
}
[data-theme="light"] .kol:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.10), 0 6px 24px rgba(0,0,0,0.06);
  border-color: #CBD5E1;
}

/* Status accent — thin top bar */
.kol[data-status="todo"]     { border-top: 2px solid #475569; }
.kol[data-status="progress"] { border-top: 2px solid #D97706; }
.kol[data-status="testing"]  { border-top: 2px solid #7C3AED; }
.kol[data-status="done"]     { border-top: 2px solid #059669; }

/* Column staggered entrance */
@keyframes kolIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kol:nth-child(1) { animation-delay: 0.02s; }
.kol:nth-child(2) { animation-delay: 0.06s; }
.kol:nth-child(3) { animation-delay: 0.10s; }
.kol:nth-child(4) { animation-delay: 0.14s; }
.kol:nth-child(n+5) { animation-delay: 0.17s; }

/* Column header */
.kol-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 2;
}
[data-theme="light"] .kol-header { border-bottom: 1px solid #F1F5F9; }
.kol-header-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.kol-header-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* Title */
.kol-title {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.80);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.1px;
}
[data-theme="light"] .kol-title { color: #1E293B; }
.kol-title-input {
  font-size: 13px; font-weight: 600; letter-spacing: -0.1px;
  color: var(--text-primary); background: var(--bg-hover);
  border: 1px solid var(--accent); border-radius: 5px;
  padding: 2px 7px; font-family: inherit; width: 100%; max-width: 160px;
  outline: none; box-shadow: 0 0 0 2px var(--accent-muted);
}

/* Count badge */
.kol-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 10px; font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.55);
}
[data-theme="light"] .kol-count { background: #F1F5F9; color: #64748B; }
/* uniform across all statuses */
.kol[data-status] .kol-count { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.55); }
[data-theme="light"] .kol[data-status] .kol-count { background: #F1F5F9; color: #64748B; }

/* Status dot — hidden (cleaner look) */
.kol-dot { display: none !important; }

/* 3-dot menu button */
.kol-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; background: transparent; border: none;
  border-radius: 5px; cursor: pointer; color: rgba(255,255,255,0.40);
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; font-family: inherit;
}
.kol:hover .kol-menu-btn, .kol-menu-btn:focus { opacity: 1; }
.kol-menu-btn:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.90); }
.kol-menu-btn svg { width: 14px; height: 14px; }
[data-theme="light"] .kol-menu-btn { color: #94A3B8; }
[data-theme="light"] .kol-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.kol-del { display: none; }

/* ── 6. CARDS ZONE ───────────────────────────────────────────────── */
.cards-zone {
  flex: 1; overflow-y: auto;
  padding: 8px 8px 4px;
  min-height: 60px;
}
.cards-zone::-webkit-scrollbar { width: 3px; }
.cards-zone::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
[data-theme="light"] .cards-zone::-webkit-scrollbar-thumb { background: #CBD5E1; }

/* Drag-over highlight */
.cards-zone.sortable-over {
  background: rgba(59,130,246,0.06);
  outline: 2px dashed rgba(59,130,246,0.40);
  outline-offset: -4px;
  border-radius: 8px;
}

/* Done column — very subtle green tint */
.kol[data-status="done"] .cards-zone { background: rgba(5,150,105,0.025); }

/* ── 7. CARD ITEM ────────────────────────────────────────────────── */
.card-item {
  background: #1C2333;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 7px;
  cursor: pointer;
  position: relative; overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,0.28);
  transition: background 0.13s, border-color 0.13s, box-shadow 0.16s, transform 0.16s;
}
[data-theme="light"] .card-item {
  background: #FFFFFF;
  border: 1px solid #E8ECF2;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.card-item:last-child { margin-bottom: 0; }

/* Hover — subtle lift + blue border accent */
.card-item:hover {
  background: #212C3F;
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 4px 16px rgba(0,0,0,0.38), 0 1px 3px rgba(0,0,0,0.20);
  transform: translateY(-1px);
}
[data-theme="light"] .card-item:hover {
  background: #FAFBFD;
  border-color: #93C5FD;
  box-shadow: 0 4px 14px rgba(59,130,246,0.10), 0 1px 3px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

/* Active click feedback */
.card-item:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

/* Focus ring */
.card-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Done column — slight muted */
.kol[data-status="done"] .card-item { opacity: 0.80; }
.kol[data-status="done"] .card-item:hover { opacity: 1; }

/* Drag states */
.card-item.sortable-chosen {
  opacity: 0.88; transform: rotate(1.5deg) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.50); border-color: #3B82F6; z-index: 50;
}
.card-item.sortable-ghost {
  opacity: 0.12; background: rgba(59,130,246,0.12);
  border: 2px dashed #3B82F6;
}
.card-item.sortable-drag { box-shadow: 0 20px 50px rgba(0,0,0,0.55); }

/* No left-accent bar */
.card-item::before { display: none !important; }

/* ── Mark-as-complete check button ──────────────────────────────── */
/* Sits top-left of every card; always visible (not just on hover)
   so users can complete tasks with a single glance.               */
.card-complete-btn {
  display: none !important; /* Hidden: user completes tasks by dragging to Done column */
  position: absolute; top: 6px; left: 6px;
  width: 20px; height: 20px;
  background: transparent; border: 2px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  cursor: pointer; flex-shrink: 0; z-index: 4;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.card-complete-btn svg { width: 10px; height: 10px; stroke-width: 3; }
/* Hover: preview green fill */
.card-complete-btn:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  transform: scale(1.12);
}
/* Light theme defaults */
[data-theme="light"] .card-complete-btn {
  border-color: rgba(9,30,66,0.20);
}
[data-theme="light"] .card-complete-btn:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}
/* Already-completed state (card lives in Done column) */
.card-item--done .card-complete-btn,
.kol[data-status="done"] .card-complete-btn {
  display: none !important; /* Hidden completely */
}

/* Loading / in-progress spinner ring on the button */
.card-complete-btn.completing {
  animation: ccbSpin 0.55s linear infinite;
  pointer-events: none;
  border-color: #059669;
  border-top-color: transparent;
}
@keyframes ccbSpin { to { transform: rotate(360deg); } }

/* ── Completed card visual state ─────────────────────────────────── */
.card-item--done {
  border-left: 3px solid #059669 !important;
}
.card-item--done .card-title {
  /* text-decoration: line-through; removed per user request */
  color: rgba(255,255,255,0.38) !important;
}
[data-theme="light"] .card-item--done .card-title {
  color: #94A3B8 !important;
}
/* Shift title/content right to clear the check button */
.card-item .card-title,
.card-item .card-top-row,
.card-item .card-label-bar-row {
  padding-left: 0;
}

/* ── 3-dot card menu ── */
.card-menu-btn {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.08); border: none; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.45); cursor: pointer;
  opacity: 0; transition: opacity 0.12s, background 0.12s, color 0.12s;
  z-index: 4; font-family: inherit;
}
.card-item:hover .card-menu-btn { opacity: 1; }
.card-menu-btn:hover { background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.90); opacity: 1; }
.card-menu-btn svg { width: 12px; height: 12px; }
[data-theme="light"] .card-menu-btn { background: #F1F5F9; color: #64748B; }
[data-theme="light"] .card-menu-btn:hover { background: #E2E8F0; color: #1E293B; }

/* ── 8. CARD CONTENT ─────────────────────────────────────────────── */
/* Top row: priority + labels */
.card-top-row {
  display: flex; align-items: center;
  gap: 4px; margin-bottom: 6px; flex-wrap: wrap;
}

/* Priority badges */
.card-priority {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; height: 18px; letter-spacing: 0.2px;
}
.card-priority-high   { background: rgba(248,116,98,0.18); color: #F87462; }
.card-priority-medium { background: rgba(254,163,98,0.18); color: #FEA362; }
.card-priority-low    { background: rgba(75,206,151,0.18); color: #4BCE97; }
[data-theme="light"] .card-priority-high   { background: #FEE2E2; color: #DC2626; }
[data-theme="light"] .card-priority-medium { background: #FEF3C7; color: #D97706; }
[data-theme="light"] .card-priority-low    { background: #DCFCE7; color: #059669; }

/* Trello-style thin label pill */
.card-label-pill {
  display: inline-block; height: 8px; min-width: 36px;
  border-radius: 4px; cursor: pointer;
  transition: filter 0.12s, height 0.12s;
}
.card-label-pill:hover { filter: brightness(1.25); height: 11px; }

/* Named label pill */
.card-label-named {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: #1D2125; height: 18px; cursor: pointer;
  transition: filter 0.12s;
}
.card-label-named:hover { filter: brightness(1.12); }

/* Label colors */
.label-red    { background: #F87462; }
.label-orange { background: #FEA362; }
.label-yellow { background: #F5CD47; }
.label-green  { background: #4BCE97; }
.label-blue   { background: #579DFF; }
.label-purple { background: #9F8FEF; }

/* Old pill class compat */
.card-label-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.card-label-dot { display: none !important; }

/* Title */
.card-item .card-title {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.88);
  line-height: 1.5; margin: 0 0 6px 0;
  padding: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
[data-theme="light"] .card-item .card-title { color: #1E293B; margin-bottom: 6px; }
.kol[data-status="done"] .card-title { color: rgba(255,255,255,0.50); }
[data-theme="light"] .kol[data-status="done"] .card-title { color: #94A3B8; }

/* Description snippet */
.card-item .card-desc {
  font-size: 11px; color: rgba(255,255,255,0.40);
  margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-theme="light"] .card-item .card-desc { color: #94A3B8; }

/* Checklist mini progress bar */
.card-cl-bar-wrap {
  height: 3px; background: rgba(255,255,255,0.08);
  border-radius: 99px; margin: 6px 0 2px; overflow: hidden;
}
[data-theme="light"] .card-cl-bar-wrap { background: #E2E8F0; }
.card-cl-bar-fill {
  height: 100%; border-radius: 99px;
  background: #3B82F6; transition: width 0.4s ease;
}
.card-cl-bar-fill.card-cl-bar-half { background: #D97706; }
.card-cl-bar-fill.card-cl-bar-done { background: #059669; }

/* Card footer */
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; gap: 5px;
}
.card-footer-left  { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; flex-wrap: wrap; }
.card-footer-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* Chips (date, comments, checklist, links) */
.card-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: rgba(255,255,255,0.40); white-space: nowrap;
}
.card-chip svg { opacity: 0.75; }
.card-chip-date { color: rgba(255,255,255,0.40); }
.card-chip-link { color: #579DFF; }
.card-chip-done { color: #34D399 !important; }
[data-theme="light"] .card-chip, [data-theme="light"] .card-chip-date { color: #94A3B8; }
[data-theme="light"] .card-chip-done { color: #059669 !important; }

/* Card avatar stack */
.card-avatar-stack { display: flex; align-items: center; }
.card-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg,#3B82F6,#7C3AED);
  color: #fff; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-left: -4px;
  box-shadow: 0 0 0 2px #1C2333;
  cursor: pointer; position: relative; z-index: 1;
  transition: transform 0.15s ease; user-select: none; flex-shrink: 0;
}
[data-theme="light"] .card-avatar { box-shadow: 0 0 0 2px #FFFFFF; }
.card-avatar:first-child { margin-left: 0; }
.card-avatar:hover { transform: translateY(-2px) scale(1.14); z-index: 10; }
.card-avatar-more {
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.65);
  font-size: 8px; cursor: default; pointer-events: none;
}

/* Board-search match / filter */
.card-item.board-search-hidden { display: none !important; }
.card-item.board-search-match { border-color: #3B82F6 !important; }
.card-item.filter-hidden { display: none !important; }
.kol.all-hidden .kol-header { opacity: .5; }

/* ── 9. EMPTY COLUMN STATE ───────────────────────────────────────── */
.cards-zone-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 20px 16px; text-align: center;
  min-height: 8px;
}
.cards-zone-empty-icon { display: none; }
.cards-zone-empty-text {
  font-size: 11px; color: rgba(255,255,255,0.22); line-height: 1.5;
}
[data-theme="light"] .cards-zone-empty-text { color: #CBD5E1; }

/* ── 10. ADD CARD TRIGGER & FORM ─────────────────────────────────── */
.kol-add-card { padding: 4px 8px 8px; flex-shrink: 0; }

.add-card-trigger {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 7px 10px; border-radius: 7px;
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.38);
  font-family: inherit; text-align: left;
  transition: background 0.13s, color 0.13s;
}
.add-card-trigger:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
}
[data-theme="light"] .add-card-trigger { color: #94A3B8; }
[data-theme="light"] .add-card-trigger:hover { background: #F1F5F9; color: #1E293B; }
.add-card-trigger svg { flex-shrink: 0; opacity: 0.7; }

/* Expanded creation form */
.add-card-form {
  display: flex; flex-direction: column; gap: 8px;
  background: #1C2333;
  border: 1px solid rgba(59,130,246,0.40);
  border-radius: 9px; padding: 10px;
  animation: acfIn 0.16s ease both;
}
[data-theme="light"] .add-card-form {
  background: #FFFFFF;
  border: 1px solid #93C5FD;
  box-shadow: 0 4px 20px rgba(59,130,246,0.10);
}
@keyframes acfIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card title input */
.acf-title {
  width: 100%; padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(59,130,246,0.45);
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
  color: rgba(255,255,255,0.90); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.acf-title:focus { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }
[data-theme="light"] .acf-title {
  background: #F8FAFC; border-color: #3B82F6; color: #1E293B;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

/* Description textarea */
.acf-desc {
  width: 100%; padding: 7px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px; color: rgba(255,255,255,0.80);
  font-size: 12px; font-family: inherit; resize: none; outline: none;
  min-height: 54px; transition: border-color 0.15s;
}
.acf-desc:focus { border-color: #3B82F6; }
[data-theme="light"] .acf-desc { background: #F8FAFC; border-color: #E2E8F0; color: #1E293B; }

/* "+ Add description" toggle */
.acf-toggle-desc {
  align-self: flex-start; background: none; border: none; cursor: pointer;
  font-size: 11px; color: rgba(255,255,255,0.38); font-family: inherit;
  padding: 0; transition: color 0.12s;
}
.acf-toggle-desc:hover { color: rgba(255,255,255,0.65); text-decoration: underline; }
[data-theme="light"] .acf-toggle-desc { color: #94A3B8; }

/* Meta row */
.acf-meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.acf-meta-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 70px; }
.acf-meta-label {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: rgba(255,255,255,0.38);
}
[data-theme="light"] .acf-meta-label { color: #94A3B8; }
.acf-meta-label svg { flex-shrink: 0; opacity: 0.8; }

.acf-due-date, .acf-priority {
  height: 28px; padding: 0 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px; color: rgba(255,255,255,0.75);
  font-size: 11px; font-family: inherit; outline: none; width: 100%;
  cursor: pointer; transition: border-color 0.15s;
}
[data-theme="light"] .acf-due-date, [data-theme="light"] .acf-priority {
  background: #F1F5F9; border-color: #E2E8F0; color: #1E293B;
}
.acf-due-date:focus, .acf-priority:focus { border-color: #3B82F6; box-shadow: 0 0 0 2px rgba(59,130,246,0.20); }

/* Member selector */
.acf-member-selector { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.acf-member-select {
  height: 28px; padding: 0 6px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px; color: rgba(255,255,255,0.65);
  font-size: 11px; font-family: inherit; outline: none; cursor: pointer;
  max-width: 90px; transition: border-color 0.15s;
}
[data-theme="light"] .acf-member-select { background: #F1F5F9; border-color: #E2E8F0; color: #64748B; }
.acf-member-avatars { display: flex; gap: 2px; flex-wrap: wrap; }
.acf-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg,#3B82F6,#7C3AED);
  color: #fff; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
  position: relative; transition: transform 0.1s;
}
.acf-avatar:hover { transform: scale(1.14); }
.acf-avatar::after {
  content: '×'; position: absolute; inset: 0; background: rgba(220,38,38,0.85);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 700; opacity: 0; transition: opacity 0.12s;
}
.acf-avatar:hover::after { opacity: 1; }

/* Label chips */
.acf-labels-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acf-label-chips { display: flex; gap: 5px; }
.acf-lchip {
  width: 26px; height: 14px; border-radius: 3px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.acf-lchip:hover { transform: scale(1.15); }
.acf-lchip.selected { border-color: rgba(255,255,255,0.80); transform: scale(1.1); }
[data-theme="light"] .acf-lchip.selected { border-color: #1E293B; }
.acf-lchip[data-color="red"]    { background: #F87462; }
.acf-lchip[data-color="orange"] { background: #FEA362; }
.acf-lchip[data-color="yellow"] { background: #F5CD47; }
.acf-lchip[data-color="green"]  { background: #4BCE97; }
.acf-lchip[data-color="blue"]   { background: #579DFF; }
.acf-lchip[data-color="purple"] { background: #9F8FEF; }

/* Actions row */
.add-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.add-card-cancel {
  width: 26px; height: 26px; border: none; background: transparent;
  border-radius: 5px; cursor: pointer; color: rgba(255,255,255,0.40);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.add-card-cancel:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.80); }
[data-theme="light"] .add-card-cancel { color: #94A3B8; }
[data-theme="light"] .add-card-cancel:hover { background: #F1F5F9; color: #1E293B; }

/* Legacy textarea compat */
.add-card-textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #3B82F6; border-radius: 7px;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.20);
  font-size: 13px; font-family: inherit;
  color: rgba(255,255,255,0.88); background: rgba(255,255,255,0.06);
  resize: none; outline: none; line-height: 1.5; min-height: 64px;
}
[data-theme="light"] .add-card-textarea { background: #FFFFFF; color: #1E293B; }

/* ── 11. ADD LIST PANEL ──────────────────────────────────────────── */
.kol-new {
  width: 300px; min-width: 300px;
  background: rgba(255,255,255,0.07) !important;
  border: 1px dashed rgba(255,255,255,0.14) !important;
  box-shadow: none !important;
  height: auto !important; max-height: none !important;
  overflow: visible !important; animation: none !important;
  border-radius: 12px !important;
  transition: background 0.15s, border-color 0.15s !important;
}
[data-theme="light"] .kol-new {
  background: rgba(0,0,0,0.04) !important;
  border-color: #CBD5E1 !important;
}
.kol-new:hover {
  background: rgba(255,255,255,0.11) !important;
  border-color: rgba(59,130,246,0.45) !important;
}
[data-theme="light"] .kol-new:hover {
  background: rgba(59,130,246,0.04) !important;
  border-color: #93C5FD !important;
}
/* Remove status top border from new-list panel */
.kol-new[data-status]    { border-top: 1px dashed rgba(255,255,255,0.14) !important; }
[data-theme="light"] .kol-new[data-status] { border-top: 1px dashed #CBD5E1 !important; }

.add-list-content { padding: 8px; }
.add-list-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 12px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.60);
  font-family: inherit; text-align: left; transition: background 0.13s, color 0.13s;
}
.add-list-trigger:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.88); }
[data-theme="light"] .add-list-trigger { color: #64748B; }
[data-theme="light"] .add-list-trigger:hover { background: var(--bg-hover); color: var(--text-primary); }
.add-list-trigger svg { flex-shrink: 0; }

.add-list-form { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 6px; }
.add-list-input {
  height: 36px; padding: 0 12px;
  border: 1px solid #3B82F6; border-radius: 7px;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.90);
  font-size: 13px; font-family: inherit; outline: none;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.20);
}
[data-theme="light"] .add-list-input { background: #FFFFFF; color: #1E293B; }
.add-list-input:focus { border-color: #3B82F6; }
.add-list-actions { display: flex; align-items: center; gap: 6px; }
.add-list-cancel {
  width: 26px; height: 26px; border: none; background: transparent;
  border-radius: 5px; cursor: pointer; color: rgba(255,255,255,0.40);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.add-list-cancel:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.80); }
[data-theme="light"] .add-list-cancel { color: #94A3B8; }
[data-theme="light"] .add-list-cancel:hover { background: #F1F5F9; color: #1E293B; }

/* ── 12. DROPDOWN MENUS ─────────────────────────────────────────── */
.kol-dropdown, .card-dropdown {
  position: absolute;
  background: #1C2333;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 9px; padding: 4px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  z-index: 300; min-width: 152px;
  animation: dropIn 0.12s ease;
}
[data-theme="light"] .kol-dropdown, [data-theme="light"] .card-dropdown {
  background: #FFFFFF; border-color: #E2E8F0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.kol-dropdown  { top: 42px; right: 8px; }
/* card-dropdown is now fixed-positioned by JS; remove the stale offsets */
.card-dropdown { top: auto; right: auto; }
@keyframes dropIn {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.65);
  cursor: pointer; transition: background 0.11s, color 0.11s;
  background: none; border: none; width: 100%; text-align: left; font-family: inherit;
}
.dropdown-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.95); }
.dropdown-item svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.65; }
.dropdown-item:hover svg { opacity: 1; }
[data-theme="light"] .dropdown-item { color: var(--text-secondary); }
[data-theme="light"] .dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item-danger { color: #F87171 !important; }
.dropdown-item-danger:hover { background: rgba(248,113,113,0.12) !important; color: #F87171 !important; }
[data-theme="light"] .dropdown-item-danger { color: #EF4444 !important; }
[data-theme="light"] .dropdown-item-danger:hover { background: #FEF2F2 !important; }
.dropdown-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 4px 6px; }
[data-theme="light"] .dropdown-sep { background: #F1F5F9; }

/* ── 13. BACKGROUND PICKER POPOVER ──────────────────────────────── */
.bg-popover {
  position: absolute; top: 58px; right: 16px;
  background: #1C2333; border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.50);
  z-index: 200; width: 230px;
  animation: popIn 0.14s ease;
}
.bg-popover[hidden] { display: none; }
[data-theme="light"] .bg-popover { background: #FFFFFF; border-color: #E2E8F0; box-shadow: 0 8px 28px rgba(0,0,0,0.12); }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.bg-popover-title {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.40);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px;
}
[data-theme="light"] .bg-popover-title { color: var(--text-muted); }
.bg-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.bg-swatch {
  width: 42px; height: 30px; border-radius: 6px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.bg-swatch:hover { transform: scale(1.09); box-shadow: 0 4px 12px rgba(0,0,0,0.30); }
.bg-swatch.active { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

/* ── 14. FILTER PANEL (Trello-style right-side drawer) ──────────── */

/* Dim overlay behind the panel */
.fp-overlay {
  display: block;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 490;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.fp-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-in panel */
.fp-panel {
  position: fixed;
  top: 0; right: 0;
  width: 304px;
  height: 100vh;
  background: #1E2736;
  border-left: 1px solid rgba(255,255,255,0.09);
  box-shadow: -8px 0 32px rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
}
.fp-panel--open { transform: translateX(0); }
.fp-panel[hidden] { display: none; }
[data-theme="light"] .fp-panel {
  background: #FFFFFF;
  border-left-color: #E2E8F0;
  box-shadow: -6px 0 28px rgba(9,30,66,0.14);
}

/* Header */
.fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  flex-shrink: 0;
}
[data-theme="light"] .fp-header { border-bottom-color: #F1F5F9; }
.fp-title {
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.90); letter-spacing: -0.1px;
}
[data-theme="light"] .fp-title { color: #172B4D; }
.fp-header-actions { display: flex; align-items: center; gap: 8px; }
.fp-clear-btn {
  font-size: 12px; font-weight: 500; color: var(--accent);
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 3px 6px; border-radius: 4px;
  transition: background 0.12s, opacity 0.12s;
}
.fp-clear-btn:hover { background: rgba(56,189,248,0.10); }
.fp-close-btn {
  width: 26px; height: 26px; border: none;
  background: rgba(255,255,255,0.08); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.55); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.fp-close-btn:hover { background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.95); }
[data-theme="light"] .fp-close-btn { background: #F1F5F9; color: #5E6C84; }
[data-theme="light"] .fp-close-btn:hover { background: #DFE1E6; color: #172B4D; }

/* Scrollable body */
.fp-body {
  flex: 1; overflow-y: auto;
  padding: 4px 0 20px;
}
.fp-body::-webkit-scrollbar { width: 4px; }
.fp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
[data-theme="light"] .fp-body::-webkit-scrollbar-thumb { background: #CBD5E1; }

/* Section */
.fp-section {
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fp-section:last-child { border-bottom: none; }
[data-theme="light"] .fp-section { border-bottom-color: #F1F5F9; }
.fp-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: rgba(255,255,255,0.40);
  margin-bottom: 8px;
}
[data-theme="light"] .fp-section-title { color: #626F86; }

/* Text input */
.fp-input {
  width: 100%; height: 32px; padding: 0 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; font-size: 12px; font-family: inherit;
  color: rgba(255,255,255,0.88); outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  box-sizing: border-box;
}
.fp-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.fp-input::placeholder { color: rgba(255,255,255,0.30); }
[data-theme="light"] .fp-input {
  background: #F4F5F7; border-color: #DFE1E6; color: #172B4D;
}
[data-theme="light"] .fp-input::placeholder { color: #97A0AF; }
[data-theme="light"] .fp-input:focus { border-color: #0052CC; box-shadow: 0 0 0 2px rgba(0,82,204,0.15); }

/* Hint text */
.fp-hint { font-size: 10px; color: rgba(255,255,255,0.28); margin: 4px 0 0; line-height: 1.4; }
[data-theme="light"] .fp-hint { color: #97A0AF; }

/* Chip-style checkbox labels */
.fp-chip-label {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 4px; cursor: pointer;
}
.fp-chip-label:last-of-type { margin-bottom: 0; }
.fp-check { display: none; }   /* hidden — chip acts as the visual */
.fp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; user-select: none; width: 100%;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.fp-chip svg { flex-shrink: 0; opacity: 0.65; }
.fp-chip:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.90); }
.fp-check:checked + .fp-chip {
  background: rgba(56,189,248,0.14);
  border-color: rgba(56,189,248,0.40);
  color: #38BDF8;
}
.fp-check:checked + .fp-chip svg { opacity: 1; }
[data-theme="light"] .fp-chip {
  background: #F4F5F7; border-color: #DFE1E6; color: #5E6C84;
}
[data-theme="light"] .fp-chip:hover { background: #EBECF0; color: #172B4D; }
[data-theme="light"] .fp-check:checked + .fp-chip {
  background: #E6F3FF; border-color: #0052CC; color: #0052CC;
}

/* Coloured chip variants */
.fp-chip-red    { color: #F87462 !important; border-color: rgba(248,116,98,0.30) !important; }
.fp-chip-orange { color: #FEA362 !important; border-color: rgba(254,163,98,0.30) !important; }
.fp-check:checked + .fp-chip-red    { background: rgba(248,116,98,0.14) !important; }
.fp-check:checked + .fp-chip-orange { background: rgba(254,163,98,0.14) !important; }

/* Select */
.fp-select {
  width: 100%; height: 32px; padding: 0 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; font-size: 12px; font-family: inherit;
  color: rgba(255,255,255,0.75); outline: none; cursor: pointer;
  margin-top: 6px;
  transition: border-color 0.14s;
}
.fp-select:focus { border-color: var(--accent); }
[data-theme="light"] .fp-select {
  background: #F4F5F7; border-color: #DFE1E6; color: #172B4D;
}

/* Label colour swatches */
.fp-label-swatches {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px;
}
.fp-swatch {
  width: 28px; height: 20px; border-radius: 4px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.fp-swatch:hover { transform: scale(1.1); }
.fp-swatch--active {
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
  transform: scale(1.1);
}
[data-theme="light"] .fp-swatch--active { border-color: #172B4D; box-shadow: 0 0 0 2px rgba(9,30,66,0.15); }
.fp-swatch[data-color="red"]    { background: #F87462; }
.fp-swatch[data-color="orange"] { background: #FEA362; }
.fp-swatch[data-color="yellow"] { background: #F5CD47; }
.fp-swatch[data-color="green"]  { background: #4BCE97; }
.fp-swatch[data-color="blue"]   { background: #579DFF; }
.fp-swatch[data-color="purple"] { background: #9F8FEF; }

/* Radio group */
.fp-radio-group { display: flex; flex-direction: column; gap: 6px; }
.fp-radio-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,0.65); cursor: pointer;
}
.fp-radio { width: 14px; height: 14px; cursor: pointer; accent-color: var(--accent); }
[data-theme="light"] .fp-radio-label { color: #5E6C84; }

/* Filter-count badge on the filter button */
.fp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 99px;
  position: absolute; top: -4px; right: -5px;
  pointer-events: none; line-height: 1;
}
#filter-btn { position: relative; }

/* Mobile: full-width panel */
@media (max-width: 600px) {
  .fp-panel { width: 100%; border-left: none; }
}


/* ── 15. CARD DETAIL MODAL (CDM2) ───────────────────────────────── */
.cdm2-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: cdm2FadeIn 0.18s ease;
}
.cdm2-overlay[hidden] { display: none !important; }
@keyframes cdm2FadeIn { from { opacity: 0; } to { opacity: 1; } }

.cdm2-box {
  background: #161B25;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  /* Fixed width, let height be driven by content up to 88vh */
  width: 100%; max-width: 780px;
  height: auto; max-height: 88vh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  animation: cdm2In 0.20s cubic-bezier(.34,1.4,.64,1);
}
[data-theme="light"] .cdm2-box {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
@keyframes cdm2In {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.cdm2-header {
  display: flex; flex-direction: column;
  padding: 14px 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  background: #161B25;
}
[data-theme="light"] .cdm2-header { background: #FFFFFF; border-bottom-color: #E8ECF0; }
.cdm2-header-trello { position: relative; }
.cdm2-list-badge-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cdm2-list-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 5px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.09);
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.55);
  cursor: pointer; font-family: inherit; transition: background 0.12s;
}
.cdm2-list-badge:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
[data-theme="light"] .cdm2-list-badge { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .cdm2-list-badge:hover { background: var(--bg-active); color: var(--text-primary); }
.cdm2-list-badge svg { opacity: 0.65; }

.cdm2-header-mid { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.cdm2-title-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 8px; color: rgba(255,255,255,0.30); }
.cdm2-title-input {
  flex: 1; font-size: 18px; font-weight: 700;
  color: rgba(255,255,255,0.92); background: transparent;
  border: 2px solid transparent; border-radius: 7px;
  padding: 4px 8px; font-family: inherit; resize: none; overflow: hidden;
  line-height: 1.35; transition: border-color 0.15s, background 0.15s;
  min-height: 32px;
}
.cdm2-title-input:hover { border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); }
.cdm2-title-input:focus {
  outline: none; border-color: var(--accent);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
[data-theme="light"] .cdm2-title-input { color: var(--text-primary); }
[data-theme="light"] .cdm2-title-input:hover { border-color: var(--border); background: var(--bg-hover); }
[data-theme="light"] .cdm2-title-input:focus { background: var(--bg-hover); }

.cdm2-toolbar {
  display: flex; align-items: center; gap: 5px;
  padding-bottom: 10px; flex-wrap: wrap;
}
.cdm2-tb-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.65);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cdm2-tb-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.90); border-color: rgba(255,255,255,0.25); }
.cdm2-tb-btn svg { opacity: 0.70; flex-shrink: 0; }
[data-theme="light"] .cdm2-tb-btn {
  background: transparent; border-color: #DFE1E6; color: #42526E;
}
[data-theme="light"] .cdm2-tb-btn:hover { background: #F4F5F7; border-color: #C1C7D0; color: #172B4D; }

/* Close button */
.cdm2-close {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; flex-shrink: 0;
  background: rgba(255,255,255,0.07); border: none;
  border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.50); font-size: 18px;
  transition: background 0.15s, color 0.15s;
}
.cdm2-close:hover { background: rgba(248,113,113,0.15); color: #F87171; }
[data-theme="light"] .cdm2-close { background: var(--bg-hover); color: var(--text-secondary); }
[data-theme="light"] .cdm2-close:hover { background: var(--red-light); color: var(--red); }

/* CDM2 Body layout */
.cdm2-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0;
  /* Critical: min-height:0 + overflow:hidden lets children scroll independently */
  min-height: 0;
  overflow: hidden;
}
@media(max-width:720px) {
  .cdm2-body { grid-template-columns: 1fr; overflow-y: auto; }
  .cdm2-right-panel { border-left: none !important; border-top: 1px solid rgba(255,255,255,0.08); }
}

.cdm2-left {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto; min-height: 0;
  /* Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}
.cdm2-left::-webkit-scrollbar { width: 4px; }
.cdm2-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 2px; }
[data-theme="light"] .cdm2-left::-webkit-scrollbar-thumb { background: #CBD5E1; }

.cdm2-right-panel {
  border-left: 1px solid rgba(255,255,255,0.08);
  /* Full height scrollable column */
  display: flex; flex-direction: column;
  overflow-y: auto; min-height: 0;
  background: rgba(0,0,0,0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
[data-theme="light"] .cdm2-right-panel { background: #F7F8F9; border-left-color: #E0E4E8; }
.cdm2-right-panel::-webkit-scrollbar { width: 3px; }
.cdm2-right-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
[data-theme="light"] .cdm2-right-panel::-webkit-scrollbar-thumb { background: #CBD5E1; }

/* Section titles */
.cdm2-section { display: flex; flex-direction: column; gap: 8px; }
.cdm2-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cdm2-section-title {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.40);
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
[data-theme="light"] .cdm2-section-title { color: #5E6C84; }
.cdm2-section-title svg { opacity: 0.7; flex-shrink: 0; }
.cdm2-section-action {
  font-size: 11px; font-weight: 500; color: var(--accent);
  background: none; border: none; cursor: pointer; font-family: inherit; padding: 0;
}
.cdm2-section-action:hover { opacity: 0.75; text-decoration: underline; }

/* Description */
.cdm2-desc-ta {
  width: 100%; min-height: 80px; max-height: 260px;
  padding: 10px 12px; border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px; font-size: 13px; font-family: inherit;
  resize: vertical; background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.85); line-height: 1.6;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.cdm2-desc-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.cdm2-desc-ta::placeholder { color: rgba(255,255,255,0.25); font-style: italic; }
[data-theme="light"] .cdm2-desc-ta {
  background: #FFFFFF; border-color: #C1C7D0; color: #172B4D;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
[data-theme="light"] .cdm2-desc-ta::placeholder { color: #8993A4; font-style: italic; }
[data-theme="light"] .cdm2-desc-ta:focus { border-color: #4C9AFF; box-shadow: 0 0 0 2px rgba(76,154,255,0.2); }

/* Props grid */
.cdm2-props-grid { display: grid; grid-template-columns: repeat(4,auto); gap: 0; align-items: stretch; }
@media(max-width:700px) { .cdm2-props-grid { grid-template-columns: repeat(2,1fr); } }
.cdm2-prop { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px 6px 0; }
.cdm2-prop:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.07); margin-right: 12px; }
[data-theme="light"] .cdm2-prop:not(:last-child) { border-right-color: var(--border-light); }
.cdm2-prop-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: rgba(255,255,255,0.38);
  display: flex; align-items: center; gap: 4px;
}
[data-theme="light"] .cdm2-prop-label { color: var(--text-muted); }
.cdm2-prop-label svg { opacity: 0.7; flex-shrink: 0; }
.cdm2-prop-value { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cdm2-prop-select, .cdm2-prop-date, .cdm2-prop-time {
  height: 30px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 5px;
  font-size: 12px; font-weight: 500; font-family: inherit;
  color: rgba(255,255,255,0.80); background: transparent;
  cursor: pointer; transition: all 0.12s; max-width: 130px;
}
.cdm2-prop-select:hover, .cdm2-prop-date:hover { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.07); }
.cdm2-prop-select:focus, .cdm2-prop-date:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted); background: rgba(255,255,255,0.07);
}
[data-theme="light"] .cdm2-prop-select, [data-theme="light"] .cdm2-prop-date { color: var(--text-primary); }
[data-theme="light"] .cdm2-prop-select:hover, [data-theme="light"] .cdm2-prop-date:hover { border-color: var(--border); background: var(--bg-hover); }

/* Priority status badges */
.cdm2-status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; flex-shrink: 0; margin-top: 6px; cursor: default; }
.cdm2-status-todo     { background: rgba(71,85,105,0.20); color: #94A3B8; }
.cdm2-status-progress { background: rgba(217,119,6,0.15); color: #FBBF24; }
.cdm2-status-testing  { background: rgba(124,58,237,0.15); color: #A78BFA; }
.cdm2-status-done     { background: rgba(5,150,105,0.15); color: #34D399; }
[data-theme="light"] .cdm2-status-todo     { background: rgba(148,163,184,0.15); color: #64748B; }
[data-theme="light"] .cdm2-status-progress { background: rgba(245,158,11,0.15); color: #D97706; }
[data-theme="light"] .cdm2-status-testing  { background: rgba(139,92,246,0.15); color: #7C3AED; }
[data-theme="light"] .cdm2-status-done     { background: rgba(16,185,129,0.15); color: #059669; }

/* Priority pills */
.cdm2-priority-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.cdm2-pp-none     { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.40); }
.cdm2-pp-low      { background: rgba(75,206,151,0.14); color: #4BCE97; }
.cdm2-pp-medium   { background: rgba(254,163,98,0.14); color: #FEA362; }
.cdm2-pp-high     { background: rgba(248,116,98,0.14); color: #F87462; }
.cdm2-pp-critical { background: rgba(220,38,38,0.18); color: #F87171; }
[data-theme="light"] .cdm2-pp-none     { background: var(--bg-hover); color: var(--text-muted); }
[data-theme="light"] .cdm2-pp-low      { background: #DCFCE7; color: #059669; }
[data-theme="light"] .cdm2-pp-medium   { background: #FEF3C7; color: #D97706; }
[data-theme="light"] .cdm2-pp-high     { background: #FEE2E2; color: #DC2626; }
[data-theme="light"] .cdm2-pp-critical { background: #FEE2E2; color: #DC2626; }
.cdm2-priority-none     { color: rgba(255,255,255,0.40) !important; }
.cdm2-priority-low      { color: #4BCE97 !important; }
.cdm2-priority-medium   { color: #FEA362 !important; }
.cdm2-priority-high     { color: #F87462 !important; }
.cdm2-priority-critical { color: #F87171 !important; font-weight: 700 !important; }
.cdm2-priority-row { display: flex; align-items: center; gap: 8px; flex-direction: row !important; flex-wrap: wrap; }

/* Labels */
.cdm2-labels-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.cdm2-label-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #1D2125; cursor: default; white-space: nowrap;
}
.cdm2-label-chip.label-red    { background: #F87462; }
.cdm2-label-chip.label-orange { background: #FEA362; }
.cdm2-label-chip.label-yellow { background: #F5CD47; }
.cdm2-label-chip.label-green  { background: #4BCE97; }
.cdm2-label-chip.label-blue   { background: #579DFF; }
.cdm2-label-chip.label-purple { background: #9F8FEF; }
.cdm2-label-rm {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.7; font-size: 14px; line-height: 1;
  padding: 0 1px; transition: opacity 0.12s;
}
.cdm2-label-rm:hover { opacity: 1; }
.cdm2-label-add-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.cdm2-label-add-row select, .cdm2-label-add-row input { height: 32px; font-size: 12px; }
.cdm2-label-add-row select { flex: 0 0 auto; width: 110px; }
.cdm2-label-add-row input  { flex: 1; min-width: 80px; }

/* Member chips */
.cdm2-member-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#3B82F6,#7C3AED);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #161B25; margin-left: -6px;
  cursor: default; transition: transform 0.12s; position: relative; z-index: 1;
}
[data-theme="light"] .cdm2-member-av { border-color: #FFFFFF; }
.cdm2-member-av:first-child { margin-left: 0; }
.cdm2-member-av:hover { transform: scale(1.14); z-index: 2; }
.cdm2-member-av[data-remove] { cursor: pointer; }
.cdm2-member-av[data-remove]:hover::after {
  content: '×'; position: absolute; inset: 0;
  background: rgba(220,38,38,0.90); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.cdm2-members-stack { display: flex; align-items: center; }
.cdm2-empty-hint { font-size: 12px; color: rgba(255,255,255,0.30); font-style: italic; }
[data-theme="light"] .cdm2-empty-hint { color: var(--text-muted); }

/* Checklist */
.cdm2-cl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cdm2-cl-progress-text { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.40); }
[data-theme="light"] .cdm2-cl-progress-text { color: var(--text-muted); }
.cdm2-cl-bar-wrap { height: 4px; background: rgba(255,255,255,0.08); border-radius: 99px; margin-bottom: 12px; overflow: hidden; }
[data-theme="light"] .cdm2-cl-bar-wrap { background: #E2E8F0; }
.cdm2-cl-bar-fill { height: 100%; border-radius: 99px; background: #3B82F6; transition: width 0.4s cubic-bezier(.4,0,.2,1); }
.cdm2-cl-bar-fill.half { background: #D97706; }
.cdm2-cl-bar-fill.full { background: #059669; }
.cdm2-cl-items { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.cdm2-cl-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; transition: background 0.12s; }
.cdm2-cl-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .cdm2-cl-item:hover { background: var(--bg-hover); }
.cdm2-cl-cb {
  width: 15px; height: 15px; flex-shrink: 0; border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.25); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: all 0.15s; background: transparent;
}
[data-theme="light"] .cdm2-cl-cb { border-color: var(--border-hover); background: var(--bg-surface); }
.cdm2-cl-cb:checked {
  background: #059669; border-color: #059669;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.cdm2-cl-text { flex: 1; font-size: 13px; color: rgba(255,255,255,0.80); line-height: 1.4; transition: color 0.12s; }
[data-theme="light"] .cdm2-cl-text { color: var(--text-primary); }
.cdm2-cl-text.done { text-decoration: line-through; color: rgba(255,255,255,0.30); }
[data-theme="light"] .cdm2-cl-text.done { color: var(--text-muted); }
.cdm2-cl-del {
  width: 20px; height: 20px; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.30); opacity: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 4px; transition: opacity 0.12s, color 0.12s;
}
.cdm2-cl-item:hover .cdm2-cl-del { opacity: 1; }
.cdm2-cl-del:hover { color: #F87171; background: rgba(248,113,113,0.12); opacity: 1 !important; }
.cdm2-cl-add-row { display: flex; gap: 6px; }
.cdm2-cl-add-input {
  flex: 1; height: 32px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 6px;
  font-size: 12px; font-family: inherit;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
}
.cdm2-cl-add-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
[data-theme="light"] .cdm2-cl-add-input { background: var(--bg-input); border-color: var(--border); color: var(--text-primary); }

/* Checklist in card mini */
.cdm-checklist-progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cdm-checklist-pct { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.40); }
.cdm-checklist-bar-wrap { height: 4px; background: rgba(255,255,255,0.08); border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.cdm-checklist-bar-fill { height: 100%; background: #3B82F6; border-radius: 4px; transition: width .3s; }
.cdm-checklist-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.cdm-checklist-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.cdm-checklist-cb { width: 15px; height: 15px; border-radius: 3px; border: 2px solid rgba(255,255,255,0.25); cursor: pointer; flex-shrink: 0; appearance: none; -webkit-appearance: none; transition: all .15s; }
.cdm-checklist-cb:checked { background: #059669; border-color: #059669; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; }
.cdm-checklist-text { font-size: 12px; color: rgba(255,255,255,0.80); flex: 1; line-height: 1.4; }
.cdm-checklist-text.done { text-decoration: line-through; color: rgba(255,255,255,0.30); }
.cdm-checklist-del { width: 20px; height: 20px; background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.30); opacity: 0; transition: opacity .12s, color .12s; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.cdm-checklist-item:hover .cdm-checklist-del { opacity: 1; }
.cdm-checklist-del:hover { color: #F87171; background: rgba(248,113,113,0.12); }
.cdm-checklist-add-wrap { display: flex; gap: 6px; }
.cdm-checklist-add-input { flex: 1; height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; font-size: 12px; font-family: inherit; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.cdm-checklist-add-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
[data-theme="light"] .cdm-checklist-text { color: var(--text-primary); }
[data-theme="light"] .cdm-checklist-text.done { color: var(--text-muted); }
[data-theme="light"] .cdm-checklist-add-input { background: var(--bg-input); border-color: var(--border); color: var(--text-primary); }

/* Right panel — comments & activity */
.cdm2-right-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  /* Sticky so header stays visible while right panel scrolls */
  position: sticky; top: 0; z-index: 2;
  background: rgba(0,0,0,0.12);
}
[data-theme="light"] .cdm2-right-header {
  border-bottom-color: #E8ECF0;
  background: #F7F8F9;
}
.cdm2-right-header-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.80); }
[data-theme="light"] .cdm2-right-header-title { color: var(--text-primary); }
.cdm2-right-header-title svg { opacity: 0.55; flex-shrink: 0; }
.cdm2-hide-details-btn { 
  font-size: 12px; 
  font-weight: 600; 
  color: var(--accent); 
  background: none; 
  border: none; 
  cursor: pointer; 
  font-family: inherit; 
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cdm2-hide-details-btn:hover { 
  opacity: 1;
  background: var(--bg-hover);
  text-decoration: none;
}
.cdm2-comment-form { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid rgba(255,255,255,0.07); }
[data-theme="light"] .cdm2-comment-form { border-bottom-color: #E8ECF0; }
.cdm2-comment-ta {
  width: 100%; min-height: 56px; padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 5px;
  font-size: 13px; font-family: inherit; resize: vertical;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85);
  line-height: 1.5; box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cdm2-comment-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.cdm2-comment-ta::placeholder { color: rgba(255,255,255,0.25); }
[data-theme="light"] .cdm2-comment-ta {
  background: #FFFFFF; border-color: #C1C7D0; color: #172B4D;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
[data-theme="light"] .cdm2-comment-ta::placeholder { color: #8993A4; }
[data-theme="light"] .cdm2-comment-ta:focus { border-color: #4C9AFF; box-shadow: 0 0 0 2px rgba(76,154,255,0.2); }
.cdm2-comment-actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 6px;
  margin-top: 4px;
}
.cdm2-comment-submit { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; background: #0052CC; color: white; border: none; border-radius: 4px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s; }
.cdm2-comment-submit:hover { background: #0747A6; }
.cdm2-activity-feed::-webkit-scrollbar { width: 4px; }
.cdm2-activity-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
[data-theme="light"] .cdm2-activity-feed::-webkit-scrollbar-thumb { background: #CBD5E1; }
.cdm2-cmt-item { display: flex; gap: 9px; }
.cdm2-cmt-av { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg,#3B82F6,#7C3AED); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cdm2-cmt-body { flex: 1; min-width: 0; }
.cdm2-cmt-header { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.cdm2-cmt-author { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.80); }
[data-theme="light"] .cdm2-cmt-author { color: var(--text-primary); }
.cdm2-cmt-time { font-size: 10px; color: var(--accent); }
.cdm2-cmt-bubble { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); border-radius: 0 7px 7px 7px; padding: 7px 10px; }
[data-theme="light"] .cdm2-cmt-bubble { background: var(--bg-hover); border-color: var(--border-light); }
.cdm2-cmt-text { font-size: 12px; color: rgba(255,255,255,0.65); line-height: 1.5; }
[data-theme="light"] .cdm2-cmt-text { color: var(--text-secondary); }
.cdm2-act-item { display: flex; gap: 9px; align-items: flex-start; }
.cdm2-act-av { background: linear-gradient(135deg,#475569,#64748B) !important; }
.cdm2-act-detail { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; }
[data-theme="light"] .cdm2-act-detail { color: var(--text-secondary); }
.cdm2-act-divider { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.25); padding: 6px 0 2px; }
[data-theme="light"] .cdm2-act-divider { color: var(--text-muted); }

/* Right panel action buttons */
.cdm2-actions-section { 
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  margin-top: 8px;
}
[data-theme="light"] .cdm2-actions-section { border-top-color: #E8ECF0; }
.cdm2-panel-section { padding: 10px 14px; }
.cdm2-panel-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255,255,255,0.30); margin-bottom: 6px; }
[data-theme="light"] .cdm2-panel-section-title { color: #8B98A5; }
.cdm2-action-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px; margin-bottom: 1px;
  border-radius: 4px;
  background: transparent; border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px; font-weight: 400; color: rgba(255,255,255,0.70);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.cdm2-action-btn:last-child { border-bottom: none; margin-bottom: 0; }
.cdm2-action-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.95); }
[data-theme="light"] .cdm2-action-btn {
  color: #172B4D;
  border-bottom-color: #E8ECF0;
  background: transparent;
}
[data-theme="light"] .cdm2-action-btn:hover { background: #F4F5F7; color: #172B4D; }
.cdm2-action-btn svg { flex-shrink: 0; opacity: 0.55; width: 14px; height: 14px; }
.cdm2-action-btn:hover svg { opacity: 0.85; }
.cdm2-action-btn-danger { color: #F87171 !important; }
[data-theme="light"] .cdm2-action-btn-danger { color: #AE2E24 !important; }
.cdm2-action-btn-danger svg { color: #F87171; opacity: 0.8 !important; }
[data-theme="light"] .cdm2-action-btn-danger svg { color: #AE2E24; }
.cdm2-action-btn-danger:hover { background: rgba(248,113,113,0.08) !important; }
[data-theme="light"] .cdm2-action-btn-danger:hover { background: #FFEDEB !important; }
.cdm2-action-btn:hover svg { opacity: 1; }
.cdm2-action-btn-danger { color: #F87171 !important; }
.cdm2-action-btn-danger:hover { background: rgba(248,113,113,0.12) !important; border-color: rgba(248,113,113,0.25) !important; }
[data-theme="light"] .cdm2-action-btn-danger { color: var(--red) !important; }
[data-theme="light"] .cdm2-action-btn-danger:hover { background: var(--red-light) !important; border-color: var(--red) !important; }
.cdm2-panel-select {
  width: 100%; height: 32px; padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 5px;
  font-size: 12px; font-family: inherit;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.80);
  margin-bottom: 4px;
}
.cdm2-panel-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
[data-theme="light"] .cdm2-panel-select {
  background: #FFFFFF; border-color: #C1C7D0; color: #172B4D;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.cdm2-member-assign-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ─────────────────────────────────────────────────────────────────
   CDM2 ENHANCED: Show/Hide Details Toggle
   ───────────────────────────────────────────────────────────────── */

/* Activity feed and actions panel toggle with smooth transitions */
.cdm2-activity-feed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 !important;
  margin: 0 !important;
}

.cdm2-activity-feed.show {
  max-height: 500px;
  opacity: 1;
  padding: 8px 12px 12px !important;
}

/* Actions visible by default when card opens */
.cdm2-actions-section { 
  display: block;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* Hidden state when user clicks "Hide details" */
.cdm2-actions-section.hide { 
  max-height: 0;
  opacity: 0;
  padding: 0 !important;
  margin-top: 0 !important;
}

/* Button state toggle */
.cdm2-hide-details-btn { 
  user-select: none;
  transition: color 0.15s ease;
}

.cdm2-hide-details-btn.showing-details {
  color: var(--accent);
}

/* Save bar positioning */
.cdm2-save-bar {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 12px 0 4px;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 12px;
  flex-wrap: wrap;
}
[data-theme="light"] .cdm2-save-bar { border-top-color: #E8ECF0; }
.cdm2-saved-tick { 
  display: none;
  align-items: center; 
  gap: 4px;
  font-size: 12px; 
  font-weight: 500;
  color: #059669;
  animation: fadeInOut 2s ease;
}
.cdm2-saved-tick.show { display: flex; }
.cdm2-saved-tick svg { width: 14px; height: 14px; }
@keyframes fadeInOut { 
  0% { opacity: 1; } 
  70% { opacity: 1; } 
  100% { opacity: 0; } 
}
.cdm2-save-btn {
  display: inline-flex; 
  align-items: center; 
  gap: 5px;
  padding: 8px 16px; 
  border-radius: 6px;
  background: var(--accent); 
  color: #fff; 
  border: none;
  font-size: 13px; 
  font-weight: 600; 
  font-family: inherit; 
  cursor: pointer; 
  transition: all 0.15s;
}
.cdm2-save-btn:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }
.cdm2-save-btn:active { transform: scale(0.98); }

/* Date picker modal overlay */
.cdm2-date-picker-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 24px;
}
.cdm2-date-picker-modal div {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-xl);
  max-width: 320px;
  width: 100%;
}

/* Responsive modal adjustments */
@media(max-width: 640px) {
  .cdm2-box { 
    width: 95vw; 
    max-width: 100%;
    max-height: 95vh;
    border-radius: 8px;
  }
  .cdm2-body { grid-template-columns: 1fr; }
  .cdm2-right-panel { 
    border-left: none !important; 
    border-top: 1px solid rgba(255,255,255,0.08); 
  }
  [data-theme="light"] .cdm2-right-panel { border-top-color: #E8ECF0; }
}

@media(max-width: 480px) {
  .cdm2-box { width: 100vw; max-height: 100vh; border-radius: 0; }
  .cdm2-header { padding: 12px 16px 0; }
  .cdm2-left { padding: 12px 16px; }
  .cdm2-toolbar { gap: 3px; }
  .cdm2-tb-btn { 
    font-size: 11px; 
    padding: 3px 8px; 
  }
  .cdm2-title-input { font-size: 16px; }
  .cdm2-props-grid { grid-template-columns: 1fr; }
  .cdm2-prop:not(:last-child) { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); margin-right: 0; margin-bottom: 8px; padding-bottom: 8px; }
}
.cdm2-member-assign-row select { flex: 1; height: 32px; font-size: 12px; }



/* Links */
.cdm2-link-item { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 7px; margin-bottom: 5px; }
[data-theme="light"] .cdm2-link-item { background: var(--bg-input); border-color: var(--border); }
.cdm2-link-item:last-child { margin-bottom: 0; }
.cdm2-link-anchor { flex: 1; font-size: 12px; font-weight: 500; color: #93C5FD; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdm2-link-anchor:hover { text-decoration: underline; }
.cdm2-link-rm { background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.30); font-size: 16px; line-height: 1; padding: 1px 3px; transition: color 0.12s; flex-shrink: 0; }
.cdm2-link-rm:hover { color: #F87171; }

/* Due date picker */
.cdm2-due-date-wrapper { display: flex; gap: 8px; align-items: center; }
.cdm2-due-date-btn { height: 28px; padding: 0 11px; border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; font-size: 12px; font-weight: 500; font-family: inherit; color: rgba(255,255,255,0.75); background: transparent; cursor: pointer; transition: all 0.12s; }
.cdm2-due-date-btn:hover { border-color: rgba(255,255,255,0.20); background: rgba(255,255,255,0.07); }
[data-theme="light"] .cdm2-due-date-btn { color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .cdm2-due-date-btn:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.cdm2-date-picker-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; overflow-y: auto; animation: cdm2FadeIn 0.18s ease; }
.cdm2-date-picker-modal[style*="display: flex"] { display: flex !important; }
.cdm2-date-picker { background: #1C2333; border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.55); width: 100%; max-width: 360px; max-height: calc(100vh - 40px); overflow-y: auto; animation: cdm2In 0.18s ease; }
[data-theme="light"] .cdm2-date-picker { background: #FFFFFF; border-color: #E2E8F0; box-shadow: 0 16px 50px rgba(0,0,0,0.14); }
.cdm2-date-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cdm2-date-nav-btn { width: 30px; height: 30px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; cursor: pointer; color: rgba(255,255,255,0.75); display: flex; align-items: center; justify-content: center; transition: all 0.12s; font-family: inherit; font-size: 16px; }
.cdm2-date-nav-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.95); }
[data-theme="light"] .cdm2-date-nav-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-primary); }
.cdm2-date-picker-title { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); flex: 1; text-align: center; }
[data-theme="light"] .cdm2-date-picker-title { color: var(--text-primary); }
.cdm2-calendar { margin-bottom: 16px; }
.cdm2-weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 8px; }
.cdm2-weekdays > div { text-align: center; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.30); text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 0; }
[data-theme="light"] .cdm2-weekdays > div { color: var(--text-muted); }
.cdm2-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cdm2-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.05); border-radius: 5px; font-size: 12px; cursor: pointer; background: transparent; color: rgba(255,255,255,0.70); transition: all 0.11s; font-family: inherit; font-weight: 500; }
.cdm2-day:hover { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.30); color: #93C5FD; }
.cdm2-day.other { color: rgba(255,255,255,0.20); opacity: 0.5; }
.cdm2-day.today { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.cdm2-day.selected { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
[data-theme="light"] .cdm2-day { color: var(--text-primary); border-color: var(--border-light); }
[data-theme="light"] .cdm2-day:hover { background: var(--bg-hover); border-color: var(--border); }
[data-theme="light"] .cdm2-day.today { border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .cdm2-day.selected { background: var(--accent); color: #fff; }
.cdm2-datetime-inputs { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.cdm2-input-group { display: flex; flex-direction: column; gap: 6px; }
.cdm2-date-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cdm2-input-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.38); text-transform: uppercase; letter-spacing: 0.5px; }
[data-theme="light"] .cdm2-input-label { color: var(--text-muted); }
.cdm2-today-btn { padding: 3px 9px; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; font-size: 11px; font-weight: 600; color: var(--accent); background: transparent; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.cdm2-today-btn:hover { background: var(--accent-muted); border-color: var(--accent); }
.cdm2-input-field { height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; font-size: 13px; font-family: inherit; color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); width: 100%; box-sizing: border-box; transition: all 0.12s; }
.cdm2-input-field:hover { border-color: rgba(255,255,255,0.18); }
.cdm2-input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
[data-theme="light"] .cdm2-input-field { background: var(--bg-input); border-color: var(--border); color: var(--text-primary); }
.cdm2-time-input { font-family: 'Monaco','Menlo','Ubuntu Mono',monospace; letter-spacing: 0.5px; font-weight: 500; padding-right: 40px !important; }
.cdm2-time-select { width: 100%; cursor: pointer; font-size: 13px; }
.cdm2-time-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cdm2-picker-footer { display: flex; gap: 8px; }
.cdm2-picker-btn { flex: 1; height: 36px; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.cdm2-btn-primary { background: var(--accent); color: #fff; }
.cdm2-btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.cdm2-btn-secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.12); }
.cdm2-btn-secondary:hover { background: rgba(255,255,255,0.13); color: rgba(255,255,255,0.95); }
[data-theme="light"] .cdm2-btn-secondary { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
[data-theme="light"] .cdm2-btn-secondary:hover { background: var(--bg-active); }
.cdm2-date-popup { position: absolute; z-index: 1100; background: #1C2333; border: 1px solid rgba(255,255,255,0.10); border-radius: 11px; box-shadow: 0 16px 48px rgba(0,0,0,0.50); padding: 16px; min-width: 280px; }
.cdm2-date-popup[hidden] { display: none; }
[data-theme="light"] .cdm2-date-popup { background: #FFFFFF; border-color: #E2E8F0; box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

/* CDM2 compat — legacy modal styles */
.card-modal-overlay { position: fixed; inset: 0; background: var(--bg-overlay); backdrop-filter: blur(5px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; animation: cdm2FadeIn 0.18s ease; }
.card-modal-overlay[hidden] { display: none; }
.card-modal-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,0.30); width: 100%; max-width: 840px; max-height: 88vh; overflow-y: auto; padding: 28px; position: relative; animation: cdm2In 0.22s ease; }
.card-modal-close { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; background: rgba(255,255,255,0.08); border: none; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.50); transition: background 0.15s, color 0.15s; }
.card-modal-close:hover { background: rgba(248,113,113,0.14); color: #F87171; }
.cdm-layout { display: grid; grid-template-columns: 1fr 240px; gap: 24px; padding-top: 4px; }
@media(max-width:680px) { .cdm-layout { grid-template-columns: 1fr; } }
.cdm-left { min-width: 0; }
.cdm-sidebar { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.cdm-sidebar-btn { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.55); cursor: pointer; transition: all 0.14s; text-align: left; font-family: inherit; width: 100%; }
.cdm-sidebar-btn:hover { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.88); }
[data-theme="light"] .cdm-sidebar-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .cdm-sidebar-btn:hover { background: var(--bg-active); color: var(--text-primary); }

/* ── 16. MEMBER AVATAR SYSTEM ────────────────────────────────────── */
[data-member-trigger] { cursor: pointer; }

/* Tooltip */
.mav-tooltip {
  position: fixed; z-index: 8500;
  background: #0D1117; color: rgba(255,255,255,0.85);
  font-size: 12px; font-weight: 600; padding: 5px 10px;
  border-radius: 6px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
[data-theme="light"] .mav-tooltip { background: #1E293B; color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.mav-tooltip.mav-tooltip-visible { opacity: 1; transform: translateY(0); }
.mav-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #0D1117; }
[data-theme="light"] .mav-tooltip::after { border-top-color: #1E293B; }

/* Profile Popover */
.member-popover {
  position: fixed; z-index: 9000; width: 292px;
  border-radius: 12px; overflow: hidden;
  background: #1C2333; border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 10px 36px rgba(0,0,0,0.50);
  opacity: 0; transform: scale(0.94) translateY(-8px);
  transform-origin: top center;
  transition: opacity 0.16s cubic-bezier(.34,1.2,.64,1), transform 0.16s cubic-bezier(.34,1.2,.64,1);
  pointer-events: none;
}
[data-theme="light"] .member-popover { background: #FFFFFF; border-color: #E2E8F0; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.member-popover.mpp-open { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.mpp-header { height: 68px; background: linear-gradient(135deg,#1D4ED8 0%,#2563EB 55%,#4F46E5 100%); position: relative; flex-shrink: 0; }
.mpp-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: none; background: rgba(255,255,255,0.14); border-radius: 5px; color: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.12s; font-family: inherit; }
.mpp-close:hover { background: rgba(255,255,255,0.26); color: #fff; }
.mpp-avatar-wrap { position: absolute; bottom: -36px; left: 18px; z-index: 2; }
.mpp-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg,#3B82F6,#7C3AED); color: #fff; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 3px solid #1C2333; box-shadow: 0 4px 18px rgba(0,0,0,0.45); user-select: none; letter-spacing: -1px; }
[data-theme="light"] .mpp-avatar { border-color: #FFFFFF; box-shadow: 0 4px 16px rgba(0,0,0,0.14); }
.mpp-body { background: #1C2333; padding: 46px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
[data-theme="light"] .mpp-body { background: #FFFFFF; }
.mpp-identity { display: flex; flex-direction: column; gap: 2px; }
.mpp-name { font-size: 15px; font-weight: 700; color: rgba(255,255,255,0.88); line-height: 1.25; }
[data-theme="light"] .mpp-name { color: #1E293B; }
.mpp-username { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45); }
.mpp-username::before { content: '@'; margin-right: 1px; opacity: 0.7; }
[data-theme="light"] .mpp-username { color: #64748B; }
.mpp-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 2px 0; }
[data-theme="light"] .mpp-divider { background: #F1F5F9; }
.mpp-actions { display: flex; flex-direction: column; gap: 2px; }
.mpp-action-btn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; border: none; background: transparent; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.55); cursor: pointer; width: 100%; text-align: left; font-family: inherit; text-decoration: none; transition: background 0.12s, color 0.12s; }
.mpp-action-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.90); }
[data-theme="light"] .mpp-action-btn { color: #475569; }
[data-theme="light"] .mpp-action-btn:hover { background: #F1F5F9; color: #1E293B; }
.mpp-action-btn svg { flex-shrink: 0; opacity: 0.60; }
.mpp-action-btn:hover svg { opacity: 1; }

/* Activity Modal */
.mam-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.60); backdrop-filter: blur(5px); z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity 0.18s ease; pointer-events: none; }
.mam-overlay.mam-open { opacity: 1; pointer-events: auto; }
.mam-box { background: #1C2333; border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.55); width: 100%; max-width: 500px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; transform: scale(0.95) translateY(10px); transition: transform 0.18s cubic-bezier(.34,1.2,.64,1); }
[data-theme="light"] .mam-box { background: #FFFFFF; border-color: #E2E8F0; box-shadow: 0 24px 64px rgba(0,0,0,0.14); }
.mam-overlay.mam-open .mam-box { transform: scale(1) translateY(0); }
.mam-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; }
[data-theme="light"] .mam-header { border-bottom-color: #F1F5F9; }
.mam-header-av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#3B82F6,#7C3AED); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mam-header-info { flex: 1; min-width: 0; }
.mam-header-name { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .mam-header-name { color: #1E293B; }
.mam-header-sub { font-size: 11px; color: rgba(255,255,255,0.38); margin-top: 1px; }
[data-theme="light"] .mam-header-sub { color: #94A3B8; }
.mam-close { width: 28px; height: 28px; border: none; background: rgba(255,255,255,0.07); border-radius: 6px; color: rgba(255,255,255,0.45); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background 0.12s, color 0.12s; font-family: inherit; }
.mam-close:hover { background: rgba(248,113,113,0.14); color: #F87171; }
[data-theme="light"] .mam-close:hover { background: #FEF2F2; color: #EF4444; }
.mam-feed { flex: 1; overflow-y: auto; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 1px; }
.mam-feed::-webkit-scrollbar { width: 4px; }
.mam-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 2px; }
[data-theme="light"] .mam-feed::-webkit-scrollbar-thumb { background: #CBD5E1; }
.mam-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 7px; border-radius: 7px; transition: background 0.1s; }
.mam-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="light"] .mam-item:hover { background: #F8FAFC; }
.mam-dot { width: 7px; height: 7px; border-radius: 50%; background: #3B82F6; flex-shrink: 0; margin-top: 5px; }
.mam-item-body { flex: 1; min-width: 0; }
.mam-item-detail { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; }
[data-theme="light"] .mam-item-detail { color: #475569; }
.mam-item-detail strong { color: rgba(255,255,255,0.82); font-weight: 600; }
[data-theme="light"] .mam-item-detail strong { color: #1E293B; }
.mam-item-time { font-size: 11px; color: rgba(255,255,255,0.28); margin-top: 2px; }
[data-theme="light"] .mam-item-time { color: #94A3B8; }
.mam-empty { padding: 28px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.28); }
[data-theme="light"] .mam-empty { color: #94A3B8; }
.mam-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 0; font-size: 13px; color: rgba(255,255,255,0.35); }
.mam-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.10); border-top-color: #3B82F6; border-radius: 50%; animation: mamSpin 0.65s linear infinite; flex-shrink: 0; }
[data-theme="light"] .mam-spinner { border-color: #E2E8F0; border-top-color: #2563EB; }
@keyframes mamSpin { to { transform: rotate(360deg); } }

/* ── 17. GLOBAL UTILITIES & COMPAT ───────────────────────────────── */

/* Board star active state */
#board-star-btn.starred svg { fill: #FBBF24; stroke: #FBBF24; }
#board-star-btn.starred { color: #FBBF24; }

/* no-item messages */
.no-item-msg { font-size: 12px; color: rgba(255,255,255,0.28); font-style: italic; }
[data-theme="light"] .no-item-msg { color: var(--text-muted); }
.rm-btn { background: none; border: none; cursor: pointer; font-size: 14px; color: rgba(255,255,255,0.35); line-height: 1; padding: 0 1px; transition: color 0.12s; }
.rm-btn:hover { color: #F87171; }
.cdm-inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cdm-inline-form select, .cdm-inline-form input { height: 32px; font-size: 12px; flex: 1; min-width: 80px; }
.cdm-title-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding-right: 44px; }
.cdm-title-input { flex: 1; font-size: 19px; font-weight: 700; color: rgba(255,255,255,0.88); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 8px; font-family: inherit; resize: none; overflow: hidden; line-height: 1.4; transition: border-color 0.15s, background 0.15s; }
.cdm-title-input:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.10); }
.cdm-title-input:focus { outline: none; background: rgba(255,255,255,0.05); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.cdm-action-row { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.cdm-action-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 6px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.09); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.55); cursor: pointer; transition: all 0.14s; text-decoration: none; font-family: inherit; }
.cdm-action-btn:hover { background: rgba(255,255,255,0.11); color: rgba(255,255,255,0.88); }
[data-theme="light"] .cdm-action-btn { background: var(--bg-hover); border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .cdm-action-btn:hover { background: var(--bg-active); color: var(--text-primary); }
.cdm-section { margin-bottom: 20px; }
.cdm-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.35); margin-bottom: 10px; }
[data-theme="light"] .cdm-section-title { color: var(--text-muted); }
.cdm-collapsible { display: none; }
.cdm-collapsible.open { display: block; }
.cdm-labels, .cdm-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.cdm-label-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #1D2125; }
.cdm-label-tag.label-red    { background: #F87462; }
.cdm-label-tag.label-orange { background: #FEA362; }
.cdm-label-tag.label-yellow { background: #F5CD47; }
.cdm-label-tag.label-green  { background: #4BCE97; }
.cdm-label-tag.label-blue   { background: #579DFF; }
.cdm-label-tag.label-purple { background: #9F8FEF; }
.cdm-member-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.09); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75); }
[data-theme="light"] .cdm-member-tag { background: var(--bg-hover); border-color: var(--border); color: var(--text-primary); }
.cdm-save-btn { padding: 6px 14px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s, transform 0.12s; white-space: nowrap; flex-shrink: 0; }
.cdm-save-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.cdm-desc-ta { width: 100%; min-height: 90px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.09); border-radius: 7px; font-size: 13px; font-family: inherit; resize: vertical; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); line-height: 1.6; }
.cdm-desc-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.cdm-comment-form { margin-bottom: 14px; }
.cdm-comment-ta { width: 100%; min-height: 66px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.09); border-radius: 7px; font-size: 13px; font-family: inherit; resize: vertical; background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); margin-bottom: 7px; }
.cdm-comment-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
[data-theme="light"] .cdm-desc-ta, [data-theme="light"] .cdm-comment-ta { background: var(--bg-input); border-color: var(--border); color: var(--text-primary); }
.cdm-comments { display: flex; flex-direction: column; gap: 12px; }
.cdm-comment-item { display: flex; gap: 10px; }
.cdm-c-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg,#3B82F6,#7C3AED); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cdm-c-body { flex: 1; min-width: 0; }
.cdm-c-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cdm-c-author { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.82); }
.cdm-c-time { font-size: 10px; color: var(--accent); }
.cdm-c-bubble { background: rgba(255,255,255,0.05); border-radius: 0 7px 7px 7px; padding: 7px 11px; border: 1px solid rgba(255,255,255,0.07); }
.cdm-c-text { font-size: 12px; color: rgba(255,255,255,0.60); line-height: 1.55; }
[data-theme="light"] .cdm-c-bubble { background: var(--bg-hover); border-color: var(--border-light); }
[data-theme="light"] .cdm-c-author { color: var(--text-primary); }
[data-theme="light"] .cdm-c-text { color: var(--text-secondary); }

/* Smooth theme transitions */
.board-page,.board-header,.kol,.kol-header,.card-item,.cdm2-box,.bg-popover {
  transition-property: background, border-color, box-shadow, color;
  transition-duration: 0.22s; transition-timing-function: ease;
}

/* Board isolation */
.board-page { isolation: isolate; }

/* KOL sortable drag */
.kol-sortable-ghost  { opacity: 0.25; }
.kol-sortable-chosen { opacity: 0.90; transform: rotate(1deg); box-shadow: 0 14px 44px rgba(0,0,0,0.55); }

/* ── 18. ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeInOverlay  { from { opacity: 0; }                           to { opacity: 1; } }
@keyframes scaleInModal   { from { opacity: 0; transform: scale(0.94); }  to { opacity: 1; transform: scale(1); } }
@keyframes scaleIn        { from { opacity: 0; transform: scale(0.95); }  to { opacity: 1; transform: scale(1); } }

/* ── 19. RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .bh-stats    { display: none; }
  .bh-divider  { display: none; }
  .bsb-item    { padding: 0 10px; }
}

@media (max-width: 640px) {
  .board-header  { padding: 0 12px; gap: 6px; height: 48px; min-height: 48px; }
  .bh-title      { max-width: 150px; font-size: 14px; }
  .bh-tool-btn   { display: none; }
  .board-canvas  { padding: 10px 8px 20px; }
  .kol           { width: 288px; min-width: 288px; }
  .kol-new       { width: 288px; min-width: 288px; }
  .bsb           { padding: 0 12px; }
  .bsb-item      { padding: 0 8px; }
  .bsb-val       { font-size: 12px; }
  .bsb-lbl       { font-size: 9px; }
  .cdm2-body     { grid-template-columns: 1fr; overflow-y: auto; }
  .cdm2-box      { max-height: 92vh; border-radius: 12px; }
  .cdm2-right-panel { border-left: none; border-top: 1px solid rgba(255,255,255,0.08); }
  .cdm2-props-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 480px) {
  .kol, .kol-new { width: 88vw; min-width: 88vw; }
  .member-popover { width: 256px; }
  .mam-box { max-height: 88vh; }
}

/* ── 20. BTN UTILITY ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.14s, transform 0.12s, box-shadow 0.14s; border: none; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.30); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }


/* ── WORKSPACE VIEWS POSITIONING ─────────────────────────────────── */
/* Workspace views positioned in custom.css */

/* Board canvas should be visible by default, hidden when viewing other tabs */
.board-canvas {
  flex: 1;
  position: relative;
  /* overflow-x and touch properties already set above — do not re-declare */
  overflow: visible;  /* allow absolute children to show */
  z-index: 2;
}

.board-canvas.hidden {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   ── 21. MOBILE RESPONSIVENESS (comprehensive)
   Tested widths: 320px · 375px · 425px · 768px
   ══════════════════════════════════════════════════════════════════ */

/* ── Touch-friendly horizontal board scroll ─────────────────────── */
/* These augment the base .board-canvas rule — must NOT re-declare overflow */
.board-canvas {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

/* ── Board columns: min touch target, no text overflow on tiny screens */
.board-columns {
  /* already min-width: max-content — keep as-is but ensure gap doesn't collapse */
  gap: 12px;
  padding-bottom: 12px; /* room for horizontal scrollbar thumb */
}

/* ── Board header right zone: wrap gracefully ─────────────────────── */
.bh-right {
  flex-shrink: 0;
  flex-wrap: nowrap; /* prevent layout break — hide overflow items per breakpoint */
  overflow: hidden;
  max-width: calc(100% - 200px); /* never crowd the title area */
}

/* ── Invite panel: full-width + safe inset on mobile ─────────────── */
#board-invite-panel {
  /* desktop already fixed-right 16px */
}
@media (max-width: 640px) {
  #board-invite-panel {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    top: 60px !important;
  }
}

/* ── Boards popover: off-screen fix on mobile ─────────────────────── */
@media (max-width: 768px) {
  .boards-popover {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    top: 70px;
  }
}

/* ── 768 px — tablet ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Board header */
  .board-header { padding: 0 12px; gap: 6px; }
  .bh-stats     { display: none; }
  .bh-divider   { display: none; }
  .bsb          { padding: 0 12px; }
  .bsb-item     { padding: 0 8px; }

  /* Column width — comfortable one-finger swipe */
  .kol, .kol-new { width: 300px; min-width: 300px; }

  /* Board canvas — allow full touch scroll */
  .board-canvas { padding: 10px 8px 24px; }

  /* Card detail modal — single column */
  .cdm2-body           { grid-template-columns: 1fr; overflow-y: auto; }
  .cdm2-right-panel    { border-left: none; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; }
  [data-theme="light"] .cdm2-right-panel { border-top-color: var(--border); }
  .cdm2-box            { max-height: 94vh; border-radius: 14px 14px 0 0; margin: 0; align-self: flex-end; }
  .cdm2-overlay        { align-items: flex-end; }
  .cdm2-props-grid     { grid-template-columns: repeat(2, 1fr); }

  /* Card modal (legacy) */
  .cdm-layout          { grid-template-columns: 1fr; }
  .card-modal-box      { max-height: 94vh; border-radius: 14px 14px 0 0; }

  /* Member popover */
  .member-popover { width: 280px; }
}

/* ── 640 px — large phone ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Board header — tighter */
  .board-header         { height: 48px; min-height: 48px; padding: 0 10px; gap: 4px; }
  .bh-title             { max-width: 140px; font-size: 13px; }
  .bh-tool-btn          { display: none; }
  .bh-btn-invite span   { display: none; }      /* icon-only invite button */
  .bh-btn-invite        { width: 30px; padding: 0; justify-content: center; }
  .bh-sprint-pill span  { display: none; }
  .bh-sprint-pill       { padding: 4px 8px; }
  .bsb-val              { font-size: 12px; }
  .bsb-lbl              { font-size: 9px; }

  /* Columns */
  .kol, .kol-new        { width: 288px; min-width: 288px; }

  /* Add-card form — full width within column */
  .add-card-form        { border-radius: 8px; padding: 8px; }
  .add-card-trigger     { padding: 8px 10px; font-size: 13px; min-height: 40px; }

  /* Card items — slightly reduced padding for density */
  .card-item            { padding: 9px 10px; }
  .card-footer          { margin-top: 6px; }

  /* Card detail modal props: single column */
  .cdm2-props-grid      { grid-template-columns: 1fr 1fr; }
}

/* ── 480 px — phone ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Near-full-width columns for easy vertical scrolling */
  .kol, .kol-new        { width: 88vw; min-width: 88vw; }

  /* Board header: hide search */
  .bh-search-wrap       { display: none; }

  /* Stats bar: hide on tiny screens */
  .bsb                  { display: none; }

  /* Card detail props: stack */
  .cdm2-props-grid      { grid-template-columns: 1fr; }
  .cdm2-prop            { border-right: none !important; margin-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,0.07); padding-bottom: 8px; }
  [data-theme="light"] .cdm2-prop { border-bottom-color: var(--border-light); }

  /* Card detail overlay: slide up from bottom */
  .cdm2-overlay         { align-items: flex-end; padding: 0; }
  .cdm2-box             { max-height: 96vh; border-radius: 18px 18px 0 0; }

  /* Member popover — full width with margin */
  .member-popover       { width: calc(100vw - 24px); max-width: 320px; }
  .mam-box              { max-height: 88vh; width: calc(100vw - 24px); }

  /* Increase touch targets for all icon-only buttons */
  .kol-menu-btn         { width: 32px; height: 32px; }
  .card-menu-btn        { width: 28px; height: 28px; opacity: 1; }
  .bh-icon-btn,
  .bh-tool-btn          { width: 34px; height: 34px; }
}

/* ── 375 px — small phone ────────────────────────────────────────── */
@media (max-width: 375px) {
  .kol, .kol-new        { width: calc(100vw - 24px); min-width: calc(100vw - 24px); }
  .board-canvas         { padding: 8px 6px 20px; }
  .board-columns        { gap: 8px; }
  .bh-title             { max-width: 110px; font-size: 13px; }

  /* Card text tighter */
  .card-item            { padding: 8px 9px; margin-bottom: 6px; }
  .card-item .card-title{ font-size: 12px; }
}

/* ── Filter panel: full-width slide-down on mobile ───────────────── */
@media (max-width: 640px) {
  .filter-panel {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 0 0 12px 12px;
    border-left: none;
    border-right: none;
  }
}

/* ── Notification dropdown: prevent viewport overflow ────────────── */
@media (max-width: 480px) {
  .notif-dropdown {
    right: -8px;
    width: calc(100vw - 16px);
    max-width: 340px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   CARD DETAIL HEADER — ALIGNMENT FIX
   Ensures badge, title and toolbar chips are flush-left and
   consistently spaced on all screen sizes.
   ══════════════════════════════════════════════════════════════════ */

/* Header container: tighter top padding, consistent left edge */
.cdm2-header {
  padding: 12px 16px 0 16px;
}

/* Badge row: flush left, compact */
.cdm2-list-badge-wrap {
  margin-bottom: 8px;
  padding-left: 2px;
}
.cdm2-list-badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.70);
}
[data-theme="light"] .cdm2-list-badge {
  color: var(--text-secondary);
}

/* Title row: no extra gap from icon, left-aligned */
.cdm2-header-mid {
  display: flex;
  align-items: flex-start;
  gap: 0;                   /* icon is hidden so no gap needed */
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Hide the decorative circle icon — it misaligns the title */
.cdm2-title-icon {
  display: none;
}

/* Title textarea: full width, left-aligned text */
.cdm2-title-input {
  width: 100%;
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  padding: 4px 6px;
  text-align: left;
  /* Remove right padding that was adding visual shift */
  padding-right: 40px; /* room for close button */
}

/* Toolbar chip row: flush left, even gap, wrap neatly */
.cdm2-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 2px 12px 2px;
}

.cdm2-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* Ensure svg inside chip buttons are consistent size */
.cdm2-tb-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Close button: always top-right, never shifts layout */
.cdm2-close {
  position: absolute;
  top: 10px;
  right: 12px;
}

/* ── Mobile: tighter header on small screens ──────────────────── */
@media (max-width: 640px) {
  .cdm2-header {
    padding: 10px 12px 0 12px;
  }
  .cdm2-title-input {
    font-size: 15px;
    padding-right: 36px;
  }
  .cdm2-toolbar {
    gap: 5px;
    padding-bottom: 10px;
  }
  .cdm2-tb-btn {
    padding: 4px 9px;
    height: 26px;
    font-size: 11px;
  }
}

@media (max-width: 375px) {
  .cdm2-tb-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .cdm2-title-input {
    font-size: 14px;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   COMPREHENSIVE BOARD RESPONSIVENESS
   Mobile-First: Horizontal scroll, proper list/card sizing
   ═══════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────
   EXTRA SMALL (320px - 374px)
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 374px) {
  .board-header { padding: 0 12px; height: 48px; gap: 8px; }
  .bh-left { gap: 6px; }
  .bh-title { font-size: 14px; max-width: 120px; }
  .bh-star-btn { width: 24px; height: 24px; }
  .bh-separator { display: none; }
  .bh-ws-link { display: none; }
  
  .board-canvas { padding: 12px 14px 20px; }
  .kol { width: 280px; min-width: 280px; }
  
  .bh-right { gap: 2px; }
  .bh-icon-btn { width: 28px; height: 28px; }
  .bh-avatar { width: 24px; height: 24px; font-size: 9px; margin-left: -3px; }
  
  .bsb { padding: 0 14px; height: 32px; }
  .bsb-item { padding: 0 12px; font-size: 11px; }
  .bsb-sep { display: none; }
}

/* ──────────────────────────────────────────────────────────────────
   SMALL PHONES (375px - 479px)
   ────────────────────────────────────────────────────────────────── */
@media (min-width: 375px) and (max-width: 479px) {
  .board-header { padding: 0 14px; height: 50px; gap: 10px; }
  .bh-title { font-size: 15px; max-width: 140px; }
  .bh-left { gap: 8px; }
  .bh-separator { margin: 0 3px; }
  .bh-ws-anchor { font-size: 11px; }
  
  .board-canvas { padding: 14px 16px 22px; }
  .kol { width: 290px; min-width: 290px; }
  .kol-header { padding: 10px 10px 8px; }
  .kol-title { font-size: 12px; max-width: 140px; }
  .kol-count { font-size: 10px; }
  .kol-menu-btn { width: 22px; height: 22px; }
  
  .card-item { padding: 9px 10px; margin-bottom: 6px; }
  .card-title { font-size: 12px; }
  .card-footer { gap: 3px; }
  .card-chip { font-size: 10px; }
  
  .bh-avatar { width: 26px; height: 26px; font-size: 10px; margin-left: -4px; }
  .bh-icon-btn { width: 28px; height: 28px; }
  .bsb-item { padding: 0 14px; font-size: 11px; }
}

/* ──────────────────────────────────────────────────────────────────
   MEDIUM PHONES (480px - 639px)
   ────────────────────────────────────────────────────────────────── */
@media (min-width: 480px) and (max-width: 639px) {
  .board-header { padding: 0 16px; height: 52px; }
  .bh-title { font-size: 16px; max-width: 180px; }
  .bh-left { gap: 10px; }
  
  .board-canvas { padding: 16px 18px 24px; }
  .kol { width: 300px; min-width: 300px; }
  .kol-header { padding: 11px 11px 9px; }
  .kol-title { font-size: 13px; }
  
  .card-item { padding: 10px 11px; margin-bottom: 7px; }
  .card-title { font-size: 13px; }
  
  .bh-avatar { width: 28px; height: 28px; }
  .bsb-item { padding: 0 16px; font-size: 12px; }
}

/* ──────────────────────────────────────────────────────────────────
   TABLETS (640px - 767px)
   ────────────────────────────────────────────────────────────────── */
@media (min-width: 640px) and (max-width: 767px) {
  .board-header { padding: 0 18px; height: 52px; }
  .bh-title { font-size: 17px; max-width: 220px; }
  .bh-left { gap: 12px; }
  
  .board-canvas { padding: 18px 20px 28px; }
  .kol { width: 310px; min-width: 310px; }
  
  .card-item { padding: 11px 12px; margin-bottom: 8px; }
  .card-title { font-size: 13px; }
  
  .bh-avatar { width: 28px; height: 28px; }
  .bh-avatars { gap: 4px; }
  .bsb-item { padding: 0 18px; }
}

/* ──────────────────────────────────────────────────────────────────
   DESKTOP/LAPTOP (768px+) — KEEP ORIGINAL
   ────────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .board-header { padding: 0 20px; height: 52px; }
  .bh-title { font-size: 18px; max-width: 300px; }
  .bh-left { gap: 14px; }
  
  .board-canvas { padding: 16px 20px 24px; }
  .kol { width: 300px; min-width: 300px; }
  
  .card-item { padding: 10px 12px; margin-bottom: 7px; }
  
  .bh-avatar { width: 28px; height: 28px; }
  .bsb-item { padding: 0 20px; }
}

/* ──────────────────────────────────────────────────────────────────
   CARD DETAIL MODAL — RESPONSIVE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 374px) {
  .cdm2-box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }
  .cdm2-header { padding: 12px 14px 0; }
  .cdm2-title-input { font-size: 16px; }
  .cdm2-body { grid-template-columns: 1fr; }
  .cdm2-left { padding: 12px 14px; gap: 12px; }
  .cdm2-right-panel {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
}

@media (min-width: 375px) and (max-width: 479px) {
  .cdm2-box { max-width: 95%; max-height: 90vh; }
  .cdm2-left { padding: 14px 16px; gap: 14px; }
  .cdm2-title-input { font-size: 17px; }
}

@media (min-width: 480px) and (max-width: 639px) {
  .cdm2-box { max-width: 90%; max-height: 88vh; }
  .cdm2-left { padding: 16px 18px; gap: 14px; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .cdm2-box { max-width: 85%; max-height: 87vh; }
  .cdm2-left { padding: 16px 20px; }
  .cdm2-body { grid-template-columns: 1fr 200px; }
}

@media (min-width: 768px) {
  .cdm2-box { max-width: 780px; }
  .cdm2-left { padding: 16px 20px; }
  .cdm2-body { grid-template-columns: 1fr 220px; }
}

/* ──────────────────────────────────────────────────────────────────
   FILTER PANEL — RESPONSIVE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .fp-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 80vh;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  }
  .fp-inner { max-height: calc(80vh - 50px); }
  .fp-header { padding: 14px 16px 10px; }
}

@media (max-width: 374px) {
  .fp-panel { border-radius: 16px 16px 0 0; }
  .fp-title { font-size: 14px; }
}

/* ──────────────────────────────────────────────────────────────────
   BOARD HEADER — MOBILE STACKING
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .bh-center { display: none; } /* Hide member avatars on small phones */
  .bh-search-wrap { width: 100%; margin-left: auto; }
}

@media (max-width: 374px) {
  .bh-search-wrap { display: none; } /* Hide search entirely on tiny phones */
  .bh-center { display: none !important; }
}

/* ──────────────────────────────────────────────────────────────────
   CARDS ZONE SCROLLBAR — THINNER ON MOBILE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .cards-zone::-webkit-scrollbar { width: 2px; }
}

/* ──────────────────────────────────────────────────────────────────
   BOARD STATS BAR — COMPACT ON MOBILE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .bsb { gap: 0; padding: 0 12px; }
  .bsb-item { padding: 0 8px; font-size: 10px; }
  .bsb-lbl { font-size: 9px; }
  .bsb-val { font-size: 12px; }
  .bsb-sep { height: 10px; }
}

@media (max-width: 374px) {
  .bsb-item:nth-child(n+3) { display: none; } /* Show only first 2 stats on tiny phones */
}

/* ──────────────────────────────────────────────────────────────────
   LIST COLUMN — ENSURE READABLE WIDTH
   Keep 280px-310px width to prevent shrinking too small
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .kol { width: 280px; min-width: 280px; }
}

@media (min-width: 480px) and (max-width: 767px) {
  .kol { width: 290px; min-width: 290px; }
}

/* ──────────────────────────────────────────────────────────────────
   ADD CARD — RESPONSIVE BUTTON
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .add-card-trigger { font-size: 12px; padding: 6px 9px; }
  .add-card-trigger svg { width: 14px; height: 14px; }
}

/* ──────────────────────────────────────────────────────────────────
   ADD LIST BUTTON
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .add-list-col-trigger { width: 280px; min-width: 280px; }
  .add-list-btn { font-size: 12px; }
}

@media (min-width: 480px) and (max-width: 767px) {
  .add-list-col-trigger { width: 290px; min-width: 290px; }
}

/* ──────────────────────────────────────────────────────────────────
   NO UNWANTED HORIZONTAL OVERFLOW
   Ensure board scrolls horizontally without page-level scroll
   ────────────────────────────────────────────────────────────────── */
.board-page {
  overflow-x: hidden; /* Prevents page-level scroll */
  width: 100%;
}

.board-canvas {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth iOS scroll */
}

/* Ensure no content overflows the viewport */
body { overflow-x: hidden; }

/* ──────────────────────────────────────────────────────────────────
   MODAL RESPONSIVE — STACKS ON MOBILE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cdm2-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .cdm2-box {
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 92vh;
  }
  .cdm2-body { grid-template-columns: 1fr; }
  .cdm2-right-panel { border-left: none; border-top: 1px solid rgba(255,255,255,0.08); }
}

/* ──────────────────────────────────────────────────────────────────
   COMMENT & ACTIVITY SECTION — MOBILE OPTIMIZED
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cdm2-right-panel { max-height: none; }
  .cdm2-activity-feed { padding: 8px 12px; }
  .cdm2-cmt-item { gap: 8px; }
  .cdm2-cmt-av { width: 24px; height: 24px; font-size: 9px; }
  .cdm2-cmt-text { font-size: 12px; }
}

/* ──────────────────────────────────────────────────────────────────
   DESCRIPTION TEXTAREA — MOBILE FRIENDLY
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .cdm2-desc-ta {
    font-size: 14px; /* Prevent zoom on iOS */
    min-height: 100px;
  }
}

/* ──────────────────────────────────────────────────────────────────
   NO CONTENT CLIPPING — CRITICAL FIX
   Ensure modals, popovers, and dropdowns don't get cut off
   ────────────────────────────────────────────────────────────────── */
.modal-overlay, .cdm2-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
}

.boards-popover {
  position: fixed !important;
  z-index: 500 !important;
}

/* Ensure board background doesn't cause cutoff */
.board-page { position: relative; }

/* ──────────────────────────────────────────────────────────────────
   TOUCH IMPROVEMENTS — BIGGER TARGETS
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .card-item { min-height: 60px; } /* Bigger touch target */
  .kol-menu-btn { width: 28px; height: 28px; } /* Bigger touch target */
  .card-menu-btn { width: 28px; height: 28px; } /* Bigger touch target */
  
  input, textarea, select { min-height: 44px; font-size: 16px; } /* iOS zoom prevention */
}
