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

:root {
  --primary: #f06a6a;
  --primary-hover: #e05555;
  --primary-light: #fff0f0;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #a8b2d8;
  --sidebar-active: #f06a6a;
  --sidebar-hover: #16213e;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e8e9ec;
  --text: #1d2335;
  --text-secondary: #6b7280;
  --todo: #6b7280;
  --inprogress: #3b82f6;
  --done: #22c55e;
  --high: #ef4444;
  --medium: #f59e0b;
  --low: #6b7280;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --transition: 0.2s ease;
  --sidebar-width: 240px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition);
  z-index: 100;
}

.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .sidebar-section .section-header span,
.sidebar.collapsed .project-list,
.sidebar.collapsed .logo span { display: none; }
.sidebar.collapsed .section-header { justify-content: center; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo i { color: var(--primary); font-size: 20px; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.sidebar-toggle:hover { color: white; }

.sidebar-nav {
  padding: 12px 8px;
}

.sidebar-nav ul { list-style: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all var(--transition);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: rgba(240,106,106,0.15); color: white; }
.nav-item.active i { color: var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
  display: none;
}
.badge.visible { display: inline; }

.sidebar-section {
  padding: 8px 8px 12px;
  flex: 1;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.section-header .btn-icon {
  color: var(--sidebar-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: all var(--transition);
  font-size: 13px;
}
.section-header .btn-icon:hover { background: rgba(255,255,255,0.1); color: white; }

.project-list { list-style: none; }

.project-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
}
.project-list-item:hover { background: var(--sidebar-hover); color: white; }
.project-list-item.active { background: rgba(255,255,255,0.08); color: white; }

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

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Top Bar ===== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left h1 { font-size: 18px; font-weight: 700; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--primary); background: white; }
.search-box i { color: var(--text-secondary); font-size: 13px; }
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 180px;
  color: var(--text);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a29bfe);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); border-color: #d1d5db; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 5px 6px;
  border-radius: 5px;
  transition: all var(--transition);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ===== View Container ===== */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view { width: 100%; }
.hidden { display: none !important; }

/* ===== Dashboard ===== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #f0fdf4; color: #22c55e; }
.stat-icon.orange { background: #fff7ed; color: #f97316; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }

.stat-number { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.dashboard-card.full-width { grid-column: 1 / -1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 15px; font-weight: 700; }
.view-link { color: var(--primary); font-size: 12px; text-decoration: none; font-weight: 600; }
.view-link:hover { text-decoration: underline; }

.task-list-compact { display: flex; flex-direction: column; gap: 8px; }

.compact-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.compact-task:last-child { border-bottom: none; }
.compact-task:hover .compact-task-title { color: var(--primary); }

.compact-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.compact-task-title { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-task-due { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.compact-task-due.overdue { color: #ef4444; font-weight: 600; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.project-card-dash {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 4px solid;
}
.project-card-dash:hover { background: var(--bg); transform: translateY(-1px); box-shadow: var(--shadow); }
.project-card-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.project-card-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.project-card-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.project-card-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state i { font-size: 36px; opacity: 0.3; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ===== Toolbar ===== */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }

.filter-group { display: flex; gap: 4px; background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }

.filter-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn.active { background: var(--primary); color: white; }
.filter-btn:hover:not(.active) { background: var(--bg); color: var(--text); }

.view-toggle { display: flex; gap: 2px; background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }

.view-btn {
  background: none;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
}
.view-btn.active { background: var(--primary); color: white; }
.view-btn:hover:not(.active) { background: var(--bg); }

.select-input {
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

/* ===== Task List View ===== */
.tasks-section { margin-bottom: 20px; }

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.count {
  background: var(--bg);
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}

.task-items { display: flex; flex-direction: column; }

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg); }

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
}
.task-check.checked { background: var(--done); border-color: var(--done); }
.task-check:hover { border-color: var(--primary); }

.task-item-main { flex: 1; min-width: 0; }
.task-item-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item-title.done-text { text-decoration: line-through; color: var(--text-secondary); }
.task-item-meta { display: flex; gap: 8px; margin-top: 3px; align-items: center; flex-wrap: wrap; }

.task-project-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
  color: white;
}

.priority-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.priority-high { background: #fef2f2; color: #ef4444; }
.priority-medium { background: #fffbeb; color: #f59e0b; }
.priority-low { background: #f9fafb; color: #6b7280; }

.due-tag {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.due-tag.overdue { color: #ef4444; font-weight: 600; }
.due-tag.today { color: #f97316; font-weight: 600; }

.task-item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--transition); }
.task-item:hover .task-item-actions { opacity: 1; }

/* ===== Board View ===== */
.board-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.board-column {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 200px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.todo-dot { background: var(--todo); }
.inprogress-dot { background: var(--inprogress); }
.done-dot { background: var(--done); }

.col-count {
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.add-col-task { color: var(--text-secondary); }

.column-tasks { display: flex; flex-direction: column; gap: 8px; }

.board-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid;
}
.board-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.board-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}
.board-card-title.done-text { text-decoration: line-through; color: var(--text-secondary); }

.board-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===== Calendar View ===== */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.calendar-toolbar h2 { font-size: 18px; font-weight: 700; min-width: 160px; text-align: center; }

.calendar-grid {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cal-day-name {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.cal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  vertical-align: top;
  transition: background var(--transition);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--primary-light); }
.cal-cell.other-month { background: #fafafa; }
.cal-cell.today { background: var(--primary-light); }

.cal-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-cell.today .cal-date { background: var(--primary); color: white; }

.cal-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cal-event.todo { background: #f1f5f9; color: var(--todo); }
.cal-event.inprogress { background: #eff6ff; color: var(--inprogress); }
.cal-event.done { background: #f0fdf4; color: var(--done); }

.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ===== Project View ===== */
.project-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.project-color-dot {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.project-meta { flex: 1; }
.project-meta h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.project-meta p { font-size: 13px; color: var(--text-secondary); }

.project-actions { display: flex; gap: 8px; align-items: center; }

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--inprogress), var(--done)); border-radius: 4px; transition: width 0.5s ease; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; min-width: 36px; text-align: right; }

/* ===== Inbox ===== */
.inbox-container { max-width: 640px; }
.inbox-item {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.inbox-icon { font-size: 16px; margin-top: 2px; }
.inbox-content { flex: 1; }
.inbox-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.inbox-time { font-size: 11px; color: var(--text-secondary); }

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

.modal-sm { max-width: 400px; }
.modal-xs { max-width: 320px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }

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

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

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.required { color: var(--primary); }

.form-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  background: white;
  width: 100%;
  font-family: inherit;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

textarea.form-input { resize: vertical; }

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

/* Color Picker */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--text); transform: scale(1.1); }

/* ===== Task Detail Sidebar ===== */
.task-detail-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  background: white;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.sidebar-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-detail-header h3 { font-size: 15px; font-weight: 700; }

.sidebar-detail-body { flex: 1; overflow-y: auto; padding: 20px; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 850;
}

.detail-field { margin-bottom: 18px; }
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 6px; }
.detail-value { font-size: 14px; color: var(--text); }
.detail-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; line-height: 1.4; }
.detail-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }

.detail-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.status-todo { background: #f1f5f9; color: var(--todo); }
.status-inprogress { background: #eff6ff; color: var(--inprogress); }
.status-done { background: #f0fdf4; color: var(--done); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c1c8d4; }

/* ===== Auth Page ===== */
.auth-body {
  display: block;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #16213e 100%);
  min-height: 100vh;
  overflow: auto;
}

.auth-container {
  max-width: 440px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.auth-logo i { color: var(--primary); }

.auth-tagline {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 22px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active { background: white; color: var(--text); box-shadow: var(--shadow); }

.auth-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-full { width: 100%; justify-content: center; padding: 11px; margin-top: 4px; }

.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 38px; }
.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}
.eye-btn:hover { color: var(--text); }

.auth-footer {
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  text-align: center;
  margin-top: 24px;
}
.auth-footer a { color: rgba(255,255,255,0.5); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== User Menu ===== */
.user-menu-wrap { position: relative; }

.user-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  padding: 8px 0;
  z-index: 500;
  border: 1px solid var(--border);
}

.user-menu-name  { padding: 12px 16px 2px; font-size: 14px; font-weight: 700; }
.user-menu-email { padding: 0 16px 10px; font-size: 12px; color: var(--text-secondary); }

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
}
.user-menu-item:hover { background: var(--bg); }
.user-menu-item i { width: 16px; text-align: center; color: var(--text-secondary); }

/* ===== Members Modal ===== */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a29bfe);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 13.5px; font-weight: 600; }

.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.role-badge-manager { background: #eff6ff; color: #3b82f6; }
.role-badge-member  { background: #f0fdf4; color: #22c55e; }
.role-badge-viewer  { background: #f9fafb; color: #6b7280; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease;
  max-width: 320px;
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: #ef4444; }
.toast.toast-success { background: #22c55e; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .board-columns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar .sidebar-nav span, .sidebar .sidebar-section .section-header span,
  .sidebar .project-list, .sidebar .logo span { display: none; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
