/* ═══════════════════════════════════════════════════════════
   TaskFlow — Design System & Styles
   Typography: Lexend + Source Sans 3
   Palette:  Warm Slate + Teal Accent (no neon)
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
  /* Typography */
  --font-heading: 'Lexend', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;

  /* Core palette — warm, professional, non-neon */
  --accent:         #2A9D8F;    /* teal */
  --accent-hover:   #238578;
  --accent-light:   #E8F5F2;
  --accent-subtle:  #D4EEEA;

  /* Priority */
  --priority-high:    #E16B5C;  /* warm coral */
  --priority-medium:  #E9A84C;  /* warm amber */
  --priority-low:     #5BA88B;  /* sage green */
  --priority-high-bg:   #FDF0EE;
  --priority-medium-bg: #FDF6EC;
  --priority-low-bg:    #EEF7F2;

  /* Status */
  --status-todo:        #94A3B8;
  --status-in-progress: #3B82F6;
  --status-review:      #A78BFA;
  --status-done:        #2A9D8F;

  /* Surfaces */
  --bg:          #F7F8FA;
  --surface:     #FFFFFF;
  --surface-hover:#F1F3F7;
  --sidebar-bg:  #1E293B;
  --sidebar-text:#CBD5E1;
  --sidebar-active:#334155;

  /* Text */
  --text-primary:   #1E293B;
  --text-secondary: #64748B;
  --text-muted:     #94A3B8;

  /* Borders & Shadows */
  --border:        #E2E8F0;
  --border-focus:  #2A9D8F;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:     0 12px 32px rgba(0,0,0,0.10);
  --shadow-card:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Spacing */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* Danger */
  --danger:       #E16B5C;
  --danger-hover: #CC5A4B;
  --danger-bg:    #FDF0EE;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 220ms;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.hidden { display: none !important; }

/* ─── SCROLLBAR (subtle) ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--duration) var(--ease-out);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: #F8FAFC;
  letter-spacing: -0.02em;
}

.sidebar-toggle {
  color: var(--sidebar-text);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--duration);
  display: none;
}
.sidebar-toggle:hover { background: var(--sidebar-active); }

.sidebar-nav {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease-out);
  text-align: left;
  width: 100%;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #F1F5F9;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #F8FAFC;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: var(--accent);
  color: #fff;
}

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

.priority-dot.high   { background: var(--priority-high); }
.priority-dot.medium { background: var(--priority-medium); }
.priority-dot.low    { background: var(--priority-low); }

/* Status indicator dots in sidebar */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-indicator.in-progress { background: var(--status-in-progress); }
.status-indicator.review      { background: var(--status-review); }
.status-indicator.done        { background: var(--status-done); }

.sidebar-section {
  padding: 16px 12px 0;
}

.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px 8px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration);
}

.team-item:hover {
  background: rgba(255,255,255,0.06);
  color: #F1F5F9;
}

.team-item.active {
  background: var(--sidebar-active);
  color: #F8FAFC;
}

.team-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.team-task-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sidebar footer — progress */
.sidebar-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-ring-container {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 4;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset 600ms var(--ease-out);
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #F8FAFC;
}

.progress-label {
  display: flex;
  flex-direction: column;
}

.progress-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #F1F5F9;
}

.progress-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--duration);
}
.mobile-menu-btn:hover { background: var(--surface-hover); }

.topbar-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* Search */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 220px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.8125rem;
  transition: all var(--duration);
  outline: none;
}
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
  width: 280px;
}  
.search-input::placeholder { color: var(--text-muted); }

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border);
}

.view-btn {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration);
  display: flex;
  align-items: center;
}

.view-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.view-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease-out);
  box-shadow: 0 1px 3px rgba(42,157,143,0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42,157,143,0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--duration);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease-out);
}
.btn-danger:hover {
  background: var(--danger-hover);
}


/* ═══════════════════════════════════════════════════════════
   CATEGORY TABS (Home Page Sub-Filters)
   ═══════════════════════════════════════════════════════════ */
.category-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 28px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  flex-shrink: 0;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}

.cat-tab:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.cat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cat-tab svg {
  flex-shrink: 0;
}

.cat-count {
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cat-tab.active .cat-count {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-subtle);
}


/* ═══════════════════════════════════════════════════════════
   TASK LIST VIEW
   ═══════════════════════════════════════════════════════════ */
.task-list-view {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
}

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

/* ─── TASK CARD ─── */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
  position: relative;
  animation: slideUp 350ms var(--ease-out) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-subtle);
  transform: translateY(-1px);
}

.task-card.completed {
  opacity: 0.6;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Checkbox */
.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  position: relative;
}

.task-checkbox:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-checkbox.checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* Priority bar */
.task-priority-bar {
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.task-priority-bar.high   { background: var(--priority-high); }
.task-priority-bar.medium { background: var(--priority-medium); }
.task-priority-bar.low    { background: var(--priority-low); }

/* Task content */
.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.task-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.task-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.task-meta-item svg {
  flex-shrink: 0;
}

.task-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.task-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-priority-badge.high {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}
.task-priority-badge.medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
}
.task-priority-badge.low {
  background: var(--priority-low-bg);
  color: var(--priority-low);
}

.task-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.task-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.task-status-badge[data-status="todo"]          { background: #F1F5F9; color: #64748B; }
.task-status-badge[data-status="todo"] .status-dot { background: var(--status-todo); }
.task-status-badge[data-status="in-progress"]   { background: #EFF6FF; color: #3B82F6; }
.task-status-badge[data-status="in-progress"] .status-dot { background: var(--status-in-progress); }
.task-status-badge[data-status="review"]        { background: #F5F3FF; color: #7C3AED; }
.task-status-badge[data-status="review"] .status-dot { background: var(--status-review); }
.task-status-badge[data-status="done"]          { background: var(--accent-light); color: var(--accent); }
.task-status-badge[data-status="done"] .status-dot { background: var(--status-done); }

.deadline-overdue {
  color: var(--priority-high) !important;
  font-weight: 600;
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #fff;
}

/* Task actions */
.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--duration);
  flex-shrink: 0;
}

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

.task-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration);
}

.task-action-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.task-action-btn.delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
}


/* ─── EMPTY STATE ─── */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  animation: fadeIn 400ms var(--ease-out);
}

.empty-state.visible {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.empty-state svg {
  margin-bottom: 24px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════
   BOARD VIEW (Kanban)
   ═══════════════════════════════════════════════════════════ */
.board-view {
  flex: 1;
  padding: 24px 28px;
  overflow-x: auto;
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  min-height: calc(100vh - var(--topbar-height) - 48px);
}

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

.board-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.board-column-header h3 {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

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

.board-column-dot.todo        { background: var(--status-todo); }
.board-column-dot.in-progress { background: var(--status-in-progress); }
.board-column-dot.review      { background: var(--status-review); }
.board-column-dot.done        { background: var(--status-done); }

.board-column-count {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 8px;
  color: var(--text-muted);
}

.board-column-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

/* Board card */
.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  animation: slideUp 350ms var(--ease-out) both;
}

.board-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-subtle);
  transform: translateY(-2px);
}

.board-card-title {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.board-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════════
   TEAM MEMBER DASHBOARD
   ═══════════════════════════════════════════════════════════ */
.member-dashboard {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  animation: fadeIn 350ms var(--ease-out);
}

.member-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.member-dash-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-dash-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.member-dash-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.member-dash-role {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Dashboard Stats */
.member-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--duration) var(--ease-out);
  animation: slideUp 350ms var(--ease-out) both;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.total   { background: #EFF6FF; color: #3B82F6; }
.stat-icon.active  { background: var(--priority-medium-bg); color: var(--priority-medium); }
.stat-icon.done    { background: var(--accent-light); color: var(--accent); }
.stat-icon.overdue { background: var(--priority-high-bg); color: var(--priority-high); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Dashboard Sections */
.member-dash-section {
  margin-bottom: 24px;
}

.member-dash-section-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.member-dash-section-title svg {
  color: var(--text-muted);
}

/* Expertise Tags */
.excellence-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.excellence-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--duration) var(--ease-out);
}

.excellence-tag:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-subtle);
}

.excellence-tag .tag-count {
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 8px;
}

/* Workload Bars */
.workload-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.workload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workload-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 90px;
  flex-shrink: 0;
}

.workload-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms var(--ease-out);
  min-width: 2px;
}

.workload-bar-fill.todo        { background: var(--status-todo); }
.workload-bar-fill.in-progress { background: var(--status-in-progress); }
.workload-bar-fill.review      { background: var(--status-review); }
.workload-bar-fill.done        { background: var(--status-done); }

.workload-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* Dashboard tasks */
.member-dash-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ═══════════════════════════════════════════════════════════
   SMART SUGGESTION (in modal)
   ═══════════════════════════════════════════════════════════ */
.smart-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #EFF6FF 0%, #E8F5F2 100%);
  border: 1px solid var(--accent-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  animation: slideUp 300ms var(--ease-out) both;
}

.smart-suggestion.hidden {
  display: none;
}

.smart-suggestion-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.smart-suggestion-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.smart-suggestion-label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.smart-suggestion-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-suggestion-apply {
  padding: 5px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--duration);
  flex-shrink: 0;
}

.smart-suggestion-apply:hover {
  background: var(--accent-hover);
}

.smart-suggestion-dismiss {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--duration);
}

.smart-suggestion-dismiss:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

/* ─── AUTOCOMPLETE DROPDOWN ─── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.autocomplete-dropdown.hidden { display: none; }

.autocomplete-item {
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--duration);
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--accent-light);
}

.autocomplete-item .ac-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.autocomplete-item .ac-label {
  flex: 1;
}

.autocomplete-item .ac-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease-out);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.97);
  transition: transform 300ms var(--ease-out);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--duration);
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px 28px;
}

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

.delete-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── FORM ─── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: var(--font-heading);
}

.required {
  color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

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

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

.custom-select-wrapper {
  position: relative;
}

.custom-select-wrapper select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all var(--duration);
}

.custom-select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Tag input */
.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  min-height: 42px;
  align-items: center;
  transition: all var(--duration);
}

.tag-input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.tag-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-chip-remove {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: background var(--duration);
}

.tag-chip-remove:hover {
  background: rgba(42,157,143,0.2);
}

#tagInput {
  flex: 1;
  min-width: 100px;
  border: none;
  background: none;
  outline: none;
  font-size: 0.8125rem;
  color: var(--text-primary);
  padding: 2px 0;
}

#tagInput::placeholder {
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--sidebar-bg);
  color: #F1F5F9;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms var(--ease-out) both;
  max-width: 360px;
}

.toast.removing {
  animation: toastOut 250ms ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.95); }
}

.toast-icon {
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon   { color: var(--danger); }
.toast.info .toast-icon    { color: var(--status-in-progress); }


/* ═══════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 90;
}

.sidebar-overlay.active {
  display: block;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .board-columns {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
  .member-dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle { display: flex; }
  .mobile-menu-btn { display: flex; }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .task-list-view {
    padding: 16px;
  }

  .board-view {
    padding: 16px;
  }

  .board-columns {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 160px;
  }

  .search-input:focus {
    width: 200px;
  }

  .btn-primary span {
    display: none;
  }

  .topbar-title {
    font-size: 1.125rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .view-toggle {
    display: none;
  }

  .member-dashboard {
    padding: 16px;
  }

  .member-dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .member-dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .category-tabs {
    padding: 10px 16px 0;
  }
}

@media (max-width: 480px) {
  .search-wrapper {
    display: none;
  }

  .topbar-count {
    display: none;
  }

  .task-card {
    padding: 14px 16px;
  }

  .member-dash-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 1.125rem;
  }

  .category-tabs {
    gap: 2px;
  }

  .cat-tab {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}


/* ═══════════════════════════════════════════════════════════
   MICRO-INTERACTIONS & POLISH
   ═══════════════════════════════════════════════════════════ */

/* Keyboard focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Select focus ring */
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Selection */
::selection {
  background: var(--accent-light);
  color: var(--accent-hover);
}

/* Placeholder date styling */
input[type="date"] {
  color: var(--text-primary);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Stagger animations for task list */
.task-card:nth-child(1) { animation-delay: 0ms; }
.task-card:nth-child(2) { animation-delay: 40ms; }
.task-card:nth-child(3) { animation-delay: 80ms; }
.task-card:nth-child(4) { animation-delay: 120ms; }
.task-card:nth-child(5) { animation-delay: 160ms; }
.task-card:nth-child(6) { animation-delay: 200ms; }
.task-card:nth-child(7) { animation-delay: 240ms; }
.task-card:nth-child(8) { animation-delay: 280ms; }
.task-card:nth-child(9) { animation-delay: 320ms; }
.task-card:nth-child(10) { animation-delay: 360ms; }

.board-card:nth-child(1) { animation-delay: 0ms; }
.board-card:nth-child(2) { animation-delay: 40ms; }
.board-card:nth-child(3) { animation-delay: 80ms; }
.board-card:nth-child(4) { animation-delay: 120ms; }
.board-card:nth-child(5) { animation-delay: 160ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
