*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(to bottom, #000521, #000000);
  display: flex;
  flex-direction: column;
  color: white;
  position: relative;
  overflow: hidden;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, #000d51 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.content {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  padding-top: 3rem;
  text-align: center;
  background: rgba(13, 16, 23, 0.5);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 0.75rem;
  background: linear-gradient(to right, #546aff, #8494ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: 100%;
  max-width: 1200px;
}

.subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #b7c0ff;
  margin-bottom: 2.5rem;
  max-width: 700px;
  line-height: 1.5;
}

.intro {
  max-width: 800px;
  margin-bottom: 3rem;
}

.intro p {
  font-size: 1.15rem;
  color: #e3e8ff;
  line-height: 1.8;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 2rem;
  background: linear-gradient(to right, #546aff, #8494ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, #546aff, #8494ff);
  border-radius: 3px;
}

.specialties {
  width: 100%;
  max-width: 1200px;
  margin-bottom: 4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.card {
  background: rgba(21, 28, 55, 0.7);
  border: 1px solid rgba(84, 106, 255, 0.3);
  border-radius: 8px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  text-align: center;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(132, 148, 255, 0.6);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.4rem;
  color: #8494ff;
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 1rem;
  color: #c8cee8;
  line-height: 1.6;
}

.cta {
  max-width: 700px;
  margin-bottom: 4rem;
}

.cta p {
  font-size: 1.15rem;
  color: #e3e8ff;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, #546aff, #8494ff);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(84, 106, 255, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(84, 106, 255, 0.5);
}

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

/* --- Top Navigation --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: rgba(0, 5, 33, 0.95);
  border-bottom: 1px solid rgba(84, 106, 255, 0.2);
  backdrop-filter: blur(12px);
}

.nav-link {
  color: #b7c0ff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(84, 106, 255, 0.15);
}

/* push page content below fixed nav */
.container,
.dashboard-page {
  padding-top: 3.5rem;
}

/* --- Dashboard Page --- */
.dashboard-page {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(to bottom, #000521, #000000);
  color: white;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 4rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.last-refresh {
  font-size: 0.85rem;
  color: #8494ff;
}

.refresh-btn {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

/* --- Dashboard Sections --- */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-section {
  margin-bottom: 2.5rem;
}

.dashboard-section .section-title {
  font-size: 1.4rem;
  text-align: left;
  margin-bottom: 1.25rem;
}

.dashboard-section .section-title::after {
  left: 0;
  transform: none;
  width: 40px;
}

/* --- Metric Cards --- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.metric-grid-small {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-width: 600px;
}

.metric-card {
  background: rgba(21, 28, 55, 0.7);
  border: 1px solid rgba(84, 106, 255, 0.25);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(132, 148, 255, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.metric-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #8494ff;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.85rem;
  color: #c8cee8;
  margin-top: 0.25rem;
}

/* --- Progress Bars --- */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-row {
  background: rgba(21, 28, 55, 0.5);
  border: 1px solid rgba(84, 106, 255, 0.15);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #e3e8ff;
  margin-bottom: 0.4rem;
}

.progress-numbers {
  color: #8494ff;
  font-size: 0.85rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(84, 106, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #546aff, #8494ff);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* --- Bar Chart --- */
.chart-container {
  background: rgba(21, 28, 55, 0.5);
  border: 1px solid rgba(84, 106, 255, 0.15);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-height: 200px;
  height: 220px;
}

.bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 40px;
  max-width: 60px;
  height: 100%;
}

.bar-value {
  font-size: 0.75rem;
  color: #8494ff;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.bar-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(to top, #546aff, #8494ff);
  border-radius: 3px 3px 0 0;
  transition: height 0.6s ease;
  min-height: 2px;
}

.bar-label {
  font-size: 0.65rem;
  color: #c8cee8;
  margin-top: 0.35rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* --- Loading & Error --- */
.dashboard-loading,
.dashboard-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(84, 106, 255, 0.2);
  border-top-color: #8494ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-message {
  color: #ff6b6b;
  font-size: 1.1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .bar-chart {
    min-height: 150px;
    height: 170px;
  }
}
