/* ===========================
   COMPONENTS
   =========================== */

/* === BUTTONS === */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}
/* --- Board Cards --- */
.board-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.board-card:hover {
  border-color: var(--accent);
  background: var(--glass-bg-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.board-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent-gradient);
  opacity: 0.8;
}

/* --- Tasklist Columns --- */
.tasklist-column {
  background: rgba(22, 22, 40, 0.4);
  border-radius: var(--radius-lg);
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--divider);
}

.tasklist-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

/* --- Tasks --- */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  cursor: grab;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.task-card:hover {
  border-color: var(--accent-light);
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.task-priority-indicator {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  position: absolute;
  left: 0;
  top: 14px;
}

/* --- Modals --- */
.modal {
  background: var(--bg-modal);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.btn-secondary {
  background: var(--bg-tag);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255,92,122,0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(45,216,130,0.2);
}
.btn-success:hover {
  background: var(--success);
  color: #fff;
}
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: 40px;
  min-height: 40px;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition-slow);
  z-index: 10;
}
.sidebar-header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #c47aff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}
.sidebar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.2;
}
.sidebar-subtitle {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}
.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  padding: 10px 8px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--accent-soft);
  color: #fff;
  border: 1px solid rgba(124,106,247,0.2);
}
.sidebar-link .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-member-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.sidebar-member-mini .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.65rem;
}

/* === TOP BAR === */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-title {
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
}
.topbar-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* === AVATAR === */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
  color: #fff;
  text-transform: uppercase;
  border: 2px solid var(--bg-card);
  transition: transform var(--transition);
}
.avatar:hover { transform: scale(1.1); }
.avatar-stack { display: flex; flex-direction: row-reverse; }
.avatar-stack .avatar { margin-right: -8px; }
.avatar-stack .avatar:last-child { margin-right: 0; }

/* === BOARD GRID === */
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 24px;
}
.board-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: boardCardIn 0.35s ease forwards;
}
.board-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--board-color, var(--accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.board-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.board-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--board-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.board-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.board-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.board-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-card-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.board-stat svg { color: var(--text-muted); }
.board-card-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.board-card:hover .board-card-actions { opacity: 1; }
.board-add-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.board-add-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.board-add-card svg { transition: transform var(--transition); }
.board-add-card:hover svg { transform: scale(1.2); }

/* === TASKLIST === */
.tasklist-wrapper {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px 24px;
  gap: 16px;
  align-items: flex-start;
}
.tasklist-column {
  width: 280px;
  min-width: 280px;
  background: var(--bg-column);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  transition: all var(--transition);
  animation: fadeIn 0.3s ease forwards;
  cursor: default;
}
.tasklist-column.dragging {
  opacity: 0.5;
  border: 1.5px dashed var(--accent);
  transform: scale(0.98);
}
.column-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
}
.column-drag-handle:active { cursor: grabbing; }
.column-drag-handle:hover { background: var(--bg-tag); color: var(--text-primary); }
 .tasklist-column.drag-over {
  border-color: var(--accent);
  background: rgba(124,106,247,0.05);
}
.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.column-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.column-title {
  font-weight: 600;
  font-size: 0.875rem;
  flex: 1;
  cursor: text;
}
.column-title[contenteditable="true"] {
  border-bottom: 1px dashed var(--accent);
  outline: none;
}
.column-count {
  font-size: 0.72rem;
  background: var(--bg-tag);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.column-menu-btn {
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.tasklist-column:hover .column-menu-btn { opacity: 1; }
.column-menu-btn:hover { background: var(--bg-tag); color: var(--text-primary); }

.column-cards {
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.column-add-btn {
  margin: 8px 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.column-add-btn:hover {
  background: var(--accent-gradient);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.column-add-btn svg {
  width: 14px;
  height: 14px;
}

/* --- Mobile: Horizontal snap-scroll for columns --- */
@media (max-width: 640px) {
  .tasklist-wrapper {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Extra bottom padding so bottom GhostNav bar doesn't cover content */
    padding-bottom: 100px;
  }
  .tasklist-column {
    /* 82vw lets user see edge of next column => navigation hint */
    min-width: 82vw !important;
    width: 82vw !important;
    scroll-snap-align: start;
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
  }
  /* Larger drag handle on mobile for easier touch */
  .column-drag-handle {
    padding: 8px 6px;
    min-width: 32px;
    min-height: 32px;
    touch-action: none;
  }
}
.add-column-btn {
  width: 280px;
  min-width: 280px;
  background: var(--bg-column);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  align-self: flex-start;
  height: 56px;
}
.add-column-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Quick add input inside column */
.quick-add-wrap {
  padding: 4px 10px 10px;
  flex-shrink: 0;
}
.quick-add-wrap textarea {
  resize: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
  min-height: 64px;
}
.quick-add-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* === TASK CARD === */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
  user-select: none;
  animation: fadeIn 0.2s ease forwards;
}
.task-card:active { cursor: grabbing; }
.task-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(124,106,247,0.3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.task-card-priority {
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.task-card-body { padding-left: 8px; }
.task-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.label-chip {
  height: 6px;
  width: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--transition);
}
.label-chip:hover { transform: scaleY(1.8); }
.task-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
}
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.task-meta-item.overdue { color: var(--danger); }
.task-card-actions {
  opacity: 0;
  display: flex;
  gap: 2px;
  transition: opacity var(--transition);
}
.task-card:hover .task-card-actions { opacity: 1; }
.task-action-btn {
  padding: 3px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--transition);
  line-height: 1;
}
.task-action-btn:hover { background: var(--bg-tag); color: var(--text-primary); }

/* Checklist progress bar */
.checklist-bar {
  height: 3px;
  background: var(--bg-tag);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}
.checklist-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Expandable Checklist on Card */
.task-checklist-expand {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideDown 0.2s ease-out;
}
.card-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.card-check-item input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.card-check-item-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.expand-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all var(--transition);
}
.expand-toggle-btn:hover {
  background: var(--bg-tag);
  color: var(--accent);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === MODAL === */
.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInScale 0.25s ease forwards;
}
.modal-lg { max-width: 820px; }
.modal-sm { max-width: 420px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--divider);
}

/* === FORM === */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); }

/* === TAGS/CHIPS === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-tag);
  color: var(--text-secondary);
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger  { background: var(--danger-soft);  color: var(--danger); }

/* === PRIORITY BADGE === */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}
.priority-critical { background: var(--danger-soft);  color: var(--danger); }
.priority-high     { background: var(--warning-soft); color: var(--warning); }
.priority-medium   { background: var(--accent-soft);  color: var(--accent); }
.priority-low      { background: var(--success-soft); color: var(--success); }

/* === TASK DETAIL MODAL === */
.task-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.task-detail-title-input {
  font-size: 1.1rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  flex: 1;
  color: var(--text-primary);
}
.task-detail-title-input:focus {
  background: var(--bg-input);
  border-color: var(--border-focus);
}
.task-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.task-detail-sidebar { display: flex; flex-direction: column; gap: 16px; }
.task-sidebar-section { display: flex; flex-direction: column; gap: 8px; }
.task-sidebar-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Checklist items */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}
.checklist-item-text {
  flex: 1;
  font-size: 0.875rem;
  cursor: text;
}
.checklist-item-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.checklist-item .del-check-btn {
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--danger);
  padding: 2px;
}
.checklist-item:hover .del-check-btn { opacity: 1; }

/* === NOTES === */
.notes-container {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeIn 0.25s ease forwards;
}
.note-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.note-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.note-card-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
.note-timestamp { font-size: 0.7rem; color: var(--text-muted); }
.note-add-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  min-height: 90px;
  transition: all var(--transition);
}
.note-add-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Note editor in modal */
.note-editor {
  width: 100%;
  min-height: 220px;
  font-size: 0.9rem;
  line-height: 1.7;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  resize: vertical;
}
.note-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* === MEMBERS === */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px;
}
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  animation: fadeIn 0.3s ease forwards;
}
.member-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.member-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-sm);
}
.member-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.member-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.member-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.member-stat-val { font-weight: 700; font-size: 1rem; display: block; }
.member-stat-lbl { font-size: 0.68rem; color: var(--text-muted); }

/* === SEARCH === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-bar input {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--text-primary);
  width: 180px;
  box-shadow: none;
}
.search-bar input:focus { border: none; box-shadow: none; }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }

/* === THEME TOGGLE === */
.theme-toggle {
  width: 46px;
  height: 26px;
  background: var(--bg-tag);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: background var(--transition);
  flex-shrink: 0;
}
.theme-toggle.light-mode { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle.light-mode .theme-toggle-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

/* === DROPDOWN MENU === */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 170px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  overflow: hidden;
  animation: fadeInScale 0.15s ease forwards;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--accent-soft); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--divider); margin: 4px 0; }

.notif-item:hover {
  background: var(--bg-hover);
}
.notif-item.unread {
  background: rgba(124, 106, 247, 0.03);
}
.unread-dot {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.notif-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  margin-top: -4px;
  margin-right: -4px;
}
.notif-item:hover .notif-del-btn {
  opacity: 1;
}
.notif-del-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* === NOTIFICATION / TOAST === */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  animation: notificationIn 0.3s ease forwards;
  max-width: 320px;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

/* === COLOR PICKER === */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.color-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.color-dot:hover, .color-dot.selected {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.tab-btn {
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-content { display: none; flex: 1; overflow: auto; }
.tab-content.active { display: flex; flex-direction: column; }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
  flex: 1;
}
.empty-state svg { opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); }
.empty-state p { font-size: 0.85rem; max-width: 280px; line-height: 1.6; }

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-tag);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover, .filter-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 6px;
  background: var(--bg-tag);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* === RESPONSIVE (Mobile First / Tablet) === */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  /* Hamburger Menu Visible */
  .menu-toggle-btn { display: inline-flex !important; }

  /* Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform var(--transition-slow);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }

  /* Sidebar Backdrop */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: all;
  }

  .main-content { width: 100%; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar-subtitle { display: none; }
  .search-bar { width: 140px; }
  .search-bar input { font-size: 0.8rem; }

  .boards-grid {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  
  .tasklist-wrapper {
    padding: 12px 12px;
    gap: 12px;
    /* GhostNav bottom bar clearance */
    padding-bottom: 100px;
  }
  .tasklist-column, .add-column-btn {
    width: 270px;
    min-width: 270px;
  }

  /* Feedback & comment sections: padding to clear GhostNav */
  .feedback-list, .comments-section, .comment-form, .feedback-section {
    padding-bottom: 100px;
  }

  .modal {
    width: 95%;
    margin: 10px;
    max-height: 95vh;
  }
  .modal-header, .modal-body, .modal-footer {
    padding: 16px 20px;
  }
  .task-detail-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tabs { padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 10px 12px; white-space: nowrap; }

  .sidebar-link { padding: 12px 16px; min-height: 48px; }

  .filter-bar { padding: 10px 16px; overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .topbar-title { font-size: 1rem; }
  .btn-sm-mobile { padding: 6px 10px; font-size: 0.75rem; }
  .search-bar { display: none; } /* Hide search on very small phones to save space */
  .new-board-btn-text { display: none; } /* Show only icon on small phones? Maybe not. */
}

/* === FEEDBACK MOBILE OPTIMIZATIONS === */

/* Base styles for feedback comment form */
.feedback-comment-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.feedback-comment-form input {
  flex: 1;
  padding: 10px;
  background: var(--bg-input, rgba(255,255,255,0.05));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  min-width: 0; /* Important for flex shrink on mobile */
}

.feedback-comment-form button {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Feedback grid - responsive cards */
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .feedback-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 12px;
    padding: 0 12px 24px !important;
  }

  .feedback-card {
    padding: 14px;
    min-height: auto;
  }

  .feedback-card .feedback-title {
    font-size: 0.95rem;
  }

  .feedback-card .feedback-excerpt {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  /* Stack vote box on mobile */
  .feedback-card {
    flex-direction: column;
  }

  .feedback-vote-box {
    flex-direction: row;
    padding: 8px 12px;
    gap: 8px;
    width: auto;
    align-self: flex-start;
  }

  /* Modal adjustments for feedback */
  #newFeedbackModal .modal,
  #feedbackDetailModal .modal {
    padding: 20px !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  #feedbackDetailModal .modal {
    width: 95%;
    margin: 10px;
  }

  /* Comment form - stack on very small screens */
  .feedback-comment-form {
    flex-direction: column;
    gap: 8px;
  }

  .feedback-comment-form input {
    width: 100%;
  }

  .feedback-comment-form button {
    width: 100%;
    padding: 12px;
  }

  /* Comments list spacing */
  #feedbackCommentsList {
    max-height: 40vh;
    overflow-y: auto;
  }

  .comment-item {
    padding: 10px 12px;
  }

  .comment-text {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  /* Even tighter spacing on small phones */
  #feedbackPage .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  #feedbackPage .page-header button {
    width: 100%;
    justify-content: center;
  }

  .feedback-grid {
    padding: 0 8px 16px !important;
  }

  /* Modal form elements */
  #newFeedbackModal input,
  #newFeedbackModal textarea,
  #newFeedbackModal select {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  /* Feedback detail content */
  #feedbackDetailContent {
    font-size: 0.85rem;
    max-height: 30vh;
    overflow-y: auto;
  }
}


/* --- DnD Drop Placeholder v49.0 --- */
.drop-placeholder {
  background: rgba(124, 106, 247, 0.08);
  border: 2px dashed var(--accent, #7c6af7);
  border-radius: 10px;
  height: 72px;
  margin-bottom: 12px;
  pointer-events: none;
}
