/* style.css - LAKON Design System & Layout */

:root {
  /* Common variables */
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Light Theme default (overridden if .dark-theme) */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: rgba(255, 255, 255, 0.75);
  --bg-card: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(226, 232, 240, 0.8);
  --border-focus: #6366f1;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  
  --accent: #8b5cf6;
  
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
}

.dark-theme {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-surface: rgba(15, 23, 42, 0.65);
  --bg-card: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --border-color: rgba(51, 65, 85, 0.5);
  --border-focus: #818cf8;
  
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: rgba(129, 140, 248, 0.15);
  
  --accent: #a78bfa;
  
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);
}

/* Base Styles */
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 20px;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  margin-top: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

/* Glassmorphism Classes */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--border-color);
}

/* Auth Page specific styling */
.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
  margin: 2rem 1rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.auth-logo svg {
  width: 2.25rem;
  height: 2.25rem;
}
.auth-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 0.85rem;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrapper input, 
.input-wrapper select, 
.input-wrapper textarea,
textarea.form-control,
input.form-control,
select.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input-wrapper input {
  padding-left: 2.6rem;
}
.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
}
.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.3s ease;
}
.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.hidden {
  display: none !important;
}

/* Background Glowing Blobs */
.glow-blob {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}
.blob-1 {
  background: var(--primary);
  top: 15%;
  left: 10%;
}
.blob-2 {
  background: var(--accent);
  bottom: 15%;
  right: 10%;
}

/* MAIN APP LAYOUT */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 20;
  transition: transform var(--transition-normal), width var(--transition-normal);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary);
}
.sidebar-logo svg {
  width: 1.75rem;
  height: 1.75rem;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.menu-title {
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-title-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.menu-title-btn:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}
.menu-title-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.project-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.project-item-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.project-item-btn.active {
  background: linear-gradient(135deg, var(--primary-light), rgba(168, 85, 247, 0.08));
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}
.project-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.project-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.project-item-btn:hover .project-actions {
  opacity: 1;
}
.project-action-btn {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
}
.project-action-btn:hover {
  color: var(--danger);
  background: var(--bg-secondary);
}
.project-action-btn.edit-btn:hover {
  color: var(--primary);
}
.project-action-btn svg {
  width: 1rem;
  height: 1rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.05);
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}
.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
}
.btn-logout:hover {
  color: var(--danger);
  background: var(--danger-light);
}
.btn-logout svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* MAIN CONTENT AREA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Workspace Headers */
.workspace-header {
  padding: 1.5rem 2rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}
.project-details h2 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}
.project-details p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.meta-item svg {
  width: 1.1rem;
  height: 1.1rem;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Dashboard Summary Cards */
.analytics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.stat-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.blue {
  background: var(--primary-light);
  color: var(--primary);
}
.stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}
.stat-icon.amber {
  background: var(--warning-light);
  color: var(--warning);
}
.stat-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent);
}
.stat-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}
.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Theme / Options toggle bar */
.options-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}
.filters-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
}
.search-box input {
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  font-size: 0.85rem;
  width: 200px;
  border-radius: var(--radius-md);
}
.btn-toggle-option {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}
.btn-toggle-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-toggle-option svg {
  width: 1rem;
  height: 1rem;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.zoom-controls {
  display: flex;
  background: var(--bg-secondary);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.zoom-btn {
  background: transparent;
  border: none;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-body);
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.zoom-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
}
.theme-toggle:hover {
  color: var(--primary);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* WORKPLAN GANTT WORKSPACE */
.gantt-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-secondary);
}

/* Split panel widths */
.gantt-table-panel {
  width: 40%;
  min-width: 320px;
  max-width: 600px;
  background: var(--bg-card);
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.gantt-chart-panel {
  flex: 1;
  overflow: auto;
  position: relative;
  background: var(--bg-primary);
}

/* Table Header */
.table-panel-header {
  height: 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.5rem;
  flex-shrink: 0;
}
.tbl-col-name { flex: 2; padding: 0 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-col-duration { flex: 0.8; padding: 0 0.5rem; text-align: center; }
.tbl-col-assignee { flex: 1; padding: 0 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-col-actions { width: 70px; text-align: center; }

/* Table Body Rows */
.table-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.gantt-row {
  height: 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 0 0.5rem;
  transition: background-color var(--transition-fast);
  background: var(--bg-card);
}
.gantt-row:hover {
  background: var(--bg-secondary);
}

.tbl-cell-name {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
  overflow: hidden;
}
.toggle-subtasks {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-muted);
  display: inline-flex;
  transition: transform var(--transition-fast);
}
.toggle-subtasks.collapsed svg {
  transform: rotate(-90deg);
}
.toggle-subtasks svg {
  width: 0.95rem;
  height: 0.95rem;
}
.task-name-span {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.task-name-span:hover {
  color: var(--primary);
}

.tbl-cell-duration {
  flex: 0.8;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.tbl-cell-assignee {
  flex: 1;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assignee-badge {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.tbl-cell-actions {
  width: 70px;
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}
.tbl-action-btn {
  background: transparent;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
}
.tbl-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}
.tbl-action-btn.del:hover {
  color: var(--danger);
  background: var(--danger-light);
}
.tbl-action-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* Indent for Subtasks */
.gantt-row.subtask-row .tbl-cell-name {
  padding-left: 1.75rem;
}
.gantt-row.subtask-row {
  background: rgba(0, 0, 0, 0.01);
}

/* CHART VIEWPORT & TIMELINE */
.chart-viewport {
  position: relative;
  min-height: 100%;
}

/* Timeline Header */
.chart-header {
  height: 48px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  position: sticky;
  top: 0;
  z-index: 15;
}
.timeline-block {
  flex-shrink: 0;
  height: 100%;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  user-select: none;
}
.timeline-block-top {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}
.timeline-block-bottom {
  font-size: 0.75rem;
}

/* Chart Grid Background */
.chart-grid-body {
  position: relative;
  min-height: calc(100% - 48px);
}
.chart-grid-cols {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  pointer-events: none;
  z-index: 1;
}
.grid-col {
  flex-shrink: 0;
  height: 100%;
  border-right: 1px dashed var(--border-color);
}
.grid-col.weekend {
  background: rgba(0, 0, 0, 0.02);
}
.dark-theme .grid-col.weekend {
  background: rgba(255, 255, 255, 0.01);
}

/* Chart Rows (matching table row heights) */
.chart-rows-container {
  position: relative;
  z-index: 2;
}
.chart-row {
  height: 48px;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

/* Gantt Task Bars */
.gantt-bar-wrapper {
  position: absolute;
  height: 32px;
  display: flex;
  align-items: center;
  cursor: grab;
  user-select: none;
}
.gantt-bar-wrapper:active {
  cursor: grabbing;
}
.gantt-bar-wrapper.dragging {
  opacity: 0.8;
  z-index: 100 !important;
}

.gantt-bar {
  width: 100%;
  height: 24px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
  border: 1px solid rgba(0,0,0,0.15);
}
.gantt-bar-wrapper:hover .gantt-bar {
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Progress fill */
.gantt-bar-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  border-radius: 12px 0 0 12px;
}

/* Drag Handles */
.gantt-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 5;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.gantt-bar-wrapper:hover .gantt-handle {
  opacity: 1;
}
.gantt-handle-left {
  left: 0;
  border-radius: 12px 0 0 12px;
}
.gantt-handle-right {
  right: 0;
  border-radius: 0 12px 12px 0;
}

/* Label text inside or beside bar */
.gantt-bar-label {
  position: absolute;
  left: calc(100% + 8px);
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Predecessor Connector Node */
.gantt-connector-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  z-index: 6;
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.gantt-bar-wrapper:hover .gantt-connector-node {
  opacity: 1;
}
.gantt-connector-node:hover {
  transform: scale(1.3);
  background: var(--accent);
}
.connector-in {
  left: -8px;
  top: calc(50% - 5px);
}
.connector-out {
  right: -8px;
  top: calc(50% - 5px);
}

/* Summary Row Gantt Bar (for Parent Tasks) */
.gantt-bar-wrapper.parent-task .gantt-bar {
  height: 12px;
  border-radius: 0;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, calc(100% - 8px) 50%, 8px 50%, 0% 100%);
  background: var(--text-primary) !important;
  border: none;
}
.gantt-bar-wrapper.parent-task .gantt-bar-progress {
  background: var(--primary);
}
.gantt-bar-wrapper.parent-task .gantt-handle,
.gantt-bar-wrapper.parent-task .gantt-connector-node {
  display: none !important; /* Parents auto-schedule based on children */
}

/* SVG Dependency Connector Lines Overlay */
.gantt-svg-overlay {
  position: absolute;
  top: 48px; /* matching timeline header */
  left: 0;
  width: 100%;
  height: calc(100% - 48px);
  pointer-events: none;
  z-index: 3;
}
.gantt-dependency-line {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.6;
  transition: stroke var(--transition-fast), stroke-width var(--transition-fast);
}
.gantt-dependency-line.interactive {
  pointer-events: stroke;
  cursor: pointer;
}
.gantt-dependency-line.interactive:hover {
  stroke: var(--danger);
  stroke-width: 3;
  opacity: 1;
}

/* Temporary connector line while dragging to connect */
.temp-connector-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

/* Critical Path Highlights */
.critical-task .gantt-bar {
  border: 2px solid var(--danger) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}
.critical-dependency {
  stroke: var(--danger) !important;
  stroke-width: 2.5 !important;
  opacity: 1 !important;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  overflow: hidden;
  margin: 1rem;
}
.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}
.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
}
.btn-close-modal:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.btn-close-modal svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.02);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Empty Project State placeholder view */
.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  flex: 1;
}
.empty-state svg {
  width: 5rem;
  height: 5rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.empty-state p {
  max-width: 400px;
  margin: 0 0 1.5rem;
}

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

/* Custom color picker palette input */
.color-picker-row {
  display: flex;
  gap: 0.5rem;
}
.color-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--transition-fast);
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

/* Responsive Overrides */
@media(max-width: 992px) {
  .gantt-workspace {
    flex-direction: column;
  }
  .gantt-table-panel {
    width: 100%;
    max-width: 100%;
    height: 40%;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }
  .gantt-chart-panel {
    height: 60%;
  }
}

@media(max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .workspace-header {
    flex-direction: column;
    gap: 1rem;
  }
}

/* --- ADVANCED FEATURES STYLING --- */

/* Modal Tabs Navigation */
.modal-tabs {
  margin-top: 0;
}
.modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.modal-tab:hover {
  color: var(--primary);
}
.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Resource Workload Panel at bottom of screen */
.workload-panel {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: height var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 15;
}
.workload-panel.collapsed {
  height: 44px;
}
.workload-panel:not(.collapsed) {
  height: 220px;
}
.workload-header {
  height: 44px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}
.workload-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.workload-toggle-icon {
  font-size: 0.75rem;
  transition: transform var(--transition-normal);
  color: var(--text-secondary);
}
.workload-panel.collapsed .workload-toggle-icon {
  transform: rotate(180deg);
}

.workload-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.workload-user-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.workload-user-name {
  width: 130px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.workload-grid {
  flex: 1;
  height: 14px;
  background: var(--bg-secondary);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.workload-bar {
  height: 100%;
  border-radius: 7px;
  transition: width var(--transition-normal), background-color var(--transition-fast);
}
.workload-bar.normal {
  background-color: var(--success);
}
.workload-bar.warning {
  background-color: var(--warning);
}
.workload-bar.overload {
  background-color: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.workload-days-count {
  width: 90px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Comments Feed Styles */
.comment-bubble {
  background: var(--bg-card);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.comment-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.comment-author {
  color: var(--primary);
}
.comment-date {
  font-weight: 400;
}
.comment-body {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

/* Attachments File Rows */
.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.attachment-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}
.attachment-info svg {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}
.attachment-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.attachment-size {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.attachment-actions {
  display: flex;
  gap: 0.25rem;
}

/* Project Activity Logs Feed */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0;
}
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  padding-left: 1.5rem;
}
.activity-row::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--bg-card);
  z-index: 2;
}
.activity-row::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: -22px;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}
.activity-row:last-child::after {
  display: none;
}
.activity-details-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.activity-action-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.activity-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.activity-user-stamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.activity-user-stamp svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* Milestone Diamond Markers */
.gantt-bar-wrapper.milestone-task {
  z-index: 10 !important;
}
.gantt-bar-wrapper.milestone-task .gantt-bar {
  width: 16px !important;
  height: 16px !important;
  transform: rotate(45deg);
  border-radius: 2px !important;
  border: 2px solid white !important;
  overflow: visible;
  margin-left: 12px; /* Center diamond within 40px grid space */
}
.gantt-bar-wrapper.milestone-task .gantt-bar-progress {
  display: none !important;
}
.gantt-bar-wrapper.milestone-task .gantt-connector-node.connector-in {
  left: 4px;
}
.gantt-bar-wrapper.milestone-task .gantt-connector-node.connector-out {
  right: 4px;
}
.gantt-bar-wrapper.milestone-task .gantt-bar-label {
  left: 42px;
}

/* Baseline Shadows */
.baseline-bar {
  position: absolute;
  height: 4px;
  background-color: rgba(148, 163, 184, 0.4);
  border-radius: 2px;
  bottom: 0px;
  left: 0;
  z-index: 1;
  pointer-events: none;
}
.dark-theme .baseline-bar {
  background-color: rgba(100, 116, 139, 0.5);
}

/* Collaborator list elements */
.project-member-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.member-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.member-role-badge.owner {
  background: var(--primary-light);
  color: var(--primary);
}
.member-role-badge.member {
  background: var(--bg-card);
  color: var(--text-secondary);
}

/* PRINT MEDIA STYLING */
#print-report-container {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-container, .modal-overlay {
    display: none !important;
  }

  #print-report-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  
  .print-report-wrapper {
    max-width: 1000px;
    margin: 0 auto;
  }
  
  .print-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 10px;
    margin-bottom: 25px;
  }
  
  .print-header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
  }
  
  .print-header-date {
    font-size: 0.85rem;
    color: #475569;
  }
  
  .print-report-title-section {
    text-align: center;
    margin-bottom: 25px;
  }
  
  .print-report-title-section h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin: 0 0 5px 0;
  }
  
  .print-subtitle {
    font-size: 1rem;
    color: #475569;
    margin: 0;
  }
  
  .print-project-details-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
  }
  
  .print-details-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .print-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .print-detail-item .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .print-detail-item .value {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.4;
  }
  
  .print-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
  }
  
  .print-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .print-metric-card.critical {
    border-color: #f87171;
    background: #fef2f2;
  }
  
  .print-metric-card .val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
  }
  
  .print-metric-card.critical .val {
    color: #dc2626;
  }
  
  .print-metric-card .lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-top: 4px;
    text-transform: uppercase;
  }
  
  .print-section {
    margin-bottom: 30px;
  }
  
  .print-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }
  
  .print-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
    margin-bottom: 15px;
  }
  
  .print-data-table th, .print-data-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    text-align: left;
  }
  
  .print-data-table th {
    background-color: #f1f5f9 !important;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
  }
  
  .print-parent-row td {
    background-color: #f8fafc !important;
  }
  
  .print-critical-row td {
    border-left: 3px solid #ef4444 !important;
  }
  
  .print-critical-badge {
    display: inline-block;
    background: #fecaca;
    color: #dc2626;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
  }
  
  /* Timeline Cell Drawing */
  .print-timeline-cell {
    padding: 4px 6px !important;
    vertical-align: middle;
    background: #fafafa;
  }
  
  .print-timeline-bar-bg {
    position: absolute;
    top: calc(50% - 6px);
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
  }
  
  .print-timeline-bar-fill {
    height: 100%;
    border-radius: 6px 0 0 6px;
  }
  
  .print-timeline-milestone {
    position: absolute;
    top: calc(50% - 8px);
    font-size: 1.15rem;
    font-weight: bold;
    color: #d97706;
    line-height: 16px;
    text-align: center;
    transform: translateY(-2px);
  }
  
  /* Badge Status Styles */
  .print-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.725rem;
    font-weight: 600;
  }
  
  .print-badge.success {
    background-color: #dcfce7;
    color: #15803d;
  }
  
  .print-badge.danger {
    background-color: #fee2e2;
    color: #b91c1c;
  }
  
  /* Log lists styling */
  .print-logs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
  }
  
  .print-log-item {
    font-size: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .print-log-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .print-log-action {
    font-weight: 700;
    color: #1e3a8a;
    text-transform: uppercase;
    font-size: 0.7rem;
    background: #e0f2fe;
    padding: 1px 6px;
    border-radius: 4px;
  }
  
  .print-log-details {
    flex: 1;
    color: #334155;
  }
  
  .print-log-meta {
    font-size: 0.725rem;
    color: #64748b;
  }
  
  .print-no-data {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    padding: 10px;
  }
  
  /* Signature blocks */
  .print-signature-section {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    page-break-inside: avoid;
  }
  
  .print-sig-col {
    width: 45%;
    display: flex;
    flex-direction: column;
  }
  
  .print-sig-col .sig-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 45px;
  }
  
  .print-sig-col .sig-line {
    border-top: 1.5px solid #0f172a;
    width: 100%;
    margin-bottom: 5px;
  }
  
  .print-sig-col .sig-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
  }
  
  .print-sig-col .sig-designation {
    font-size: 0.75rem;
    color: #64748b;
  }

  /* Page breaks optimization */
  .page-break {
    page-break-before: always !important;
  }
}
