/* ------------------------------------
   AegisOps Global Design Tokens
------------------------------------ */
:root {
  /* Color Palette - Premium Engineering Vibe */
  --bg-dark: #07090f;          /* Deepest background */
  --bg-surface: #0f1423;       /* Card/Panel surface */
  --bg-surface-elevated: #1a2235; /* Hover/Active states */
  
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #cbd5e1;

  --accent-blue: #3b82f6;      /* Primary actionable */
  --accent-blue-glow: rgba(59, 130, 246, 0.4);
  
  --status-normal: #10b981;    /* Emerald */
  --status-warning: #f59e0b;   /* Amber */
  --status-critical: #ef4444;  /* Rose */

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Borders & Shadows */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 15px var(--accent-blue-glow);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ------------------------------------
   Layout Utilities
------------------------------------ */
.container {
  max-w-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { 
    grid-template-columns: 1fr; 
  }
}

/* ------------------------------------
   Typography Utilities
------------------------------------ */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.125rem; font-weight: 600; }
.text-xl { font-size: 1.5rem; font-weight: 700; }
.text-2xl { font-size: 2rem; font-weight: 800; }
.text-3xl { font-size: 2.5rem; font-weight: 800; tracking: -0.02em; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-blue); }

.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* ------------------------------------
   Components
------------------------------------ */

/* Navigation */
.navbar {
  background-color: rgba(15, 20, 35, 0.85); /* rgba surface */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--space-md) 0;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background-color: #242f48;
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover.interactive {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid;
}

.badge-normal {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--status-normal);
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--status-warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.badge-critical {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--status-critical);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge-outline {
  background-color: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

/* Big Metrics */
.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Utility Animations */
@keyframes pulse-subtle {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}
.animate-pulse {
  animation: pulse-subtle 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-elevated) 25%, #242f48 50%, var(--bg-surface-elevated) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
