:root {
  --navy: #01233F;
  --ink: #1c2430;
  --muted: #5b6570;
  --teal: #355A68;
  --ice: #98C6D4;
  --tint: #E8F3F6;
  --paper: #F6F3EE;
  --card: #FFFcf7;
  --line: #D9D3C8;
  --ok: #2C5F4A;
  --warn: #8A6A28;
  --shadow: 0 1px 2px rgba(1,35,63,.06), 0 8px 24px rgba(1,35,63,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 Inter, system-ui, sans-serif; }
button, input, select { font: inherit; }
a { color: var(--teal); }
img { display: block; max-width: 100%; }

header.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
header.topbar .lockup { height: 36px; width: auto; }
header.topbar nav { display: flex; gap: 4px; }
header.topbar nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 500; font-size: 13.5px; letter-spacing: .01em;
}
header.topbar nav a:hover, header.topbar nav a.on { color: var(--navy); background: var(--tint); }
header.topbar .grow { flex: 1; }
header.topbar .who { font-size: 12px; color: var(--muted); text-align: right; }
header.topbar .who b { display: block; color: var(--navy); font-weight: 600; }

.banner {
  background: var(--navy); color: #fff;
  padding: 9px 28px;
  font-size: 12.5px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline;
}
.banner strong { color: var(--ice); font-weight: 600; }
.banner span.sep { opacity: .4; }

main { max-width: 1280px; margin: 0 auto; padding: 28px 28px 80px; }

h1, h2, .serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; letter-spacing: 0; color: var(--navy); }
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 62ch; }

.row { display: flex; gap: 16px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-family: "Instrument Serif", Georgia, serif; font-size: 28px; color: var(--navy); margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=search], select {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink);
}
.btn {
  appearance: none; border: 1px solid var(--navy); background: var(--navy); color: #fff;
  border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 13.5px;
}
.btn:hover { background: #023354; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--tint); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
th { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fbfaf6; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf7f1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.client a, td.client button.link { font-weight: 600; color: var(--navy); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; }
.muted { color: var(--muted); }
.check { width: 28px; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--teal);
}
.pill.ready { background: var(--tint); color: var(--teal); }
.pill.sent { background: #e8f0ea; color: var(--ok); }
.pill.failed { background: #eef0f2; color: var(--muted); }
.pill.unpaid { background: #f3efe4; color: var(--warn); }
.pill.paid { background: #e8f0ea; color: var(--ok); }
.pill.warn { background: #f3efe4; color: var(--warn); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.letter {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px;
  min-height: 480px;
}
.letter .who { font-size: 13px; color: var(--muted); margin: 0 0 2px; }
.letter h2 { margin: 0 0 18px; }
.letter .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 16px 0 22px; font-size: 13.5px; }
.letter .meta b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.letter table th { background: transparent; }
.pdf-frame { width: 100%; height: 640px; border: 0; background: #fff; }

.queue { list-style: none; margin: 0; padding: 0; }
.queue li {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.queue li:hover, .queue li.on { background: var(--tint); }
.queue .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.mail { padding: 18px 20px; }
.mail pre { white-space: pre-wrap; font: 13.5px/1.55 Inter, system-ui, sans-serif; margin: 10px 0 0; }

.placeholder { padding: 48px 28px; text-align: center; }
.placeholder h2 { margin: 0 0 8px; }
.signin { max-width: 420px; margin: 12vh auto; text-align: center; padding: 40px 28px; }
.signin img { margin: 0 auto 18px; height: 48px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(1,35,63,.45);
  display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px;
}
.modal { background: var(--card); border-radius: 14px; max-width: 520px; width: 100%; padding: 24px 24px 20px; box-shadow: 0 16px 60px rgba(1,35,63,.25); }
.modal h2 { margin: 0 0 8px; font-size: 28px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal input[type=text] { width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); }

.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  header.topbar { padding: 10px 14px; gap: 10px; }
  header.topbar nav { display: none; }
  main { padding: 18px 14px 60px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  h1 { font-size: 28px; }
  .banner { padding: 8px 14px; }
  .pdf-frame { height: 420px; }
  th.sm-hide, td.sm-hide { display: none; }
}

.mobile-nav {
  display: none;
  position: sticky; top: 57px; z-index: 15;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 6px 10px; gap: 4px; overflow-x: auto;
}
.mobile-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 500; font-size: 13px; white-space: nowrap; }
.mobile-nav a.on { color: var(--navy); background: var(--tint); }
@media (max-width: 900px) { .mobile-nav { display: flex; } header.topbar .who { display: none; } }

.pdf-paper {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 32px 36px 28px; box-shadow: var(--shadow); min-height: 520px;
  font-size: 13px; color: var(--navy);
}
.pdf-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1.5px solid var(--navy); padding-bottom: 12px; margin-bottom: 18px; }
.pdf-brand { font-family: "Instrument Serif", Georgia, serif; font-size: 20px; }
.pdf-addr { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pdf-title { font-family: "Instrument Serif", Georgia, serif; font-size: 28px; }
.pdf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pdf-kv { margin-bottom: 6px; }
.pdf-kv b, .pdf-paper b { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: block; }
.pdf-lines { margin-top: 18px; border-top: 1px solid var(--line); }
.pdf-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pdf-line.head { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pdf-line.total { border-bottom: 0; font-weight: 700; font-size: 15px; padding-top: 12px; }
.pdf-foot { margin-top: 28px; font-size: 10px; color: var(--muted); }

.invoice-cards { display: none; }
.invoice-cards article {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
}
.invoice-cards .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.invoice-cards .amt { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.invoice-cards .pills { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .desktop-table { display: none; }
  .invoice-cards { display: block; }
  .banner .rest { display: none; }
}

.btn:disabled { opacity: .4; filter: grayscale(.2); }

/* Richer teal used on invoices and the schedule, matching the website palette. */
:root {
  --rise-teal: #63CDC7;
  --rise-teal-deep: #1A6F6A;
  --rise-mint: #E6F7F6;
}

.schedule-table td.brand { font-weight: 600; color: var(--navy); }
.schedule-table .lines-preview { color: var(--muted); font-size: 12.5px; max-width: 360px; }
.schedule-table tr.held td { background: #f4f2ed; color: var(--muted); }
.schedule-table tr.open td { background: var(--rise-mint); }
.schedule-table tr.held.open td { background: #f4f2ed; }
.pill.held { background: #eef0f2; color: var(--muted); }
.pill.scheduled { background: var(--tint); color: var(--teal); }
.pill.draft { background: #f3efe4; color: var(--warn); }
.pill.approved, .pill.ready { background: var(--rise-mint); color: var(--rise-teal-deep); }
.charge-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px 14px; margin: 10px 0 18px; box-shadow: var(--shadow);
}
.editor h3 { margin: 0 0 4px; font-size: 22px; }
.editor .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.editor table { margin: 0 0 10px; }
.editor td { vertical-align: middle; }
.editor input[type=text], .editor input[type=number] {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
.editor input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
.editor .line-actions { display: flex; gap: 6px; justify-content: flex-end; }
.editor .totals { display: flex; justify-content: flex-end; gap: 18px; align-items: baseline; padding: 8px 4px 12px; }
.editor .totals .amt { font-family: "Instrument Serif", Georgia, serif; font-size: 28px; color: var(--navy); }
.editor .locked-note {
  background: var(--rise-mint); color: var(--rise-teal-deep);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 10px;
}
.editor .defaults { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.audit { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.audit details { cursor: pointer; }
.audit li { margin: 4px 0; }
.linkish { background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; padding: 0; font-weight: 600; }
.held-reason { font-size: 12.5px; color: var(--muted); }

/* Letter-sized invoice preview (matches the in-app PDF). */
.inv-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; box-shadow: var(--shadow);
  color: var(--navy); font-size: 13px;
}
.inv-band { background: var(--navy); color: #fff; padding: 22px 28px 18px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.inv-band img.wordmark { height: 36px; width: auto; }
.inv-band .paradigm-mark { color: #fff; }
.inv-band .paradigm-mark .p1 { font-family: Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: .12em; font-size: 18px; }
.inv-band .paradigm-mark .p2 { color: var(--rise-teal); letter-spacing: .16em; font-size: 10px; font-weight: 600; margin-top: 2px; }
.inv-band .inv-kicker { text-align: right; }
.inv-band .inv-kicker .title { font-family: Inter, system-ui, sans-serif; font-weight: 700; letter-spacing: .08em; font-size: 22px; color: var(--rise-teal); }
.inv-band .inv-kicker .sub { color: var(--ice); font-size: 11.5px; margin-top: 4px; }
.inv-accent { height: 7px; background: var(--rise-teal); }
.inv-body { padding: 22px 28px 8px; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.inv-submitted { color: var(--muted); font-size: 12.5px; }
.inv-duebox { background: var(--rise-mint); border-left: 5px solid var(--rise-teal); padding: 10px 16px 12px; min-width: 200px; }
.inv-duebox .k { font-size: 10px; letter-spacing: .08em; font-weight: 700; color: var(--rise-teal-deep); }
.inv-duebox .v { font-family: Inter, system-ui, sans-serif; font-weight: 700; font-size: 26px; color: var(--navy); line-height: 1.15; margin-top: 2px; }
.inv-duebox .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.inv-meta { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid #d4e4e3; border-bottom: 1px solid #d4e4e3; margin-bottom: 16px; }
.inv-meta b { display: block; font-size: 10px; letter-spacing: .08em; color: var(--rise-teal-deep); font-weight: 700; margin-bottom: 4px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th { background: var(--navy); color: var(--rise-teal); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; }
.inv-table th.num, .inv-table td.num { text-align: right; }
.inv-table td { padding: 8px 12px; border-bottom: 0; }
.inv-table tbody tr:nth-child(odd) td { background: var(--rise-mint); }
.inv-sub { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 12px 6px; color: var(--rise-teal-deep); }
.inv-total { display: flex; justify-content: flex-end; margin: 4px 0 18px; }
.inv-total span { background: var(--navy); color: #fff; display: flex; gap: 28px; align-items: baseline; padding: 8px 16px; min-width: 200px; justify-content: space-between; }
.inv-total .lab { color: var(--rise-teal); font-size: 10px; letter-spacing: .08em; font-weight: 700; }
.inv-total .val { font-weight: 700; font-size: 16px; }
.inv-footer { background: var(--navy); color: var(--ice); padding: 14px 28px 16px; display: flex; justify-content: space-between; gap: 16px; font-size: 11px; border-top: 4px solid var(--rise-teal); }
.inv-footer .who { color: var(--rise-teal); font-weight: 600; text-align: right; }

@media (max-width: 900px) {
  .inv-meta { grid-template-columns: 1fr; }
  .inv-band { flex-direction: column; }
  .inv-band .inv-kicker { text-align: left; }
  .inv-footer { flex-direction: column; }
  .editor input[type=number] { min-width: 0; }
}

.nowrap { white-space: nowrap; }
.btn.google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line);
  height: 44px; margin-top: 8px;
}
.btn.google:hover { background: var(--tint); }
.btn.google svg { flex: 0 0 auto; }
.signin-msg { font-size: 13px; min-height: 18px; margin: 12px 0 0; color: var(--warn); }
header.topbar .who { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
header.topbar .who .btn { font-size: 12px; padding: 4px 10px; }
