:root {
  --bg-main: #070b13;
  --bg-sidebar: #0b1120;
  --bg-board: #0e1626;
  --bg-column: #131d31;
  --bg-column-header: #17243c;
  --bg-card: #182338;
  --bg-card-hover: #1e2c45;
  --bg-modal: #111a2e;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-emerald);
}

/* Top Navigation Bar */
.navbar {
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-box {
  position: relative;
  width: 280px;
}
.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 34px;
  color: #fff;
  font-size: 0.85rem;
  transition: var(--transition);
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}
.search-box i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User & Quick Switcher */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
}
.user-avatar {
  width: 26px;
  height: 26px;
  background: var(--accent-emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #042f2e;
  font-size: 0.8rem;
}

/* App Main Layout: Sidebar + Canvas */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Boards Sidebar */
.boards-sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
  transition: var(--transition);
}

.boards-sidebar.collapsed {
  width: 60px;
  padding: 16px 8px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 6px;
}
.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.board-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 4px;
  transition: var(--transition);
  border: 1px solid transparent;
}
.board-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.board-nav-item.active {
  background: rgba(16, 185, 129, 0.12);
  color: #fff;
  border-color: rgba(16, 185, 129, 0.3);
}
.board-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-icon {
  font-size: 1rem;
}
.board-count {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-dim);
}

.btn-sidebar-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  transition: var(--transition);
}
.btn-sidebar-add:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.05);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ecosystem-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.ecosystem-link:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

/* Kanban Workspace Canvas */
.board-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-board);
  overflow: hidden;
}

/* Board Header Bar */
.board-header {
  padding: 14px 24px;
  background: rgba(11, 17, 32, 0.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.board-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.board-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.board-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.stat-pill strong {
  color: #fff;
}

/* Columns Horizontal Scroll Area */
.columns-container {
  flex: 1;
  display: flex;
  gap: 18px;
  padding: 20px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}

/* Column Card */
.kanban-column {
  width: 310px;
  min-width: 310px;
  background: var(--bg-column);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 170px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.kanban-column.drag-over {
  border-color: var(--accent-emerald);
  background: #152238;
}

.column-header {
  padding: 12px 14px;
  background: var(--bg-column-header);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
}

.column-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}

.column-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Cards List within Column */
.cards-list {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
}

/* Individual Kanban Card */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  user-select: none;
}

.kanban-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* SortableJS drag states */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px dashed var(--accent-emerald) !important;
}
.sortable-chosen {
  cursor: grabbing !important;
}

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.card-label {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 8px;
}

.card-desc-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress Bar for Checklists */
.card-checklist-progress {
  margin-bottom: 10px;
}
.checklist-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--accent-emerald);
  transition: width 0.3s ease;
}
.checklist-progress-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Card Footer: Priority + Due Date */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Priority Badges */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 4px;
}
.priority-urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.priority-high {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.priority-medium {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.priority-low {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Due Date Badge */
.due-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-weight: 500;
}
.due-badge.overdue {
  color: #f87171;
  font-weight: 600;
}
.due-badge.due-soon {
  color: #fbbf24;
  font-weight: 600;
}

/* Add Card Footer in Column */
.column-footer {
  padding: 10px;
  border-top: 1px solid var(--border-color);
}
.btn-add-card {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-add-card:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

/* Add Column Button */
.add-column-box {
  width: 280px;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  gap: 8px;
}
.add-column-box:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.04);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 90%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: #fff;
  font-size: 0.88rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-emerald);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}
textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

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

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: var(--transition);
}
.btn-primary {
  background: var(--accent-emerald);
  color: #042f2e;
}
.btn-primary:hover {
  background: #059669;
  box-shadow: 0 0 12px var(--accent-emerald-glow);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

/* Checklist in Modal */
.checklist-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checklist-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.checklist-item-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}
.checklist-item-row input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
}
.checklist-item-row input[type="text"]:focus {
  outline: none;
}
.checklist-item-row.done input[type="text"] {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* Activity Drawer */
.activity-drawer {
  position: fixed;
  top: 60px;
  right: -360px;
  width: 360px;
  bottom: 0;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  padding: 20px;
  overflow-y: auto;
  transition: right 0.25s ease;
  z-index: 40;
}
.activity-drawer.active {
  right: 0;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}
.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}
.activity-item .act-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Login Screen Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #0f1c32 0%, #060911 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #111a2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  text-align: center;
}
.auth-logo {
  font-size: 2.2rem;
  color: var(--accent-emerald);
  margin-bottom: 12px;
}
.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
