/* ============================================================
   CRM DASHBOARD — Design System & Component Styles
   Modern, eye-soothing theme with soft indigo accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Root Variables ─────────────────────────────────────── */
:root {
  /* Sidebar */
  --sidebar-bg: #0f1117;
  --sidebar-bg-hover: rgba(255,255,255,.06);
  --sidebar-bg-active: rgba(108,99,255,.15);
  --sidebar-text: #8b8fa3;
  --sidebar-text-bright: #e4e6ef;
  --sidebar-text-muted: #4e5266;
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 56px;
  --sidebar-border: rgba(255,255,255,.06);
  --sidebar-accent-bar: linear-gradient(135deg, #6C63FF, #8B7CF6);

  /* Main Area */
  --main-bg: #f6f7fb;
  --main-bg-alt: #eef0f6;
  --main-bg-card: #ffffff;
  --main-border: #dfe2ec;
  --main-border-light: #eceef5;

  /* Text */
  --text-primary: #1a1d2e;
  --text-secondary: #5c6178;
  --text-muted: #9297ad;
  --text-white: #ffffff;

  /* Group Badge Colors */
  --group-orange: #f5a623;
  --group-green: #27ae60;
  --group-red: #e74c3c;
  --group-purple: #8e44ad;
  --group-blue: #3498db;
  --group-teal: #1abc9c;
  --group-pink: #e91e8a;
  --group-indigo: #6366f1;

  /* Status Colors */
  --status-todo: #8892a4;
  --status-inprogress: #5b9cf6;
  --status-review: #e8b931;
  --status-done: #5cc06a;
  --status-blocked: #e8554e;

  /* Priority Colors */
  --priority-urgent: #e8554e;
  --priority-high: #f0943a;
  --priority-normal: #5b9cf6;
  --priority-low: #8892a4;

  /* Accent */
  --accent: #6C63FF;
  --accent-hover: #5A52E0;
  --accent-light: rgba(108,99,255,.1);
  --accent-glow: rgba(108,99,255,.25);
  --cta-gradient: linear-gradient(135deg, #6C63FF 0%, #8B7CF6 100%);
  --task-btn-bg: #6C63FF;
  --task-btn-hover: #5A52E0;

  /* Shadows — soft, tinted */
  --shadow-xs: 0 1px 3px rgba(15,17,23,.04);
  --shadow-sm: 0 2px 8px rgba(15,17,23,.06);
  --shadow-md: 0 4px 16px rgba(15,17,23,.08);
  --shadow-lg: 0 8px 32px rgba(15,17,23,.12);
  --shadow-xl: 0 20px 60px rgba(15,17,23,.18);
  --shadow-accent: 0 4px 20px rgba(108,99,255,.25);
  --shadow-card: 0 1px 4px rgba(15,17,23,.05), 0 4px 16px rgba(15,17,23,.04);

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-smooth: 350ms cubic-bezier(.4,0,.2,1);
  --transition-bounce: 400ms cubic-bezier(.34,1.56,.64,1);

  /* Z-index layers */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-dropdown: 500;
  --z-modal-overlay: 300;
  --z-modal: 310;
  --z-tooltip: 600;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--main-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ── App Layout ─────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-smooth), min-width var(--transition-smooth);
  z-index: var(--z-sidebar);
  border-right: 1px solid var(--sidebar-border);
  position: relative;
}

/* subtle glow line on right edge */
.sidebar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(108,99,255,.3), transparent);
  pointer-events: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-workspace-name,
.sidebar.collapsed .sidebar-workspace-plan,
.sidebar.collapsed .sidebar-item-badge,
.sidebar.collapsed .sidebar-tree-children,
.sidebar.collapsed .sidebar-section-action {
  display: none;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 8px 0;
}

.sidebar.collapsed .sidebar-item .sidebar-icon {
  margin-right: 0;
}

/* Sidebar scrollable area */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 10px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.15);
}

/* Workspace header — glassmorphism */
.sidebar-workspace {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(12px);
  transition: background var(--transition-fast);
}
.sidebar-workspace:hover {
  background: rgba(255,255,255,.05);
}

.sidebar-workspace-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--cta-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(108,99,255,.35);
}

.sidebar-workspace-info {
  flex: 1;
  min-width: 0;
}

.sidebar-workspace-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-workspace-plan {
  font-size: 10px;
  color: var(--sidebar-text-muted);
  letter-spacing: .03em;
}

/* Sidebar sections */
.sidebar-section {
  padding: 4px 0;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--sidebar-border);
}

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

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-text-muted);
}

.sidebar-section-action {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--sidebar-text-muted);
  font-size: 14px;
  transition: all var(--transition-fast);
}
.sidebar-section-action:hover {
  background: var(--sidebar-bg-hover);
  color: var(--accent);
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
  border-radius: var(--radius-md);
  margin: 1px 8px;
  color: var(--sidebar-text);
}

.sidebar-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-bright);
}

.sidebar-item.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-bright);
}

/* Accent bar on active items */
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-accent-bar);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.sidebar-label {
  flex: 1;
  font-size: 13px;
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-badge {
  background: rgba(108,99,255,.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Sidebar tree (spaces) */
.sidebar-tree-item {
  display: flex;
  align-items: center;
  padding: 5px 16px 5px 24px;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin: 1px 8px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
}
.sidebar-tree-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-bright);
}
.sidebar-tree-item.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-bright);
}

.sidebar-tree-children {
  padding-left: 12px;
}

.sidebar-tree-toggle {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
  font-size: 9px;
  color: var(--sidebar-text-muted);
  flex-shrink: 0;
}
.sidebar-tree-toggle.expanded {
  transform: rotate(90deg);
}

.sidebar-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(0,0,0,.2);
}

/* User avatars in sidebar */
.sidebar-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5cc06a;
  border: 2px solid var(--sidebar-bg);
  position: absolute;
  bottom: 6px;
  left: 30px;
}

/* ── Main Content ───────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--main-bg);
  min-width: 0;
}

/* ── Top Bar ────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--main-border);
  flex-shrink: 0;
  background: var(--main-bg-card);
  z-index: var(--z-topbar);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  gap: 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--main-border-light);
}

.topbar-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.topbar-breadcrumb-item:hover {
  color: var(--accent);
}
.topbar-breadcrumb-item.current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-breadcrumb-sep {
  color: var(--text-muted);
  font-size: 11px;
}

/* View Tabs */
.topbar-views {
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 2px;
  overflow-x: auto;
  background: var(--main-bg-card);
}

.topbar-views::-webkit-scrollbar {
  height: 0;
}

.topbar-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-tab:hover {
  color: var(--text-primary);
  background: var(--accent-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.topbar-tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.topbar-tab-icon {
  font-size: 13px;
  opacity: .7;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  gap: 8px;
  flex-shrink: 0;
  background: var(--main-bg-card);
  border-bottom: 1px solid var(--main-border-light);
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--main-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--main-bg-card);
  transition: all var(--transition-fast);
}
.filter-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-spacer {
  flex: 1;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--main-border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--main-bg-card);
  width: 180px;
  transition: all var(--transition-fast);
}
.filter-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: #fff;
}

.filter-search input {
  border: none;
  outline: none;
  background: none;
  font-size: 12px;
  color: var(--text-primary);
  width: 100%;
}

.add-task-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  background: var(--cta-gradient);
  color: var(--text-white);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-accent);
  letter-spacing: .01em;
}
.add-task-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108,99,255,.4);
}
.add-task-cta:active {
  transform: translateY(0);
}

/* ── Content Area (scrollable) ──────────────────────────── */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding-bottom: 40px;
  background: var(--main-bg);
}

.content-area::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.content-area::-webkit-scrollbar-track {
  background: transparent;
}
.content-area::-webkit-scrollbar-thumb {
  background: var(--main-border);
  border-radius: 10px;
}
.content-area::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── List View ──────────────────────────────────────────── */
.list-view {
  min-width: 900px;
}

/* Group */
.task-group {
  margin-bottom: 2px;
}

.group-header {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--main-bg-card);
  z-index: 10;
  border-bottom: 1px solid var(--main-border-light);
  transition: background var(--transition-fast);
}
.group-header:hover {
  background: var(--main-bg);
}

.group-toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}
.group-toggle.collapsed {
  transform: rotate(-90deg);
}

.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.group-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.group-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.group-header:hover .group-actions {
  opacity: 1;
}

.group-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--transition-fast);
}
.group-action-btn:hover {
  background: var(--main-bg-alt);
  color: var(--text-primary);
}

/* Column headers */
.column-headers {
  display: flex;
  align-items: center;
  padding: 4px 24px 4px 60px;
  border-bottom: 1px solid var(--main-border-light);
  background: var(--main-bg);
  position: sticky;
  top: 43px;
  z-index: 9;
}

.col-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 8px;
  white-space: nowrap;
}

.col-name       { flex: 1; min-width: 250px; }
.col-assignee   { width: 110px; text-align: center; }
.col-duedate    { width: 110px; text-align: center; }
.col-priority   { width: 100px; text-align: center; }
.col-status     { width: 130px; text-align: center; }
.col-tags       { width: 120px; text-align: center; }
.col-created    { width: 110px; text-align: center; }

/* Task Row */
.task-row {
  display: flex;
  align-items: center;
  padding: 0 24px 0 60px;
  min-height: 40px;
  border-bottom: 1px solid var(--main-border-light);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  background: var(--main-bg-card);
}
.task-row:hover {
  background: var(--accent-light);
}

.task-row.subtask-row {
  padding-left: 84px;
  background: rgba(246,247,251,.6);
}

.task-row.subtask-row .task-name-cell::before {
  content: '↳';
  margin-right: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Task cells */
.task-cell {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.task-name-cell {
  flex: 1;
  min-width: 250px;
  justify-content: flex-start;
  gap: 8px;
}

.task-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-name-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 450;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}
.task-name-text:hover {
  color: var(--accent);
}

.task-subtask-count {
  font-size: 11px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  background: var(--accent-light);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.task-expand-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 9px;
  color: var(--text-muted);
  transition: transform var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.task-expand-btn:hover {
  background: rgba(108,99,255,.1);
  color: var(--accent);
}
.task-expand-btn.expanded {
  transform: rotate(90deg);
}

.cell-assignee  { width: 110px; }
.cell-duedate   { width: 110px; }
.cell-priority  { width: 100px; }
.cell-status    { width: 130px; }
.cell-tags      { width: 120px; }
.cell-created   { width: 110px; color: var(--text-muted); font-size: 12px; }

/* Assignee avatar */
.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 2px solid var(--main-bg-card);
  box-shadow: var(--shadow-xs);
}
.assignee-avatar:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.assignee-unassigned {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--main-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.assignee-unassigned:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Status pill — soft pastel tones */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.status-pill:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-sm);
}

.status-pill[data-status="To Do"]        { background: #eceef5; color: #5c6178; }
.status-pill[data-status="Open"]         { background: #eceef5; color: #5c6178; }
.status-pill[data-status="In Progress"]  { background: #e0edff; color: #3b7ddb; }
.status-pill[data-status="Review"]       { background: #fef3c7; color: #b8860b; }
.status-pill[data-status="Done"]         { background: #dcf5e2; color: #1c8c3e; }
.status-pill[data-status="Completed"]    { background: #dcf5e2; color: #1c8c3e; }
.status-pill[data-status="Blocked"]      { background: #fde8e8; color: #c53030; }
.status-pill[data-status="Closed"]       { background: #fde8e8; color: #c53030; }

/* Priority flag */
.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.priority-flag:hover {
  background: rgba(0,0,0,.03);
}

.priority-flag[data-priority="Urgent"]  { color: var(--priority-urgent); }
.priority-flag[data-priority="High"]    { color: var(--priority-high); }
.priority-flag[data-priority="Normal"]  { color: var(--priority-normal); }
.priority-flag[data-priority="Low"]     { color: var(--priority-low); }

.priority-flag-icon {
  font-size: 13px;
}

.priority-unset {
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.priority-unset:hover {
  color: var(--accent);
}

/* Tags */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  margin: 1px;
  white-space: nowrap;
  letter-spacing: .01em;
}

.tags-cell-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}

/* Due date */
.duedate-text {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  font-weight: 450;
}
.duedate-text:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.duedate-text.overdue {
  color: var(--priority-urgent);
  font-weight: 600;
  background: #fde8e8;
}
.duedate-unset {
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.duedate-unset:hover {
  color: var(--accent);
}

/* Add Task row */
.add-task-row {
  display: flex;
  align-items: center;
  padding: 8px 24px 8px 60px;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--main-border-light);
  background: var(--main-bg-card);
}
.add-task-row:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.add-task-row-icon {
  font-size: 14px;
}

/* Add Group */
.add-group-row {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.add-group-row:hover {
  color: var(--accent);
}

/* ── Board (Kanban) View ────────────────────────────────── */
.board-view {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  height: 100%;
  overflow-x: auto;
  align-items: flex-start;
}

.board-column {
  min-width: 290px;
  width: 290px;
  background: var(--main-bg);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  flex-shrink: 0;
  border: 1px solid var(--main-border-light);
}

.board-column-header {
  display: flex;
  align-items: center;
  padding: 16px 16px 10px;
  gap: 8px;
}

.board-column-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.board-column-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--main-border-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.board-column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-column-cards::-webkit-scrollbar {
  width: 3px;
}
.board-column-cards::-webkit-scrollbar-thumb {
  background: var(--main-border);
  border-radius: 10px;
}

.board-card {
  background: var(--main-bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--main-border-light);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  border-left: 3px solid transparent;
}
.board-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-light);
}

.board-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

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

.board-card-group {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #fff;
  letter-spacing: .02em;
}

.board-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  margin-left: auto;
  border: 2px solid var(--main-bg-card);
}

.board-card-priority {
  font-size: 11px;
}

.board-card-due {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 450;
}

.board-card-tags {
  display: flex;
  gap: 3px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.board-add-task {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.board-add-task:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,12,20,.5);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--main-bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 580px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(.95) translateY(12px);
  transition: transform var(--transition-smooth);
  border: 1px solid var(--main-border-light);
}

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

.modal::-webkit-scrollbar {
  width: 5px;
}
.modal::-webkit-scrollbar-thumb {
  background: var(--main-border);
  border-radius: 10px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--main-border-light);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: #fde8e8;
  color: var(--priority-urgent);
}

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

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--main-bg-card);
  outline: none;
  transition: all var(--transition-fast);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

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

.form-select {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--main-bg-card);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239297ad' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  transition: all var(--transition-fast);
}
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

.form-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-lg);
  min-height: 40px;
  align-items: center;
  cursor: text;
  transition: all var(--transition-fast);
}
.form-tags-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-tags-input input {
  border: none;
  outline: none;
  font-size: 13px;
  background: none;
  min-width: 80px;
  flex: 1;
  padding: 2px;
}

.form-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

.form-tag-remove {
  cursor: pointer;
  font-size: 12px;
  opacity: .7;
  transition: opacity var(--transition-fast);
}
.form-tag-remove:hover {
  opacity: 1;
}

/* Subtask section in modal */
.modal-subtasks {
  margin-top: 16px;
  border-top: 1px solid var(--main-border-light);
  padding-top: 16px;
}

.modal-subtasks-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtask-entry {
  background: var(--main-bg);
  border: 1px solid var(--main-border-light);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 8px;
  position: relative;
  transition: border-color var(--transition-fast);
}
.subtask-entry:hover {
  border-color: var(--accent);
}

.subtask-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.subtask-entry-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.subtask-remove-btn {
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}
.subtask-remove-btn:hover {
  color: var(--priority-urgent);
}

.add-subtask-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px dashed rgba(108,99,255,.3);
  border-radius: var(--radius-lg);
  width: 100%;
  justify-content: center;
  transition: all var(--transition-fast);
}
.add-subtask-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--main-border-light);
  background: var(--main-bg);
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

.btn {
  padding: 8px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  letter-spacing: .01em;
}

.btn-secondary {
  background: var(--main-bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--main-border);
}
.btn-secondary:hover {
  background: var(--main-bg-alt);
  border-color: var(--text-muted);
}

.btn-primary {
  background: var(--cta-gradient);
  color: var(--text-white);
  border: none;
}
.btn-primary:hover {
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: #fde8e8;
  color: #c53030;
  border: 1.5px solid #fecaca;
}
.btn-danger:hover {
  background: #fecaca;
  color: #991b1b;
}

/* ── Dropdown (custom, inline) ──────────────────────────── */
.dropdown-menu {
  position: absolute;
  background: var(--main-bg-card);
  border: 1px solid var(--main-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  min-width: 170px;
  padding: 4px;
  animation: dropdown-in 200ms cubic-bezier(.34,1.56,.64,1);
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 450;
}
.dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.dropdown-item.selected {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* ── Inline Edit ────────────────────────────────────────── */
.inline-edit-input {
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 2px 8px;
  font-size: 13px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
  width: 100%;
  background: var(--main-bg-card);
}

/* ── Add Group Modal ────────────────────────────────────── */
.color-picker-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-picker-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--transition-fast);
}
.color-picker-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.color-picker-swatch.selected {
  border-color: var(--text-primary);
  transform: scale(1.18);
  box-shadow: 0 0 0 3px rgba(108,99,255,.25);
}

/* ── Confirm Dialog ─────────────────────────────────────── */
.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.task-group-body {
  animation: slideDown 250ms ease;
}

/* ── Status option colors for select ────────────────────── */
.status-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Tooltip ────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-md);
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* ── Chat Page ──────────────────────────────────────────── */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--main-border);
  gap: 10px;
  flex-shrink: 0;
  background: var(--main-bg-card);
}

.chat-header-icon {
  font-size: 18px;
  color: var(--accent);
}

.chat-header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-header-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--main-bg);
}

.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--main-border); border-radius: 10px; }

.chat-date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 16px 0 8px;
  font-weight: 600;
  letter-spacing: .03em;
}

.chat-message {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast);
}
.chat-message:hover {
  background: rgba(108,99,255,.04);
}

.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-msg-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-msg-time {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-msg-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  word-break: break-word;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  gap: 10px;
  border-top: 1px solid var(--main-border);
  flex-shrink: 0;
  background: var(--main-bg-card);
}

.chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  background: var(--main-bg);
}
.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--main-bg-card);
}

.chat-send-btn {
  padding: 10px 22px;
  background: var(--cta-gradient);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-accent);
}
.chat-send-btn:hover {
  box-shadow: 0 6px 24px rgba(108,99,255,.4);
  transform: translateY(-1px);
}

/* ── Home Page ──────────────────────────────────────────── */
.home-page {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

.home-welcome {
  margin-bottom: 32px;
}

.home-welcome h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -.02em;
}

.home-welcome p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 450;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.home-stat {
  background: var(--main-bg-card);
  border: 1px solid var(--main-border-light);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.home-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.home-stat:nth-child(1)::before { background: linear-gradient(90deg, #6C63FF, #8B7CF6); }
.home-stat:nth-child(2)::before { background: linear-gradient(90deg, #5b9cf6, #7bb8f8); }
.home-stat:nth-child(3)::before { background: linear-gradient(90deg, #5cc06a, #7dd98a); }
.home-stat:nth-child(4)::before { background: linear-gradient(90deg, #e8554e, #f07e78); }

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

.home-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.home-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.home-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.home-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--main-bg-card);
  border: 1px solid var(--main-border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.home-recent-item:hover {
  background: var(--accent-light);
  border-color: rgba(108,99,255,.2);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

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

.home-recent-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.home-recent-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 450;
}

/* ── My Tasks Page ──────────────────────────────────────── */
.mytasks-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mytasks-header {
  padding: 24px 28px 14px;
  border-bottom: 1px solid var(--main-border);
  flex-shrink: 0;
  background: var(--main-bg-card);
}

.mytasks-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}

.mytasks-header p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 450;
}

.mytasks-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.mytasks-section {
  margin-bottom: 24px;
}

.mytasks-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--main-border-light);
  margin-bottom: 6px;
}

.mytask-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  border-bottom: 1px solid var(--main-border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  margin: 2px 0;
}
.mytask-row:hover {
  background: var(--accent-light);
}

.mytask-name {
  flex: 1;
  font-size: 13px;
  font-weight: 450;
  color: var(--text-primary);
}

.mytask-list {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--main-bg-alt);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* ── Status Management Modal ────────────────────────────── */
.status-manager {
  padding: 4px 0;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--main-border-light);
}

.status-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.status-color-btn:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.status-name-input {
  flex: 1;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  outline: none;
  transition: all var(--transition-fast);
}
.status-name-input:focus {
  border-color: var(--accent);
  background: var(--main-bg-card);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.status-category-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  width: 50px;
  text-align: center;
}

.status-delete-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.status-delete-btn:hover {
  color: #c53030;
  background: #fde8e8;
}

/* ── Inbox Page ─────────────────────────────────────────── */
.inbox-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}
.inbox-page .empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.inbox-page .empty-state-text { font-size: 15px; }

/* ── Auth Page ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f1117 0%, #1a1c2e 40%, #0f1117 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative gradient orbs */
.auth-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,.15), transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,124,246,.1), transparent 70%);
  bottom: -100px;
  left: -50px;
  pointer-events: none;
}

.auth-card {
  background: var(--main-bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 420px;
  max-width: 100%;
  padding: 40px;
  animation: authFadeIn 0.5s cubic-bezier(.34,1.56,.64,1);
  position: relative;
  z-index: 1;
  border: 1px solid var(--main-border-light);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--cta-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.auth-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  font-weight: 450;
}

.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
  text-transform: none;
  letter-spacing: 0;
}
.auth-form .form-input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}
.auth-form .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--cta-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
  box-shadow: var(--shadow-accent);
}
.auth-submit:hover {
  box-shadow: 0 8px 28px rgba(108,99,255,.4);
  transform: translateY(-1px);
}
.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a, .auth-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover, .auth-link:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fde8e8;
  color: #c53030;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #fecaca;
}
.auth-error.show { display: block; }

.auth-success {
  background: #dcf5e2;
  color: #1c8c3e;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #bbf7d0;
}
.auth-success.show { display: block; }

/* ── Team Page ──────────────────────────────────────────── */
.team-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 14px;
  border-bottom: 1px solid var(--main-border);
  flex-shrink: 0;
  background: var(--main-bg-card);
}

.team-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.team-header-actions {
  display: flex;
  gap: 8px;
}

.team-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--main-bg-card);
  border: 1px solid var(--main-border-light);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cta-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.team-card:hover::before {
  opacity: 1;
}

.team-card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  position: relative;
  border: 3px solid var(--main-bg-card);
  box-shadow: var(--shadow-sm);
}

.team-card-online {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5cc06a;
  border: 3px solid var(--main-bg-card);
  position: absolute;
  bottom: -2px;
  right: -2px;
}

.team-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.team-card-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
}
.team-card-role[data-role="superadmin"] { background: #fef3c7; color: #b45309; }
.team-card-role[data-role="admin"]      { background: #e0edff; color: #3b7ddb; }
.team-card-role[data-role="member"]     { background: #eceef5; color: #5c6178; }

.team-card-dept {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 450;
}

.team-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ── Profile Page ───────────────────────────────────────── */
.profile-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.profile-header {
  padding: 24px 28px 14px;
  border-bottom: 1px solid var(--main-border);
  flex-shrink: 0;
  background: var(--main-bg-card);
}

.profile-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.01em;
}

.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-content: start;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--main-bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--main-border-light);
  box-shadow: var(--shadow-card);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  position: relative;
  border: 4px solid var(--main-bg-card);
  box-shadow: var(--shadow-md);
}

.profile-avatar-upload {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: 3px solid var(--main-bg-card);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.profile-avatar-upload:hover { background: var(--accent-hover); transform: scale(1.1); }

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-role-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

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

.profile-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--main-border);
  margin-bottom: 8px;
  margin-top: 16px;
}
.profile-section-title:first-child { margin-top: 0; }

.profile-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.profile-field-label {
  width: 160px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.profile-field-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.profile-field-input {
  flex: 1;
  padding: 7px 12px;
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}
.profile-field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.profile-field-input:disabled {
  background: var(--main-bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.profile-field-lock {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Sidebar Toggle Button ──────────────────────────────── */
.sidebar-toggle-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--main-bg-alt);
  border-radius: var(--radius-md);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  margin-right: 8px;
  color: var(--text-secondary);
}
.sidebar-toggle-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Mobile Sidebar Overlay ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,20,.6);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(4px);
}

/* ── Voice Recording ────────────────────────────────────── */
.voice-recorder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--main-bg);
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-xl);
  margin-top: 8px;
}

.voice-record-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.voice-record-btn.idle {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.voice-record-btn.idle:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
}
.voice-record-btn.recording {
  background: #e8554e;
  color: #fff;
  animation: voicePulse 1.2s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,85,78,.5); }
  50% { box-shadow: 0 0 0 12px rgba(232,85,78,0); }
}

.voice-timer {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 50px;
  font-variant-numeric: tabular-nums;
}

.voice-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
}
.voice-wave-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: waveAnim 0.6s ease-in-out infinite alternate;
}
.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.4s; }
.voice-wave-bar:nth-child(6) { animation-delay: 0.15s; }
.voice-wave-bar:nth-child(7) { animation-delay: 0.25s; }
.voice-wave-bar:nth-child(8) { animation-delay: 0.35s; }

@keyframes waveAnim {
  0% { height: 4px; }
  100% { height: 24px; }
}

.voice-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fde8e8;
  color: #c53030;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}
.voice-delete-btn:hover { background: #fecaca; }

/* Voice note in task row */
.voice-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--accent-light);
  border: 1px solid rgba(108,99,255,.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.voice-note:hover {
  background: rgba(108,99,255,.18);
  transform: scale(1.04);
}
.voice-note-icon {
  font-size: 13px;
}
.voice-note-duration {
  font-variant-numeric: tabular-nums;
}
.voice-note.playing {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* Voice note in modal preview */
.voice-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--main-bg);
  border: 1.5px solid var(--main-border);
  border-radius: var(--radius-xl);
  margin-top: 8px;
}
.voice-preview audio {
  flex: 1;
  height: 32px;
}
.voice-preview-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fde8e8;
  color: #c53030;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.voice-preview-remove:hover { background: #fecaca; }

/* ── Filter Dropdown (in-page) ──────────────────────────── */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--main-bg-card);
  border: 1px solid var(--main-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  min-width: 220px;
  padding: 8px;
  animation: dropdown-in 200ms cubic-bezier(.34,1.56,.64,1);
}

.filter-dropdown-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 8px 4px;
}

.filter-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.filter-dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.filter-dropdown-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.filter-dropdown-sep {
  height: 1px;
  background: var(--main-border-light);
  margin: 4px 0;
}

/* ── Mobile Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 244px; }
  .col-tags, .col-created, .cell-tags, .cell-created { display: none; }
}

@media (max-width: 768px) {
  /* Show hamburger */
  .sidebar-toggle-btn { display: inline-flex; }

  /* Sidebar: overlay mode */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
    width: var(--sidebar-width) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }

  /* Main area takes full width */
  .app { display: flex; }
  .main { width: 100%; }

  /* Top bar */
  .topbar-breadcrumb { padding: 8px 14px; font-size: 12px; }
  .topbar-views { padding: 0 10px; gap: 0; }
  .topbar-tab { padding: 8px 8px; font-size: 11px; }
  .topbar-tab-icon { display: none; }

  /* Filter bar */
  .filter-bar { padding: 6px 14px; flex-wrap: wrap; gap: 6px; }
  .filter-search { width: 100%; order: 10; }

  /* List view */
  .list-view { min-width: unset; }
  .column-headers { display: none; }
  .task-row {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 6px;
  }
  .task-row.subtask-row { padding-left: 28px; }
  .task-name-cell { flex: 1 1 100%; min-width: unset; padding: 4px 0; }
  .cell-assignee, .cell-duedate, .cell-priority, .cell-status { width: auto; flex-shrink: 0; }
  .cell-tags, .cell-created { display: none; }
  .group-header { padding: 8px 14px; }
  .add-task-row { padding: 6px 14px; }

  /* Board view */
  .board-view {
    flex-direction: column;
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
  }
  .board-column {
    min-width: unset;
    width: 100%;
  }

  /* Modals full screen */
  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
  }

  /* Home page */
  .home-page { padding: 18px; }
  .home-welcome h1 { font-size: 20px; }
  .home-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-stat { padding: 16px; }
  .home-stat-value { font-size: 20px; }

  /* Chat */
  .chat-header { padding: 10px 14px; }
  .chat-messages { padding: 12px 14px; }
  .chat-input-bar { padding: 10px 14px; }

  /* My Tasks / Inbox */
  .mytasks-header { padding: 16px 14px 8px; }
  .mytasks-content { padding: 12px 14px; }
  .home-recent-item { padding: 10px 12px; }

  /* Team page */
  .team-header { padding: 16px 14px; flex-wrap: wrap; gap: 8px; }
  .team-content { padding: 14px; }
  .team-grid { grid-template-columns: 1fr; }

  /* Profile page */
  .profile-content { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .profile-sidebar { flex-direction: row; padding: 18px; gap: 14px; }
  .profile-avatar { width: 64px; height: 64px; font-size: 24px; }
  .profile-field { flex-direction: column; align-items: flex-start; gap: 4px; }
  .profile-field-label { width: auto; }
}

@media (max-width: 480px) {
  .home-stats { grid-template-columns: 1fr; }
  .home-stat-icon { width: 40px; height: 40px; font-size: 18px; }
  .board-card { padding: 10px; }
  .board-card-name { font-size: 12px; }
  .auth-card { padding: 24px; }
  .auth-title { font-size: 20px; }
  .form-row { flex-direction: column; }
  .modal-body { padding: 16px; }
  .chat-send-btn { padding: 10px 14px; font-size: 12px; }
  .profile-sidebar { flex-direction: column; }
  .voice-recorder { flex-wrap: wrap; }
  .voice-wave { min-width: 80px; }
  .team-header h1 { font-size: 18px; }
}
