/* === CSS Variables === */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --accent: #00a8d8;
  --accent-hover: #18c0f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
  --transition: 150ms ease;

  --priority-none: transparent;
  --priority-low: #3b82f6;
  --priority-medium: #f59e0b;
  --priority-high: #f97316;
  --priority-critical: #ef4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* === Auth Pages === */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; text-align: center; }
.auth-card .subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 32px; font-size: 0.9rem; }
.auth-card .logo { text-align: center; font-size: 2.5rem; margin-bottom: 16px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: none;
}
.auth-error.visible { display: block; }

.auth-link { text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 0.9rem; }
.auth-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-link a:hover { color: var(--accent-hover); }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; width: 100%; justify-content: center; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; width: auto; }
.btn-xs { padding: 2px 6px; font-size: 0.75rem; }

.btn-icon {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm); font-size: 1rem;
  transition: all var(--transition); display: inline-flex; align-items: center;
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-icon.btn-xs { padding: 2px 4px; font-size: 0.8rem; }

/* === Small select === */
.select-sm {
  background: var(--bg-primary); border: 1px solid var(--border); color: var(--text-primary);
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.85rem; font-family: inherit;
}
.select-sm:focus { outline: none; border-color: var(--accent); }

/* === Header === */
.header {
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.header-logo:hover { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 12px; }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.75rem; font-weight: 700; color: white; text-transform: uppercase;
}
.user-avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }

.user-menu {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius); transition: background var(--transition);
}
.user-menu:hover { background: var(--bg-tertiary); }
.user-name { font-size: 0.85rem; font-weight: 500; }

/* === Board List === */
.boards-page { flex: 1; padding: 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
.boards-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.boards-header h2 { font-size: 1.5rem; font-weight: 700; }
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.board-tile {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; cursor: pointer; transition: all var(--transition); position: relative;
}
.board-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.board-tile h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.board-tile .card-count { color: var(--text-secondary); font-size: 0.85rem; }

.board-tile-new {
  border-style: dashed; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.95rem; min-height: 100px;
}
.board-tile-new:hover { color: var(--accent); border-color: var(--accent); }

.board-tile-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.board-tile:hover .board-tile-actions { opacity: 1; }

/* === Empty states === */
.empty-state { text-align: center; padding: 40px 20px; grid-column: 1 / -1; }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* === Board View === */
.board-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.board-header {
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: var(--bg-secondary);
}
.board-header-left { display: flex; align-items: center; gap: 12px; }
.board-header-right { display: flex; align-items: center; gap: 8px; }
.board-header h2 { font-size: 1.2rem; font-weight: 600; }
.board-header .back-btn { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; display: flex; align-items: center; gap: 4px; }
.board-header .back-btn:hover { color: var(--text-primary); }

/* === Filter Bar === */
.filter-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-group select, .filter-group input { font-size: 0.85rem; }
.filter-search {
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; color: var(--text-primary); font-size: 0.85rem; width: 200px; font-family: inherit;
}
.filter-search:focus { outline: none; border-color: var(--accent); }
.filter-group select {
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; color: var(--text-primary); font-family: inherit;
}

.board-columns {
  flex: 1; display: flex; gap: 16px; padding: 16px; overflow-x: auto; overflow-y: hidden; align-items: flex-start;
}

/* === Columns === */
.column {
  background: var(--bg-secondary); border-radius: var(--radius-lg); min-width: 300px; max-width: 300px;
  max-height: calc(100vh - 200px); display: flex; flex-direction: column; border: 1px solid var(--border);
}
.column-header {
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.column-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; }
.column-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.column-count { background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.7rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.column-actions { display: flex; gap: 2px; }
.column-cards { flex: 1; overflow-y: auto; padding: 8px; min-height: 60px; }
.column-cards.drag-over { background: rgba(99, 102, 241, 0.08); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.column-empty { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 20px 10px; }
.column-footer { padding: 8px; flex-shrink: 0; }

.add-card-btn {
  width: 100%; padding: 8px; background: transparent; border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-muted); cursor: pointer; font-size: 0.85rem;
  transition: all var(--transition); font-family: inherit;
}
.add-card-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(99, 102, 241, 0.05); }

.add-column-btn {
  min-width: 300px; max-width: 300px; padding: 16px; background: transparent;
  border: 2px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all var(--transition);
  font-family: inherit; height: fit-content;
}
.add-column-btn:hover { border-color: var(--accent); color: var(--accent); }

/* === Cards === */
.card {
  background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all var(--transition);
  position: relative; border-left: 3px solid var(--priority-none);
  animation: cardFadeIn 0.2s ease; overflow: hidden;
}
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card.dragging { opacity: 0.5; transform: rotate(2deg); }

/* Column drag and drop */
.column-header[draggable="true"] { cursor: grab; }
.column-header[draggable="true"]:active { cursor: grabbing; }
.column.column-dragging { opacity: 0.4; transform: rotate(1deg); }
.column-placeholder {
  min-width: 300px; max-width: 300px; min-height: 120px;
  border: 2px dashed var(--accent); border-radius: var(--radius-lg);
  background: rgba(0, 168, 216, 0.06);
  transition: all 0.15s ease;
}

/* Drop placeholder */
.card-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  margin-bottom: 8px;
  height: 40px;
  background: rgba(0, 168, 216, 0.08);
  transition: height 0.15s ease;
}
.card[data-priority="low"] { border-left-color: var(--priority-low); }
.card[data-priority="medium"] { border-left-color: var(--priority-medium); }
.card[data-priority="high"] { border-left-color: var(--priority-high); }
.card[data-priority="critical"] { border-left-color: var(--priority-critical); }

.card-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; line-height: 1.4; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; overflow: hidden; }
.card-label { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: white; text-transform: uppercase; letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-edit-btn, .label-remove-btn {
  background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 0.75rem; padding: 0 2px; line-height: 1; display: none;
}
.label-edit-btn:hover, .label-remove-btn:hover { color: white; }
.card-label:hover .label-edit-btn, .card-label:hover .label-remove-btn { display: inline; }

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }
.card-due { display: flex; align-items: center; gap: 4px; }
.card-due.overdue { color: var(--danger); font-weight: 600; }
.card-due.due-soon { color: var(--warning); }
.card-comment-count { display: flex; align-items: center; gap: 2px; }

/* Card assignee avatars */
.card-assignees { display: flex; gap: 0; flex-shrink: 0; }
.card-assignee-avatar {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.6rem; font-weight: 700; color: white;
  text-transform: uppercase; border: 2px solid var(--bg-primary);
  margin-left: -6px; flex-shrink: 0;
}
.card-assignees .card-assignee-avatar:first-child { margin-left: 0; }

/* === Inline Add Card === */
.inline-add-card { padding: 8px; }
.inline-add-card input {
  width: 100%; padding: 10px 12px; background: var(--bg-primary);
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--text-primary); font-size: 0.9rem; font-family: inherit;
}
.inline-add-card input:focus { outline: none; }
.inline-add-card-actions { display: flex; gap: 8px; margin-top: 8px; }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; z-index: 1000; overflow-y: auto;
  transition: background 0.2s ease;
}
.modal-overlay.visible { background: rgba(0, 0, 0, 0.6); }
.modal-overlay.closing { background: rgba(0, 0, 0, 0); }

.modal {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); position: relative;
  transform: translateY(-10px); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-overlay.visible .modal { transform: translateY(0); opacity: 1; }
.modal-overlay.closing .modal { transform: translateY(-10px); opacity: 0; }

.modal-lg { max-width: 800px; }

.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 600; flex: 1; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-body section { margin-bottom: 24px; }
.modal-body section:last-child { margin-bottom: 0; }
.modal-body section h4 {
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Card detail: two-column layout */
.card-detail-body { display: flex; gap: 24px; }
.card-detail-main { flex: 1; min-width: 0; }
.card-detail-sidebar { width: 220px; flex-shrink: 0; }

.card-detail-description { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.card-detail-description:empty::before { content: 'Click to add description'; color: var(--text-muted); font-style: italic; }

.meta-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.meta-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.meta-value { font-size: 0.9rem; color: var(--text-secondary); }

/* === Comments === */
.comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comment-author { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.comment-author strong { color: var(--text-primary); }
.comment-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.comment:hover .comment-actions { opacity: 1; }
.comment-body { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; }
.edited-badge { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.comment-edit-textarea {
  width: 100%; min-height: 60px; padding: 8px; background: var(--bg-primary);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.comment-form textarea {
  width: 100%; min-height: 60px; padding: 10px; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem; resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }

/* === Assignee chips === */
.assignee-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-tertiary); border-radius: 20px; padding: 4px 10px 4px 4px;
  font-size: 0.85rem; margin: 2px;
}
.assignee-chip .card-assignee-avatar { margin-left: 0; border-color: var(--bg-tertiary); }

/* === Activity === */
.activity-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1rem; flex-shrink: 0; }


/* === Members list (board settings) === */
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-info { display: flex; align-items: center; gap: 10px; }
.member-actions { display: flex; align-items: center; gap: 8px; }

.add-member-form { display: flex; gap: 8px; align-items: center; }
.add-member-form input { flex: 1; }

/* === Invite link === */
.invite-link-box { display: flex; gap: 8px; align-items: center; }
.invite-link-box input { flex: 1; }

/* === Badge === */
.badge {
  display: inline-block; background: var(--bg-tertiary); color: var(--text-secondary);
  padding: 2px 10px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}

/* === Admin Panel === */
.admin-page { flex: 1; padding: 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
.admin-page h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.admin-section { margin-bottom: 32px; }
.admin-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }

.table-container { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table tr.expired { opacity: 0.5; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* === Profile Page === */
.profile-page { flex: 1; padding: 32px; max-width: 800px; margin: 0 auto; width: 100%; }
.profile-page h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }
.profile-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.profile-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.profile-header { display: flex; align-items: center; gap: 16px; }

/* API Keys */
.api-key-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.api-key-row:last-child { border-bottom: none; }
.api-key-reveal {
  background: var(--bg-primary); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 12px; margin-top: 8px;
}
.api-key-code { display: block; margin: 8px 0; padding: 8px; background: var(--bg-tertiary); border-radius: var(--radius-sm); font-size: 0.85rem; word-break: break-all; }

/* Keyboard shortcuts */
.shortcuts-list { display: flex; flex-direction: column; gap: 8px; }
.shortcut { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
kbd {
  display: inline-block; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 2px 8px; font-family: monospace; font-size: 0.85rem;
  box-shadow: 0 1px 0 var(--border);
}

/* === Utility classes === */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }

/* === Loading === */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 10px; }
.loading-inline { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }
.spinner-sm { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Editable === */
.editable { cursor: text; padding: 4px 8px; border-radius: var(--radius-sm); transition: background var(--transition); }
.editable:hover { background: var(--bg-tertiary); }

/* === Label Picker === */
.label-input-row { display: flex; gap: 8px; margin-top: 8px; }
.label-input-row input {
  flex: 1; padding: 6px 10px; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem; font-family: inherit;
}
.label-input-row input:focus { outline: none; border-color: var(--accent); }

/* === Column Edit Modal extras === */
.color-picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 8px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.selected { border-color: white; box-shadow: 0 0 0 2px var(--bg-primary); }

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

/* === Toast notifications === */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 20px; box-shadow: var(--shadow-lg); font-size: 0.9rem;
  animation: slideIn 0.3s ease; max-width: 340px;
}
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--success); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === Responsive === */
/* Comment image attachments */
.comment-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.comment-attachment {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
  max-width: 240px;
}
.comment-attachment:hover {
  border-color: var(--accent);
}
.comment-attachment img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
}
.comment-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.comment-preview-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 120px;
}
.comment-preview-thumb img {
  display: block;
  max-width: 100%;
  max-height: 80px;
  object-fit: cover;
}
.comment-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  padding: 0;
}
.comment-preview-remove:hover {
  background: rgba(220,38,38,0.8);
}
.comment-preview-name {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .boards-page { padding: 16px; }
  .boards-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .board-columns { padding: 8px; gap: 8px; }
  .column { min-width: 280px; max-width: 280px; }
  .header { padding: 0 12px; }
  .modal-overlay { padding: 20px 10px; }
  .card-detail-body { flex-direction: column; }
  .card-detail-sidebar { width: 100%; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { padding: 8px 12px; }
  .admin-page, .profile-page { padding: 16px; }
}

@media (max-width: 480px) {
  .column { min-width: 260px; max-width: 260px; }
  .user-name { display: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}
