:root {
  --green: #153d26;
  --green-deep: #0f2d1c;
  --green-tint: #eef2ee;
  --gold: #c5a55a;
  --paper: #f6f5f0;
  --white: #ffffff;
  --ink: #1b211c;
  --muted: #5f6861;
  --rule: #dcd9cf;
  --line: #c9c6bb;
  --danger: #a33a2e;
  --serif: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--green); }
.booting { padding: 48px; color: var(--muted); }

/* top bar */
.top { background: var(--green); color: #fff; border-bottom: 3px solid var(--gold); padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 12px; }
.wordmark { font-family: var(--serif); font-size: 24px; letter-spacing: 0.01em; }
.brand-sub { font-size: 14px; opacity: 0.85; }
.who { text-align: right; font-size: 14px; }
.who-name { font-weight: 600; }
.wrist { display: block; height: 4px; width: 100%; max-width: 72px; border-radius: 2px; margin: 4px 0 4px auto; }
.who-band { opacity: 0.9; }
.who-band a { color: #fff; }

/* frame */
.frame { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100% - 64px); }
.side { padding: 24px 0 24px 16px; border-right: 1px solid var(--rule); }
.navlink { display: block; padding: 8px 12px; border-left: 3px solid transparent; color: var(--ink); text-decoration: none; }
.navlink:hover { background: var(--green-tint); }
.navlink.current { border-left-color: var(--green); font-weight: 600; }
main { padding: 32px 40px 64px; max-width: 1140px; min-width: 0; }
.foot { grid-column: 1 / -1; padding: 16px 24px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }

h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; color: var(--green); margin: 0 0 8px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--green); margin: 32px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 8px 0 0; }
.ok { color: var(--green); margin: 8px 0 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.btn { display: inline-block; background: var(--green); color: #fff; border: 0; padding: 10px 16px; border-radius: 4px; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--green-deep); }
.btn:focus-visible, .link:focus-visible, .navlink:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--green); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }
.link.danger { color: var(--danger); }

/* tables */
.tablewrap { overflow-x: auto; background: var(--white); border: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { font-weight: 600; font-size: 13px; color: var(--muted); background: var(--paper); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover { background: var(--green-tint); }
.refused { color: var(--danger); }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; max-width: 840px; background: var(--white); border: 1px solid var(--rule); padding: 24px; }
.field { display: grid; gap: 6px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--green); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.actions { grid-column: 1 / -1; display: flex; gap: 20px; align-items: center; padding-top: 8px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }

.detail { display: grid; grid-template-columns: 200px 1fr; gap: 12px 24px; background: var(--white); border: 1px solid var(--rule); padding: 24px; max-width: 840px; margin: 0; }
.detail dt { font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.detail dd { margin: 0; white-space: pre-wrap; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 16px 0; margin: 16px 0 8px; }
.stats div { padding: 8px 0; }
.big { display: block; font-family: var(--serif); font-size: 34px; color: var(--green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span + span { color: var(--muted); font-size: 14px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--green); padding: 32px; }
.login-card .wordmark { color: var(--green); display: block; margin-bottom: 4px; }
.login-card h1 { font-size: 22px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; margin-top: 8px; }
.login-card .muted { margin-top: 20px; font-size: 14px; }

.notice { background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--gold); padding: 16px 20px; max-width: 840px; margin: 0 0 24px; }

@media (max-width: 760px) {
  .top { padding: 12px 16px; }
  .who { text-align: left; }
  .wrist { margin-left: 0; }
  .frame { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px 16px; display: flex; overflow-x: auto; gap: 4px; }
  .navlink { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 8px 10px; }
  .navlink.current { border-bottom-color: var(--green); }
  main { padding: 24px 16px 48px; }
  .form, .detail { grid-template-columns: 1fr; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
