
:root {
  --ink: #0c2f4c; --mist: #5a7184; --line: #dfe6ec; --bg: #f6f8fa;
  --card: #ffffff; --accent: #0b4f9e; --good: #17794d; --bad: #b3261e;
  --warn: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
.bar { max-width: 1040px; margin: 0 auto; padding: .9rem 1.2rem; display: flex;
  align-items: baseline; gap: 1.4rem; flex-wrap: wrap; }
.bar h1 { font-size: 1.05rem; margin: 0; letter-spacing: .02em; }
.bar nav { display: flex; gap: 1.1rem; margin-left: auto; flex-wrap: wrap; }
.bar nav a { text-decoration: none; color: var(--mist); font-size: .92rem; }
.bar nav a.here { color: var(--ink); font-weight: 600; }
main { max-width: 1040px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.card h2 { font-size: 1rem; margin: 0 0 .8rem; letter-spacing: .01em; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 600; color: var(--mist); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em; padding: .35rem .5rem; }
td { padding: .45rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--mist); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  font-size: .75rem; border: 1px solid var(--line); }
.pill.overdue { background: #fdeceb; border-color: #f3c2bf; color: var(--bad); }
.pill.auto { background: #eaf4ee; border-color: #bfdcc9; color: var(--good); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: .8rem .9rem; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--mist); font-size: .8rem; }
form.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
label { display: block; font-size: .78rem; color: var(--mist); margin-bottom: .2rem; }
input, select, textarea { font: inherit; padding: .42rem .55rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink); }
input[type=text], input[type=date], select { min-width: 8rem; }
button { font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; cursor: pointer; }
button.ghost { background: #fff; color: var(--accent); }
button.link { background: none; border: none; color: var(--accent); padding: 0;
  cursor: pointer; font-size: .85rem; text-decoration: underline; }
.notice { padding: .7rem .9rem; border-radius: 8px; border: 1px solid #bfdcc9;
  background: #eaf4ee; margin-bottom: 1rem; font-size: .92rem; }
.notice.bad { border-color: #f3c2bf; background: #fdeceb; }
.caveat { font-size: .85rem; color: var(--warn); margin-top: .5rem; }
.signin { max-width: 22rem; margin: 5rem auto; }
.inline { display: inline; }
.wide { width: 100%; }
.gap { margin-top: 1rem; }
.gap-below { margin-bottom: .9rem; }
.gap-big { margin-top: 1.4rem; }
.tiny { font-size: .78rem; }
label.check { display: flex; align-items: center; gap: .45rem; margin-top: .7rem;
  font-size: .85rem; color: var(--ink); }
label.check input { margin: 0; }
ul.codes { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .4rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
ul.codes li { background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: .5rem .7rem; text-align: center; }
ul.codes code { font-size: 1rem; letter-spacing: .04em; }
code { background: var(--bg); padding: .1rem .3rem; border-radius: 4px; font-size: .88rem; }
td.receipts { white-space: nowrap; }
.receipt { display: inline-flex; align-items: center; gap: .25rem; margin-right: .5rem; }
.thumb { height: 2.2rem; width: auto; border: 1px solid var(--line); border-radius: 4px;
  vertical-align: middle; object-fit: cover; }
.attach { display: inline-flex; align-items: center; gap: .3rem; }
.attach input[type=file] { font-size: .78rem; max-width: 11rem; }

/* --- the dashboard ----------------------------------------------------- */
/* Every colour a chart uses is declared here rather than on the element.
   smepoint.com's policy says style-src 'self' with no 'unsafe-inline', so a
   style="" attribute on an SVG rect is not a shortcut -- it is a bar that
   silently does not render. Geometry goes in attributes, colour goes here. */
.hero { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hero .stat b { font-size: 1.7rem; }
.viz { overflow-x: auto; }
.viz svg { display: block; max-width: 100%; height: auto; }
.viz .plot { fill: none; }
.viz .gridline { stroke: var(--line); stroke-width: 1; }
.viz .zero { stroke: #c6d0d8; stroke-width: 1; }
.viz .tick { fill: var(--mist); font-size: 11px; font-family: inherit; }
.viz .tick.mid { text-anchor: middle; }
.viz .tick.end { text-anchor: end; }
.viz .s1 { fill: #2a78d6; }
.viz .s2 { fill: #eb6834; }
.viz .lbl { fill: var(--ink); font-size: 11px; font-family: inherit;
  text-anchor: middle; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: 0 0 .5rem;
  font-size: .85rem; color: var(--mist); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .7rem; height: .7rem; border-radius: 3px; display: inline-block; }
.legend i.s1 { background: #2a78d6; }
.legend i.s2 { background: #eb6834; }
.legend .spacer { margin-left: auto; }
details.table { margin-top: .9rem; }
details.table summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
.barline { display: grid; grid-template-columns: 11rem 1fr 6rem; gap: .7rem;
  align-items: center; padding: .3rem 0; font-size: .9rem; }
.barline .track { background: var(--bg); border-radius: 4px; height: .75rem; }
.barline .fill { background: #2a78d6; border-radius: 4px; height: .75rem; display: block; }
.barline .fill.out { background: #eb6834; }
.barline .amt { text-align: right; font-variant-numeric: tabular-nums; }
.barline .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- the calendar ------------------------------------------------------ */
.calbar { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  margin-bottom: .9rem; }
.calbar h2 { margin: 0; }
.calbar .spacer { margin-left: auto; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; }
.cal .dow { background: var(--bg); color: var(--mist); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; padding: .4rem .5rem; }
.cal .day { background: var(--card); min-height: 6.2rem; padding: .35rem .45rem; }
.cal .day.out { background: #fafcfd; }
.cal .day.today { background: #eef5fd; }
.cal .dnum { font-size: .78rem; color: var(--mist); font-variant-numeric: tabular-nums; }
.cal .dnum .wd { display: none; }
.cal .day.today .dnum { color: var(--accent); font-weight: 700; }
.cal .ev { display: block; font-size: .74rem; line-height: 1.3; margin-top: .25rem;
  padding: .15rem .35rem; border-radius: 4px; border-left: 3px solid #2a78d6;
  background: #eef5fd; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.pay { border-left-color: #eb6834; background: #fdf1ec; }
.cal .ev.proj { background: #fbf6f3; color: var(--mist); border-left-style: dotted; }
.cal .ev.overdue { border-left-color: var(--bad); background: #fdeceb; }
.cal .ev.done { color: var(--mist); text-decoration: line-through; background: var(--bg);
  border-left-color: var(--line); }
.calkey { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: .8rem;
  font-size: .8rem; color: var(--mist); }
.calkey span { display: inline-flex; align-items: center; gap: .4rem; }
.calkey i { width: .7rem; height: .7rem; border-radius: 3px; display: inline-block;
  border-left: 3px solid #2a78d6; background: #eef5fd; }
.calkey i.pay { border-left-color: #eb6834; background: #fdf1ec; }
.calkey i.proj { border-left-color: #eb6834; background: #fbf6f3; border-left-style: dotted; }
@media (max-width: 720px) {
  .cal { display: block; background: none; border: none; }
  .cal .dow { display: none; }
  .cal .day { min-height: 0; border-bottom: 1px solid var(--line); }
  .cal .day.empty, .cal .day.bare { display: none; }
  .cal .dnum .wd { display: inline; }
  .barline { grid-template-columns: 8rem 1fr 5rem; }
}
.barline .fill.w0 { width: 0%; }
.barline .fill.w1 { width: 1%; }
.barline .fill.w2 { width: 2%; }
.barline .fill.w3 { width: 3%; }
.barline .fill.w4 { width: 4%; }
.barline .fill.w5 { width: 5%; }
.barline .fill.w6 { width: 6%; }
.barline .fill.w7 { width: 7%; }
.barline .fill.w8 { width: 8%; }
.barline .fill.w9 { width: 9%; }
.barline .fill.w10 { width: 10%; }
.barline .fill.w11 { width: 11%; }
.barline .fill.w12 { width: 12%; }
.barline .fill.w13 { width: 13%; }
.barline .fill.w14 { width: 14%; }
.barline .fill.w15 { width: 15%; }
.barline .fill.w16 { width: 16%; }
.barline .fill.w17 { width: 17%; }
.barline .fill.w18 { width: 18%; }
.barline .fill.w19 { width: 19%; }
.barline .fill.w20 { width: 20%; }
.barline .fill.w21 { width: 21%; }
.barline .fill.w22 { width: 22%; }
.barline .fill.w23 { width: 23%; }
.barline .fill.w24 { width: 24%; }
.barline .fill.w25 { width: 25%; }
.barline .fill.w26 { width: 26%; }
.barline .fill.w27 { width: 27%; }
.barline .fill.w28 { width: 28%; }
.barline .fill.w29 { width: 29%; }
.barline .fill.w30 { width: 30%; }
.barline .fill.w31 { width: 31%; }
.barline .fill.w32 { width: 32%; }
.barline .fill.w33 { width: 33%; }
.barline .fill.w34 { width: 34%; }
.barline .fill.w35 { width: 35%; }
.barline .fill.w36 { width: 36%; }
.barline .fill.w37 { width: 37%; }
.barline .fill.w38 { width: 38%; }
.barline .fill.w39 { width: 39%; }
.barline .fill.w40 { width: 40%; }
.barline .fill.w41 { width: 41%; }
.barline .fill.w42 { width: 42%; }
.barline .fill.w43 { width: 43%; }
.barline .fill.w44 { width: 44%; }
.barline .fill.w45 { width: 45%; }
.barline .fill.w46 { width: 46%; }
.barline .fill.w47 { width: 47%; }
.barline .fill.w48 { width: 48%; }
.barline .fill.w49 { width: 49%; }
.barline .fill.w50 { width: 50%; }
.barline .fill.w51 { width: 51%; }
.barline .fill.w52 { width: 52%; }
.barline .fill.w53 { width: 53%; }
.barline .fill.w54 { width: 54%; }
.barline .fill.w55 { width: 55%; }
.barline .fill.w56 { width: 56%; }
.barline .fill.w57 { width: 57%; }
.barline .fill.w58 { width: 58%; }
.barline .fill.w59 { width: 59%; }
.barline .fill.w60 { width: 60%; }
.barline .fill.w61 { width: 61%; }
.barline .fill.w62 { width: 62%; }
.barline .fill.w63 { width: 63%; }
.barline .fill.w64 { width: 64%; }
.barline .fill.w65 { width: 65%; }
.barline .fill.w66 { width: 66%; }
.barline .fill.w67 { width: 67%; }
.barline .fill.w68 { width: 68%; }
.barline .fill.w69 { width: 69%; }
.barline .fill.w70 { width: 70%; }
.barline .fill.w71 { width: 71%; }
.barline .fill.w72 { width: 72%; }
.barline .fill.w73 { width: 73%; }
.barline .fill.w74 { width: 74%; }
.barline .fill.w75 { width: 75%; }
.barline .fill.w76 { width: 76%; }
.barline .fill.w77 { width: 77%; }
.barline .fill.w78 { width: 78%; }
.barline .fill.w79 { width: 79%; }
.barline .fill.w80 { width: 80%; }
.barline .fill.w81 { width: 81%; }
.barline .fill.w82 { width: 82%; }
.barline .fill.w83 { width: 83%; }
.barline .fill.w84 { width: 84%; }
.barline .fill.w85 { width: 85%; }
.barline .fill.w86 { width: 86%; }
.barline .fill.w87 { width: 87%; }
.barline .fill.w88 { width: 88%; }
.barline .fill.w89 { width: 89%; }
.barline .fill.w90 { width: 90%; }
.barline .fill.w91 { width: 91%; }
.barline .fill.w92 { width: 92%; }
.barline .fill.w93 { width: 93%; }
.barline .fill.w94 { width: 94%; }
.barline .fill.w95 { width: 95%; }
.barline .fill.w96 { width: 96%; }
.barline .fill.w97 { width: 97%; }
.barline .fill.w98 { width: 98%; }
.barline .fill.w99 { width: 99%; }
.barline .fill.w100 { width: 100%; }
