:root {
  /* Richer, deeper background palette */
  --bg-dark: #020617;
  /* Deep Slate/Black */
  --bg-card: rgba(30, 41, 59, 0.7);
  /* Translucent Slate for Glassmorphism */
  --bg-header: rgba(15, 23, 42, 0.8);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Premium Accents */
  --accent-color: #2dd4bf;
  /* Teal 400 */
  --accent-hover: #14b8a6;
  /* Teal 500 */
  --accent-glow: rgba(45, 212, 191, 0.4);

  /* Status Colors */
  --success-color: #34d399;
  /* Emerald 400 */
  --success-glow: rgba(52, 211, 153, 0.4);
  --danger-color: #f87171;
  /* Red 400 */
  --danger-glow: rgba(248, 113, 113, 0.4);

  /* UX */
  --border-radius: 16px;
  --card-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* Background & Main Layout */
body,
body.dark-mode,
.wrapper,
.content-wrapper,
.main-footer,
.main-header {
  background-color: var(--bg-dark) !important;
  background: radial-gradient(circle at top right, #1e293b 0%, #020617 40%) !important;
  color: var(--text-primary) !important;
  border: none !important;
}

/* Glassmorphism Navbar */
.main-header {
  background: var(--bg-header) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  height: 70px;
  /* Slightly taller */
  position: sticky;
  top: 0;
}

.brand-console {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.nav-link {
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-color) !important;
  text-shadow: 0 0 8px var(--accent-glow);
}

/* Premium Cards */
.hpc-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--card-border);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.hpc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
}

.hpc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.hpc-card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: block;
  opacity: 0.8;
}

/* Typography Scale */
.hpc-big-value {
  font-size: 3rem;
  /* Larger */
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hpc-sub-text {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
  text-shadow: 0 0 10px var(--accent-glow);
}

/* Enhanced Wave Visuals */
.cluster-wave-container {
  height: 220px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.wave-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0) 100%);
  mask-image: url("data:image/svg+xml,%3Csvg preserveAspectRatio='none' viewBox='0 0 1440 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,192L60,170.7C120,149,240,107,360,112C480,117,600,171,720,197.3C840,224,960,224,1080,208C1200,192,1320,160,1380,144L1440,128L1440,320L0,320Z' /%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg preserveAspectRatio='none' viewBox='0 0 1440 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,192L60,170.7C120,149,240,107,360,112C480,117,600,171,720,197.3C840,224,960,224,1080,208C1200,192,1320,160,1380,144L1440,128L1440,320L0,320Z' /%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  z-index: 1;
}

.wave-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg preserveAspectRatio='none' viewBox='0 0 1440 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,192L60,170.7C120,149,240,107,360,112C480,117,600,171,720,197.3C840,224,960,224,1080,208C1200,192,1320,160,1380,144L1440,128' fill='none' stroke='%232dd4bf' stroke-width='4' stroke-linecap='round' /%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: bottom;
  filter: drop-shadow(0 0 8px var(--accent-color));
  z-index: 2;
  opacity: 0.8;
}

/* Table Polish */
.table-minimal {
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  /* Row gaps */
}

.table-minimal thead th {
  border: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-bottom: 1rem;
}

.table-minimal tbody tr {
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
}

.table-minimal tbody tr:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.table-minimal tbody td {
  border: none;
  padding: 1.25rem 1rem;
}

.table-minimal tbody td:first-child {
  border-radius: 8px 0 0 8px;
}

.table-minimal tbody td:last-child {
  border-radius: 0 8px 8px 0;
}

/* Glowing Status Dots */
.status-running {
  box-shadow: 0 0 8px var(--success-glow);
}

.status-stopped {
  box-shadow: 0 0 8px var(--danger-glow);
}


/* Form Inputs */
.form-control {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary) !important;
  backdrop-filter: blur(4px);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: rgba(15, 23, 42, 0.8) !important;
}

/* Premium Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-color) 0%, #14b8a6 100%);
  border: none;
  color: #020617;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-primary:active {
  transform: scale(0.98);
}


.btn-danger {
  background-color: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
  background-color: rgba(248, 113, 113, 0.2);
}

/* Login Page Specifics */
.login-page-modern {
  background-color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-box-modern {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-logo-modern {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.1em;
}

/* Custom Scrollbar for webkit */
::-webkit-scrollbar {
  width: 8px;
  background-color: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background-color: #334155;
  border-radius: 4px;
}

/* Page Transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}