/* ============================================================
   TaskFlow — Main Stylesheet
   Dark mode by default, inspired by Notion/Discord/Linear
   ============================================================ */

:root {
  /* Colors */
  --bg-base:       #0f1117;
  --bg-surface:    #161b27;
  --bg-elevated:   #1e2435;
  --bg-hover:      #252d3d;
  --bg-active:     #2d3650;

  --border:        #2a3148;
  --border-light:  #3a4565;

  --text-primary:  #e8eaf0;
  --text-secondary:#8b95b0;
  --text-muted:    #5a6480;

  --accent:        #6366f1;
  --accent-hover:  #7c7ff5;
  --accent-dim:    rgba(99,102,241,0.15);

  --green:         #22c55e;
  --green-dim:     rgba(34,197,94,0.15);
  --yellow:        #f59e0b;
  --yellow-dim:    rgba(245,158,11,0.15);
  --red:           #ef4444;
  --red-dim:       rgba(239,68,68,0.15);
  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.15);
  --purple:        #a855f7;
  --purple-dim:    rgba(168,85,247,0.15);
  --orange:        #f97316;
  --orange-dim:    rgba(249,115,22,0.15);

  /* Status */
  --status-not-started-bg:  rgba(107,114,128,0.2);
  --status-not-started-fg:  #9ca3af;
  --status-in-progress-bg:  rgba(59,130,246,0.2);
  --status-in-progress-fg:  #60a5fa;
  --status-done-bg:         rgba(34,197,94,0.2);
  --status-done-fg:         #4ade80;

  /* Priority */
  --priority-low-bg:      rgba(34,197,94,0.15);
  --priority-low-fg:      #4ade80;
  --priority-medium-bg:   rgba(245,158,11,0.15);
  --priority-medium-fg:   #fbbf24;
  --priority-high-bg:     rgba(249,115,22,0.15);
  --priority-high-fg:     #fb923c;
  --priority-critical-bg: rgba(239,68,68,0.15);
  --priority-critical-fg: #f87171;

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 60px;

  /* Spacing / Radius / Shadow */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
  --transition: 0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 0 20px rgba(99,102,241,0.4);
}
.sidebar-logo span {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-nav a.active {
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition);
  cursor: pointer;
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 0.72rem; color: var(--text-muted); }
.sidebar-user .logout-btn { color: var(--text-muted); font-size: 0.85rem; }
.sidebar-user .logout-btn:hover { color: var(--red); }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
  transition: border-color var(--transition);
  min-width: 240px;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box i { color: var(--text-muted); font-size: 0.85rem; }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

.topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.topbar-icon-btn .notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  padding: 28px 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.page-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-dim); color: var(--green); border-color: rgba(34,197,94,0.3); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* ── Stats Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-not-started { background: var(--status-not-started-bg); color: var(--status-not-started-fg); }
.status-in-progress { background: var(--status-in-progress-bg); color: var(--status-in-progress-fg); }
.status-done        { background: var(--status-done-bg);        color: var(--status-done-fg); }

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

.role-admin   { background: rgba(168,85,247,0.15); color: #c084fc; }
.role-manager { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-user    { background: rgba(34,197,94,0.15);  color: #4ade80; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr { border-top: 1px solid var(--border); transition: background var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
td { padding: 12px 16px; font-size: 0.88rem; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 9px 13px;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; cursor: pointer; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.input-group {
  position: relative;
}
.input-group .form-control { padding-left: 38px; }
.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.input-group .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 2px;
}
.input-group .toggle-password:hover { color: var(--text-primary); }

.form-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.3); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

/* ── Alert / Toast ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.alert-danger   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(239,68,68,0.25); }
.alert-warning  { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(245,158,11,0.25); }
.alert-info     { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.25); }

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  min-width: 280px;
  max-width: 380px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease, fadeOut 0.3s ease 3.7s forwards;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--yellow); }
.toast.info    { border-left: 3px solid var(--accent); }
.toast i { font-size: 1rem; }
.toast.success i { color: var(--green); }
.toast.error   i { color: var(--red); }
.toast.warning i { color: var(--yellow); }
.toast.info    i { color: var(--accent); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(120%); }
}

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.kanban-column-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-header h3::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.col-not-started h3::before { background: var(--status-not-started-fg); }
.col-in-progress h3::before { background: var(--status-in-progress-fg); }
.col-done        h3::before { background: var(--status-done-fg); }
.kanban-count {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }

.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}
.task-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.task-card.drag-over { border-color: var(--accent); background: var(--accent-dim); }
.task-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.task-assignees {
  display: flex;
}
.task-assignees .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elevated);
  margin-right: -6px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.task-due {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-due.overdue { color: var(--red); }
.task-comments {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Kanban Drag placeholder ─────────────────────────────── */
.drag-placeholder {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  height: 80px;
}

/* ── Filters bar ─────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 7px 30px 7px 11px;
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  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='%238b95b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--accent); }
.filters-bar label { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.06) 0%, transparent 50%);
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
}
.auth-logo span {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.auth-card h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.auth-card .auth-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-muted); }

/* ── Notifications dropdown ──────────────────────────────── */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
}
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-dim); }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 0.85rem; font-weight: 600; }
.notif-msg { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.notif-footer { padding: 10px 16px; text-align: center; font-size: 0.82rem; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}
.tab-btn {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb i { font-size: 0.7rem; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  gap: 12px;
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 1rem; font-weight: 600; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); max-width: 280px; }

/* ── Avatar group ────────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ── Progress bar ────────────────────────────────────────── */
.progress-wrap { background: var(--bg-elevated); border-radius: 99px; overflow: hidden; height: 6px; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Checkbox custom ─────────────────────────────────────── */
.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
}
.checkbox-custom input { display: none; }
.checkbox-custom .checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.checkbox-custom input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox-custom input:checked + .checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ── Charts section ──────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}
.chart-wrap { position: relative; }
.chart-canvas { max-height: 260px; }

/* ── Activity Feed ───────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-text { font-size: 0.85rem; flex: 1; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Tag pill ────────────────────────────────────────────── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* ── Sidebar overlay on mobile ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 20px; }
  .search-box { min-width: 160px; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .modal { border-radius: var(--radius-lg); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
}

/* ── Utility ─────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.fw-600 { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-100 { width: 100%; }
.overdue-label { color: var(--red); font-size: 0.78rem; font-weight: 600; }
