:root {
  --border: #3a3a44;
  --charcoal-light: #25252d;
  --charcoal-lighter: #2f2f3a;
  --charcoal: #1a1a1f;
  --error-red-bg: rgba(239, 68, 68, 0.1);
  --error-red: #ef4444;
  --green-dark: #059669;
  --green: #10b981;
  --purple-dark: #6d28d9;
  --purple-light: #a78bfa;
  --purple: #8b5cf6;
  --sidebar-width: 260px;
  --text-primary: #e5e5e7;
  --text-secondary: #9ca3af;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--charcoal-light);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  animation: slideInLeft 0.4s ease;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.sidebar-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  padding: 0 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.nav-items {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.nav-link[aria-current=page] {
  background: rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
}

.nav-link[aria-current=page]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(135deg, var(--purple), var(--green));
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  margin-left: auto;
  background: var(--purple);
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

/* Bottom nav */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 1.5rem;
}

/* Healthcheck indicator */
.sidebar-healthcheck {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.sidebar-healthcheck:hover {
  color: var(--text-primary);
}

.healthcheck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.healthcheck-ok {
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
}

.healthcheck-error {
  background: var(--red, #ef4444);
  box-shadow: 0 0 4px var(--red, #ef4444);
}

.healthcheck-warning {
  background: var(--yellow, #f59e0b);
  box-shadow: 0 0 4px var(--yellow, #f59e0b);
}

.healthcheck-loading {
  background: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}
.healthcheck-text {
  white-space: nowrap;
}

.healthcheck-version {
  margin-left: auto;
  opacity: 0.7;
}

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

body {
  font-family: "Outfit", sans-serif;
  background: var(--charcoal);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-inner {
  padding: 1rem 2rem;
}

/* Top bar */
.top-bar {
  background: var(--charcoal-light);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  min-width: 300px;
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  width: 100%;
}

.search-bar input:focus {
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.icon-button {
  width: 40px;
  height: 40px;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-button:hover {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.1);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--charcoal-light);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu:hover {
  border-color: var(--purple);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Content area */
.content {
  padding: 2rem;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--charcoal-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.stat-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon {
  width: 36px;
  height: 36px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--purple);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 0.5rem;
}

.stat-change {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--green);
}

.stat-change.negative {
  color: #ef4444;
}

/* Content sections */
.content-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

/* Card */
.card {
  background: var(--charcoal-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Table */
.table-container {
  overflow-x: auto;
}

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

thead {
  background: var(--charcoal);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(139, 92, 246, 0.05);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.status-badge.offline {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 999;
}

@media (max-width: 968px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .search-bar {
    min-width: auto;
    width: 100%;
  }
  .top-bar {
    padding: 1rem;
  }
  .top-bar-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .content {
    padding: 1rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .user-info {
    display: none;
  }
}
