/* Deals desk. One loud thing: the sentence that says what to do today. Everything else stays quiet. */
:root {
  --ink: #17202b; --muted: #5b6673; --line: #d5dbe2; --canvas: #eef1f4; --sheet: #ffffff;
  --todo: #8a4b00; --todo-bg: #fff3d6; --stop: #9c1f1a; --stop-bg: #fde9e7; --pass: #0d5c43; --pass-bg: #e2f3ec;
  --link: #1d4a8f;
}
* { box-sizing: border-box; }
html { font: 16px/1.5 "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; font-variant-numeric: tabular-nums; }
a { color: var(--link); }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }

header { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; padding: .75rem 1.5rem; background: var(--ink); color: #fff; }
header a { color: #fff; text-decoration: none; }
header .brand { font-weight: 700; font-size: 1.125rem; }
header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; flex: 1; }
header nav a { opacity: .82; }
header nav a:hover { opacity: 1; text-decoration: underline; }
header .money { margin: 0; font-size: .9375rem; }
header .money.over { background: var(--stop); padding: .125rem .5rem; border-radius: 3px; }
header form { margin: 0; }

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.125rem; margin: 2rem 0 .5rem; }
.bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.count { color: var(--muted); font-weight: 400; }
.hint, small { color: var(--muted); font-size: .875rem; font-weight: 400; }
.empty { color: var(--muted); max-width: 44rem; }
code { font-size: .9em; }

.deals { list-style: none; margin: 0; padding: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; }
.deals li + li { border-top: 1px solid var(--line); }
.deals a { display: grid; grid-template-columns: 14rem 11rem 1fr; gap: .125rem 1rem; padding: .75rem 1rem; color: inherit; text-decoration: none; border-left: 4px solid transparent; }
.deals a:hover { background: #f7f9fb; }
.deals .who { font-weight: 600; overflow-wrap: anywhere; }
.deals .stage { color: var(--muted); }
.deals .todo { grid-column: 1 / -1; grid-row: 1; font-size: 1.125rem; font-weight: 600; color: var(--todo); }
.deals li:has(.todo) a { border-left-color: #f0a500; }
.deals li.problem a { border-left-color: var(--stop); }
.deals li.problem .todo { color: var(--stop); }
.deals .facts { color: var(--muted); overflow-wrap: anywhere; }
h1 .stage { font-size: 1rem; font-weight: 400; color: var(--muted); margin-left: .5rem; }

p.todo, p.refusal, p.pass, p.note { margin: 0 0 .75rem; padding: .625rem .875rem; border-radius: 4px; max-width: 48rem; }
p.todo { background: var(--todo-bg); color: var(--todo); font-weight: 600; }
p.refusal { background: var(--stop-bg); color: var(--stop); font-weight: 600; }
p.pass { background: var(--pass-bg); color: var(--pass); }
p.note { background: var(--sheet); border: 1px solid var(--line); }

.split { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 2rem; align-items: start; }
.deal-form { display: grid; gap: .875rem; max-width: 26rem; }
.deal-form.wide { max-width: 48rem; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .9375rem; }
input, select, textarea { font: inherit; font-weight: 400; color: inherit; padding: .5rem .625rem; border: 1px solid #aab3be; border-radius: 4px; background: var(--sheet); width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
textarea[readonly] { background: #f7f9fb; }
button, .button { font: inherit; font-weight: 600; padding: .5625rem 1rem; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; justify-self: start; }
button.quiet { background: transparent; color: inherit; border-color: currentColor; font-weight: 400; padding: .3125rem .75rem; }
header button.quiet { opacity: .82; }

aside { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem; }
aside h2:first-of-type { margin-top: 1rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; margin: .5rem 0 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }
.totals dd { font-size: 1.375rem; }
.events { margin: 0; padding-left: 1.125rem; color: var(--muted); font-size: .9375rem; }

table { border-collapse: collapse; width: 100%; background: var(--sheet); border: 1px solid var(--line); }
th, td { text-align: left; padding: .5rem .75rem; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: .875rem; }
.num { text-align: right; }

body.bare { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login { display: grid; gap: 1rem; width: min(22rem, 100%); background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 1.75rem; }
.login h1 { font-size: 1.375rem; margin: 0; }

@media (max-width: 52rem) {
  .split { grid-template-columns: 1fr; }
  .deals a { grid-template-columns: 1fr; }
  .deals .todo { grid-row: auto; }
  main { padding: 1rem; }
}

.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 48rem; }
.inbox li { background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem; }
.inbox form { display: flex; gap: .75rem; margin-top: 1rem; }
.inbox dl { margin-bottom: .75rem; }
.inbox form { flex-wrap: wrap; align-items: end; }
.inbox form label { flex-basis: 100%; }
.links { list-style: none; margin: 0 0 1rem; padding: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; max-width: 48rem; }
.links li + li { border-top: 1px solid var(--line); }
.links a { display: block; padding: .75rem 1rem; font-weight: 600; }
header .account { opacity: .82; }
.steps { max-width: 48rem; padding-left: 1.25rem; }
.steps li + li { margin-top: .375rem; }
