.assignment-prompt-modal {
  z-index: 1201 !important;
}

/* Utility class to hide elements */
.hidden {
  display: none !important;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; font-family: system-ui, Arial, sans-serif; }

/* Force full width on all screen sizes */
@media (max-width: 768px) {
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #app {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
:root {
  --sidebar-width: 230px;
}
#app { 
  display: grid; 
  grid-template-columns: var(--sidebar-width) 6px 1fr; 
  grid-template-rows: 1fr auto;
  grid-template-areas: 
    "sidebar resizer main"
    "toolbar toolbar toolbar";
}
.sidebar { 
  grid-area: sidebar;
  background: #0f172a; 
  color: #e2e8f0; 
  padding: 10px; 
  overflow-y: auto; 
  width: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 15px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}

.sidebar-logo img {
  max-width: 100%;
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

.resizer { 
  grid-area: resizer;
  width: 6px; 
  cursor: col-resize; 
  background: #0b1222;
  position: relative;
  user-select: none;
}
.resizer:hover { 
  background: #13223f; 
}
.resizer:active {
  background: #1e3a8a;
}
.resizer.resizing {
  background: #1e3a8a;
}
.resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
}
.resizer:hover::after {
  background: rgba(255, 255, 255, 0.5);
  width: 3px;
  height: 50px;
}
.main { 
  grid-area: main;
  padding: 16px; 
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #000000;
}

/* Screen reader only labels */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Auth panel styling */
.auth { margin-bottom: 16px; }
.auth.minimized { display: none; }
.auth-toggle { margin-bottom: 16px; }
.auth-toggle-btn { 
  width: 100%; 
  padding: 8px; 
  background: #1e293b; 
  color: #e2e8f0; 
  border: 1px solid #334155; 
  border-radius: 4px; 
  cursor: pointer; 
}
.auth-toggle-btn:hover { background: #334155; }
.auth input { width: 100%; margin-bottom: 8px; padding: 8px; border-radius: 4px; border: 1px solid #334155; background: #111827; color: #e2e8f0; box-sizing: border-box; }
.auth-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth button { flex: 1; padding: 8px; border: 0; border-radius: 4px; background: #22c55e; color: #083344; font-weight: 700; cursor: pointer; margin-bottom: 0; min-width: 80px; }
.auth-buttons button { margin-bottom: 0 !important; }
.auth button:hover { background: #16a34a; }
#logoutBtn { background: #ef4444; color: white; }
#logoutBtn:hover { background: #dc2626; }
.auth-minimize-btn { 
  width: 20px; 
  height: 20px; 
  border: none; 
  background: #475569; 
  color: #e2e8f0; 
  border-radius: 50%; 
  cursor: pointer; 
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}
.auth-minimize-btn:hover { background: #64748b; }
.auth { position: relative; }

/* New auth view styles */
.initial-auth-view,
.login-view,
.register-view,
.logged-in-view {
  padding: 0;
}

.initial-auth-view h2 {
  margin-bottom: 16px;
  color: #e2e8f0;
  text-align: center;
}

.auth-action-btn {
  flex: 1 !important;
  padding: 12px 8px !important;
  background: #3b82f6 !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background-color 0.2s !important;
  margin-bottom: 0 !important;
}

.auth-action-btn:hover {
  background: #2563eb !important;
}

.back-btn {
  background: #6b7280 !important;
  color: white !important;
  margin-bottom: 0 !important;
}

.back-btn:hover {
  background: #4b5563 !important;
}

.current-user {
  color: #e2e8f0;
  font-style: italic;
  margin-bottom: 12px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Empty projects state */
.empty-projects-message {
  padding: 40px 20px;
  text-align: center;
}

.empty-state {
  background: #1e293b;
  border-radius: 12px;
  padding: 32px 24px;
  border: 2px dashed #475569;
}

.empty-state h3 {
  color: #e2e8f0;
  font-size: 20px;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.empty-state p {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.create-project-btn {
  background: #22c55e;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
}

.create-project-btn:hover {
  background: #16a34a;
}

.plus-icon {
  font-size: 16px;
  font-weight: bold;
}

.projects h2 { margin-top: 16px; border-bottom: 1px solid #334155; padding-bottom: 6px; }
.create-project { display: flex; gap: 6px; margin-top: 8px; }
.create-project input { flex: 1; padding: 6px; border-radius: 4px; border: 1px solid #334155; background: #111827; color: #e2e8f0; }
.create-project button { padding: 6px 10px; border-radius: 4px; border: 0; background: #3b82f6; color: white; cursor: pointer; }

/* System Info Box */

/* Activity Log Box */
.activity-log-box {
  margin-top: auto;
  margin-bottom: 8px;
  padding: 0;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  transition: max-height 0.3s ease;
}

.activity-log-box.collapsed {
  max-height: 38px;
}

.activity-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #334155;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}

.activity-log-box.collapsed .activity-log-header {
  border-bottom: none;
  border-radius: 6px;
}

.activity-log-title {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 12px;
}

.activity-log-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.activity-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
  line-height: 1;
}

.activity-toggle-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

.activity-log-box.collapsed .activity-toggle-btn {
  transform: rotate(-90deg);
}

.activity-refresh-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
}

.activity-refresh-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
  transform: rotate(90deg);
}

.activity-log-content {
  overflow-y: auto;
  flex: 1;
  padding: 6px 8px;
  max-height: 140px;
  transition: opacity 0.3s ease;
}

.activity-log-box.collapsed .activity-log-content {
  display: none;
}

.activity-log-loading {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-style: italic;
}

.activity-log-empty {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-style: italic;
}

.activity-log-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.3);
  border-left: 3px solid;
  transition: background 0.2s;
  cursor: pointer;
}

.activity-log-item:hover {
  background: rgba(30, 41, 59, 0.5);
}

.activity-log-item.activity-login {
  border-left-color: #3b82f6;
}

.activity-log-item.activity-comment {
  border-left-color: #8b5cf6;
}

.activity-log-item.activity-project {
  border-left-color: #10b981;
}

.activity-log-item.activity-task {
  border-left-color: #f59e0b;
}

.activity-log-item.activity-user {
  border-left-color: #06b6d4;
}

.activity-log-item.activity-delete {
  border-left-color: #ef4444;
}

/* Whiteboard project pin styles */
.project-pin {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  min-width: 120px;
  height: 36px;
  cursor: grab;
}

.project-pin .project-pin-title {
  font-weight: 600;
  font-size: 13px;
  color: #111827;
}

.project-pin .project-pin-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
  z-index: 1000; /* ensure controls are on top */
}

.project-pin .project-pin-controls button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.project-pin .project-pin-legs .project-leg {
  position: absolute;
  width: 120px;
  max-width: 120px;
  height: 28px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e6e6e6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.project-pin-task-item {
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  cursor: grab;
  font-size: 13px;
}
.whiteboard-undo-snackbar {
  font-family: Inter, sans-serif;
}
.project-pin-task-item:active { cursor: grabbing; }

.project-leg .task-leg-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.project-pin.dragging { opacity: 0.9; cursor: grabbing; }

/* Large compact project-pin (no white background, tab only) */
.project-pin.large {
  /* Make the pin slightly smaller to match project tree row height at 100% zoom */
  min-width: 220px;
  height: 40px;
  padding: 0; /* spacing moved to internal body */
  background: transparent; /* parent background set inline to project color */
  border: none; /* remove white-card border */
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-radius: 6px;
  overflow: visible; /* allow tasks list to expand downward outside the pin */
}
.project-pin.large .project-pin-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.project-pin.large .project-pin-controls button {
  font-size: 12px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 4px;
  border: none;
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.project-pin.large .project-pin-controls button:hover { filter: brightness(0.95); }
.project-pin.large .project-pin-body {
  position: relative;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  pointer-events: auto;
}
/* Large pin row for proper layout */
.project-pin.large .project-pin-row { display:flex; align-items:center; width:100%; }
.project-pin.large .project-pin-left { display:flex; align-items:center; gap:8px; flex:1; }

/* Task tree inside the large pin */
.project-pin-task-tree { box-sizing:border-box; border-radius:4px; background: #ffffff; border: 1px solid rgba(0,0,0,0.08); z-index: 9999; max-height: 320px; overflow:auto; }
.task-tree-toggle {
  background: none;
  border: none;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-tree-toggle:hover { background: rgba(0,0,0,0.04); border-radius: 4px; }
.project-pin-task-tree li { display:flex; align-items:center; }
.project-pin-task-tree li { font-size: 13px; color: #0f172a; }

/* Visual debug flash for toggle clicks during troubleshooting (removed later) */
.project-pin-toggle-flash { display:none !important; }
.project-pin-debug-overlay { display:none !important; }

/* Task overlay handle for dragging */
.project-pin-tasks-handle {
  background: rgba(0,0,0,0.04);
  cursor: grab;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.project-pin-tasks-fallback { z-index: 2147483000; }

/* Task overlay root (inside postItContainer) */
.project-pin-tasks {
  /* Whiteboard linked project badges and read-only indicator */
  .whiteboard-badge {
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #e6e6fa;
  }
  .whiteboard-readonly {
    background: #fff1f2;
    color: #b91c1c;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #fecaca;
  }
  position: absolute; /* overridden as needed by JS */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 1100;
  min-width: 220px;
  pointer-events: auto;
}
.link-whiteboard-selected { border: 1px solid #3b82f6; background: #eef2ff; }

/* Small avatar inside project pin */
.project-pin .project-pin-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.95);
  box-sizing: border-box;
}

.project-pin.large .project-pin-title {
  font-size: 13px;
  font-weight: 600;
}

.pin-ctrl-icon {
  padding: 0 !important;
  line-height: 1 !important;
}

/* Ensure project title sits on its own row inside the pin */
.project-pin .project-pin-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.project-pin .project-pin-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-pin.large .project-pin-legs .project-leg {
  /* keep a clean leg appearance for large pins */
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.project-pin.large .project-pin-legs { pointer-events: auto; }


.activity-log-item.activity-restore {
  border-left-color: #84cc16;
}

.activity-log-item.activity-role {
  border-left-color: #ec4899;
}

.activity-log-time {
  color: #64748b;
  font-size: 10px;
  margin-bottom: 2px;
}

.activity-log-text {
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.4;
}

.activity-log-user {
  color: #60a5fa;
  font-weight: 500;
}

.system-info-box {
  margin-top: auto;
  padding: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.system-info-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  line-height: 1.4;
}

.info-label {
  color: #64748b;
  font-weight: 500;
}

.system-info-item span:last-child {
  color: #e2e8f0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
}

.tree { margin: 8px 0; }
.tree ul { list-style: none; padding-left: 14px; }
.tree li { cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.tree li:hover { background: #1f2937; }
header { border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; background: #fff; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0 0 6px; color: #334155; font-size: 14px; }
.controls { display: flex; gap: 6px; margin: 8px 0; }
.controls input, .controls select { padding: 6px; }

/* Simple schedule */
.schedule { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.schedule-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; }
.schedule-label { font-size: 13px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-bar { height: 16px; background: #60a5fa; border-radius: 8px; }

/* New task form and task list styling */
.add-task-card { background: #f8fafc; padding: 6px; }
.task-form { display: flex; flex-direction: column; gap: 12px; }
.task-title-input, .task-desc-input { padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; }
.task-desc-input { resize: vertical; }
.date-row { display: flex; gap: 12px; }
.date-row input { flex: 1; padding: 6px; }
.primary-btn { background: #3b82f6; color: white; padding: 10px 16px; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; }
.primary-btn:hover { background: #2563eb; }

.tasks-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
  padding: 10px;
  border: 3px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.task-item.collapsed {
  padding: 8px 10px;
}
.task-item-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.toggle-item-btn {
  transition: all 0.2s ease;
}
.toggle-item-btn:hover {
  background: #d1d5db !important;
  transform: scale(1.1);
}
.task-item:hover { background: #f9fafb; }
.task-item h4 { margin: 0 0 6px; font-size: 16px; }
.task-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.status-badge { padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-todo { background: #fef3c7; color: #92400e; }
.status-doing { background: #dbeafe; color: #1e40af; }
.status-done { background: #d1fae5; color: #065f46; }
.task-description { margin: 8px 0 0; color: #6b7280; font-size: 14px; }
.empty-message { color: #9ca3af; font-style: italic; }

.back-btn { padding: 8px 16px; margin-bottom: 16px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; }
.back-btn:hover { background: #e5e7eb; }
.task-detail-card h2 { margin-top: 0; }
.task-detail-meta { display: flex; gap: 16px; align-items: center; margin: 12px 0; }
.task-dates { font-size: 14px; }
.task-full-description { 
  margin-top: 20px; 
  margin-bottom: 20px;
  padding: 16px; 
  line-height: 1.6; 
  border: 3px solid #3b82f6; 
  border-radius: 8px;
  background: #eff6ff;
}
.task-timeline { margin-top: 12px; }
.timeline-bar { background: #3b82f6; color: white; padding: 8px 12px; border-radius: 4px; text-align: center; font-weight: 600; }

/* Comments and attachments styling */
.comment-form { margin-top: 16px; }
.comment-input { width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; resize: vertical; }
.comment-form button { margin-top: 8px; }
.comments-list { margin: 16px 0; }
.comment-item { 
  background: #ffffff; 
  border: 1px solid #e2e8f0; 
  border-radius: 6px; 
  padding: 0; 
  margin-bottom: 12px; 
  overflow: hidden;
}
.comment-header { 
  display: flex; 
  align-items: center; 
  padding: 6px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.comment-author { font-weight: 600; color: #1f2937; }
.comment-timestamp { font-size: 12px; color: #6b7280; }
.comment-text { 
  color: #374151; 
  line-height: 1.5; 
  padding: 12px;
}
.edit-comment-btn { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.edit-comment-btn:hover { background: #e5e7eb; }
.delete-comment-btn { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.delete-comment-btn:hover { background: #fecaca; border-color: #f87171; }
.restore-comment-btn { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.restore-comment-btn:hover { background: #a7f3d0; border-color: #34d399; }
.comment-deleted { background: #fef2f2 !important; border-left: 3px solid #ef4444 !important; opacity: 0.7; }

/* Comment reactions */
.comment-reactions { 
  display: flex; 
  gap: 8px; 
  padding: 6px 12px; 
  border-top: 1px solid #e5e7eb; 
  background: #fafafa; 
}
.reaction-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.reaction-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.reaction-btn.active {
  background: #dbeafe;
  border-color: #3b82f6;
}
.reaction-count {
  font-size: 12px;
  color: #6b7280;
}
.reply-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
}
.reply-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Comment file upload and attachments */
.comment-file-container { margin: 8px 0; }
.comment-file-input { display: none; }
.comment-file-label { display: inline-block; padding: 6px 12px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; font-size: 14px; color: #374151; }
.comment-file-label:hover { background: #e5e7eb; }
.comment-file-container { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.comment-file-preview-container { display: flex; flex-wrap: wrap; gap: 8px; }
.comment-file-preview-item { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  padding: 6px 10px; 
  background: #f3f4f6; 
  border: 1px solid #d1d5db; 
  border-radius: 4px; 
  font-size: 13px;
  transition: all 0.2s;
}
.comment-file-preview-item:hover { background: #e5e7eb; }
.comment-file-preview-item img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e5e7eb;
}
.comment-file-preview-item button {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.comment-file-preview-item button:hover {
  background: #fecaca;
  border-color: #fca5a5;
}
.comment-attachments { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; }
.comment-attachment-item { margin: 4px 0; }
.comment-attachment-link { color: #3b82f6; text-decoration: none; font-size: 14px; }
.comment-attachment-link:hover { text-decoration: underline; }
.comment-attachment-size { color: #6b7280; font-size: 12px; }

/* Image thumbnails in comments */
.comment-attachment-thumbnail-container { display: flex; align-items: center; gap: 12px; }
.comment-attachment-thumbnail { 
  width: 60px; 
  height: 60px; 
  object-fit: cover; 
  border-radius: 6px; 
  border: 1px solid #e5e7eb; 
  cursor: pointer; 
  transition: transform 0.2s; 
}
.comment-attachment-thumbnail:hover { 
  transform: scale(1.05); 
  border-color: #3b82f6; 
}
.comment-attachment-info { display: flex; flex-direction: column; gap: 2px; }
.comment-attachment-filename { font-size: 14px; font-weight: 500; color: #374151; }

/* Task attachments list */
.task-attachments-list { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.task-attachment-item { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 8px; 
  background: #f9fafb; 
  border-radius: 6px; 
  border: 1px solid #e5e7eb; 
}
.task-attachment-item:hover { background: #f3f4f6; }
.delete-attachment-btn { 
  padding: 6px 12px; 
  background: #fee2e2; 
  color: #991b1b; 
  border: 1px solid #fecaca; 
  border-radius: 4px; 
  cursor: pointer; 
  font-size: 14px; 
  transition: all 0.2s; 
}
.delete-attachment-btn:hover { 
  background: #fecaca; 
  border-color: #fca5a5; 
}

/* Edit comment form */
.edit-comment-form { margin-top: 8px; }
.edit-comment-buttons { display: flex; gap: 8px; margin-top: 8px; }
.secondary-btn { background: #f3f4f6; color: #374151; padding: 10px 16px; border: 1px solid #d1d5db; border-radius: 4px; font-weight: 600; cursor: pointer; }
.secondary-btn:hover { background: #e5e7eb; }
.secondary-btn:hover { background: #e5e7eb; }
.auth input { width: 100%; margin-bottom: 8px; padding: 8px; border-radius: 4px; border: 1px solid #334155; background: #111827; color: #e2e8f0; }
.auth button { width: 100%; padding: 8px; border: 0; border-radius: 4px; background: #22c55e; color: #083344; font-weight: 700; cursor: pointer; }
.projects h2 { margin-top: 16px; border-bottom: 1px solid #334155; padding-bottom: 6px; }
.create-project { display: flex; gap: 6px; margin-top: 8px; }
.create-project input { flex: 1; padding: 6px; border-radius: 4px; border: 1px solid #334155; background: #111827; color: #e2e8f0; }
.create-project button { padding: 6px 10px; border-radius: 4px; border: 0; background: #3b82f6; color: white; cursor: pointer; }
.tree { margin: 8px 0; }
.tree ul { list-style: none; padding-left: 14px; }
.tree li { cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.tree li:hover { background: #1f2937; }
header { border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; background: #fff; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0 0 6px; color: #334155; font-size: 14px; }
.controls { display: flex; gap: 6px; margin: 8px 0; }
.controls input, .controls select { padding: 6px; }
/* Simple schedule */
.schedule { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.schedule-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; }
.schedule-label { font-size: 13px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-bar { height: 16px; background: #60a5fa; border-radius: 8px; }

/* New task form and task list styling */
.add-task-card { background: #f8fafc; padding: 6px; }
.task-form { display: flex; flex-direction: column; gap: 12px; }
.task-title-input, .task-desc-input { padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; }
.task-desc-input { resize: vertical; }
.date-row { display: flex; gap: 12px; }
.date-row input { flex: 1; padding: 6px; }
.primary-btn { background: #3b82f6; color: white; padding: 10px 16px; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; }
.primary-btn:hover { background: #2563eb; }

.tasks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* Row view for project tasks */
.tasks-list.row-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Row view styling for task items */
.tasks-list.row-view .task-item {
  padding: 10px 14px;
}

.tasks-list.row-view .task-item.collapsed {
  padding: 8px 14px;
}

.tasks-list.row-view .task-item h4 {
  font-size: 14px;
}

/* Keep details hidden when collapsed in row view */
.tasks-list.row-view .task-item.collapsed .task-item-details {
  display: none;
}

.task-item {
  padding: 14px;
  background: white;
  border: 2px solid var(--task-color, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}
.task-item.collapsed {
  padding: 8px 10px;
}
.task-item-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.toggle-item-btn {
  transition: all 0.2s ease;
  background: #f3f4f6 !important;
  color: #374151 !important;
}
.toggle-item-btn:hover {
  background: #d1d5db !important;
  transform: scale(1.1);
}
.task-item:hover { 
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.task-item h4 { 
  margin: 0 0 6px; 
  font-size: 16px; 
  color: #1e293b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-item h4::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--task-color, #3b82f6);
  border-radius: 50%;
  flex-shrink: 0;
}
.task-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.status-badge { padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-todo { background: #fef3c7; color: #92400e; }
.status-doing { background: #dbeafe; color: #1e40af; }
.status-done { background: #d1fae5; color: #065f46; }
.task-description { 
  margin: 8px 0 0; 
  color: #64748b; 
  font-size: 14px; 
  background: #f8fafc;
  padding: 8px;
  border-radius: 4px;
}
.task-assignment {
  color: #1e293b !important;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 4px;
}
.task-dependencies {
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 4px;
}
.empty-message { color: #9ca3af; font-style: italic; }

.back-btn { padding: 8px 16px; margin-bottom: 16px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; }
.back-btn:hover { background: #e5e7eb; }
.task-detail-card h2 { margin-top: 0; }
.task-detail-meta { display: flex; gap: 16px; align-items: center; margin: 12px 0; }
.task-dates { font-size: 14px; }
.task-full-description { 
  margin-top: 20px; 
  margin-bottom: 20px;
  padding: 16px; 
  line-height: 1.6; 
  border: 3px solid #3b82f6; 
  border-radius: 8px;
  background: #eff6ff;
}
.task-timeline { margin-top: 12px; }
.timeline-bar { background: #3b82f6; color: white; padding: 8px 12px; border-radius: 4px; text-align: center; font-weight: 600; }

/* Task form toggle button styling */
.task-form-header { 
  display: flex; 
  justify-content: flex-start; 
  align-items: center; 
  margin-bottom: 4px; 
  cursor: pointer;
  user-select: none;
  padding: 2px;
  border-radius: 4px;
  transition: background 0.2s;
  gap: 6px;
}
.task-form-header:hover { 
  background: #f9fafb; 
}
.task-form-header h3 { 
  margin: 0; 
  cursor: pointer;
  flex: 1;
  font-size: 15px;
}
.task-form-header-buttons { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.task-form-toggle-btn { background: #e5e7eb; border: none; border-radius: 4px; padding: 4px 12px; font-size: 18px; cursor: pointer; transition: background 0.2s; line-height: 1; }
.task-form-toggle-btn:hover { background: #d1d5db; }

/* Concept Map View */
.concept-map-view {
  display: none;
  padding: 20px;
}

.concept-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.concept-map-header h2 {
  color: #1f2937;
  font-size: 24px;
  margin: 0;
}

/* Concept Map kontroller */
.concept-map-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.control-group {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.map-control-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  font-size: 18px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.map-control-btn:hover {
  background: #f3f4f6;
  border-color: #3b82f6;
  color: #3b82f6;
  transform: scale(1.05);
}

.map-control-btn:active {
  transform: scale(0.95);
}

.zoom-indicator {
  min-width: 50px;
  text-align: center;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.concept-map-container {
  background: #f9fafb;
  border-radius: 12px;
  padding: 40px;
  min-height: 600px;
  position: relative;
  overflow: auto;
}

/* Tasks View Scrolling */
.tasks-view { 
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Overview View - same scroll behavior as tasks-view */
.overview-view {
  min-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 40px; /* Extra space at bottom */
}

.tasks-content {
  height: calc(100vh - 200px);
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 20px;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
  padding-bottom: 100px;
}

/* Row view layout */
.tasks-grid.row-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* View toggle button */
.view-toggle-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-left: auto;
}

.view-toggle-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.view-toggle-btn:active {
  transform: translateY(0);
}

/* Compact task tile layout */
.task-tile {
  background: white;
  border: 2px solid var(--task-color);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Row view styling */
.tasks-grid.row-view .task-tile {
  min-height: auto;
  flex-direction: row;
  align-items: center;
  padding: 12px 16px;
  gap: 16px;
}

.tasks-grid.row-view .task-tile-header {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.tasks-grid.row-view .task-tile-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  -webkit-line-clamp: 1;
}

.tasks-grid.row-view .task-tile-project {
  font-size: 11px;
}

.tasks-grid.row-view .task-tile-meta {
  flex-direction: row;
  align-items: center;
  min-width: 200px;
  gap: 8px;
}

.tasks-grid.row-view .task-tile-row {
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.tasks-grid.row-view .task-tile-footer {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 8px;
  min-width: 150px;
}

.tasks-grid.row-view .task-tile-deadline {
  position: static;
  margin-left: 8px;
}

.task-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.task-tile-header {
  margin-bottom: 10px;
}

.task-tile-title {
  color: #1e293b;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.task-tile-project {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #1e293b;
}

.task-tile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #f8fafc;
  border-radius: 4px;
}

.task-tile-assignment {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.task-tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.task-tile-status {
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #1e293b;
}

.task-tile-priority {
  font-size: 11px;
  color: #1e293b;
}

.task-tile-deadline {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.task-tile-deadline.overdue {
  background: #ef4444;
}

.task-tile-deadline.today {
  background: #f59e0b;
}

.task-tile-deadline.soon {
  background: #f97316;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding: 12px;
  }
  
  .task-tile {
    min-height: 120px;
    padding: 12px;
  }
}

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

/* Plus button for creating projects */
.plus-btn {
  background: #22c55e;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  position: relative;
}

.plus-btn.main-project-btn {
  background: #3b82f6;
  width: 40px;
  height: 40px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.plus-btn.main-project-btn:hover {
  background: #2563eb;
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.plus-btn:hover {
  background: #16a34a;
  transform: scale(1.1);
}

.plus-btn:active {
  transform: scale(0.95);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

#createProjectModal.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

#createProjectModal.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.3s;
}

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

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: white;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}

.modal-footer button {
  min-width: 100px;
}

.btn-cancel {
  padding: 10px 20px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-primary {
  padding: 10px 20px;
  border: none;
  background: #3b82f6;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-create {
  padding: 10px 20px;
  border: none;
  background: #22c55e;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-create:hover {
  background: #16a34a;
}

.btn-create:active {
  transform: scale(0.98);
}

/* Main project tile - hierarchical parent project */
.main-project-tile {
  background-color: #ffffff !important;
  border: 4px solid #000000 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  position: relative;
  margin-bottom: 0 !important;
  font-size: 16px !important;
  padding: 16px 20px !important;
  min-height: 60px !important;
}

.main-project-tile .project-tile-name {
  color: #000000 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

.main-project-tile::before {
  content: '📌';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  opacity: 0.6;
}

.main-project-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
}

/* Project Switcher Icon */
.project-switcher-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #3b82f6;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  z-index: 10;
}

.project-switcher-icon:hover {
  background: #3b82f6;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.project-switcher-dropdown {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  min-width: 250px;
  max-width: 350px;
  max-height: 400px;
  overflow-y: auto;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-switcher-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-switcher-item:last-child {
  border-bottom: none;
}

.project-switcher-item:hover {
  background: #f8fafc;
}

.project-switcher-item.active {
  background: #eff6ff;
  color: #3b82f6;
  font-weight: 600;
}

/* Subprojects container with hierarchical connection lines */
.subprojects-container {
  position: relative;
  padding-left: 40px;
  margin-top: 0;
  padding-top: 20px;
}

.subprojects-container::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 20px;
  width: 3px;
  background: linear-gradient(to bottom, #ffffff 0%, #000000 100%);
  z-index: 0;
}

.subproject-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.subproject-wrapper::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 50%;
  width: 40px;
  height: 2px;
  background: #666666;
  z-index: 0;
}

.subproject-wrapper::after {
  content: '';
  position: absolute;
  left: -40px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #666666;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}


/* User Management Button - Styling defined in bottom-toolbar.css */
/* Trash Button - Styling defined in bottom-toolbar.css */

/* Users List in Modal */
.users-list {
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Wider modal for user management */
#userRolesModal .modal-content {
  max-width: 700px;
  width: 95%;
}

/* Higher z-index for edit roles modal to appear above user management modal */
#editUserRolesModal {
  z-index: 1100;
}

.user-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s;
  overflow-x: hidden;
  gap: 12px;
}

.user-list-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateX(4px);
}

.user-list-item .user-avatar {
  flex-shrink: 0;
  margin-right: 4px;
}

.user-info {
  flex: 1;
}

.user-email {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.user-roles {
  font-size: 13px;
  color: #64748b;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.role-badge {
  display: inline-block;
  padding: 1px 4px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

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

.role-badge.economy {
  background: #d1fae5;
  color: #065f46;
}

.role-badge.project-manager {
  background: #dbeafe;
  color: #1e40af;
}

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

.edit-roles-btn {
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.edit-roles-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.reset-password-btn {
  padding: 8px 16px;
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.reset-password-btn:hover {
  background: #d97706;
  transform: scale(1.05);
}

/* Checkbox Labels for Roles */
.checkbox-label {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Undo toast after soft-delete */
.undo-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  z-index: 9999;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.undo-toast button {
  margin-left: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Stacked undo toasts layout: each new toast sits above the previous */
.undo-toast { right: 20px; position: fixed; z-index: 10000; }
.undo-toast:nth-last-child(1) { bottom: 20px; }
.undo-toast:nth-last-child(2) { bottom: 70px; }
.undo-toast:nth-last-child(3) { bottom: 120px; }

/* Trash view styling */
.trash-view .card { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 12px; }
.trash-view .card .primary-btn { margin-left: 12px; }

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-label span {
  position: relative;
  cursor: pointer;
}

.checkbox-label span[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) translateY(-8px);
  background: #222;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: pre-line;
  font-size: 13px;
  z-index: 9999;
  max-width: 260px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  pointer-events: none;
}

.checkbox-label input[type="checkbox"]:checked + span {
  color: #3b82f6;
  font-weight: 600;
}

/* Kanban Board Styles */
.kanban-view {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kanban-header {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.kanban-header h2 {
  margin: 0 0 8px 0;
  color: #1f2937;
  align-self: flex-start;
}

#kanbanProjectName {
  display: block;
  width: 100%;
  text-align: left;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

/* Kanban Zoom Levels */
.kanban-board.zoom-large .kanban-task {
  min-height: 180px;
  font-size: 15px;
  padding: 18px;
}

.kanban-board.zoom-large .task-title {
  font-size: 17px;
  margin-bottom: 14px;
}

.kanban-board.zoom-large .task-meta {
  font-size: 13px;
  gap: 12px;
}

.kanban-board.zoom-medium .kanban-task {
  min-height: 120px;
  font-size: 14px;
  padding: 14px;
}

.kanban-board.zoom-medium .task-title {
  font-size: 15px;
  margin-bottom: 10px;
}

.kanban-board.zoom-medium .task-meta {
  font-size: 12px;
  gap: 8px;
}

.kanban-board.zoom-small .kanban-task {
  min-height: 70px;
  font-size: 11px;
  padding: 8px;
}

.kanban-board.zoom-small .task-title {
  font-size: 12px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.kanban-board.zoom-small .task-meta {
  font-size: 10px;
  gap: 4px;
}

.kanban-board.zoom-small .priority-badge,
.kanban-board.zoom-small .task-icon {
  font-size: 9px;
  padding: 1px 4px;
}

/* Kanban Zoom Controls */
.kanban-zoom-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.zoom-btn {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.zoom-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.zoom-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.zoom-btn svg {
  width: 18px;
  height: 18px;
}

.zoom-btn.zoom-large svg {
  width: 20px;
  height: 20px;
}

.zoom-btn.zoom-small svg {
  width: 16px;
  height: 16px;
}

/* Overview Cards Zoom Levels */
.overview-cards-container.zoom-large {
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)) !important;
}

.overview-cards-container.zoom-large .overview-project-card {
  padding: 28px !important;
}

.overview-cards-container.zoom-large h2 {
  font-size: 24px !important;
}

.overview-cards-container.zoom-large p {
  font-size: 15px !important;
}

.overview-cards-container.zoom-medium {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
}

.overview-cards-container.zoom-small {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
}

.overview-cards-container.zoom-small .overview-project-card {
  padding: 16px !important;
}

.overview-cards-container.zoom-small h2 {
  font-size: 16px !important;
}

.overview-cards-container.zoom-small p {
  font-size: 12px !important;
}

.overview-cards-container.zoom-small button {
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.kanban-column {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.kanban-column-header h3 {
  margin: 0;
  font-size: 16px;
  color: #374151;
}

.task-count {
  background: #3b82f6;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.kanban-tasks {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: calc(100vh - 280px);
  padding-right: 4px;
  padding-bottom: 16px;
}

.kanban-tasks::-webkit-scrollbar {
  width: 8px;
}

.kanban-tasks::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.kanban-tasks::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 4px;
}

.kanban-tasks::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

.kanban-task {
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  cursor: grab;
  transition: all 0.2s;
}

.kanban-task:last-child {
  margin-bottom: 0;
}

.kanban-task:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.kanban-task:active {
  cursor: grabbing;
}

.kanban-task.dragging {
  opacity: 0.5;
}

.kanban-task-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  font-size: 14px;
}

.kanban-task-project {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.kanban-task-dates {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.kanban-task-description {
  font-size: 12px;
  color: #4b5563;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

/* Whiteboard View */
#whiteboardView {
  position: relative;
  width: 100%;
  background: #f8fafc;
  z-index: 1;
  flex-direction: column;
  min-height: calc(100vh - 80px);
}

/* Overview View */
#overviewView {
  position: relative;
  width: 100%;
  z-index: 2;
}

/* ========================================
   INTERMAP STYLES
   ======================================== */

.intermap-container {
  padding: 20px;
  max-width: 100%;
}

.intermap-toolbar {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.map-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.map-selector-row label {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.map-select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.map-select:hover {
  border-color: #3b82f6;
}

.map-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Opacity Control with Knob Dial (OLD - DEPRECATED) */
.opacity-control {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Opacity Control Inline (NEW - Compact version without knob) */
.opacity-control-inline {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin: 0 8px;
}

.opacity-control-inline label {
  font-weight: 600;
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}

.opacity-slider-inline {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.3) 0%, #3b82f6 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.opacity-slider-inline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.15s;
}

.opacity-slider-inline::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.opacity-slider-inline::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.15s;
}

.opacity-slider-inline::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.opacity-value-inline {
  font-weight: 600;
  color: #3b82f6;
  font-size: 11px;
  min-width: 35px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.opacity-control label {
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  white-space: nowrap;
}

.knob-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  background: linear-gradient(to right, #e5e7eb 0%, #3b82f6 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.opacity-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.opacity-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* Knob Dial (Räfflad ratt) */
.knob-dial {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.1),
    0 4px 8px rgba(0,0,0,0.15);
  position: relative;
  transition: transform 0.3s ease-out;
  cursor: pointer;
}

/* Räfflor på ratten */
.knob-dial::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: 
    repeating-conic-gradient(
      from 0deg,
      #d1d5db 0deg,
      #d1d5db 4deg,
      transparent 4deg,
      transparent 8deg
    );
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.15);
}

/* Center dot on knob */
.knob-dial::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: #6b7280;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 
    inset 0 1px 2px rgba(0,0,0,0.3),
    0 1px 2px rgba(255,255,255,0.5);
}

/* Indicator line on knob */
.knob-dial {
  background-image: 
    linear-gradient(145deg, #f3f4f6, #e5e7eb),
    linear-gradient(to bottom, #ef4444 0%, #ef4444 100%);
  background-size: 100% 100%, 3px 20px;
  background-position: center, center 8px;
  background-repeat: no-repeat, no-repeat;
}

.opacity-value {
  font-weight: 700;
  color: #3b82f6;
  font-size: 14px;
  min-width: 45px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.marker-controls-row {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 2px solid #e5e7eb;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.compact-select {
  padding: 6px 10px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.compact-select:hover:not(:disabled) {
  border-color: #3b82f6;
}

.compact-select:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.6;
}

.compact-btn {
  padding: 6px 12px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.compact-btn:hover {
  background: #f3f4f6;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.compact-btn.primary {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.compact-btn.primary:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

.compact-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.compact-btn.delete-btn {
  background: #fee;
  border-color: #fcc;
  color: #dc2626;
}

.compact-btn.delete-btn:hover {
  background: #fcc;
  border-color: #dc2626;
}

.marker-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.click-instruction {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  font-style: italic;
}

.intermap-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.map-view {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  position: relative;
}

.map-placeholder {
  color: #9ca3af;
  font-size: 16px;
  font-style: italic;
}

.map-container {
  width: 100%;
  height: 600px;
  overflow: hidden;
  position: relative;
  cursor: default;
  background: #f3f4f6;
}

.map-wrapper {
  position: relative;
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  width: fit-content;
  margin: 0 auto;
}

.map-image {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  transition: opacity 0.3s ease;
}

.map-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 28px;
  cursor: grab;
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.2s, filter 0.2s;
  z-index: 10;
}

.map-marker:hover {
  transform: translate(-50%, -100%) scale(1.2);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  z-index: 20;
}

.map-marker:active {
  cursor: grabbing;
}

.marker-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-marker:hover .marker-label {
  opacity: 1;
}

.delete-marker-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dc2626;
  color: white;
  border: 2px solid white;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 30;
}

.map-marker:hover .delete-marker-btn {
  display: flex;
}

.delete-marker-btn:hover {
  background: #b91c1c;
  transform: scale(1.1);
}



/* AI Analysis Spinner */
.spinner {
  border: 4px solid #1e293b;
  border-top: 4px solid #8b5cf6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Checklist Modal */
#checklistModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999 !important;
  align-items: center;
  justify-content: center;
}

#checklistModal.show {
  display: flex !important;
}

#checklistModal .modal-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#checklistModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#checklistModal .modal-header h3 {
  margin: 0;
  color: #1f2937;
}

#checklistModal .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

#checklistModal .modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

#checklistModal .form-group {
  margin-bottom: 16px;
}

#checklistModal .form-group label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
}

#checklistModal .form-group input,
#checklistModal .form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

#checklistModal .form-group input:focus,
#checklistModal .form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#checklistModal .modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

#checklistModal .modal-footer button {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

#checklistModal .btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

#checklistModal .btn-cancel:hover {
  background: #e5e7eb;
}

#checklistModal .btn-save {
  background: #3b82f6;
  color: white;
}

#checklistModal .btn-save:hover {
  background: #2563eb;
}

/* Universal Modals */
#universalAlertModal,
#universalConfirmModal,
#universalPromptModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999 !important;
  align-items: center;
  justify-content: center;
}

#universalAlertModal.show,
#universalConfirmModal.show,
#universalPromptModal.show {
  display: flex !important;
}

#universalAlertModal .modal-content,
#universalConfirmModal .modal-content,
#universalPromptModal .modal-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#universalAlertModal .modal-header,
#universalConfirmModal .modal-header,
#universalPromptModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#universalAlertModal .modal-header h3,
#universalConfirmModal .modal-header h3,
#universalPromptModal .modal-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
}

#universalAlertModal .modal-close,
#universalConfirmModal .modal-close,
#universalPromptModal .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 0;
}

#universalAlertModal .modal-close:hover,
#universalConfirmModal .modal-close:hover,
#universalPromptModal .modal-close:hover {
  color: #374151;
}

#universalAlertModal .modal-body,
#universalConfirmModal .modal-body,
#universalPromptModal .modal-body {
  margin-bottom: 20px;
}

#universalAlertModal .modal-footer,
#universalConfirmModal .modal-footer,
#universalPromptModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#universalAlertModal .btn-save,
#universalConfirmModal .btn-save,
#universalPromptModal .btn-save {
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

#universalAlertModal .btn-save:hover,
#universalConfirmModal .btn-save:hover,
#universalPromptModal .btn-save:hover {
  background: #2563eb;
}

#universalAlertModal .btn-cancel,
#universalConfirmModal .btn-cancel,
#universalPromptModal .btn-cancel {
  padding: 10px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

#universalAlertModal .btn-cancel:hover,
#universalConfirmModal .btn-cancel:hover,
#universalPromptModal .btn-cancel:hover {
  background: #e5e7eb;
}

/* BBCode Toolbar */
.bbcode-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px 6px 0 0;
  border-bottom: none;
  align-items: center;
}

.bbcode-btn {
  padding: 6px 10px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s;
  min-width: 32px;
}

.bbcode-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.bbcode-btn b,
.bbcode-btn i,
.bbcode-btn u,
.bbcode-btn s {
  pointer-events: none;
}

.toolbar-divider {
  height: 20px;
  width: 1px;
  background: #d1d5db;
  margin: 0 4px;
}

.task-desc-input {
  border-radius: 0 0 6px 6px !important;
  border-top: none !important;
}

/* Checklist drag-and-drop styles */
.checklist-item.dragging {
  opacity: 0.5 !important;
}

.checklist-item.drag-over {
  border: 2px dashed #3b82f6 !important;
  background: #dbeafe !important;
  transform: scale(1.02);
}

.checklist-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========== CHAT STYLES ========== */

.chat-view {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-header {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.chat-header h2 {
  margin: 0 0 4px 0;
  color: #1f2937;
}

.chat-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* Chat Mode Selector */
.chat-mode-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.chat-mode-btn {
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-mode-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.chat-mode-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
}

.chat-mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
  color: #9ca3af;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 0;
  min-height: 400px;
  max-height: calc(100vh - 420px);
}

.chat-messages {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 70%;
  position: relative;
  animation: slideIn 0.2s ease-out;
  align-self: flex-end;
  margin-left: auto;
}

/* Own messages have light gray background */
.chat-message.own-message {
  background: #f3f4f6;
  border-color: #d1d5db;
}

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

/* Chat position modes for wide screens */
.chat-messages.position-left .chat-message {
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
  background: #f9fafb;
  border-color: #e5e7eb;
}

.chat-messages.position-center .chat-message {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}

/* Right position is default (already styled above) */

.chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.chat-message-author {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.own-message .chat-message-author {
  color: #1e40af;
}

.chat-message-time {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

.chat-message-text {
  color: #374151;
  line-height: 1.6;
  word-wrap: break-word;
  font-size: 14px;
}

.chat-message-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 4px;
}

.chat-message:hover .chat-message-delete {
  opacity: 0.6;
}

.chat-message-delete:hover {
  opacity: 1 !important;
}

.chat-input-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  position: sticky;
  bottom: 20px;
  margin-top: auto;
  margin-bottom: 20px;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Toggle formatting button */
.toggle-formatting-btn {
  position: absolute;
  right: 12px;
  bottom: 60px;
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -2px;
}

.toggle-formatting-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.toggle-formatting-btn.active {
  background: #10b981;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .toggle-formatting-btn {
    right: 10px;
    bottom: 55px;
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    font-size: 18px;
  }
}

.chat-formatting-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.chat-formatting-toolbar .format-btn {
  padding: 6px 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.chat-formatting-toolbar .format-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.chat-formatting-toolbar .format-help-btn {
  margin-left: auto;
}

#chatPositionBtn {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  font-weight: 600;
}

#chatPositionBtn:hover {
  background: #bfdbfe;
  border-color: #60a5fa;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
}

.chat-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-chat-btn {
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-chat-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.send-chat-btn:active {
  transform: scale(0.95);
}

/* Responsive Chat */
@media (max-width: 768px) {
  .chat-message {
    max-width: 85%;
  }
  
  .chat-formatting-toolbar {
    gap: 2px;
  }
  
  .chat-formatting-toolbar .format-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .chat-messages-container {
    max-height: calc(100vh - 400px);
  }
}

/* ============================================
   AVATAR EDITOR
   ============================================ */

.avatar-editor {
  display: flex;
  gap: 20px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar-preview-large {
  width: 150px;
  height: 150px;
  border: 3px solid #d1d5db;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.avatar-svg {
  width: 100%;
  height: 100%;
}

.avatar-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-control-group label {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

.avatar-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.avatar-gallery-item {
  width: 50px;
  height: 50px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  overflow: hidden;
  padding: 2px;
}

.avatar-gallery-item:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.avatar-gallery-item.selected {
  border-color: #3b82f6;
  background: #dbeafe;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.avatar-gallery-item svg {
  width: 100%;
  height: 100%;
}

.avatar-option {
  width: 40px;
  height: 40px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
}

.avatar-option:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.avatar-option.selected {
  border-color: #3b82f6;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.avatar-option.color-option {
  border: 2px solid #d1d5db;
  position: relative;
}

.avatar-option.color-option::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.avatar-option.color-option.selected::after {
  border-color: #3b82f6;
}

/* Avatar in chat and comments */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar svg {
  width: 100%;
  height: 100%;
}

.user-avatar.small {
  width: 24px;
  height: 24px;
  border-width: 1px;
}

.user-avatar.large {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

@media (max-width: 768px) {
  .avatar-editor {
    flex-direction: column;
  }
  
  .avatar-preview,
  .avatar-preview-large {
    align-self: center;
  }
  
  .avatar-gallery {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    max-height: 250px;
  }
}

/* Notification styles */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.5),
                0 0 10px rgba(34, 197, 94, 0.3),
                inset 0 0 5px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
  }
  50% {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8),
                0 0 20px rgba(34, 197, 94, 0.5),
                inset 0 0 8px rgba(34, 197, 94, 0.4);
    border-color: rgba(34, 197, 94, 1);
  }
}

.task-card.new-task {
  animation: pulseGlow 2s ease-in-out infinite;
  border: 3px solid #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
}

.new-comment-indicator {
  color: #ef4444;
  font-size: 18px;
  margin-left: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.chat-new-divider {
  width: 100%;
  height: 40px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  margin: 20px 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: 100% 3px;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 11px;
  font-weight: bold;
  color: #3b82f6;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chat-new-divider::before,
.chat-new-divider::after {
  content: '';
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, transparent, #3b82f6);
}

.chat-new-divider::after {
  background: linear-gradient(90deg, #3b82f6, transparent);
}

/* Change Project Role Modal */
#changeProjectRoleModal .role-radio-option {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

#changeProjectRoleModal .role-radio-option:hover {
  border-color: #3b82f6;
  background-color: #f0f9ff;
  transform: translateX(3px);
}

#changeProjectRoleModal .role-radio-option:has(input:checked) {
  border-color: #3b82f6;
  background-color: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#changeProjectRoleModal input[type='radio'] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

#changeProjectRoleModal .role-checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#changeProjectRoleModal .role-checkbox-option:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

#changeProjectRoleModal .role-checkbox-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
  margin: 0;
}

#changeProjectRoleModal .role-info {
  flex: 1;
}

#changeProjectRoleModal .role-desc {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

#changeProjectRoleModal .owner-color {
  color: #dc2626;
}

#changeProjectRoleModal .editor-color {
  color: #059669;
}

#changeProjectRoleModal .viewer-color {
  color: #f59e0b;
}

#changeProjectRoleModal .member-color {
  color: #6b7280;
}

/* ==========================================
   DARK MODE VARIABLES & STYLES
   ========================================== */
:root {
  /* Light mode colors (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --hover-bg: #f8fafc;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  /* Dark mode colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --card-bg: #1e293b;
  --hover-bg: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
}

/* Apply dark mode to main content area */
body.dark-mode .main,
body.dark-mode .main-content {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
}

body.dark-mode .card,
body.dark-mode .project-tile,
body.dark-mode .task-card {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .modal-content,
body.dark-mode .user-modal-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .form-group label {
  color: var(--text-primary);
}

body.dark-mode .user-tab {
  color: var(--text-secondary);
}

body.dark-mode .user-tab.active {
  color: var(--text-primary);
  border-bottom-color: #3b82f6;
}

/* Additional dark mode styling */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #ffffff !important;
}

body.dark-mode p,
body.dark-mode span,
body.dark-mode div {
  color: inherit;
}

body.dark-mode .project-header {
  border-bottom-color: var(--border-color);
}

body.dark-mode .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .btn-secondary:hover {
  background: var(--hover-bg);
}

/* Back button and secondary buttons */
body.dark-mode .back-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .back-btn:hover {
  background: var(--hover-bg);
}

body.dark-mode .secondary-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .secondary-btn:hover {
  background: var(--hover-bg);
}

/* Edit and delete comment buttons */
body.dark-mode .edit-comment-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .edit-comment-btn:hover {
  background: var(--hover-bg);
}

body.dark-mode .delete-comment-btn {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #991b1b;
}

body.dark-mode .delete-comment-btn:hover {
  background: #991b1b;
  border-color: #dc2626;
}

/* Comment file upload */
body.dark-mode .comment-file-label {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .comment-file-label:hover {
  background: var(--hover-bg);
}

body.dark-mode .comment-file-preview-item {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .comment-file-preview-item:hover {
  background: var(--hover-bg);
}

body.dark-mode .comment-file-remove-btn {
  background: #7f1d1d;
  color: #fecaca;
}

body.dark-mode .comment-file-remove-btn:hover {
  background: #991b1b;
}

/* Task form toggle */
body.dark-mode .task-form-toggle-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

body.dark-mode .task-form-toggle-btn:hover {
  background: var(--hover-bg);
}

/* Add task card */
body.dark-mode .add-task-card {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Buttons and links */
body.dark-mode button:not(.btn-primary):not(.btn-danger):not(.btn-success) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode a {
  color: #60a5fa;
}

body.dark-mode a:hover {
  color: #93c5fd;
}

/* Tables */
body.dark-mode table {
  background: var(--card-bg);
  color: var(--text-primary);
}

body.dark-mode th,
body.dark-mode td {
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode thead {
  background: var(--bg-tertiary);
}

/* Lists */
body.dark-mode ul,
body.dark-mode ol,
body.dark-mode li {
  color: var(--text-primary);
}

/* Form elements - enhanced */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  background: var(--bg-tertiary);
  border-color: #3b82f6;
  color: var(--text-primary);
  outline: none;
}

body.dark-mode input[disabled],
body.dark-mode textarea[disabled],
body.dark-mode select[disabled] {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  opacity: 0.6;
}

/* Small text and labels */
body.dark-mode small {
  color: var(--text-secondary);
}

body.dark-mode .form-group small {
  color: var(--text-secondary);
}

/* Project tiles */
body.dark-mode .project-tile h3,
body.dark-mode .project-tile p {
  color: var(--text-primary);
}

body.dark-mode .project-tile:hover {
  background: var(--hover-bg);
  border-color: #3b82f6;
}

/* Task cards */
body.dark-mode .task-card h4,
body.dark-mode .task-card p {
  color: var(--text-primary);
}

body.dark-mode .task-status {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Modal dialogs */
body.dark-mode .modal-header {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .modal-footer {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

/* User tabs */
body.dark-mode .user-modal-tabs {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .user-tab-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Account section */
body.dark-mode .account-section,
body.dark-mode .settings-section,
body.dark-mode .groups-section {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Dropdown menus */
body.dark-mode select option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Checkbox and radio buttons */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
  accent-color: #3b82f6;
}

/* Code blocks */
body.dark-mode code,
body.dark-mode pre {
  background: var(--bg-tertiary);
  color: #e879f9;
  border-color: var(--border-color);
}

/* Scrollbars */
body.dark-mode ::-webkit-scrollbar {
  background: var(--bg-secondary);
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--hover-bg);
}

/* Avatar elements */
body.dark-mode .avatar-preview-large,
body.dark-mode .avatar-gallery {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .avatar-gallery-item {
  border-color: var(--border-color);
}

body.dark-mode .avatar-gallery-item.selected {
  border-color: #3b82f6;
  background: var(--bg-tertiary);
}

/* Activity log */
body.dark-mode .activity-log-box {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .activity-log-header {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .activity-item {
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

/* System info */
body.dark-mode .system-info {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Kanban columns */
body.dark-mode .kanban-column {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .kanban-column h3 {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

/* Kanban view complete */
body.dark-mode .kanban-view {
  background: var(--bg-primary);
}

body.dark-mode .kanban-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .kanban-header h2 {
  color: var(--text-primary);
}

body.dark-mode .kanban-board {
  background: var(--bg-primary);
}

body.dark-mode .kanban-column-header {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .kanban-column-header h3 {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .kanban-tasks {
  background: var(--card-bg);
}

body.dark-mode .kanban-tasks::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

body.dark-mode .kanban-tasks::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
}

body.dark-mode .kanban-tasks::-webkit-scrollbar-thumb:hover {
  background: var(--hover-bg);
}

body.dark-mode .kanban-task {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .kanban-task:hover {
  background: var(--hover-bg);
  border-color: #3b82f6;
}

body.dark-mode .kanban-task.dragging {
  background: var(--bg-tertiary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .kanban-task-title {
  color: var(--text-primary);
}

body.dark-mode .kanban-task-project {
  color: var(--text-secondary);
}

body.dark-mode .kanban-task-dates {
  color: var(--text-secondary);
}

body.dark-mode .kanban-task-description {
  color: var(--text-secondary);
}

/* Dashboard */
body.dark-mode .dashboard-view {
  background: var(--bg-primary);
}

body.dark-mode .dashboard-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .dashboard-header h2 {
  color: var(--text-primary);
}

body.dark-mode .dashboard-grid {
  background: transparent;
}

body.dark-mode .widget {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .widget-header {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .widget-header h3 {
  color: var(--text-primary);
}

body.dark-mode .widget-content {
  color: var(--text-primary);
}

body.dark-mode .widget-stat-value {
  color: var(--text-primary);
}

body.dark-mode .widget-stat-label {
  color: var(--text-secondary);
}

/* Concept Map / Intermap */
body.dark-mode .concept-map-view {
  background: var(--bg-primary);
}

body.dark-mode .concept-map-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .concept-map-header h2 {
  color: var(--text-primary);
}

body.dark-mode .concept-map-controls {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .concept-map-container {
  background: var(--bg-primary);
}

body.dark-mode .intermap-container {
  background: var(--bg-primary);
}

body.dark-mode .intermap-toolbar {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .intermap-content {
  background: var(--bg-primary);
}

/* Timeline view */
body.dark-mode .timeline-view {
  background: var(--bg-primary);
}

body.dark-mode .timeline-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .timeline-bar {
  background: #3b82f6;
  color: white;
}

/* Tasks view */
body.dark-mode .tasks-view {
  background: var(--bg-primary);
}

body.dark-mode .tasks-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .tasks-header h2 {
  color: var(--text-primary);
}

body.dark-mode .tasks-list {
  background: var(--bg-primary);
}

body.dark-mode .task-item {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .task-item:hover {
  background: var(--hover-bg);
}

/* Calendar */
body.dark-mode .calendar-day {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .calendar-day:hover {
  background: var(--hover-bg);
}

/* Calendar view headers and controls */
body.dark-mode .calendar-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .calendar-controls {
  background: transparent;
}

body.dark-mode .calendar-controls button {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .calendar-controls button:hover {
  background: var(--hover-bg);
}

/* Reports */
body.dark-mode .report-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .reports-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

/* Chat view complete */
body.dark-mode .chat-view {
  background: var(--bg-primary);
}

body.dark-mode .chat-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .chat-header h2 {
  color: var(--text-primary);
}

body.dark-mode .chat-messages {
  background: var(--bg-primary);
}

body.dark-mode .chat-message {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .chat-message-user {
  color: var(--text-primary);
  font-weight: 600;
}

body.dark-mode .chat-message-text {
  color: var(--text-primary);
}

body.dark-mode .chat-message-time {
  color: var(--text-secondary);
}

body.dark-mode .chat-input-container {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

body.dark-mode .chat-input {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .chat-input:focus {
  border-color: #3b82f6;
}

body.dark-mode .chat-formatting-toolbar {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .chat-format-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

body.dark-mode .chat-format-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.dark-mode .chat-mode-selector {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .chat-mode-btn {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

body.dark-mode .chat-mode-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

body.dark-mode .chat-mode-btn:hover:not(.active) {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.dark-mode .chat-mode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Badges and tags */
body.dark-mode .badge,
body.dark-mode .tag {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Alerts and notifications */
body.dark-mode .alert {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Light colored elements need dark text */
body.dark-mode .btn-primary,
body.dark-mode .btn-success,
body.dark-mode .btn-warning,
body.dark-mode .badge.success,
body.dark-mode .badge.warning,
body.dark-mode .badge.info,
body.dark-mode .alert-success,
body.dark-mode .alert-warning,
body.dark-mode .alert-info {
  color: #0f172a !important; /* Dark text on light backgrounds */
}

body.dark-mode .btn-danger,
body.dark-mode .badge.danger,
body.dark-mode .alert-danger {
  color: #ffffff !important; /* White text on red background */
}

/* Status badges with light colors */
body.dark-mode .status-done,
body.dark-mode .status-completed {
  background: #22c55e;
  color: #0f172a !important;
}

body.dark-mode .status-in-progress,
body.dark-mode .status-active {
  background: #3b82f6;
  color: #ffffff !important;
}

body.dark-mode .status-pending,
body.dark-mode .status-todo {
  background: #f59e0b;
  color: #0f172a !important;
}

body.dark-mode .status-blocked,
body.dark-mode .status-cancelled {
  background: #ef4444;
  color: #ffffff !important;
}

/* Priority badges */
body.dark-mode .priority-high {
  background: #ef4444;
  color: #ffffff !important;
}

body.dark-mode .priority-medium {
  background: #f59e0b;
  color: #0f172a !important;
}

body.dark-mode .priority-low {
  background: #22c55e;
  color: #0f172a !important;
}

/* Role badges with light colors */
body.dark-mode .role-badge.admin {
  background: #8b5cf6;
  color: #ffffff !important;
}

body.dark-mode .role-badge.project-manager {
  background: #3b82f6;
  color: #ffffff !important;
}

body.dark-mode .role-badge.economy {
  background: #f59e0b;
  color: #0f172a !important;
}

/* Light colored backgrounds */
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background-color: white"] {
  color: #0f172a !important;
}

/* Ensure inline styles with light backgrounds get dark text */
body.dark-mode [style*="background: rgb(255"],
body.dark-mode [style*="background-color: rgb(255"] {
  color: #0f172a !important;
}

/* ==========================================
   TOGGLE SWITCH FOR DARK MODE
   ========================================== */
.settings-section {
  padding: 24px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.settings-item-info {
  flex: 1;
}

.settings-item-info label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-item-info small {
  color: var(--text-secondary);
  font-size: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(28px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Toast Notifications */
.toast {
  position: relative;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-out;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info {
  background-color: #3498db;
}

.toast-success {
  background-color: #2ecc71;
}

.toast-warning {
  background-color: #f39c12;
}

.toast-error {
  background-color: #e74c3c;
}

/* Slide in animation for tasks */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Presence indicator (online/offline) */
.presence-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #95a5a6;
  display: inline-block;
  margin-left: 5px;
  border: 2px solid white;
}

.presence-indicator.online {
  background-color: #2ecc71;
  box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
  animation: pulse 2s infinite;
}

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

/* Global Search Styles */
.header-content { 
  display: flex; 
  justify-content: flex-end; 
  align-items: center; 
  gap: 20px; 
}
.header-content h1 {
  flex: 1;
  margin: 0;
}
.global-search-container { 
  position: relative; 
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
}

.search-content {
  width: 400px;
  flex-shrink: 0;
}

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

.global-search-input { 
  width: 100%; 
  padding: 8px 40px 8px 12px; 
  border: 1px solid #d1d5db; 
  border-radius: 8px; 
  font-size: 14px; 
  background: #fff;
  transition: all 0.2s;
}

.search-settings-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.search-settings-btn:hover {
  background: #f1f5f9;
  color: #3b82f6;
}

.search-settings-btn svg {
  display: block;
}

/* Header Filter Buttons */
.header-filters {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  flex-wrap: nowrap;
}
.header-filter-btn {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  position: relative;
  padding-right: 10px;
  white-space: nowrap;
  flex: 1;
}
.header-filter-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.header-filter-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  padding-right: 24px;
}
.header-filter-btn.active::after {
  content: '×';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: bold;
  opacity: 0.8;
}
.header-filter-btn.active:hover::after {
  opacity: 1;
}
.global-search-input:focus { 
  outline: none; 
  border-color: #3b82f6; 
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); 
}
.search-results { 
  position: absolute; 
  top: 100%; 
  left: 0; 
  right: 0; 
  margin-top: 4px; 
  background: #fff; 
  border: 1px solid #d1d5db; 
  border-radius: 8px; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
  max-height: 500px; 
  overflow-y: auto; 
  z-index: 9999;
}
.search-result-item { 
  padding: 12px; 
  border-bottom: 1px solid #e5e7eb; 
  cursor: pointer; 
  transition: background 0.2s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f3f4f6; }
.search-result-type { 
  display: inline-block; 
  padding: 2px 8px; 
  border-radius: 4px; 
  font-size: 11px; 
  font-weight: 600; 
  text-transform: uppercase; 
  margin-bottom: 4px;
}
.search-result-type.project { background: #dbeafe; color: #1e40af; }
.search-result-type.task { background: #fef3c7; color: #92400e; }
.search-result-type.comment { background: #e0e7ff; color: #3730a3; }
.search-result-type.file { background: #d1fae5; color: #065f46; }
.search-result-title { 
  font-weight: 600; 
  font-size: 14px; 
  color: #111827; 
  margin-bottom: 4px; 
  display: block;
}
.search-result-description { 
  font-size: 13px; 
  color: #6b7280; 
  margin-bottom: 4px; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  display: -webkit-box; 
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result-meta { 
  font-size: 12px; 
  color: #9ca3af; 
  display: flex; 
  gap: 12px; 
  align-items: center;
}
.search-no-results { 
  padding: 20px; 
  text-align: center; 
  color: #6b7280; 
  font-size: 14px;
}
.search-loading { 
  padding: 20px; 
  text-align: center; 
  color: #6b7280; 
  font-size: 14px;
}

/* Dark mode search styles */
body.dark-mode .global-search-input {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}
body.dark-mode .global-search-input:focus {
  border-color: #60a5fa;
}
body.dark-mode .search-results {
  background: #1f2937;
  border-color: #374151;
}
body.dark-mode .search-result-item {
  border-bottom-color: #374151;
}
body.dark-mode .search-result-item:hover {
  background: #374151;
}
body.dark-mode .search-result-title {
  color: #e5e7eb;
}
body.dark-mode .search-result-description,
body.dark-mode .search-no-results,
body.dark-mode .search-loading {
  color: #9ca3af;
}

/* Dark mode header filters */
body.dark-mode .header-filter-btn {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}
body.dark-mode .header-filter-btn:hover {
  background: #374151;
  border-color: #4b5563;
}
body.dark-mode .header-filter-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
body.dark-mode .header-filter-btn.advanced {
  border-color: #8b5cf6;
  color: #a78bfa;
}
body.dark-mode .header-filter-btn.advanced:hover {
  background: #8b5cf6;
  color: #fff;
}

/* @Mention Styles */
.mention-autocomplete {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10000;
  min-width: 250px;
}
.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}
.mention-item:last-child {
  border-bottom: none;
}
.mention-item:hover,
.mention-item.selected {
  background: #f3f4f6;
}
.mention-highlight {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}
.comment-text .mention-highlight {
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Dark mode mention styles */
body.dark-mode .mention-autocomplete {
  background: #1f2937;
  border-color: #374151;
}
body.dark-mode .mention-item {
  border-bottom-color: #374151;
}
body.dark-mode .mention-item:hover,
body.dark-mode .mention-item.selected {
  background: #374151;
}

/* Advanced Filters Styles */
.kanban-filters {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-btn {
  padding: 8px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}
.filter-btn:hover {
  background: #2563eb;
}
.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quick-filter-btn {
  padding: 6px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
}
.quick-filter-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}
.quick-filter-btn.active {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
  font-weight: 600;
}
.filter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 24px;
  z-index: 10001;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 12px;
}
.filter-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #111827;
}
.filter-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}
.filter-group {
  margin-bottom: 20px;
}
.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
}
.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}
.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.filter-apply-btn {
  flex: 1;
  padding: 10px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.filter-apply-btn:hover {
  background: #2563eb;
}
.filter-clear-btn {
  padding: 10px 16px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
}
.filter-clear-btn:hover {
  background: #e5e7eb;
}

/* Dark mode filters */
body.dark-mode .filter-btn {
  background: #2563eb;
}
body.dark-mode .quick-filter-btn {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
body.dark-mode .quick-filter-btn:hover {
  background: #4b5563;
}
body.dark-mode .quick-filter-btn.active {
  background: #1e40af;
  border-color: #3b82f6;
  color: #dbeafe;
}
body.dark-mode .filter-modal {
  background: #1f2937;
  border-color: #374151;
}
body.dark-mode .filter-modal-header {
  border-bottom-color: #374151;
}
body.dark-mode .filter-modal-header h3 {
  color: #e5e7eb;
}
body.dark-mode .filter-group label {
  color: #e5e7eb;
}
body.dark-mode .filter-group select,
body.dark-mode .filter-group input {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
body.dark-mode .filter-actions {
  border-top-color: #374151;
}
body.dark-mode .filter-clear-btn {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
body.dark-mode .filter-clear-btn:hover {
  background: #4b5563;
}

/* Blocked Task Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Member Avatars */
.members-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.members-label {
  font-size: 16px;
  color: #64748b;
  font-weight: 500;
}

.avatar-container {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
}

.avatar-wrapper {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: visible;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px; /* Small gap between avatars */
}

.avatar-wrapper:first-child {
  margin-left: 0;
}

.avatar-wrapper:hover {
  transform: translateY(-4px) scale(1.1);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.avatar-wrapper .avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  color: white;
  text-transform: uppercase;
  border-radius: 50%;
}

/* Group icon styling */
.avatar-initials.avatar-group-icon {
  padding: 8px;
}

.avatar-initials.avatar-group-icon svg {
  width: 100%;
  height: 100%;
}



.avatar-tooltip {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.avatar-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.avatar-wrapper:hover .avatar-tooltip {
  opacity: 1;
}

.member-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background: #3b82f6;
  color: white;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}



/* Dark mode support */
body.dark-mode .avatar-wrapper {
  border-color: #374151;
}

body.dark-mode .member-count-badge {
  background: #2563eb;
}

body.dark-mode .add-member-btn {
  border-color: #059669 !important;
  background: rgba(16, 185, 129, 0.15);
}

/* ========================================
   COMPREHENSIVE DARK MODE - CORE LAYOUT
   ======================================== */

/* Mobile header */
body.dark-mode .mobile-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .mobile-header h1 {
  color: var(--text-primary);
}

body.dark-mode .mobile-nav-toggle {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .mobile-nav-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .mobile-nav {
  background: var(--bg-secondary);
}

/* Sidebar - redan mörk som standard, men säkerställ konsistens */
body.dark-mode .sidebar {
  background: #0f172a;
  color: #e2e8f0;
}

/* Project tree */
body.dark-mode .project-tree {
  background: transparent;
}

body.dark-mode .project-node {
  color: #e2e8f0;
  background: transparent;
}

body.dark-mode .project-node:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .project-node.active {
  background: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

body.dark-mode .project-toggle {
  color: #94a3b8;
}

body.dark-mode .project-name {
  color: inherit;
}

body.dark-mode .subproject {
  border-left-color: rgba(148, 163, 184, 0.3);
}

/* Resizer */
body.dark-mode .resizer {
  background: #0b1222;
}

body.dark-mode .resizer:hover {
  background: #13223f;
}

body.dark-mode .resizer:active,
body.dark-mode .resizer.resizing {
  background: #1e3a8a;
}

/* Bottom toolbar */
body.dark-mode .bottom-toolbar {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

body.dark-mode .toolbar-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

body.dark-mode .toolbar-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.dark-mode .toolbar-btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: #3b82f6;
}

/* Header content (main content header) */
body.dark-mode .header-content {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .header-content h1 {
  color: #ffffff !important;
  font-weight: 700;
}

/* Global search */
body.dark-mode .global-search-container {
  background: transparent;
}

/* Auth section */
body.dark-mode .auth {
  background: transparent;
}

body.dark-mode .auth-toggle-btn {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode .auth-toggle-btn:hover {
  background: #334155;
}

body.dark-mode .auth input {
  background: #111827;
  color: #e2e8f0;
  border-color: #334155;
}

body.dark-mode .auth button {
  background: #22c55e;
  color: #083344;
}

/* User info */
body.dark-mode .user-info {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .user-name {
  color: var(--text-primary);
}

body.dark-mode .user-email {
  color: var(--text-secondary);
}

body.dark-mode .logout-btn {
  background: #ef4444;
  color: white;
}

body.dark-mode .logout-btn:hover {
  background: #dc2626;
}

/* Project tiles and cards */
body.dark-mode .project-tiles {
  background: transparent;
}

body.dark-mode .project-list {
  background: transparent;
}

body.dark-mode .project-grid {
  background: transparent;
}

/* Modal overlays and backgrounds */
body.dark-mode .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .task-modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-mode .user-modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-mode .project-modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-mode .settings-modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

/* Comments section */
body.dark-mode .comments-section {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .comment-item {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .comment-header {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .comment-reactions {
  background: var(--bg-secondary);
  border-top-color: var(--border-color);
}

body.dark-mode .reaction-btn {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .reaction-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

body.dark-mode .reaction-btn.active {
  background: #1e3a8a;
  border-color: #3b82f6;
}

body.dark-mode .reply-btn {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .reply-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

body.dark-mode .comment-user {
  color: var(--text-primary);
  font-weight: 600;
}

body.dark-mode .comment-text {
  color: var(--text-primary);
}

body.dark-mode .comment-time {
  color: var(--text-secondary);
}

body.dark-mode .comment-input {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Attachments */
body.dark-mode .attachments-section {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .attachment-item {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .attachment-item:hover {
  background: var(--hover-bg);
}

body.dark-mode .attachment-name {
  color: var(--text-primary);
}

body.dark-mode .attachment-size {
  color: var(--text-secondary);
}

body.dark-mode .attachment-upload {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Time entries */
body.dark-mode .time-entries {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .time-entry {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .time-entry-user {
  color: var(--text-primary);
}

body.dark-mode .time-entry-hours {
  color: var(--text-primary);
  font-weight: 600;
}

body.dark-mode .time-entry-date {
  color: var(--text-secondary);
}

/* Blocked tasks modal */
body.dark-mode .blocked-tasks-modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.dark-mode .blocked-task-item {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .blocked-task-item:hover {
  background: var(--hover-bg);
}

/* Dropdown menus and context menus */
body.dark-mode .dropdown-menu {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .dropdown-item {
  color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
  background: var(--hover-bg);
}

body.dark-mode .dropdown-divider {
  border-color: var(--border-color);
}

body.dark-mode .context-menu {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .context-menu-item {
  color: var(--text-primary);
}

body.dark-mode .context-menu-item:hover {
  background: var(--hover-bg);
}

/* Fix text color in project context menu for dark mode */
body.dark-mode .project-context-menu {
  background: white;
  border-color: #e5e7eb;
}

body.dark-mode .project-context-menu .context-menu-item {
  color: #1f2937;
}

body.dark-mode .project-context-menu .context-menu-item:hover {
  background: #f3f4f6;
}

/* Notifications and toasts */
body.dark-mode .notification {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .notification.success {
  background: #065f46;
  border-color: #10b981;
  color: #d1fae5;
}

body.dark-mode .notification.error {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fee2e2;
}

body.dark-mode .notification.warning {
  background: #78350f;
  border-color: #f59e0b;
  color: #fef3c7;
}

body.dark-mode .notification.info {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #dbeafe;
}

body.dark-mode .toast {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Tabs */
body.dark-mode .tabs {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

body.dark-mode .tab {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

body.dark-mode .tab:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.dark-mode .tab.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-color);
  border-bottom-color: var(--bg-primary);
}

/* Pagination */
body.dark-mode .pagination {
  background: transparent;
}

body.dark-mode .page-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .page-btn:hover {
  background: var(--hover-bg);
}

body.dark-mode .page-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

body.dark-mode .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Finance card */
body.dark-mode .finance-card {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .finance-header {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .finance-value {
  color: var(--text-primary);
}

body.dark-mode .finance-label {
  color: var(--text-secondary);
}

/* Progress bars */
body.dark-mode .progress-bar {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.dark-mode .progress-fill {
  background: #3b82f6;
}

body.dark-mode .progress-text {
  color: var(--text-primary);
}

/* Empty states */
body.dark-mode .empty-state {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.dark-mode .empty-state-icon {
  color: var(--text-secondary);
  opacity: 0.5;
}

body.dark-mode .empty-state-text {
  color: var(--text-secondary);
}

/* Loading states */
body.dark-mode .loading-spinner {
  border-color: var(--border-color);
  border-top-color: #3b82f6;
}

body.dark-mode .loading-text {
  color: var(--text-secondary);
}

/* Tooltips */
body.dark-mode .tooltip {
  background: rgba(15, 23, 42, 0.95);
  color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .tooltip::after {
  border-top-color: rgba(15, 23, 42, 0.95);
}

/* Dividers */
body.dark-mode hr,
body.dark-mode .divider {
  border-color: var(--border-color);
}

/* Labels and help text */
body.dark-mode .help-text {
  color: var(--text-secondary);
}

body.dark-mode .label-text {
  color: var(--text-primary);
}

body.dark-mode .required-mark {
  color: #ef4444;
}

/* ========================================
   DARK MODE - WHITE BACKGROUND ELEMENTS
   ======================================== */

/* Project switcher */
body.dark-mode .project-switcher-icon {
  background: var(--bg-tertiary);
  border-color: #3b82f6;
  color: var(--text-primary);
}

body.dark-mode .project-switcher-icon:hover {
  background: #3b82f6;
  color: white;
}

body.dark-mode .project-switcher-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

body.dark-mode .project-switcher-item {
  border-bottom-color: var(--border-color);
  color: var(--text-primary);
}

body.dark-mode .project-switcher-item:hover {
  background: var(--hover-bg);
}

body.dark-mode .project-switcher-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Map control buttons */
body.dark-mode .map-control-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .map-control-btn:hover {
  background: var(--hover-bg);
  border-color: #3b82f6;
  color: #60a5fa;
}

body.dark-mode .zoom-indicator {
  color: var(--text-primary);
}

/* Modal content - CRITICAL FIX */
body.dark-mode .modal-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

body.dark-mode .modal-header h3 {
  color: var(--text-primary);
}

body.dark-mode .modal-close {
  color: var(--text-secondary);
}

body.dark-mode .modal-close:hover {
  color: var(--text-primary);
}

/* Form inputs - CRITICAL FIX */
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .form-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Primary button */
body.dark-mode .btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
}

body.dark-mode .btn-primary:hover {
  background: #2563eb;
}

/* Cancel button */
body.dark-mode .btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode .btn-cancel:hover {
  background: var(--hover-bg);
  border-color: var(--border-color);
}

/* ========================================
   DARK MODE - INLINE STYLE OVERRIDES
   ======================================== */

/* Override inline styles with light backgrounds - ALL VARIANTS */
body.dark-mode [style*="background: #f"],
body.dark-mode [style*="background:#f"],
body.dark-mode [style*="background-color: #f"],
body.dark-mode [style*="background-color:#f"] {
  background: var(--bg-tertiary) !important;
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

body.dark-mode [style*="background: #e"],
body.dark-mode [style*="background:#e"],
body.dark-mode [style*="background-color: #e"],
body.dark-mode [style*="background-color:#e"] {
  background: var(--bg-tertiary) !important;
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"] {
  background: var(--bg-secondary) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color:#fff"] {
  background: var(--bg-secondary) !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

/* Checklist modal specific fix */
body.dark-mode #checklistModal .modal-content {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

body.dark-mode #checklistModal .modal-header h3 {
  color: var(--text-primary) !important;
}

body.dark-mode #checklistModal .modal-close {
  color: var(--text-secondary);
}

body.dark-mode #checklistModal .modal-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.dark-mode #checklistModal .form-group label {
  color: var(--text-primary);
}

body.dark-mode #checklistModal .form-group input,
body.dark-mode #checklistModal .form-group select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

body.dark-mode #checklistModal .form-group input:focus,
body.dark-mode #checklistModal .form-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.dark-mode #checklistModal .btn-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

body.dark-mode #checklistModal .btn-cancel:hover {
  background: var(--hover-bg);
}

/* ========================================
   DARK MODE - CARD WITH INLINE STYLES
   ======================================== */

/* Force dark mode on ALL cards regardless of inline styles */
body.dark-mode .card {
  background: var(--card-bg) !important;
  background-color: var(--card-bg) !important;
  color: var(--text-primary) !important;
}

/* Tasks list and checklist sections */
body.dark-mode .tasks-list,
body.dark-mode .checklist-list {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* ========================================
   EISENHOWER MATRIX
   ======================================== */

.eisenhower-quadrant {
  position: relative;
  min-height: 200px;
  transition: all 0.3s ease;
}

.eisenhower-quadrant:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.eisenhower-tasks {
  position: relative;
  width: 100%;
  height: 100%;
}

#eisenhowerHeatmapToggle {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
}

/* Dark mode support for Eisenhower */
body.dark-mode .eisenhower-quadrant {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .eisenhower-quadrant[data-quadrant="urgent-important"] {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
}

body.dark-mode .eisenhower-quadrant[data-quadrant="not-urgent-important"] {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
}

body.dark-mode .eisenhower-quadrant[data-quadrant="urgent-not-important"] {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%) !important;
}

body.dark-mode .eisenhower-quadrant[data-quadrant="not-urgent-not-important"] {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%) !important;
}

/* Whiteboard management styles */
.whiteboard-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.whiteboard-row:hover {
  background-color: #f9fafb;
}

.whiteboard-name {
  flex: 1;
  font-weight: 500;
  cursor: pointer;
}

.whiteboard-project {
  flex: 1;
  color: #6b7280;
  font-size: 0.9em;
}

.whiteboard-actions {
  display: flex;
  gap: 8px;
}

.whiteboard-actions button {
  padding: 4px 8px;
  font-size: 0.8em;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.whiteboard-actions button:hover {
  background: #f3f4f6;
}

.inline-edit-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.inline-edit-select {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* Overview project card whiteboard badge */
.overview-whiteboard-badge {
  display: inline-block;
  font-size: 12px;
  color: #374151;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 6px;
  margin-right: 6px;
  border-radius: 4px;
}

/* Blink animation for pending applications indicator */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.blink-dot {
  animation: blink 1s infinite;
}
