:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #ea580c; /* HubSpot-ish orange */
  --accent-dark: #1e293b;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--accent-dark); color: #fff;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; opacity: 0.85; }
.topbar a.logout { color: #fff; opacity: 0.7; text-decoration: none; font-size: 12px; }
.topbar a.logout:hover { opacity: 1; }

/* ---- toolbar ---- */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.toolbar .group { display: flex; align-items: center; gap: 6px; }
.toolbar label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button.active { background: var(--accent); color: #fff; }
select, input[type=text], input[type=search], input[type=date] {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--text);
}
input[type=search] { min-width: 220px; }
.btn {
  border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  background: var(--accent); color: #fff;
}
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn:hover { filter: brightness(1.05); }
.spacer { flex: 1; }
.chip-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-toggle {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.chip-toggle.on { color: #fff; border-color: transparent; }

/* ---- board ---- */
.board { display: flex; gap: 14px; padding: 18px 20px; overflow-x: auto; align-items: flex-start; height: calc(100vh - 112px); }
.column {
  background: #eef2f7; border-radius: 12px; min-width: 290px; max-width: 290px;
  display: flex; flex-direction: column; max-height: 100%;
}
.column.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.column-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px;
  font-weight: 700; font-size: 13px;
}
.column-head .count { color: var(--muted); font-weight: 600; background: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.column-head .swatch { width: 10px; height: 10px; border-radius: 3px; }
.column-body { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--surface); border-radius: 10px; padding: 12px; box-shadow: var(--shadow);
  cursor: pointer; border: 1px solid transparent;
}
.card:hover { border-color: var(--border); }
.card.dragging { opacity: 0.5; }
.card .title { font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.tag { color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-dark); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.due { font-size: 12px; }
.due.overdue { color: #dc2626; font-weight: 600; }
.due.due-today { color: #d97706; font-weight: 600; }
.pri-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.notes-preview { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 480px; max-width: 92vw; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px; min-height: 80px; font: inherit; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.status-banner { padding: 8px 20px; font-size: 13px; background: #fef3c7; color: #92400e; display: none; }
.status-banner.show { display: block; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
