/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cobalt: #2563eb;
  --cobalt-hover: #1d4ed8;
  --cobalt-soft: rgba(37, 99, 235, 0.1);
  --cobalt-glow: rgba(37, 99, 235, 0.3);
  --red: #ef4444;
  --red-hover: #dc2626;
  --red-soft: rgba(239, 68, 68, 0.1);
  --green: #10b981;
  --amber: #f59e0b;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 66px;
}

body[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-2: #ffffff;
  --bg-3: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #94a3b8;
  --text-dim: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px -15px rgba(15, 23, 42, 0.2);
  --drag-highlight: rgba(37, 99, 235, 0.06);
}

body[data-theme="dark"] {
  --bg: #0b0d11;
  --bg-2: #111419;
  --bg-3: #161a20;
  --surface: #151a20;
  --surface-2: #1a1f26;
  --surface-3: #20262e;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-soft: #a8b2be;
  --text-muted: #6b7684;
  --text-dim: #444d59;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
  --drag-highlight: rgba(37, 99, 235, 0.15);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}
input:focus,
select:focus,
textarea:focus { outline: none; }

::selection { background: var(--cobalt); color: white; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================================
   APP SHELL
============================================ */
.app { display: flex; min-height: 100vh; }

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.3s var(--ease), transform 0.3s var(--ease);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: var(--topbar-h);
  gap: 0.5rem;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 1.1rem 0.5rem;
}
.sidebar.collapsed .logo { display: none; }
.sidebar.collapsed .sidebar-toggle {
  width: 32px;
  height: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cobalt);
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cobalt), #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -3px var(--cobalt-glow);
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-toggle {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.sidebar-toggle:hover { background: var(--surface-2); color: var(--text); }
.sidebar-toggle svg { transition: transform 0.3s var(--ease); }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-section {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  white-space: nowrap;
}
.workspace-switcher:hover { background: var(--surface-2); }

.workspace-avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.workspace-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.workspace-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
}
.workspace-plan {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.sidebar.collapsed .workspace-info { display: none; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.75rem 0.5rem;
  white-space: nowrap;
}

.sidebar.collapsed .nav-group-label {
  opacity: 0;
  height: 0.4rem;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}
.nav-item.active svg { opacity: 1; }

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

.nav-badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.nav-item.active .nav-badge {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.sidebar.collapsed .nav-item span:not(.nav-dot):not(.nav-badge) {
  opacity: 0;
  pointer-events: none;
}
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-dot { width: 10px; height: 10px; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.theme-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  justify-content: center;
}

.theme-btn {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.theme-btn:hover { color: var(--text); }
.theme-btn.active {
  background: var(--surface);
  color: var(--cobalt);
  box-shadow: var(--shadow-sm);
}

.sidebar.collapsed .theme-switch { flex-direction: column; }
.sidebar.collapsed .theme-btn { height: 26px; }

/* ============================================
   MAIN
============================================ */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s var(--ease);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-w-collapsed); }

/* ============================================
   TOPBAR
============================================ */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  z-index: 40;
  flex-shrink: 0;
}
body[data-theme="dark"] .topbar {
  background: rgba(11, 13, 17, 0.85);
}

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

.sidebar-toggle-mobile {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
}
.sidebar-toggle-mobile:hover {
  background: var(--surface-2);
  color: var(--text);
}

.board-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.board-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.board-icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.page-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 100%;
  max-width: 380px;
  transition: all 0.2s var(--ease);
}
.search:focus-within {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
  background: var(--surface);
}

.search svg { color: var(--text-muted); flex-shrink: 0; }

.search input {
  flex: 1;
  font-size: 0.85rem;
  background: transparent;
  border: none;
  min-width: 0;
}
.search input::placeholder { color: var(--text-muted); }

.search kbd {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

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

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  border: 2px solid var(--bg-2);
  margin-left: -8px;
  flex-shrink: 0;
}
.avatar:first-child { margin-left: 0; }

.avatar-more {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 0.62rem;
}

/* ============================================
   BUTTONS
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--cobalt);
  color: white;
  box-shadow: 0 4px 12px -3px var(--cobalt-glow);
}
.btn-primary:hover {
  background: var(--cobalt-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -3px var(--cobalt-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.btn-danger {
  background: var(--red);
  color: white;
  box-shadow: 0 4px 12px -3px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

/* ============================================
   BOARD
============================================ */
.board-wrap {
  flex: 1;
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  min-height: 0;
}

.board {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-height: 100%;
}

/* Column */
.column {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 3rem);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.column.drag-over {
  background: var(--drag-highlight);
  box-shadow: 0 0 0 2px var(--cobalt) inset;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 0.9rem 0.7rem;
  flex-shrink: 0;
}

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

.column-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  outline: none;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  transition: background 0.15s var(--ease);
  cursor: text;
  min-width: 40px;
  flex: 1;
}
.column-name:hover { background: var(--surface-3); }
.column-name:focus {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--cobalt);
}

.column-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--surface-3);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.column-menu-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.column-menu-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Column body */
.column-body {
  padding: 0 0.5rem 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card */
.card {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.8rem;
  cursor: grab;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  animation: cardIn 0.3s var(--ease);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.card:active { cursor: grabbing; }

.card.dragging {
  opacity: 0.4;
  transform: rotate(3deg);
  cursor: grabbing;
}

.card.filtered-out {
  display: none;
}

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.card-labels:empty { display: none; }

.card-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: white;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  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: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-priority {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
}

.card-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.card-due {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.card-due.overdue {
  color: var(--red);
  font-weight: 600;
}

.card-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: auto;
}

.card-actions {
  display: flex;
  gap: 0.15rem;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  background: var(--surface);
  border-radius: 6px;
  padding: 2px;
  box-shadow: var(--shadow-sm);
}

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

.card-action {
  width: 24px; height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}
.card-action:hover {
  background: var(--surface-2);
  color: var(--text);
}
.card-action.delete:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* Empty state per column */
.column-empty {
  padding: 1.2rem 0.8rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}

/* Add card button in column */
.add-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin: 0.2rem 0.5rem 0.5rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  text-align: left;
}
.add-card-btn:hover {
  background: var(--surface-3);
  color: var(--cobalt);
}

/* Add column button */
.add-column-btn {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: transparent;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s var(--ease);
  height: fit-content;
}
.add-column-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: var(--cobalt-soft);
}

/* ============================================
   MODAL
============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}

.field-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.field input[type="text"],
.field input[type="date"],
.field textarea,
.field select {
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--text);
  transition: all 0.2s var(--ease);
  width: 100%;
  resize: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--cobalt);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }

.field select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2rem;
}

/* Priority picker */
.priority-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.priority-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.2s var(--ease);
}
.priority-btn:hover {
  border-color: var(--border);
  color: var(--text);
}
.priority-btn.active {
  background: var(--cobalt-soft);
  border-color: var(--cobalt);
  color: var(--cobalt);
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Labels picker */
.labels-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.label-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
  color: var(--text-soft);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.label-btn:hover { color: var(--text); }

.label-btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.label-btn.active {
  color: white;
  border-color: transparent;
}

.modal-footer {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Confirm modal */
.modal-confirm {
  max-width: 380px;
  text-align: center;
}

.confirm-icon {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.confirm-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0.4rem 0 1.5rem;
}

.modal-confirm .modal-footer { justify-content: center; }

/* ============================================
   TOAST
============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg-2);
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform 0.4s var(--ease);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.toast-undo {
  background: rgba(255, 255, 255, 0.15);
  color: var(--bg-2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.3rem;
  transition: background 0.2s var(--ease);
}
.toast-undo:hover { background: rgba(255, 255, 255, 0.25); }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
  }
  .main { margin-left: 0 !important; }
  .sidebar.collapsed { width: var(--sidebar-w); }
  .sidebar.collapsed .nav-item span:not(.nav-dot):not(.nav-badge),
  .sidebar.collapsed .nav-group-label,
  .sidebar.collapsed .workspace-info {
    opacity: 1;
    height: auto;
    padding: 0 0.75rem 0.5rem;
  }
  .sidebar.collapsed .nav-badge { display: inline-block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; }
  .sidebar-toggle-mobile { display: flex; }
  .sidebar-toggle { display: none; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 1rem; }
  .topbar-center { display: none; }
  .board-wrap { padding: 1rem; }
}

@media (max-width: 700px) {
  .btn-primary span { display: none; }
  .avatar-stack { display: none; }
  .column { width: 260px; }
  .add-column-btn { width: 260px; }
  .field-row { grid-template-columns: 1fr; }
}