/* ============================================================================
   DASHBOARD SECTION STYLES
   ============================================================================ */

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  background-color: var(--color-light-gray);
  min-height: 100vh;
}

/* ============================================================================
   STATS GRID (Top Cards)
   ============================================================================ */

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.dashboard-stat-card {
  border-radius: 16px;
  padding: 24px;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
}

.dashboard-card-teal {
  background: linear-gradient(135deg, #17a697 0%, #0d8b7f 100%);
}

.dashboard-card-blue {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.dashboard-card-green {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.dashboard-card-green-alt {
  background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.dashboard-stat-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dashboard-stat-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.dashboard-stat-info {
  flex: 1;
}

.dashboard-stat-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: block;
}

.dashboard-stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
  letter-spacing: -0.5px;
}

.dashboard-stat-change {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
  display: block;
}

.dashboard-stat-change.positive {
  color: rgba(255, 255, 255, 0.85);
}

.dashboard-stat-change.negative {
  color: rgba(255, 255, 255, 0.85);
}

.dashboard-stat-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1200px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .dashboard-stat-card {
    padding: 20px;
    min-height: 120px;
  }
  
  .dashboard-stat-value {
    font-size: 24px;
  }
  
  .dashboard-stat-icon-circle {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
}

/* ============================================================================
   CHARTS GRID
   ============================================================================ */

.charts-grid-container {
  width: 100%;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
}

.chart-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-card:nth-child(1) {
  grid-row: 1 / 3;
  grid-column: 1;
}

.chart-card:nth-child(2) {
  grid-row: 1;
  grid-column: 2;
}

.chart-card:nth-child(3) {
  grid-row: 2;
  grid-column: 2;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  margin-bottom: 8px;
}

#revenueChart {
  max-height: 300px;
  width: 100%;
}

#pieChart {
  max-height: 180px;
  width: 100%;
}

.chart-canvas {
  max-height: 250px;
  width: 100%;
}

.chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
}

.pie-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pie-chart-canvas {
  max-height: 180px;
  width: 100%;
  max-width: 180px;
}

.pie-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #333;
  padding: 6px 8px;
  background: #f9f9f9;
  border-radius: 4px;
}

.legend-item:hover {
  background: #f9f9f9;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.mountain-chart-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.mountain-chart-canvas {
  width: 100%;
  height: 100%;
}

.bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar-label {
  font-size: 13px;
  color: #333;
  font-weight: 500;
  min-width: 90px;
}

.bar-wrapper {
  flex: 1;
  height: 24px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0097A7 0%, #00D9FF 100%);
  border-radius: 4px;
}

.bar-value {
  font-size: 13px;
  color: #333;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* Responsive: Single column on mobile, 2 columns on tablet, 2-3 on desktop */
@media (max-width: 480px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-card:nth-child(1) {
    grid-row: auto;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-card:nth-child(1) {
    grid-row: auto;
  }
}

@media (min-width: 769px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .chart-card:nth-child(1) {
    grid-row: 1 / 3;
  }
}

/* ============================================================================
   DATA TABLE
   ============================================================================ */

.data-table-container {
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-wrapper {
  overflow-x: auto;
  flex: 1;
}

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

.data-table thead {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-bottom: 2px solid #667eea;
}

.table-header-cell {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: white;
  user-select: none;
}

.header-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sort-icon {
  font-size: var(--font-size-xs);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.table-header-cell:hover .sort-icon {
  opacity: 1;
}

.table-body {
  display: contents;
}

.table-row {
  border-bottom: 1px solid var(--color-light-gray);
  transition: background-color var(--transition-fast);
}

.table-row:nth-child(even) {
  background-color: #f8f9fa;
}

.table-row:hover {
  background-color: #f0f0f0;
}

.table-cell {
  padding: var(--spacing-md);
  color: var(--color-dark-gray);
  word-break: break-word;
}

/* Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-top: 1px solid var(--color-light-gray);
  background-color: #f8f9fa;
}

.pagination-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pagination-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

.page-info {
  font-size: var(--font-size-sm);
  color: var(--color-dark-gray);
  font-weight: var(--font-weight-medium);
  min-width: 120px;
  text-align: center;
}

/* Responsive table on mobile */
@media (max-width: 480px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  .table-header-cell,
  .table-cell {
    padding: var(--spacing-sm);
    font-size: var(--font-size-xs);
  }
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-message {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--color-medium-gray);
  font-size: var(--font-size-base);
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  margin: var(--spacing-md);
}

/* ============================================================================
   RESPONSIVE LAYOUT
   ============================================================================ */

@media (max-width: 480px) {
  .dashboard-section {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 481px) and (max-width: 768px) {
  .dashboard-section {
    padding: var(--spacing-md);
    gap: var(--spacing-md);
  }

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .dashboard-section {
    padding: var(--spacing-lg);
    gap: var(--spacing-lg);
  }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================================
   RECENT PROJECTS SECTION
   ============================================================================ */

.recent-projects-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.recent-projects-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-gray);
  margin: 0;
  padding: 0;
}

.recent-projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  width: 100%;
}

.recent-projects-empty-state {
  grid-column: 1 / -1;
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--color-medium-gray);
  font-size: var(--font-size-base);
  background: var(--color-light-gray);
  border-radius: var(--radius-md);
}

/* ============================================================================
   RECENT PROJECT CARD
   ============================================================================ */

.recent-project-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--color-white);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.recent-project-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #e0e0e0;
}

.recent-project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.recent-project-card-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-gray);
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.recent-project-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  flex-shrink: 0;
}

.recent-project-status-active {
  background: rgba(127, 255, 0, 0.15);
  color: #5a8c00;
  border: 1px solid rgba(127, 255, 0, 0.3);
}

.recent-project-status-on-hold {
  background: rgba(255, 152, 0, 0.15);
  color: #e65100;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.recent-project-status-completed {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.recent-project-status-pending {
  background: rgba(158, 158, 158, 0.15);
  color: #666;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* ============================================================================
   RECENT PROJECT PROGRESS
   ============================================================================ */

.recent-project-progress-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.recent-project-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--color-medium-gray);
  font-weight: var(--font-weight-medium);
}

.recent-project-progress-value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-gray);
}

.recent-project-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-light-gray);
  border-radius: 3px;
  overflow: hidden;
}

.recent-project-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan-blue) 0%, #00a8cc 100%);
  border-radius: 3px;
  transition: width var(--transition-base);
}

/* ============================================================================
   RECENT PROJECT UPDATE INFO
   ============================================================================ */

.recent-project-update-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--spacing-sm);
  border-top: 1px solid #f0f0f0;
  font-size: var(--font-size-sm);
  color: var(--color-medium-gray);
}

.recent-project-update-label {
  font-weight: var(--font-weight-medium);
}

.recent-project-update-date {
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark-gray);
}

/* ============================================================================
   RESPONSIVE LAYOUT
   ============================================================================ */

@media (max-width: 1024px) {
  .recent-projects-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .recent-projects-section {
    padding: var(--spacing-md);
  }

  .recent-projects-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm);
  }

  .recent-project-card {
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
  }

  .recent-project-card-name {
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .recent-projects-section {
    padding: var(--spacing-md);
  }

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

  .recent-project-card {
    padding: var(--spacing-md);
  }

  .recent-project-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .recent-project-status-badge {
    align-self: flex-start;
  }
}
