:root {
  --bg: #050913;
  --panel: #0b1226;
  --panel-strong: #101a33;
  --border: #1f2d4f;
  --accent: #7fffd4;
  --accent-2: #92a5ff;
  --text: #edf3ff;
  --muted: #8ea2c5;
  --danger: #ff6b6b;
  --success: #2dd4bf;
  --warning: #f6c858;
  --radius: 14px;
  --shadow: 0 18px 80px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 10% 0%, rgba(146,165,255,.12), transparent 50%),
    radial-gradient(900px 700px at 80% 10%, rgba(125,255,230,.12), transparent 55%),
    linear-gradient(180deg, var(--bg), #040710 60%, #02040a);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(10, 16, 33, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0cf, #82ffe0);
  display: grid; place-items: center;
  font-weight: 700; color: #050913;
}
.brand-title { font-weight: 700; letter-spacing: .5px; }
.brand-sub { color: var(--muted); font-size: 12px; }

.header-actions { display: flex; gap: 10px; align-items: center; }
.user-pill {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
}

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 70px); }
.sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #070c1c, #080d22 50%, #060918);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nav-title { text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--muted); }
.nav-link {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border .2s, transform .2s, background .2s;
  margin-bottom: 10px;
}
.nav-link:hover { border-color: var(--accent); transform: translateX(2px); }
.nav-link.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(127,255,212,.4); background: #0f1a33; }
.nav-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.nav-tip { color: var(--muted); font-size: 12px; }

.content { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.notifications { display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #0e1833; color: var(--text); }
.toast.error { border-color: var(--danger); color: #ffd7d7; }
.toast.success { border-color: var(--success); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--muted); }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.field input, .field textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #061025;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.button.danger { background: linear-gradient(120deg, var(--danger), #ff9b8b); color: #220202; }

.chip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: #101a33; font-size: 12px; }
.chip.muted { color: var(--muted); }
.tag { padding: 4px 8px; border-radius: 8px; background: #0f1933; border: 1px solid var(--border); color: var(--muted); font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--panel-strong); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .badge { padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.card-footer { color: var(--muted); font-size: 12px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.status { padding: 6px 10px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.status.online { background: rgba(45,212,191,.1); color: var(--success); }
.status.degraded { background: rgba(246,200,88,.1); color: var(--warning); }
.status.offline { background: rgba(255,107,107,.12); color: var(--danger); }

.metric-bar { height: 6px; background: #0d152b; border-radius: 999px; position: relative; overflow: hidden; }
.metric-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; }

.logs { display: grid; gap: 10px; }
.log-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #0f1a33; display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.log-row .muted { font-size: 12px; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 60px; z-index: 5; }
  .log-row { grid-template-columns: 1fr; }
}
