/* ================= GLOBAL DESIGN SYSTEM ================= */
:root {
  /* Fonts */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Shared transitions */
  --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);
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  
  /* Theme-specific tokens (Defaults to Dark Mode) */
  --bg-app: #090a0f;
  --bg-sidebar: #10121a;
  --bg-card: #161922;
  --bg-input: #1f2330;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  /* Functional Accents */
  --primary: #6366f1; /* Neon Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-hover: #4f46e5;
  
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.15);
  --success-bg: rgba(16, 185, 129, 0.1);
  
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.15);
  --warning-bg: rgba(245, 158, 11, 0.1);
  
  --danger: #ef4444; /* Rose */
  --danger-glow: rgba(239, 68, 68, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.1);
  
  --info: #06b6d4; /* Cyan */
  --info-glow: rgba(6, 182, 212, 0.15);
  --info-bg: rgba(6, 182, 212, 0.1);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  
  --glass-bg: rgba(22, 25, 34, 0.7);
  --glass-blur: blur(12px);
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.08);
  --primary-hover: #4338ca;
  
  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.05);
  --shadow-md: 0 8px 20px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 16px 32px rgba(99, 102, 241, 0.12);
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(12px);
}

/* ================= BASIC STYLING & RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-hidden: hidden; /* App container handles scrolling */
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* ================= APP CONTAINER LAYOUT ================= */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  flex-shrink: 0;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.scope-glow,
.compass-glow {
  animation: spinSlow 30s linear infinite;
}

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

.brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item a i {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.nav-item:hover a {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item:hover a i {
  transform: translateX(2px);
}

.nav-item.active a {
  color: white;
  background: linear-gradient(90deg, var(--primary), rgba(99, 102, 241, 0.3));
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .nav-item.active a {
  color: white;
  background: var(--primary);
}

.lock-badge {
  position: absolute;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Sidebar Footer & Swappers */
.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--info));
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.user-info h4 {
  font-size: 13px;
  font-weight: 600;
}

.user-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.session-switcher {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-switcher label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.session-switcher select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.session-switcher select:hover {
  border-color: var(--border-hover);
}

/* ================= MAIN CONTENT SPACE ================= */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* App Header */
.app-header {
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
  flex-shrink: 0;
  z-index: 10;
}

.header-left h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.search-box i {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-box input {
  font-size: 13px;
  width: 100%;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-md);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all var(--transition-fast);
  position: relative;
}

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

.header-btn i {
  width: 18px;
  height: 18px;
}

/* Header button notification counter badge */
.header-btn .badge,
.notif-badge {
  background-color: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -4px;
  right: -4px;
  border: 2px solid var(--bg-card);
  padding: 0 4px;
  z-index: 5;
}

/* General inline badge pill tags */
.badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.3;
  white-space: nowrap;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid transparent;
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-glow);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-glow);
}

.badge-success {
  background-color: var(--success-bg);
  color: var(--success);
  border-color: var(--success-glow);
}

.badge-info {
  background-color: var(--info-bg);
  color: var(--info);
  border-color: var(--info-glow);
}

.badge-muted {
  background-color: var(--bg-input);
  color: var(--text-muted);
  border-color: var(--border-color);
}

/* Notifications Dropdown */
.notifications-bell {
  position: relative;
}

.notifications-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.dropdown-header h3 {
  font-size: 13px;
  font-weight: 700;
}

.text-btn {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.text-btn:hover {
  text-decoration: underline;
}

.notification-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.notification-item {
  padding: 10px;
  background-color: var(--bg-input);
  border-left: 3px solid var(--warning);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notification-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.notification-item.urgent {
  border-left-color: var(--danger);
}

.notification-item h4 {
  font-weight: 600;
  margin-bottom: 2px;
}

.notification-item p {
  color: var(--text-muted);
}

.notification-item .notif-date {
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 24px 0;
}

/* ================= CONTENT PANELS ================= */
.content-body {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.view-panel {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.view-panel.active {
  display: block;
}

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

/* ================= DASHBOARD MODULE ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-card.alert-highlight {
  border-left: 4px solid var(--danger);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-danger { background-color: var(--danger); }
.bg-info { background-color: var(--info); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 2px;
}

.stat-subtext {
  font-size: 10px;
  margin-top: 2px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dashboard-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-half {
  grid-column: span 1;
}

@media(max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .card-half {
    grid-column: span 2;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  position: relative;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* Custom SVG Donut Chart */
.svg-chart-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center-text span {
  font-size: 32px;
  font-weight: 800;
  display: block;
  line-height: 1;
}

.donut-center-text p {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Workload Distribution bars */
.workload-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  height: 100%;
}

.workload-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workload-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
}

.workload-bar-bg {
  height: 8px;
  background-color: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.workload-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--info));
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* Dashboard list layout */
.dashboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 320px;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: var(--bg-input);
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  transition: border var(--transition-fast);
}

.dashboard-list-item:hover {
  border-color: var(--border-color);
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-size: 13px;
  font-weight: 600;
}

.item-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ================= PROJECTS LIST MODULE ================= */
.view-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.filters-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.filter-group select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-group select:hover {
  border-color: var(--border-hover);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-toggle {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 2px;
}

.view-toggle button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.view-toggle button.active {
  background-color: var(--primary);
  color: white;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  padding: 10px 18px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all var(--transition-fast);
  font-size: 13px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.primary-btn.small {
  padding: 6px 12px;
  font-size: 11px;
}

.outline-btn {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  font-size: 13px;
}

.outline-btn:hover {
  background-color: var(--bg-card);
  border-color: var(--border-hover);
}

.outline-btn.small {
  padding: 6px 12px;
  font-size: 11px;
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title-block h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.card-title-block p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Badges systems */
.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-not-started { background-color: var(--border-color); color: var(--text-main); }
.status-in-progress { background-color: var(--primary-glow); color: var(--primary); }
.status-on-hold { background-color: var(--warning-bg); color: var(--warning); }
.status-completed { background-color: var(--success-bg); color: var(--success); }
.status-cancelled { background-color: var(--danger-bg); color: var(--danger); }

.overdue-banner {
  background-color: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}

.bar-bg {
  height: 6px;
  background-color: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--info));
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.project-card-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.avatar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.priority-flag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--text-muted); }

/* Table design */
.projects-list-table-container, .users-list-table-container, .reports-table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th, .data-table td {
  padding: 16px 20px;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--bg-input);
  color: var(--primary);
}

/* ================= PROJECT DETAILS WORKSPACE ================= */
.detail-header {
  margin-bottom: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color var(--transition-fast);
}

.back-btn:hover {
  color: var(--primary);
}

.project-title-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-code-badge {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}

.title-left h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.project-client-name {
  font-size: 13px;
  color: var(--text-muted);
}

.title-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Workspace Tabs */
.workspace-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-top: 24px;
  margin-bottom: 24px;
}

.tab-btn, .report-tab-btn {
  padding: 12px 20px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  font-size: 13px;
}

.tab-btn:hover, .report-tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active, .report-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel, .report-panel {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.tab-panel.active, .report-panel.active {
  display: block;
}

/* General Details Workspace */
.details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.details-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-block h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.info-block h4 {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.info-block p {
  font-size: 14px;
  line-height: 1.6;
}

.info-blocks-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.external-link:hover {
  text-decoration: underline;
}

.details-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.owner-card-detail, .progress-card-detail {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.owner-card-detail h3, .progress-card-detail h3 {
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.margin-top-md {
  margin-top: 16px;
}

.progress-info span {
  font-size: 14px;
}

/* Documents Sub-tab */
.documents-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.doc-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
}

.doc-cat-btn {
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.doc-cat-btn:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.doc-cat-btn.active {
  background-color: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

.doc-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.doc-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-card-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-input);
}

.doc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-title-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-file-icon {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-title-block h4 {
  font-size: 13px;
  font-weight: 600;
}

.doc-card-actions {
  display: flex;
  gap: 8px;
}

.doc-versions-list {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

.version-badge {
  background-color: var(--border-color);
  color: var(--text-main);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
}

/* ================= TIMELINE GANTT STYLING ================= */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gantt-chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: 180px 1fr;
  overflow-x: auto;
}

.gantt-y-axis {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
  margin-top: 40px; /* offset month header */
}

.gantt-phase-label {
  font-size: 11px;
  font-weight: 600;
  height: 32px;
  display: flex;
  align-items: center;
}

.gantt-canvas-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
}

.gantt-months-header {
  display: flex;
  height: 40px;
  border-bottom: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gantt-month-col {
  flex-grow: 1;
  text-align: center;
  border-right: 1px dashed rgba(255, 255, 255, 0.05);
}

.gantt-bars-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  position: relative;
}

.gantt-row {
  height: 32px;
  position: relative;
  width: 100%;
}

.gantt-bar {
  height: 16px;
  border-radius: 8px;
  position: absolute;
  top: 8px;
  background: linear-gradient(90deg, var(--primary), var(--info));
  opacity: 0.85;
  box-shadow: 0 0 10px var(--primary-glow);
  transition: all var(--transition-slow);
}

.gantt-bar.completed {
  background: linear-gradient(90deg, var(--success), #34d399);
  box-shadow: 0 0 10px var(--success-glow);
}

.gantt-bar.not-started {
  background: var(--border-color);
  box-shadow: none;
}

/* ================= PAYMENTS WORKSPACE ================= */
.payments-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

@media(max-width: 1024px) {
  .payments-layout {
    grid-template-columns: 1fr;
  }
}

.payments-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 14px;
  font-weight: 700;
}

.quotations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quotation-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quotation-info h4 {
  font-size: 13px;
  font-weight: 700;
}

.quotation-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.payment-table-wrapper {
  overflow-x: auto;
}

.font-small {
  font-size: 12px;
}

.card-table th, .card-table td {
  padding: 12px 14px;
}

.reminders-list-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reminder-pill {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

/* ================= REPORTS MODULE ================= */
.weekly-email-preview {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.email-envelope-header {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  line-height: 1.6;
}

.email-body {
  padding: 32px;
  background-color: #12141a;
  color: #f1f5f9;
  font-family: var(--font-family);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.email-container {
  border: 1px solid #2d3748;
  padding: 24px;
  background-color: #1a202c;
  border-radius: 8px;
}

.email-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 12px;
  margin-bottom: 20px;
  text-align: center;
}

.email-header h2 {
  font-size: 20px;
  color: white;
}

.email-section {
  margin-bottom: 24px;
}

.email-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid #4a5568;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.email-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.email-table th, .email-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #4a5568;
  text-align: left;
}

.email-table th {
  background-color: #2d3748;
  color: white;
}

.text-danger-custom { color: #fc8181; }
.text-warning-custom { color: #fbd38d; }

/* ================= MODALS SYSTEM ================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn var(--transition-fast);
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 600px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--transition-fast);
}

.small-modal {
  max-width: 440px;
}

.preview-modal {
  max-width: 700px;
}

@keyframes scaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.close-modal:hover {
  background-color: var(--bg-input);
  color: var(--danger);
}

/* Form layouts */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
}

.col-6 { width: 50%; }
.col-12 { width: 100%; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

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

.readonly-input {
  background-color: var(--bg-card) !important;
  opacity: 0.7;
}

.field-help {
  font-size: 10px;
}

.field-error {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 24px;
}

/* Document mock preview content */
.preview-body {
  background-color: var(--bg-input);
  border-radius: var(--border-radius-md);
  padding: 24px;
  min-height: 280px;
  font-size: 13px;
  max-height: 400px;
  overflow-y: auto;
}

.doc-mock-pdf {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 260px;
  color: var(--text-muted);
  gap: 12px;
}

.doc-mock-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

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

/* ================= UTILITY CLASSES ================= */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-highlight { font-weight: 700; color: var(--success); }
.text-small { font-size: 12px; }
.margin-top-md { margin-top: 16px; }

/* Switch Toggle (iOS style) */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 24px;
}

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

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ================= LOGIN & AUTH STYLING ================= */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  padding: 24px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: background-color var(--transition-normal);
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: scaleIn var(--transition-normal);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.login-brand .logo-icon {
  width: 52px;
  height: 52px;
}

.login-brand .brand-text h1 {
  font-size: 22px;
  font-weight: 800;
}

.login-panel h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-panel p {
  font-size: 13px;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-options {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
}

.form-actions-inline {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.alert-banner {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 12px;
  font-weight: 600;
  margin-top: 16px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-banner.error {
  background-color: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-banner.success {
  background-color: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}
