:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dee6;
  --text: #17202a;
  --muted: #657386;
  --primary: #1c6b4a;
  --primary-strong: #14533a;
  --danger: #b42318;
  --warn: #a15c07;
  --good: #177245;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

button:hover {
  background: var(--primary-strong);
}

button.secondary {
  color: var(--text);
  background: #e8edf2;
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

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

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

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 60px rgb(23 32 42 / 8%);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  font-size: 20px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.nav button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #e8edf2;
  text-decoration: none;
}

.nav a.active {
  color: #fff;
  background: var(--primary);
}

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

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

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

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

.form-grid button,
.form-grid .message,
.span-2 {
  grid-column: 1 / -1;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}

.badge.good {
  color: var(--good);
  background: #e8f5ee;
}

.badge.bad {
  color: var(--danger);
  background: #fff0ee;
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
}

.secret-box {
  display: grid;
  gap: 8px;
  word-break: break-all;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e5;
  padding: 12px;
}

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

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

