:root {
  --bg-app: #050507;
  --bg-sidebar: #0b0b0e;
  --bg-card: #121216;
  --bg-card-hover: #18181d;
  --bg-input: #1f1f25;
  --border-subtle: #2a2a35;
  --primary: #5e6ad2;
  --primary-glow: rgba(94, 106, 210, 0.4);
  --accent: #00f2ff;
  --text-main: #e1e1e6;
  --text-muted: #8d8d99;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex-shrink: 0;
}

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

/* Sidebar Elements */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 40px;
  letter-spacing: 1px;
}

.brand i {
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent));
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

/* Header & Views */
.top-bar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(5, 5, 7, 0.8);
  backdrop-filter: blur(10px);
}

.view-section {
  padding: 30px;
  overflow-y: auto;
  height: calc(100% - 70px);
  animation: fadeIn 0.3s ease-out;
}

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

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

/* Cards & Widgets */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.card.full-height {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.5;
}

.stat-card.unique::before {
  background: var(--accent);
}

.stat-card .icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-main);
}

.stat-card .info {
  display: flex;
  flex-direction: column;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  gap: 20px;
}

.btn-primary-glow {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.btn-primary-glow:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.input-dark,
.dropdown-dark {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
}

/* Tables */
.table-responsive {
  flex-grow: 1;
  overflow: auto;
}

.table-modern {
  width: 100%;
  border-collapse: collapse;
}

.table-modern th {
  background: rgba(255, 255, 255, 0.02);
  padding: 16px 24px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.table-modern td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
}

.table-modern tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Console */
.console-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  height: 100%;
}

.console-logs {
  display: flex;
  flex-direction: column;
}

.log-container {
  flex-grow: 1;
  padding: 20px;
  background: #000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry {
  padding: 4px 8px;
  border-left: 2px solid transparent;
  opacity: 0.8;
}

.log-entry.rx {
  border-left-color: var(--success);
  color: #86efac;
}

.log-entry.tx {
  border-left-color: var(--accent);
  color: #7dd3fc;
}

.log-entry.system {
  border-left-color: var(--text-muted);
  color: var(--text-muted);
}

.badge-live {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.control-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Additions for improved filtering UI */
.filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  min-height: 45px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check-input {
  background-color: var(--bg-input);
  border-color: var(--border-subtle);
  width: 18px;
  height: 18px;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.card-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 15px;
  background: rgba(255, 255, 255, 0.01);
}

/* Pagination dark mode */
.page-link {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.page-link:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-item.disabled .page-link {
  background-color: var(--bg-app);
  color: #444;
}

.header-actions {
  display: flex;
  align-items: center;
}

/* Secondary glow button */
.btn-secondary-glow {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: 0.2s;
}

.btn-secondary-glow:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(94, 106, 210, 0.05);
}