:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --ink: #18212b;
  --muted: #657381;
  --line: #dbe3e8;
  --accent: #126b61;
  --accent-strong: #0d4f48;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #136c3a;
  --shadow: 0 12px 28px rgba(25, 38, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.15rem;
}

input,
textarea,
select,
button {
  width: 100%;
  font: inherit;
}

input,
textarea,
select {
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

button,
.button-link {
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

code,
pre {
  border-radius: 6px;
  background: #eef3f2;
  color: #12342f;
}

code {
  padding: 0.15rem 0.35rem;
}

pre {
  overflow: auto;
  padding: 1rem;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(120deg, rgba(18, 107, 97, 0.12), rgba(61, 77, 89, 0.08)),
    var(--bg);
}

.auth-shell {
  width: min(430px, 100%);
}

.auth-panel,
.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 2rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  backdrop-filter: blur(12px);
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.topbar form {
  margin: 0;
}

.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.summary-grid,
.grid-two {
  display: grid;
  gap: 1rem;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.compact-summary {
  margin: 1rem 0 0;
}

.compact-summary .metric strong {
  font-size: 1rem;
  word-break: break-word;
}

.grid-two,
.layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}

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

.panel,
.metric {
  padding: 1rem;
}

.panel-title,
.tenant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tenant-head {
  margin-bottom: 1rem;
}

.metric span,
.muted,
.back-link {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 2rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.compact-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover {
  background: var(--accent-strong);
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button-link {
  display: inline-block;
  width: auto;
  background: var(--accent);
  color: white;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  border-radius: 999px;
  background: #e8f4f1;
  color: var(--accent-strong);
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.alert {
  margin: 0 0 1rem;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  font-weight: 700;
}

.alert.success {
  background: #e7f5ed;
  color: var(--success);
}

.alert.warning {
  background: #fff4d8;
  color: var(--warning);
}

.alert.danger {
  background: #fde8e7;
  color: var(--danger);
}

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

@media (max-width: 900px) {
  .summary-grid,
  .layout,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar nav,
  .tenant-head {
    align-items: stretch;
    flex-direction: column;
  }
}
