/* Custom dashboard styles with CSS variables integration */
.dashboard-container {
  padding: 1.5rem;
  max-width: 100rem;
  margin: 0 auto;
}

.kpi-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

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

.kpi-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-color);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.alert-item {
  border-left: 4px solid var(--accent-color);
  padding: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.alert-item.urgent {
  background: #fef2f2;
  border-left-color: #dc2626;
}

.alert-item.warning {
  background: #fffbeb;
  border-left-color: #d97706;
}

.alert-item.info {
  background: #eff6ff;
  border-left-color: #2563eb;
}

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

.progress-bar {
  width: 6rem;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-color);
  transition: width 0.3s;
  width: var(--progress, 0%);
}

/* Status badge styles moved to output.css */

.activity-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.125rem;
}

.activity-icon.invoice {
  background: #e8f5e9;
  color: #4caf50;
}

.activity-icon.comment {
  background: #e3f2fd;
  color: #2196f3;
}

.activity-icon.alert {
  background: #fce4ec;
  color: #e91e63;
}

.quick-action {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s;
  font-size: 1.125rem;
}

.quick-action:hover {
  transform: scale(1.1);
  background: var(--accent-color-dark);
}

.quick-action.primary {
  width: 3.75rem;
  height: 3.75rem;
  font-size: 1.5rem;
}

.weather-widget {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

  .project-grid {
    grid-column: span 2;
  }

  .activity-feed {
    grid-column: span 2;
  }
}

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

  .project-grid {
    grid-column: span 1;
  }

  .activity-feed {
    grid-column: span 1;
  }

  .welcome-bar {
    flex-direction: column;
    gap: 1rem;
  }

  /* Charts on mobile stack vertically */
  .grid.grid-cols-1.lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .lg\:col-span-2 {
    grid-column: span 1;
  }

  /* MOBILE FIX: Dashboard container full width */
  .dashboard-container {
    padding: 0.75rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* MOBILE FIX: Fact of the day - text should wrap normally */
  .fact-of-day {
    padding: 0.75rem !important;
  }

  .fact-of-day p {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  /* MOBILE FIX: Weather widget hide on very small screens */
  .weather-widget {
    display: none;
  }

  /* MOBILE FIX: Header should scroll horizontally if needed */
  .header-enhanced {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* MOBILE FIX: KPI cards smaller padding */
  .kpi-card {
    padding: 1rem;
  }

  /* MOBILE FIX: Weather bar — override components.css .card-enhanced > div.mb-2 (0,2,1 specificity) */
  /* Needs .card-enhanced > div.weather-bar (0,2,1) + later source order to win */
  .card-enhanced > div.weather-bar.stats-actions-bar {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0.5rem !important;
  }
  .weather-bar .flex.items-center.gap-3.text-sm {
    display: none;
  }
  .weather-bar .flex.items-center.gap-3.flex-wrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Chart containers - ensure proper rendering */
.chart-container {
  position: relative;
  height: 200px;
  min-height: 200px;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Prevent infinite scroll issues */
body {
  overflow-x: hidden;
}

.dashboard-container {
  max-width: 100%;
  overflow-x: hidden;
}

/* Force reasonable heights for chart sections */
.bg-white.rounded-xl {
  max-height: none;
}

/* Dashboard scroll: handled by inline Tailwind classes in template
   (same pattern as work_bons.html - h-[calc(100vh-280px)] + overflow-y-auto) */

/* Chart container fixed height */
.chart-container {
  height: 200px;
}
