:root {
  --bg: #071029;
  --bg-2: #0e1a3b;
  --panel: rgba(13, 24, 55, 0.75);
  --panel-border: rgba(148, 163, 184, 0.22);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-2: #22d3ee;
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 700px at 20% -10%, #1d4ed8 0%, transparent 55%),
              radial-gradient(900px 640px at 92% 5%, #0ea5e9 0%, transparent 60%),
              linear-gradient(145deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.3;
  pointer-events: none;
}

.orb-a {
  width: 320px;
  height: 320px;
  top: 12vh;
  left: -120px;
  background: #3b82f6;
}

.orb-b {
  width: 280px;
  height: 280px;
  bottom: 8vh;
  right: -80px;
  background: #06b6d4;
}

.container {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 16px 44px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #93c5fd;
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.08;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  padding: 8px 12px;
  border-radius: 12px;
}

.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip strong {
  display: block;
  font-size: 13px;
}

.user-chip small {
  color: var(--muted);
  font-size: 11px;
}

.btn {
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .16s ease, opacity .16s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: 1.1fr .9fr;
}

.stat-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-value {
  margin: 8px 0 0;
  font-size: 34px;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 8px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}

input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
}

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

.alert.error {
  background: rgba(127, 29, 29, .35);
  border: 1px solid rgba(239, 68, 68, .45);
}

.alert.success {
  background: rgba(20, 83, 45, .35);
  border: 1px solid rgba(34, 197, 94, .45);
}

.chart-wrap {
  width: 100%;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, .2);
  overflow: hidden;
  margin-bottom: 12px;
}

#trendChart {
  width: 100%;
  height: 220px;
  display: block;
}

.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.top-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  padding-bottom: 8px;
}

.top-list strong {
  display: block;
  font-size: 13px;
}

.top-list small {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  font-size: 13px;
}

th {
  color: #bfdbfe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

a {
  color: #93c5fd;
}

.ellipsis {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge.ok { background: rgba(22, 163, 74, .25); color: #bbf7d0; }
.badge.warn { background: rgba(245, 158, 11, .2); color: #fde68a; }
.badge.bad { background: rgba(220, 38, 38, .24); color: #fecaca; }

.muted { color: var(--muted); }

.landing {
  text-align: center;
  padding: 28px;
}

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
}
