@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* --- HSL DESIGN TOKENS (PROFESSIONAL MEDICAL PALETTE) --- */
  --hull-h: 220;
  --hull-s: 16%;
  --hull-l: 97%;

  --hull-dark-h: 222;
  --hull-dark-s: 47%;
  --hull-dark-l: 11%;

  /* Accents */
  --accent-cyan-h: 199;
  --accent-cyan-s: 89%;
  --accent-cyan-l: 48%;

  --accent-purple-h: 262;
  --accent-purple-s: 83%;
  --accent-purple-l: 58%;

  --accent-green-h: 160;
  --accent-green-s: 84%;
  --accent-green-l: 39%;

  /* Semantic Mappings */
  --base-bg: #f8f9fb;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --glass-bg: rgba(255, 255, 255, 0.6);
  
  --accent-cyan: hsl(var(--accent-cyan-h), var(--accent-cyan-s), var(--accent-cyan-l));
  --accent-cyan-soft: hsla(var(--accent-cyan-h), var(--accent-cyan-s), var(--accent-cyan-l), 0.07);
  --accent-cyan-glow: hsla(var(--accent-cyan-h), var(--accent-cyan-s), var(--accent-cyan-l), 0.25);

  --accent-purple: hsl(var(--accent-purple-h), var(--accent-purple-s), var(--accent-purple-l));
  --accent-purple-soft: hsla(var(--accent-purple-h), var(--accent-purple-s), var(--accent-purple-l), 0.08);

  --accent-green: hsl(var(--accent-green-h), var(--accent-green-s), var(--accent-green-l));
  --accent-green-soft: hsla(var(--accent-green-h), var(--accent-green-s), var(--accent-green-l), 0.08);

  --alert-red: hsl(4, 90%, 58%);
  --warning-amber: hsl(38, 92%, 50%);

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Effects */
  --hull-glass: rgba(255, 255, 255, 0.85);
  --glass-blur: blur(16px);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-premium: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
  --transition-snappy: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  --topbar-height: 64px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--base-bg);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism Utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Glow Effects */
.glow-cyan {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.glow-green {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.glow-red {
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.glow-amber {
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.glow-text-cyan {
  text-shadow: 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Common Layout Components */
.dashboard-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.page-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.page-container::-webkit-scrollbar {
  width: 6px;
}

.page-container::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 10px;
}

/* 4K UI Limits Wrapper */
.page-content-wrapper {
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

/* Responsive Grid Layouts */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 24px;
  height: auto;
  min-height: calc(100% - 140px);
}

.main-grid > * {
  min-width: 0;
}

/* Responsive Breakpoints */
@media (max-width: 1400px) {
  .main-grid {
    grid-template-columns: 1fr 1fr;
  }
  .main-grid > *:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 72px;
  }
  .sidebar-label {
    display: none !important;
  }
  .main-grid {
    grid-template-columns: 1fr;
  }
  .main-grid > *:last-child {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 16px;
  }
  .stats-bar {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* Pulse Animation */
@keyframes pulse-red {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse-dot-red {
  width: 8px;
  height: 8px;
  background-color: var(--alert-red);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
  animation: pulse-red 2s infinite ease-in-out;
}

@keyframes pulse-cyan {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse-dot-cyan {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  animation: pulse-cyan 2s infinite ease-in-out;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.05), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 100;
}

/* Scrollbar Hide for specific panels if needed */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hover-glow {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

.spin-slow {
  animation: spin 8s linear infinite;
}

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

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

.spin {
  animation: spin 1s linear infinite;
}

.table-row-hover {
  transition: all 0.2s ease;
}

.table-row-hover:hover {
  background: rgba(59, 130, 246, 0.04) !important;
}

.input-glow:focus {
  outline: none;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

/* Global Dropdown Styling */
select, select option {
  color: var(--text-primary);
  background-color: var(--card-bg);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── PREMIUM ADMIN DASHBOARD STYLES ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-header-premium {
  position: relative;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, hsla(210, 40%, 98%, 0.8), hsla(0, 0%, 100%, 0.95));
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-header-premium h2 {
  font-size: 1.8rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.premium-stat-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.premium-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(59, 130, 246, 0.2);
}

.premium-stat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.premium-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 750;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.premium-stat-value {
  font-size: 2rem;
  font-weight: 850;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.premium-stat-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.premium-health-card {
  background: hsla(210, 40%, 98%, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.premium-health-card:hover {
  background: #fff;
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.08);
}

.health-status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 1200px) {
  .dashboard-primary-grid, .dashboard-secondary-grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================================================================
   GLOBAL SIDEBAR (PROFESSIONAL LIGHT DESIGN)
   ========================================================================== */
.sidebar-premium {
  background: #ffffff !important;
  border-right: 1px solid #edf2f7 !important;
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.03);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sidebar-logo-text {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 2px 12px;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 8px;
  border: none;
  border-left: none;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-nav-item:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-nav-item.active {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-nav-item.active::before {
  display: none;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 48px;
  margin: 1px 12px;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px;
  transition: all 0.15s ease;
  border: none;
  border-left: none;
}

.sidebar-sub-item:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-sub-item.active {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-sub-item.active::before {
  display: none;
}
