/* CTB Realty — Kanban Page Apple Style */
/* Inherits design tokens from tokens.css */

/* ── Board Layout ── */
.board {
  display: flex;
  gap: 12px;
  padding: 14px 20px 40px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
  min-height: calc(100vh - 48px);
}

.column {
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 280px;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: var(--r12);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t), background 0.3s var(--ease);
}
.column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}

/* ── Column Header ── */
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px 8px;
}
.col-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.col-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.col-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text2);
}
.col-count-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 1px 7px;
  border-radius: var(--r99);
}
.col-head-actions { display: flex; align-items: center; }
.col-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  width: 24px;
  height: 24px;
  border-radius: var(--r6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
}
.col-btn:hover { background: var(--surface); color: var(--text); }
.col-btn svg { width: 13px; height: 13px; }

/* ── Column Body ── */
.col-cards {
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}
.col-add-new {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 10px;
  padding: 7px;
  border-radius: var(--r8);
  border: 1.5px dashed var(--border);
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.col-add-new:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.col-add-new svg { width: 12px; height: 12px; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r10);
  padding: 11px 11px 9px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t), background 0.3s var(--ease);
  animation: cardIn 0.18s ease both;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.card.dragging {
  opacity: 0.45;
  transform: rotate(1.5deg) scale(1.02);
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
}
.card.filtered-out { display: none; }

.card-tags-top {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.ctag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r4);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
}
.ctag-high { color: #ef4444; background: #fee2e2; border-color: #fecaca; }
.ctag-medium { color: #d97706; background: #fef3c7; border-color: #fde68a; }
.ctag-low { color: #059669; background: #d1fae5; border-color: #a7f3d0; }
[data-theme="dark"] .ctag-high { color: #f87171; background: #451a1a; border-color: #7f1d1d; }
[data-theme="dark"] .ctag-medium { color: #fbbf24; background: #452a09; border-color: #78350f; }
[data-theme="dark"] .ctag-low { color: #34d399; background: #064e3b; border-color: #065f46; }

.ctag-id {
  font-family: monospace;
  font-weight: 700;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text3);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.1px;
}

.card-desc-preview {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-progress {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}
.prog-bar-bg {
  height: 4px;
  background: var(--bg);
  border-radius: var(--r99);
  overflow: hidden;
}
.prog-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r99);
}
.prog-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.card-avatars {
  display: flex;
  align-items: center;
}
.c-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid var(--card);
  margin-left: -6px;
}
.c-av:first-child { margin-left: 0; }

.card-due-sm {
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-due-sm svg { width: 10px; height: 10px; }
.card-due-sm.overdue { color: #ef4444; font-weight: 600; }

.card-counts {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-count {
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 2px;
}
.card-count svg { width: 10px; height: 10px; }

.drop-placeholder {
  height: 50px; border: 2px dashed var(--accent);
  border-radius: var(--r8); background: var(--accent-light);
  opacity: 0.6; animation: blink 0.9s ease infinite alternate;
}
@keyframes blink { from { opacity: 0.35; } to { opacity: 0.65; } }

/* ── Panel Adjustments for Kanban ── */
/* Inherits right-panel from app.css/crm.css, just add specifics if needed */
.rp-fields {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r10);
  overflow: hidden; background: var(--surface);
}
.rp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.rp-row:last-child { border-bottom: none; }
.rp-label { font-size: 12px; font-weight: 600; color: var(--text2); width: 90px; flex-shrink: 0; }
.req { color: #ef4444; margin-left: 3px; font-weight: bold; font-size: 14px; }
.rp-input, .rp-select {
  flex: 1; border: none; outline: none; font-family: inherit;
  font-size: 13px; color: var(--text); background: none; cursor: pointer;
}
.rp-desc {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r8);
  padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--bg); resize: vertical; outline: none; line-height: 1.5;
  transition: border-color var(--t), background 0.3s var(--ease);
  min-height: 80px;
}
.rp-desc:focus { border-color: var(--accent); }
.rp-row-progress { display: flex; align-items: center; }
.rp-progress-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.rp-range { flex: 1; cursor: pointer; accent-color: var(--accent); }
.rp-pct { font-size: 12px; font-weight: 600; color: var(--text2); width: 30px; text-align: right; }

@media (max-width: 900px) {
  .board { gap: 8px; padding: 10px 14px 30px; }
  .column { min-width: 250px; max-width: 250px; }
}
@media (max-width: 768px) {
  .right-panel { width: 100vw; }
  .board { gap: 6px; padding: 8px 10px 20px; }
  .column { min-width: 280px; max-width: 280px; }
}
