/* Inflow client portal. Colours from design/TOKENS.md (dark only), layout from
   design/Portal.dc.html. No web fonts are loaded (the CSP allows nothing external):
   Inter is used when it is installed, else the system font. */
:root {
  --bg: #0E0F12; --surface: #16181D; --surface-alt: #13151A; --hover: #1C1F26;
  --border: #23262E; --border-strong: #2B2F38; --row: #1E2128;
  --text: #E7E9EE; --soft: #D3D6DD; --muted: #9BA1AD;
  --accent: #7CC4FF; --on-accent: #0B1520; --late: #F5A35B; --teal: #5EEAD4;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #A9D8FF; text-decoration: underline; }
h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
h3 { margin: 12px 0 4px; font-size: 14px; font-weight: 600; color: var(--soft); }
p { margin: 0; }
code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }

header.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); }
.brand { font-weight: 700; font-size: 15px; flex-grow: 1; }
.who { color: var(--muted); }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }
button.link:hover { text-decoration: underline; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.hello p { margin-top: 4px; }
.muted { color: var(--muted); }
.sub { font-size: 13px; margin-top: 8px; }
.late { color: var(--late); font-weight: 500; }
.error { color: var(--late); background: #3A2614; border: 1px solid #5A3618; border-radius: 8px; padding: 8px 12px; }
.pre { white-space: pre-line; overflow-wrap: anywhere; color: var(--soft); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.narrow { max-width: 460px; width: 100%; margin: 24px auto 0; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 200px; gap: 4px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .label.late { color: var(--late); }
.stat .big { font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }

.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.two { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.two > * { flex: 1 1 360px; min-width: 0; }
.line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--row); }
.line .date { width: 96px; flex-shrink: 0; color: var(--muted); font-size: 13px; }
.line .grow { flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }
.line .amount { font-weight: 600; text-align: right; white-space: nowrap; }
.line .paid { color: var(--muted); font-weight: 400; font-size: 13px; }
.file.older { opacity: 0.8; }
.filename { overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.small { font-size: 13px; }

.pill { padding: 3px 10px; border-radius: 999px; background: #1C2A38; color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.teal { background: #15302D; color: var(--teal); }
.pill.done { background: var(--hover); color: #B4BAC5; }
.pill.closed { background: var(--hover); color: var(--muted); }

.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .row { font-size: 13px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--border); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--border); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }

a.button, button.primary {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: transparent; color: var(--accent); font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
a.button:hover { background: var(--hover); text-decoration: none; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
label { color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=password] {
  background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px;
  min-height: 44px; padding: 0 12px; font: inherit; width: 100%;
}
input:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.copy { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }

@media (max-width: 560px) {
  main { padding: 16px 12px 40px; }
  .line .date { width: 72px; }
  .line.file { flex-wrap: wrap; }
  .actions { flex-direction: row; align-items: center; }
}
