:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --panel-2: #eef5f1;
  --text: #18221d;
  --muted: #637169;
  --line: #d8e0db;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b7791f;
  --danger: #b42318;
  --ok: #16803c;
  --shadow: 0 18px 45px rgba(24, 34, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.actions input {
  width: 190px;
}

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

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

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 26px;
  line-height: 1;
}

.panel {
  margin-top: 14px;
  overflow: hidden;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.panelHeader p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
}

.dot.online {
  background: var(--ok);
}

.dot.offline {
  background: #8b9490;
}

.tableWrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #f8faf8;
}

.statusPill {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.statusPill.online {
  background: var(--ok);
}

.statusPill.offline {
  background: #7a847f;
}

.clientName {
  font-weight: 750;
}

.limitInput {
  width: 96px;
}

.rowActions {
  display: flex;
  gap: 7px;
}

.clearBtn {
  border-color: var(--line);
  background: #ffffff;
  color: var(--danger);
}

.clearBtn:hover {
  border-color: var(--danger);
  background: #fff6f5;
}

.twoCol {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 14px;
}

.console {
  min-height: 190px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  background: #151a17;
  color: #e8f1ec;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.empty {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 880px) {
  .topbar,
  .panelHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions input,
  .actions button {
    flex: 1 1 150px;
  }

  .metrics,
  .twoCol {
    grid-template-columns: 1fr;
  }
}
