:root {
  --ink: #000c49;
  --muted: #5c6578;
  --line: #e4ddd0;
  --paper: #f3efe6;
  --card: #fff;
  --accent: #a72d31;
  --accent-dark: #8c2428;
  --danger-bg: #fdecea;
  --danger: #8c1d22;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 168px;
  height: auto;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top nav form { margin: 0; }

.top nav a,
.top nav span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.top nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.logout {
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.page {
  padding: 28px 0 64px;
}

.login-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 40px);
  padding: 32px 16px;
}

.login-card {
  width: min(440px, 100%);
  padding: 32px 28px;
}

.login-card img {
  display: block;
  width: 220px;
  height: auto;
  margin: 0 auto 18px;
}

h1, h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.15;
}

h1 { font-size: 32px; }
h2 { font-size: 22px; }

.lede, .hint {
  margin: 0 0 18px;
  color: var(--muted);
}

.stat {
  margin: 0 0 22px;
  font-size: 18px;
}

.stat strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
}

label {
  display: block;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid #cfc6b8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 88px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

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

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

button.secondary, .button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid #cfc6b8;
}

.alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

.ok {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f4ea;
  color: #1d5c32;
}

.stack {
  display: grid;
  gap: 18px;
}

.panel { padding: 22px; }

.table-wrap { overflow-x: auto; }

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

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

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.embed-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.who {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.forms {
  display: grid;
  gap: 14px;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.inline label { flex: 1 1 180px; }

.sf-picker { margin-top: 4px; }

.hint-inline {
  color: var(--muted);
  font-weight: 400;
}

.sf-results {
  display: grid;
  gap: 6px;
}

.sf-picked {
  margin: 0 0 8px;
  font-weight: 700;
}

button.sf-hit {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}

button.sf-hit strong { display: block; }

button.sf-hit span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

button.sf-hit:hover,
button.sf-hit:focus {
  background: var(--paper);
  color: var(--ink);
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f6ec;
  color: #1d5c32;
  font-size: 12px;
  font-weight: 700;
}

.status.off {
  background: #f3f0ea;
  color: var(--muted);
}

@media (max-width: 720px) {
  .top-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .brand span { display: none; }
  h1 { font-size: 28px; }
  .stat strong { font-size: 40px; }
}
