:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #657382;
  --line: #d9e0e7;
  --accent: #126c61;
  --accent-2: #b3442d;
}

* { 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;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 0 24px;
  background: #14212b;
  color: #fff;
}

.brand { color: #fff; font-weight: 700; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: #dce7ef; }
.logout-form { margin: 0; }
.logout-form button {
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  color: #dce7ef;
}

.page {
  width: min(1280px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

h1 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 0;
}

section {
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.toolbar, .inline-form, .filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar { justify-content: space-between; }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}

.tabs a.active {
  border-color: var(--accent);
  background: #e7f1ef;
  color: #0f5d54;
  font-weight: 700;
}

.tabs span {
  color: var(--muted);
  font-weight: 500;
}

input, select, button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

button:hover { filter: brightness(0.96); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
}

.metrics div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metrics strong {
  display: block;
  font-size: 28px;
}

.metrics span { color: var(--muted); }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: transparent;
  border: 0;
  padding: 0;
}

.grid.two > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-block;
  min-width: 74px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f1ef;
  color: #0f5d54;
  text-align: center;
  font-size: 12px;
}

.table-meta {
  color: var(--muted);
  margin: 12px 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
}

.pagination a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

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

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .topbar nav { flex-wrap: wrap; }
  .metrics, .grid.two, .detail-grid { grid-template-columns: 1fr; }
  table { font-size: 13px; }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #14212b;
}

.login-panel {
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid var(--line);
}

.login-panel form {
  display: grid;
  gap: 12px;
}

.login-panel label {
  color: var(--muted);
}
