:root {
  /* Palette: Nebula & Glass */
  --primary-color: #6366f1;
  /* Indigo 500 */
  --primary-hover: #4f46e5;
  /* Indigo 600 */
  --accent-color: #8b5cf6;
  /* Violet 500 */

  --bg-body: #f8fafc;
  /* Slate 50 */
  --bg-sidebar: #0f172a;
  /* Slate 900 */

  --text-main: #334155;
  /* Slate 700 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-sidebar: #94a3b8;
  /* Slate 400 */
  --text-sidebar-active: #ffffff;

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --card-radius: 16px;

  /* Status Colors */
  --status-up-bg: #dcfce7;
  --status-up-text: #166534;
  --status-down-bg: #fee2e2;
  --status-down-text: #991b1b;
  --status-warn-bg: #fef3c7;
  --status-warn-text: #92400e;

  --font-main: 'Outfit', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;

  --sidebar-width: 260px;
  --transition-speed: 0.3s;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #1e293b;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--card-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Metric Card (Special variant) */
.metric-card {
  border: none;
  border-radius: var(--card-radius);
  background: white;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Layout */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  padding: 1.5rem;
  transition: all var(--transition-speed);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#sidebar .brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.03em;
}

#sidebar ul.components {
  padding: 0;
  list-style: none;
}

#sidebar ul li {
  margin-bottom: 0.5rem;
}

#sidebar ul li a {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 12px;
  background: transparent;
  transition: all 0.2s ease;
  font-weight: 500;
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
  color: var(--text-sidebar-active);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

#sidebar ul li a i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

#sidebar .sidebar-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  font-weight: 600;
}

/* Content Area */
#content {
  width: 100%;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: all var(--transition-speed);
}

/* Tables */
.table-custom {
  --bs-table-bg: transparent;
}

.table-custom thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem;
}

.table-custom tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  color: var(--text-main);
}

.table-custom tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.5);
}

/* Utilities */
.text-mono {
  font-family: var(--font-mono);
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.shadow-soft {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    margin-left: calc(var(--sidebar-width) * -1);
  }

  #sidebar.active {
    margin-left: 0;
  }

  #content {
    margin-left: 0;
  }
}