:root {
  color-scheme: light;
  --bg: #eef2f3;
  --panel: #ffffff;
  --text: #172026;
  --muted: #62767d;
  --line: #ccd5d8;
  --accent: #116149;
  --danger: #dc2626;
  --warn: #b54708;
  --ok: #15803d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
button, input { font: inherit; }
button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 11px;
  font-weight: 650;
  cursor: pointer;
}
button:hover { border-color: #6d8a92; }
button:disabled { opacity: .45; cursor: not-allowed; }
h1, h2, h3, p { margin: 0; letter-spacing: 0; }
p, small { color: var(--muted); }
a {
  color: #0b5cad;
  font-weight: 700;
  text-decoration: none;
}
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.error { color: var(--danger); }

.login-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(23, 32, 38, 0.12);
  display: grid;
  gap: 14px;
  max-width: 400px;
  padding: 22px;
  width: 100%;
}
.brand-row {
  align-items: center;
  display: flex;
  gap: 10px;
}
.brand-row small {
  display: block;
  margin-top: 2px;
}
.brand-icon {
  align-items: center;
  background: #d7fff0;
  border-radius: 6px;
  color: #0c4937;
  display: inline-flex;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.message {
  min-height: 20px;
}
label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
}
input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--text);
}
.actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.secondary,
.secondary-link {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}
.secondary-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  min-height: 36px;
  padding: 8px 11px;
}

.admin-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.topbar,
.notice,
.admin-card,
.admin-audit {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.topbar {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}
.topbar nav {
  align-items: center;
  display: flex;
  gap: 10px;
}
.notice {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 11px 14px;
}
.notice strong {
  color: var(--warn);
}
.notice span {
  color: var(--muted);
  font-size: 13px;
}
.admin-message {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}
.admin-message.ok { background: #dcfce7; color: #166534; }
.admin-message.warn { background: #fef3c7; color: #92400e; }
.admin-message.error { background: #fee2e2; color: #991b1b; }
.admin-config {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.admin-card header,
.admin-audit header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.admin-card h2,
.admin-audit h2 {
  font-size: 16px;
}
.admin-card p,
.admin-field small,
.admin-audit p {
  color: var(--muted);
  font-size: 12px;
}
.admin-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-field {
  background: #f8fafc;
  border: 1px solid #e3e8eb;
  border-radius: 6px;
  padding: 9px;
}
.admin-field span {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.admin-field strong {
  color: var(--text);
  font-size: 12px;
}
.admin-field em {
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}
.admin-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  margin-top: 6px;
}
.admin-audit {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.audit-list {
  display: grid;
  gap: 6px;
}
.audit-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e3e8eb;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: 170px minmax(160px, 1fr) 110px 70px;
  padding: 8px 10px;
}
.audit-row span,
.audit-row em,
.audit-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.audit-row strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.empty {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

@media (max-width: 920px) {
  .topbar,
  .admin-card header,
  .admin-audit header {
    align-items: stretch;
    flex-direction: column;
  }
  .topbar nav,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-config,
  .admin-fields,
  .audit-row {
    grid-template-columns: 1fr;
  }
}
