:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --border: #dde1e8;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok-bg: #e7f6ec;
  --ok-text: #1a6b35;
  --err-bg: #fdecec;
  --err-text: #a32020;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b;
    --surface: #1a1f28;
    --text: #e6e9ef;
    --muted: #9aa3b5;
    --border: #2c3340;
    --accent: #4c8dff;
    --ok-bg: #143322;
    --ok-text: #7fd69e;
    --err-bg: #3a1818;
    --err-text: #ff9b9b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 650; }
.env {
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  background: #f5a623;
  color: #1d2330;
}
.env:empty { display: none; }
.account { display: flex; gap: 0.75rem; align-items: center; color: var(--muted); font-size: 0.9rem; min-width: 0; }
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem; }
.center { text-align: center; padding-top: 12vh; }
h1 { margin: 0 0 1rem; font-size: 1.75rem; }
h2 { margin: 0; font-size: 1.1rem; }
.muted { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
input[type="text"] {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button { font: inherit; cursor: pointer; }
button.primary {
  padding: 0.6rem 1.2rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
button.primary:disabled { opacity: 0.6; cursor: progress; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }

.notice { margin: 0.75rem 0 0; padding: 0.5rem 0.75rem; border-radius: 8px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.error { background: var(--err-bg); color: var(--err-text); }
.center .notice { display: inline-block; margin-bottom: 1rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-top: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; border-top: 0; }
td.name { white-space: normal; font-weight: 500; }
td.id code { font-size: 0.8rem; color: var(--muted); }
.status { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status.active { background: var(--ok-bg); color: var(--ok-text); }
.status.suspended { background: var(--err-bg); color: var(--err-text); }
