/* ═══════════════════════════════════════════════════════
   Flowboard — Premium Project Management UI
   Tone: Luxury/refined meets industrial utility
   Fonts: Bricolage Grotesque (UI) + Outfit (body/cards)
   Theming: Full light/dark via CSS custom properties
═══════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Light theme (default) */
  --bg-app:          #F0EDE8;
  --bg-board:        #E8E4DE;
  --bg-column:       #FAFAF8;
  --bg-card:         #FFFFFF;
  --bg-card-hover:   #FDFCFB;
  --bg-topbar:       rgba(250, 250, 248, 0.88);
  --bg-modal:        #FFFFFF;
  --bg-overlay:      rgba(28, 31, 38, 0.45);
  --bg-input:        #F5F3EF;
  --bg-input-focus:  #FFFFFF;
  --bg-badge:        #F0EDE8;

  --text-primary:    #1C1F26;
  --text-secondary:  #5A5F6E;
  --text-muted:      #9299A8;
  --text-inverse:    #FFFFFF;

  --accent:          #4F46E5;
  --accent-hover:    #4338CA;
  --accent-dim:      rgba(79, 70, 229, 0.1);
  --accent-glow:     rgba(79, 70, 229, 0.2);

  --border:          rgba(28, 31, 38, 0.08);
  --border-strong:   rgba(28, 31, 38, 0.14);
  --border-focus:    var(--accent);

  --shadow-sm:       0 1px 3px rgba(28,31,38,0.06), 0 1px 2px rgba(28,31,38,0.04);
  --shadow-md:       0 4px 12px rgba(28,31,38,0.08), 0 2px 4px rgba(28,31,38,0.04);
  --shadow-lg:       0 12px 40px rgba(28,31,38,0.12), 0 4px 12px rgba(28,31,38,0.06);
  --shadow-drag:     0 20px 60px rgba(28,31,38,0.22), 0 8px 20px rgba(28,31,38,0.12);

  /* Priority colors */
  --priority-high:        #EF4444;
  --priority-high-bg:     rgba(239, 68, 68, 0.1);
  --priority-high-border: rgba(239, 68, 68, 0.25);
  --priority-medium:      #F59E0B;
  --priority-medium-bg:   rgba(245, 158, 11, 0.1);
  --priority-medium-border: rgba(245, 158, 11, 0.25);
  --priority-low:         #10B981;
  --priority-low-bg:      rgba(16, 185, 129, 0.1);
  --priority-low-border:  rgba(16, 185, 129, 0.25);

  /* Column accent colors */
  --col-todo:       #6366F1;
  --col-inprogress: #F59E0B;
  --col-done:       #10B981;

  /* Dot pattern for columns */
  --dot-pattern: radial-gradient(circle, rgba(28,31,38,0.06) 1px, transparent 1px);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg-app:          #0F1117;
  --bg-board:        #0B0D12;
  --bg-column:       #161920;
  --bg-card:         #1E2130;
  --bg-card-hover:   #232638;
  --bg-topbar:       rgba(22, 25, 32, 0.92);
  --bg-modal:        #1E2130;
  --bg-overlay:      rgba(0, 0, 0, 0.65);
  --bg-input:        rgba(255,255,255,0.05);
  --bg-input-focus:  rgba(255,255,255,0.08);
  --bg-badge:        rgba(255,255,255,0.06);

  --text-primary:    #E8E6E1;
  --text-secondary:  #9299A8;
  --text-muted:      #5A5F6E;
  --text-inverse:    #0F1117;

  --accent:          #6366F1;
  --accent-hover:    #818CF8;
  --accent-dim:      rgba(99, 102, 241, 0.15);
  --accent-glow:     rgba(99, 102, 241, 0.25);

  --border:          rgba(255, 255, 255, 0.06);
  --border-strong:   rgba(255, 255, 255, 0.1);

  --shadow-sm:       0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:       0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg:       0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-drag:     0 20px 60px rgba(0,0,0,0.6), 0 8px 20px rgba(0,0,0,0.4);

  --dot-pattern: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  height: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
[contenteditable]:focus { outline: none; }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 64px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  font-size: 18px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.brand-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  transition: var(--transition);
  cursor: text;
  white-space: nowrap;
}

.brand-name:hover { background: var(--accent-dim); }
.brand-name:focus { background: var(--accent-dim); box-shadow: 0 0 0 2px var(--accent); }

.board-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.board-tag {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.board-dot { opacity: 0.4; }

.topbar-center { display: flex; justify-content: center; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 8px 40px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-badge);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.avatar-stack {
  display: flex;
  flex-direction: row-reverse;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--bg-topbar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: white;
  margin-left: -8px;
  cursor: default;
  transition: var(--transition);
  position: relative;
}

.avatar:hover { transform: translateY(-3px); z-index: 1; }
.av-1 { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.av-2 { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.av-3 { background: linear-gradient(135deg, #10B981, #3B82F6); }
.av-4 { background: linear-gradient(135deg, #EC4899, #8B5CF6); }

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon { position: absolute; transition: var(--transition); }
.theme-icon-dark { opacity: 0; transform: rotate(-90deg) scale(0.5); }

[data-theme="dark"] .theme-icon-light { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="dark"] .theme-icon-dark  { opacity: 1; transform: rotate(0) scale(1); }

/* ── Board Layout ── */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
  min-height: calc(100vh - 64px);
  align-items: start;
  background: var(--bg-board);
}

/* ── Column ── */
.column {
  background: var(--bg-column);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
  min-height: 200px;
}

.column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim), inset 0 0 20px var(--accent-dim);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.column-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-todo       { background: var(--col-todo); box-shadow: 0 0 8px rgba(99,102,241,0.5); }
.dot-inprogress { background: var(--col-inprogress); box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.dot-done       { background: var(--col-done); box-shadow: 0 0 8px rgba(16,185,129,0.5); }

.column-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.badge {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-badge);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  min-width: 24px;
  text-align: center;
  transition: var(--transition);
}

.col-menu-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.col-menu-btn:hover {
  background: var(--bg-badge);
  color: var(--text-primary);
}

/* ── Column Body (cards container) ── */
.column-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  background-image: var(--dot-pattern);
  background-size: 20px 20px;
  transition: background 0.3s ease;
  flex: 1;
}

.column-body.drag-active {
  background-color: var(--accent-dim);
}

/* Drop placeholder */
.drop-placeholder {
  height: 80px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
  opacity: 0.6;
  pointer-events: none;
  animation: placeholderPulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes placeholderPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.7; }
}

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  cursor: grab;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
  animation: cardEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.card:active { cursor: grabbing; }

/* Priority left border */
.card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  transition: var(--transition);
}

.card[data-priority="high"]::before   { background: var(--priority-high); }
.card[data-priority="medium"]::before { background: var(--priority-medium); }
.card[data-priority="low"]::before    { background: var(--priority-low); }

/* Dragging state */
.card.dragging {
  opacity: 0.3;
  transform: scale(0.97);
  box-shadow: none;
  pointer-events: none;
}

/* Done column — subtle strikethrough effect */
#cards-done .card { opacity: 0.85; }
#cards-done .card-title { text-decoration: line-through; text-decoration-color: var(--text-muted); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.card-priority-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.priority-high {
  color: var(--priority-high);
  background: var(--priority-high-bg);
  border-color: var(--priority-high-border);
}

.priority-medium {
  color: var(--priority-medium);
  background: var(--priority-medium-bg);
  border-color: var(--priority-medium-border);
}

.priority-low {
  color: var(--priority-low);
  background: var(--priority-low-bg);
  border-color: var(--priority-low-border);
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-due {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.card-due.overdue { color: var(--priority-high); }
.card-due.due-soon { color: var(--priority-medium); }

.card-due-icon { font-size: 10px; }

.card-assignee {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  color: white;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Bricolage Grotesque', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.card:hover .card-actions { opacity: 1; }

.card-action-btn {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-badge);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.card-action-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.card-action-btn.delete-btn:hover {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}

/* Hidden by search */
.card.hidden-search {
  display: none;
}

/* ── Add Card Area ── */
.add-card-wrap {
  padding: 8px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.add-card-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  text-align: left;
}

.add-card-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.add-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}

/* Slide-down form */
.add-card-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              margin-top 0.25s ease;
  margin-top: 0;
}

.add-card-form.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 10px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  resize: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-date { color: var(--text-secondary); }

.form-actions {
  display: flex;
  gap: 8px;
}

/* ── Buttons ── */
.btn-primary {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Bricolage Grotesque', sans-serif;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  padding: 8px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-ghost:hover {
  background: var(--bg-badge);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  padding: 8px 16px;
  background: var(--priority-high-bg);
  color: var(--priority-high);
  border: 1px solid var(--priority-high-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Bricolage Grotesque', sans-serif;
  transition: var(--transition);
}

.btn-danger:hover {
  background: var(--priority-high);
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* ── Drag Ghost ── */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 280px;
  opacity: 0;
  transform: rotate(3deg) scale(1.04);
  box-shadow: var(--shadow-drag);
  border-radius: var(--radius-lg);
  transition: opacity 0.1s ease;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 14px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.drag-ghost.visible { opacity: 0.95; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease both;
}

.modal-overlay[hidden] { display: none; }

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

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  overflow: hidden;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-col-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--priority-high-bg);
  border-color: var(--priority-high-border);
  color: var(--priority-high);
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.modal-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-input,
.modal-select,
.modal-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  resize: none;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.modal-footer-right {
  display: flex;
  gap: 8px;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 280px;
}

.toast.toast-out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

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

.toast-icon { font-size: 15px; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  gap: 8px;
  pointer-events: none;
}

.empty-icon {
  font-size: 28px;
  opacity: 0.4;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .topbar-center {
    grid-column: 1 / -1;
    order: 3;
  }

  .search-wrap { width: 100%; }

  .board-meta { display: none; }

  .board {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .column { min-height: auto; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 16px; }
  .avatar-stack { display: none; }
  .board { padding: 12px; gap: 12px; }
  .modal { border-radius: var(--radius-lg); }
  .modal-row { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; align-items: stretch; }
  .modal-footer-right { justify-content: flex-end; }
  .form-row { grid-template-columns: 1fr; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}

/* Mobile swipeable columns hint */
@media (max-width: 900px) {
  .board {
    overflow-x: auto;
    grid-template-columns: repeat(3, min(85vw, 340px));
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
  }

  .column {
    scroll-snap-align: start;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: 1fr;
    overflow-x: visible;
    scroll-snap-type: none;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Select option dark mode fix ── */
select option {
  background: var(--bg-modal);
  color: var(--text-primary);
}