/* One operator, one screen, no framework. Dense and legible beats decorated:
   this page is read at 02:00 while a customer is on the phone. */

:root {
  --ink: #14181d;
  --ink-soft: #5b6570;
  --rule: #d3d8de;
  --bg: #fbfbfa;
  --panel: #ffffff;
  --accent: #1f4f82;
  --bad: #8a1c1c;
  --bad-bg: #fdf0ef;
  --warn-bg: #fdf6e3;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Header ------------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .55rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.topbar .brand {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { color: var(--accent); text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.topbar .signout { margin-left: auto; }

main { max-width: 74rem; margin: 0 auto; padding: 1.25rem; }

h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .5rem; }

footer {
  max-width: 74rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2.5rem;
  color: var(--ink-soft);
  font-size: 12px;
  border-top: 1px solid var(--rule);
}

/* Tables ------------------------------------------------------------------
   Money and ids are monospace so digits line up and a wrong figure is visible
   as a shape, not only as a value. Numeric columns are right-aligned. */

table { width: 100%; border-collapse: collapse; background: var(--panel); }

th, td {
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

th a { color: inherit; text-decoration: none; }
th a:hover { text-decoration: underline; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
td.num.mono { font-family: var(--mono); }

tbody tr:hover { background: #f4f7fa; }

/* States are words first and colour second: colour alone is not something an
   operator can grep, screenshot or read colour-blindly. */
tr.negative td.num { color: var(--bad); font-weight: 600; }
tr.suspended { background: var(--bad-bg); }
tr.stale, tr.differs { background: var(--warn-bg); }

.tag {
  display: inline-block;
  padding: 0 .35rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 12px;
  white-space: nowrap;
}
.tag.bad { border-color: var(--bad); color: var(--bad); }

/* Cards and forms --------------------------------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 1rem;
  margin-bottom: 1rem;
}

.narrow { max-width: 26rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; }

label { display: block; margin: .6rem 0 .2rem; font-size: 12px; color: var(--ink-soft); }

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: inherit;
  background: #fff;
}

input[type=text], input[type=number] { font-family: var(--mono); }
textarea { min-height: 4.5rem; resize: vertical; }

button {
  margin-top: .8rem;
  padding: .35rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
button:hover { background: #17395e; }

.signout button { margin: 0; background: transparent; color: var(--accent); border-color: var(--rule); }
.signout button:hover { background: #eef2f6; }

/* Who is signed in, in the header. On a shared laptop this is the difference
   between moving money as yourself and moving it as whoever left the tab open. */
.topbar .who { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
.topbar .who + .signout { margin-left: 1rem; }

/* A link that submits: the directory is a table of one-click actions, and a
   button per row must not be a button-sized block per row. */
a.button {
  display: inline-block;
  padding: .35rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
a.button:hover { background: #17395e; }

form.inline { display: inline; }
form.inline button { margin: 0 .5rem 0 .2rem; padding: 0 .35rem; font-size: 12px; }
form.inline select { width: auto; }
button.link {
  background: transparent;
  border: none;
  color: var(--bad);
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
button.link:hover { background: transparent; }

/* Messages ---------------------------------------------------------------- */

.flash, .error, .hint, .stub {
  max-width: 74rem;
  margin: .75rem auto 0;
  padding: .5rem 1.25rem;
}

.flash { background: #eef4ec; border-left: 3px solid #3d6b3d; }
.error { background: var(--bad-bg); border-left: 3px solid var(--bad); color: var(--bad); }
.hint { color: var(--ink-soft); font-size: 12px; padding-left: 0; }
.stub { color: var(--ink-soft); font-style: italic; padding-left: 0; }

code { font-family: var(--mono); font-size: 12px; }
