/* ============================================
   PROJECT MANAGEMENT DASHBOARD - MAIN STYLES
   ============================================ */

/* ============ CSS VARIABLES ============ */
:root {
  /* Light Theme Colors */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Neutral Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-lg: rgba(0, 0, 0, 0.15);

  /* Status Colors */
  --status-new: #06b6d4;
  --status-progress: #3b82f6;
  --status-blocked: #ef4444;
  --status-completed: #10b981;

  /* Priority Colors */
  --priority-low: #10b981;
  --priority-medium: #f59e0b;
  --priority-high: #ef4444;

  /* Risk Colors */
  --risk-low: #10b981;
  --risk-medium: #f59e0b;
  --risk-high: #ef4444;

  /* Health Colors */
  --health-good: #10b981;
  --health-warning: #f59e0b;
  --health-danger: #ef4444;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ LAYOUT ============ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 1000;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  background: var(--primary);
  color: white;
}

.sidebar-nav svg {
  flex-shrink: 0;
}

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

.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
}

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

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.content-area {
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
}

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

/* ============ CARDS ============ */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

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

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-secondary);
}

/* ============ STATISTICS CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.stat-card-blue { color: var(--primary); }
.stat-card-green { color: var(--success); }
.stat-card-purple { color: var(--secondary); }
.stat-card-red { color: var(--danger); }
.stat-card-gold { color: var(--warning); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow);
}

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

.stat-card-content {
  flex: 1;
}

.stat-card-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============ PROJECT CARDS ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow-lg);
}

.project-card-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-card-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.project-card-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.project-card-body {
  padding: 1.25rem;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-card-footer {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.project-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.project-health {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-good {
  background: rgba(16, 185, 129, 0.1);
  color: var(--health-good);
}

.health-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--health-warning);
}

.health-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--health-danger);
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-new {
  background: rgba(6, 182, 212, 0.1);
  color: var(--status-new);
}

.status-progress {
  background: rgba(59, 130, 246, 0.1);
  color: var(--status-progress);
}

.status-blocked {
  background: rgba(239, 68, 68, 0.1);
  color: var(--status-blocked);
}

.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-completed);
}

.priority-low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--priority-low);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--priority-medium);
}

.priority-high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--priority-high);
}

.risk-low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--risk-low);
}

.risk-medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--risk-medium);
}

.risk-high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--risk-high);
}

/* ============ PROGRESS BARS ============ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.progress-bar-small {
  width: 60px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ============ TABLES ============ */
.data-table {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-secondary);
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

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

.data-table td.actions {
  display: flex;
  gap: 0.25rem;
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.error,
input.error {
  border-color: var(--danger);
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--danger);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

select {
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============ WIZARD ============ */
.wizard {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-indicator {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.step-indicator.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step-indicator.completed .step-number {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ============ TABS ============ */
.tabs {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

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

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============ TOASTS ============ */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 24px var(--shadow-lg);
  z-index: 10000;
  min-width: 300px;
  opacity: 0;
  transform: translateX(400px);
  transition: var(--transition);
}

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

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: var(--success);
  color: white;
}

.toast-error .toast-icon {
  background: var(--danger);
  color: white;
}

.toast-warning .toast-icon {
  background: var(--warning);
  color: white;
}

.toast-info .toast-icon {
  background: var(--info);
  color: white;
}

.toast-message {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============ TIMELINE CHART ============ */
.timeline-chart {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  overflow-x: auto;
}

.timeline-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.timeline-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.timeline-bars-header {
  display: flex;
  min-width: 600px;
}

.timeline-month {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.25rem;
  border-left: 1px solid var(--border);
}

.timeline-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.timeline-row .timeline-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.timeline-row .timeline-label small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.timeline-bars {
  position: relative;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  min-width: 600px;
}

.timeline-bar {
  position: absolute;
  height: 100%;
  background: var(--primary);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.timeline-bar:hover {
  filter: brightness(1.1);
  transform: scaleY(1.1);
}

.timeline-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--success);
  border-radius: var(--border-radius);
  opacity: 0.8;
}

.timeline-bar-label {
  position: relative;
  z-index: 1;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============ RISK MATRIX ============ */
.risk-matrix {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.risk-matrix-grid {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  background: var(--border);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.risk-zone {
  background: var(--bg-secondary);
}

.risk-zone-low {
  background: rgba(16, 185, 129, 0.2);
}

.risk-zone-medium {
  background: rgba(245, 158, 11, 0.2);
}

.risk-zone-high {
  background: rgba(239, 68, 68, 0.2);
}

.risk-point {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--shadow);
}

.risk-point:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 10;
}

.risk-point.risk-level-low {
  background: var(--risk-low);
}

.risk-point.risk-level-medium {
  background: var(--risk-medium);
}

.risk-point.risk-level-high {
  background: var(--risk-high);
}

.risk-point-label {
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
}

.risk-matrix-x-label,
.risk-matrix-y-label {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.75rem 0;
}

.risk-matrix-y-label {
  position: absolute;
  left: -80px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  width: 100px;
}

.risk-matrix-legend {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.risk-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.risk-legend-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.risk-legend-text {
  color: var(--text-primary);
}

/* ============ PROGRESS GAUGE ============ */
.progress-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.progress-gauge svg {
  transform: rotate(-90deg);
}

.progress-gauge-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.progress-gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.progress-gauge-text {
  font-size: 20px;
  font-weight: 700;
  fill: var(--text-primary);
  text-anchor: middle;
  dominant-baseline: middle;
  transform: rotate(90deg);
  transform-origin: center;
}

.progress-gauge-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============ BAR CHART ============ */
.bar-chart {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.bar-chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.bar-chart-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bar-chart-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
}

.bar-chart-label {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.bar-chart-bar-container {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  height: 32px;
  position: relative;
  overflow: hidden;
}

.bar-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  transition: width 0.5s ease;
}

.bar-chart-value {
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============ DONUT CHART ============ */
.donut-chart {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.donut-chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.donut-chart-svg {
  flex-shrink: 0;
}

.donut-chart-total {
  font-size: 32px;
  font-weight: 700;
  fill: var(--text-primary);
}

.donut-chart-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.donut-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.donut-chart-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.donut-chart-legend-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.donut-chart-legend-value {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============ ACTIVITY FEED ============ */
.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--bg-secondary);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.activity-project {
  font-weight: 500;
}

/* ============ PROJECT DETAILS ============ */
.project-header {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.project-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-header-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.overview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.overview-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.overview-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1rem;
}

.overview-card dt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.overview-card dd {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.health-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

.health-indicator.health-good {
  background: rgba(16, 185, 129, 0.1);
}

.health-indicator.health-warning {
  background: rgba(245, 158, 11, 0.1);
}

.health-indicator.health-danger {
  background: rgba(239, 68, 68, 0.1);
}

.health-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.health-good .health-icon {
  background: var(--health-good);
}

.health-warning .health-icon {
  background: var(--health-warning);
}

.health-danger .health-icon {
  background: var(--health-danger);
}

.health-label {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ============ MILESTONES ============ */
.milestone-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.milestone-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.milestone-progress {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.milestone-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.milestone-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ============ RISKS ============ */
.risk-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.risk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.risk-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.risk-metrics {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.risk-metric {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.risk-metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.risk-metric-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
}

.risk-metric-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--danger));
  border-radius: 999px;
}

.risk-metric-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.risk-item dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.risk-item dt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.risk-item dd {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* ============ NOTES ============ */
.note-item {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.note-item p {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============ DOCUMENTS & LINKS ============ */
.document-item,
.link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: 0.75rem;
}

.document-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.document-info {
  flex: 1;
}

.document-info strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.document-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.document-actions {
  display: flex;
  gap: 0.5rem;
}

.link-item a {
  flex: 1;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.link-item a:hover {
  text-decoration: underline;
}

/* ============ ACCOUNTS ============ */
.account-item {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.account-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.account-item dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem;
}

.account-item dt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.account-item dd {
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.password-value {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ============ COMMUNICATIONS ============ */
.comm-item {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.comm-item h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.comm-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.comm-item strong {
  color: var(--text-primary);
}

.comm-item a {
  color: var(--primary);
  text-decoration: none;
}

.comm-item a:hover {
  text-decoration: underline;
}

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============ LOADING ============ */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

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

/* ============ UTILITIES ============ */
.text-muted {
  color: var(--text-muted);
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

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

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

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

/* ============ RTL SUPPORT ============ */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"] .search-box svg {
  left: auto;
  right: 0.75rem;
}

[dir="rtl"] .search-box input {
  padding-left: 1rem;
  padding-right: 2.5rem;
}

[dir="rtl"] .toast {
  right: auto;
  left: 1rem;
}

[dir="rtl"] .toast.show {
  transform: translateX(0);
}

[dir="rtl"] .toast:not(.show) {
  transform: translateX(-400px);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  [dir="rtl"] .main-content {
    margin-right: 0;
  }

  .topbar {
    padding: 0 1rem;
  }

  .search-box {
    width: 200px;
  }

  .content-area {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-stats {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .wizard-steps {
    flex-wrap: wrap;
  }

  .tabs-nav {
    overflow-x: auto;
  }

  .modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    min-width: auto;
  }

  .timeline-chart {
    overflow-x: scroll;
  }

  .risk-matrix {
    max-width: 100%;
  }

  .bar-chart-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .search-box {
    display: none;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .project-card-header h3 {
    font-size: 1rem;
  }

  .wizard-actions {
    flex-direction: column;
  }

  .wizard-actions .btn {
    width: 100%;
  }
}

/* ============ PRINT STYLES ============ */
@media print {
  .sidebar,
  .topbar,
  .btn,
  .modal-overlay,
  .toast {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .card,
  .data-table {
    box-shadow: none;
    border: 1px solid #000;
  }
}
