/* ============================================================
   TaskFlow v2.0 — Design System
   ============================================================ */

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

/* ── CSS Variables (Light Theme) ────────────────────────── */
:root {
  --bg:          #f4f6fb;
  --bg-card:     #ffffff;
  --bg-hover:    #f8f9ff;
  --bg-sidebar:  #1e1b4b;
  --border:      #e5e7eb;
  --border-focus:#4f46e5;

  --text:        #111827;
  --text-2:      #374151;
  --text-3:      #6b7280;
  --text-inv:    #ffffff;

  --primary:     #4f46e5;
  --primary-h:   #4338ca;
  --primary-l:   #ede9fe;
  --success:     #10b981;
  --success-l:   #d1fae5;
  --warning:     #f59e0b;
  --warning-l:   #fef3c7;
  --danger:      #ef4444;
  --danger-l:    #fee2e2;
  --info:        #3b82f6;
  --info-l:      #dbeafe;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.12);

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  --sidebar-w:   230px;
  --header-h:    60px;
  --transition:  .18s ease;
}

/* ── Dark Theme ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #0f172a;
  --bg-card:     #1e293b;
  --bg-hover:    #263548;
  --bg-sidebar:  #0d1117;
  --border:      #334155;
  --border-focus:#818cf8;

  --text:        #f1f5f9;
  --text-2:      #cbd5e1;
  --text-3:      #94a3b8;
  --text-inv:    #ffffff;

  --primary:     #818cf8;
  --primary-h:   #6366f1;
  --primary-l:   #1e1b4b;
  --success:     #34d399;
  --success-l:   #064e3b;
  --warning:     #fbbf24;
  --warning-l:   #451a03;
  --danger:      #f87171;
  --danger-l:    #450a0a;
  --info:        #60a5fa;
  --info-l:      #1e3a5f;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.3);
  --shadow:      0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.5);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-content { padding: 28px 28px 48px; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo-text em { font-style: normal; color: #818cf8; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #818cf8;
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}
.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.4); }

/* ── Avatar ──────────────────────────────────────────────── */
.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;
  letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  gap: 8px;
  width: 240px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.topbar-search input {
  border: none; outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-3); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm   { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg   { padding: 11px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius); justify-content: center; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body   { padding: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── Stats Cards ─────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; }

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

.column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 160px;
  transition: all var(--transition);
}
.column.drag-over {
  background: var(--primary-l);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,70,229,.2);
}
.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid;
}
.column-header-left { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-todo     .column-header { border-color: #6366f1; }
.col-todo     .col-dot       { background: #6366f1; }
.col-todo     .column-header-left { color: #6366f1; }
.col-progress .column-header { border-color: #f59e0b; }
.col-progress .col-dot       { background: #f59e0b; }
.col-progress .column-header-left { color: #f59e0b; }
.col-done     .column-header { border-color: #10b981; }
.col-done     .col-dot       { background: #10b981; }
.col-done     .column-header-left { color: #10b981; }
.col-count {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-3);
}

/* ── Task Cards ──────────────────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}
.task-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .4; transform: scale(.98); }
.task-card.blocked { border-left: 3px solid var(--danger) !important; opacity: .8; }
.task-card.priority-high   { border-left: 3px solid var(--danger); }
.task-card.priority-medium { border-left: 3px solid var(--warning); }
.task-card.priority-low    { border-left: 3px solid var(--success); }

.task-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 6px; }
.task-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; flex: 1; }
.task-title a { color: inherit; }
.task-title a:hover { color: var(--primary); text-decoration: none; }
.task-desc {
  font-size: 12px; color: var(--text-3); line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.task-actions {
  display: flex; align-items: center; gap: 5px;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: opacity var(--transition);
}
.task-card:hover .task-actions { opacity: 1; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-primary { background: var(--primary-l); color: var(--primary); }
.badge-success { background: var(--success-l); color: var(--success); }
.badge-warning { background: var(--warning-l); color: #92400e; }
.badge-danger  { background: var(--danger-l);  color: var(--danger); }
.badge-gray    { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.p-high   { background: var(--danger-l);  color: #b91c1c; }
.p-medium { background: var(--warning-l); color: #92400e; }
.p-low    { background: var(--success-l); color: #065f46; }

.due-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); font-weight: 500; }
.due-tag.overdue   { color: var(--danger); font-weight: 600; }
.due-tag.due-soon  { color: var(--warning); font-weight: 600; }
.label-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 7px; border-radius: var(--radius-full); font-weight: 500; }
.label-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Progress ────────────────────────────────────────────── */
.progress-wrap { height: 5px; background: var(--bg); border-radius: var(--radius-full); overflow: hidden; margin: 4px 0; }
.progress-bar { height: 100%; border-radius: var(--radius-full); background: var(--success); transition: width .4s ease; }
.subtask-progress { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }

/* ── Forms ───────────────────────────────────────────────── */
.form-wrap { max-width: 620px; }
.form-group { margin-bottom: 20px; }
label, .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-weight: 400; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=search],
textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { height: 100px; resize: vertical; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-group { display: flex; gap: 10px; }
.input-group input { flex: 1; }

.check-group { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.check-item {
  display: flex; align-items: flex-start; gap: 8px;
  cursor: pointer; padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.check-item:hover { background: var(--bg-hover); }
.check-item input[type=checkbox] { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; cursor: pointer; accent-color: var(--primary); }
.check-item-text { font-size: 13px; color: var(--text-2); font-weight: 400; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13.5px; display: flex; align-items: flex-start; gap: 8px; border: 1px solid transparent; }
.alert-success { background: var(--success-l); color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: var(--danger-l);  color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: var(--warning-l); color: #92400e; border-color: #fcd34d; }
.alert-info    { background: var(--info-l);    color: #1e40af; border-color: #93c5fd; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  padding: 20px;
}
.auth-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px 38px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; font-size: 26px; font-weight: 800; color: var(--primary); margin-bottom: 4px; letter-spacing: -.02em; }
.auth-sub  { text-align: center; color: var(--text-3); font-size: 14px; margin-bottom: 30px; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-3); }
.password-strength { display: flex; gap: 4px; margin-top: 6px; }
.strength-bar { height: 3px; flex: 1; border-radius: var(--radius-full); background: var(--border); transition: background .3s; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 14px; border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Comments ────────────────────────────────────────────── */
.comment-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time   { font-size: 11.5px; color: var(--text-3); }
.comment-text   { font-size: 13.5px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ── Activity Feed ───────────────────────────────────────── */
.activity-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 13px; color: var(--text-2); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); margin-top: 5px; flex-shrink: 0; }
.activity-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ── Subtask List ────────────────────────────────────────── */
.subtask-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.subtask-item:last-child { border-bottom: none; }
.subtask-item.done .subtask-title { text-decoration: line-through; color: var(--text-3); }
.subtask-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--success); flex-shrink: 0; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1a1a2e; color: #fff;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  min-width: 200px; max-width: 340px;
  opacity: 0; transform: translateY(10px);
  transition: all .3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: scale(.95); transition: transform var(--transition); }
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body  { padding: 20px 24px; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-state-icon  { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; }
.drop-placeholder { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px 20px; text-align: center; color: var(--text-3); font-size: 13px; transition: all var(--transition); }
.column.drag-over .drop-placeholder { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 8px 16px; font-size: 13.5px; font-weight: 500; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); text-decoration: none; }
.tab:hover { color: var(--primary); text-decoration: none; }
.tab.active { color: var(--primary); border-color: var(--primary); }

/* ── Color Swatches ──────────────────────────────────────── */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); }
.color-swatch:hover, .color-swatch.selected { transform: scale(1.2); border-color: var(--text); }

/* ── Attachments ─────────────────────────────────────────── */
.attachment-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; }
.attachment-icon { font-size: 20px; flex-shrink: 0; }
.attachment-name { flex: 1; font-weight: 500; color: var(--text-2); }
.attachment-size { font-size: 11px; color: var(--text-3); }

/* ── Utility ─────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4  { gap: 4px; }  .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }   .mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }  .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }  .mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-sm    { font-size: 12px; }
.text-muted { color: var(--text-3); }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-center { text-align: center; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13.5px; margin-bottom: 20px; transition: color var(--transition); }
.back-link:hover { color: var(--primary); text-decoration: none; }
.chart-wrap { position: relative; height: 200px; }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter-chip { padding: 5px 14px; border-radius: var(--radius-full); border: 1.5px solid var(--border); background: var(--bg-card); font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all var(--transition); text-decoration: none; }
.filter-chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle { width: 38px; height: 22px; background: var(--border); border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background var(--transition); border: none; }
.theme-toggle::after { content: ''; width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.theme-toggle.on { background: var(--primary); }
.theme-toggle.on::after { transform: translateX(16px); }

/* ── Hamburger ───────────────────────────────────────────── */
.hamburger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 6px; border: none; background: none; }
.hamburger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

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

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin   { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .25s ease; }
.spinner { animation: spin 1s linear infinite; display: inline-block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar     { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area   { margin-left: 0; }
  .board       { grid-template-columns: 1fr; }
  .topbar      { padding: 0 16px; }
  .page-content{ padding: 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .hamburger   { display: flex; }
}
@media (max-width: 600px) {
  .auth-card   { padding: 28px 20px; }
  .stat-grid   { grid-template-columns: 1fr 1fr; }
  .topbar-search { display: none; }
}

/* ══════════════════════════════════════════════════════════
   ADDITIONS: Detail Grid · Preview Modal · Mobile UI v2
   ══════════════════════════════════════════════════════════ */

/* ── Detail Grid ─────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* ── Attachment Thumbnail ────────────────────────────────── */
.attachment-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.attachment-item.previewable { cursor: pointer; }
.attachment-item.previewable:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

/* ── Preview Modal ───────────────────────────────────────── */
.preview-modal {
  max-width: min(92vw, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.preview-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 20px;
  background: var(--bg);
}
.preview-body img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: var(--shadow);
}
.preview-body iframe {
  width: 100%;
  height: 72vh;
  border: none;
  border-radius: var(--radius-sm);
}
.preview-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── mb-12 utility ───────────────────────────────────────── */
.mb-12 { margin-bottom: 12px; }

/* ══════════════════════════════════════════════════════════
   MOBILE UI — comprehensive overhaul
   ══════════════════════════════════════════════════════════ */

/* ── 900 px breakpoint (tablet + mobile) ────────────────── */
@media (max-width: 900px) {

  /* Layout */
  .detail-grid { grid-template-columns: 1fr; }

  /* Kanban: horizontal scroll  */
  .board {
    display: flex !important;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .column {
    min-width: min(82vw, 300px);
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Topbar */
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 15px; }

  /* Page padding (extra bottom for thumbs) */
  .page-content { padding: 14px 14px 72px; }

  /* Cards */
  .card-body   { padding: 16px; }
  .card-header { padding: 14px 16px; }
  .card-footer { padding: 12px 16px; }

  /* Stat grid */
  .stat-grid  { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-value { font-size: 22px; }
  .stat-card  { padding: 14px; gap: 10px; }

  /* Back link */
  .back-link { margin-bottom: 12px; }

  /* Filter bar */
  .filter-chip { padding: 5px 12px; font-size: 12px; }

  /* Forms */
  .form-grid-2 { grid-template-columns: 1fr; }

  /* Modals slide up from bottom */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    max-width: 100vw;
    width: 100%;
    transform: translateY(40px);
  }
  .modal-overlay.open .modal { transform: translateY(0); }

  /* Preview modal stays centered on tablet */
  .preview-modal {
    border-radius: var(--radius-lg);
    max-width: 92vw;
    margin: auto;
    transform: scale(.95);
  }
  .modal-overlay.open .preview-modal { transform: scale(1); }
}

/* ── 600 px breakpoint (phone) ──────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 14px; }

  /* Auth */
  .auth-card  { padding: 24px 18px; }
  .auth-logo  { font-size: 22px; }

  /* Topbar — hide search, shrink */
  .topbar-search  { display: none; }
  .topbar-title   { font-size: 14px; }
  .page-content   { padding: 12px 12px 80px; }

  /* Stats 2-col */
  .stat-grid  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 20px; }
  .stat-card  { padding: 12px; }
  .stat-icon  { width: 34px; height: 34px; font-size: 15px; }

  /* Tabs: horizontal scroll */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; padding: 8px 12px; font-size: 12.5px; }

  /* Buttons — larger touch target */
  .btn    { padding: 9px 16px; }
  .btn-sm { padding: 6px 12px; font-size: 11.5px; }
  .btn-lg { padding: 12px 22px; }

  /* Attachment */
  .attachment-item { padding: 8px 10px; gap: 8px; }
  .attachment-thumb { width: 40px; height: 40px; }

  /* Comment */
  .comment-item { gap: 8px; }

  /* Section title */
  .section-title { font-size: 14px; }

  /* Toast — full width at bottom */
  .toast-container { bottom: 14px; right: 10px; left: 10px; }
  .toast           { min-width: 0; max-width: 100%; }

  /* Preview modal — near full-screen */
  .preview-modal {
    max-width: 100vw;
    max-height: 96vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .preview-body { padding: 12px; }
  .preview-body img { max-height: 60vh; }
  .preview-body iframe { height: 60vh; }

  /* Kanban column label */
  .column { min-width: min(85vw, 280px); }

  /* Board section headers */
  .column-header-left { font-size: 11px; }
  .task-card { padding: 10px 12px; }
  .task-title { font-size: 13px; }

  /* Table horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }

  /* Profile 2-col swatches on smaller screen */
  .color-swatches { gap: 10px; }
  .color-swatch   { width: 30px; height: 30px; }
}

/* ── 400 px breakpoint (very small phone) ───────────────── */
@media (max-width: 400px) {
  .stat-grid  { grid-template-columns: 1fr; }
  .filter-bar { gap: 4px; }
  .filter-chip { padding: 4px 10px; font-size: 11.5px; }
  .board      { gap: 8px; }
  .column     { min-width: 88vw; }
}

/* ── Safe area (iPhone notch / Dynamic Island) ──────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  .page-content {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .toast-container {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 900px) {
  @supports (padding: env(safe-area-inset-bottom)) {
    .page-content {
      padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
  }
}

/* ══════════════════════════════════════════════════════════
   SWIMLANE BOARD — Group by Main Job
   ══════════════════════════════════════════════════════════ */

.swimlane-wrap { display: flex; flex-direction: column; gap: 20px; }

/* Work-area container */
.swimlane-area {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Area header (click to collapse) */
.swimlane-area-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  cursor: pointer; user-select: none;
}
.wa-dot  { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wa-code { font-weight: 700; font-size: 15px; }
.wa-name { color: var(--text-3); font-size: 13px; }
.sw-area-arrow { margin-left: auto; color: var(--text-3); font-size: 12px; transition: transform .2s; }

.swimlane-area.collapsed .sw-area-arrow      { transform: rotate(-90deg); }
.swimlane-area.collapsed .swimlane-area-body { display: none; }

/* Column header row */
.swimlane-col-headers {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.swimlane-label-col {
  padding: 8px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3);
  border-right: 1px solid var(--border);
}
.swimlane-col-head {
  padding: 8px 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  border-left: 1px solid var(--border);
}
.sw-head-todo { color: var(--text-3); }
.sw-head-prog { color: var(--warning); }
.sw-head-done { color: var(--success); }

/* Swimlane data rows */
.swimlane-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.swimlane-row:last-child { border-bottom: none; }

.swimlane-label {
  padding: 10px 14px;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.swimlane-job-name  { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.swimlane-job-count { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

.swimlane-cell {
  padding: 6px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
  background: var(--bg-card);
}
.sw-empty { font-size: 11px; color: var(--border); text-align: center; padding: 12px 0; }

/* Swimlane cards */
.sw-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.sw-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.sw-card-code {
  font-family: monospace; font-size: 9.5px; font-weight: 700;
  color: var(--primary); margin-bottom: 3px;
}
.sw-card-title {
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  line-height: 1.4; display: block; text-decoration: none;
}
.sw-card-title:hover { color: var(--primary); text-decoration: none; }
.sw-card-sub    { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.sw-card-avatars{ display: flex; align-items: center; margin-top: 5px; }
.sw-card-more   { font-size: 10px; color: var(--text-3); margin-left: 4px; }

/* Responsive */
@media (max-width: 900px) {
  .swimlane-col-headers,
  .swimlane-row { grid-template-columns: 140px 1fr 1fr 1fr; }
  .swimlane-label { padding: 8px 10px; }
  .swimlane-job-name { font-size: 11px; }
}
@media (max-width: 600px) {
  .swimlane-col-headers { display: none; }
  .swimlane-row {
    display: flex;
    flex-direction: column;
    border-bottom: 2px solid var(--border);
  }
  .swimlane-label {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .swimlane-cell { border-left: none; border-top: 1px solid var(--border); }
}

/* ══════════════════════════════════════════════════════════
   UI/UX ENHANCEMENTS v2.1
   ══════════════════════════════════════════════════════════ */

/* ── Mobile Bottom Navigation ───────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 60px;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .bn-icon {
  font-size: 20px;
  line-height: 1;
  transition: transform var(--transition);
}
.bottom-nav-item.active,
.bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-item.active .bn-icon { transform: scale(1.1); }

/* Center Add button */
.bottom-nav-add {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
  margin: 0 auto;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-add:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(79,70,229,.5); }

/* Bottom nav — show only on mobile (sidebar stays transform-based from original CSS) */
@media (max-width: 900px) {
  .bottom-nav      { display: block; }
  .page-content    { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Filter Drawer (mobile) ──────────────────────────────── */
.filter-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
}
.filter-drawer-overlay.open { display: block; }

.filter-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 501;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 85vh;
  overflow-y: auto;
}
.filter-drawer.open { transform: translateY(0); }

.filter-drawer-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 16px;
}
.filter-drawer-title {
  padding: 0 20px 12px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.filter-drawer-body {
  padding: 0 16px;
}
.filter-drawer-section { margin-bottom: 18px; }
.filter-drawer-section h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-bottom: 10px;
}
.filter-drawer-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.filter-drawer-chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  cursor: pointer; text-decoration: none;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.filter-drawer-chip.active {
  border-color: var(--primary);
  background: var(--primary-l);
  color: var(--primary);
}
.filter-drawer-close {
  display: block;
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}

/* Mobile filter button in toolbar */
.mobile-filter-btn {
  display: none;
  align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.mobile-filter-btn.has-filter {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-l);
}
@media (max-width: 700px) {
  .mobile-filter-btn { display: flex; }
  .filter-bar { display: none; }
}

/* ── Compact Board Mode ──────────────────────────────────── */
.board.compact .task-card { padding: 7px 10px; }
.board.compact .task-meta { display: none; }
.board.compact .subtask-progress { display: none; }
.board.compact .task-title { font-size: 12px; margin-bottom: 4px; }
.board.compact .task-actions .btn-ghost:not([onclick*="openTask"]) { display: none; }

.compact-toggle {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-3);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: all var(--transition);
  white-space: nowrap;
}
.compact-toggle.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-l);
}

/* ── Quick Add Row (bottom of each column) ───────────────── */
.quick-add-row {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.quick-add-trigger {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.quick-add-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-l);
}

/* ════════════════════════════════════════════════════════════
   NOTIFICATIONS + START DATE MODAL
   ════════════════════════════════════════════════════════════ */

/* ── Notification Bell ────────────────────────────────────── */
.notif-wrap {
  position: relative;
  flex-shrink: 0;
}
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.notif-btn:hover { background: var(--bg-hover); }
.notif-badge {
  position: absolute;
  top: 0; right: 0;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-card);
  line-height: 1;
}

/* ── Notification Panel ───────────────────────────────────── */
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 95vw;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  overflow: hidden;
  flex-direction: column;
  animation: fadeIn .15s ease;
}
.notif-panel.open {
  display: flex;
  flex-direction: column;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title { font-size: 14px; font-weight: 700; }
.notif-read-all-btn {
  font-size: 11.5px; color: var(--primary);
  background: none; border: none; cursor: pointer;
  padding: 3px 6px; border-radius: 4px;
}
.notif-read-all-btn:hover { background: var(--primary-l); }
.notif-panel-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.notif-group-header {
  padding: 8px 16px 4px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3);
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--primary-l); }
[data-theme="dark"] .notif-item.unread { background: rgba(79,70,229,.12); }
.notif-item.unread:hover { filter: brightness(1.03); }
.notif-item-main { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.notif-item-msg   { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time  { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-empty  { text-align: center; padding: 28px 20px; color: var(--text-3); font-size: 13px; }
.notif-loading{ text-align: center; padding: 20px; color: var(--text-3); font-size: 13px; }
.notif-clear-btn {
  font-size: 11.5px; color: var(--text-3);
  background: none; border: none; cursor: pointer;
  padding: 3px 6px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.notif-clear-btn:hover { color: #ef4444; background: #ef444418; }

/* ── Notification backdrop (mobile only) ─────────────────────── */
.notif-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1199;
  background: rgba(0,0,0,.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.notif-backdrop.open { display: block; animation: fadeIn .2s ease; }

/* ── Drag handle pill (mobile) ──────────────────────────────── */
.notif-drag-handle {
  display: none;
  width: 40px; height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 10px auto 6px;
  flex-shrink: 0;
  cursor: grab;
  transition: background .15s;
}
.notif-drag-handle:active { cursor: grabbing; background: var(--text-3); }

/* ── Notif close button (mobile) ─────────────────────────────── */
.notif-close-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: none; border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.notif-close-btn:hover { background: var(--bg-hover); }

/* Scroll lock when notif panel is open on mobile */
body.notif-open { overflow: hidden; }

/* Mobile: notif panel full-width bottom sheet */
@media (max-width: 600px) {
  .notif-panel {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 75vh;
    visibility: visible !important;
    transition: transform .32s cubic-bezier(.32,0,.17,1), visibility 0s linear 0s !important;
  }
  .notif-drag-handle { display: block; }
  .notif-close-btn   { display: flex !important; }
  .notif-panel-header { padding-top: 6px; }
}

/* ── Progress bar on Kanban in_progress cards ─────────────── */
.task-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}
.task-progress-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.task-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width .4s ease;
}
.task-progress-bar-fill.done-fill { background: var(--success); }
.quick-add-form {
  display: none;
  flex-direction: column;
  gap: 6px;
}
.quick-add-form.open { display: flex; }
.quick-add-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
}
.quick-add-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.quick-add-btns { display: flex; gap: 6px; }
.quick-add-btns .btn { font-size: 12px; padding: 5px 12px; }

/* ── Status Quick-Change Badge ───────────────────────────── */
.status-picker {
  position: relative;
  display: inline-block;
}
.status-picker-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 999;
  min-width: 130px;
  overflow: hidden;
}
.status-picker-menu.open { display: block; }
.status-picker-item {
  display: block;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.status-picker-item:hover { background: var(--bg-hover); }
.status-picker-item.current { font-weight: 600; color: var(--primary); }

/* ── Git Save Modal ──────────────────────────────────────── */
.git-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 4000;
  align-items: center; justify-content: center;
}
.git-modal-overlay.open { display: flex; }
.git-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 420px;
  max-width: 96vw;
  box-shadow: var(--shadow-lg);
  animation: tmIn .15s ease;
}
.git-modal h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.git-modal p { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.git-modal input[type=text] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  margin-bottom: 16px;
}
.git-modal input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.git-modal .git-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}
.git-modal .git-result.ok   { background: var(--success-l); color: #065f46; }
.git-modal .git-result.fail { background: var(--danger-l);  color: #7f1d1d; }

/* Task modal — full screen on mobile */
@media (max-width: 700px) {
  #taskModalBox {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }
}
