:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #18202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: #075c7a;
  text-decoration: none;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid #dce2e8;
}

.brand {
  font-weight: 700;
  color: #18202a;
}

nav {
  display: flex;
  gap: 18px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
}

.hero-row,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-row h1,
.toolbar h1 {
  margin-bottom: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.narrow {
  max-width: 440px;
  margin: 40px auto;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 160px);
}

.auth-copy h1 {
  font-size: 42px;
  line-height: 1.05;
}

.auth-copy p {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.5;
}

.auth-form {
  margin: 0;
}

h1, h2 {
  margin-top: 0;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0b6b82;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: #66727f;
}

.small {
  font-size: 13px;
}

form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select {
  height: 40px;
  border: 1px solid #b9c3cd;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  background: #ffffff;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: #0b6b82;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #e8edf1;
  color: #18202a;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 6px;
  background: #0b6b82;
  color: #ffffff;
  font-weight: 700;
  padding: 0 14px;
}

.button-link.secondary {
  background: #e8edf1;
  color: #18202a;
}

button.danger {
  background: #9b2c2c;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  margin: 18px 0;
}

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

.host-admin-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.host-admin-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b9d7e0;
  border-radius: 8px;
  background: #f3fafc;
}

.host-admin-link span {
  color: #52616f;
  font-size: 13px;
}

.detail-list {
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
}

.detail-list dd {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.meta-cell {
  max-width: 340px;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.operational-foundations summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.operational-foundations[open] summary {
  margin-bottom: 24px;
}

.confirm-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.confirm-label input {
  width: 18px;
  height: 18px;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: #edf1f4;
  padding: 3px 6px;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #dce2e8;
  text-align: left;
}

.product {
  border-top: 1px solid #dce2e8;
  padding: 16px 0;
}

.product.compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 0;
  padding: 10px 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 30px;
}

.metric span {
  color: #66727f;
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.tenant-card {
  border: 1px solid #dce2e8;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
}

.tenant-title,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tenant-title h3,
.panel-head h2 {
  margin-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1f4;
  color: #384553;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: #e6f5ed;
  color: #126038;
}

.pill.warn {
  background: #fff1d6;
  color: #795000;
}

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

dt {
  color: #66727f;
  font-size: 12px;
}

dd {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-password-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  max-width: 760px;
  margin: 14px 0;
}

.action-result {
  margin: 8px 0;
  color: #126038;
  font-weight: 700;
}

.action-result.error {
  color: #8a1f1f;
}

button:disabled {
  cursor: wait;
  opacity: .55;
}

.result {
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
  background: #111820;
  color: #dbe8ee;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
}

.empty,
.alert {
  border-radius: 8px;
  padding: 14px;
  background: #f1f5f8;
}

.alert.error {
  background: #fdecec;
  color: #8a1f1f;
}

@media (max-width: 760px) {
  .auth-shell,
  .split,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .auth-copy h1 {
    font-size: 32px;
  }

  .topbar {
    padding: 0 16px;
  }

  .page {
    padding: 24px 16px;
  }

  .admin-search {
    grid-template-columns: 1fr;
  }

  .admin-password-form {
    grid-template-columns: 1fr;
  }
}
