:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #61706a;
  --line: #d9e1dd;
  --panel: #ffffff;
  --surface: #f5f7f4;
  --accent: #0d5c46;
  --accent-strong: #083f31;
  --warn: #7a4a00;
  --warn-bg: #fff4d8;
  --danger: #8c1d18;
  --danger-bg: #ffe9e7;
  --ok: #116042;
  --ok-bg: #e5f6ef;
  --focus: #2f6fed;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

a {
  color: var(--accent-strong);
}

.admin-shell {
  min-height: 100vh;
}

.boot-panel,
.state-panel,
.login-panel {
  display: grid;
  gap: 16px;
  align-content: center;
  justify-items: start;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.boot-mark,
.brand-mark {
  width: 44px;
  height: 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p,
.status-row,
.microcopy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  min-height: calc(100vh - 77px);
}

.side-nav {
  border-right: 1px solid var(--line);
  background: #eef3ef;
  padding: 18px 14px;
}

.route-link {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.route-link[aria-current="page"],
.route-link:focus-visible {
  border-color: var(--accent);
  background: var(--panel);
  outline: 2px solid transparent;
}

.content {
  padding: 24px;
}

.panel {
  max-width: 960px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.panel h2,
.state-panel h1,
.login-panel h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.surface-card {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.surface-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 12px;
}

.badge.ok {
  border-color: #b9dfce;
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.locked {
  border-color: #e3c27b;
  background: var(--warn-bg);
  color: var(--warn);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: var(--panel);
  color: var(--accent-strong);
}

.button[aria-disabled="true"],
.button:disabled {
  border-color: var(--line);
  background: #e8ece9;
  color: var(--muted);
  cursor: not-allowed;
}

.state-panel {
  min-height: calc(100vh - 77px);
}

.state-code {
  display: inline-flex;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .route-link {
    flex: 0 0 180px;
  }
}
