:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #607080;
  --line: #d7dde4;
  --accent: #007c89;
  --accent-strong: #005f68;
  --warn: #fff5d9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

nav a,
a {
  color: var(--accent);
}

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

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0 0 8px;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 17px;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.table-wrap,
article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

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

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

th {
  background: #edf2f4;
  color: #3b4a58;
  font-size: 12px;
  text-transform: uppercase;
}

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

article {
  padding: 16px;
}

dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0;
}

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

dd {
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

button:disabled {
  border-color: var(--line);
  background: #c5ccd3;
  cursor: not-allowed;
}

.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e7f4f6;
  color: var(--accent-strong);
  font-size: 12px;
}

.notice {
  padding: 12px;
  background: var(--warn);
  border: 1px solid #ead390;
  border-radius: 8px;
}

.session-warning-box {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 1000;
  width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  background: #fff3cd;
  border: 1px solid #e0b84b;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(23, 32, 42, 0.18);
  color: #6a4b00;
}

.session-warning-box strong {
  display: block;
  margin-bottom: 4px;
}

pre {
  overflow: auto;
  padding: 12px;
  background: #111827;
  color: #f8fafc;
  border-radius: 6px;
}
.sort-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

th[data-sort-direction="asc"] .sort-button::after {
  content: " ↑";
}

th[data-sort-direction="desc"] .sort-button::after {
  content: " ↓";
}

.topnav {
  display: none;
}

body.has-sidebar {
  padding-left: 64px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  width: 64px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 16px rgba(23, 32, 42, 0.08);
  transition: width 160ms ease;
}

.sidebar.is-expanded {
  width: 286px;
}

.sidebar-head {
  display: flex;
  min-height: 56px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.sidebar-toggle,
.side-nav-link {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-toggle {
  color: var(--accent-strong);
  cursor: pointer;
}

.sidebar-brand-icon {
  display: block;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
}

.sidebar-toggle:hover,
.side-nav-link:hover,
.side-nav-link:focus-visible {
  background: #eaf4f5;
  color: var(--accent-strong);
  outline: none;
}

.sidebar-icon {
  display: inline-flex;
  width: 24px;
  min-width: 24px;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  text-align: center;
}

.sidebar-label {
  overflow: hidden;
  opacity: 0;
  max-width: 0;
  transition: opacity 100ms ease, max-width 160ms ease;
}

.sidebar.is-expanded .sidebar-label {
  opacity: 1;
  max-width: 240px;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
}

.logout-form {
  margin: 0;
}

.nav-button {
  text-align: left;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(23, 32, 42, 0.24);
}

.sidebar-scrim[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-label {
    transition: none;
  }
}

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

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

.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(23, 32, 42, 0.08);
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-kicker {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.12);
}

.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #f3b7b7;
  border-radius: 6px;
  background: #fff1f1;
  color: #9f1d1d;
}

@media (max-width: 720px) {
  .topnav {
    gap: 10px 14px;
  }
}
