:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d8e0ec;
  --text: #172033;
  --muted: #667085;
  --accent: #184e77;
  --accent-strong: #123b5b;
  --good-bg: #e8f7ee;
  --good-text: #137333;
  --warn-bg: #fff5db;
  --warn-text: #946200;
  --bad-bg: #fff1f0;
  --bad-text: #b42318;
}

* {
  box-sizing: border-box;
}

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

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

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav a,
.account a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}

.nav a.active,
.nav a:hover,
.account a:hover {
  background: #eef3f8;
  color: var(--text);
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

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

h1 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

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

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

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stat,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 16px;
}

.stat .value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 750;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.btn.secondary {
  background: #eef3f8;
  color: var(--text);
}

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

.btn.secondary:hover {
  background: #dfe8f2;
}

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

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

th {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.good {
  background: var(--good-bg);
  color: var(--good-text);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge.bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.badge.neutral {
  background: #eef3f8;
  color: #344054;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.flash {
  margin-bottom: 16px;
  border-radius: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: #fff;
}

.flash.success {
  background: var(--good-bg);
  border-color: #b7e4c7;
  color: var(--good-text);
}

.flash.error {
  background: var(--bad-bg);
  border-color: #fecdca;
  color: var(--bad-text);
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.login-page {
  max-width: 420px;
  margin: 10vh auto;
  padding: 0 24px;
}

@media (max-width: 760px) {
  .topbar,
  .page-head,
  .account {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 14px 18px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 18px;
  }
}

