:root {
  color-scheme: dark;
  --black: #030303;
  --panel: #101010;
  --panel-strong: #171717;
  --line: #343434;
  --yellow: #f0b808;
  --muted: #c6c0b4;
  --white: #f8f8f8;
  --green: #7cff9e;
  --red: #ff4d3d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input { font: inherit; }
button {
  min-height: 42px;
  border: 1px solid rgba(240, 184, 8, .55);
  border-radius: 8px;
  background: var(--yellow);
  color: #000;
  font-weight: 900;
  padding: 0 16px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease, opacity .12s ease;
}

button:hover,
button:focus-visible {
  filter: brightness(1.08);
  border-color: rgba(240, 184, 8, .95);
}

button:active,
.button-pressed {
  transform: translateY(1px) scale(.99);
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
  transform: none;
}

.is-loading {
  position: relative;
  overflow: hidden;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px 10px;
  height: 2px;
  background: rgba(0, 0, 0, .5);
  animation: loadingBar 1s linear infinite;
}

@keyframes loadingBar {
  from { transform: translateX(-70%); }
  to { transform: translateX(70%); }
}

.secondary {
  background: var(--panel);
  color: var(--yellow);
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

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

.toast-tray {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  min-height: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .42);
}

.toast.ok {
  border-color: rgba(124, 255, 158, .7);
}

.toast.bad {
  border-color: rgba(255, 77, 61, .75);
}

.shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 24px);
}

.hero {
  min-height: 74px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.hero img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.hero strong,
.hero span {
  display: block;
}

.hero strong {
  color: var(--yellow);
  font-size: 17px;
}

.hero span,
.panel p,
.notice span {
  color: var(--muted);
}

.panel,
.metric,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login {
  width: min(420px, 100%);
  margin: 9vh auto 0;
  padding: 18px;
}

.login h1 {
  margin: 0 0 8px;
  color: var(--yellow);
}

.login form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.login input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070707;
  color: var(--white);
  padding: 0 12px;
}

.login small {
  display: block;
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
}

.notice {
  display: grid;
  gap: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.notice strong {
  color: var(--yellow);
}

.feed-actions {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(160px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.feed-actions label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.feed-actions input[type="number"] {
  height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070707;
  color: var(--white);
  padding: 0 10px;
}

.inline-check {
  min-height: 42px;
  align-content: center;
  grid-template-columns: auto minmax(0, 1fr);
  text-transform: none !important;
}

.feed-summary {
  min-height: 20px;
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
}

.feed-table-wrap {
  margin-top: 10px;
}

.muted-row {
  opacity: .62;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.25;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  min-height: 92px;
  padding: 12px;
  display: grid;
  align-content: space-between;
}

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

.metric strong {
  font-size: 24px;
}

.metric.warn { border-color: rgba(240, 184, 8, .65); }
.metric.bad { border-color: rgba(255, 77, 61, .65); }

.panel {
  padding: 14px;
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

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

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid #272727;
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--yellow);
  background: var(--panel-strong);
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #000;
  padding: 3px 8px;
  font-weight: 900;
  font-size: 12px;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.server-grid article {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 10px;
  display: grid;
  align-content: space-between;
}

.server-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
}

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .hero img {
    width: 44px;
    height: 44px;
  }

  .hero button {
    grid-column: 1 / -1;
  }

  .feed-actions {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    padding: 10px;
    border-bottom: 1px solid #272727;
  }

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

  td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--yellow);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }
}
