:root {
  --bg: #111418;
  --bg-panel: #171b20;
  --bg-card: #1b2027;
  --bg-input: #0e1115;
  --border: #2b323c;
  --border-strong: #3a4450;
  --text: #d7dce2;
  --text-dim: #8b95a3;
  --accent: #6ea8fe;
  --accent-strong: #3d7bd6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.brand-amp {
  color: var(--text-dim);
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity-chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px 60px;
}

.view {
  animation: fadein 0.25s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.boot-status {
  color: var(--text-dim);
  font-family: var(--mono);
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #33270f;
  border: 1px solid #5a4315;
  color: var(--warn);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

.banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  flex: 0 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.auth-card {
  max-width: 520px;
  margin: 22px auto 0;
}

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

.card-title {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.card-head .card-title {
  margin: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-inline {
  flex-direction: row;
  align-items: flex-end;
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.grow {
  flex: 1;
}

.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  font-weight: 600;
}

.field-note {
  font-size: 12.5px;
  color: var(--text-dim);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(61, 123, 214, 0.25);
}

select {
  appearance: auto;
}

.code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 12px;
}

.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #20262d;
  border-color: #4a5560;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.form-error {
  color: var(--err);
  font-size: 13px;
  margin: 0;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.kv span {
  color: var(--text-dim);
}

.kv code {
  font-family: var(--mono);
  color: var(--text);
  text-align: right;
}

.quota-body {
  display: flex;
  flex-direction: column;
}

.meter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.meter {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.meter-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  min-width: 44px;
  text-align: right;
}

.repo-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.repo-list li {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 11px;
}

.repo-list .empty {
  color: var(--text-dim);
  border-style: dashed;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}

.fieldset-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
}

.token-output {
  resize: vertical;
  min-height: 120px;
  word-break: break-all;
  white-space: pre-wrap;
}

.token-result {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.usage-label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.usage-block {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.pg-args {
  resize: vertical;
  font-family: var(--mono);
  font-size: 12.5px;
}

.pg-result {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-badge {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
}

.status-badge.ok {
  color: var(--ok);
  border-color: var(--ok);
}

.status-badge.err {
  color: var(--err);
  border-color: var(--err);
}

.pg-json {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  margin: 0;
}

.pg-envelope {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pg-envelope pre {
  max-height: 220px;
}

/* Tenant Web Console billing & team members cards (#2209). */
.admin-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  margin-right: 12px;
  white-space: nowrap;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

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

.members-table th {
  font-weight: 600;
  color: var(--text-dim);
}

.members-table tbody tr:last-child td {
  border-bottom: none;
}

#billing-result {
  margin-top: 6px;
}
