:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --line: #334155;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}
h1, h2 { margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.login { max-width: 420px; margin: 12vh auto; }
input, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
}
input {
  width: 100%;
  padding: 12px;
  background: #0b1220;
  color: var(--text);
  margin-bottom: 10px;
}
button {
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--text); }
button.danger { background: var(--bad); color: #1f0a0a; }
button.warn { background: var(--warn); color: #3b2500; }
.error { color: var(--bad); }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stats article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.stats span { font-size: 28px; font-weight: 800; display: block; }
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: right;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.pending { background: #334155; }
.active { background: #065f46; }
.frozen { background: #7c2d12; }
.expired { background: #3f3f46; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions input { width: 72px; margin: 0; }
.device { font-size: 11px; color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .stats, .charts { grid-template-columns: 1fr; }
}
