:root {
  --bg: #050816;
  --bg-elevated: #0b1020;
  --accent: #3b82f6;
  --accent-soft: #1d4ed8;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
  --border: #1f2937;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

body {
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  color: var(--text);
  min-height: 100vh;
}

/* Layout base */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #3b82f6, #22c55e 45%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 0 22px rgba(59, 130, 246, 0.7);
}

.brand-text-title {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Nav */
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item button {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  transition: 0.18s ease;
}

.nav-item button:hover {
  background: rgba(30, 64, 175, 0.4);
  color: var(--text);
}

.nav-item button.active {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.nav-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.15);
  color: #6ee7b7;
}

/* Bottom sidebar */
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.logout-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.16s ease;
}

.logout-btn:hover {
  border-color: var(--danger);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.4);
}

/* Main */
.main {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left-title {
  font-size: 22px;
  font-weight: 600;
}

.topbar-left-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-status {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.2);
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Cards layout */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 14px 14px 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.metric {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}

/* Table */
.table-wrapper {
  margin-top: 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: rgba(15, 23, 42, 0.9);
}

th, td {
  padding: 9px 12px;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.7);
}

.status-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-ok {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
}

.status-down {
  background: rgba(220, 38, 38, 0.18);
  color: #fecaca;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 22px;
  border: 1px solid var(--border);
  padding: 24px 22px 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.9);
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.input-group {
  margin-bottom: 10px;
}

.input-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.input-field {
  width: 100%;
  padding: 8px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
}

.primary-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 999px;
  padding: 9px 12px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.7);
  transition: 0.18s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(79, 70, 229, 0.8);
}

.error-box {
  font-size: 12px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.4);
  border-radius: 14px;
  padding: 6px 9px;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .sidebar-bottom {
    display: none;
  }
}
