:root {
  --bg: #fff;
  --fg: #000;
  --muted: rgba(0, 0, 0, 0.42);
  --line: rgba(0, 0, 0, 0.09);
  --soft: rgba(0, 0, 0, 0.03);
  --navy: #07162b;
  --good: #1f7a4d;
  --bad: #b3261e;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); }
body {
  font-family: "Switzer", "Inter", system-ui, sans-serif;
  font-size: 14px; line-height: 1.45; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.cap { text-transform: uppercase; font-size: 13px; letter-spacing: 0; }

/* Underlined uppercase link, same as the main site */
.u {
  text-transform: uppercase; font-size: 13px; letter-spacing: 0;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  background: none; border: 0; cursor: pointer; transition: color .2s;
}
.u:hover, .u.active { color: var(--muted); }

/* Header */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px var(--gutter); background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.bar-logo img { height: 12px; display: block; }
.bar-clock { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: pre; }
.bar-links { display: flex; gap: 24px; justify-content: flex-end; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 40px var(--gutter) 96px; }
.title { font-size: clamp(28px, 3.4vw, 44px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.02; }
.sub { color: var(--muted); text-transform: uppercase; font-size: 13px; margin-top: 10px; }
.section { margin-top: 48px; }
.section > h3 { font-size: 13px; font-weight: 400; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.prose { max-width: 42em; font-size: 16px; line-height: 1.55; white-space: pre-wrap; }

/* Tabs */
.tabs { display: flex; gap: 28px; margin-bottom: 32px; }

/* List rows */
.rows { list-style: none; }
.rows > * { border-bottom: 1px solid var(--line); }
.rows > :first-child { border-top: 1px solid var(--line); }
.r {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 120px; gap: 16px; align-items: baseline;
  padding: 16px 0; transition: padding .35s var(--ease), color .2s;
}
a.r:hover { padding-left: 10px; }
.r > :first-child { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -0.03em; }
.r > :not(:first-child) { color: var(--muted); text-transform: uppercase; font-size: 13px; }
.r > :last-child { text-align: right; }

/* Key numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stat { padding: 18px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; }
.stat span { color: var(--muted); text-transform: uppercase; font-size: 12px; }

.badge { display: inline-block; padding: 3px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; text-transform: uppercase; vertical-align: middle; }
.badge.open { color: var(--good); }
.badge.closed { color: var(--muted); }
.badge.pending { color: #8a6d00; }
.badge.approved { color: var(--good); }
.badge.rejected { color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { background: var(--soft); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.chip b { font-weight: 500; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.chart { position: relative; height: 280px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 400; color: var(--muted); text-transform: uppercase; font-size: 12px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.act { text-align: right; white-space: nowrap; }
.tbl td.act > * + * { margin-left: 14px; }

/* Feed */
.feed { list-style: none; display: grid; }
.post { padding: 24px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.post:first-child { border-top: 1px solid var(--line); }
.post h4 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 6px; }
.post .meta { color: var(--muted); text-transform: uppercase; font-size: 12px; display: grid; gap: 6px; align-content: start; padding-top: 4px; }
.post .body { white-space: pre-wrap; max-width: 44em; }

/* Forms */
.form { display: grid; gap: 18px; }
.form.cols { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 28px; }
.form .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; }
label > span { color: var(--muted); text-transform: uppercase; font-size: 12px; }
input, select, textarea {
  width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid rgba(0, 0, 0, .2);
  background: transparent; outline: none; border-radius: 0; transition: border-color .2s;
}
textarea { min-height: 110px; resize: vertical; border: 1px solid rgba(0, 0, 0, .2); padding: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--fg); }
label.check { display: flex; align-items: center; gap: 10px; }
label.check input { width: auto; }
.btn {
  justify-self: start; padding: 11px 22px; border-radius: 999px; border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg); cursor: pointer; text-transform: uppercase; font-size: 13px;
  transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn.ghost { background: transparent; color: var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); }
.btn:disabled { opacity: .4; pointer-events: none; }
.inline { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: end; margin-top: 18px; }
.inline label { flex: 1 1 120px; }

/* Auth screens */
.auth { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 28px var(--gutter); }
.auth-head { display: flex; justify-content: space-between; align-items: center; }
.auth-head img { height: 12px; display: block; }
.auth-main { align-self: center; justify-self: center; width: min(100%, 380px); }
.auth-main h1 { font-size: 13px; font-weight: 400; text-transform: uppercase; margin-bottom: 28px; }
.auth-main .alt { margin-top: 28px; display: flex; gap: 24px; flex-wrap: wrap; }
.auth-foot { color: var(--muted); font-size: 13px; text-transform: uppercase; text-align: center; }
.view { display: none; }
.view.on { display: block; animation: in .5s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.note { font-size: 14px; color: var(--muted); }
.err { color: var(--bad); font-size: 13px; min-height: 1em; }

.empty { color: var(--muted); padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Admin split */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }
.side { list-style: none; position: sticky; top: 80px; }
.side li { border-bottom: 1px solid var(--line); }
.side li:first-child { border-top: 1px solid var(--line); }
.side button { width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; transition: padding .3s var(--ease); }
.side button:hover, .side button.active { padding-left: 8px; }
.side button.active { font-weight: 500; }
.side small { color: var(--muted); text-transform: uppercase; font-size: 11px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50;
  background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; transition: opacity .3s, transform .4s var(--ease); pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

@media (max-width: 760px) {
  .bar { grid-template-columns: auto 1fr; }
  .bar-clock { display: none; }
  .bar-links { gap: 16px; }
  .r { grid-template-columns: 1fr auto; }
  .r > :nth-child(2), .r > :nth-child(3) { display: none; }
  .grid2, .split { grid-template-columns: 1fr; }
  .side { position: static; }
  .post { grid-template-columns: 1fr; gap: 8px; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
}
