:root {
  color-scheme: dark;
  --bg: #05080c;
  --panel: #0b1118;
  --panel-2: #101923;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3fbff;
  --muted: rgba(243, 251, 255, 0.62);
  --cyan: #00d4ff;
  --green: #60f0b4;
  --red: #ff5a66;
  --amber: #ffc857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 82% 12%, rgba(0, 212, 255, 0.18), transparent 24rem),
    linear-gradient(135deg, #030507, #07111b 52%, #04070b);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #031016;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.admin-page {
  width: min(1420px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
}

.hidden {
  display: none !important;
}

.login-panel,
.data-panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 36%),
    rgba(11, 17, 24, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login-panel {
  width: min(620px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

h1,
h2,
p {
  margin: 0;
}

.login-panel h1,
.dashboard-top h1 {
  margin-top: 18px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-panel p {
  margin-top: 18px;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
}

.token-form {
  margin-top: 24px;
}

.token-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: rgba(96, 240, 180, 0.72);
  box-shadow: 0 0 0 3px rgba(96, 240, 180, 0.12);
}

.status-text {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.status-text.error {
  color: var(--red);
}

.dashboard-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 38px;
  line-height: 1;
}

.stat-card.online strong {
  color: var(--green);
}

.stat-card.offline strong {
  color: var(--red);
}

.content-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.data-panel {
  overflow: hidden;
}

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

.panel-heading h2 {
  font-size: 20px;
}

.panel-heading span {
  min-width: 34px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: rgba(243, 251, 255, 0.86);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill.online {
  background: rgba(96, 240, 180, 0.12);
  color: var(--green);
}

.pill.online::before {
  background: var(--green);
}

.pill.offline {
  background: rgba(255, 90, 102, 0.12);
  color: var(--red);
}

.pill.offline::before {
  background: var(--red);
}

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

@media (max-width: 860px) {
  .dashboard-top,
  .token-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

@media (max-width: 520px) {
  .admin-page {
    width: min(100% - 20px, 1420px);
    padding: 16px 0;
  }

  .login-panel {
    margin-top: 4vh;
    padding: 20px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}
