:root {
  color-scheme: light;
  --bg: #f5f8f3;
  --surface: #ffffff;
  --surface-soft: #fbf7ec;
  --line: #dbe4d5;
  --text: #152318;
  --muted: #68756b;
  --brand: #0f6b3d;
  --brand-dark: #06452b;
  --brand-soft: #e8f6ec;
  --gold: #b77914;
  --gold-soft: #fff5d6;
  --accent: #0f766e;
  --blue: #245c9f;
  --danger: #b42318;
  --success: #047857;
  --shadow: 0 14px 34px rgba(20, 48, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef8ee 0, #f5f8f3 230px, #f8faf7 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

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

label {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: #344054;
  font-weight: 650;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 61, 0.14);
}

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

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.topbar {
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(90deg, var(--brand-dark), #0b5b38 58%, #7a520c);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(255, 224, 147, 0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  flex: 0 0 auto;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar a {
  color: #eef4ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.topbar a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.shell > section + section {
  margin-top: 20px;
}

.shell.narrow {
  width: min(680px, calc(100% - 32px));
}

.auth-shell,
.install-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
}

.install-shell .panel {
  width: min(880px, 100%);
}

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

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--brand-dark);
  font-size: 15px;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e7c56f;
  box-shadow: 0 8px 18px rgba(45, 72, 36, 0.14);
}

.member-line {
  display: grid;
  gap: 3px;
}

.member-line strong {
  font-weight: 750;
}

.page-title {
  margin-bottom: 20px;
}

.page-title p,
.muted {
  color: var(--muted);
  margin: 0;
}

.links {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-weight: 750;
  cursor: pointer;
}

.button:hover {
  background: #0d5f59;
}

.button.secondary {
  background: #4f5f55;
}

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

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

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

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.notice.error {
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #fecdca;
}

.notice.success {
  color: var(--success);
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

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

.grid > *,
.metric-grid > * {
  min-width: 0;
}

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

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

.metric-grid article {
  background: linear-gradient(180deg, #fff, #fbfefb);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  border-top: 3px solid var(--brand);
}

.metric-grid article:nth-child(2n) {
  border-top-color: var(--gold);
}

.metric-grid article:nth-child(3n) {
  border-top-color: var(--blue);
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-grid strong {
  display: block;
  font-size: 24px;
  color: var(--brand-dark);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

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

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

th {
  color: #4f5f55;
  font-size: 13px;
  background: #f5faf4;
}

tbody tr:nth-child(even) {
  background: #fbfdf9;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: #dcfae6;
  color: #067647;
}

.badge.warn {
  background: #fff4cc;
  color: #7a4d00;
}

.badge.err {
  background: #fee4e2;
  color: #b42318;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.inline-form input,
.inline-form select {
  min-width: 180px;
}

.mini-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mini-form select {
  min-width: 112px;
  padding: 7px 8px;
}

.mini-form input {
  width: auto;
  min-width: 120px;
  padding: 7px 8px;
}

.checkline {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

input[type="checkbox"] {
  width: auto;
}

.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

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

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

.details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

pre {
  max-height: 420px;
  overflow: auto;
  background: #101828;
  color: #f2f4f7;
  border-radius: 8px;
  padding: 16px;
}

code {
  background: #eef6ee;
  border-radius: 5px;
  padding: 2px 5px;
}

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

  .topbar {
    height: auto;
    align-items: stretch;
    padding: 14px;
    flex-direction: column;
    gap: 12px;
  }

  .topbar nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar nav a {
    white-space: nowrap;
  }

  .inline-form {
    display: grid;
  }

  .member-title,
  .mini-form {
    display: grid;
  }

  .panel {
    padding: 18px;
  }

  h1 {
    font-size: 22px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }
}
