:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #f6f7f9;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: #1768ac;
  color: #fff;
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

button:hover {
  background: #10558f;
}

button.secondary {
  background: #e8edf2;
  color: #17202a;
}

button.secondary:hover {
  background: #dce4ec;
}

button.danger {
  background: #c43c38;
}

button.danger:hover {
  background: #a8322f;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  padding: 8px 10px;
}

input:focus {
  border-color: #1768ac;
  outline: 2px solid rgba(23, 104, 172, 0.18);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
  margin-top: 12vh;
  padding: 32px;
  border: 1px solid #dde5ed;
  border-radius: 8px;
  background: #fff;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: #1768ac;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

.muted {
  margin: 0;
  color: #607086;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 14px;
}

.toolbar,
.table-wrap {
  border: 1px solid #dde5ed;
  border-radius: 8px;
  background: #fff;
}

.toolbar {
  padding: 18px;
  margin-bottom: 18px;
}

.agent-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) minmax(150px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.checkline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  color: #334155;
}

.checkline input {
  width: 18px;
  min-height: 18px;
}

.message,
.error {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 14px;
}

.error {
  color: #b42318;
}

.message {
  color: #1768ac;
}

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

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

th,
td {
  border-bottom: 1px solid #e6edf3;
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #607086;
  font-size: 13px;
  font-weight: 700;
  background: #fbfcfd;
}

td {
  color: #263241;
}

.domain-line {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.domain {
  color: #174a74;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.domain:hover {
  text-decoration: underline;
}

.copy-button {
  min-height: 30px;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: #334155;
  padding: 0 10px;
}

.copy-button:hover {
  background: #f1f5f9;
}

.code {
  display: inline-block;
  border-radius: 5px;
  background: #eef5fb;
  color: #174a74;
  font-family: "Cascadia Mono", Consolas, monospace;
  padding: 4px 7px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status.enabled {
  background: #e7f6ed;
  color: #166534;
}

.status.disabled {
  background: #f1f5f9;
  color: #64748b;
}

.actions {
  display: flex;
  gap: 8px;
}

.empty {
  padding: 42px 16px;
  text-align: center;
  color: #607086;
}

@media (max-width: 860px) {
  .login-panel {
    grid-template-columns: 1fr;
    margin-top: 24px;
    padding: 22px;
  }

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

  .agent-form {
    grid-template-columns: 1fr;
  }
}
