:root {
  color-scheme: dark light;
  --bg: #101412;
  --fg: #e8ede5;
  --surface: #151a16;
  --hover: #1b221c;
  --muted: #a2b09f;
  --border: #ffffff16;
  --accent: #34d399;
  --error: #fda4af;
  --sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f4;
    --fg: #1a1f1a;
    --surface: #fff;
    --hover: #e8ece8;
    --muted: #526052;
    --border: #d8e0d8;
    --accent: #047857;
    --error: #b91c1c;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
}
a {
  color: var(--accent);
}
button,
input {
  font: inherit;
}
button,
.button {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 15px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--hover);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}
input[type="file"] {
  font-size: 0.85rem;
}
label {
  display: block;
  margin: 16px 0 5px;
  font-weight: 600;
}
form button {
  margin-top: 16px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--surface);
  padding: 12px;
  z-index: 2;
}
.skip:focus {
  top: 12px;
}
.topbar,
main,
footer {
  max-width: 1240px;
  margin: auto;
  padding: 24px;
}
.topbar,
.topbar nav,
.actions,
.section-heading,
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--fg);
  text-decoration: none;
}
.brand span {
  color: var(--accent);
  margin-left: 7px;
}
.topbar {
  border-bottom: 1px solid var(--border);
}
h1,
h2,
h3,
p {
  margin: 0 0 14px;
}
h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
.eyebrow {
  font: 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
}
.page-heading {
  margin: 20px 0 24px;
}
.panel,
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.panel {
  margin-bottom: 20px;
}
.auth {
  max-width: 560px;
  margin: 32px auto;
}
.muted,
.fine,
.panel > p {
  color: var(--muted);
}
.fine {
  font-size: 0.82rem;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.tile .value {
  display: block;
  font: 600 1.9rem var(--mono);
  margin-top: 8px;
}
.tile .label {
  color: var(--muted);
  font-size: 0.85rem;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.error {
  color: var(--error);
}
.state {
  padding: 24px 0;
  color: var(--muted);
}
.quota {
  margin: 12px 0 20px;
}
.quota progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
  margin: 8px 0;
}
.quota small {
  color: var(--muted);
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 500;
}
td .quota {
  min-width: 160px;
  margin: 0;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover {
  background: var(--hover);
}
.tenant-link {
  border: 0;
  padding: 4px 0;
  background: none;
  color: var(--accent);
  font-family: var(--mono);
}
.pill {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
}
.pill.active {
  color: var(--accent);
}
.pill.suspended,
.pill.deleted {
  color: var(--error);
}
code,
pre {
  font-family: var(--mono);
}
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}
dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 18px;
  font-size: 0.9rem;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
  color: var(--muted);
}
.chart text {
  fill: currentColor;
  font: 12px var(--mono);
}
.chart .bar {
  fill: var(--accent);
}
.chart .bar:hover,
.chart .bar:focus {
  opacity: 0.65;
}
.chart .grid {
  stroke: var(--border);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}
#notice:not(:empty) {
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  overflow-wrap: anywhere;
}
#detail {
  border-color: var(--accent);
}
@media (max-width: 600px) {
  .topbar,
  main,
  footer {
    padding: 16px;
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 16px;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tile {
    padding: 14px;
  }
  .tile .value {
    font-size: 1.5rem;
  }
  .topbar nav {
    gap: 10px;
    font-size: 0.85rem;
  }
  .section-heading {
    align-items: flex-start;
  }
}
