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

/* ═══════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════ */
:root {
  /* Brand */
  --brand-primary: #1a1f36;
  --brand-accent:  #4f6ef7;
  --brand-accent2: #7c3aed;
  --brand-glow:    rgba(79,110,247,.18);

  /* Backgrounds */
  --bg-base:    #0f1117;
  --bg-surface: #161b2e;
  --bg-card:    #1c2340;
  --bg-hover:   #212847;
  --bg-input:   #141929;

  /* Text */
  --text-primary:   #eef0f8;
  --text-secondary: #8892b0;
  --text-muted:     #4a5275;
  --text-accent:    #4f6ef7;

  /* Borders */
  --border:       rgba(255,255,255,.07);
  --border-hover: rgba(79,110,247,.4);

  /* Status colors */
  --todo:       #64748b;
  --inprogress: #4f6ef7;
  --done:       #10b981;
  --onhold:     #f59e0b;

  /* Priority colors */
  --low:    #10b981;
  --medium: #f59e0b;
  --high:   #ef4444;

  /* Team colors */
  --team-1: #4f6ef7;
  --team-2: #0891b2;
  --team-3: #7c3aed;
  --team-4: #059669;

  /* Spacing */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.5);
  --glow:      0 0 30px rgba(79,110,247,.15);

  /* Sidebar */
  --sidebar-w: 240px;

  /* Transitions */
  --t: .18s ease;
  --t-slow: .35s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ═══════════════════════════════════════════
   LAYOUT — APP SHELL
═══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 34px; height: 34px;
  background: #f59e0b;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--glow);
}

.logo-text { line-height: 1.2; }
.logo-text strong { display: block; font-size: .95rem; font-weight: 600; }
.logo-text span { font-size: .7rem; color: var(--text-muted); letter-spacing: .04em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--t);
  position: relative;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--brand-glow);
  color: var(--brand-accent);
  border-color: rgba(79,110,247,.25);
}

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

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--high);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  transition: background var(--t);
  cursor: pointer;
}

.user-info:hover { background: var(--bg-hover); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.avatar.lg { width: 44px; height: 44px; font-size: .9rem; }

.user-details { flex: 1; min-width: 0; }
.user-details strong { display: block; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-details span { font-size: .7rem; color: var(--text-muted); }

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

.topbar {
  position: sticky;
  top: 0;
  background: rgba(15,17,23,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 50;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

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

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--t);
  position: relative;
}

.icon-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }

.icon-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--high);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.page-body {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  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;
}

.card-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .03em;
  text-transform: uppercase;
  font-size: .75rem;
}

/* ═══════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.todo::before    { background: var(--todo); }
.stat-card.inprog::before  { background: var(--inprogress); }
.stat-card.done::before    { background: var(--done); }
.stat-card.onhold::before  { background: var(--onhold); }
.stat-card.overdue::before { background: var(--high); }
.stat-card.total::before   { background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent2)); }

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 16px;
}

.stat-card.todo .stat-icon    { background: rgba(100,116,139,.15); }
.stat-card.inprog .stat-icon  { background: rgba(79,110,247,.15); }
.stat-card.done .stat-icon    { background: rgba(16,185,129,.15); }
.stat-card.onhold .stat-icon  { background: rgba(245,158,11,.15); }
.stat-card.overdue .stat-icon { background: rgba(239,68,68,.15); }
.stat-card.total .stat-icon   { background: rgba(79,110,247,.15); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .02em;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--t);
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--brand-accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(79,110,247,.3);
}
.btn-primary:hover {
  background: #3d5ce8;
  box-shadow: 0 0 30px rgba(79,110,247,.45);
  transform: translateY(-1px);
}

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

.btn-danger {
  background: rgba(239,68,68,.12);
  color: #ef4444;
  border-color: rgba(239,68,68,.3);
}
.btn-danger:hover { background: rgba(239,68,68,.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: .95rem; }

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }

.badge-todo    { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-inprog  { background: rgba(79,110,247,.15);  color: #7c9cf7; }
.badge-done    { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-onhold  { background: rgba(245,158,11,.15);  color: #fbbf24; }

.badge-low     { background: rgba(16,185,129,.15);  color: #34d399; }
.badge-medium  { background: rgba(245,158,11,.15);  color: #fbbf24; }
.badge-high    { background: rgba(239,68,68,.15);   color: #f87171; }

.badge-admin   { background: rgba(124,58,237,.15);  color: #a78bfa; }
.badge-employee{ background: rgba(79,110,247,.15);  color: #7c9cf7; }

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: .03em;
}

.form-label span { color: var(--high); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: .875rem;
  transition: all var(--t);
  outline: none;
  font-family: 'Sora', sans-serif;
}

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

.form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,.12);
  background: var(--bg-surface);
}

.form-control:disabled {
  opacity: .5;
  cursor: not-allowed;
}

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892b0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

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

.form-error {
  font-size: .73rem;
  color: var(--high);
  margin-top: 5px;
  display: none;
}

.form-error.visible { display: block; }

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

/* ═══════════════════════════════════════════
   TABLE
═══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

thead {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--bg-hover); }

td strong { color: var(--text-primary); font-weight: 500; }

.td-actions { display: flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform var(--t-slow);
  box-shadow: var(--shadow-lg);
}

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

.modal-lg { max-width: 680px; }

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

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all var(--t);
  line-height: 1;
}

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

.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ═══════════════════════════════════════════
   TASK CARD (Kanban)
═══════════════════════════════════════════ */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

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

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

.task-card-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

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

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.task-date {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.task-date.overdue { color: var(--high); }

/* ═══════════════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 200px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

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

.kanban-count {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   FILTERS BAR
═══════════════════════════════════════════ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px 9px 36px;
  color: var(--text-primary);
  font-size: .85rem;
  font-family: 'Sora', sans-serif;
  outline: none;
  transition: all var(--t);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 28px 9px 12px;
  color: var(--text-secondary);
  font-size: .82rem;
  font-family: 'Sora', sans-serif;
  outline: none;
  cursor: pointer;
  transition: all var(--t);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%238892b0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus { border-color: var(--brand-accent); color: var(--text-primary); }

/* ═══════════════════════════════════════════
   TEAM COLOR DOTS
═══════════════════════════════════════════ */
.team-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ═══════════════════════════════════════════
   NOTIFICATION DROPDOWN
═══════════════════════════════════════════ */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  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 {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 600;
}

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(79,110,247,.04); }

.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-item.unread .notif-dot { background: var(--brand-accent); }
.notif-item:not(.unread) .notif-dot { background: transparent; }

.notif-text { font-size: .8rem; color: var(--text-secondary); line-height: 1.5; }
.notif-text strong { color: var(--text-primary); }
.notif-time { font-size: .68rem; color: var(--text-muted); margin-top: 3px; font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: .95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: .82rem; }

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

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .83rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: slideIn .3s ease;
}

.toast.success { border-left: 3px solid var(--done); }
.toast.error   { border-left: 3px solid var(--high); }
.toast.info    { border-left: 3px solid var(--brand-accent); }
.toast.warning { border-left: 3px solid var(--onhold); }

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

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.page-header-left p {
  font-size: .83rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.tab-btn {
  padding: 9px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--t);
  position: relative;
  bottom: -1px;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   COMMENT THREAD
═══════════════════════════════════════════ */
.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child { border-bottom: none; }

.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.comment-author { font-size: .83rem; font-weight: 600; color: var(--text-primary); }
.comment-time   { font-size: .72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.comment-text   { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }

/* ═══════════════════════════════════════════
   ATTACHMENT ITEM
═══════════════════════════════════════════ */
.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--t);
}

.attachment-item:hover { border-color: var(--border-hover); }

.attachment-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(79,110,247,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.attachment-name { font-size: .83rem; font-weight: 500; color: var(--text-primary); }
.attachment-size { font-size: .72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}

.page-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.page-btn.active { background: var(--brand-accent); color: #fff; border-color: var(--brand-accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-up { animation: fadeUp .4s ease both; }

.animate-up:nth-child(1) { animation-delay: .05s; }
.animate-up:nth-child(2) { animation-delay: .1s; }
.animate-up:nth-child(3) { animation-delay: .15s; }
.animate-up:nth-child(4) { animation-delay: .2s; }
.animate-up:nth-child(5) { animation-delay: .25s; }
.animate-up:nth-child(6) { animation-delay: .3s; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

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

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    width: 240px;
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content { margin-left: 0; }

  .kanban-board { grid-template-columns: 1fr; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .form-row     { grid-template-columns: 1fr; }
  .page-body    { padding: 16px; }

  .menu-toggle { display: flex !important; }
}

.menu-toggle { display: none; }
