:root {
  --bg: #0f172a;
  --panel: #111827;
  --line: #243044;
  --txt: #e5e7eb;
  --muted: #94a3b8;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --gray: #64748b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top right, #1e293b, var(--bg));
  color: var(--txt);
}

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

.header h1 { margin: 0; font-size: 1.5rem; }
.status { display: flex; gap: 12px; align-items: center; color: var(--muted); }

.layout {
  padding: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: 2fr 2fr 1.3fr;
  grid-template-areas:
    "kpi kpi kpi"
    "inventory inventory reads"
    "inventory inventory unreg";
}

.card {
  background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(17,24,39,.85));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}
.card h2 { margin-top: 0; }

.kpi { grid-area: kpi; }
.kpi-number { font-size: 4rem; font-weight: 800; line-height: 1; }
.kpi-sub { display: flex; gap: 24px; color: var(--muted); font-size: 1.1rem; }

.table-wrap { overflow: auto; max-height: 60vh; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: .95rem; }

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow: auto;
}

.list li {
  background: rgba(15, 23, 42, .7);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  line-height: 1.3;
}

.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.in { background: rgba(22,163,74,.2); color: #86efac; }
.badge.out { background: rgba(220,38,38,.2); color: #fca5a5; }
.badge.ignored { background: rgba(100,116,139,.2); color: #cbd5e1; }
.badge.registered { background: rgba(22,163,74,.15); color: #86efac; }
.badge.unregistered { background: rgba(245,158,11,.15); color: #fcd34d; }

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: "kpi" "inventory" "reads" "unreg";
  }
}
