/* Cage admin portal (/admin), for a desktop browser. Same Playground brand as the tablet app
   (css/app.css): Poppins for text, Oswald Bold for headlines, red #cd0000, black, white and
   light grey #e6e7e8. Denser than the tablet: this is read with a mouse, not tapped. */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600 700; font-display: swap; src: url('../vendor/fonts/poppins-700.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/oswald-700.woff2') format('woff2'); }

:root {
  --red: #cd0000;
  --red-dark: #a30000;
  --black: #000000;
  --ink: #111111;
  --muted: #555a63;
  --line: #d2d4d7;
  --line-soft: #e9eaec;
  --bg: #e6e7e8;
  --card: #ffffff;
  --head: #f4f4f5;
  --ok: #1f7a46;
  --ok-bg: #e7f4ec;
  --warn-bg: #fff6e0;
  --warn-line: #e8b339;
  --warn-ink: #6b4700;
  --err-bg: #fdeaea;
  --err-line: #efb7bd;
  --radius: 10px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { height: 100%; scrollbar-color: #9a9da3 var(--bg); }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 .9375rem/1.5 var(--font); caret-color: var(--red); }
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bar :focus-visible, .signin-brand :focus-visible { outline-color: #fff; }
a { color: inherit; text-underline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; }

h1 { font: 700 1.9rem/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .02em; margin: 0; text-wrap: balance; }
h2 { font: 700 1.05rem/1.3 var(--font); margin: 0 0 6px; }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 72ch; }
.fine { color: var(--muted); font-size: .84rem; margin: 12px 0 0; }
.muted { color: var(--muted); }
.sub { display: block; font-size: .8rem; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Top bar: the tablet app's black bar and red rule, with the sections as tabs. */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: stretch; gap: 28px; background: var(--black); color: #fff; padding: 0 24px; border-bottom: 3px solid var(--red); min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
/* Logo #1 as supplied: never stretched or recoloured; the black bar gives it its clear space. */
.brand img { height: 34px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: #555; }
.brand-name { font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.tabs { display: flex; align-items: stretch; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; padding: 0 14px; margin-bottom: -3px; border-bottom: 3px solid transparent; color: #c9cbcf; text-decoration: none; font-weight: 500; white-space: nowrap; transition: color .15s var(--ease), background-color .15s var(--ease); }
.tabs a:hover { color: #fff; background: #1c1c1c; }
.tabs a[aria-current="page"] { color: #fff; font-weight: 600; border-bottom-color: #fff; }
.me { display: flex; align-items: center; gap: 12px; flex: none; }
.me-name { color: #c9cbcf; font-size: .84rem; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: 1360px; margin: 0 auto; padding: 32px 24px 80px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lead { margin-top: 6px; }

/* Buttons: the tablet's shape, at mouse size. */
.btn { font: 600 .9rem/1.2 var(--font); border-radius: 8px; padding: 9px 16px; min-height: 40px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover { background: #f1f2f4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.danger { color: var(--red-dark); border-color: var(--err-line); background: transparent; }
.btn.danger:hover { border-color: var(--red-dark); background: var(--err-bg); }
.btn.on-dark { background: transparent; color: #fff; border-color: #555; }
.btn.on-dark:hover { border-color: #fff; background: #1c1c1c; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: .82rem; border-width: 1.5px; }
.btn.wide { width: 100%; min-height: 46px; font-size: 1rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.file:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Fields */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 5px; }
.field input, .field select { width: 100%; font: inherit; padding: 8px 12px; min-height: 40px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); transition: border-color .15s var(--ease); }
.field input:hover, .field select:hover { border-color: #9a9da3; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
.field input::placeholder { color: #6a6f78; }
.field .help { color: var(--muted); font-size: .82rem; margin: 5px 0 0; }
.field.invalid input { border-color: var(--red); background: #fff8f8; }
.field-row { display: flex; gap: 8px; align-items: stretch; }
.field-row input { flex: 1; min-width: 0; }
.pin-input { font-size: 1.15rem !important; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.form-error { color: var(--red-dark); font-weight: 500; min-height: 1.4em; margin: 0; }

/* Labels share one line and every control is 40px tall, so the labels and the boxes line up
   whatever the control is (text box, date box or list). */
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; margin-bottom: 16px; }
.filters .field { margin: 0; flex: 0 1 170px; }
.filters .field label, .filters .field .label { line-height: 1.3; }
.filters .field.wide { flex-basis: 215px; }
.filters + .filters { margin-top: -4px; }
.quick-row { display: flex; gap: 6px; }
.quick-row .btn { min-height: 40px; padding: 4px 12px; font-size: .84rem; }
.filters .field.clear { margin-left: auto; }
.filters .field input, .filters .field select { height: 40px; }
.filters .field.grow { flex: 1 1 240px; max-width: 340px; }

/* Notes: a full border and a tint; never a stripe down one side. */
.note { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; max-width: 86ch; }
.note strong { font-weight: 600; }
.note-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.note-error { background: var(--err-bg); border-color: var(--err-line); color: #7a0000; }
.note-ok { background: var(--ok-bg); border-color: #9fd2b3; color: #14532f; }

/* Tables */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
thead th { background: var(--head); color: var(--muted); font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
/* Sortable column headings: a real button in the th; aria-sort on the th says which one is sorted. */
th[aria-sort] { color: var(--ink); }
.th-sort { font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; padding: 3px 6px; margin: -3px -6px; min-height: 26px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: background-color .15s var(--ease); }
.th-sort:hover { background: #e6e7e9; color: var(--ink); }
.th-sort svg { flex: none; }
.th-sort .unsorted { color: #7f838b; }
.th-sort .sorted { color: var(--ink); }
/* Fixed layout: the columns keep their widths, so opening a record never moves them. */
table.fixed { table-layout: fixed; min-width: 1240px; }
.c-when { width: 160px; } .c-type { width: 95px; } .c-pos { width: 125px; } .c-amount { width: 115px; } .c-picked { width: 170px; }
.c-by { width: 155px; } .c-sig { width: 140px; } .c-act { width: 92px; }
table.fixed td { overflow-wrap: anywhere; }
tbody td { border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s var(--ease); }
tbody tr:hover { background: #fafafb; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
td.when, td.no { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.no { font-weight: 600; }
tr.is-off td { color: var(--muted); }
tr.is-off td.no { font-weight: 500; }
.foot-main { display: inline-flex; align-items: center; gap: 12px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--head); color: var(--muted); font-size: .84rem; }
.empty { padding: 44px 24px; text-align: center; }
.empty h2 { margin-bottom: 4px; }
.empty p { color: var(--muted); margin: 0 auto 16px; max-width: 52ch; }
.empty p:last-child { margin-bottom: 0; }
.loading td { color: var(--muted); padding: 28px 16px; }

.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.chip.on { background: var(--ok-bg); color: var(--ok); }
.chip.off { background: #ececee; color: #4a4e56; }
.chip.bad { background: var(--err-bg); color: var(--red-dark); }
.chip.pos-share { background: #ececee; color: var(--ink); }
/* Needs review: amber, with a drawn warning sign and the words, so colour is never the only cue. */
.chip.review { display: inline-flex; align-items: center; gap: 5px; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); padding: 2px 8px; }
.chip.review svg { flex: none; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* One BBJ payout record, opened under its row */
.detail { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr); gap: 20px 32px; padding: 8px 0 12px; align-items: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sigs figure { margin: 0; }
.sigs img { width: 100%; height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: block; }
.sigs figcaption { color: var(--muted); font-size: .82rem; margin-top: 4px; }
tbody tr.detail-row, tbody tr.detail-row:hover { background: var(--head); }
tr.detail-row td { white-space: normal; padding: 14px 18px 18px; }
.count-line { margin: 0 0 10px; min-height: 32px; }
.count-line .btn { margin-left: 8px; }
.count-line strong { font-weight: 600; }
/* Loading cue: the list dims and a bar runs across the top while a request is in flight. */
.is-busy { position: relative; cursor: progress; }
.is-busy > .table-card { opacity: .55; transition: opacity .2s var(--ease); }
.is-busy::before { content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--red), transparent) 0 0 / 40% 100% no-repeat; animation: busy-bar 1s var(--ease) infinite; }
@keyframes busy-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.legend { color: var(--muted); font-size: .84rem; max-width: 75ch; margin: 12px 2px 0; }
.legend strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }

/* Import */
.steps { display: grid; gap: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.step h2 { font: 700 1.05rem/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--red); }
.step p { margin: 0 0 12px; color: var(--muted); max-width: 80ch; }
.step p.summary { color: var(--ink); }
.step .table-card { margin: 12px 0; }
.step td, .step th { padding: 7px 12px; font-size: .86rem; vertical-align: top; }
tr.bad td { background: #fff5f5; }
tr.dup td { color: var(--muted); }
tr.warn td:last-child { color: #8a5a00; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 18px 44px -18px rgba(0, 0, 0, .28); }
.signin-brand { background: var(--black); border-bottom: 3px solid var(--red); padding: 22px 28px; }
.signin-brand img { height: 46px; width: auto; display: block; }
.signin-body { padding: 26px 28px 28px; }
.signin-body .lead { margin: 8px 0 20px; }
.signin-body .note { margin-bottom: 16px; font-size: .88rem; }
/* Plain text, not a second card inside the sign-in card. */
.temp-note { margin: 0 0 16px; color: var(--warn-ink); font-size: .88rem; }
.temp-note strong { font-weight: 600; }

/* Dialog */
.dialog { border: 0; border-radius: 14px; padding: 26px 28px; width: min(460px, calc(100% - 32px)); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45); }
.dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog[open] { animation: dialog-in .2s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } }
.dialog h2 { font: 700 1.35rem/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 6px; }
.dialog-lead { color: var(--muted); margin: 0 0 16px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.handout { border: 1px solid var(--line); border-radius: var(--radius); margin: 4px 0 6px; }
.handout div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 16px; }
.handout div + div { border-top: 1px solid var(--line-soft); }
.handout dt { color: var(--muted); font-weight: 500; }
.handout dd { margin: 0; font-weight: 700; font-size: 1.25rem; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
dl.handout { padding: 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 8px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; gap: 0 16px; padding: 0 16px; }
  .brand { min-height: 56px; }
  .me { margin-left: auto; }
  .tabs { order: 3; flex-basis: 100%; min-height: 44px; }
  .page { padding: 24px 16px 64px; }
  .me-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
