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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.6;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #1e293b;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

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

.dashboard-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
}

.date-range-selector {
  display: flex;
  gap: 0.5rem;
  background: #1e293b;
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.date-range-selector button {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.date-range-selector button:hover {
  background: #334155;
  color: #e2e8f0;
}

.date-range-selector button.active {
  background: #3b82f6;
  color: white;
}

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

.stat-card {
  background: #1e293b;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content h3 {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #3b82f6;
}

.appointments-section {
  background: #1e293b;
  border-radius: 0.75rem;
  border: 1px solid #334155;
  padding: 1.5rem;
}

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

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f1f5f9;
}

.refresh-btn {
  padding: 0.5rem 1rem;
  background: #334155;
  color: #e2e8f0;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: #475569;
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment-card {
  background: #0f172a;
  padding: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}

.appointment-card:hover {
  border-color: #3b82f6;
}

.appointment-info h4 {
  font-size: 1.125rem;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.appointment-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.appointment-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.view-btn {
  padding: 0.5rem 1rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.view-btn:hover {
  background: #2563eb;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

@media (max-width: 768px) {
  .dashboard {
    padding: 1rem;
  }
  
  .appointment-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .appointment-actions {
    width: 100%;
    justify-content: space-between;
  }
}
