:root {
  /* Ultra-Modern 2026 Color Palette */
  --primary: #10b981;
  --primary-light: #34d399;
  --primary-dark: #059669;
  --secondary: #00d4ff;
  --accent: #a855f7;
  --danger: #ef4444;

  /* Realistic Depth Colors */
  --bg-base: #0a0e14;
  --bg-elevated: #131920;
  --bg-surface: #1a2332;
  --bg-overlay: #242d3d;

  /* Legacy compatibility */
  --bg-primary: #0a0e14;
  --bg-secondary: #131920;
  --bg-tertiary: #1a2332;

  /* Text Hierarchy */
  --text-primary: #ffffff;
  --text-secondary: #b4bcd0;
  --text-tertiary: #6b7a8f;
  --text-muted: #4a5568;

  /* Glass & Blur */
  --glass-bg: rgba(26, 35, 50, 0.6);
  --glass-border: rgba(16, 185, 129, 0.2);

  /* Shadows for Depth */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);

  /* Glow Effects */
  --glow-primary: 0 0 20px rgba(16, 185, 129, 0.4);
  --glow-secondary: 0 0 20px rgba(0, 212, 255, 0.4);
  --glow-accent: 0 0 20px rgba(168, 85, 247, 0.4);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;

  /* Sidebar */
  --sidebar-width: 280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none;
  /* Firefox */
}

*::-webkit-scrollbar {
  display: none;
  /* Chrome, Edge, Safari */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0a0e14 0%, #131920 50%, #0f1419 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Background Effects */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(0, 212, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: ambientMove 30s ease-in-out infinite;
}

@keyframes ambientMove {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(2%, -2%) rotate(1deg);
  }

  66% {
    transform: translate(-2%, 2%) rotate(-1deg);
  }
}

/* Subtle Grain Texture */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  max-width: none;
}

/* Hide old navbar */
.navbar {
  display: none !important;
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--glass-border);
}

.view-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: var(--shadow-lg), var(--glow-accent);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-online {
  color: var(--primary);
}

.status-offline {
  color: var(--danger);
}

/* Data Table */
.data-table {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: var(--spacing-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: var(--spacing-md);
  color: var(--primary);
  border-bottom: 2px solid rgba(16, 185, 129, 0.2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.data-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.data-table tr:hover td {
  background: rgba(16, 185, 129, 0.05);
  color: var(--text-primary);
}

/* Buttons */
.btn-refresh,
.btn-save {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9375rem;
}

.btn-refresh:hover,
.btn-save:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Form Inputs */
.search-input,
.filter-select {
  background: rgba(13, 17, 23, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  max-width: 300px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus,
.filter-select:focus {
  background: var(--glass-bg);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.filter-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Loading state */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: var(--spacing-xl);
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.875rem;
  }

  .data-table th,
  .data-table td {
    padding: var(--spacing-sm);
  }
}

/* Leaflet Map overrides */
.leaflet-container {
  background: var(--bg-elevated) !important;
  color: var(--text-primary);
}