:root {
  color-scheme: light;
  --bg: #f5f8fb;
  --panel: rgba(255, 255, 255, 0.84);
  --text: #172033;
  --muted: #657086;
  --line: rgba(23, 32, 51, 0.1);
  --blue: #1aa7ec;
  --green: #22bba9;
  --orange: #ff9d5c;
  --red: #ee5d64;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.92), rgba(240, 249, 255, 0.74) 34%, rgba(255, 249, 238, 0.74) 62%, rgba(243, 255, 248, 0.9)),
    linear-gradient(42deg, #6ddcff, #ffb26b 34%, #74f2ce 66%, #bda3ff);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.page {
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.16;
}

h2 {
  font-size: 20px;
}

.ghost-button {
  min-width: 88px;
  height: 40px;
  color: var(--text);
  font-weight: 800;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 28px rgba(36, 62, 98, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.login-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(36, 62, 98, 0.14);
  backdrop-filter: blur(20px);
}

.stat-card {
  min-height: 112px;
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

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

.stat-card strong.small {
  font-size: 16px;
  line-height: 1.35;
}

.layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settings-form,
.login-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #435069;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.82);
}

input:focus,
select:focus {
  border-color: rgba(26, 167, 236, 0.72);
  box-shadow: 0 0 0 4px rgba(26, 167, 236, 0.12);
}

.settings-form button,
.login-form button {
  height: 46px;
  margin-top: 4px;
  color: white;
  font-weight: 900;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--blue), var(--green) 56%, var(--orange));
  box-shadow: 0 14px 34px rgba(34, 187, 169, 0.28);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #4b5872;
  font-size: 12px;
  font-weight: 900;
  background: rgba(247, 251, 255, 0.8);
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.ok {
  background: var(--green);
}

.badge.bad {
  background: var(--red);
}

.badge.warn {
  background: var(--orange);
}

.message {
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 96px);
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.brand {
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.login-card h1 {
  margin-top: 10px;
  font-size: 28px;
}

.login-card p {
  margin: 12px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.alert {
  margin-bottom: 16px;
  padding: 12px;
  color: #8f2730;
  border-radius: 8px;
  background: rgba(238, 93, 100, 0.12);
}

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

  .settings-panel,
  .history-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .page {
    width: min(100vw - 24px, 1480px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
