/* === PULSE — Design Tokens & Styles === */

:root {
  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Satoshi', 'Inter', system-ui, sans-serif;
  
  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Light Theme — refined warm neutral palette */
  --color-bg: #f7f6f4;
  --color-surface: #ffffff;
  --color-surface-2: #faf9f8;
  --color-surface-3: #f2f1ef;
  --color-surface-hover: #eeecea;
  --color-border: #e0dedb;
  --color-divider: #e8e6e3;
  --color-text: #1a1816;
  --color-text-muted: #6b6560;
  --color-text-faint: #9e9892;
  --color-text-inverse: #ffffff;

  /* Teal primary — more saturated, richer */
  --color-primary: #0d9488;
  --color-primary-hover: #0f766e;
  --color-primary-light: #ccfbf1;
  --color-primary-subtle: rgba(13, 148, 136, 0.08);
  --color-primary-text: #ffffff;
  --color-primary-glow: rgba(13, 148, 136, 0.25);
  
  /* Status colors — slightly warmer, more refined */
  --color-error: #dc2626;
  --color-error-light: #fef2f2;
  --color-warning: #d97706;
  --color-warning-light: #fffbeb;
  --color-success: #16a34a;
  --color-success-light: #f0fdf4;

  /* Sidebar — deeper, richer */
  --color-sidebar-bg: #141211;
  --color-sidebar-text: #e7e5e4;
  --color-sidebar-muted: #8a8480;
  --color-sidebar-hover: #222019;
  --color-sidebar-active: #0d9488;
  --color-sidebar-gradient: linear-gradient(180deg, #1a1816 0%, #141211 100%);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 20px;

  /* Shadows — richer layered shadows for depth */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.03), 0 6px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 40px rgba(0,0,0,0.10);
  --shadow-xl: 0 8px 16px rgba(0,0,0,0.06), 0 24px 56px rgba(0,0,0,0.14);
  --shadow-glow: 0 0 20px var(--color-primary-glow);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.05), 0 12px 28px rgba(0,0,0,0.08);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-blur: 16px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
  --duration-slow: 350ms;
  --duration-fast: 120ms;
}

/* === DARK THEME === */
[data-theme="dark"] {
  --color-bg: #0f0e0c;
  --color-surface: #181614;
  --color-surface-2: #201e1b;
  --color-surface-3: #282522;
  --color-surface-hover: #2e2b28;
  --color-border: #332f2b;
  --color-divider: #2a2724;
  --color-text: #eae8e6;
  --color-text-muted: #a8a29e;
  --color-text-faint: #706a64;
  --color-text-inverse: #1a1816;

  --color-primary: #2dd4bf;
  --color-primary-hover: #14b8a6;
  --color-primary-light: #0d2926;
  --color-primary-subtle: rgba(45, 212, 191, 0.10);
  --color-primary-text: #0f0e0c;
  --color-primary-glow: rgba(45, 212, 191, 0.20);

  --color-error: #f87171;
  --color-error-light: #2d1515;
  --color-warning: #fbbf24;
  --color-warning-light: #2d2410;
  --color-success: #4ade80;
  --color-success-light: #0f2d18;

  --color-sidebar-bg: #0a0908;
  --color-sidebar-text: #e7e5e4;
  --color-sidebar-muted: #706a64;
  --color-sidebar-hover: #181614;
  --color-sidebar-active: #14b8a6;
  --color-sidebar-gradient: linear-gradient(180deg, #121110 0%, #0a0908 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.25), 0 8px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 6px 12px rgba(0,0,0,0.3), 0 20px 48px rgba(0,0,0,0.4);
  --shadow-xl: 0 10px 20px rgba(0,0,0,0.35), 0 28px 64px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--color-primary-glow);
  --shadow-card-hover: 0 6px 16px rgba(0,0,0,0.3), 0 16px 36px rgba(0,0,0,0.35);

  /* Glassmorphism — dark variant */
  --glass-bg: rgba(24, 22, 20, 0.78);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
}

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

html, body { 
  height: 100%; 
  overflow: hidden; 
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-slow) var(--ease-smooth);
}

#root { height: 100%; }

h1, h2, h3, .top-bar-title, .dash-card-title, .sidebar-title,
.profile-modal-header h2, .empty-state h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

button { 
  cursor: pointer; 
  background: none; 
  border: none; 
  font: inherit; 
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

/* === LAYOUT === */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100dvh;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--color-sidebar-gradient, var(--color-sidebar-bg));
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

.sidebar-header {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo svg { color: white; }

.sidebar-title {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-section {
  padding: var(--space-3) var(--space-3);
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-sidebar-muted);
  padding: var(--space-1) var(--space-2);
  margin-bottom: var(--space-1);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-sidebar-text);
  transition: background var(--duration) var(--ease);
  cursor: pointer;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover { background: var(--color-sidebar-hover); }
.sidebar-item.active { 
  background: var(--color-sidebar-active); 
  color: white;
  box-shadow: 0 0 16px rgba(13, 148, 136, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.sidebar-item.active svg { opacity: 1; }

.sidebar-item .ws-badge {
  font-size: 0.625rem;
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-workspaces {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-user {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.avatar-sm { width: 22px; height: 22px; font-size: 0.5625rem; }
.avatar-lg { width: 32px; height: 32px; font-size: 0.75rem; }

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

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--color-sidebar-muted);
}

/* === MAIN CONTENT === */
.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  min-height: 48px;
  position: relative;
}

.top-bar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: 1;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
}

.breadcrumbs span { color: var(--color-text-faint); }
.breadcrumbs .current { color: var(--color-text); font-weight: 500; }

.search-input-wrapper {
  position: relative;
  width: 280px;
  display: flex;
  align-items: center;
}

/* Icon span wrapper (from Icon component) */
.search-input-wrapper > span {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--color-text-faint);
  pointer-events: none;
  z-index: 1;
}
.search-input-wrapper > span svg {
  width: 15px;
  height: 15px;
}

.search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.search-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-subtle); }

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  position: relative;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.icon-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.icon-btn svg { width: 18px; height: 18px; }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--color-error);
  color: white;
  font-size: 0.5625rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === CONTENT AREA === */
.content-area {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

/* === KANBAN === */
.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.kanban-filters {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface);
  transition: all var(--duration) var(--ease);
}

.filter-btn:hover { border-color: var(--color-text-faint); color: var(--color-text); }
.filter-btn.active { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.filter-btn svg { width: 13px; height: 13px; }

/* Add member button & dropdown */
.add-member-wrap {
  position: relative;
}
.add-member-btn {
  border-style: dashed !important;
  color: var(--color-text-faint) !important;
  padding: 5px 8px !important;
}
.add-member-btn:hover {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
.add-member-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 6px;
}
.add-member-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  margin-bottom: 4px;
}
.add-member-search:focus { border-color: var(--color-primary); }
.add-member-list {
  max-height: 200px;
  overflow-y: auto;
}
.add-member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;
}
.add-member-item:hover { background: var(--color-bg); }
.add-member-role {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.add-member-empty {
  padding: 12px 8px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.kanban-column {
  background: var(--color-surface-3, var(--color-bg));
  border-radius: var(--radius-lg);
  min-height: 200px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-3);
  position: sticky;
  top: 0;
}

.kanban-column-title {
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kanban-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
}

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

.status-dot.todo { background: var(--color-text-faint); }
.status-dot.in-progress { background: #3b82f6; }
.status-dot.ongoing { background: #0ea5e9; }
.status-dot.review { background: var(--color-warning); }
.status-dot.completed { background: var(--color-success); }

.kanban-column-body {
  padding: 0 var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 100px;
  max-height: 54vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.kanban-column-body .task-card,
.kanban-column-body .kanban-drop-zone {
  flex-shrink: 0;
}

.kanban-column-body.drag-over {
  background: var(--color-primary-subtle);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 2px var(--color-primary-glow);
  transition: all var(--duration) var(--ease);
}

/* === KANBAN SUBSECTION DIVIDER (In Progress / Ongoing grouping) === */

/* === TASK CARD === */
.task-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  cursor: pointer;
  transition: transform var(--duration) var(--ease-spring),
              box-shadow var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  user-select: none;
  will-change: transform;
}

.task-card:hover { 
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover); 
  border-color: color-mix(in srgb, var(--color-border) 60%, var(--color-primary) 15%);
}

.task-card.dragging { 
  opacity: 0.85; 
  transform: rotate(2deg) scale(1.03);
  box-shadow: var(--shadow-xl);
  z-index: 100;
}

.task-card.task-completed {
  opacity: 0.6;
}

.task-card.task-completed:hover {
  opacity: 0.8;
}

.task-card-title.completed-title {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-faint);
}

.task-card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.task-card-tags {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.priority-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority-badge.urgent { background: #fef2f2; color: #dc2626; }
.priority-badge.high { background: #fff7ed; color: #ea580c; }
.priority-badge.medium { background: #fffbeb; color: #d97706; }
.priority-badge.low { background: #f0fdf4; color: #16a34a; }

.due-badge {
  font-size: 0.625rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.due-badge svg { width: 11px; height: 11px; }
.due-badge.overdue { color: var(--color-error); }
.due-badge.today { color: var(--color-warning); }

.task-card-avatars {
  display: flex;
  margin-left: auto;
}

.task-card-avatars .avatar {
  margin-left: -4px;
  border: 2px solid var(--color-surface);
}

.task-card-avatars .avatar:first-child { margin-left: 0; }

/* Drag-drop user assignment */
.task-card { position: relative; overflow: hidden; }
.task-card.user-drop-assignee { border-color: var(--color-primary); box-shadow: inset 4px 0 0 var(--color-primary), 0 0 0 2px rgba(0,150,136,0.15); transform: scale(1.01); }
.task-card.user-drop-reviewer { border-color: #8b5cf6; box-shadow: inset -4px 0 0 #8b5cf6, 0 0 0 2px rgba(139,92,246,0.15); transform: scale(1.01); }
.task-card.task-urgent { box-shadow: inset 3px 0 0 var(--color-error); }
.task-card.task-closed { box-shadow: inset 3px 0 0 #22c55e; }
.task-card.user-drop-assignee,
.task-card.user-drop-reviewer { transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease; }
.task-card-drop-hint {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  pointer-events: none; z-index: 3;
  background: rgba(255,255,255,0.85);
  border-radius: inherit;
}
.drop-hint-left, .drop-hint-right {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  opacity: 0.4; transition: opacity 0.12s, background 0.12s;
}
.drop-hint-left { color: var(--color-primary); }
.drop-hint-right { color: #8b5cf6; }
.drop-hint-left.active { opacity: 1; background: rgba(0,150,136,0.12); }
.drop-hint-right.active { opacity: 1; background: rgba(139,92,246,0.12); }

.task-card-avatars-row {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}
.task-card-reviewers {
  display: flex; align-items: center; opacity: 0.65;
}
.task-card-reviewers .avatar {
  margin-left: -4px; border: 2px solid var(--color-surface); width: 20px; height: 20px; font-size: 8px;
}
.task-card-reviewers .avatar:first-of-type { margin-left: 0; }

.filter-btn[draggable="true"] { cursor: grab; }
.filter-btn[draggable="true"]:active { cursor: grabbing; }

.recurrence-badge {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.625rem;
  font-weight: 500;
}

.recurrence-badge svg { width: 11px; height: 11px; }

.logged-badge {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.625rem;
  font-weight: 500;
}
.logged-badge svg { width: 11px; height: 11px; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.btn-primary:hover { 
  background: var(--color-primary-hover);
  box-shadow: 0 2px 8px var(--color-primary-glow), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-surface-hover); }

.btn-ghost {
  color: var(--color-text-muted);
}
.btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.btn-danger {
  background: var(--color-error);
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-xs);
}
.btn-sm svg { width: 13px; height: 13px; }

/* === FORMS === */
.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: var(--space-10) var(--space-4);
  animation: overlayFadeIn var(--duration) var(--ease) both;
  overflow-y: auto;
  animation: fadeIn 150ms var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  animation: slideUp 200ms var(--ease);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}

.modal-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.modal-body {
  padding: var(--space-5);
  max-height: 75vh;
  overflow-y: auto;
}
.form-select optgroup {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-top: 6px;
  border-top: 2px solid var(--color-divider);
}
.form-select optgroup option {
  font-weight: 400;
  color: var(--color-text);
}

.modal-team-section {
  padding: 0 var(--space-5) var(--space-4);
  overflow: visible;
  position: relative;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
}
.modal-team-section .searchable-multi-select { position: relative; width: 50%; }
.modal-team-section .sms-dropdown {
  max-height: 180px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-divider);
}

/* === TASK DETAIL MODAL === */
.task-detail-modal {
  max-width: 960px;
  width: 90vw;
  /* Cap to viewport so header + body + save button fit without pushing anything offscreen.
     Overlay adds --space-10 vertical padding; subtract that plus a little breathing room. */
  max-height: calc(100vh - var(--space-10) * 2 - var(--space-2));
  display: flex;
  flex-direction: column;
}

.task-detail-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  flex-shrink: 0;
}

.task-detail-status-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.task-detail-title {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}

.task-detail-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.task-detail-quick-log {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 320px;
  max-width: 640px;
}
.task-detail-quick-log .form-input {
  font-size: var(--text-sm);
  height: 32px;
  padding: 4px 8px;
}
.task-detail-quick-log .btn {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .task-detail-quick-log {
    flex-basis: 100%;
    min-width: 0;
  }
}

.task-detail-project-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.task-detail-crumb-sep { opacity: 0.5; }
.task-detail-crumb-proj.clickable {
  color: #2563eb;
  cursor: pointer;
  transition: color 100ms;
}
.task-detail-crumb-proj.clickable:hover {
  text-decoration: underline;
}

.task-detail-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.task-detail-main {
  padding: var(--space-5);
  overflow-y: auto;
  border-right: 1px solid var(--color-divider);
  min-height: 0;
}

.task-detail-sidebar {
  padding: var(--space-4);
  font-size: var(--text-sm);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
/* Keep the Save button anchored at the bottom of the sidebar — never scrolled offscreen */
.task-detail-sidebar > div:last-child {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-divider);
  z-index: 1;
}

.tab-scroll-list {
  max-height: 340px;
  overflow-y: auto;
}

/* === CONTEXT MENU === */
.ctx-menu {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 4px 0;
  font-size: var(--text-sm);
}
.ctx-menu-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  padding: 6px 12px 2px;
}
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 100ms;
}
.ctx-menu-item:hover {
  background: var(--color-bg-tertiary);
}
.ctx-menu-item.active {
  font-weight: 600;
  color: var(--color-primary);
}
.ctx-menu-item.ctx-danger {
  color: var(--color-error);
}
.ctx-menu-item.ctx-danger:hover {
  background: #fef2f2;
}
.ctx-menu-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 4px 0;
}
.ctx-menu-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.ctx-menu-confirm-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex: 1;
}

.move-project-option:hover {
  background: var(--color-bg-tertiary);
}

/* Inbox items used to outline overdue notifs in red — removed by user request.
   Kanban cards still use border accents via .task-urgent / .task-closed. */

.sidebar-rename-input {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}

/* === DROP ZONES === */
.kanban-drop-zone {
  border-radius: var(--radius-md);
  border: 2px dashed transparent;
  padding: 4px;
  min-height: 24px;
  transition: border-color 150ms, background 150ms;
}
.kanban-drop-zone.drop-highlight {
  border-color: var(--color-primary);
  background: rgba(13, 107, 110, 0.06);
}

/* Gantt panning cursor */
.gantt-body { cursor: grab; }
.gantt-body.gantt-panning { cursor: grabbing; }
.gantt-body .gantt-bar { cursor: pointer; }


.task-detail-field {
  margin-bottom: var(--space-4);
}

.task-detail-field-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.task-detail-field-value {
  font-size: var(--text-sm);
}

/* === TABS === */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-4);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  margin-bottom: -1px;
  position: relative;
}

.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: transparent; font-weight: 500; }

/* === COMMENTS === */
.comment {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.comment-author {
  font-size: var(--text-sm);
  font-weight: 500;
}

.comment-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.comment-text {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
}

.comment.system {
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.comment.system .system-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.comment.system .comment-author {
  font-weight: 500;
  color: var(--color-text-muted);
}

.comment.system .comment-text {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.comment-input-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.comment-input-row .form-input {
  flex: 1;
}

/* === LOGIN === */
.login-page {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

.login-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.login-logo svg { color: white; width: 24px; height: 24px; }

.login-logo-img {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto var(--space-4);
}

.pulse-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 var(--space-2);
}

.pulse-lockup-compact {
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
}

.sidebar-logo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-md);
}
.sidebar-logo-btn:hover { opacity: 0.85; }

.pulse-mark {
  display: block;
  flex-shrink: 0;
}

.pulse-word {
  font-family: 'Satoshi', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: 0.22em;
  color: var(--color-text);
  line-height: 1;
}

.pulse-lockup-compact .pulse-word {
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  color: var(--color-sidebar-text);
}

.login-byline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-6);
}


.login-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.login-code {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0;
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.15em;
  color: var(--color-primary);
}

.login-code-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.login-error {
  background: var(--color-error-light);
  color: var(--color-error);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* === NOTIFICATION DROPDOWN === */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: fadeIn 120ms var(--ease);
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.notif-dropdown-header h3 {
  font-size: var(--text-sm);
  font-weight: 600;
}

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

.notif-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
  line-height: 1.4;
  transition: background 100ms;
  cursor: pointer;
}

.notif-item:hover { background: var(--color-surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface)); }
.notif-item:last-child { border-bottom: none; }

.task-link {
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  transition: text-decoration 100ms;
}
.task-link:hover {
  text-decoration: underline;
}

.notif-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

.notif-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* === SEARCH RESULTS DROPDOWN === */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}
.search-see-all {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.search-see-all:hover { background: var(--color-surface-hover); }
.search-all-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 4px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.search-all-modal { max-width: 1040px; width: 96%; height: 86vh; max-height: 86vh; display: flex; flex-direction: column; }
.search-all-form { padding: 12px 20px 8px; border-bottom: 1px solid var(--color-border); }
.search-all-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; flex-wrap: wrap; }
.search-all-field { flex: 1; min-width: 160px; position: relative; }
.search-all-field-task { flex: 1.2; }
.search-all-combo {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--color-border); border-radius: 8px;
  max-height: 360px; overflow-y: auto; box-shadow: var(--shadow-md);
}
.search-all-combo-item { padding: 8px 10px; font-size: var(--text-sm); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.search-all-combo-item:hover { background: var(--color-surface-hover); }
.search-all-combo-empty { padding: 8px 10px; font-size: var(--text-xs); color: var(--color-text-faint); }
.search-all-body { padding: 8px 20px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.search-all-hint { color: var(--color-text-muted); font-size: var(--text-sm); padding: 24px 8px; }
.search-all-section { margin-top: 12px; }
.search-all-section-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 6px; }
.search-all-row-item { display: flex; gap: 8px; align-items: center; padding: 8px 6px; cursor: pointer; border-radius: 6px; }
.search-all-row-item:hover { background: var(--color-surface-hover); }
.search-all-table-head, .search-all-table-row {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 1.25fr 0.95fr 0.7fr;
  gap: 8px;
  padding: 8px 6px;
  font-size: var(--text-sm);
}
.search-all-table-row.is-active,
.search-all-row-item.is-active { background: var(--color-surface-hover); outline: 1px solid var(--color-primary); }
.search-result.is-active { background: var(--color-surface-hover); }
.search-see-all.is-active { background: var(--color-surface-hover); }
.search-all-table-head { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-faint); border-bottom: 1px solid var(--color-border); }
.search-all-table-row { cursor: pointer; border-radius: 6px; color: #1a1816; }
.search-all-table-row:hover { background: var(--color-surface-hover); }
.search-all-table-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-assignee-cell { overflow: visible !important; white-space: nowrap !important; }
.search-assignee-cell .avatar-stack-sm { flex-wrap: nowrap; }
.search-assignee-cell .avatar-sm { width: 22px; height: 22px; font-size: 9px; border: 2px solid #fff; }

.search-result {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search-result:hover { background: var(--color-surface-hover); }
.search-result svg { width: 14px; height: 14px; color: var(--color-text-faint); flex-shrink: 0; }

.search-result-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* === DASHBOARD CARDS === */

.dash-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  transition: box-shadow var(--duration-slow) var(--ease);
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.dash-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
}


.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* === MY TASKS LIST === */


.section-header {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}

.section-header.overdue { color: var(--color-error); }

/* === ADD NEW BUTTONS === */
.add-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  transition: all var(--duration) var(--ease);
}

.add-card-btn:hover { 
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.add-card-btn svg { width: 13px; height: 13px; }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

.empty-state h3 {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 300px;
}

/* === TIME LOG === */
.time-log-inline {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.time-log-inline .form-input {
  width: 80px;
}

/* === MULTI-SELECT AVATARS === */


/* === QUICK LOG === */
.quick-log {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.quick-log .form-input {
  width: 60px;
  padding: 3px 6px;
  font-size: var(--text-xs);
}

/* === SETTINGS / ADMIN === */
.settings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.settings-table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.settings-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.settings-table td:last-child {
  text-align: center;
  width: 48px;
}

.settings-table tr:hover td { background: var(--color-surface-2); }

.settings-inline-select {
  width: auto;
  padding: 5px 28px 5px 10px;
  font-size: var(--text-sm);
}

.settings-role-select {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
}

.settings-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  color: var(--color-text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.settings-delete-btn:hover {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.06);
}
.settings-delete-btn svg { width: 14px; height: 14px; }

/* === SIDEBAR WORKSPACE ROW (collapse + add project) === */
.ws-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.ws-header-btn {
  flex: 1;
  min-width: 0;
}

.ws-add-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-sidebar-muted);
  flex-shrink: 0;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
  opacity: 0;
}

.ws-row:hover .ws-add-btn {
  opacity: 1;
}

.ws-add-btn:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text);
}

.ws-add-btn svg {
  width: 14px;
  height: 14px;
}

/* === SIDEBAR ARCHIVED ITEMS === */
.sidebar-item-archived {
  opacity: 0.55;
  font-style: italic;
}

.sidebar-show-archived {
  color: var(--color-sidebar-muted) !important;
  font-size: var(--text-xs) !important;
  padding-left: 32px !important;
  opacity: 0.7;
}

.sidebar-show-archived:hover {
  opacity: 1;
}

.sidebar-show-archived svg {
  width: 13px !important;
  height: 13px !important;
}

/* === KANBAN SEARCH === */
.kanban-header {
  flex-wrap: wrap;
  gap: var(--space-3);
}

.kanban-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.kanban-search-wrap svg {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  color: var(--color-text-faint);
  pointer-events: none;
}

.kanban-search-input {
  padding: 5px 10px 5px 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font: inherit;
  color: inherit;
  outline: none;
  width: 200px;
  transition: border-color var(--duration) var(--ease);
}

.kanban-search-input:focus {
  border-color: var(--color-primary);
}

.kanban-search-input::placeholder {
  color: var(--color-text-faint);
}

/* === PROJECT TOP BAR (archive button area) === */
/* === PROJECT STATS BAR === */
.project-stats-bar {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  min-width: 0; /* allow flex children to actually respect their width */
}
/* 2/3 : 1/3 split — stats get the majority, notes get the rest. */
.project-stats-bar-content {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex: 2 1 0;
  min-width: 0;
  flex-wrap: wrap;
}
.project-stats-bar-notes {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--color-divider);
  padding-left: var(--space-4);
  overflow: hidden; /* hard cap on preview width */
}
.project-stats-bar-notes-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (max-width: 960px) {
  .project-stats-bar-content { flex-basis: 100%; }
  .project-stats-bar-notes { flex-basis: 100%; border-left: none; padding-left: 0; border-top: 1px solid var(--color-divider); padding-top: var(--space-3); }
}

.ribbon-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ribbon-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.service-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.service-type-badge svg { width: 12px; height: 12px; }

.project-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.project-type-badge svg { width: 12px; height: 12px; }
.project-type-badge.one-time { background: #f0f4ff; color: #4f6df5; }
.project-type-badge.ongoing { background: #ecfdf5; color: #059669; }
.project-type-badge.sm { font-size: 10px; padding: 2px 6px; }

/* Project type toggle in modal */
.project-type-toggle {
  display: flex;
  gap: var(--space-2);
}
.project-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 100ms;
}
.project-type-btn svg { width: 14px; height: 14px; }
.project-type-btn:hover { border-color: var(--color-text-muted); }
.project-type-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.hours-summary {
  flex: 1 1 auto;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hours-summary-stats {
  display: flex;
  gap: var(--space-5);
}
.hours-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hours-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hours-stat-value {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.hours-stat-value.over-budget {
  color: var(--color-danger);
}
.hours-progress-track {
  width: 100%;
  height: 4px;
  background: var(--color-bg-alt);
  border-radius: 2px;
  overflow: hidden;
}
.hours-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.hours-progress-fill.over-budget {
  background: var(--color-danger);
}
.budget-display {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-end;
}

.project-top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 32px;
}

/* === ARCHIVE BANNER === */
.archive-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-light);
  border: 1px solid color-mix(in srgb, var(--color-warning) 30%, transparent);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-warning);
}

.archive-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.archive-banner span {
  flex: 1;
  font-weight: 500;
}

/* === ADMIN ROLE BADGES === */
.admin-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-role-badge.role-planner {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.admin-role-badge.role-creator {
  background: #f0f9ff;
  color: #0369a1;
}

.admin-role-badge.role-placeholder {
  background: #fef3c7;
  color: #92400e;
}

.admin-role-badge.role-super-admin {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* === LEADERSHIP DASHBOARD === */


/* Health Table */


/* Utilization */


/* Project Detail Drilldown */

.detail-stat {
  text-align: center;
}


/* === NEW DASHBOARD === */


.dash-card-body {
  max-height: 420px;
  overflow-y: auto;
}


.dash-task-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 100ms;
  border-bottom: 1px solid var(--color-divider);
}

.dash-task-row:last-child {
  border-bottom: none;
}

.dash-task-row:hover {
  background: var(--color-surface-2);
}

.dash-task-info {
  flex: 1;
  min-width: 0;
}

.dash-task-title {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-task-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
}


.due-overdue { color: #dc2626; }
.due-today   { color: #d97706; }
.due-soon    { color: #2563eb; }
.due-normal  { color: var(--color-text-muted); }

.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  color: var(--color-text-faint);
}
.dash-empty svg { width: 24px; height: 24px; opacity: 0.5; }
.dash-empty p { font-size: var(--text-sm); margin: 0; }

/* Dashboard Inbox Feed */
.dash-inbox-list {
  display: flex;
  flex-direction: column;
}

.dash-inbox-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 100ms;
}
.dash-inbox-item:last-child { border-bottom: none; }
.dash-inbox-item:hover { background: var(--color-surface-2); }

.dash-inbox-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.dash-inbox-icon svg { width: 14px; height: 14px; }

.dash-inbox-content {
  flex: 1;
  min-width: 0;
}

.dash-inbox-msg {
  font-size: var(--text-sm);
  line-height: 1.4;
}

.dash-inbox-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* === ACTIVITY LOG === */
.activity-log-list {
  padding: var(--space-3) var(--space-4);
}

.activity-log-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}

.activity-log-entry:last-child { border-bottom: none; }

.activity-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-log-body {
  flex: 1;
  min-width: 0;
}

.activity-log-header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.activity-log-action {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.activity-log-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

.activity-log-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* ─── TIMESHEET VIEW ───────────────────────────────────────────────────────── */
.timesheet-view {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.timesheet-view > .mywork-view-as-bar {
  padding: 18px 28px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-divider);
}
.timesheet-view > .mywork-view-as-bar .mywork-view-as-inner {
  gap: var(--space-4);
}
.timesheet-view > .mywork-view-as-bar .mywork-view-as-banner {
  padding: 8px 16px;
}
.timesheet-view > .mywork-view-as-bar .mywork-view-as-select select {
  padding: 6px 12px;
  min-width: 200px;
}

.timesheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.timesheet-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ts-calendar-wrapper {
  position: relative;
  margin-left: 12px;
}

.timesheet-week-label.ts-calendar-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timesheet-week-label.ts-calendar-trigger:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.timesheet-week-label.ts-calendar-trigger svg {
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.timesheet-week-label.ts-calendar-trigger:hover svg {
  opacity: 0.8;
}

.ts-calendar-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 12px;
  min-width: 280px;
  animation: ts-cal-appear 0.15s ease;
}

@keyframes ts-cal-appear {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ts-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ts-cal-month-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  user-select: none;
}

.ts-cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 2px;
}

.ts-cal-day-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
  padding: 4px 0;
  user-select: none;
}

.ts-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-radius: 6px;
}

.ts-cal-week-active {
  background: var(--color-bg-hover);
}

.ts-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ts-cal-day:hover {
  background: var(--color-bg-hover);
}

.ts-cal-day-outside {
  color: var(--color-text-muted);
  opacity: 0.4;
}

.ts-cal-day-today {
  font-weight: 700;
  color: var(--color-accent);
  position: relative;
}

.ts-cal-day-today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
}

.ts-cal-day-in-week {
  font-weight: 600;
}

.ts-cal-today-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.ts-cal-today-btn:hover {
  background: var(--color-bg-hover);
}

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

.timesheet-total {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.timesheet-total strong {
  color: var(--color-text);
  font-weight: 600;
}

.timesheet-search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  width: 340px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px;
  margin-top: 4px;
}

.timesheet-search-dropdown .form-input {
  width: 100%;
  margin-bottom: 4px;
}

.timesheet-search-results {
  max-height: 240px;
  overflow-y: auto;
}

.timesheet-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: var(--text-sm);
}

.timesheet-search-item:hover {
  background: var(--color-bg-hover);
}

.timesheet-search-title {
  font-weight: 500;
  color: var(--color-text);
}

.timesheet-search-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* Grid */
.timesheet-grid-wrapper {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.timesheet-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  table-layout: fixed;
}

.timesheet-grid th,
.timesheet-grid td {
  padding: 0;
  border-bottom: 1px solid var(--color-divider);
  vertical-align: middle;
  height: 40px;
}

.timesheet-grid thead th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 8px;
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--color-divider);
}

/* Column widths — clamp() info cols scale with viewport, days absorb rest */
.ts-col-pin { width: 28px; text-align: center; }
.ts-col-context { width: clamp(160px, 16%, 240px); padding: 0 10px !important; text-align: left; overflow: hidden; }
.ts-col-task { width: clamp(170px, 17%, 280px); padding: 0 10px !important; text-align: left; overflow: hidden; }
.ts-col-status { width: 72px; padding: 0 4px !important; text-align: left; overflow: hidden; }
.ts-col-day-wd { width: auto; text-align: center; border-right: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06)); }
.ts-col-day-we { width: 72px; text-align: center; border-right: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06)); }
.ts-col-total { width: 56px; text-align: center; font-weight: 600; }

/* Today highlight — light blue-grey tint */
.ts-today {
  background: rgba(100, 145, 190, 0.12);
}

thead .ts-today {
  color: var(--color-primary);
  font-weight: 600;
}

/* Weekend columns — darker grey */
.ts-weekend {
  background: rgba(0, 0, 0, 0.07);
  color: var(--color-text-faint);
}

thead .ts-weekend {
  color: var(--color-text-faint);
}

/* Today takes priority over weekend */
.ts-today.ts-weekend {
  background: rgba(100, 145, 190, 0.12);
  color: var(--color-text-muted);
}

/* Pin button */
.ts-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-faint);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

.ts-pin-btn:hover {
  opacity: 1;
  color: var(--color-primary);
  transform: scale(1.15);
}

.ts-pin-btn.pinned {
  opacity: 1;
  color: var(--color-primary);
  transform: rotate(-45deg);
}

tr:hover .ts-pin-btn {
  opacity: 0.5;
}

tr:hover .ts-pin-btn.pinned {
  opacity: 1;
}

/* Pinned row gets a subtle left accent */
.ts-row-pinned {
  border-left: 3px solid var(--color-primary);
}

/* Task name */
.ts-task-title {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Clickable task link */
a.ts-task-link,
a.ts-context-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.12s;
}

a.ts-task-link:hover,
a.ts-context-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Completed / Pending Client Action row — struck-through, dimmed */
.ts-row-completed .ts-task-title,
.ts-row-completed .ts-client-name,
.ts-row-completed .ts-project-name,
.ts-row-completed .ts-status-badge {
  text-decoration: line-through;
  opacity: 0.55;
}

.ts-row-completed .ts-cell-value {
  opacity: 0.5;
}

.ts-row-completed .ts-row-total {
  opacity: 0.5;
}

/* Combined Project / Client cell — stacked layout */
.ts-col-context {
  overflow: hidden;
}

.ts-project-name {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ts-client-name {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Time cells */
.ts-cell {
  cursor: pointer;
  transition: background 0.12s;
  padding: 0 2px !important;
  position: relative;
}

.ts-cell:hover {
  background: rgba(13, 107, 110, 0.08);
}

.ts-cell.has-time {
  font-weight: 500;
  color: var(--color-text);
}

.ts-cell-value {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  min-height: 24px;
  line-height: 24px;
}

.ts-cell.has-time .ts-cell-value {
  color: var(--color-text);
  font-weight: 500;
}

/* "+" hover indicator for empty cells */


/* Small dot indicator for cells with notes */
.ts-cell-note-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.6;
}

/* Timesheet read-only mode (viewing another user) */
.ts-readonly .ts-cell { cursor: default; }
.ts-readonly .ts-cell:hover { background: none; }

/* Entry popover — Wrike-style inline edit */
.ts-entry-popover {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
  padding: 6px 8px;
  min-width: 280px;
  white-space: nowrap;
}

.ts-entry-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ts-entry-time {
  width: 72px;
  flex-shrink: 0;
  border: 1px solid var(--color-divider);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  text-align: left;
}

.ts-entry-time:focus {
  border-color: var(--color-primary);
}

.ts-entry-comment {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--color-divider);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
}

.ts-entry-comment:focus {
  border-color: var(--color-primary);
}

.ts-entry-delete,
.ts-entry-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  color: var(--color-text-faint);
  transition: color 0.12s, background 0.12s;
}

.ts-entry-delete:hover {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
}

.ts-entry-close:hover {
  color: var(--color-text-muted);
  background: var(--color-bg-hover);
}

[data-theme="dark"] .ts-entry-popover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Row total */
.ts-row-total {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
}

/* Daily totals bar — sticky inside .timesheet-grid-wrapper */
.ts-totals-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--color-surface, var(--color-bg));
  border-top: 2px solid var(--color-divider, var(--color-border));
}
.ts-totals-bar .ts-totals-table td {
  font-weight: 600;
  padding: 6px 4px !important;
}
.ts-totals-bar .ts-week-total {
  color: var(--color-primary);
}
.ts-totals-bar .ts-today {
  background: rgba(100, 145, 190, 0.05);
}

.ts-totals-label {
  text-align: right !important;
  font-size: var(--text-xs) !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted) !important;
}

.ts-day-total {
  text-align: center;
}

.ts-grand-total {
  text-align: center;
  color: var(--color-primary) !important;
}

.ts-grand-total strong {
  font-size: var(--text-sm);
}

/* Row hover */
.timesheet-grid tbody tr:hover {
  background: var(--color-bg-hover);
}

.timesheet-grid tbody tr:hover .ts-today {
  background: rgba(100, 145, 190, 0.18);
}

/* Timesheet sort control */
.timesheet-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
}

.ts-sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-hover);
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  padding: 4px 24px 4px 10px;
  font-size: var(--text-xs);
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  outline: none;
}

.ts-sort-select:hover {
  border-color: var(--color-text-muted);
}

.ts-sort-select:focus {
  border-color: var(--color-primary);
}

/* ── GOOGLE DRIVE ATTACHMENT STYLES ────────────────────────────────────────── */
.attachment-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.attachment-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.attachment-upload-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: 420px;
  line-height: 1.35;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: var(--text-sm);
  transition: background 0.15s;
}

.attachment-item:hover {
  background: var(--color-surface-hover, rgba(0,0,0,0.03));
}

.drive-attachment {
  border: 1px solid var(--color-divider);
  border-radius: 8px;
  margin-bottom: 4px;
}

.drive-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.attachment-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

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

.attachment-title {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-title:hover {
  text-decoration: underline;
}

.attachment-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 1px;
}

.drive-type-badge {
  font-weight: 500;
  font-size: var(--text-xs);
}

/* ── REPORTS STYLES ────────────────────────────────────────────────────────── */
.reports-container {
  max-width: 1100px;
}

.report-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.report-stat-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-divider);
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}

.report-stat-card.alert {
  border-color: var(--color-error);
  background: rgba(220, 38, 38, 0.04);
}

.report-stat-card.critical {
  border-color: var(--color-error);
}

.report-stat-card.warning {
  border-color: var(--color-warning);
}

.report-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.report-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.report-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.report-filter-btns {
  display: flex;
  gap: 4px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.report-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
}

.report-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-divider);
  vertical-align: middle;
}

.report-table tbody tr:hover {
  background: var(--color-surface-hover, rgba(0,0,0,0.02));
}

.report-link {
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.report-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}


.report-status-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

.report-status-badge.active {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.report-status-badge.archived {
  background: rgba(0,0,0,0.06);
  color: var(--color-text-muted);
}

.report-bar {
  position: relative;
  height: 20px;
  background: var(--color-divider);
  border-radius: 4px;
  overflow: hidden;
}

.report-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.report-bar-label {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text);
  mix-blend-mode: multiply;
}


/* ── Reports: Project Status Expandable Rows ── */

.ps-project-row {
  transition: background 0.1s ease;
}
.ps-project-row:hover {
  background: var(--color-bg-elevated) !important;
}
.ps-project-row.ps-expanded {
  background: var(--color-bg-elevated);
  border-bottom: none;
}
.ps-project-row.ps-expanded td {
  border-bottom-color: transparent;
}
.ps-task-row {
  background: var(--color-bg);
}
.ps-task-row td {
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.04));
  padding-top: 6px;
  padding-bottom: 6px;
}
.ps-task-row:last-child td,
.ps-task-row + .ps-project-row td {
  border-bottom-color: var(--color-border);
}
.ps-expand-arrow {
  user-select: none;
}

/* ── Reports: Monthly Breakdown Panel ── */

.ps-monthly-panel {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.ps-monthly-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.monthly-breakdown-table {
  font-size: var(--text-sm);
}
.monthly-breakdown-table thead th {
  white-space: nowrap;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.monthly-breakdown-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--color-bg-elevated);
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.monthly-project-row td {
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}
.monthly-project-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-bg-elevated);
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.monthly-task-row td {
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.04));
}
.monthly-task-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-bg);
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

/* ── Reports: Team Utilization Bars ── */


/* ── Reports: Overdue ── */


.overdue-days-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.overdue-days-badge.critical {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.overdue-days-badge.warning {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.overdue-days-badge.minor {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-muted);
}

/* === AVATAR IMAGE SUPPORT === */
.avatar-img {
  overflow: hidden;
  padding: 0;
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* === SIDEBAR USER HOVER === */
.sidebar-user {
  transition: background var(--duration) var(--ease);
}

.sidebar-user:hover {
  background: var(--color-sidebar-hover);
}

/* === PROFILE MODAL === */
.profile-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  width: 540px;
  max-width: 90vw;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalSlideUp var(--duration-slow) var(--ease) both;
}

.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.profile-modal-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.profile-modal-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-height: min(72vh, 740px);
  overflow-y: auto;
}

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.profile-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-preview.clickable { cursor: pointer; }
.profile-avatar-preview.clickable:hover { opacity: 0.85; transform: scale(1.05); transition: all 0.15s ease; }

.profile-avatar-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.profile-avatar-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
}

.profile-avatar-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}

.profile-field input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.profile-field input:focus {
  border-color: var(--color-primary);
}

.profile-field-disabled {
  background: var(--color-surface-2) !important;
  color: var(--color-text-faint) !important;
  cursor: not-allowed;
}

.profile-theme-toggle {
  display: flex;
  gap: var(--space-2);
}

.profile-theme-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.profile-theme-btn:hover {
  border-color: var(--color-text-faint);
  color: var(--color-text);
}

.profile-theme-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}

.profile-theme-btn i {
  width: 16px;
  height: 16px;
}

.profile-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* === MY WORK PAGE === */
.mywork-page {
  padding: var(--space-3) var(--space-4);
}

/* View As Another User bar */
.mywork-view-as-bar {
  margin-bottom: var(--space-3);
}
.mywork-view-as-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.mywork-view-as-select {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.mywork-view-as-select label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.mywork-view-as-select select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  min-width: 180px;
}
.mywork-view-as-select select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}
.mywork-view-as-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--color-primary-alpha);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
}
.mywork-view-as-banner .btn {
  margin-left: var(--space-2);
  font-size: var(--text-xs);
}

.back-to-report-btn {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-radius: var(--radius-sm);
  padding: 3px 10px !important;
  gap: 4px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.back-to-report-btn:hover {
  opacity: 0.85;
}

.mywork-board {
  min-height: 0;
}

.mywork-col .kanban-column-header {
  position: relative;
}

.mywork-col-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
  margin-top: 1px;
  padding-left: 18px;
}

/* Scrollable column body */
.mywork-col-body {
  max-height: 54vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Don't squash cards when a column is full — scroll instead. */
.mywork-col-body .task-card,
.mywork-col-body .kanban-drop-zone,
.mywork-col-body .mywork-priority-bucket,
.mywork-col-body .mywork-review-section {
  flex-shrink: 0;
}

/* Thin scrollbar for My Work columns */
.mywork-col-body::-webkit-scrollbar { width: 4px; }
.mywork-col-body::-webkit-scrollbar-track { background: transparent; }
.mywork-col-body::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.mywork-col-body::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

/* Card layout: title + priority top row, context + due bottom row */
/* My Work card breadcrumb — sits above the title */
.mywork-card-context {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  min-width: 0;
}

.mywork-client-tag {
  font-size: 10px;
  color: var(--color-text-secondary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mywork-context-sep {
  font-size: 10px;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.mywork-tag-link {
  cursor: pointer;
  border-radius: 3px;
  transition: background 120ms ease, color 120ms ease;
}
.mywork-client-tag.mywork-tag-link:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-primary);
}
.mywork-project-tag.mywork-tag-link:hover {
  background: color-mix(in srgb, var(--color-surface-2) 60%, var(--color-primary) 20%);
  color: var(--color-primary);
}

.mywork-project-tag {
  font-size: 10px;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Priority bucket labels inside columns */
.mywork-priority-bucket {
  margin-bottom: var(--space-1);
}

.mywork-bucket-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0 4px 2px;
  color: var(--color-text-faint);
}

.mywork-bucket-label.urgent { color: #ef4444; }
.mywork-bucket-label.high { color: #f59e0b; }
.mywork-bucket-label.low { color: var(--color-text-faint); }

.mywork-empty-col {
  padding: var(--space-6) var(--space-3);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

.mywork-lower {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Review column sub-sections */
.mywork-review-section {
  margin-bottom: var(--space-2);
}

.mywork-review-section:last-child {
  margin-bottom: 0;
}

.mywork-review-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  padding: 4px 2px 6px;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-1);
}

.mywork-review-section-label .kanban-count {
  font-size: 9px;
}

/* Read-only Service Ends helper text on the Edit Project form (ongoing). */
.ongoing-end-info-text {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  padding: 8px 10px;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.ongoing-end-info-text strong {
  color: var(--color-text);
}

/* Day / Week / Month time-window header for Closed > Completed.
   The pending zone above sometimes had its task-card visually overflow
   into the next zone because the drop-zones use plain block layout
   (no flex / no gap), so we make the bottom drop-zone a flex column
   and the header stretches to full width with explicit spacing. */
.mywork-completed-col .kanban-drop-zone {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;  /* don't compress the zone itself */
}
/* Keep cards at their natural height so they never get squished when the
   completed list overflows — the column body itself handles scrolling. */
.mywork-completed-col .kanban-drop-zone > * {
  flex-shrink: 0;
}
/* Same protection for the Pending Client Action zone above. Without this,
   when the Completed zone has many cards the flex column compresses the
   pending card to fit, causing it to overlap. */
.mywork-completed-col > .kanban-drop-zone:first-child {
  flex-shrink: 0;
}
.mywork-completed-header {
  display: block;
  padding: 10px 4px 8px;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
  background: var(--color-bg);
  position: relative;
  z-index: 1;
  min-height: 56px;
  box-sizing: border-box;
  width: 100%;
}
.mywork-completed-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.mywork-completed-header-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}
.mywork-completed-header .kanban-count {
  font-size: 9px;
}
.mywork-completed-window-tabs {
  display: flex;
  gap: 2px;
  background: var(--color-bg-raised);
  border-radius: var(--radius-sm);
  padding: 2px;
  width: fit-content;
  white-space: nowrap;
}
.mywork-completed-window-tab {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 3px 10px;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.mywork-completed-window-tab:hover {
  color: var(--color-text);
}
.mywork-completed-window-tab.active {
  background: var(--color-bg);
  color: var(--color-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.mywork-empty-subsection {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-1);
  font-style: italic;
}

/* Completed this Week column */
.mywork-completed-col {
  opacity: 0.85;
}


/* Side-by-side lower section */
.mywork-lower-split {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: start;
}

.mywork-lower-left,
.mywork-lower-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.mywork-section-fill {
  flex: 1;
}

/* Inbox scroll cap inside My Work lower split */
.mywork-lower-left .dash-inbox-list {
  max-height: 480px;
  overflow-y: auto;
}

.mywork-lower-left .dash-inbox-list::-webkit-scrollbar { width: 4px; }
.mywork-lower-left .dash-inbox-list::-webkit-scrollbar-track { background: transparent; }
.mywork-lower-left .dash-inbox-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.mywork-lower-left .dash-inbox-list::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

.mywork-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-3) var(--space-4);
}

.mywork-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.mywork-section-header.clickable {
  cursor: pointer;
  user-select: none;
}

.mywork-section-header h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.mywork-section-header h3 > span {
  display: flex;
}

.mywork-section-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.mywork-task-list {
  display: flex;
  flex-direction: column;
}

.mywork-blocked-row {
  opacity: 0.7;
}

.mywork-upcoming-row {
  opacity: 0.8;
}

.mywork-status-chip {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
  white-space: nowrap;
}

.mywork-status-chip.in-progress { color: #3b82f6; background: rgba(59,130,246,0.08); }
.mywork-status-chip.ongoing { color: #0ea5e9; background: rgba(14,165,233,0.08); }
.mywork-status-chip.todo { color: var(--color-text-faint); }

.mywork-blocked-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--color-text-faint);
  background: rgba(0,0,0,0.04);
  padding: 1px 6px;
  border-radius: 4px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mywork-blocked-tag > span {
  display: flex;
}

[data-theme="dark"] .mywork-blocked-tag {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .mywork-project-tag {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .mywork-status-chip {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .mywork-status-chip.in-progress { background: rgba(59,130,246,0.15); }

/* Revision button */
.btn-revision {
  background: var(--color-warning, #f59e0b) !important;
  color: #fff !important;
  border: none;
  font-weight: 600;
  gap: 6px;
  padding: 5px 14px !important;
  border-radius: var(--radius-md);
}

.btn-revision:hover {
  background: #d97706 !important;
}

/* === DARK MODE OVERRIDES === */
[data-theme="dark"] .sidebar-item-archived {
  color: var(--color-text-faint);
}

[data-theme="dark"] .overdue-days-badge.minor {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .kanban-column {
  background: var(--color-surface-2);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .btn-secondary {
  background: var(--color-surface-2);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .btn-ghost {
  color: var(--color-text-muted);
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

[data-theme="dark"] .priority-badge.urgent { background: #2d1515; color: #f87171; }
[data-theme="dark"] .priority-badge.high { background: #2d1f10; color: #fb923c; }
[data-theme="dark"] .priority-badge.medium { background: #2d2410; color: #fbbf24; }
[data-theme="dark"] .priority-badge.low { background: #0f2d18; color: #4ade80; }

[data-theme="dark"] .status-badge { border-color: var(--color-border); }

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}


/* ─── NEW STATUS DOT COLORS ──────────────────────────────────────────────── */
.status-dot.needs-attention { background: #f59e0b; }
.status-dot.pending-client { background: #8b5cf6; }
.status-dot.ongoing { background: #0ea5e9; }

/* ─── IMAGE LIGHTBOX ──────────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.15s ease;
}
.lightbox-content {
  position: relative;
  text-align: center;
}
.lightbox-image {
  width: 500px;
  height: 500px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-name {
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: 16px;
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(0,0,0,0.8); }

/* ─── SEARCHABLE MULTI-SELECT ─────────────────────────────────────────────── */
.searchable-multi-select {
  position: relative;
  width: 100%;
}
.sms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.sms-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 2px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-divider);
  border-radius: 20px;
  font-size: var(--text-xs);
  color: var(--color-text);
}
.sms-chip .avatar-sm { width: 20px; height: 20px; font-size: 9px; }
.sms-chip-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
}
.sms-chip-remove:hover { color: var(--color-text); }
.sms-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  font-size: var(--text-xs);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}
.sms-search-input:focus { border-color: var(--color-accent); }
.sms-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 160px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  margin-top: 4px;
}
.sms-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text);
  text-align: left;
}
.sms-dropdown-item:hover { background: var(--color-surface-hover); }
.sms-dropdown-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sms-load {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

[data-theme="dark"] .sms-search-input { background: var(--color-surface); }
[data-theme="dark"] .sms-dropdown { background: var(--color-surface); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
[data-theme="dark"] .lightbox-close { background: rgba(255,255,255,0.2); }
[data-theme="dark"] .lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ─── TIMESHEET CELL INNER ─────────────────────────────────────────────────── */
.ts-cell-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 24px;
  height: 100%;
}

/* ─── TIMESHEET STATUS BADGES ────────────────────────────────────────────── */
.ts-col-status {
  overflow: hidden;
}
.ts-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.4;
  background: var(--color-surface-elevated);
  color: var(--color-text-muted);
}
.ts-status-to-do { background: rgba(100, 145, 190, 0.15); color: var(--color-primary); }
.ts-status-in-progress { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.ts-status-ongoing { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.ts-status-internal-review { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.ts-status-needs-attention { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.ts-status-pending-client-action { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.ts-status-completed { background: rgba(34, 197, 94, 0.15); color: #16a34a; }

/* ─── TIMESHEET 3-COL CELL (quick-log buttons) ───────────────────────────── */
.ts-cell-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  padding: 0;
  position: relative;
}
/* ── Timesheet inline hover grid for quick actions ── */
.ts-cell-actions {
  position: relative;
  height: 100%;
}
.ts-cell-display {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.ts-cell-hover-grid {
  display: none;
  position: absolute;
  inset: 0;
  grid-template-columns: 1fr 1fr 1fr minmax(36px, 0.7fr);
  grid-template-rows: 1fr;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(1px);
  z-index: 5;
  height: 100%;
}
.ts-cell:hover .ts-cell-hover-grid {
  display: grid;
}
/* Value stays visible behind the semi-transparent grid */
.ts-hg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-right: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary, #01696F);
  padding: 0 2px;
  transition: background 0.1s;
  user-select: none;
}
.ts-hg-btn:hover {
  background: rgba(1, 105, 111, 0.08);
}
.ts-hg-tall {
  /* Full height of the cell */
}
.ts-hg-weekend {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
}
.ts-hg-weekend .ts-hg-btn {
  border-right: none;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
}
.ts-hg-weekend .ts-hg-btn:last-child {
  border-bottom: none;
}
.ts-hg-split {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ts-hg-split .ts-hg-btn {
  flex: 1;
  border-right: none;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
  min-height: 0;
}
.ts-hg-split .ts-hg-btn:last-child {
  border-bottom: none;
}
.ts-hg-custom {
  font-size: 14px;
  font-weight: 400;
}
.ts-hg-delete {
  color: var(--color-error) !important;
}
.ts-hg-delete:hover {
  background: rgba(161, 44, 123, 0.08);
}
.ts-quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 1px 0;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
  min-height: 24px;
  border-radius: 3px;
  user-select: none;
}
.ts-cell:hover .ts-quick-btn {
  opacity: 0.8;
}
.ts-quick-btn:hover {
  opacity: 1 !important;
  background: rgba(100, 145, 190, 0.12);
}
.ts-quick-plus {
  font-size: 14px;
  font-weight: 600;
}
/* When cell has time, show value centered, buttons appear on hover */
.ts-cell-value-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  pointer-events: none;
  transition: opacity 0.12s;
}
.ts-cell:hover .ts-cell-value-overlay {
  opacity: 0;
}
.ts-cell.has-time .ts-quick-btn {
  opacity: 0;
}
.ts-cell.has-time:hover .ts-quick-btn {
  opacity: 0.8;
}
.ts-readonly .ts-quick-btn { display: none; }
.ts-readonly .ts-cell-value-overlay { opacity: 1 !important; }

.btn-xs {
  padding: 3px 8px;
  font-size: var(--text-xs);
  border-radius: 4px;
}


/* ─── REPORTS CLIENT FILTER (Feature 3) ───────────────────────────────────── */
.reports-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.report-client-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.report-client-filter .form-select {
  padding: 4px 8px;
  height: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/*  CLIENT SUMMARY VIEW                                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar chevron toggle ────────────────────────────────────────────────── */
.ws-chevron-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-sidebar-muted);
  flex-shrink: 0;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.ws-chevron-btn:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text);
}

.ws-chevron-btn svg {
  width: 14px;
  height: 14px;
}

/* ── Top row: Details + Overview cards ─────────────────────────────────────── */
.client-summary {
  padding: var(--space-6);
}

.cs-top-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.cs-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.cs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}

.cs-card-header svg {
  color: var(--color-primary);
}

.cs-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

/* ── Client details display ────────────────────────────────────────────────── */
.cs-details-display {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-description {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}

.cs-description.cs-empty,
p.cs-empty {
  color: var(--color-text-faint);
  font-style: italic;
  font-size: var(--text-sm);
}


.cs-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.cs-contact-item svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Multiple contacts */
.cs-contacts-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-divider);
}

.cs-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-contact-card {
  padding: 8px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
}

.cs-contact-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
}

.cs-contact-card-header svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.cs-contact-name {
  color: var(--color-text);
}

.cs-contact-role {
  color: var(--color-text-faint);
  font-weight: 400;
  font-size: var(--text-xs);
}

.cs-contact-role::before {
  content: '\2022';
  margin: 0 4px;
}

.cs-contact-details {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding-left: 20px;
}

.cs-contact-edit-row {
  padding: 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--color-surface-raised);
}

/* ── Details edit form ─────────────────────────────────────────────────────── */
.cs-details-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-details-form textarea.form-input {
  min-height: 60px;
  resize: vertical;
}

/* ── KPI grid (Overview card) ──────────────────────────────────────────────── */
.cs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-4);
}
.cs-kpi-2x3 {
  grid-template-columns: repeat(2, 1fr);
}

.cs-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
}

.cs-kpi-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.cs-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.cs-kpi-alert { border: 1px solid var(--color-error); }
.cs-kpi-alert .cs-kpi-value { color: var(--color-error); }
.cs-overdue-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); color: var(--color-error); font-weight: 600;
  margin-top: 4px;
}

/* ── Time filter bar ───────────────────────────────────────────────────────── */
.cs-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.cs-filter-presets {
  display: flex;
  gap: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2px;
}

.cs-filter-btn {
  padding: 5px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.cs-filter-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

.cs-filter-btn.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.cs-custom-dates {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Section headers (Active Projects, Archived Projects) ──────────────────── */
.cs-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.cs-section-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.cs-section-count {
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ── Project cards grid ────────────────────────────────────────────────────── */
.cs-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.cs-project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-project-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.cs-project-card.cs-archived {
  opacity: 0.6;
}

.cs-project-card.cs-archived:hover {
  opacity: 0.85;
}

.cs-project-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow: hidden;
}

.cs-project-header .service-type-badge,
.cs-project-header .project-type-badge {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  flex-shrink: 1;
  min-width: 0;
}

.cs-project-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

/* ── Project progress rows ─────────────────────────────────────────────────── */
.cs-project-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-progress-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cs-progress-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.cs-progress-value.over-budget {
  color: var(--color-error);
}

/* ── Project budget line ───────────────────────────────────────────────────── */
.cs-project-budget {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider);
}

/* ── View Toggle Bar ──────────────────────────────────────────────────────── */
.view-toggle-bar {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}
.view-toggle-btns {
  display: flex;
  gap: 2px;
  background: var(--color-bg-subtle);
  border-radius: 6px;
  padding: 2px;
}
.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn:hover { color: var(--color-text); }
.view-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ── Gantt Chart ──────────────────────────────────────────────────────────── */
.gantt-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-divider);
  border-radius: 8px;
  background: var(--color-surface);
  overflow: hidden;
}

.gantt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg-subtle);
}
.gantt-zoom-btns {
  display: flex;
  gap: 2px;
  background: var(--color-surface);
  border-radius: 5px;
  padding: 2px;
}
.gantt-zoom-btn {
  padding: 3px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
}
.gantt-zoom-btn:hover { color: var(--color-text); }
.gantt-zoom-btn.active {
  background: var(--color-primary);
  color: #fff;
}
.gantt-today-btn {
  padding: 3px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 4px;
  background: var(--color-surface);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
}
.gantt-today-btn:hover { color: var(--color-text); border-color: var(--color-text-muted); }

.gantt-export-btn {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 4px;
  background: var(--color-surface);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gantt-export-btn:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.gantt-export-btn:disabled { opacity: 0.5; cursor: wait; }

.gantt-chart-area {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Left labels panel */
.gantt-labels {
  width: 200px;
  min-width: 200px;
  border-right: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
}
.gantt-labels-header {
  height: 50px;
  display: flex;
  align-items: flex-end;
  padding: 0 12px 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg-subtle);
}
.gantt-labels-body {
  overflow-y: auto;
  overflow-x: hidden;
}
.gantt-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-divider);
  transition: background 0.1s;
}
.gantt-label-row:hover {
  background: var(--color-bg-subtle);
}
.gantt-label-row.dragging {
  opacity: 0.7;
  background: var(--color-bg-subtle);
}
.gantt-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gantt-label-text {
  font-size: var(--text-xs);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* Right timeline panel */
.gantt-timeline-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.gantt-timeline-header {
  overflow: hidden;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg-subtle);
  flex-shrink: 0;
}
.gantt-header-inner {
  display: flex;
  flex-direction: column;
}
.gantt-month-row {
  display: flex;
  height: 24px;
  position: relative;
}
.gantt-month-cell {
  position: absolute;
  height: 24px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-divider);
  white-space: nowrap;
  overflow: hidden;
}
.gantt-day-row {
  display: flex;
  height: 26px;
}
.gantt-day-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-text-faint);
  border-right: 1px solid color-mix(in srgb, var(--color-divider) 50%, transparent);
  flex-shrink: 0;
}
.gantt-day-cell.weekend {
  background: color-mix(in srgb, var(--color-divider) 30%, transparent);
  color: var(--color-text-faint);
}
.gantt-day-cell.monday {
  border-left: 1px solid var(--color-divider);
}

/* Scrollable body */
.gantt-body {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
}
.gantt-body-rows {
  position: relative;
}

/* Weekend stripes */
.gantt-weekend-stripe {
  position: absolute;
  top: 0;
  background: color-mix(in srgb, var(--color-divider) 20%, transparent);
  pointer-events: none;
}

/* Today line */
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-error);
  z-index: 5;
  pointer-events: none;
}
.gantt-today-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
}

/* Bars */
.gantt-bar-wrap {
  position: absolute;
  height: 28px;
  display: flex;
  align-items: center;
  z-index: 2;
  user-select: none;
}
.gantt-bar-wrap.dragging {
  z-index: 100;
  opacity: 0.9;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
}
.gantt-bar-wrap.dragging .gantt-bar {
  box-shadow: 0 0 0 2px var(--color-primary), 0 8px 24px rgba(59,130,246,0.2);
  transform: scaleY(1.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.gantt-bar-wrap.gantt-bar-unscheduled {
  left: 12px;
}
.gantt-bar-no-dates {
  font-size: 10px;
  color: var(--color-text-faint);
  font-style: italic;
  padding: 0 4px;
}

.gantt-bar {
  flex: 1;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  cursor: grab;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.gantt-bar:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.gantt-bar:active {
  cursor: grabbing;
}
.gantt-bar-label {
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Ongoing bars — extend to timeline edge with fade-out */
.gantt-bar-wrap.ongoing .gantt-bar {
  -webkit-mask-image: linear-gradient(to right, #000 80%, transparent 100%);
  mask-image: linear-gradient(to right, #000 80%, transparent 100%);
  border-radius: 4px 0 0 4px;
}
.gantt-bar-wrap.ongoing .gantt-resize-handle.right,
.gantt-bar-wrap.ongoing .gantt-dep-dot.right {
  display: none;
}

/* Resize handles */
.gantt-resize-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}
.gantt-resize-handle.left { left: -2px; }
.gantt-resize-handle.right { right: -2px; }
.gantt-resize-handle:hover {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* ── Dependencies ──────────────────────────────────────────────────────────── */

/* Gantt Dependency Dot Handles */
.gantt-dep-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0d6b6e;
  border: 2px solid #fff;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  cursor: crosshair;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.gantt-dep-dot.left { left: -6px; }
.gantt-dep-dot.right { right: -6px; }
.gantt-bar-wrap:hover .gantt-dep-dot,
.gantt-dep-dot.active {
  opacity: 1;
}
.gantt-dep-dot:hover {
  transform: translateY(-50%) scale(1.3);
  background: #0a5557;
}
.gantt-dep-dot.active {
  background: #0a5557;
  transform: translateY(-50%) scale(1.3);
}

/* Highlight target bar during dep drawing */
.gantt-bar-wrap.gantt-dep-target .gantt-bar {
  outline: 2px solid #0d6b6e;
  outline-offset: 1px;
  box-shadow: 0 0 8px rgba(13, 107, 110, 0.3);
}

/* Delete dependency button (on arrow) */
.gantt-dep-delete-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.1s;
}
.gantt-dep-delete-btn:hover {
  transform: scale(1.15);
  background: #b91c1c;
}

/* Task card badge */
.dep-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}
.dep-badge.dep-pending {
  background: color-mix(in srgb, var(--color-warning) 15%, transparent);
  color: var(--color-warning);
}

/* Task detail dependency list */
.dep-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.dep-dependents {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-divider);
}
.dep-section-label {
  font-size: 10px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.dep-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--color-bg-subtle);
  font-size: var(--text-xs);
}
.dep-item-reverse {
  opacity: 0.7;
}
.dep-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dep-status-dot.completed {
  background: var(--color-success);
}
.dep-status-dot.pending {
  background: var(--color-warning);
}
.dep-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
  font-weight: 500;
}
.dep-status-label {
  font-size: 10px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.dep-remove-btn {
  border: none;
  background: none;
  color: var(--color-text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.dep-remove-btn:hover {
  color: var(--color-error);
}
.dep-add-btn {
  margin-top: 6px;
  font-size: var(--text-xs) !important;
  gap: 4px;
}

/* Dependency search dropdown */
.dep-search-wrap {
  margin-top: 6px;
}
.dep-search-input {
  font-size: var(--text-xs) !important;
  padding: 5px 8px !important;
}
.dep-search-results {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  margin-top: 4px;
  background: var(--color-surface);
}
.dep-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.1s;
  gap: 8px;
}
.dep-search-item:hover {
  background: var(--color-bg-subtle);
}
.dep-search-item-title {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.dep-search-item-status {
  font-size: 10px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.dep-search-empty {
  padding: 12px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ─── INBOX ──────────────────────────────────────────────────────────────── */
.inbox-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}
.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.inbox-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inbox-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
}
.inbox-unread-badge {
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.inbox-broadcast-composer {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.broadcast-composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.broadcast-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.broadcast-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 6px 0 !important;
  font-size: var(--text-sm);
}
.broadcast-input:focus {
  box-shadow: none !important;
}
.broadcast-send-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  font-size: var(--text-sm);
}
.inbox-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.inbox-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-faint);
}
.inbox-empty svg {
  opacity: 0.3;
  margin-bottom: 12px;
}
.inbox-empty h3 {
  margin: 0 0 4px 0;
  font-weight: 500;
  color: var(--color-text-muted);
}
.inbox-empty p {
  margin: 0;
  font-size: var(--text-sm);
}
.inbox-feed {
  display: flex;
  flex-direction: column;
}
.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.inbox-item:hover {
  background: var(--color-bg-hover);
}
.inbox-item.unread {
  background: var(--color-bg-raised);
}
.inbox-item.unread:hover {
  background: var(--color-bg-hover);
}
.inbox-item + .inbox-item {
  border-top: 1px solid var(--color-divider);
}
.inbox-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
}
.inbox-item-icon.assigned { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.inbox-item-icon.comment { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.inbox-item-icon.mention { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.inbox-item-icon.review { background: rgba(234, 179, 8, 0.1); color: #eab308; }
.inbox-item-icon.dependency { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.inbox-item-icon.broadcast { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.inbox-item-content {
  flex: 1;
  min-width: 0;
}
.inbox-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.inbox-item-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.inbox-item-time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.inbox-item-message {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.4;
}
.unread .inbox-item-message {
  font-weight: 500;
}
.inbox-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: 4px;
}
.inbox-item-delete {
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.inbox-item:hover .inbox-item-delete {
  opacity: 1;
}

/* ── Gmail-style inbox: select / bulk / trash / breadcrumbs ─────────────────────── */
.inbox-item.selected {
  background: rgba(1, 105, 111, 0.06);
  outline: 1px solid rgba(1, 105, 111, 0.25);
}
.inbox-item-checkbox {
  display: flex;
  align-items: center;
  padding: 4px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.inbox-item-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}
.inbox-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
  align-self: center;
}
.inbox-item:hover .inbox-item-actions,
.inbox-item.selected .inbox-item-actions {
  opacity: 1;
}
.inbox-item-action-btn {
  background: none;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.inbox-item-action-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-error);
}
.inbox-select-all {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  cursor: pointer;
}
.inbox-select-all input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary);
}
.inbox-bulk-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  border-radius: var(--radius-md);
  flex: 1;
}
.inbox-bulk-count {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  margin-right: 6px;
}
.inbox-view-toggle {
  display: inline-flex;
  gap: 2px;
  margin-right: 4px;
}
.inbox-view-toggle .btn-ghost.active {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.inbox-trash-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--color-bg-raised);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
}
.inbox-trash-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: rgba(234, 179, 8, 0.08);
  color: #92400e;
  font-size: var(--text-xs);
}
.inbox-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 4px 0;
}
.inbox-crumb {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border: 1px solid var(--color-divider);
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-crumb:hover {
  background: var(--color-bg-raised);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.inbox-crumb-client {
  font-weight: 600;
}
.inbox-task-link {
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 500;
}
.inbox-task-link:hover {
  text-decoration: underline;
}
.inbox-item-delete:hover {
  color: var(--color-error);
}

/* Sidebar unread badge */
.sidebar-badge {
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: auto;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}

/* ─── SCHEDULED BROADCASTS ───────────────────────────────────────────────── */
.scheduled-panel {
  border-top: 1px solid var(--color-divider);
  margin-top: 12px;
  padding-top: 12px;
}
.scheduled-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.scheduled-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.scheduled-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.scheduled-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scheduled-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  gap: 10px;
}
.scheduled-item.paused {
  opacity: 0.5;
}
.scheduled-item-content {
  flex: 1;
  min-width: 0;
}
.scheduled-item-msg {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scheduled-item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.scheduled-repeat-badge {
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 4px;
  font-weight: 600;
  text-transform: capitalize;
}
.scheduled-paused-badge {
  background: var(--color-text-faint);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 4px;
  font-weight: 600;
}
.scheduled-item-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
/* btn-sm defined in base button section (line ~680) */

/* ── Revenue & Profit Report ── */

/* Revenue table */
.rev-group-row {
  background: transparent;
  transition: background 0.15s;
}
.rev-group-row:hover {
  background: var(--color-surface-hover, rgba(0,0,0,0.02));
}
.rev-group-row.expanded {
  border-bottom: none;
}
.rev-expand-cell {
  width: 24px;
  color: var(--color-text-muted);
  padding-right: 0 !important;
}
.rev-detail-row {
  background: var(--color-bg);
}
.rev-detail-row td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: var(--text-sm);
}
.rev-total-row {
  border-top: 2px solid var(--color-border);
  background: transparent;
}
.rev-total-row td {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* Profitability report */
.prof-report { }
.prof-table { margin-top: 0; }
.prof-table th.prof-sortable { cursor: pointer; transition: color 0.15s; }
.prof-table th.prof-sortable:hover { color: var(--color-primary); }
.prof-table th.prof-sort-active { color: var(--color-primary); }
.prof-at-risk-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
}
.prof-at-risk-row {
  background: rgba(239, 68, 68, 0.04) !important;
}
.prof-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.prof-type-badge.project {
  background: rgba(59, 130, 246, 0.12);
  color: rgb(59, 130, 246);
}
.prof-type-badge.ongoing {
  background: rgba(34, 197, 94, 0.12);
  color: rgb(34, 197, 94);
}
.prof-burn-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.prof-burn-bar {
  width: 60px;
  height: 6px;
  background: var(--color-surface-3, #e5e5e5);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.prof-burn-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Communication Log ────────────────────────────────────────────── */
.cs-comm-form {
  background: var(--color-bg-secondary, var(--bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.cs-comm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.cs-comm-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cs-comm-scroll {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 6px;
}
.cs-comm-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 6px;
  background: var(--color-bg-secondary, var(--bg-secondary));
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.cs-comm-entry:hover {
  border-color: var(--color-border);
}
.cs-comm-entry:hover .cs-comm-delete {
  opacity: 1;
}
.cs-comm-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-bg-primary, var(--bg-primary));
  color: var(--color-text-muted);
}
.cs-comm-body {
  flex: 1;
  min-width: 0;
}
.cs-comm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  flex-wrap: wrap;
}
.cs-comm-type {
  font-weight: 600;
  color: var(--color-text-primary, var(--text-primary));
}
.cs-comm-duration {
  font-weight: 500;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.cs-comm-date {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.cs-comm-user {
  color: var(--color-text-faint);
}
.cs-comm-notes {
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}
.cs-comm-delete {
  opacity: 0;
  flex-shrink: 0;
  color: var(--color-text-faint);
  transition: opacity 0.15s, color 0.15s;
}
.cs-comm-delete:hover {
  color: var(--color-error) !important;
}

/* Exclude Communication toggle in reports */

/* ─── FEATURE 1: WORKSPACE ARCHIVING ─────────────────────────────────────── */
.ws-archived-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  background: var(--color-bg-secondary, var(--bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.ws-archived-item {
  opacity: 0.65;
}

.ws-archived-item:hover {
  opacity: 0.85;
}

.ws-row-archived {
  opacity: 0.7;
}


/* ─── FEATURE 2: ACTIVITY LOG FILTERS ────────────────────────────────────── */
.activity-filters {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

/* ─── FEATURE 3: TASK TEMPLATES ──────────────────────────────────────────── */
.templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--color-bg-secondary, var(--bg-secondary));
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.template-card:hover {
  border-color: var(--color-primary, #2dd4a8);
  box-shadow: 0 0 0 1px var(--color-primary, #2dd4a8);
}

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.template-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
}


/* Priority dots for template task list */
.priority-dot { display: inline-block; }
.priority-dot.priority-urgent { background: #dc2626; }
.priority-dot.priority-high { background: #ea580c; }
.priority-dot.priority-low { background: #16a34a; }

/* Template task expanded item */
.tpl-task-item { transition: background 150ms ease, border-color 150ms ease; }
.tpl-task-item:hover:not(.tpl-task-expanded) { border-color: var(--color-text-faint) !important; }

/* Apply Template Dropdown */


.view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── FEATURE 4: PROFITABILITY HEATMAP ───────────────────────────────────── */


.heatmap-table th,


/* ─── FEATURE 6: GANTT MILESTONES ────────────────────────────────────────── */
.gantt-milestone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
}

.gantt-milestone-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  opacity: 0.6;
}

.gantt-milestone-diamond {
  position: absolute;
  top: 4px;
  left: -7px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  border-radius: 2px;
  pointer-events: all;
  z-index: 10;
  transition: transform 0.15s;
}

.gantt-milestone-diamond:hover {
  transform: rotate(45deg) scale(1.2);
}

.gantt-milestone-label {
  position: absolute;
  top: 20px;
  left: 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* btn-xs defined in report filters section (line ~4176) */

/* ═══════ TEAM WORKLOAD & SCHEDULING ═══════ */

.wl-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wl-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
}

.wl-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-base);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Panel B: Workload Table */
.wl-table-section {
  margin-top: 4px;
}

.wl-table th {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.wl-dept-row td {
  padding: 8px 12px 4px !important;
  border-bottom: none !important;
  background: var(--color-bg-surface) !important;
}

.wl-dept-label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-base);
  margin-right: 8px;
}

.wl-dept-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.wl-capacity-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-capacity-bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-bg-surface);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.wl-capacity-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.wl-capacity-bar-label {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wl-pri-zero {
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

.wl-pri-badge {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wl-pri-sep {
  color: var(--color-text-faint);
  font-weight: 400;
  font-size: var(--text-xs);
}

.wl-link {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.wl-link:hover {
  color: var(--color-primary-dark, #0d6efd);
  text-decoration: underline;
}


/* Panel C: Heatmap Gantt */
.wl-gantt-section {
  margin-top: 4px;
}

.wl-gantt-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.wl-gantt-table {
  border-collapse: collapse;
  font-size: var(--text-xs);
  width: max-content;
  min-width: 100%;
}

.wl-gantt-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg-surface);
  z-index: 2;
  border-bottom: 1px solid var(--color-border);
}

.wl-gantt-name-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--color-bg-base);
  min-width: 140px;
  max-width: 160px;
  padding: 6px 10px !important;
  border-right: 1px solid var(--color-border);
}

thead .wl-gantt-name-col {
  z-index: 4;
  background: var(--color-bg-surface);
}

.wl-gantt-day-hdr {
  min-width: 28px;
  max-width: 28px;
  text-align: center;
  padding: 4px 2px !important;
  font-weight: 500;
  color: var(--color-text-muted);
  user-select: none;
}

.wl-gantt-day-hdr.wl-weekend {
  color: var(--color-text-faint);
}

.wl-gantt-day-hdr.wl-today {
  color: var(--color-primary);
  font-weight: 700;
}

.wl-gantt-month {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  line-height: 1;
  margin-bottom: 1px;
}

.wl-gantt-date {
  line-height: 1;
}

.wl-gantt-cell {
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  border: 0.5px solid var(--color-border);
  cursor: default;
  transition: background 0.15s;
}

.wl-gantt-cell.wl-today {
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
}

.wl-gantt-cell.wl-weekend {
  background: var(--color-bg-surface) !important;
  opacity: 0.5;
}

.wl-gantt-count {
  font-size: 9px;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}

/* Gantt Legend */
.wl-gantt-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0;
}

.wl-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--color-border);
}

.wl-legend-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-right: 6px;
}

/* Hover tooltip (lightweight) */
.wl-tooltip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 160px;
  max-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: none;
}

.wl-tooltip-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wl-tooltip-task {
  font-size: 12px;
  color: var(--color-text);
  padding: 2px 0;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wl-tooltip-task:last-child {
  border-bottom: none;
}

/* Active cell highlight */
.wl-cell-active {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-radius: 2px;
}

/* Click-to-pin popover backdrop */
.wl-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.08);
}

/* Click-to-pin popover */
.wl-popover {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 320px;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 0 0 1px var(--color-border);
  animation: wl-pop-in 0.15s ease-out;
}

@keyframes wl-pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wl-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--color-border);
}

.wl-popover-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.wl-popover-date {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.wl-popover-weight {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 24px;
}

.wl-popover-weight-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.wl-popover-weight-label {
  font-size: 10px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wl-popover-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--color-text-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-popover-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.wl-popover-tasks {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wl-popover-task-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.12s;
}

.wl-popover-task-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-text-faint);
}

.wl-popover-task-card.overdue {
  border-left: 3px solid #ef4444;
}

.wl-popover-task-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.wl-popover-overdue-tag {
  font-size: 10px;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wl-popover-recurrence {
  font-size: 10px;
  color: var(--color-text-faint);
}

.wl-popover-task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.wl-popover-task-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.wl-popover-task-dates {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-faint);
}

.wl-popover-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Smart Suggest Hours Button */
.smart-suggest-btn { color: var(--color-primary); transition: all 0.15s; }
.smart-suggest-btn:hover:not(:disabled) { color: var(--color-primary); background: rgba(20, 184, 166, 0.08); }
.smart-suggest-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── TOAST NOTIFICATIONS ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--color-surface-3, #1e293b);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: auto;
  max-width: 360px;
}
.toast-visible {
  transform: translateY(0);
  opacity: 1;
}
.toast-exit {
  transform: translateY(-8px);
  opacity: 0;
}
.toast-success { background: #047857; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1d4ed8; }
.toast-warning { background: #b45309; }
[data-theme="dark"] .toast-success { background: #065f46; }
[data-theme="dark"] .toast-error { background: #991b1b; }
[data-theme="dark"] .toast-info { background: #1e3a8a; }
[data-theme="dark"] .toast-warning { background: #92400e; }

/* ── KANBAN STATUS PICKER ─────────────────────────────────────────────────── */
.kanban-status-picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
}
.kanban-status-picker {
  position: absolute;
  z-index: 51;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 180px;
}
.kanban-status-picker-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 2px 10px 6px;
}
.kanban-status-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: background 0.12s;
}
.kanban-status-picker-btn:hover {
  background: var(--color-surface-2);
}

/* ── TASK CARD INLINE EDIT ────────────────────────────────────────────────── */
.task-card-title {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.task-card-title > span {
  flex: 1;
}
.task-card-edit-btn {
  opacity: 0;
  border: none;
  background: transparent;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: opacity 0.15s, background 0.12s;
  flex-shrink: 0;
}
.task-card:hover .task-card-edit-btn {
  opacity: 1;
}
.task-card-edit-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.task-card-edit-input {
  width: 100%;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
}

/* ── @MENTION DROPDOWN ────────────────────────────────────────────────────── */
.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 200px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  padding: 4px;
}
.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: background 0.12s;
}
.mention-option:hover,
.mention-option.active {
  background: var(--color-surface-2);
}
.mention-option .avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

/* ── ACTIVITY FEED ────────────────────────────────────────────────────────── */
.activity-feed {
  padding: 16px 20px;
  max-width: 700px;
}
.activity-feed-group {
  margin-bottom: 20px;
}
.activity-feed-date {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
}
.activity-feed-item {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text);
}
.activity-feed-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.activity-feed-content {
  flex: 1;
  min-width: 0;
}
.activity-feed-user {
  font-weight: 600;
}
.activity-feed-time {
  margin-left: 8px;
  font-size: 11px;
  color: var(--color-text-faint, var(--color-text-muted));
}

/* Archive ongoing service prompt */
.archive-ongoing-prompt {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.archive-ongoing-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ── Updates Panel ─────────────────────────────────────────── */
.updates-panel { max-width: 100%; }

.updates-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 0 8px;
}
.updates-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.updates-info-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.updates-info-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}
.updates-commit-hash {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--color-primary);
}

.updates-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
}
.updates-status-current {
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}
.updates-status-available {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}
.updates-status-error {
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  color: var(--color-error);
}
.updates-status-warning {
  background: color-mix(in srgb, var(--color-warning) 12%, transparent);
  color: var(--color-warning);
}

.updates-commits-list {
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.updates-commit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
}
.updates-commit-row:last-child { border-bottom: none; }

/* Changelog rendering */
.changelog-content {
  padding: 4px 0 12px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
}
.changelog-content h2.changelog-h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--color-text);
}
.changelog-content h3.changelog-h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--color-text);
}
.changelog-content h4.changelog-h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--color-text-muted);
}
.changelog-content hr.changelog-hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}
.changelog-content ul.changelog-list {
  list-style: disc;
  padding-left: 20px;
  margin: 4px 0 8px;
}
.changelog-content ul.changelog-list li {
  margin-bottom: 2px;
}
.changelog-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 1px 4px;
}
.changelog-content strong {
  font-weight: 600;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* === EXPANDABLE NOTES === */
.expandable-notes-collapsed {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border);
  background: var(--color-surface-muted, var(--color-surface));
  color: var(--color-text);
  font-size: var(--text-xs);
  cursor: pointer;
  min-height: 28px;
  width: 100%;           /* fill the parent column exactly */
  max-width: 100%;
  min-width: 0;          /* critical: allow ellipsis to actually kick in */
  box-sizing: border-box;
  overflow: hidden;      /* hard stop on preview bleed */
  transition: background 120ms, border-color 120ms;
}
.expandable-notes-collapsed:hover { border-color: var(--color-primary); background: var(--color-primary-subtle, var(--color-surface)); }
.expandable-notes-collapsed.is-empty { color: var(--color-text-faint); font-style: italic; }
.expandable-notes-collapsed.compact { padding: 4px 8px; min-height: 24px; }
.expandable-notes-collapsed > svg { flex-shrink: 0; margin-top: 2px; }
.expandable-notes-preview {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Clamp to N lines (default 1). Falls back to single-line ellipsis on older browsers. */
  display: -webkit-box;
  -webkit-line-clamp: var(--notes-preview-lines, 1);
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}
.expandable-notes-expanded {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.expandable-notes-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  font-size: var(--text-sm);
  padding: 8px 10px;
  line-height: 1.4;
}
.expandable-notes-hint {
  font-size: 10px;
  color: var(--color-text-faint);
  text-align: right;
}
.cs-notes-row {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cs-notes-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}


/* ══════════════════════════════════════════════════════════════════════════════
   PREMIUM POLISH — Animations, Glassmorphism, Motion
   ══════════════════════════════════════════════════════════════════════════════ */

/* --- Keyframe Animations --- */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

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

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes completionBurst {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Staggered Card Entrance --- */
.task-card {
  animation: cardFadeIn var(--duration-slow) var(--ease) both;
}
.kanban-column-body .task-card:nth-child(1) { animation-delay: 0ms; }
.kanban-column-body .task-card:nth-child(2) { animation-delay: 40ms; }
.kanban-column-body .task-card:nth-child(3) { animation-delay: 80ms; }
.kanban-column-body .task-card:nth-child(4) { animation-delay: 120ms; }
.kanban-column-body .task-card:nth-child(5) { animation-delay: 160ms; }
.kanban-column-body .task-card:nth-child(6) { animation-delay: 200ms; }
.kanban-column-body .task-card:nth-child(n+7) { animation-delay: 240ms; }

/* --- Button Micro-interactions --- */
.btn {
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-secondary {
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.btn-secondary:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-secondary:active { transform: translateY(0); }

.icon-btn {
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.icon-btn:hover { transform: scale(1.08); }
.icon-btn:active { transform: scale(0.95); }

/* --- Sidebar Item Transitions --- */
.sidebar-item {
  transition: background var(--duration) var(--ease), 
              box-shadow var(--duration) var(--ease),
              transform var(--duration-fast) var(--ease);
  position: relative;
}
.sidebar-item:active { transform: scale(0.98); }

/* Active sidebar glow bar */
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

/* --- Tab Transitions --- */
.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
  transition: all var(--duration) var(--ease);
  transform: translateX(-50%);
}
.tab.active::after {
  width: 100%;
}
.tab:hover:not(.active)::after {
  width: 50%;
  background: var(--color-text-faint);
}

/* --- Enhanced Status Dots — subtle pulse for active states --- */
.status-dot {
  transition: all var(--duration) var(--ease);
}
.status-dot.in-progress {
}
.status-dot.needs-attention {
}

/* --- Priority Badges — refined styling --- */
.priority-badge {
  transition: all var(--duration) var(--ease);
  border: 1px solid transparent;
}
.priority-badge.urgent {
  border-color: rgba(220, 38, 38, 0.15);
}

/* --- Enhanced Kanban Column Headers --- */
.kanban-column-header {
  position: relative;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}
.sidebar ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
}
.sidebar ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* --- Enhanced Avatars --- */
.avatar {
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) var(--ease);
  box-shadow: 0 0 0 2px var(--color-surface);
}

/* --- Empty States — refined --- */
.empty-state {
  animation: cardFadeIn var(--duration-slow) var(--ease) both;
}
.empty-state svg {
  opacity: 0.4;
  transition: opacity var(--duration) var(--ease);
}
.empty-state:hover svg {
  opacity: 0.6;
}

/* --- Dashboard Card Polish --- */
.dash-card-header {
  position: relative;
}
.dash-card-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Settings Table Row Hover --- */
.settings-table tbody tr {
  transition: background var(--duration-fast) var(--ease);
}
.settings-table tbody tr:hover {
  background: var(--color-surface-hover);
}

/* --- Notification Inbox Items --- */
.inbox-item {
  transition: background var(--duration) var(--ease), transform var(--duration-fast) var(--ease);
}
.inbox-item:hover {
  transform: translateX(2px);
}

/* --- Content Area Smooth Transitions --- */
.content-area {
  animation: contentFadeIn var(--duration) var(--ease) both;
}
@keyframes contentFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Enhanced Filter Buttons --- */
.filter-btn {
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.filter-btn:hover { transform: translateY(-1px); }
.filter-btn.active {
  box-shadow: 0 0 0 1px var(--color-primary), 0 2px 6px var(--color-primary-subtle);
}

/* --- Top Bar Title Heading Font --- */
.top-bar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* --- Sidebar Logo Enhancement --- */
.sidebar-logo {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
  transition: box-shadow var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
}
.sidebar-logo:hover {
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45);
  transform: scale(1.05);
}

/* --- Search Modal Glass Effect --- */

/* --- Modal Content Glass Treatment (dark mode) --- */
[data-theme="dark"] .profile-modal,
[data-theme="dark"] .modal-content {
  border-color: var(--glass-border);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04);
}

/* --- Subtle Focus Rings --- */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* --- Loading Skeleton Shimmer --- */

/* --- Smooth View Transitions --- */

/* --- Chart/Report Card Hover --- */
.report-card:hover,
.dash-card:hover {
  box-shadow: var(--shadow-md);
}

/* --- Gantt Bar Polish --- */
.gantt-bar {
  transition: all var(--duration) var(--ease), transform var(--duration-fast) var(--ease-spring);
  border-radius: var(--radius-md);
}
.gantt-bar:hover {
  transform: scaleY(1.15);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

/* --- Communication Log Badge Colors --- */

/* --- Checkbox Enhancement --- */
input[type="checkbox"] {
  accent-color: var(--color-primary);
}

/* --- Selection Color --- */
::selection {
  background: var(--color-primary);
  color: white;
}

/* --- Reduced Motion Preference --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUDIT ADDITIONS — Confirm Modal, Skeletons, Empty States, Search Badges
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- Confirm Modal --- */
.confirm-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10100;
  animation: fadeIn 0.15s ease;
}
.confirm-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 16px);
  padding: 28px 32px;
  max-width: 440px; width: 90%;
  box-shadow: var(--shadow-xl, 0 20px 40px rgba(0,0,0,0.2));
  text-align: center;
  animation: spring-scale-in 0.25s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1)) both;
}
@keyframes spring-scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.confirm-modal-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  background: var(--color-bg-secondary);
  color: var(--color-primary);
}
.confirm-modal-icon.danger {
  background: rgba(239,68,68,0.1);
  color: var(--color-error);
}
.confirm-modal-title {
  font-size: var(--text-lg, 18px);
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--color-text);
}
.confirm-modal-message {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex; gap: 10px; justify-content: center;
}
.confirm-modal-actions .btn {
  min-width: 100px;
}
.btn-danger {
  background: var(--color-error);
  color: white;
  border: none;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* --- Search Result Badges --- */
.search-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.search-result-title > span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.priority-badge.mini {
  font-size: 9px;
  padding: 1px 5px;
  line-height: 1.4;
  border-radius: 3px;
}
.status-badge-mini {
  font-size: 9px;
  padding: 1px 5px;
  line-height: 1.4;
  border-radius: 3px;
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.status-badge-mini.todo { background: rgba(107,114,128,0.12); color: #6b7280; }
.status-badge-mini.in-progress { background: rgba(59,130,246,0.12); color: var(--color-primary); }
.status-badge-mini.ongoing { background: rgba(14,165,233,0.12); color: #0ea5e9; }
.status-badge-mini.review { background: rgba(168,85,247,0.12); color: #a855f7; }
.status-badge-mini.pending-client { background: rgba(245,158,11,0.12); color: #f59e0b; }
.status-badge-mini.completed { background: rgba(34,197,94,0.12); color: var(--color-success); }

/* --- Skeleton Loading --- */
.skeleton-table {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px 0;
}
.skeleton-row {
  display: flex; gap: 16px; align-items: center;
  padding: 8px 0;
}
.skeleton-bone {
  height: 12px;
  background: linear-gradient(90deg, var(--color-surface-3) 25%, var(--color-surface-hover) 50%, var(--color-surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm, 4px);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px 0;
}
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  min-height: 80px;
}

/* --- Empty State --- */
.empty-state-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px;
  text-align: center;
  min-height: 200px;
}
.empty-state-icon {
  color: var(--color-text-faint);
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-title {
  font-size: var(--text-lg, 18px);
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text);
}
.empty-state-message {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  max-width: 320px;
  line-height: 1.5;
}

/* --- Report Link Consistency --- */
.report-link {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.report-link:hover {
  color: var(--color-primary-hover, #2563eb);
  text-decoration: underline;
}

/* --- Gantt Drag Visual Feedback --- */
.gantt-bar.dragging {
  opacity: 0.85;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 2px var(--color-primary);
  transform: scaleY(1.1);
  z-index: 100;
  cursor: grabbing;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px var(--color-primary); }
  50% { box-shadow: 0 0 12px var(--color-primary); }
}

/* --- Breadcrumb Trail --- */
.breadcrumb-copy {
  margin-left: 6px;
  opacity: 0.55;
}
.breadcrumb-copy:hover { opacity: 1; }
.cs-page-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.mywork-empty-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 0 16px 12px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mywork-empty-banner p { margin: 0; }

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  min-height: 32px;
  overflow-x: auto;
  flex-shrink: 0;
}
.breadcrumb-item {
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: var(--radius-sm, 4px);
}
.breadcrumb-item:hover {
  color: var(--color-primary);
  background: rgba(59,130,246,0.06);
}
.breadcrumb-sep {
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
}
.breadcrumb-back-btn {
  background: none; border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex; align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm, 4px);
  transition: all 0.15s ease;
  margin-right: 4px;
}
.breadcrumb-back-btn:hover {
  background: rgba(59,130,246,0.08);
  color: var(--color-primary);
}

/* --- Keyboard Shortcut Hint Toast --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #f3f2f0;
  border: 1px solid #d4d1cc;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  color: #1a1816;
}
.kbd-help-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10300;
  animation: fadeIn 0.15s ease;
}
.kbd-help-modal {
  background: #ffffff;
  color: #1a1816;
  border: 1px solid #e0dedb;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 480px; width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.22);
  animation: spring-scale-in 0.25s var(--ease-spring) both;
}
.kbd-help-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1816;
  margin: 0 0 20px;
}
.kbd-help-group {
  margin-bottom: 16px;
}
.kbd-help-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6560;
  margin-bottom: 8px;
}
.kbd-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.875rem;
  color: #1a1816;
}
.kbd-help-row .kbd-key {
  margin-left: 12px;
}
.kbd-help-modal .btn {
  color: #1a1816;
}

/* ── Profitability filter layout ── */
.prof-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-bg-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}
.prof-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.prof-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prof-filter-sep {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 4px;
}
.prof-filter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.prof-comm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.prof-comm-toggle input[type="checkbox"] {
  accent-color: var(--color-primary);
}

/* ── Business Review ── */
.biz-period-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--color-bg-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.biz-period-bar .report-filter-btns {
  gap: 4px;
}
.biz-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.biz-kpi-card {
  padding: 18px;
  background: var(--color-surface, #fff);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  cursor: help;
}
.biz-kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.biz-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}
.biz-kpi-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 4px;
}
.biz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.biz-panel {
  background: var(--color-bg-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 18px;
}
.biz-panel-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
}
.biz-trend-chart {
  background: var(--color-bg-surface);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  padding: 18px;
  margin-bottom: 24px;
}
.biz-trend-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
}
.biz-trend-svg {
  width: 100%;
  height: 280px;
}
.biz-legend {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  justify-content: center;
}
.biz-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Business Review: delta badges */
.biz-delta {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.biz-delta.up {
  color: var(--color-success);
  background: rgba(16, 185, 129, 0.1);
}
.biz-delta.down {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
}
.biz-delta.neutral {
  color: var(--color-text-faint);
}

/* Business Review: period comparison bars */
.biz-comp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.biz-comp-label {
  flex: 0 0 70px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.biz-comp-bars {
  flex: 1;
}
.biz-comp-bar-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.biz-comp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.biz-comp-bar {
  height: 16px;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.biz-comp-bar.current {
  background: #14b8a6;
}
.biz-comp-bar.prior {
  background: var(--color-text-faint);
  opacity: 0.25;
}
.biz-comp-val {
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  white-space: nowrap;
}
.biz-comp-val.muted {
  color: var(--color-text-faint);
  font-weight: 400;
}
.biz-comp-delta {
  flex: 0 0 65px;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Business Review: period date badges */
.biz-period-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -4px;
  margin-bottom: 18px;
}
.biz-date-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.biz-date-badge.current {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.2);
}
.biz-date-badge.prior {
  color: var(--color-text-muted);
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
}

/* Business Review (rebuilt April 2026)
   ==========================================================
   Wrapper, toolbar, KPI grid, donut cards, table cards */
.biz-review {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.biz-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}
.biz-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.biz-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.biz-toolbar-group-right { margin-left: auto; }
.biz-toolbar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.biz-toolbar-meta {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.biz-toolbar-meta-muted { color: var(--color-text-faint); }
.biz-compare-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.biz-compare-btn {
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 500;
  background: transparent;
  color: var(--color-text-muted);
  border: 0;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.biz-compare-btn + .biz-compare-btn { border-left: 1px solid var(--color-border); }
.biz-compare-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.biz-compare-btn.active {
  background: #14b8a6;
  color: #fff;
}

/* KPI cards */
.biz-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
@media (max-width: 1200px) { .biz-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .biz-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.biz-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.biz-kpi-card .biz-kpi-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.biz-kpi-card .biz-kpi-value.is-negative { color: var(--color-error); }
.biz-kpi-card .biz-kpi-value.is-warn { color: var(--color-warning); }
.biz-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.biz-kpi-prior {
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

/* Donut cards — grid of two columns, each column stacks Revenue on top of Hours */
.biz-donut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 960px) { .biz-donut-grid { grid-template-columns: 1fr; } }
.biz-donut-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.biz-donut-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.biz-donut-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.biz-donut-body {
  display: flex;
  align-items: center;
  gap: 20px;
}
.biz-donut-svg { flex-shrink: 0; }
.biz-donut-card .biz-donut-legend { flex: 1; min-width: 0; }
.biz-donut-legend-label {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.biz-donut-legend-more {
  font-size: 11px;
  color: var(--color-text-faint);
  font-style: italic;
  padding-top: 2px;
}
.biz-donut-empty {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 36px 18px;
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}
.biz-donut-empty-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

/* Tables */
.biz-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 18px;
}
.biz-table-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.biz-table-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.biz-table-sub {
  font-size: 11px;
  color: var(--color-text-faint);
}
.biz-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
}

/* Monthly-chart legend row */
.biz-trend-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.biz-trend-legend .biz-trend-swatch {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.biz-chart-tooltip { position: fixed; z-index: 1200; }

/* Legacy classes kept below for other reports. */
/* Business Review: Donut Charts (legacy) */
.biz-donut-wrap {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 8px 0 16px;
}
.biz-donut-chart-area {
  flex-shrink: 0;
}
.biz-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  min-width: 0;
}
.biz-donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  line-height: 1.4;
}
.biz-donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.biz-donut-legend-name {
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.biz-donut-legend-pct {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
  font-weight: 600;
  flex-shrink: 0;
}

/* Business Review: Custom date input */
.biz-date-input {
  padding: 4px 8px;
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-surface);
  color: var(--color-text);
  font-family: inherit;
}
.biz-date-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Business Review: Period select dropdown */
.biz-period-select {
  padding: 6px 32px 6px 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-surface);
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 340px;
}
.biz-period-select:hover {
  border-color: var(--color-text-muted);
}
.biz-period-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.15);
}
.biz-period-select optgroup {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.biz-period-select option {
  font-weight: 400;
  color: var(--color-text);
  padding: 4px 8px;
}

/* Business Review: Editable date badges in Period Comparison */
.biz-date-badge-editable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.biz-badge-date-input {
  border: none;
  background: transparent;
  color: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  font-family: inherit;
  padding: 0;
  width: 120px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.biz-badge-date-input:focus {
  outline: none;
}
.biz-badge-date-input::-webkit-calendar-picker-indicator {
  opacity: 0.4;
  cursor: pointer;
}
.biz-badge-date-input:hover::-webkit-calendar-picker-indicator {
  opacity: 0.8;
}
.biz-badge-sep {
  color: inherit;
  opacity: 0.6;
  font-size: var(--text-xs);
}

/* Business Review: Chart Tooltip */
.biz-chart-tooltip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  pointer-events: none;
  font-size: var(--text-xs);
}
.biz-chart-tooltip-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 6px;
  color: var(--color-text);
}
.biz-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--color-text-muted);
}
.biz-chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.biz-chart-tooltip-val {
  margin-left: auto;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.biz-chart-tooltip-margin {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text);
}

/* Business Review: Horizontal donut pair layout */
.biz-donut-pair {
  display: flex;
  gap: 24px;
}
.biz-donut-section {
  flex: 1;
  min-width: 0;
}
.biz-donut-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Business Review: Chart/Table Toggle */
.biz-view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.biz-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--color-text-faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.biz-view-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}
.biz-view-btn.active {
  background: var(--color-accent);
  color: #fff;
}
.biz-view-btn + .biz-view-btn {
  border-left: 1px solid var(--color-border);
}


/* ── STICKY TABLE HEADERS ──────────────────────────────────────────────────── */
.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.report-table thead th[title] {
  cursor: help;
}
.settings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.wl-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
[data-theme="dark"] .report-table thead th,
[data-theme="dark"] .settings-table thead th,
[data-theme="dark"] .wl-table thead th {
  background: var(--color-surface);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .settings-table thead th {
  background: var(--color-surface);
}

/* ── TOAST UNDO BUTTON ─────────────────────────────────────────────────────── */
.toast-undo-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 12px;
  transition: background 0.15s;
  white-space: nowrap;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.15); }
.toast { display: flex; align-items: center; gap: 4px; }

/* ── ERROR BOUNDARY ────────────────────────────────────────────────────────── */
.error-boundary-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  background: var(--color-bg);
}
.error-boundary-inner {
  text-align: center;
  max-width: 480px;
  color: var(--color-text-muted);
}
.error-boundary-inner h2 {
  margin: 16px 0 8px;
  color: var(--color-text);
  font-size: var(--text-lg);
}
.error-boundary-inner p {
  margin-bottom: 16px;
  font-size: var(--text-sm);
}
.error-boundary-detail {
  font-size: 11px;
  background: var(--color-surface-3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: left;
  overflow-x: auto;
  max-height: 80px;
  color: var(--color-error);
}

/* ── SUBTASKS / CHECKLISTS ──────────────────────────────────────────────────── */
.subtask-section { margin-top: 12px; }
.subtask-header {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 8px;
}
.subtask-progress {
  font-weight: 400; color: var(--color-text-faint); text-transform: none; letter-spacing: 0;
}
.subtask-progress-bar {
  height: 4px; border-radius: 2px; background: var(--color-surface-3); flex: 1; max-width: 80px; overflow: hidden;
}
.subtask-progress-fill {
  height: 100%; border-radius: 2px; background: var(--color-primary); transition: width 0.3s ease;
}
.subtask-list { display: flex; flex-direction: column; gap: 2px; }
.subtask-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}
.subtask-item:last-child { border-bottom: none; }
.subtask-checkbox {
  width: 16px; height: 16px; border-radius: 3px;
  border: 1.5px solid var(--color-border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
  background: transparent;
}
.subtask-checkbox:hover { border-color: var(--color-primary); }
.subtask-checkbox.checked {
  background: var(--color-primary); border-color: var(--color-primary);
}
.subtask-checkbox.checked::after {
  content: '\2713'; color: #fff; font-size: 11px; font-weight: 700;
}
.subtask-title { flex: 1; }
.subtask-title.done { text-decoration: line-through; color: var(--color-text-faint); }
.subtask-delete {
  opacity: 0; background: none; border: none; cursor: pointer;
  color: var(--color-text-faint); padding: 2px; font-size: 14px; line-height: 1;
}
.subtask-item:hover .subtask-delete { opacity: 1; }
.subtask-add {
  display: flex; gap: 6px; margin-top: 6px;
}
.subtask-add input {
  flex: 1; font-size: var(--text-xs); padding: 4px 8px;
}

/* ── CHECKPOINT STYLES ────────────────────────────────────────────────────── */
.subtask-drag-handle {
  cursor: grab; color: var(--color-text-faint); opacity: 0;
  display: flex; align-items: center; transition: opacity 0.15s;
  flex-shrink: 0;
}
.subtask-item:hover .subtask-drag-handle { opacity: 0.6; }
.subtask-drag-handle:active { cursor: grabbing; }
.subtask-item.dragging { opacity: 0.4; }
.subtask-item.checkpoint-item {
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  border-radius: 4px; padding: 2px 4px; margin: -2px -4px;
}
.subtask-cp-toggle {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--color-text-faint); display: flex; align-items: center;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.subtask-item:hover .subtask-cp-toggle { opacity: 1; }
.subtask-cp-toggle.active {
  opacity: 1; color: var(--color-primary);
}
.subtask-cp-days {
  border: 1px solid var(--color-border); border-radius: 3px;
  background: var(--color-surface); color: var(--color-text);
}
.subtask-cp-date {
  font-size: var(--text-xs); color: var(--color-text-muted);
  white-space: nowrap;
}
/* Gantt checkpoint diamonds */
.gantt-checkpoint-diamond {
  position: absolute; top: 50%; transform: translate(-50%, -50%) rotate(45deg);
  width: 8px; height: 8px; background: var(--color-warning, #f59e0b);
  border: 1.5px solid rgba(255,255,255,0.9); z-index: 5;
  pointer-events: auto; cursor: default;
}
.gantt-checkpoint-diamond.done {
  background: var(--color-success, #22c55e);
}

/* ── TASK ACTIVITY FEED ────────────────────────────────────────────────────── */
.task-activity-feed { max-height: 300px; overflow-y: auto; }
.task-activity-item {
  display: flex; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs); color: var(--color-text-muted);
}
.task-activity-item:last-child { border-bottom: none; }
.task-activity-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-surface-3); display: flex; align-items: center;
  justify-content: center; color: var(--color-text-faint);
}
.task-activity-content { flex: 1; }
.task-activity-who { font-weight: 600; color: var(--color-text); }
.task-activity-time { color: var(--color-text-faint); margin-left: 8px; }

/* ── CLIENT HEALTH SCORE ───────────────────────────────────────────────────── */
.cs-health-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  flex: 1;
}
.cs-health-indicator {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--text-sm); color: #fff;
  flex-shrink: 0;
}
.cs-health-indicator.green { background: #16a34a; }
.cs-health-indicator.yellow { background: #d97706; }
.cs-health-indicator.red { background: #dc2626; }
.cs-health-details { flex: 1; }
.cs-health-label {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 2px;
}
.cs-health-factors {
  display: flex; gap: 16px; font-size: var(--text-xs); color: var(--color-text-muted);
}
.cs-health-factor { display: flex; align-items: center; gap: 4px; }
.cs-health-tips {
  margin-top: 6px; display: flex; flex-direction: column; gap: 3px;
}
.cs-health-tip {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); color: var(--color-text);
  font-weight: 500;
}

/* ── FIRST-RUN ONBOARDING ──────────────────────────────────────────────────── */
.onboarding-card {
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  position: relative;
}
.onboarding-card h3 {
  font-size: var(--text-base); font-weight: 600; margin-bottom: 10px; color: var(--color-text);
}
.onboarding-steps {
  display: flex; gap: 24px; font-size: var(--text-sm); color: var(--color-text-muted);
}
.onboarding-step {
  display: flex; align-items: flex-start; gap: 8px;
}
.onboarding-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.onboarding-dismiss {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-faint); font-size: 18px; line-height: 1;
  padding: 4px;
}
.onboarding-dismiss:hover { color: var(--color-text); }

/* ── GANTT CRITICAL PATH ───────────────────────────────────────────────────── */
.gantt-bar-wrap.critical-path .gantt-bar {
  border: 2px solid var(--color-error);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.3);
}
.gantt-crit-legend {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--color-text-muted);
  margin-left: auto;
}
.gantt-crit-swatch {
  width: 16px; height: 8px; border-radius: 2px;
  border: 2px solid var(--color-error); background: transparent;
}

/* ── AGENCY HEALTH KPI STRIP ───────────────────────────────────────────────── */
.agency-kpi-strip {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.agency-kpi {
  flex: 1; min-width: 140px; background: var(--color-surface-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 10px 14px; text-align: center;
}
.agency-kpi-value {
  font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums;
}
.agency-kpi-label {
  font-size: 11px; color: var(--color-text-muted);
  letter-spacing: 0.05em; margin-top: 2px;
}

/* ── SUGGESTION BOX ────────────────────────────────────────────────────────── */
.sidebar-suggestion-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; margin: 8px 0 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-sidebar-muted);
  cursor: pointer; transition: color 0.15s;
  border: none; background: none;
}
.sidebar-suggestion-link:hover {
  color: var(--color-sidebar-text);
}
.suggestion-modal { width: 560px; max-width: 95vw; }
.suggestion-modal .modal-body { padding: 24px 28px 8px; }
.suggestion-modal .form-group { margin-bottom: 20px; }
.suggestion-modal .form-group label { display: block; font-size: var(--text-sm); font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.suggestion-modal .form-group input[type="text"] { width: 100%; padding: 10px 12px; font-size: var(--text-base); }
.suggestion-modal .form-group textarea { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; font-size: var(--text-sm); }
.suggestion-modal .form-group select { padding: 8px 12px; font-size: var(--text-sm); }
.suggestion-modal .modal-header { padding: 20px 28px 0; display: flex; align-items: center; gap: 10px; }
.suggestion-modal .modal-header h3 { flex: 1; }
.suggestion-modal .suggestion-header-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--color-primary-subtle); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.suggestion-modal .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 28px 24px; }

/* My Suggestions (Profile) */
.my-suggestions { margin-top: 24px; border-top: 1px solid var(--color-border); padding-top: 16px; }
.my-suggestions h4 { font-size: var(--text-sm); font-weight: 600; margin-bottom: 10px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.my-suggestion-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--color-border-subtle); gap: 12px; }
.my-suggestion-item:last-child { border-bottom: none; }
.my-suggestion-title { font-size: var(--text-sm); color: var(--color-text); flex: 1; }
.my-suggestion-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.my-suggestion-date { font-size: 11px; color: var(--color-text-faint); }

/* Suggestion status badges */
.suggestion-status {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.suggestion-status.new { background: var(--color-primary-subtle); color: var(--color-primary); }
.suggestion-status.selected { background: var(--color-success-subtle); color: var(--color-success); }

/* ── FEEDBACK CONSOLE (Settings) ───────────────────────────────────────────── */
.feedback-console { margin-top: 8px; }
.feedback-sub-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.feedback-sub-tab {
  padding: 6px 14px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; cursor: pointer;
  background: transparent; border: 1px solid var(--color-border); color: var(--color-text-muted);
  transition: all 0.15s; display: flex; align-items: center; gap: 6px;
}
.feedback-sub-tab:hover { background: var(--color-bg-hover); }
.feedback-sub-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.feedback-badge {
  font-size: 10px; background: var(--color-error); color: #fff;
  border-radius: 10px; padding: 1px 6px; font-weight: 700;
  min-width: 18px; text-align: center;
}
.feedback-sub-tab.active .feedback-badge { background: rgba(255,255,255,0.3); }

/* Suggestions admin table */
.suggestion-row { border-bottom: 1px solid var(--color-border-subtle); }
.suggestion-row:last-child { border-bottom: none; }
.suggestion-row-main { display: grid; grid-template-columns: 100px 1fr 110px 80px 60px; align-items: center; padding: 10px 0; gap: 12px; }
.suggestion-row-main .suggestion-user { font-size: var(--text-sm); font-weight: 500; }
.suggestion-row-main .suggestion-title-cell { font-size: var(--text-sm); }
.suggestion-row-main .suggestion-cat { font-size: 11px; color: var(--color-text-muted); }
.suggestion-expand-btn { background: none; border: none; cursor: pointer; color: var(--color-text-muted); padding: 4px; border-radius: var(--radius-sm); }
.suggestion-expand-btn:hover { color: var(--color-text); background: var(--color-bg-hover); }
.suggestion-detail { padding: 0 0 12px 112px; }
.suggestion-desc { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 8px; white-space: pre-wrap; }
.suggestion-admin-note { margin-top: 8px; }
.suggestion-admin-note textarea { font-size: var(--text-sm); min-height: 50px; width: 100%; resize: vertical; }
.suggestion-admin-note label { font-size: 11px; font-weight: 600; color: var(--color-text-faint); text-transform: uppercase; margin-bottom: 2px; display: block; }
.suggestion-status-select { font-size: var(--text-sm); padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); }

/* Error log table */
.error-log-row { border-bottom: 1px solid var(--color-border-subtle); padding: 10px 0; }
.error-log-row:last-child { border-bottom: none; }
.error-log-header { display: grid; grid-template-columns: 140px 1fr 80px 100px 36px; align-items: center; gap: 12px; }
.error-log-header .el-date { font-size: 11px; color: var(--color-text-faint); }
.error-log-header .el-msg { font-size: var(--text-sm); color: var(--color-error); font-family: 'SF Mono', Monaco, monospace; word-break: break-word; }
.error-log-header .el-count { font-size: var(--text-sm); font-weight: 600; text-align: center; }
.error-log-header .el-users { font-size: 11px; color: var(--color-text-muted); }
.error-log-stack { padding: 8px 0 4px 152px; }
.error-log-stack pre {
  font-size: 11px; background: var(--color-bg-subtle); border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm); padding: 8px 12px; overflow-x: auto; max-height: 200px;
  color: var(--color-text-muted); white-space: pre-wrap; word-break: break-all;
}
.error-log-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.error-log-empty { text-align: center; padding: 40px 20px; color: var(--color-text-muted); font-size: var(--text-sm); }

/* === RICH TEXT EDITOR === */
.rte-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rte-wrap.rte-focused {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}
.rte-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  padding: 0;
}
.rte-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}
.rte-btn:active {
  background: var(--color-active, var(--color-hover));
}
.rte-sep {
  width: 1px;
  height: 18px;
  background: var(--color-divider);
  margin: 0 4px;
}
.rte-btn-wrap {
  position: relative;
  display: flex;
}
.rte-link-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.12));
  margin-top: 4px;
}
.rte-link-input {
  width: 200px;
  padding: 4px 8px;
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
}
.rte-link-input:focus {
  border-color: var(--color-primary);
}
.rte-link-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.rte-emoji-popup {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.12));
  margin-top: 4px;
  width: 310px;
  max-height: 320px;
  overflow-y: auto;
}
.rte-emoji-cat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.rte-emoji-cat-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.rte-emoji-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: background 0.1s;
}
.rte-emoji-btn:hover {
  background: var(--color-hover);
}
.rte-editor {
  min-height: 60px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  outline: none;
  cursor: text;
}
.rte-editor:empty.rte-empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
  pointer-events: none;
}
/* Rich text content styles */
.rte-editor b, .rte-editor strong { font-weight: 600; }
.rte-editor i, .rte-editor em { font-style: italic; }
.rte-editor u { text-decoration: underline; }
.rte-editor s, .rte-editor strike { text-decoration: line-through; }
.rte-editor ul, .rte-editor ol { margin: 4px 0; padding-left: 24px; }
.rte-editor li { margin: 2px 0; }
.rte-editor a { color: var(--color-primary); text-decoration: underline; }
.rte-editor pre {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: var(--text-xs);
  white-space: pre-wrap;
  margin: 6px 0;
}
.rte-editor code {
  background: var(--color-surface);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}
/* Read-only rendered description (same styles) */
.task-description-html b, .task-description-html strong { font-weight: 600; }
.task-description-html i, .task-description-html em { font-style: italic; }
.task-description-html u { text-decoration: underline; }
.task-description-html s, .task-description-html strike { text-decoration: line-through; }
.task-description-html ul, .task-description-html ol { margin: 4px 0; padding-left: 24px; }
.task-description-html li { margin: 2px 0; }
.task-description-html a { color: var(--color-primary); text-decoration: underline; }
.task-description-html pre {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: var(--text-xs);
  white-space: pre-wrap;
  margin: 6px 0;
}
.task-description-html code {
  background: var(--color-surface);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}


/* === ITEM 3: Attempt label styling === */
.cs-comm-duration {
  font-variant-numeric: tabular-nums;
}

/* === ITEM 5: Communication attachment link === */
.cs-comm-attachment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-decoration: none;
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: background 0.15s;
}
.cs-comm-attachment:hover {
  background: var(--color-bg-surface-hover);
}

/* === ITEM 6: Stacked bar styles for workload === */
.wl-stacked-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  padding: 2px 0;
}
.wl-stacked-bar-track {
  display: flex;
  flex: 1;
  height: 8px;
  background: var(--color-bg-surface);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}
.wl-stacked-bar-client {
  height: 100%;
  background: var(--color-success);
  min-width: 0;
  transition: width 0.3s ease;
}
.wl-stacked-bar-internal {
  height: 100%;
  background: #6366f1;
  min-width: 0;
  transition: width 0.3s ease;
}
.wl-stacked-bar-track > :last-child {
  border-radius: 0 4px 4px 0;
}
.wl-stacked-bar-label {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--color-text-muted);
  min-width: 36px;
  text-align: right;
}

/* === ITEM 9: Date range select === */
.wl-date-range-bar .form-input {
  max-width: 140px;
}

/* === ITEM 10: Intelligent bar sizing - handled via JS maxHrs computation === */

/* === ITEM 11: KPI card tooltips — now JS-rendered (wl-tooltip style) === */

/* ─── ONGOING TASKS ENHANCED DROPDOWN ─── */
.mywork-ongoing-section { }

.mywork-ongoing-body {
  padding: 0;
}

.mywork-ongoing-toggle {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.ongoing-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.ongoing-toggle-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}
.ongoing-toggle-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ongoing-toggle-btn.active .kanban-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.ongoing-table-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border-light);
}

.ongoing-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}
.ongoing-task-row:last-child {
  border-bottom: none;
}
.ongoing-task-row:hover {
  background: var(--color-bg-hover);
}

.ongoing-col-task {
  flex: 1;
  min-width: 0;
}
.ongoing-task-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ongoing-task-row .dash-task-meta {
  margin-top: 2px;
}

.ongoing-col-time {
  width: 80px;
  flex-shrink: 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.ongoing-col-time.has-time {
  color: var(--color-text);
  font-weight: 500;
}

.ongoing-col-actions {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.ongoing-quick-log {
  font-size: var(--text-xs) !important;
  padding: 3px 8px !important;
  font-weight: 600;
  color: var(--color-primary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 4px !important;
  white-space: nowrap;
}
.ongoing-quick-log:hover {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
}

.ongoing-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Header row alignment matches task rows */
.ongoing-table-header .ongoing-col-task { text-align: left; }
.ongoing-table-header .ongoing-col-time { width: 80px; text-align: center; }
.ongoing-table-header .ongoing-col-actions { width: 110px; text-align: right; }

/* ── CALL SHEET ────────────────────────────────────────────────────────────── */
.call-sheet-modal {
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.call-sheet-body {
  overflow-y: auto;
  max-height: calc(85vh - 120px);
  padding-bottom: 12px;
}
.call-sheet-body .form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 2px 0 6px 0;
  line-height: 1.4;
}
.call-sheet-btn {
  gap: 5px;
}

/* Checkbox group (where shared, content type, orientation) */
.cs-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: all 0.15s ease;
  user-select: none;
}
.cs-checkbox-label:hover {
  border-color: var(--color-primary);
}
.cs-checkbox-label.checked {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.cs-checkbox-label input[type="checkbox"] {
  display: none;
}

/* Contact selector dropdown */
.cs-contact-field {
  position: relative;
}
.cs-contact-select {
  position: relative;
}
.cs-contact-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}
.cs-contact-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin-top: 4px;
  padding: 6px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cs-contact-dropdown .form-input {
  margin-bottom: 4px;
  font-size: var(--text-sm);
}
.cs-contact-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cs-contact-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.cs-contact-option:hover {
  background: var(--color-hover);
}
.cs-contact-option.selected {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 500;
}

/* Task complete checkbox in modal header */
.task-complete-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background 120ms ease, border-color 120ms ease;
  user-select: none;
}
.task-complete-checkbox:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
  color: #22c55e;
}
.task-complete-checkbox input[type="checkbox"] {
  accent-color: #22c55e;
  margin: 0;
}
.task-completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: #22c55e;
  padding: 4px 8px;
  font-weight: 600;
}

/* Sortable table headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-th:hover {
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE VIEW
   Completely separate layout for mobile devices (≤768px + touch)
   ═══════════════════════════════════════════════════════════════════════════════ */

.mob-app {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: env(safe-area-inset-top, 0px);
}
.mob-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  -webkit-overflow-scrolling: touch;
}

/* ── Bottom Nav ── */
.mob-bottom-nav {
  display: flex;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated, var(--color-bg));
  padding: 6px 0 max(env(safe-area-inset-bottom, 8px), 8px);
  flex-shrink: 0;
  z-index: 100;
}
.mob-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.mob-nav-btn.active {
  color: var(--accent, #01696F);
}
.mob-nav-label {
  font-weight: 500;
}

/* ── Page Headers ── */
.mob-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mob-page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

/* ── Filter Pills ── */
.mob-filter-pills {
  display: flex;
  gap: 6px;
}
.mob-pill {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.mob-pill.active {
  background: var(--accent, #01696F);
  color: #fff;
  border-color: transparent;
}

/* ── Task Cards ── */
.mob-task-list { display: flex; flex-direction: column; gap: 12px; }
.mob-task-group { display: flex; flex-direction: column; gap: 6px; }
.mob-group-header {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 0 2px;
  font-weight: 500;
}
.mob-group-client { opacity: 0.7; }
.mob-group-sep { opacity: 0.4; }
.mob-group-project { font-weight: 600; color: var(--color-text); }

.mob-task-card {
  background: var(--color-bg-elevated, #fff);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.mob-task-card:active {
  border-color: var(--accent, #01696F);
}
.mob-task-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mob-task-card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
}
.mob-task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── Status Chips ── */
.mob-status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--color-border);
  color: var(--color-text-muted);
}
.mob-status-chip.to-do { background: #e8e8e8; color: #666; }
.mob-status-chip.in-progress { background: #dbeafe; color: #1e40af; }
.mob-status-chip.ongoing { background: #ede9fe; color: #6d28d9; }
.mob-status-chip.internal-review { background: #fef3c7; color: #92400e; }
.mob-status-chip.needs-attention { background: #fde2e2; color: #991b1b; }
.mob-status-chip.pending-client-action { background: #ffedd5; color: #9a3412; }
.mob-status-chip.completed { background: #d1fae5; color: #065f46; }

/* ── Priority Badges ── */
.mob-priority-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.mob-priority-badge.urgent { background: #fde2e2; color: #991b1b; }
.mob-priority-badge.high { background: #ffedd5; color: #9a3412; }

.mob-due { display: flex; align-items: center; gap: 3px; }
.mob-due.overdue { color: var(--color-error); font-weight: 600; }
.mob-hours { display: flex; align-items: center; gap: 3px; }

/* ── Task Detail ── */
.mob-task-detail {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
}
.mob-task-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated, var(--color-bg));
  flex-shrink: 0;
}
.mob-back-btn {
  border: none;
  background: none;
  color: var(--color-text-muted);
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.mob-task-title-area { flex: 1; min-width: 0; }
.mob-task-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.mob-task-breadcrumb {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.mob-task-controls {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  align-items: flex-end;
}
.mob-control-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.mob-control-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.mob-select {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-bg);
  color: var(--color-text);
}
.mob-complete-btn, .mob-reopen-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mob-complete-btn {
  background: var(--color-success, #065f46);
  color: #fff;
}
.mob-reopen-btn {
  background: var(--color-border);
  color: var(--color-text);
}

/* ── Task Detail Tabs ── */
.mob-task-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.mob-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.mob-tab.active {
  color: var(--accent, #01696F);
  border-bottom-color: var(--accent, #01696F);
}
.mob-task-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── Details tab ── */
.mob-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.mob-description-text {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--color-text);
}
.mob-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.mob-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mob-info-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.mob-info-value {
  font-size: 14px;
  font-weight: 500;
}
.mob-info-value.overdue { color: var(--color-error); }
.mob-assignees { margin-bottom: 16px; }
.mob-avatar-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mob-assignee-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  background: var(--color-bg-elevated, #f5f5f5);
  font-size: 13px;
}

/* ── Time / Comments tabs ── */
.mob-time-form, .mob-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.mob-comment-form {
  flex-direction: row;
  align-items: center;
}
.mob-input {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  box-sizing: border-box;
}
.mob-textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.mob-btn-primary {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #01696F);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.mob-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mob-btn-full { width: 100%; }

.mob-time-list, .mob-comment-list { display: flex; flex-direction: column; gap: 8px; }
.mob-time-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
}
.mob-time-entry-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mob-time-duration { font-weight: 600; }
.mob-time-date { color: var(--color-text-muted); font-size: 13px; }
.mob-time-notes { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.mob-time-user { font-size: 12px; color: var(--color-text-faint); margin-top: 2px; }

.mob-comment {
  padding: 10px;
  background: var(--color-bg-elevated, #f9f9f9);
  border-radius: 8px;
}
.mob-comment.system {
  background: none;
  opacity: 0.6;
  font-size: 12px;
}
.mob-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mob-comment-author { font-weight: 600; font-size: 13px; }
.mob-comment-date { font-size: 11px; color: var(--color-text-muted); margin-left: auto; }
.mob-comment-body { font-size: 14px; line-height: 1.4; color: var(--color-text); }

/* ── Inbox ── */
.mob-notif-list { display: flex; flex-direction: column; }
.mob-notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
  cursor: pointer;
}
.mob-notif-item.unread { background: rgba(1, 105, 111, 0.04); }
.mob-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.mob-notif-icon.overdue { background: #fde2e2; color: #991b1b; }
.mob-notif-icon.assigned { background: #dbeafe; color: #1e40af; }
.mob-notif-icon.comment { background: #d1fae5; color: #065f46; }
.mob-notif-icon.broadcast { background: #ede9fe; color: #6d28d9; }
.mob-notif-content { flex: 1; min-width: 0; }
.mob-notif-message { font-size: 14px; line-height: 1.3; }
.mob-notif-item.unread .mob-notif-message { font-weight: 600; }
.mob-notif-time { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.mob-text-btn {
  border: none;
  background: none;
  color: var(--accent, #01696F);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Timesheet ── */
.mob-date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 8px 0;
}
.mob-date-arrow {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: none;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mob-date-arrow:disabled { opacity: 0.3; }
.mob-date-display { text-align: center; }
.mob-date-label { font-size: 16px; font-weight: 600; }
.mob-date-total { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }

.mob-ts-task-list { display: flex; flex-direction: column; gap: 10px; }
.mob-ts-group { display: flex; flex-direction: column; gap: 4px; }
.mob-ts-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-bg-elevated, #fff);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.mob-ts-task-info { flex: 1; min-width: 0; }
.mob-ts-task-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.mob-ts-task-logged { font-size: 12px; color: var(--accent, #01696F); font-weight: 600; margin-top: 2px; }
.mob-ts-quick-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.mob-ts-quick-btn {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: none;
  color: var(--accent, #01696F);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.mob-ts-quick-btn:active {
  background: rgba(1, 105, 111, 0.1);
}
.mob-ts-quick-btn:disabled {
  opacity: 0.4;
}

/* ── Comms Form ── */
.mob-comms-form { display: flex; flex-direction: column; gap: 12px; }
.mob-form-group { display: flex; flex-direction: column; gap: 4px; }
.mob-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.mob-form-row { display: flex; gap: 8px; }

/* ── Search ── */
.mob-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-elevated, #fff);
  margin-bottom: 16px;
  color: var(--color-text-muted);
}
.mob-search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--color-text);
  outline: none;
}
.mob-search-input::placeholder { color: var(--color-text-faint); }
.mob-search-clear {
  border: none;
  background: none;
  color: var(--color-text-muted);
  padding: 4px;
  cursor: pointer;
}
.mob-search-results { display: flex; flex-direction: column; gap: 8px; }
.mob-search-breadcrumb { font-size: 12px; color: var(--color-text-muted); }

/* ── Shared ── */
.mob-loading {
  text-align: center;
  padding: 32px;
  color: var(--color-text-muted);
  font-size: 14px;
}
.mob-empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-faint);
}
.mob-empty-state p { margin: 8px 0 0; }
.mob-empty { text-align: center; padding: 24px; color: var(--color-text-faint); font-size: 14px; }

/* ── Timesheet Today button ── */
.ts-today-btn {
  padding: 4px 12px;
  border: 1px solid var(--accent, #01696F);
  border-radius: 6px;
  background: none;
  color: var(--accent, #01696F);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.12s, color 0.12s;
}
.ts-today-btn:hover {
  background: var(--accent, #01696F);
  color: #fff;
}

/* ── Timesheet Multi-Entry Popover ── */
.ts-me-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ts-me-popover {
  background: var(--color-bg-elevated, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Communication & Planning popover is wider because the log form has type,
   duration, date, notes, and attachment fields. */
.ts-comm-popover {
  width: 640px;
  max-width: 95vw;
  overflow-y: auto;
  padding: 16px;
}
.ts-comm-entry { cursor: pointer; }
.ts-comm-entry:hover { background: var(--color-surface-alt, rgba(0,0,0,0.03)); }
.ts-comm-entry.is-editing { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }
/* Communication-view cell hover: one full-size '+' button that fills the
   whole cell, instead of the main timesheet's multi-button grid. The base
   .ts-cell-hover-grid rule keeps it display:none until .ts-cell:hover, so
   we only need to override the grid template (don't touch `display`). */
.ts-comm-hover {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
}
.ts-comm-hover .ts-hg-full {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 600;
}
.ts-me-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.ts-me-title {
  font-size: 15px;
  font-weight: 600;
}
.ts-me-close {
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
}
.ts-me-entries {
  padding: 8px 18px;
  overflow-y: auto;
  flex: 1;
}
.ts-me-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0,0,0,0.06));
}
.ts-me-entry:last-child { border-bottom: none; }
.ts-me-duration {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  font-size: 14px;
}
/* Editable duration field in the multi-entry popover. Styled to mirror the
   notes input so the two cells feel like a row of editable fields. */
.ts-me-duration-input {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  width: 64px;
  min-width: 64px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
}
.ts-me-duration-input:hover {
  border-color: var(--color-border);
}
.ts-me-duration-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.ts-me-notes {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ts-me-notes-input {
  flex: 1;
  font-size: 13px;
  color: var(--color-text);
  min-width: 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: none;
  padding: 2px 0;
  outline: none;
  transition: border-color 0.15s;
}
.ts-me-notes-input::placeholder {
  color: var(--color-text-faint);
  font-style: italic;
}
.ts-me-notes-input:focus {
  border-bottom-color: var(--accent, #01696F);
}
.ts-me-delete {
  border: none;
  background: none;
  color: var(--color-error);
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.1s;
  flex-shrink: 0;
}
.ts-me-delete:hover { opacity: 1; }
.ts-me-empty {
  text-align: center;
  padding: 16px;
  color: var(--color-text-faint);
  font-size: 13px;
}
.ts-me-add {
  display: flex;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  align-items: center;
}
.ts-me-input {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-bg);
  color: var(--color-text);
  width: 72px;
  flex-shrink: 0;
}
.ts-me-input-notes {
  flex: 1;
  width: auto;
  min-width: 0;
}
.ts-me-add-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: var(--accent, #01696F);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ts-me-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── INTERNAL VIEWS ──────────────────────────────────────────────────────── */
.internal-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.internal-header {
  padding: 24px 28px 16px;
  flex-shrink: 0;
}
.internal-header h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0;
}
.int-header-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  display: block;
}

/* Project cards grid */
.int-project-grid {
  flex: 1;
  overflow: auto;
  padding: 0 28px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-content: start;
}
.int-project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 10px);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.int-project-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.int-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.int-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.3;
}
.int-card-hours {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.int-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 6px;
}
.int-card-empty {
  color: var(--color-text-faint);
  font-style: italic;
}
.int-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.int-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.int-card-members {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.int-header-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.4;
  max-width: 600px;
}

/* Internal project — 2-column card layout */
.int-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 28px 28px;
  flex: 1;
  overflow: auto;
  align-content: start;
}
.int-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.int-col-header {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.int-col-count {
  font-size: 10px;
  background: var(--color-hover);
  color: var(--color-text-faint);
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 500;
}
.int-col-done .int-col-header {
  border-color: var(--color-border-subtle, rgba(0,0,0,0.08));
}
.int-col-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}
.int-task-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.int-task-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.int-task-card.drag-over {
  border-color: var(--color-primary);
  background: rgba(100,145,190,0.04);
}
.int-task-done {
  opacity: 0.55;
}
.int-tcard-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.int-task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
  color: var(--color-text);
  margin-top: 1px;
}
.int-task-check:hover {
  border-color: var(--color-primary);
  background: rgba(100,145,190,0.08);
}
.int-task-check.checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.int-tcard-title {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
}
.int-task-done .int-tcard-title {
  text-decoration: line-through;
}
.int-tcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-faint);
  align-items: center;
}
.int-tcard-meta > span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.int-tcard-assignees {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-left: auto;
}



/* Internal project header */
.int-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* Compact member bar — avatar stack */
.int-member-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px 16px;
  flex-shrink: 0;
  max-width: 33%;
}
.int-avatar-stack {
  display: flex;
  align-items: center;
}
.int-stack-avatar {
  margin-left: -6px;
  cursor: grab;
  position: relative;
  border-radius: 50%;
  transition: transform 0.15s;
}
.int-stack-avatar:first-child {
  margin-left: 0;
}
.int-stack-avatar:hover {
  transform: translateY(-2px);
}
.int-stack-avatar:active {
  cursor: grabbing;
}
.int-stack-count {
  margin-left: 6px;
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.1s;
}
.int-stack-count:hover {
  background: var(--color-hover);
}
.int-member-bar.expanded {
  max-width: 100%;
}
.int-members-expanded {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.int-member-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  background: var(--color-hover);
  font-size: var(--text-xs);
  cursor: grab;
  user-select: none;
  transition: background 0.1s;
}
.int-member-pill:hover {
  background: var(--color-border);
}
.int-collapse-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 4px 8px;
}
.int-member-pill.pill-active {
  background: var(--color-primary);
  color: white;
}
.int-stack-avatar.stack-active {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-radius: 50%;
}
.int-pill-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--color-text-faint);
  color: white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: 2px;
}
.int-member-pill:hover .int-pill-remove {
  display: flex;
}
.kanban-filters-expanded {
  flex-wrap: wrap;
}
.kanban-filters .int-avatar-stack,
.kanban-filters .int-members-expanded {
  max-width: 33vw;
}
.int-manage-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.int-manage-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.add-member-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  padding: 8px 10px 4px;
  font-weight: 600;
}
.add-member-current .add-member-remove-label {
  margin-left: auto;
  color: var(--color-text-faint);
  transition: color 0.1s;
}
.add-member-current:hover .add-member-remove-label {
  color: var(--color-danger, #e74c3c);
}
.int-header-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* Add Task modal */
.int-add-modal {
  max-width: 440px;
}
.int-add-form {
  padding: 16px 20px;
}
.int-add-form .form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  display: block;
}
.int-add-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.int-add-assignee-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: transparent;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--color-text);
}
.int-add-assignee-btn:hover {
  border-color: var(--color-primary);
}
.int-add-assignee-btn.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Shared avatar stack — overlapping circles for task cards and lists */
.avatar-stack-sm {
  display: flex;
  align-items: center;
}
.avatar-stack-item {
  position: relative;
  margin-left: -4px;
  border-radius: 50%;
  line-height: 0;
}
.avatar-stack-item:first-child {
  margin-left: 0;
}
.avatar-stack-more {
  margin-left: 4px;
  font-size: 10px;
  color: var(--color-text-faint);
  font-weight: 500;
}

.int-rename-input {
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  width: 100%;
}

.int-col.col-drag-over {
  background: rgba(100, 145, 190, 0.04);
  border-radius: var(--radius-lg, 10px);
  outline: 2px dashed var(--color-primary);
  outline-offset: -2px;
}
.int-task-card[draggable="true"] {
  cursor: grab;
}
.int-task-card[draggable="true"]:active {
  cursor: grabbing;
  opacity: 0.6;
}

.notif-prefs-lead {
  padding: 0 20px 8px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}
.notif-prefs-note {
  margin: 0 20px 12px;
  padding: 8px 12px;
  font-size: var(--text-sm);
  background: var(--color-surface-2);
  border-radius: 8px;
  color: var(--color-text-muted);
}
.notif-prefs-bulk {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.notif-prefs-list { padding: 4px 12px 16px; }
.notif-pref-cols,
.notif-pref-row {
  display: grid;
  grid-template-columns: 1fr 72px 88px;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
}
.notif-pref-cols {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}
.notif-pref-col-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-faint);
  text-transform: uppercase;
}
.notif-pref-row {
  border-bottom: 1px solid var(--color-border);
}
.notif-pref-row:last-child { border-bottom: none; }
.notif-pref-row.is-off .notif-pref-label { color: var(--color-text-muted); font-weight: 500; }
.notif-pref-copy { min-width: 0; }
.notif-pref-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}
.notif-pref-hint { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 2px; }
.notif-pref-check {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.notif-pref-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.notif-pref-check input[type="checkbox"]:disabled {
  cursor: default;
  opacity: 0.7;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.profile-notif {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
}
.profile-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.profile-notif-head label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}
.profile-modal .notif-prefs-lead {
  padding: 0;
  margin-bottom: 8px;
}
.profile-modal .notif-prefs-note {
  margin: 0 0 10px;
}
.profile-modal .notif-prefs-list { padding: 0; }
.profile-modal .notif-pref-cols,
.profile-modal .notif-pref-row {
  grid-template-columns: 1fr 64px 80px;
  padding-left: 0;
  padding-right: 0;
}

/* Client Health report */
.ch-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ch-green { background: #22c55e; }
.ch-yellow { background: #eab308; }
.ch-red { background: #ef4444; }
.ch-paused { background: var(--color-text-faint); }
.ch-group-row td {
  background: var(--color-hover) !important;
  padding: 8px 12px !important;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-border);
}
.ch-row {
  cursor: pointer;
  transition: background 0.1s;
}
.ch-row:hover {
  background: var(--color-hover);
}
.ch-client-name {
  font-weight: 500;
}

.int-stack-expand {
  margin-left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.int-stack-expand:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Assignee display — threshold approach */
.assignee-everyone {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 500;
  padding: 2px 8px;
  background: rgba(100, 145, 190, 0.08);
  border-radius: 10px;
}
.assignee-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Work Pipeline report */
.wp-week-group {
  margin-bottom: 4px;
}
.wp-week-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-hover);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  user-select: none;
  transition: background 0.1s;
}
.wp-week-header:hover {
  background: var(--color-border-subtle, rgba(0,0,0,0.06));
}
.wp-overdue-header {
  background: rgba(239, 68, 68, 0.06);
  color: var(--color-danger, #e74c3c);
}
.wp-overdue-header:hover {
  background: rgba(239, 68, 68, 0.1);
}
.wp-week-label {
  font-weight: 600;
}
.wp-week-count {
  font-size: 10px;
  background: var(--color-bg-tertiary, rgba(0,0,0,0.05));
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 500;
  color: var(--color-text-faint);
}
.wp-week-summary {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
}
.wp-table {
  font-size: var(--text-xs);
  table-layout: fixed;
}
.wp-table th:nth-child(1),
.wp-table td:nth-child(1) { width: 18%; } /* Project / Client */
.wp-table th:nth-child(2),
.wp-table td:nth-child(2) { width: 20%; } /* Task */
.wp-table th:nth-child(3),
.wp-table td:nth-child(3) { width: 10%; } /* Assignee */
.wp-table th:nth-child(4),
.wp-table td:nth-child(4) { width: 10%; } /* Status */
.wp-table th:nth-child(5),
.wp-table td:nth-child(5) { width: 7%; }  /* Priority */
.wp-table th:nth-child(6),
.wp-table td:nth-child(6) { width: 10%; } /* Start */
.wp-table th:nth-child(7),
.wp-table td:nth-child(7) { width: 10%; } /* Due */
.wp-table th:nth-child(8),
.wp-table td:nth-child(8) { width: 6%; text-align: center; }  /* Est */
.wp-table th:nth-child(9),
.wp-table td:nth-child(9) { width: 6%; text-align: center; }  /* Used */
.wp-table th:nth-child(10),
.wp-table td:nth-child(10) { width: 3%; } /* Blocked icon */
.wp-row {
  cursor: pointer;
  transition: background 0.1s;
}
.wp-row:hover {
  background: var(--color-hover);
}

.wp-client-col {
  overflow: hidden;
}
.wp-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-client {
  font-size: 10px;
  color: var(--color-text-faint);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-project {
  font-weight: 500;
  font-size: var(--text-xs);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-task-name {
  font-weight: 500;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.1s;
}
.wp-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.wp-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-in-progress { background: #3b82f6; }
.dot-review { background: #8b5cf6; }
.dot-attention { background: #ef4444; }
.dot-ongoing { background: #22c55e; }
.dot-todo { background: #94a3b8; }
.wp-pri {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.wp-urgent { background: rgba(239,68,68,0.1); color: #ef4444; }
.wp-high { background: rgba(234,179,8,0.1); color: #ca8a04; }
.wp-low { background: rgba(148,163,184,0.1); color: #94a3b8; }

/* Retainer project row — gold highlight */
.prof-retainer-row {
  background: rgba(234, 179, 8, 0.06) !important;
}
.prof-retainer-row:hover {
  background: rgba(234, 179, 8, 0.1) !important;
}

/* Contract line-item cards (Edit Project modal) --------------------------
   Each card groups one line's amount/type/dates with its own note so it's
   visually clear the note belongs to the line directly above it, not the
   contract overall. Lets users explain price increases or one-off items
   per line. */
.contract-item-card {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface-alt, rgba(0, 0, 0, 0.015));
}
.contract-item-card:hover {
  border-color: var(--color-border-strong, var(--color-border));
}
.contract-item-card .contract-item-row {
  row-gap: 4px;
}
.contract-item-card .contract-item-note {
  background: transparent;
}

/* Timesheet Summary report — week navigator + grid -------------------------
   Lives on the Reports page. Reuses .timesheet-grid / .ts-totals-bar styles
   so totals/footer align with the user-facing Timesheet view. */
.tssummary-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}
.tssummary-week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
.tssummary-week-label {
  min-width: 220px;
  text-align: center;
}
.tssummary-grid td.ts-cell.has-time {
  font-weight: 600;
}

/* Timesheet Summary report — name cell with avatar + name link */
.tssummary-name-cell { padding: 8px 12px; }
.tssummary-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.tssummary-user-link:hover .tssummary-user-name { color: var(--color-primary); }
.tssummary-user-name { font-weight: 500; }
