:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --line: #dfe3e6;
  --line-strong: #c7cdd2;
  --text: #1f252b;
  --muted: #69727c;
  --soft: #eef1f3;
  --accent: #2563eb;
  --danger: #c2410c;
  --ok: #15803d;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  min-height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.danger {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  min-height: 30px;
  padding: 6px 8px;
  outline: none;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.login {
  width: 360px;
  margin: 16vh auto 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login h1,
.page h1 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
}

.login p {
  margin: 0 0 14px;
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 0;
}

.nav {
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  padding: 10px;
}

.nav button {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 6px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.nav button.active {
  background: var(--soft);
  border-color: var(--line);
}

.content {
  padding: 14px;
  overflow: auto;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: 420px 1fr;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

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

.lookup-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.lookup-form .field {
  margin-bottom: 0;
}

.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.user-card-name {
  font-size: 15px;
  font-weight: 700;
}

.empty-tip {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  background: #fbfcfd;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 600;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 22px;
  padding: 0 8px;
  background: #fff;
  color: var(--muted);
}

.pill.ok {
  color: var(--ok);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.pill.off {
  color: var(--danger);
  border-color: #fed7aa;
  background: #fff7ed;
}

.muted {
  color: var(--muted);
}

.notice {
  margin: 10px 0 0;
  color: var(--muted);
}

.error {
  color: var(--danger);
}

.success {
  color: var(--ok);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quota-grid {
  display: grid;
  grid-template-columns: 90px repeat(3, 1fr);
  gap: 8px;
  align-items: center;
}

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

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.truncate {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
