/* Slipway Admin — same family as the public site, dialled down for density.
   Fonts are the system stack here: this is an internal tool behind a login and
   two people look at it, so 240KB of webfont on every page load buys nothing. */

:root {
  --cream: #f5f0e6;
  --paper: #fffdf7;
  --ink: #16130f;
  --ink-soft: #58503f;
  --line: #d9d0be;
  --lime: #c6f24e;
  --coral: #ff5c38;
  --sea: #126b66;
  --lilac: #c3b1ff;
  --amber: #f0a92c;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sea); }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---- chrome ---- */

.top {
  background: var(--ink);
  color: var(--cream);
  border-bottom: 3px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top__inner {
  max-width: 1240px;
  margin-inline: auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  min-height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.top nav { display: flex; gap: 0.15rem; flex-wrap: wrap; flex: 1; }
.top nav a {
  color: #cdc6ba;
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.92rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.top nav a:hover { background: #2a251e; color: var(--cream); }
.top nav a[aria-current='page'] { background: var(--lime); color: var(--ink); font-weight: 600; }
.top__out { margin: 0; }
.linkbtn {
  background: none;
  border: 0;
  color: #cdc6ba;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.4rem;
  min-height: 44px;
  text-decoration: underline;
}
.linkbtn:hover { color: var(--cream); }

main {
  max-width: 1240px;
  margin-inline: auto;
  padding: 1.75rem 1.25rem 5rem;
}

/* ---- page furniture ---- */

.pagehead { margin-bottom: 1.5rem; }
.pagehead p { color: var(--ink-soft); margin: 0.4rem 0 0; max-width: 70ch; }

.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}
.panel > h2 { margin-bottom: 0.25rem; }
.panel > h2 + p { color: var(--ink-soft); margin: 0 0 1rem; font-size: 0.92rem; max-width: 72ch; }

.split {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

/* ---- kpis ---- */

.kpis {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  margin-bottom: 1rem;
}
.kpi {
  border: 2px solid var(--ink);
  background: var(--cream);
  padding: 0.85rem 0.9rem;
}
.kpi--good { background: #eaf9c9; }
.kpi--warn { background: #fdf0d5; }
.kpi--bad  { background: #ffe4dd; }
.kpi--flat { background: var(--paper); }
.kpi__label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.kpi__value {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 0.3rem;
}
.kpi__sub { display: block; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }

/* ---- notes ---- */

.note {
  border: 2px solid var(--ink);
  border-left-width: 8px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.25rem;
  background: var(--paper);
  font-size: 0.92rem;
}
.note--info { border-left-color: var(--sea); }
.note--ok   { border-left-color: var(--lime); }
.note--warn { border-left-color: var(--amber); }
.note--bad  { border-left-color: var(--coral); }

.empty { color: var(--ink-soft); font-style: italic; margin: 0.5rem 0; }

/* ---- tables ---- */

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
}
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--cream); }
td .muted { color: var(--ink-soft); }

.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}
.pill--free { background: var(--paper); }
.pill--premium { background: var(--lime); }
.pill--grant { background: var(--lilac); }
.pill--both { background: var(--amber); }
.pill--deleted { background: #e6e0d4; color: var(--ink-soft); }

/* ---- charts ---- */

.chart { margin: 0.5rem 0 0; }
.chart svg { width: 100%; display: block; background: var(--cream); border: 1px solid var(--line); }
.bar { fill: var(--sea); }
.bar:hover { fill: var(--coral); }
.chart figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

/* ---- forms ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--danger { background: var(--coral); color: var(--paper); }
.btn--quiet { background: var(--paper); box-shadow: none; min-height: 40px; padding: 0.35rem 0.7rem; font-size: 0.85rem; }

label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; }
input[type='text'], input[type='password'], input[type='search'], input[type='date'], select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  font: inherit;
  min-height: 48px;
}
.field { margin-bottom: 1rem; }
.formrow {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  align-items: end;
}

.searchbar { display: flex; gap: 0.6rem; align-items: flex-end; margin-bottom: 1.25rem; flex-wrap: wrap; }
.searchbar .field { margin: 0; flex: 1 1 18rem; }

/* ---- login ---- */

.loginbody {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.25rem;
}
.login {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 2rem;
  width: min(24rem, 100%);
  text-align: left;
}
.login h1 { margin: 0.75rem 0 1.25rem; font-size: 1.4rem; }
.login .btn { width: 100%; margin-top: 1rem; }

/* ---- misc ---- */

.stamp {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  font-variant-numeric: tabular-nums;
}
.backlink { display: inline-block; margin-bottom: 1rem; font-size: 0.9rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0; font-size: 0.92rem; }
dl.facts dt { color: var(--ink-soft); font-weight: 600; }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}
