/* === Typography === */
body, .ProseMirror, input, button, select, textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.014em; font-weight: 600; }

/* === Palette: Teal / Cyan brand — super WOW === */
:root {
  /* Brand — Primary #14B8A6 · Dark #0F766E · Accent #06B6D4 */
  --app-accent: #14B8A6;
  --app-accent-hover: #0F766E;
  --app-accent-soft: rgba(20, 184, 166, 0.10);
  --app-accent-strong: rgba(20, 184, 166, 0.18);
  --app-accent2: #06B6D4;
  --app-accent2-soft: rgba(6, 182, 212, 0.10);
  /* Deeper gradient for legible white CTA text — teal-600 → cyan-700 */
  --app-gradient: linear-gradient(135deg, #0d9488 0%, #0e7490 100%);
  --app-gradient-hover: linear-gradient(135deg, #0f766e 0%, #155e75 100%);

  /* Surfaces — soft, paper-like */
  --app-bg: #F8FAFC;
  --app-surface: #ffffff;
  --app-surface-alt: #f1f5f9;
  --app-surface-raised: #ffffff;
  --app-surface-soft: #f8fafc;

  /* Lines — hairline */
  --app-border: #e2e8f0;
  --app-border-strong: #cbd5e1;
  --app-border-soft: #eef2f6;

  /* Text — Text #0F172A */
  --app-text: #0F172A;
  --app-text-strong: #020617;
  --app-muted: #64748b;
  --app-muted-strong: #475569;

  /* Status accents */
  --app-success: #10b981;
  --app-warning: #f59e0b;
  --app-danger:  #ef4444;
  --app-info:    #06B6D4;

  /* Sidebar — LIGHT slate (Notion-soft) */
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-text-strong: #0F172A;
  --sidebar-hover: #f1f5f9;
  --sidebar-active-bg: rgba(20, 184, 166, 0.10);
  --sidebar-active-text: #0F766E;
  --sidebar-border: #e2e8f0;
  --sidebar-width: 256px;

  /* Layout — generous radii for the soft vibe */
  --navbar-height: 60px;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Soft, low-elevation shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 6px 18px rgba(13, 148, 136, 0.28);

  /* Bootstrap overrides */
  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--app-text);
  --bs-body-color-rgb: 15, 23, 42;
  --bs-primary: #14B8A6;
  --bs-primary-rgb: 20, 184, 166;
}

[data-bs-theme="dark"] {
  --app-accent: #2dd4bf;
  --app-accent-hover: #5eead4;
  --app-accent-soft: rgba(45, 212, 191, 0.16);
  --app-accent-strong: rgba(45, 212, 191, 0.28);
  --app-accent2: #22d3ee;
  --app-accent2-soft: rgba(34, 211, 238, 0.14);
  /* Same deeper gradient family — looks great on dark surfaces too */
  --app-gradient: linear-gradient(135deg, #0F766E 0%, #0E7490 100%);
  --app-gradient-hover: linear-gradient(135deg, #115e59 0%, #155e75 100%);

  /* Neutral charcoal — no blue tint */
  --app-bg: #0e1013;
  --app-surface: #16181c;
  --app-surface-alt: #1c1f24;
  --app-surface-raised: #1f2229;
  --app-surface-soft: #131519;

  --app-border: #262a31;
  --app-border-strong: #353a44;
  --app-border-soft: #1e2127;

  /* Brighter text for legibility */
  --app-text: #f1f5f9;
  --app-text-strong: #ffffff;
  --app-muted: #a1a7b3;
  --app-muted-strong: #d3d7df;

  /* Sidebar — darker than bg so it reads as a panel */
  --sidebar-bg: #0a0c0f;
  --sidebar-text: #a1a7b3;
  --sidebar-text-strong: #ffffff;
  --sidebar-hover: #1c1f24;
  --sidebar-active-bg: rgba(45, 212, 191, 0.16);
  --sidebar-active-text: #2dd4bf;
  --sidebar-border: #262a31;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.50), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.60), 0 2px 8px rgba(0, 0, 0, 0.40);
  --shadow-glow: 0 6px 20px rgba(15, 118, 110, 0.45);

  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--app-text);
  --bs-body-color-rgb: 241, 245, 249;
  --bs-primary: #2dd4bf;
  --bs-primary-rgb: 45, 212, 191;
}

/* === Global === */
body {
  min-height: 100vh;
}

.btn-primary {
  --bs-btn-bg: var(--app-accent);
  --bs-btn-border-color: var(--app-accent);
  --bs-btn-hover-bg: var(--app-accent-hover);
  --bs-btn-hover-border-color: var(--app-accent-hover);
}

/* === Auth Layout === */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-alt);
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}

.auth-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.theme-toggle-float {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1050;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
  transition: transform .2s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-brand:hover { color: #fff; }

.sidebar-close { color: var(--sidebar-text); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: .75rem 0;
}

.sidebar-section { padding: 0 .75rem; }

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .25rem .5rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sidebar-text);
  opacity: .7;
}

.sidebar-add {
  color: var(--sidebar-text);
  padding: .125rem .25rem;
  line-height: 1;
}
.sidebar-add:hover { color: #fff; }

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: .25rem 0 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s, color .15s;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
}

.sidebar-empty {
  padding: .45rem .75rem;
  font-size: .8rem;
  opacity: .5;
  font-style: italic;
}

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

.project-dot-lg {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-block;
}

.project-card {
  transition: border-color .15s, box-shadow .15s;
  border: 1px solid var(--app-border);
}

.project-card:hover {
  border-color: var(--app-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
  display: none;
}

/* === Main Content Area === */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* === Navbar === */
.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

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

.nav-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  color: var(--app-muted);
}

.nav-icon-btn:hover {
  color: var(--bs-body-color);
  background: var(--app-surface-alt);
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: .25rem .5rem;
  color: var(--bs-body-color);
}

/* === Avatars === */
.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--app-accent);
  color: #fff;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.avatar-md {
  width: 40px;
  height: 40px;
}

.avatar-stack {
  display: flex;
}

.avatar-stack > * {
  margin-left: -8px;
  border: 2px solid var(--app-surface);
}

.avatar-stack > *:first-child {
  margin-left: 0;
}

/* === Status pill === */
.status-pill {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  white-space: nowrap;
}

/* === Priority badges === */
/* priority-* solid fills — overridden by .badge[class*="priority-"] in redesign layer */

/* === Kanban === */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 400px;
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  background: var(--app-surface-alt);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem;
  border-bottom: 1px solid var(--app-border);
}

.kanban-cards {
  padding: .5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 50px;
}

.kanban-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 6px;
  padding: .6rem .75rem;
  cursor: grab;
  transition: box-shadow .15s;
}

.kanban-ghost {
  opacity: .4;
}

.kanban-drag {
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.kanban-card-title {
  font-size: .875rem;
  font-weight: 500;
  color: var(--bs-body-color);
}

/* === Task table === */
.task-table th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--app-muted);
  border-bottom-width: 1px;
}

/* === Responsive === */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar.show ~ .sidebar-overlay {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
}

/* === Scrollbar (dark mode) === */
[data-bs-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--app-surface);
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--app-border);
  border-radius: 4px;
}

/* ---------- Comments ---------- */
.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--app-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.comment-item {
  border-bottom: 1px solid var(--app-border);
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-body .mention {
  background: rgba(79, 70, 229, 0.12);
  color: var(--app-accent);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 500;
}
[data-bs-theme="dark"] .comment-body .mention {
  background: rgba(77, 171, 247, 0.2);
}

/* ---------- Notification bell ---------- */
.notification-bell {
  position: relative;
}
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}
.notification-dropdown {
  width: 360px;
  max-height: 480px;
  overflow-y: auto;
}
.notification-item {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
  display: block;
  color: inherit;
  text-decoration: none;
}
.notification-item:hover {
  background: var(--app-border);
}
.notification-item.unread {
  background: rgba(79, 70, 229, 0.06);
}
.notification-item.unread::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--app-accent);
  margin-right: 6px;
  vertical-align: middle;
}
[data-bs-theme="dark"] .notification-item.unread {
  background: rgba(77, 171, 247, 0.08);
}

/* ---------- Sidebar sublinks ---------- */
.sidebar-sublinks {
  display: none;
  flex-direction: column;
  padding-left: 1.85rem;
  padding-bottom: 0.4rem;
}
.sidebar-list li.sidebar-project-active > .sidebar-sublinks,
.sidebar-list li.sidebar-project-expanded > .sidebar-sublinks {
  display: flex;
}
.sidebar-expand {
  background: none;
  border: none;
  color: var(--app-muted);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 4px;
  font-size: 0.7rem;
  transition: transform 120ms, color 80ms;
  flex-shrink: 0;
}
.sidebar-expand:hover { color: var(--app-text); background: var(--sidebar-hover); }
.sidebar-project-active > .sidebar-project-row .sidebar-expand,
.sidebar-project-expanded > .sidebar-project-row .sidebar-expand {
  transform: rotate(90deg);
}
.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem;
  color: var(--app-muted);
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.sidebar-sublink:hover {
  background: var(--sidebar-hover);
  color: var(--app-accent);
}
.sidebar-sublink i { font-size: 0.85rem; opacity: 0.85; }

/* ---------- Doc card (list) ---------- */
.doc-card {
  transition: border-color 120ms, transform 120ms;
  border-color: var(--app-border);
}
.doc-card:hover {
  border-color: var(--app-accent);
  transform: translateY(-1px);
}
.doc-card h6 { color: var(--bs-body-color); }

/* ---------- Doc editor page ---------- */
.doc-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem;
}
.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bs-body-bg);
}
.doc-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.doc-title-input {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--bs-body-color);
  outline: none;
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.doc-title-input:focus { background: var(--app-border); }
.doc-status {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--app-border);
}
.doc-peers {
  display: flex;
  gap: -4px;
}
.doc-peer {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: -6px;
  border: 2px solid var(--bs-body-bg);
}
.doc-editor-wrap {
  padding: 2rem 0 4rem;
}
#editor {
  outline: none;
}
#editor .ProseMirror {
  outline: none;
  min-height: 320px;
  line-height: 1.6;
  color: var(--bs-body-color);
}
#editor .ProseMirror > * + * { margin-top: 0.6em; }
#editor .ProseMirror h1 { font-size: 2rem; font-weight: 700; margin-top: 1.2em; }
#editor .ProseMirror h2 { font-size: 1.5rem; font-weight: 700; margin-top: 1.1em; }
#editor .ProseMirror h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1em; }
#editor .ProseMirror p { margin: 0; }
#editor .ProseMirror ul, #editor .ProseMirror ol { padding-left: 1.4rem; }
#editor .ProseMirror blockquote {
  border-left: 3px solid var(--app-accent);
  padding-left: 0.9rem;
  color: var(--app-muted);
  font-style: italic;
  margin: 0.6em 0;
}
#editor .ProseMirror code {
  background: var(--app-border);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
#editor .ProseMirror pre {
  background: var(--app-border);
  color: var(--bs-body-color);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.88rem;
}
#editor .ProseMirror pre code {
  background: transparent;
  padding: 0;
}
#editor .ProseMirror hr {
  border: none;
  border-top: 1px solid var(--app-border);
  margin: 1.5em 0;
}
#editor .ProseMirror ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}
#editor .ProseMirror ul[data-type="taskList"] li {
  display: flex;
  align-items: start;
  gap: 0.5rem;
}
#editor .ProseMirror ul[data-type="taskList"] li > label {
  user-select: none;
  padding-top: 2px;
}
#editor .ProseMirror ul[data-type="taskList"] li > div { flex: 1; }
#editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--app-muted);
  pointer-events: none;
  height: 0;
}
#editor .ProseMirror h1.is-empty::before,
#editor .ProseMirror h2.is-empty::before,
#editor .ProseMirror h3.is-empty::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--app-muted);
  pointer-events: none;
  height: 0;
}

/* Task mention chip */
.task-mention {
  background: rgba(79, 70, 229, 0.12);
  color: var(--app-accent) !important;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.task-mention:hover {
  background: rgba(79, 70, 229, 0.22);
  text-decoration: none;
}
[data-bs-theme="dark"] .task-mention {
  background: rgba(77, 171, 247, 0.18);
}

/* Remote cursor (CollaborationCursor) */
.collaboration-cursor__caret {
  border-left: 1px solid;
  border-right: 1px solid;
  margin-left: -1px;
  margin-right: -1px;
  pointer-events: none;
  position: relative;
  word-break: normal;
}
.collaboration-cursor__label {
  position: absolute;
  top: -1.4em;
  left: -1px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  padding: 2px 5px;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
}

/* Slash and mention menus */
.slash-menu, .mention-menu {
  position: fixed;
  z-index: 1000;
  min-width: 240px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bs-body-bg);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 4px;
}
.slash-menu-item, .mention-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: none;
  border: none;
  color: var(--bs-body-color);
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88rem;
}
.slash-menu-item:hover, .mention-menu-item:hover,
.slash-menu-item.selected, .mention-menu-item.selected {
  background: var(--app-accent);
  color: #fff;
}
.slash-menu-item i { font-size: 1rem; width: 18px; text-align: center; }
.slash-menu-empty, .mention-menu-empty {
  padding: 0.8rem;
  color: var(--app-muted);
  font-size: 0.85rem;
  text-align: center;
}
.mention-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mention-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-status {
  font-size: 0.72rem;
  background: rgba(255,255,255,0.15);
  padding: 1px 6px;
  border-radius: 3px;
}
.slash-menu-item:not(.selected):hover .mention-status,
.mention-menu-item:not(.selected):hover .mention-status {
  background: rgba(255,255,255,0.2);
}

/* ---------- Task indicators ---------- */
.task-indicators {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--app-muted);
  vertical-align: middle;
}
.task-indicators i { font-size: 0.78rem; }
.kanban-card-indicators {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--app-muted);
}
.kanban-card-indicators span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* ---------- Row drag handle ---------- */
.drag-row-handle {
  cursor: grab;
  color: var(--app-muted);
  margin-right: 0.4rem;
  opacity: 0;
  transition: opacity 80ms;
  font-size: 0.95rem;
}
tr:hover .drag-row-handle { opacity: 1; }
tr.sortable-chosen .drag-row-handle { cursor: grabbing; opacity: 1; }
tr.sortable-ghost { opacity: 0.4; background: var(--app-border); }

/* ---------- Phase / Milestone chips ---------- */
.phase-chip, .milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.phase-chip i, .milestone-chip i { font-size: 0.7rem; }

/* ---------- Inline editors (task list) ---------- */
.cell-inline {
  border-radius: 4px;
  transition: background-color 80ms;
}
.cell-inline:hover {
  background: var(--app-border);
}
.cell-input {
  width: 100% !important;
  min-width: 80px;
}
.inline-popover {
  position: fixed;
  z-index: 1050;
  min-width: 200px;
  max-width: 320px;
  background: var(--bs-body-bg);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 4px;
}
.inline-popover-list {
  max-height: 280px;
  overflow-y: auto;
}
.inline-popover-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: none;
  border: none;
  color: var(--bs-body-color);
  border-radius: 4px;
  font-size: 0.88rem;
  text-align: left;
  margin: 0;
}
.inline-popover-item:hover, .inline-popover-item.selected {
  background: var(--app-border);
}
.inline-popover-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.5rem;
  border-top: 1px solid var(--app-border);
  margin-top: 4px;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.priority-dot.priority-urgent { background: #ef4444; }
.priority-dot.priority-high   { background: #f97316; }
.priority-dot.priority-normal { background: #6b7280; }
.priority-dot.priority-low    { background: #94a3b8; }

/* ---------- Quick-add row ---------- */
.quick-add-row {
  border-top: 2px dashed var(--app-border);
}
.quick-add-row td {
  padding: 0.4rem 0.6rem;
  background: var(--bs-body-bg);
}
#quick-add-input {
  background: transparent;
}
#quick-add-input:focus {
  background: var(--app-border);
}

/* ---------- Kanban quick-add ---------- */
.kanban-quick-add {
  padding: 0.5rem 0;
}
.kanban-quick-add-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--app-border);
  color: var(--app-muted);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.kanban-quick-add-btn:hover {
  background: var(--app-border);
  color: var(--app-accent);
  border-color: var(--app-accent);
}
.kanban-quick-add-input {
  width: 100%;
}

/* ---------- Board quick-add ---------- */
.board-quick-add-btn {
  width: 100%;
  border: 2px dashed var(--app-border);
  background: transparent;
  color: var(--app-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.board-quick-add-btn:hover {
  border-color: var(--app-accent);
  color: var(--app-accent);
}

/* ---------- Global search ---------- */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--app-border);
  border: 1px solid transparent;
  color: var(--app-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  min-width: 180px;
  text-align: left;
  cursor: text;
}
.nav-search-btn:hover {
  border-color: var(--app-accent);
  color: var(--bs-body-color);
}
@media (max-width: 768px) {
  .nav-search-btn { min-width: 0; }
}

.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  opacity: 0;
  transition: opacity 180ms;
}
.search-modal.show { opacity: 1; }

.search-modal-card {
  width: min(640px, 92vw);
  background: var(--bs-body-bg);
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.35);
  overflow: hidden;
  border: 1px solid var(--app-border);
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-border);
}
.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--bs-body-color);
  font-size: 1rem;
}
.search-modal-results {
  max-height: 60vh;
  overflow-y: auto;
}
.search-section { padding: 0.4rem 0; }
.search-section-title {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--app-muted);
  padding: 0.4rem 1rem 0.25rem;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  color: var(--bs-body-color);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.search-result-item:hover {
  background: var(--app-border);
  border-left-color: var(--app-accent);
  color: var(--bs-body-color);
}
.search-result-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { white-space: nowrap; }

/* ---------- Task drawer ---------- */
.task-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  z-index: 1040;
  opacity: 0;
  transition: opacity 200ms ease;
}
.task-drawer-backdrop.show { opacity: 1; }

.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(70vw, 100%);
  background: var(--bs-body-bg);
  border-left: 1px solid var(--app-border);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms ease;
  box-shadow: -8px 0 24px rgba(0,0,0,0.18);
}
.task-drawer.show { transform: translateX(0); }

.task-drawer-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--app-border);
}

.task-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.task-drawer-body .col-lg-8 { width: 100%; max-width: 100%; flex: 0 0 100%; }
.task-drawer-body .col-lg-4 { width: 100%; max-width: 100%; flex: 0 0 100%; margin-top: 1rem; }

@media (max-width: 768px) {
  .task-drawer { width: 100%; }
}

/* ---------- Floating toast ---------- */
.toast-floating {
  position: fixed;
  top: 80px;
  right: 24px;
  min-width: 240px;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: opacity 300ms;
}
.toast-floating:not(.show) { opacity: 0; }

/* ---------- Sidebar project kebab ---------- */
.sidebar-list li {
  position: relative;
}
.sidebar-project-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.sidebar-project-row .sidebar-link {
  flex: 1;
  min-width: 0;
}
.sidebar-kebab {
  background: none;
  border: none;
  color: var(--app-muted);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 120ms, background-color 120ms;
}
.sidebar-list li:hover .sidebar-kebab,
.sidebar-kebab.show,
.sidebar-kebab:focus {
  opacity: 1;
}
.sidebar-kebab:hover {
  background: var(--app-border);
  color: var(--app-accent);
}

/* ===========================================================
   ========= TASKS360 — SUPER WOW REDESIGN LAYER =============
   Palette: Primary #14B8A6 · Dark #0F766E · Accent #06B6D4
   Background #F8FAFC · Text #0F172A
   =========================================================== */

html, body { background: var(--app-bg); color: var(--app-text); }
::selection { background: var(--app-accent-strong); color: var(--app-text-strong); }

/* ---- Scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: var(--app-border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--app-border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--app-muted); background-clip: padding-box; }

/* ========== SIDEBAR ========== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  width: var(--sidebar-width);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--sidebar-text-strong);
  font-weight: 700; font-size: 1rem; text-decoration: none;
  letter-spacing: -0.02em;
}
.sidebar-brand i {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--app-gradient);
  color: #fff; border-radius: 8px; font-size: 1rem;
  box-shadow: 0 2px 8px rgba(20,184,166,0.35);
}
.sidebar-nav { padding: 0.75rem 0.6rem; flex: 1; overflow-y: auto; }
.sidebar-section { padding: 0.2rem 0; }
.sidebar-section.mt-auto { margin-top: auto; padding-top: 0.5rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.7rem 0.35rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  font-size: 0.62rem; font-weight: 600; color: var(--app-muted);
}
.sidebar-add {
  background: transparent; border: none; color: var(--sidebar-text);
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 100ms, color 100ms;
}
.sidebar-add:hover { background: var(--sidebar-hover); color: var(--app-accent); }

.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list > li { padding: 1px 0; }

.sidebar-link {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.42rem 0.7rem;
  color: var(--sidebar-text);
  font-size: 0.88rem; font-weight: 450;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 100ms, color 100ms;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.sidebar-link.active,
.sidebar-link[aria-current="page"] {
  background: rgba(20,184,166,0.12);
  color: var(--app-accent);
  font-weight: 500;
}

.project-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.project-dot-lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* Sidebar sublinks: hidden by default, shown for active/expanded */
.sidebar-sublinks {
  display: none; flex-direction: column; gap: 1px;
  padding-left: 1.9rem; padding-bottom: 0.35rem;
}
.sidebar-list li.sidebar-project-active > .sidebar-sublinks,
.sidebar-list li.sidebar-project-expanded > .sidebar-sublinks { display: flex; }
.sidebar-sublink {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.22rem 0.55rem;
  color: var(--sidebar-text); font-size: 0.78rem;
  text-decoration: none; border-radius: var(--radius-sm);
  transition: background 80ms, color 80ms;
}
.sidebar-sublink:hover { background: var(--sidebar-hover); color: var(--app-accent); }
.sidebar-sublink i { font-size: 0.82rem; opacity: 0.8; }

.sidebar-expand {
  background: none; border: none; color: var(--sidebar-text);
  width: 20px; height: 20px; display: inline-flex; align-items: center;
  justify-content: center; padding: 0; border-radius: 4px;
  font-size: 0.68rem; transition: transform 120ms, color 80ms;
  flex-shrink: 0; opacity: 0;
}
.sidebar-expand:hover { color: var(--app-accent); background: var(--sidebar-hover); }
.sidebar-list li:hover .sidebar-expand,
.sidebar-project-active .sidebar-expand,
.sidebar-project-expanded .sidebar-expand { opacity: 1; }
.sidebar-project-active > .sidebar-project-row .sidebar-expand,
.sidebar-project-expanded > .sidebar-project-row .sidebar-expand { transform: rotate(90deg); }

/* Active project highlight */
.sidebar-list li.sidebar-project-active > .sidebar-project-row > .sidebar-link {
  color: var(--sidebar-text-strong); font-weight: 500;
}

.sidebar-empty { color: var(--app-muted); font-size: 0.82rem; padding: 0.5rem 0.75rem; }

.sidebar-kebab {
  background: transparent; border: none; color: var(--sidebar-text);
  padding: 2px 5px; border-radius: var(--radius-sm);
  opacity: 0; transition: opacity 100ms, background 100ms;
}
.sidebar-list li:hover .sidebar-kebab,
.sidebar-kebab.show, .sidebar-kebab:focus { opacity: 1; }
.sidebar-kebab:hover { background: var(--sidebar-hover); color: var(--app-accent); }

/* Main content offset */
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; }
@media (max-width: 991.98px) { .main-content { margin-left: 0; } }

/* ========== TOP NAVBAR ========== */
.app-navbar {
  height: var(--navbar-height);
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 100;
}
[data-bs-theme="dark"] .app-navbar {
  background: rgba(12, 16, 23, 0.78);
}
.page-title {
  font-size: 0.95rem; font-weight: 600; color: var(--app-text-strong);
  letter-spacing: -0.01em;
}
.nav-icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--app-muted); border-radius: var(--radius-md);
  transition: all 120ms;
}
.nav-icon-btn:hover {
  background: var(--app-surface-alt); border-color: var(--app-border);
  color: var(--app-text);
}
.nav-user-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md); color: var(--app-text);
  transition: all 100ms;
}
.nav-user-btn:hover { background: var(--app-surface-alt); border-color: var(--app-border); }

/* Search pill */
.nav-search-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--app-surface-alt); border: 1px solid var(--app-border);
  color: var(--app-muted); padding: 0.34rem 0.75rem;
  border-radius: var(--radius-md); font-size: 0.85rem;
  min-width: 200px; text-align: left; cursor: text;
  transition: border-color 120ms, box-shadow 120ms;
}
.nav-search-btn:hover {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
  color: var(--app-text);
}

/* ========== AVATARS ========== */
.avatar-xs {
  width: 24px; height: 24px; font-size: 0.7rem; font-weight: 600;
  background: var(--app-gradient); color: #fff;
  border: 1.5px solid var(--app-bg);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.avatar-stack { display: inline-flex; }
.avatar-stack > * + * { margin-left: -8px; }
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--app-gradient); color: #fff;
  font-size: 0.85rem; font-weight: 600; flex-shrink: 0;
}

/* ========== CARDS ========== */
.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms, box-shadow 150ms;
}
.card-body { padding: 1.15rem 1.2rem; }
.card-title { font-size: 0.92rem; font-weight: 600; color: var(--app-text-strong); margin-bottom: 0.8rem; }

/* ========== TABLES ========== */
.table {
  --bs-table-bg: transparent;
  color: var(--app-text);
  border-color: var(--app-border);
}
.table > :not(caption) > * > * {
  background: transparent; color: var(--app-text);
  border-bottom-color: var(--app-border);
}
.table thead th {
  background: var(--app-surface-alt) !important;
  color: var(--app-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.68rem; border-bottom: 1px solid var(--app-border);
  padding: 0.65rem 0.75rem; white-space: nowrap;
}
.table tbody tr { transition: background 80ms; }
.table td { padding: 0.65rem 0.75rem; font-size: 0.88rem; vertical-align: middle; }

.task-table {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}
.task-table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.task-table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }

/* ========== BUTTONS ========== */
.btn {
  font-weight: 500; font-size: 0.88rem;
  border-radius: var(--radius-md);
  padding: 0.42rem 0.9rem;
  transition: all 120ms;
  letter-spacing: 0;
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn:active { transform: translateY(0.5px); }

.btn-primary {
  background: var(--app-gradient);
  border: none; color: #fff;
  box-shadow: 0 2px 10px rgba(20,184,166,0.3);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--app-accent-hover); border-color: var(--app-accent-hover);
  color: #fff; box-shadow: 0 4px 16px rgba(20,184,166,0.35);
}
.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--app-accent-soft), 0 2px 10px rgba(20,184,166,0.3);
}
.btn-outline-secondary {
  border-color: var(--app-border); color: var(--app-text); background: var(--app-surface);
}
.btn-outline-secondary:hover {
  background: var(--app-surface-alt); border-color: var(--app-border-strong); color: var(--app-text);
}
.btn-outline-secondary.active,
.btn-outline-secondary:active {
  background: var(--app-accent-soft) !important; border-color: var(--app-accent) !important;
  color: var(--app-accent) !important;
}
.btn-outline-danger { border-color: var(--app-border); color: var(--app-danger); background: var(--app-surface); }
.btn-outline-danger:hover { background: rgba(239,68,68,0.08); border-color: var(--app-danger); color: var(--app-danger); }
.btn-outline-primary { border-color: var(--app-border); color: var(--app-accent); background: var(--app-surface); }
.btn-outline-primary:hover { background: var(--app-accent-soft); border-color: var(--app-accent); }
.btn-link { color: var(--app-accent); }
.btn-link:hover { color: var(--app-accent-hover); }
.btn-group-sm > .btn.active { background: var(--app-accent-soft); border-color: var(--app-accent); color: var(--app-accent); }

/* ========== FORMS ========== */
.form-control, .form-select {
  background: var(--app-surface); border: 1px solid var(--app-border);
  color: var(--app-text); border-radius: var(--radius-md);
  font-size: 0.88rem; transition: border-color 120ms, box-shadow 120ms;
}
.form-control:focus, .form-select:focus {
  background: var(--app-surface); color: var(--app-text);
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
}
.form-control::placeholder { color: var(--app-muted); }
.form-control-sm, .form-select-sm { font-size: 0.82rem; padding: 0.34rem 0.6rem; }
.form-label { font-size: 0.78rem; font-weight: 500; color: var(--app-muted-strong); margin-bottom: 0.3rem; }
.form-check-input { border-color: var(--app-border-strong); }
.form-check-input:checked { background-color: var(--app-accent); border-color: var(--app-accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--app-accent-soft); border-color: var(--app-accent); }

/* ========== STATUS PILL ========== */
.status-pill {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px; color: #fff;
  letter-spacing: 0.01em; white-space: nowrap;
}

/* ========== PRIORITY ========== */
.badge[class*="priority-"] {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  font-weight: 500; font-size: 0.72rem;
  border-radius: 999px; letter-spacing: 0.01em;
}
.badge.priority-urgent { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge.priority-high   { background: rgba(249,115,22,0.12); color: #ea580c; }
.badge.priority-normal { background: rgba(100,116,139,0.12); color: var(--app-muted-strong); }
.badge.priority-low    { background: rgba(148,163,184,0.10); color: #94a3b8; }
[data-bs-theme="dark"] .badge.priority-urgent { color: #f87171; }
[data-bs-theme="dark"] .badge.priority-high   { color: #fb923c; }
[data-bs-theme="dark"] .badge.priority-normal { color: #cbd5e1; }
[data-bs-theme="dark"] .badge.priority-low    { color: #94a3b8; }

.badge.rounded-pill { font-weight: 500; padding: 0.2rem 0.6rem; }

/* ========== TABS ========== */
.nav-tabs { border-bottom: 1px solid var(--app-border); gap: 0.2rem; }
.nav-tabs .nav-link {
  border: none; color: var(--app-muted); font-size: 0.88rem;
  font-weight: 500; padding: 0.6rem 0.95rem; border-radius: 0;
  border-bottom: 2px solid transparent;
  transition: color 100ms, border-color 100ms;
}
.nav-tabs .nav-link:hover { color: var(--app-text); }
.nav-tabs .nav-link.active {
  color: var(--app-accent); background: transparent;
  border-bottom-color: var(--app-accent);
}

/* ========== DROPDOWNS ========== */
.dropdown-menu {
  background: var(--app-surface-raised, var(--app-surface));
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 0.35rem; font-size: 0.88rem;
  animation: dropFade 120ms ease-out;
}
@keyframes dropFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item {
  color: var(--app-text); padding: 0.42rem 0.75rem; border-radius: var(--radius-sm);
  transition: background 80ms;
}
.dropdown-item:hover, .dropdown-item:focus { background: var(--app-surface-alt); color: var(--app-text-strong); }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.08); color: var(--app-danger); }
.dropdown-item.text-warning:hover { background: rgba(245,158,11,0.08); color: var(--app-warning); }
.dropdown-divider { border-top-color: var(--app-border); margin: 0.3rem 0; }

/* ========== ALERTS ========== */
.alert { border-radius: var(--radius-md); border: 1px solid; padding: 0.65rem 0.95rem; font-size: 0.88rem; }
.alert-success { background: rgba(16,185,129,0.08); color: var(--app-success); border-color: rgba(16,185,129,0.2); }
.alert-danger  { background: rgba(239,68,68,0.08);  color: var(--app-danger);  border-color: rgba(239,68,68,0.2); }
.alert-warning { background: rgba(245,158,11,0.08); color: var(--app-warning); border-color: rgba(245,158,11,0.2); }
.alert-info    { background: rgba(6,182,212,0.08);  color: var(--app-info);    border-color: rgba(6,182,212,0.2); }

/* ========== TASK DRAWER ========== */
.task-drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 1040; opacity: 0; transition: opacity 200ms; }
.task-drawer-backdrop.show { opacity: 1; }
.task-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(72vw, 100%);
  background: var(--app-bg); border-left: 1px solid var(--app-border);
  z-index: 1050; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -20px 0 50px rgba(15,23,42,0.18);
}
.task-drawer.show { transform: translateX(0); }
.task-drawer-header {
  display: flex; align-items: center; padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--app-border); flex-shrink: 0;
}
.task-drawer-body { flex: 1; overflow-y: auto; padding: 0; }
.task-drawer-body .task-detail { height: 100%; }
.task-drawer-body .task-detail-columns { height: 100%; }
.task-drawer-body .task-detail-main { padding: 1.5rem 1.75rem 2rem; }
.task-drawer-body .task-detail-chat { padding: 0; }
@media (max-width: 768px) { .task-drawer { width: 100%; } }

/* ========== SEARCH MODAL ========== */
.search-modal {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px); z-index: 2000;
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh; opacity: 0; transition: opacity 150ms;
}
.search-modal.show { opacity: 1; }
.search-modal-card {
  width: min(640px, 92vw);
  background: var(--app-surface-raised, var(--app-surface));
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-lg); border-radius: var(--radius-lg);
  overflow: hidden;
  animation: dropFade 150ms ease-out;
}
.search-modal-input-wrap { display: flex; align-items: center; gap: 0.65rem; padding: 0.95rem 1.15rem; border-bottom: 1px solid var(--app-border); }
.search-modal-input { flex: 1; border: none; outline: none; background: transparent; color: var(--bs-body-color); font-size: 1.05rem; }
.search-modal-results { max-height: 60vh; overflow-y: auto; }
.search-section { padding: 0.4rem 0; }
.search-section-title { text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.06em; color: var(--app-muted); padding: 0.4rem 1.1rem 0.25rem; font-weight: 600; }
.search-result-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 1.1rem; color: var(--app-text); text-decoration: none;
  border-left: 2px solid transparent; transition: all 80ms;
}
.search-result-item:hover { background: var(--app-accent-soft); border-left-color: var(--app-accent); color: var(--app-text); }
.search-result-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { white-space: nowrap; font-size: 0.78rem; }

/* ========== NOTIFICATIONS ========== */
.notification-badge { background: var(--app-danger); border: 2px solid var(--app-bg); font-size: 0.6rem; padding: 1px 5px; border-radius: 999px; color: #fff; }
.notification-dropdown { background: var(--app-surface-raised, var(--app-surface)); border: 1px solid var(--app-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 0; width: 380px; }
.notification-item:hover { background: var(--app-surface-alt); }
.notification-item.unread { background: var(--app-accent-soft); }

/* ========== TOAST ========== */
.toast-floating {
  position: fixed; top: 80px; right: 24px; min-width: 260px; z-index: 2000;
  padding: 0.7rem 1rem; font-size: 0.88rem; font-weight: 500;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: opacity 300ms;
  background: var(--app-text-strong); color: var(--app-bg);
  border: 1px solid var(--app-text-strong);
}
[data-bs-theme="dark"] .toast-floating { background: var(--app-surface-raised); color: var(--app-text-strong); border-color: var(--app-border-strong); }
.toast-floating:not(.show) { opacity: 0; }
.alert-success.toast-floating { background: var(--app-success); border-color: var(--app-success); color: #fff; }
.alert-danger.toast-floating  { background: var(--app-danger);  border-color: var(--app-danger);  color: #fff; }

/* ========== INLINE POPOVERS ========== */
.inline-popover {
  position: fixed; z-index: 1050; min-width: 200px; max-width: 320px;
  background: var(--app-surface-raised, var(--app-surface));
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 4px;
  animation: dropFade 100ms ease-out;
}
.inline-popover-list { max-height: 280px; overflow-y: auto; }
.inline-popover-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.42rem 0.65rem; background: none; border: none;
  color: var(--app-text); border-radius: var(--radius-sm); font-size: 0.88rem;
  text-align: left; margin: 0; transition: background 80ms;
}
.inline-popover-item:hover, .inline-popover-item.selected { background: var(--app-accent-soft); color: var(--app-accent); }
.inline-popover-footer { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.5rem; border-top: 1px solid var(--app-border); margin-top: 4px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-dot.priority-urgent { background: #ef4444; }
.priority-dot.priority-high   { background: #f97316; }
.priority-dot.priority-normal { background: #64748b; }
.priority-dot.priority-low    { background: #94a3b8; }

/* ========== CELL INLINE EDITING ========== */
.cell-inline { border-radius: var(--radius-sm); transition: background 80ms; cursor: pointer; }
.cell-inline:hover { background: var(--app-accent-soft); }
.cell-input { width: 100% !important; min-width: 80px; }

/* ========== QUICK-ADD ROWS ========== */
.quick-add-row { border-top: 1px dashed var(--app-border) !important; }
.quick-add-row td { background: var(--app-surface-alt); padding: 0.55rem 0.75rem; }
#quick-add-input { background: transparent; }
#quick-add-input:focus { background: var(--app-surface) !important; }
tr.group-quick-add td { background: transparent !important; border-bottom: 1px solid var(--app-border); }
.group-quick-input { font-size: 0.82rem; }
.group-quick-input::placeholder { color: var(--app-muted); }
.group-quick-input:focus { background: var(--app-surface-alt) !important; }

/* ========== KANBAN ========== */
.kanban-board { display: flex; gap: 0.9rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-column {
  background: var(--app-surface-alt); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); width: 290px; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.kanban-column-header {
  padding: 0.75rem 0.9rem 0.55rem;
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--app-border);
}
.kanban-cards { padding: 0.5rem; min-height: 60px; flex: 1; }
.kanban-card {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-md); padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem; box-shadow: var(--shadow-sm);
  cursor: grab; transition: all 120ms;
}
.kanban-card:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--app-accent-soft);
  transform: translateY(-1px);
}
.kanban-card:active { cursor: grabbing; transform: scale(0.99); }
.kanban-card-title { font-size: 0.88rem; font-weight: 500; color: var(--app-text); line-height: 1.35; }

.kanban-quick-add { padding: 0.5rem; }
.kanban-quick-add-btn {
  width: 100%; background: transparent; border: 1px dashed var(--app-border);
  color: var(--app-muted); border-radius: var(--radius-sm);
  padding: 0.5rem; font-size: 0.82rem; cursor: pointer;
  transition: all 120ms;
}
.kanban-quick-add-btn:hover { background: var(--app-accent-soft); color: var(--app-accent); border-color: var(--app-accent); }

/* ========== DOC CARDS ========== */
.doc-card { background: var(--app-surface); transition: all 150ms; }
.doc-card:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--app-accent-soft);
  transform: translateY(-1px);
}
.doc-card h6 { color: var(--bs-body-color); }

/* ========== GROUPING ========== */
tr.group-header { background: var(--app-surface-alt); }
tr.group-header td {
  padding: 0.6rem 0.85rem !important; font-size: 0.76rem; font-weight: 600;
  color: var(--app-text); letter-spacing: 0.01em;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-alt) !important;
}
.group-toggle {
  background: transparent; border: none; color: var(--app-muted);
  width: 22px; height: 22px; display: inline-flex; align-items: center;
  justify-content: center; margin-right: 0.35rem; padding: 0; border-radius: 4px;
  vertical-align: middle; transition: background 80ms;
}
.group-toggle:hover { background: var(--app-border); color: var(--app-text); }
.group-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.5rem; vertical-align: middle; }
.group-dot-empty { background: var(--app-border-strong); }
.group-label { color: var(--app-text-strong); }
.group-count {
  display: inline-block; padding: 0.05rem 0.45rem; margin-left: 0.5rem;
  background: var(--app-border); color: var(--app-muted); border-radius: 999px;
  font-size: 0.68rem; font-weight: 500;
}
tr.group-collapsed { display: none !important; }

/* ========== DRAG HANDLE ========== */
.drag-row-handle {
  cursor: grab; color: var(--app-muted); margin-right: 0.4rem;
  opacity: 0; transition: opacity 80ms; font-size: 0.95rem;
}
tr:hover .drag-row-handle { opacity: 1; }
tr.sortable-chosen .drag-row-handle { cursor: grabbing; opacity: 1; }
tr.sortable-ghost { opacity: 0.4; background: var(--app-accent-soft); }

/* ========== SORTABLE HEADERS ========== */
.th-sortable { user-select: none; cursor: pointer; transition: color 80ms; }
.th-sortable:hover { color: var(--app-text); }
.th-sortable.th-sorted { color: var(--app-accent); }
.sort-icon { font-size: 0.75rem; }
.title-edit-input { max-width: 100%; }

/* ========== TASK INDICATORS ========== */
.task-indicators { display: inline-flex; gap: 0.5rem; margin-left: 0.5rem; font-size: 0.72rem; color: var(--app-muted); vertical-align: middle; }
.task-indicators i { font-size: 0.78rem; }
.kanban-card-indicators { display: flex; gap: 0.6rem; margin-top: 0.35rem; font-size: 0.7rem; color: var(--app-muted); }
.kanban-card-indicators span { display: inline-flex; align-items: center; gap: 0.2rem; }

/* ========== PHASE/MILESTONE CHIPS ========== */
.phase-chip, .milestone-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
.phase-chip i, .milestone-chip i { font-size: 0.7rem; }

/* ========== MISC OVERRIDES ========== */
h3.mb-0, h4.mb-0, h5.mb-0 { color: var(--app-text-strong); }
.bg-body-secondary { background-color: var(--app-surface-alt) !important; }
.text-body-secondary { color: var(--app-muted) !important; }
.text-muted { color: var(--app-muted) !important; }

/* Bulk bar */
.bulk-bar > div {
  background: var(--app-surface-raised, var(--app-surface)) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 0.6rem 0.85rem !important;
}

/* Auth body */
.auth-body {
  background:
    radial-gradient(900px 500px at 75% -15%, rgba(20,184,166,0.12) 0%, transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(6,182,212,0.08) 0%, transparent 60%),
    var(--app-bg);
}
.auth-card {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 2rem 2.25rem; width: min(420px, 100%);
}

/* Sidebar project row */
.sidebar-project-row { display: flex; align-items: center; gap: 0.25rem; }
.sidebar-project-row .sidebar-link { flex: 1; min-width: 0; }

/* ========== CHIP SELECT ========== */
.chip-select { position: relative; display: flex; align-items: flex-start; gap: 0.35rem; }
.chip-select-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1; min-height: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
  background: var(--app-accent-soft); color: var(--app-accent);
  border: 1px solid color-mix(in srgb, var(--app-accent) 20%, transparent);
  white-space: nowrap; line-height: 1.3;
}
.chip-remove { background: none; border: none; color: inherit; font-size: 0.9rem; line-height: 1; padding: 0; margin-left: 0.1rem; cursor: pointer; opacity: 0.6; }
.chip-remove:hover { opacity: 1; }
.chip-select-add {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px dashed var(--app-border-strong); background: transparent;
  color: var(--app-muted); font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all 100ms;
}
.chip-select-add:hover { background: var(--app-accent-soft); color: var(--app-accent); border-color: var(--app-accent); }
.chip-select-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  margin-top: 0.3rem;
  background: var(--app-surface-raised, var(--app-surface));
  border: 1px solid var(--app-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 0.3rem;
  max-height: 220px; overflow-y: auto;
}
.chip-select-search {
  width: 100%; border: 1px solid var(--app-border);
  background: var(--app-surface); color: var(--app-text);
  border-radius: var(--radius-sm); padding: 0.35rem 0.55rem;
  font-size: 0.82rem; margin-bottom: 0.3rem; outline: none;
}
.chip-select-search:focus { border-color: var(--app-accent); box-shadow: 0 0 0 2px var(--app-accent-soft); }
.chip-select-option {
  padding: 0.38rem 0.55rem; font-size: 0.82rem; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--app-text); transition: background 80ms;
}
.chip-select-option:hover { background: var(--app-accent-soft); color: var(--app-accent); }
.chip-select-option.chip-option-selected { opacity: 0.4; pointer-events: none; }
.chip-create-option { color: var(--app-accent); font-weight: 500; }
.task-field-wide { grid-column: 1 / -1; }

/* ========== TASK DETAIL (2-col) ========== */
.task-detail-columns { display: flex; gap: 0; height: 100%; }
.task-detail-main { flex: 1; overflow-y: auto; padding-right: 1.25rem; border-right: 1px solid var(--app-border); }
.task-detail-chat { width: 340px; min-width: 280px; display: flex; flex-direction: column; padding-left: 1.25rem; }
@media (max-width: 900px) {
  .task-detail-columns { flex-direction: column; }
  .task-detail-main { border-right: none; padding-right: 0; border-bottom: 1px solid var(--app-border); padding-bottom: 1.5rem; }
  .task-detail-chat { width: 100%; padding-left: 0; padding-top: 1rem; }
}
.task-detail-title {
  border: none; background: transparent; font-size: 1.4rem; font-weight: 700;
  color: var(--app-text-strong); outline: none; width: 100%;
  padding: 0.25rem 0; margin-bottom: 0.5rem; letter-spacing: -0.015em;
}
.task-detail-title:focus { background: var(--app-surface-alt); border-radius: var(--radius-sm); padding: 0.25rem 0.5rem; }
.task-detail-desc {
  border: 1px solid transparent; background: transparent; color: var(--app-text);
  width: 100%; resize: vertical; padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem;
}
.task-detail-desc:focus { background: var(--app-surface-alt); border-color: var(--app-border); outline: none; }
.task-detail-desc::placeholder { color: var(--app-muted); }
.task-detail-header { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.task-detail-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem 1rem; margin-bottom: 1rem; }
.task-field { display: flex; flex-direction: column; gap: 0.2rem; }
.task-field label {
  font-size: 0.7rem; font-weight: 600; color: var(--app-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.3rem;
}
.task-field label i { font-size: 0.76rem; }
.task-section-title { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-muted); margin-bottom: 0.5rem; }
.task-detail-section { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--app-border); }
.task-detail-actions { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--app-border); }
.task-detail-meta {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin-top: 1.5rem; padding-top: 0.75rem;
  border-top: 1px solid var(--app-border);
  font-size: 0.7rem; color: var(--app-muted);
}

/* ========== CHAT COMMENTS ========== */
.chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--app-border); flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-bubble {
  max-width: 95%; background: var(--app-surface-alt); border: 1px solid var(--app-border);
  border-radius: var(--radius-lg); padding: 0.55rem 0.75rem; font-size: 0.88rem;
}
.chat-bubble.chat-own { align-self: flex-end; background: var(--app-accent-soft); border-color: color-mix(in srgb, var(--app-accent) 20%, transparent); }
.chat-bubble-header { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.25rem; }
.chat-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600;
  background: var(--app-gradient); color: #fff; flex-shrink: 0;
}
.chat-bubble-body { font-size: 0.85rem; line-height: 1.45; color: var(--app-text); }
.chat-composer {
  display: flex; align-items: flex-end; gap: 0.5rem;
  padding: 0.75rem 1rem; border-top: 1px solid var(--app-border); flex-shrink: 0;
}
.chat-composer textarea {
  flex: 1; border: 1px solid var(--app-border);
  background: var(--app-surface); color: var(--app-text);
  border-radius: var(--radius-md); padding: 0.5rem 0.7rem;
  font-size: 0.85rem; resize: none; line-height: 1.4; outline: none;
}
.chat-composer textarea:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--app-accent-soft); }
.chat-send-btn {
  width: 36px; height: 36px; border: none;
  background: var(--app-gradient); color: #fff; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.9rem; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(20,184,166,0.3);
  transition: all 100ms;
}
.chat-send-btn:hover { box-shadow: 0 4px 14px rgba(20,184,166,0.4); transform: scale(1.05); }
.chat-send-btn:active { transform: scale(0.92); }

/* ========== FLATPICKR DARK ========== */
[data-bs-theme="dark"] .flatpickr-calendar { background: var(--app-surface-raised); border-color: var(--app-border); box-shadow: var(--shadow-lg); }
[data-bs-theme="dark"] .flatpickr-months .flatpickr-month,
[data-bs-theme="dark"] .flatpickr-weekdays,
[data-bs-theme="dark"] span.flatpickr-weekday { background: var(--app-surface-raised); color: var(--app-muted); }
[data-bs-theme="dark"] .flatpickr-day { color: var(--app-text); }
[data-bs-theme="dark"] .flatpickr-day:hover { background: var(--app-surface-alt); border-color: var(--app-border); }
[data-bs-theme="dark"] .flatpickr-day.selected { background: var(--app-accent); border-color: var(--app-accent); }
[data-bs-theme="dark"] .flatpickr-current-month input.cur-year,
[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months { color: var(--app-text); }
[data-bs-theme="dark"] .flatpickr-months .flatpickr-prev-month,
[data-bs-theme="dark"] .flatpickr-months .flatpickr-next-month { fill: var(--app-muted); }

/* ========== BOOTSTRAP PRIMARY → TEAL ========== */
.text-primary { color: var(--app-accent) !important; }
.bg-primary   { background-color: var(--app-accent) !important; }
.border-primary { border-color: var(--app-accent) !important; }
.bg-primary-subtle { background-color: var(--app-accent-soft) !important; }
.text-info { color: var(--app-accent2, var(--app-accent)) !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 575.98px) {
  .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
  .task-table { border-radius: 0; }
  .task-detail-fields { grid-template-columns: 1fr; }
  .nav-search-btn { min-width: 0; }
  .nav-search-btn span { display: none; }

  /* Task drawer fills the screen, no border/shadow */
  .task-drawer {
    width: 100% !important;
    max-width: 100% !important;
    border-left: none;
    box-shadow: none;
  }

  /* The whole table becomes a block stack — using grid/flex on a <tr> while
     it's still a table-row makes the row shrink to its intrinsic content
     width, so we strip table-layout entirely on mobile. */
  .task-table,
  .task-table > tbody {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }
  .task-table > thead { display: none; }
  .task-table > tbody > tr {
    display: block;
    width: 100%;
  }

  /* Group header + quick-add row — single full-width bar */
  .task-table > tbody > tr.group-header,
  .task-table > tbody > tr.group-quick-add,
  .task-table > tbody > tr#quick-add-row {
    padding: 0;
  }
  .task-table > tbody > tr.group-header > td,
  .task-table > tbody > tr.group-quick-add > td,
  .task-table > tbody > tr#quick-add-row > td {
    display: block;
    width: 100%;
    padding: 0.7rem 0.85rem !important;
    border-bottom: 1px solid var(--app-border);
  }

  /* Task row — grid: row 1 = checkbox + title, rows 2+ = everything else */
  .task-table > tbody > tr[data-task-id] {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.6rem;
    row-gap: 0.35rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--app-border);
  }
  .task-table > tbody > tr[data-task-id] > td {
    display: block;
    padding: 0;
    border: none;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    width: auto;
    max-width: 100%;
  }
  .task-table > tbody > tr[data-task-id] > td[data-col="check"] {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .task-table > tbody > tr[data-task-id] > td.cell-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding-left: 0 !important;
    font-weight: 600;
  }
  .task-table > tbody > tr[data-task-id] > td.cell-title .task-title-link {
    white-space: normal;
    word-break: break-word;
  }
  .task-table > tbody > tr[data-task-id] > td:not([data-col="check"]):not(.cell-title) {
    grid-column: 1 / -1;
    padding-left: 2.25rem;
  }
  /* Cells with only the muted "—" placeholder are noise on mobile */
  .task-table > tbody > tr[data-task-id] > td:has(> .text-muted:only-child) {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .kanban-board { gap: 0.5rem; }
  .kanban-column { width: 260px; min-width: 240px; }
}
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%); position: fixed; z-index: 1060;
    height: 100vh; top: 0; transition: transform 250ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.45);
    z-index: 1055; opacity: 0; pointer-events: none; transition: opacity 250ms;
  }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
}

/* ============================================================
   ============== SOFT NOTION FINAL OVERRIDE LAYER ============
   Last in file — wins via source order.
   Vibe: Asana/Notion soft · light sidebar · pill chips/buttons
   · 16-20px card radii · low elevation · generous whitespace
   · teal→cyan gradient on brand mark + primary CTA only
   ============================================================ */

body { font-feature-settings: 'cv02','cv03','cv04','cv11', 'ss01'; }

/* Wider main content gutters for breathing room */
main.container-fluid { padding: 1.25rem 1.75rem !important; max-width: 1480px; }
@media (max-width: 991.98px) { main.container-fluid { padding: 1rem 1rem !important; } }

/* ===== Light sidebar (override the dark variant) ===== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}
.sidebar-header { border-bottom: 1px solid var(--sidebar-border); padding: 0 1.1rem; }
.sidebar-brand { color: var(--sidebar-text-strong); }
.sidebar-brand i {
  width: 30px; height: 30px;
  background: var(--app-gradient);
  color: #fff;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(20,184,166,0.30);
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-section-header { color: var(--app-muted); font-weight: 600; }
.sidebar-link {
  color: var(--sidebar-text);
  font-weight: 500;
  border-radius: 10px;
  padding: 0.42rem 0.7rem;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
}
.sidebar-link.active, .sidebar-link[aria-current="page"] {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.sidebar-sublinks { padding-left: 1.95rem; padding-bottom: 0.4rem; }
.sidebar-sublink {
  color: var(--app-muted);
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
}
.sidebar-sublink:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active-text);
}
.sidebar-add, .sidebar-kebab, .sidebar-expand {
  color: var(--app-muted);
}
.sidebar-add:hover, .sidebar-kebab:hover, .sidebar-expand:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active-text);
}
.project-dot {
  width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
}

/* ===== Top navbar — softer, frosted ===== */
.app-navbar {
  height: var(--navbar-height);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--app-border);
  padding: 0 1.5rem;
}
[data-bs-theme="dark"] .app-navbar { background: rgba(12, 16, 23, 0.78); }
.page-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--app-text-strong); }
.nav-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--app-muted);
}
.nav-icon-btn:hover {
  background: var(--app-surface-alt);
  color: var(--app-text);
  border-color: var(--app-border);
}
.nav-search-btn {
  background: var(--app-surface-alt);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  color: var(--app-muted);
  font-weight: 500;
  min-width: 220px;
  transition: border-color 120ms, background-color 120ms;
}
.nav-search-btn:hover {
  border-color: var(--app-accent);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 0 0 4px var(--app-accent-soft);
}
.nav-user-btn {
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border: 1px solid transparent;
  font-weight: 500;
}
.nav-user-btn:hover { background: var(--app-surface-alt); border-color: var(--app-border); }

/* ===== Cards — paper-like, low elevation ===== */
.card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.card:hover { border-color: var(--app-border-strong); }
.card-body { padding: 1.15rem 1.25rem; }
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--app-text-strong); margin-bottom: 0.85rem; }

/* ===== Tables — softer, more whitespace ===== */
.table { color: var(--app-text); }
.table > :not(caption) > * > * {
  background: transparent;
  color: var(--app-text);
  border-bottom-color: var(--app-border-soft);
}
.table thead th {
  background: var(--app-surface-soft) !important;
  color: var(--app-muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--app-border) !important;
  padding: 0.7rem 0.85rem;
  white-space: nowrap;
}
.table tbody tr { transition: background-color 100ms; }
.table td { padding: 0.7rem 0.85rem; font-size: 0.875rem; vertical-align: middle; }

/* List task table wraps in a card */
.task-table {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.task-table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.task-table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }

/* ===== Buttons — pill-shaped (Notion-soft) ===== */
.btn {
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-pill);
  padding: 0.42rem 1rem;
  transition: background-color 120ms, border-color 120ms, color 120ms, box-shadow 120ms, transform 80ms;
  letter-spacing: 0;
  border-width: 1px;
}
.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}
.btn-lg { padding: 0.55rem 1.4rem; font-size: 0.95rem; }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--app-accent-soft); }

.btn-primary {
  background: var(--app-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--app-gradient);
  border-color: transparent;
  color: #fff;
  filter: brightness(0.96);
  box-shadow: var(--shadow-glow), var(--shadow-sm);
}
.btn-primary:disabled, .btn-primary.disabled {
  background: var(--app-accent);
  opacity: 0.6;
  box-shadow: none;
}

.btn-outline-secondary {
  border-color: var(--app-border);
  color: var(--app-text);
  background: var(--app-surface);
}
.btn-outline-secondary:hover {
  background: var(--app-surface-alt);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}
.btn-outline-primary {
  border-color: var(--app-accent);
  color: var(--app-accent-hover);
  background: var(--app-surface);
}
.btn-outline-primary:hover {
  background: var(--app-accent-soft);
  border-color: var(--app-accent);
  color: var(--app-accent-hover);
}
.btn-outline-danger { border-color: var(--app-border); color: var(--app-danger); background: var(--app-surface); }
.btn-outline-danger:hover { background: rgba(239,68,68,0.08); border-color: var(--app-danger); color: var(--app-danger); }
.btn-link { color: var(--app-accent-hover); text-decoration: none; }
.btn-link:hover { color: var(--app-accent); }

/* Icon-only btn-sm should be square-ish but pill */
.btn-sm:has(> i:only-child) { padding: 0.35rem 0.55rem; }

.btn-group .btn { border-radius: 999px; }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ===== Forms — softer, focus halo in teal ===== */
.form-control, .form-select {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  padding: 0.42rem 0.75rem;
  transition: border-color 120ms, box-shadow 120ms;
}
.form-control:hover, .form-select:hover { border-color: var(--app-border-strong); }
.form-control:focus, .form-select:focus {
  background: var(--app-surface);
  color: var(--app-text);
  border-color: var(--app-accent);
  box-shadow: 0 0 0 4px var(--app-accent-soft);
}
.form-control::placeholder { color: var(--app-muted); }
.form-control-sm, .form-select-sm { font-size: 0.82rem; padding: 0.32rem 0.6rem; border-radius: var(--radius-xs); }
.form-label { font-size: 0.78rem; font-weight: 500; color: var(--app-muted-strong); margin-bottom: 0.35rem; }
.form-check-input { border-color: var(--app-border-strong); border-radius: 4px; }
.form-check-input:checked { background-color: var(--app-accent); border-color: var(--app-accent); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--app-accent-soft); border-color: var(--app-accent); }
.form-check-input[type=checkbox] { border-radius: 5px; }
.form-switch .form-check-input { border-radius: 999px; }

/* ===== Status pills, priority chips, tag chips — fully pill ===== */
.status-pill {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  color: #fff;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset;
}
.badge[class*="priority-"] {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  font-weight: 600; font-size: 0.72rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
}
.badge.priority-urgent { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge.priority-high   { background: rgba(245,158,11,0.14); color: #d97706; }
.badge.priority-normal { background: rgba(100,116,139,0.14); color: var(--app-muted-strong); }
.badge.priority-low    { background: rgba(148,163,184,0.16); color: #64748b; }
[data-bs-theme="dark"] .badge.priority-urgent { color: #fca5a5; }
[data-bs-theme="dark"] .badge.priority-high   { color: #fcd34d; }
[data-bs-theme="dark"] .badge.priority-normal { color: #cbd5e1; }
[data-bs-theme="dark"] .badge.priority-low    { color: #94a3b8; }

.badge.rounded-pill {
  font-weight: 500;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
}

/* ===== Avatars — deterministic soft pastel from initial ===== */
/* Each user gets a consistent pastel based on name hash (set by JS or via
   inline style). Falls back to teal-soft. */
.avatar-xs, .avatar-sm, .avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
  background: var(--av-bg, var(--app-accent-soft));
  color: var(--av-color, var(--app-accent-hover));
  border: 1.5px solid var(--app-bg);
}
.avatar-xs { width: 26px; height: 26px; font-size: 0.72rem; border-radius: 999px; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.82rem; border-radius: 999px; }
.avatar-circle { width: 36px; height: 36px; font-size: 0.92rem; border-radius: 999px; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > * + * { margin-left: -8px; }

/* Avatar palette classes — deterministic via JS based on initial */
.av-1 { --av-bg: rgba(20,184,166,0.14); --av-color: #0F766E; }   /* teal */
.av-2 { --av-bg: rgba(6,182,212,0.14);  --av-color: #0E7490; }   /* cyan */
.av-3 { --av-bg: rgba(99,102,241,0.14); --av-color: #4338CA; }   /* indigo */
.av-4 { --av-bg: rgba(168,85,247,0.14); --av-color: #7E22CE; }   /* purple */
.av-5 { --av-bg: rgba(236,72,153,0.14); --av-color: #BE185D; }   /* pink */
.av-6 { --av-bg: rgba(244,114,182,0.14); --av-color: #BE185D; }  /* rose */
.av-7 { --av-bg: rgba(251,146,60,0.14); --av-color: #C2410C; }   /* orange */
.av-8 { --av-bg: rgba(245,158,11,0.14); --av-color: #B45309; }   /* amber */
.av-9 { --av-bg: rgba(132,204,22,0.16); --av-color: #4D7C0F; }   /* lime */
.av-10 { --av-bg: rgba(34,197,94,0.14); --av-color: #15803D; }   /* green */
.av-11 { --av-bg: rgba(20,184,166,0.14); --av-color: #0F766E; }
.av-12 { --av-bg: rgba(59,130,246,0.14); --av-color: #1D4ED8; }
[data-bs-theme="dark"] .av-1  { --av-color: #5eead4; }
[data-bs-theme="dark"] .av-2  { --av-color: #67e8f9; }
[data-bs-theme="dark"] .av-3  { --av-color: #a5b4fc; }
[data-bs-theme="dark"] .av-4  { --av-color: #d8b4fe; }
[data-bs-theme="dark"] .av-5  { --av-color: #f9a8d4; }
[data-bs-theme="dark"] .av-6  { --av-color: #fda4af; }
[data-bs-theme="dark"] .av-7  { --av-color: #fdba74; }
[data-bs-theme="dark"] .av-8  { --av-color: #fcd34d; }
[data-bs-theme="dark"] .av-9  { --av-color: #bef264; }
[data-bs-theme="dark"] .av-10 { --av-color: #86efac; }
[data-bs-theme="dark"] .av-11 { --av-color: #5eead4; }
[data-bs-theme="dark"] .av-12 { --av-color: #93c5fd; }

/* ===== Tabs — pill-toggle look ===== */
.nav-tabs {
  border-bottom: 1px solid var(--app-border);
  gap: 0.4rem;
  padding-bottom: 0;
}
.nav-tabs .nav-link {
  border: none;
  color: var(--app-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--app-text); border-color: transparent; background: var(--app-surface-alt); }
.nav-tabs .nav-link.active {
  color: var(--app-accent-hover);
  background: transparent;
  border-bottom-color: var(--app-accent);
  font-weight: 600;
}

/* ===== Dropdowns — soft elevation ===== */
.dropdown-menu {
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.35rem;
  font-size: 0.875rem;
}
.dropdown-item {
  color: var(--app-text);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-weight: 500;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
}
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.10); color: var(--app-danger); }
.dropdown-item.text-warning:hover { background: rgba(245,158,11,0.10); color: var(--app-warning); }
.dropdown-divider { border-top-color: var(--app-border); margin: 0.35rem 0; }

/* ===== Alerts ===== */
.alert {
  border-radius: var(--radius-md);
  border: 1px solid;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
}
.alert-success { background: rgba(16,185,129,0.08); color: #047857; border-color: rgba(16,185,129,0.25); }
.alert-danger  { background: rgba(239,68,68,0.08);  color: #b91c1c;  border-color: rgba(239,68,68,0.25); }
.alert-warning { background: rgba(245,158,11,0.10); color: #92400e; border-color: rgba(245,158,11,0.30); }
.alert-info    { background: var(--app-accent2-soft); color: var(--app-accent2); border-color: rgba(6,182,212,0.30); }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger  { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; }

/* ===== Drawer (task detail) ===== */
.task-drawer-backdrop { background: rgba(15, 23, 42, 0.42); backdrop-filter: blur(2px); }
.task-drawer {
  background: var(--app-bg);
  border-left: 1px solid var(--app-border);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
  width: min(1180px, 96vw);
  display: flex;
  flex-direction: column;
}
.task-drawer-header {
  background: var(--app-bg);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
  flex-shrink: 0;
}
.task-drawer-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

/* ===== Search modal ===== */
.search-modal { background: rgba(15, 23, 42, 0.50); backdrop-filter: blur(6px); }
.search-modal-card {
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-modal-input-wrap { padding: 1rem 1.2rem; gap: 0.7rem; border-bottom: 1px solid var(--app-border); }
.search-modal-input { font-size: 1.02rem; font-weight: 500; }
.search-result-item {
  padding: 0.65rem 1.2rem;
  gap: 0.7rem;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--app-border-soft);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover {
  background: var(--app-accent-soft);
  border-left-color: var(--app-accent);
  color: var(--app-text-strong);
}
.search-section-title {
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--app-muted); font-weight: 600;
  font-size: 0.68rem;
  padding: 0.55rem 1.2rem 0.3rem;
}

/* ===== Notification bell ===== */
.notification-badge {
  background: var(--app-danger);
  color: #fff;
  border: 2px solid var(--app-bg);
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 999px;
}
.notification-dropdown {
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0;
  width: 380px;
  overflow: hidden;
}
.notification-item { padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--app-border-soft); }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--app-surface-alt); }
.notification-item.unread { background: var(--app-accent-soft); }
.notification-item.unread::before { background: var(--app-accent); }

/* ===== Toast ===== */
.toast-floating {
  background: var(--app-text-strong);
  color: var(--app-bg);
  border: 1px solid var(--app-text-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}
[data-bs-theme="dark"] .toast-floating {
  background: var(--app-surface-raised);
  color: var(--app-text-strong);
  border-color: var(--app-border-strong);
}
.alert-success.toast-floating { background: var(--app-success); border-color: var(--app-success); color: #fff; }
.alert-danger.toast-floating  { background: var(--app-danger);  border-color: var(--app-danger);  color: #fff; }

/* ===== Inline popovers ===== */
.inline-popover {
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.3rem;
}
.inline-popover-item {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}
.inline-popover-item:hover, .inline-popover-item.selected {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
}

/* ===== Quick-add row ===== */
.quick-add-row { border-top: 1px dashed var(--app-border) !important; }
.quick-add-row td { background: var(--app-surface-soft) !important; padding: 0.55rem 0.85rem !important; }
#quick-add-input { background: transparent; border-radius: 8px; }
#quick-add-input:focus { background: var(--app-surface); border: none !important; box-shadow: none !important; }

/* ===== Cell inline-edit ===== */
.cell-inline { transition: background-color 100ms; border-radius: 8px; }
.cell-inline:hover { background: var(--app-accent-soft); cursor: pointer; }

/* ===== Doc card (list) ===== */
.doc-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
}
.doc-card:hover { border-color: var(--app-accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ===== Kanban ===== */
.kanban-board { gap: 1rem; padding-bottom: 1rem; overflow-x: auto; }
.kanban-column {
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  width: 300px;
  flex-shrink: 0;
}
.kanban-column-header {
  padding: 0.85rem 1rem 0.6rem;
  display: flex; align-items: center; gap: 0.6rem;
  border-bottom: 1px solid var(--app-border);
}
.kanban-cards { padding: 0.6rem; min-height: 80px; }
.kanban-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: border-color 100ms, transform 80ms, box-shadow 100ms;
}
.kanban-card:hover { border-color: var(--app-accent); box-shadow: var(--shadow-sm); }
.kanban-card:active { cursor: grabbing; transform: scale(0.99); }
.kanban-card-title { font-size: 0.88rem; font-weight: 500; color: var(--app-text); line-height: 1.35; }

.kanban-quick-add { padding: 0.5rem 0.6rem 0.7rem; }
.kanban-quick-add-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--app-border-strong);
  color: var(--app-muted);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.kanban-quick-add-btn:hover {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
  border-color: var(--app-accent);
}

/* ===== Project list cards ===== */
.project-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
}
.project-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--project-color, var(--app-accent));
  opacity: 0.85;
}
.project-card:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

/* ===== Page headers ===== */
.page-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.page-header h3, .page-header h4, .page-header h5 {
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--app-text-strong);
  margin: 0;
}
.project-dot-lg {
  width: 14px; height: 14px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px var(--app-bg);
}

/* ===== Group rows (list view) ===== */
tr.group-header {
  background: transparent;
}
tr.group-header td {
  padding: 0.7rem 0.85rem !important;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-text-strong) !important;
  border-bottom: 1px solid var(--app-border-soft);
  background: var(--app-surface-soft) !important;
}
.group-toggle { background: transparent; border: none; color: var(--app-muted); width: 22px; height: 22px; }
.group-toggle:hover { background: var(--app-border); color: var(--app-text); border-radius: 6px; }
.group-dot { width: 9px; height: 9px; border-radius: 999px; margin-right: 0.5rem; vertical-align: middle; }
.group-count {
  background: var(--app-border);
  color: var(--app-muted-strong);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Tag chip variants */
.tag-chip {
  border-radius: var(--radius-pill) !important;
  padding: 0.22rem 0.6rem !important;
}

/* Link styling */
a { color: var(--app-accent-hover); text-decoration: none; }
a:hover { color: var(--app-accent); text-decoration: none; }
/* Opt-in underlines on links inside body content only */
.chat-bubble-body a:hover, .ProseMirror a:hover, .alert a:hover { text-decoration: underline; }

/* Section / utility */
.bg-body-secondary { background-color: var(--app-surface-alt) !important; }
.text-body-secondary { color: var(--app-muted) !important; }
.text-muted { color: var(--app-muted) !important; }

/* Bulk bar — floating, attention-grabbing */
.bulk-bar {
  position: sticky;
  top: calc(var(--navbar-height) + 0.5rem);
  z-index: 50;
}
.bulk-bar.d-none { display: none !important; }
.bulk-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  background: var(--app-surface-raised);
  border: 1px solid var(--app-accent);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0.85rem;
}
.bulk-bar-count {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--app-accent-hover);
  padding-right: 0.35rem;
}
.bulk-bar .bulk-pill {
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
}
.bulk-bar .dropdown-menu {
  min-width: 200px;
  padding: 0.35rem;
}
.bulk-bar .bulk-multi-menu .form-check-input {
  flex-shrink: 0;
}
.bulk-bar .vr {
  background-color: var(--app-border) !important;
  opacity: 0.7;
}

/* Comment chat bubbles */
.chat-bubble {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
  margin-bottom: 0.5rem;
}
.chat-bubble.chat-own { background: var(--app-accent-soft); border-color: rgba(20,184,166,0.20); }
.chat-bubble-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.chat-avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--av-bg, var(--app-accent-soft));
  color: var(--av-color, var(--app-accent-hover));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 600;
}
.chat-bubble-body { font-size: 0.9rem; color: var(--app-text); line-height: 1.5; }
.chat-bubble-body .mention {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
}

/* Empty state container */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--app-muted);
}
.empty-state svg { width: 180px; height: auto; margin-bottom: 1rem; }
.empty-state h5 {
  font-size: 1.05rem; font-weight: 600;
  color: var(--app-text-strong);
  margin: 0.5rem 0 0.35rem;
}
.empty-state p { color: var(--app-muted); font-size: 0.9rem; margin-bottom: 1rem; max-width: 360px; }

/* Auth pages */
.auth-body {
  background:
    radial-gradient(900px 500px at 80% -10%, var(--app-accent-soft) 0%, transparent 60%),
    radial-gradient(700px 300px at -10% 100%, var(--app-accent2-soft) 0%, transparent 60%),
    var(--app-bg);
}
.auth-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2rem 2.25rem;
  width: min(440px, 100%);
}

/* Sortable headers */
.th-sortable { user-select: none; cursor: pointer; }
.th-sortable:hover { color: var(--app-text); }
.th-sortable.th-sorted { color: var(--app-accent-hover); }
.sort-icon { font-size: 0.75rem; }

/* Title-edit input */
.title-edit-input {
  max-width: 100%;
  border-radius: 6px !important;
  resize: none;
  overflow: hidden;
  line-height: 1.3;
  font-family: inherit;
  min-height: 2rem;
}

/* ===== Doc editor chrome ===== */
.doc-toolbar {
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-border);
  padding: 0.85rem 0 !important;
  gap: 0.85rem;
}
.doc-title-input {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--app-text-strong);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
}
.doc-title-input:focus { background: var(--app-surface-alt); }
.doc-status {
  background: var(--app-surface-alt);
  border: 1px solid var(--app-border);
  color: var(--app-muted-strong);
  font-weight: 500;
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.doc-peer {
  width: 28px; height: 28px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  margin-left: -8px;
  border: 2px solid var(--app-bg);
}

/* ===== Reports table polish ===== */
.report-totals {
  background: var(--app-accent-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
}

/* ===== Settings tabs page ===== */
.tab-content > .tab-pane { padding-top: 1rem; }

/* ===== Members table polish ===== */
.member-name { color: var(--app-text); font-weight: 500; }

/* ===== Status list (settings) ===== */
.list-group-item {
  background: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text);
  font-size: 0.875rem;
  padding: 0.7rem 0.95rem;
}
.list-group-item:first-child { border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md); }
.list-group-item:last-child { border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

/* ===== Project menu kebab dropdown ===== */
.project-menu { min-width: 200px; }
.project-menu .dropdown-item i { width: 18px; }

/* ===== Comment form composer ===== */
.comment-form textarea {
  border-radius: var(--radius-md);
  resize: vertical;
}

/* ===== Time log row ===== */
#time-form { background: var(--app-surface-alt); padding: 0.85rem; border-radius: var(--radius-md); border: 1px solid var(--app-border); }
#time-form .form-label { color: var(--app-muted-strong); }
.total-logged {
  padding: 0.65rem 0.85rem;
  background: var(--app-accent-soft);
  border-radius: var(--radius-md);
  color: var(--app-text);
  font-size: 0.88rem;
}

/* ===== Slash + mention menus (doc editor) ===== */
.slash-menu, .mention-menu {
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.3rem;
  min-width: 240px;
}
.slash-menu-item, .mention-menu-item {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.slash-menu-item.selected, .slash-menu-item:hover,
.mention-menu-item.selected, .mention-menu-item:hover {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
}

/* ===== Chip selectors (task detail) ===== */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
  border: 1px solid var(--app-accent-soft);
  font-size: 0.78rem; font-weight: 500;
}
.chip-remove {
  background: transparent; border: none; color: inherit;
  padding: 0; line-height: 1; opacity: 0.6;
}
.chip-remove:hover { opacity: 1; }
.chip-select-add {
  background: var(--app-surface-alt);
  border: 1px dashed var(--app-border-strong);
  color: var(--app-muted);
  width: 24px; height: 24px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.chip-select-add:hover { border-color: var(--app-accent); color: var(--app-accent); }

/* ===== Task detail title input ===== */
.task-detail-title {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--app-text-strong);
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  resize: none;
  overflow: hidden;
  font-family: inherit;
  display: block;
}
.task-detail-title:focus { outline: none; background: var(--app-surface-alt); }
.task-detail-desc {
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  font-size: 0.95rem;
  color: var(--app-text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  resize: vertical;
}
.task-detail-desc:focus, .task-detail-desc:hover {
  border-color: var(--app-border);
  background: var(--app-surface);
}
.task-field label {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--app-muted-strong);
  font-size: 0.78rem; font-weight: 500;
  margin-bottom: 0.3rem;
}
.task-field label i { color: var(--app-muted); }

/* ===== Task indicators in title cell ===== */
.task-indicators { display: inline-flex; gap: 0.4rem; margin-left: 0.5rem; color: var(--app-muted); font-size: 0.78rem; }
.task-indicators i { font-size: 0.78rem; }

/* ===== Bigger touch targets for icons-only buttons in toolbars ===== */
.btn-group-sm > .btn { min-height: 30px; }

/* ===== Mention chip in comments ===== */
.chat-bubble-body .mention { background: var(--app-accent-soft); color: var(--app-accent-hover); }

/* ===== Group quick-add row (under each status group) ===== */
tr.group-quick-add td { background: transparent !important; padding: 0 !important; }
.group-quick-input {
  font-size: 0.85rem !important;
  padding: 0.35rem 0 !important;
  color: var(--app-text);
}
.group-quick-input::placeholder { color: var(--app-muted); }

/* ===== Drawer keeps the two-column layout (form on left, chat on right) ===== */
/* Older overrides forced single-column; we now want the ClickUp two-pane look. */
.task-drawer-body .task-detail-columns { display: flex; height: 100%; }
.task-drawer-body .task-detail-main { flex: 1; min-width: 0; overflow-y: auto; }
.task-drawer-body .task-detail-chat {
  width: 380px;
  min-width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--app-border);
}
@media (max-width: 720px) {
  .task-drawer-body .task-detail-columns { flex-direction: column; height: auto; }
  .task-drawer-body .task-detail-chat { width: 100%; min-width: 0; border-left: none; border-top: 1px solid var(--app-border); }
}

/* ============================================================
   ============== PASS 2 — POLISH FIXES (last layer) ===========
   Wins via source order. Targeted fixes for the redesign pass.
   ============================================================ */

/* B2 — Pin the brand color regardless of global a:hover cascade */
.sidebar-brand,
.sidebar-brand:hover,
.sidebar-brand:focus,
.sidebar-brand:active {
  color: var(--sidebar-text-strong) !important;
  text-decoration: none !important;
}
.sidebar-brand i { color: #fff !important; }

/* B3 — Button alignment (fixes the "weird bottom padding" on icon+text buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  line-height: 1.25;
}
.btn > i { line-height: 1; }
.btn > i.me-1 { margin-right: 0 !important; } /* gap handles it */
/* Single source of truth for sm padding */
.btn-sm {
  padding: 0.36rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.2;
}
.btn-sm > i { font-size: 0.95rem; }

/* B4 — Cell-inline hover: neutral surface, chips stay self-contained pills */
.cell-inline:hover { background: var(--app-surface-alt) !important; cursor: pointer; }
.phase-chip, .milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--app-surface-alt);
  border: 1px solid var(--app-border);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 100ms;
}
.cell-inline:hover .phase-chip,
.cell-inline:hover .milestone-chip {
  border-color: var(--app-border-strong);
  background: var(--app-surface);
}
.phase-chip i, .milestone-chip i { font-size: 0.7rem; }

/* B6 — Primary CTA: deeper gradient already in tokens; add inset highlight + clean hover */
.btn-primary {
  background: var(--app-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--app-gradient-hover);
  border-color: transparent;
  color: #fff;
  filter: none;
  box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:disabled, .btn-primary.disabled {
  background: var(--app-accent-hover);
  opacity: 0.55;
  box-shadow: none;
}

/* B7 — Hover polish on cards (project, doc, kanban) */
.project-card {
  color: var(--app-text);
  text-decoration: none !important;
}
.project-card:hover,
.project-card:focus {
  color: var(--app-text);
  border-color: var(--app-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none !important;
}
.project-card * { text-decoration: none !important; }

.doc-card,
.doc-card:hover {
  color: var(--app-text);
  text-decoration: none !important;
}
.doc-card:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kanban-card .task-title-link,
.kanban-card .task-title-link:hover { text-decoration: none !important; color: var(--app-text); }
.kanban-card:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-sm);
}

/* Task-title links inside the list table — never underline */
.task-title-link, .task-title-link:hover {
  text-decoration: none !important;
  color: var(--app-text);
}
.task-title-link:hover { color: var(--app-accent-hover); }

/* Sidebar links never underline */
.sidebar-link, .sidebar-link:hover,
.sidebar-sublink, .sidebar-sublink:hover { text-decoration: none !important; }

/* Dropdown items never underline */
.dropdown-item, .dropdown-item:hover { text-decoration: none !important; }

/* Search results never underline */
.search-result-item, .search-result-item:hover { text-decoration: none !important; }

/* C — Inline + button next to Assignees / Tags labels in task drawer */
.task-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  /* Override the global .form-label/label width — we want this hugging content */
  width: auto;
}
.task-field-add {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px dashed var(--app-border-strong);
  background: transparent;
  color: var(--app-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 600;
  padding: 0;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.task-field-add:hover {
  border-style: solid;
  border-color: var(--app-accent);
  color: var(--app-accent);
  background: var(--app-accent-soft);
}
/* When + sits next to label, hide the trailing chip-row + so we don't have two */
.task-field .chip-select.has-label-add > .chip-select-add { display: none; }

/* Reports range field */
.flatpickr-range { padding-right: 0.85rem; }

/* Minimal per-group + Add task */
tr.group-quick-add td { background: transparent !important; padding: 0.15rem 0.85rem !important; border: none !important; }
.group-quick-add-wrap {
  padding-left: 2.2rem;
}
.group-quick-add-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 100ms, color 100ms;
}
.group-quick-add-trigger:hover {
  background: var(--app-surface-alt);
  color: var(--app-accent);
}
.group-quick-add-trigger i { font-size: 0.85rem; }
.group-quick-add-input {
  max-width: 420px;
  background: var(--app-surface);
  border-color: var(--app-border);
}

/* Rich description editor (contenteditable with paste/drop image upload) */
.rich-desc {
  min-height: 80px;
  padding: 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--app-text);
  font-size: 0.95rem;
  line-height: 1.55;
  outline: none;
  transition: border-color 100ms, background-color 100ms, box-shadow 100ms;
}
.rich-desc:hover { border-color: var(--app-border); }
.rich-desc:focus {
  border-color: var(--app-accent);
  background: var(--app-surface);
  box-shadow: 0 0 0 4px var(--app-accent-soft);
}
.rich-desc[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--app-muted);
  pointer-events: none;
}
.rich-desc.rich-desc-drag {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
}
.rich-desc-img {
  display: inline-block;
  max-height: 120px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 0.3rem 0.4rem 0.3rem 0;
  vertical-align: middle;
  cursor: zoom-in;
  border: 1px solid var(--app-border);
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}
.rich-desc-img:hover {
  border-color: var(--app-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.rich-desc-img.is-uploading {
  filter: grayscale(0.6);
  opacity: 0.6;
  cursor: progress;
  animation: rich-desc-pulse 1.4s ease-in-out infinite;
}

/* Image lightbox */
.image-lightbox {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 200ms;
}
.image-lightbox.show { opacity: 1; }
.image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.image-lightbox-close,
.image-lightbox-download {
  position: absolute;
  top: 1.25rem;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 120ms, transform 120ms;
}
.image-lightbox-close:hover,
.image-lightbox-download:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: scale(1.05);
}
.image-lightbox-close { right: 1.25rem; }
.image-lightbox-download { right: 4.25rem; }
@keyframes rich-desc-pulse { 0%, 100% { opacity: 0.55 } 50% { opacity: 0.85 } }
.rich-desc p { margin: 0 0 0.6rem; }
.rich-desc p:last-child { margin-bottom: 0; }

/* @mention suggest popover (drawer comment composer) */
.chat-composer { position: relative; }
.mention-suggest {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0.5rem;
  right: 3rem;
  max-height: 220px;
  overflow-y: auto;
  background: var(--app-surface-raised);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.3rem;
  z-index: 60;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  color: var(--app-text);
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.mention-item:hover, .mention-item.active {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
}
.mention-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-item-handle { font-size: 0.78rem; }

/* Indicator hover tooltip — shows description preview */
.indicator-with-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.indicator-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 70;
  background: var(--app-text-strong);
  color: var(--app-bg);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  width: 320px;
  max-width: 60vw;
  white-space: normal;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms, transform 120ms;
}
[data-bs-theme="dark"] .indicator-tip {
  background: var(--app-surface-raised);
  color: var(--app-text);
  border: 1px solid var(--app-border);
}
.indicator-with-tip:hover .indicator-tip {
  opacity: 1;
  transform: translateY(0);
}

/* Save indicator (task detail) */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--app-surface-alt);
  color: var(--app-muted);
  border: 1px solid var(--app-border);
  transition: background-color 200ms, color 200ms, border-color 200ms;
}
.save-indicator i { font-size: 0.9rem; line-height: 1; }
.save-indicator.save-idle { color: var(--app-muted); }
.save-indicator.save-saving { color: var(--app-accent-hover); border-color: var(--app-accent-soft); background: var(--app-accent-soft); }
.save-indicator.save-saved {
  color: #047857; /* emerald-700 */
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.30);
  animation: save-pulse 1.6s ease-out 1;
}
[data-bs-theme="dark"] .save-indicator.save-saved { color: #6ee7b7; }
.save-indicator.save-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
}
[data-bs-theme="dark"] .save-indicator.save-error { color: #fca5a5; }
@keyframes save-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  60%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.save-spin { animation: save-spin 0.9s linear infinite; }
@keyframes save-spin { to { transform: rotate(360deg); } }

/* View customizer popover */
.view-customizer {
  width: 320px;
  max-width: 92vw;
  padding: 0 !important;
}
.view-customizer-section { padding: 0.85rem 1rem; border-bottom: 1px solid var(--app-border-soft); }
.view-customizer-section:last-child { border-bottom: none; }
.view-customizer-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--app-muted);
  margin-bottom: 0.55rem;
}
.view-customizer-hint { font-size: 0.72rem; margin-top: 0.4rem; }
.view-customizer-groups, .view-customizer-columns {
  list-style: none; padding: 0; margin: 0;
}
.view-customizer-group {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--app-text);
  background: var(--app-surface-soft);
  margin-bottom: 4px;
  border: 1px solid var(--app-border-soft);
}
.view-customizer-group .group-drag {
  cursor: grab;
  color: var(--app-muted);
  font-size: 1rem;
}
.view-customizer-group .group-color {
  width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0;
}
.view-customizer-group .group-name { flex: 1; }
.view-customizer-columns label.dropdown-item {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}
.sort-pill { font-size: 0.78rem; padding: 0.25rem 0.7rem; border-radius: 999px; }

/* Sidebar — lists under each project */
.sidebar-sublinks-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 0.35rem;
}
.sidebar-sublinks-section + .sidebar-sublinks-section {
  border-top: 1px solid var(--sidebar-border);
  margin-top: 0.4rem;
  padding-top: 0.45rem;
}
.sidebar-sublink-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.55rem 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--app-muted);
}
.sidebar-sublink-group-header i { font-size: 0.75rem; opacity: 0.85; margin-right: 0.3rem; }
.sidebar-list-add {
  background: transparent;
  border: none;
  color: var(--app-muted);
  width: 18px; height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
}
.sidebar-list-add:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active-text);
}
.sidebar-list-link {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-list-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.sidebar-list-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filter row — pill buttons that show active state */
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.filter-row-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.filter-row-right {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
}
.filter-search {
  position: relative;
  width: 220px;
  min-width: 180px;
}
.filter-search > i.bi-search {
  position: absolute;
  top: 50%;
  left: 0.7rem;
  transform: translateY(-50%);
  color: var(--app-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.filter-search input {
  padding-left: 1.95rem !important;
  border-radius: var(--radius-pill);
}
.filter-pill .filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-pill);
  color: var(--app-muted-strong);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 100ms, color 100ms, background-color 100ms, box-shadow 100ms;
}
.filter-pill .filter-pill-btn:hover {
  border-color: var(--app-border-strong);
  color: var(--app-text);
}
.filter-pill .filter-pill-btn i {
  font-size: 0.85rem;
  opacity: 0.85;
}
.filter-pill.filter-pill-active .filter-pill-btn {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
  font-weight: 600;
}
.filter-pill.filter-pill-active .filter-pill-btn i { opacity: 1; }
.filter-pill .filter-pill-label { white-space: nowrap; }
.filter-pill-menu { min-width: 220px; padding: 0.3rem; }
.filter-pill-menu .filter-option { padding: 0.4rem 0.7rem; border-radius: 8px; }
.filter-multi-menu .dropdown-item { border-radius: 8px; }
.filter-multi-menu .dropdown-item:hover { background: var(--app-accent-soft); color: var(--app-accent-hover); }
.filter-group-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--app-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-group-header + .filter-group-header { padding-top: 0.2rem; }
.filter-grouped-item { padding-left: 1.4rem !important; }

/* Bulk-import textarea */
.bulk-import-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
}

/* List switcher in tasks toolbar */
.list-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem !important;
  border-radius: var(--radius-pill);
  color: var(--app-text) !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.list-switcher-btn:hover {
  background: var(--app-surface-alt);
}
.list-switcher-btn .list-name { line-height: 1; }
.list-switcher-btn i.bi-chevron-down { font-size: 0.7rem; opacity: 0.7; }
.list-dot {
  width: 9px; height: 9px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}
.list-switcher-menu { min-width: 240px; }
.list-switcher-menu .dropdown-item.active {
  background: var(--app-accent-soft);
  color: var(--app-accent-hover);
  font-weight: 600;
}

/* Drag-the-whole-title-cell affordance */
.drag-cell { cursor: grab; }
.drag-cell:active { cursor: grabbing; }
.sortable-chosen .drag-cell { cursor: grabbing; }
.sortable-ghost { opacity: 0.45; background: var(--app-accent-soft) !important; }
/* Hide any leftover handle icon */
.drag-row-handle { display: none !important; }

/* ========== PASS 3 ========== */

/* Task table — drop the grey hover wash, replace with subtle accent stripe */
.task-table,
#task-table {
  --bs-table-hover-bg: transparent;
  --bs-table-hover-color: inherit;
}
.task-table tbody tr,
.task-table tbody tr td,
.task-table.table-hover tbody tr:hover,
.task-table.table-hover tbody tr:hover > *,
#task-table.table-hover tbody tr:hover,
#task-table.table-hover tbody tr:hover > * {
  background: transparent !important;
  --bs-table-bg-state: transparent;
}
.task-table tbody tr[data-task-id]:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--app-accent);
}

/* Group header — clearer, uppercase, bigger */
tr.group-header td {
  padding: 0.85rem 0.85rem 0.5rem !important;
  font-size: 0.78rem !important;
}
tr.group-header .group-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--app-text-strong);
  font-size: 0.85rem;
}
tr.group-header .group-dot {
  width: 11px;
  height: 11px;
}
tr.group-header .group-count {
  font-weight: 600;
  font-size: 0.7rem;
}

/* Resizable column header — show a faint divider so the grab affordance is visible */
.task-table thead th { position: relative; }
.task-table thead th + th { border-left: 1px solid var(--app-border-soft); }
.th-resize {
  position: absolute;
  top: 6px;
  right: -3px;
  bottom: 6px;
  width: 7px;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}
.th-resize::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--app-border);
  transform: translateX(-50%);
  transition: background 80ms, width 80ms;
}
.th-resize:hover::before,
.th-resize-active::before {
  width: 3px;
  background: var(--app-accent);
}

/* Sidebar Dashboard top link */
.sidebar-top-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--sidebar-text, var(--app-text));
  text-decoration: none;
  font-weight: 500;
}
.sidebar-top-link:hover { background: var(--sidebar-hover, var(--app-surface-alt)); color: var(--app-text-strong); text-decoration: none; }
.sidebar-top-link.active { background: var(--sidebar-active-bg, var(--app-accent-soft)); color: var(--app-accent-hover); }
.sidebar-top-link i { color: inherit; }

/* ===== Brand logo ===== */
.sidebar-brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 160px;
}
.auth-logo {
  display: block;
  margin: 0 auto;
  height: 56px;
  width: auto;
  max-width: 220px;
}

/* ===== Dashboard ===== */
.dashboard-grid .card { border-radius: var(--radius-md); }
.dashboard-section + .dashboard-section { border-top: 1px solid var(--app-border-soft); padding-top: 0.5rem; }
.dashboard-task-row,
.dashboard-comment-row,
.dashboard-milestone-row,
.dashboard-activity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--app-text);
  margin: 0 -0.5rem;
}
.dashboard-task-row:hover,
.dashboard-comment-row:hover,
.dashboard-milestone-row:hover,
.dashboard-activity-row:hover {
  background: var(--app-surface-alt);
  text-decoration: none;
}
.dashboard-task-title { flex: 1 1 auto; min-width: 0; font-size: 0.88rem; }
.dashboard-comment-task { flex: 1 1 auto; min-width: 0; font-size: 0.85rem; }
.dashboard-milestone-row,
.dashboard-activity-row { flex-wrap: wrap; }
.dashboard-milestone-meta,
.dashboard-activity-meta { flex-basis: 100%; padding-left: 1.4rem; }
.project-dot-sm {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.25rem;
}
.dashboard-stat {
  background: var(--app-surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}
.dashboard-stat-label { color: var(--app-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.dashboard-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--app-text-strong); }
.dashboard-project-card {
  display: block;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--app-text);
  transition: border-color 80ms;
}
.dashboard-project-card:hover { border-color: var(--app-accent); text-decoration: none; }
.dashboard-workload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
.dashboard-workload-bar {
  flex: 1 1 auto;
  height: 6px;
  background: var(--app-border-soft);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.dashboard-workload-fill { height: 100%; background: var(--app-accent); }

/* Assign-members modal */
.assign-members-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
}
.assign-members-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--app-border-soft);
  cursor: pointer;
  margin: 0;
}
.assign-members-row:last-child { border-bottom: none; }
.assign-members-row:hover { background: var(--app-surface-alt); }
.assign-members-row input[type=checkbox]:checked ~ * { /* no-op anchor */ }
.assign-members-row:has(input:checked) { background: var(--app-accent-soft); }

/* Sidebar drag handles — the project/list color dot doubles as a grip */
.sidebar-list .project-dot,
.sidebar-sublinks-section .list-dot {
  cursor: grab;
}
.sidebar-list .project-dot:active,
.sidebar-sublinks-section .list-dot:active { cursor: grabbing; }
.sortable-ghost.sidebar-list-row,
li.sortable-ghost { opacity: 0.4; }

/* Sidebar list kebab — show on row hover, sit to the right of the link */
.sidebar-list-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.sidebar-list-row .sidebar-list-link {
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-list-kebab {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.15s;
  background: transparent;
  border: none;
  color: var(--sidebar-muted, var(--app-muted));
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  font-size: 0.95rem;
  margin-right: 0.35rem;
}
.sidebar-list-row:hover .sidebar-list-kebab,
.sidebar-list-kebab:focus,
.sidebar-list-kebab.show { opacity: 1; }
.sidebar-list-kebab:hover { color: var(--app-text-strong); background: var(--sidebar-hover, var(--app-surface-alt)); }

/* Tags column cell */
.cell-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.cell-tags-chips .tag-chip {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Every cell respects column width — content truncates instead of overflowing.
   The check column holds only an <input> (no text) — applying text-overflow
   there makes some browsers render a stray "…", so opt it out. */
.task-table {
  table-layout: fixed;
  /* Sum of th widths (check 40, priority 100, assignees 150, tags 160,
     phase 130, milestone 140, est 110, logged 110, due 100) plus a healthy
     budget for the title column (which now also carries the status dot).
     Anything narrower crushes the title to "…" on small viewports —
     .table-responsive scrolls horizontally. */
  min-width: 1150px;
}
.task-table tbody td {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-table tbody td[data-col="check"] {
  text-overflow: clip;
  text-align: center;
}
.task-table tbody td[data-col="check"] .task-check { vertical-align: middle; }
.task-table tbody td.cell-inline > *,
.task-table tbody td.cell-inline .status-pill,
.task-table tbody td.cell-inline .phase-chip,
.task-table tbody td.cell-inline .milestone-chip,
.task-table tbody td.cell-inline .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* Tag chips wrap-row inside the cell, but each chip still truncates */
.task-table tbody td[data-col="tags"] .cell-tags-chips {
  flex-wrap: nowrap;
  overflow: hidden;
}
.task-table tbody td[data-col="tags"] .tag-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Avatar stack truncates: extra avatars collapse into the +N badge */
.task-table tbody td[data-col="assignees"] .avatar-stack {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
}
/* Doc category filter pill — small × delete button on hover */
.doc-category-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.doc-category-pill .doc-category-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.doc-category-pill:hover .doc-category-delete {
  opacity: 1;
}
.doc-category-pill .doc-category-delete:hover {
  background: var(--bs-danger, #ef4444);
  color: #fff;
  border-color: var(--bs-danger, #ef4444);
}

/* Indent task rows slightly so they nest visually under the group header */
.task-table tbody tr[data-task-id] td.cell-title {
  padding-left: 1.75rem;
}

/* Status indicator — colored dot at the start of the title cell, opens the
   same status picker as the old Status column. */
.status-dot-trigger {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.status-dot-trigger:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
}
.status-dot-trigger[data-value=""] {
  background: transparent !important;
  border-style: dashed;
  border-color: var(--app-border-strong);
}

/* Title cell — table-layout: fixed already pins each column's width, so the
   td just needs to clip + ellipsis. The link inside stays plain inline so
   it doesn't fight the cell's truncation logic. */
.task-table td.cell-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-table td.cell-title .task-title-link {
  vertical-align: middle;
}
.task-table td.cell-title .task-indicators {
  display: none;
}
.task-table td.cell-title:hover .task-indicators {
  display: inline-flex;
}
/* While the row is being edited, let the textarea wrap and grow vertically. */
.task-table tr[data-editing="1"] td.cell-title {
  white-space: normal;
  overflow: visible;
}

/* Customize dropdown action footer */
.view-customizer-actions {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--app-border);
  justify-content: flex-end;
}
