:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f2;
  --rail: #182422;
  --text: #17211f;
  --muted: #66746f;
  --border: #dce4e2;
  --accent: #197e6b;
  --accent-soft: #dff2ed;
  --blue: #2f6fba;
  --red: #b83b3b;
  --red-soft: #f7e3e2;
  --orange: #b96a1a;
  --orange-soft: #f7eadc;
  --green: #287a49;
  --green-soft: #e0f1e7;
  --shadow: 0 12px 32px rgba(22, 33, 31, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

input,
button {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--rail);
  color: #fff;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  font-weight: 850;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  color: #9fb3ae;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 750;
}

.side-nav a:hover {
  color: #fff;
  background: var(--accent);
}

.main {
  min-width: 0;
}

.main-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

p,
.muted {
  color: var(--muted);
}

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

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

.panel,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
}

.form {
  display: grid;
  gap: 12px;
}

.form.compact {
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}

label.inline {
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button.warn {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-soft);
}

.button.ghost {
  background: transparent;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  padding: 12px;
  overflow-wrap: anywhere;
}

.table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex !important;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 850;
}

.badge.ok {
  color: var(--green);
  background: var(--green-soft);
}

.badge.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.badge.muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.notice {
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 750;
}

.notice.error {
  color: var(--red);
  background: var(--red-soft);
}

.notice.success {
  color: var(--green);
  background: var(--green-soft);
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.check-row input {
  min-height: auto;
  margin-top: 4px;
}

.check-row small {
  display: block;
  color: var(--muted);
}

.qr {
  width: 190px;
  height: 190px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

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

  .sidebar {
    position: static;
  }

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

  .table {
    min-width: 720px;
  }

  .panel {
    overflow-x: auto;
  }
}
