:root {
  --ink: #111820;
  --ink-soft: #3d4b58;
  --muted: #6b7a86;
  --paper: #ffffff;
  --card: #ffffff;
  --wash: #f4f7fa;
  --line: #dde4ea;
  --brand: #14508c;
  --brand-dk: #0d3763;
  --brand-lt: #1c66ae;
  --brand-soft: #e9f1f9;
  --accent: #ef4323;
  --accent-dk: #c9351a;
  --accent-soft: #fdeae5;
  --red: #c0341c;
  --red-soft: #fae6e1;
  --green: #1c7a46;
  --green-soft: #e2f2e8;
  --amber: #a8760f;
  --amber-soft: #fbf0d9;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(17, 24, 32, 0.05), 0 6px 18px rgba(17, 24, 32, 0.05);
  --shadow-lg: 0 18px 48px rgba(13, 55, 99, 0.18);
  --sans: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --t-xs: 11.5px;
  --t-sm: 12.5px;
  --t-base: 14.5px;
  --t-md: 16px;
  --t-lg: 19px;
  --t-xl: 24px;
  --t-2xl: 30px;
  --lead-tight: 1.25;
  --lead: 1.55;
  --banner-h: 52px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: var(--lead);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--t-base);
  font-feature-settings: 'calt' 1, 'liga' 0;
}

h1, h2, h3, h4 {
  line-height: var(--lead-tight);
  font-weight: 700;
}

h1 {
  font-size: var(--t-2xl);
  letter-spacing: -0.028em;
}

h2 {
  font-size: var(--t-xl);
  letter-spacing: -0.022em;
}

h3 {
  font-size: var(--t-md);
  letter-spacing: -0.015em;
}

h4 {
  font-size: var(--t-base);
  letter-spacing: -0.008em;
}

.tnum, .money, .val, .bal, td.right, th.right, input[type=number] {
  font-variant-numeric: tabular-nums lining-nums slashed-zero;
  font-feature-settings: 'tnum' 1, 'lnum' 1, 'zero' 1;
}

.serif {
  font-family: var(--sans);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
}

.masthead {
  background: #fff;
  padding: 26px 24px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 4px solid var(--brand);
}

.masthead .logo {
  height: 58px;
  width: auto;
  display: block;
}

.mainnav {
  background: var(--brand);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.mainnav .inner {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 0 20px;
  min-height: var(--banner-h);
}

.mainnav .links {
  grid-column: 2;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
}

.mainnav .links a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: 0.14s;
  white-space: nowrap;
  cursor: pointer;
}

.mainnav .links a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mainnav .links a.on {
  background: rgba(255, 255, 255, 0.16);
  border-bottom-color: var(--accent);
}

.mainnav .acct {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 0;
}

.mainnav .acct .nm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.92);
}

.mainnav .acct a, .mainnav .acct button {
  padding: 0;
  border: none;
  background: none;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.85;
  transition: 0.14s;
  cursor: pointer;
}

.mainnav .acct a:hover, .mainnav .acct button:hover {
  opacity: 1;
  text-decoration: underline;
  background: none;
}

.main {
  max-width: 1500px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  margin: 0;
}

.topbar .sp {
  flex: 1;
}

.content {
  padding: 30px;
  max-width: 1500px;
}

.grid {
  display: grid;
  gap: 18px;
}

.g4 {
  grid-template-columns: repeat(4, 1fr);
}

.g3 {
  grid-template-columns: repeat(3, 1fr);
}

.g2 {
  grid-template-columns: 1fr 1fr;
}

.g23 {
  grid-template-columns: 1.7fr 1fr;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 22px;
}

.card > .content {
  padding: 22px;
}

.card h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.kpi .lbl {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}

.kpi .val {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 12px;
  color: var(--ink);
}

.kpi .val.neg {
  color: var(--red);
}

.kpi .val.pos {
  color: var(--green);
}

.card.kpi {
  display: block;
  transition: 0.15s;
  cursor: pointer;
}

.card.kpi:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}

.kpi .sub {
  font-size: 14px;
  margin-top: 8px;
  color: var(--muted);
}

.kpi .sub.up {
  color: var(--green);
}

.kpi .sub.dn {
  color: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

tbody td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.click {
  cursor: pointer;
  transition: 0.12s;
}

tbody tr.click:hover {
  background: var(--brand-soft);
}

tbody tr.pending td {
  background: var(--amber-soft);
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.neg {
  color: var(--red);
}

.pos {
  color: var(--green);
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.tag.blue {
  background: var(--brand-soft);
  color: var(--brand-dk);
}

.tag.gold {
  background: var(--accent-soft);
  color: var(--accent-dk);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.tag.amber {
  background: var(--amber-soft);
  color: #7a5810;
}

.tag.grey {
  background: #eceff3;
  color: var(--ink-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.14s;
  white-space: nowrap;
}

.btn.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.btn.primary:hover {
  background: var(--brand-dk);
  border-color: var(--brand-dk);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dk);
}

.btn.gold {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.gold:hover {
  background: var(--accent-dk);
  border-color: var(--accent-dk);
}

.btn.sm {
  padding: 7px 13px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.btn.danger {
  background: #fff;
  color: var(--red);
  border-color: #e6bdb3;
}

.btn.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ============ TOOLBAR (search sits with the page, not in a ribbon) ==== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar .sp {
  flex: 1;
}

.toolbar .search {
  min-width: 280px;
  flex: 0 1 340px;
  border: 1px solid #c9d4de;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}

.toolbar .search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ============ JOB CARDS — drag to reorder ============ */
.job-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s;
  display: block;
  position: relative;
}

.job-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}

.job-card.drag {
  opacity: 0.45;
}

.job-card.over {
  border-color: var(--accent);
  border-style: dashed;
}

/* Bigger than it looks — the padding makes it a real touch target. */
.job-card .grip {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 10px 12px;
  color: #c2ccd6;
  font-size: 17px;
  letter-spacing: 2px;
  cursor: grab;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  border-radius: var(--radius-sm);
  transition: 0.14s;
}

.job-card .grip:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.job-card .grip:active {
  cursor: grabbing;
}

.job-card.drag {
  opacity: 0.45;
}

/* Where the card will land. */
.job-card.over {
  border-color: var(--accent);
  border-style: dashed;
  background: var(--accent-soft);
}

.job-card .addr {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
  padding-right: 30px;
}

.job-card .owner {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.job-card .ballbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.job-card .bal {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ============ FIELDS / FORMS ============ */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--ink-soft);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid #c9d4de;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: 0.15s;
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* Segmented Deposit / Withdrawal switch */
.seg {
  display: inline-flex;
  border: 1px solid #c9d4de;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg button {
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: var(--ink-soft);
  transition: 0.14s;
}

.seg button + button {
  border-left: 1px solid #c9d4de;
}

.seg button.on {
  background: var(--brand);
  color: #fff;
}

/* File drop box — bigger target, per owner note on W-9 */
.filebox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed #c9d4de;
  border-radius: var(--radius);
  padding: 30px 20px;
  background: var(--wash);
  cursor: pointer;
  transition: 0.15s;
  text-align: center;
}

.filebox:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.filebox .fb-main {
  font-size: 14.5px;
  font-weight: 700;
}

.filebox .fb-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.filebox input {
  display: none;
}

.rowbtns {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.doclink {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}

.doclink:hover {
  text-decoration: underline;
}

.backlink {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 14px;
}

.backlink:hover {
  color: var(--brand);
  text-decoration: underline;
}

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

/* ============ MODAL ============ */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 32, 0.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  margin: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.modal-x {
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}

.modal-x:hover {
  color: var(--ink);
}

.modal-body {
  padding: 24px;
}

.modal-foot {
  padding: 18px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--wash);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Actions stack in one column so every option is the same width and the
   eye reads straight down: main action, alternates, then the way out. */
.act-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.act-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn.block {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
}

.act-pair .btn {
  width: 100%;
  padding: 12px 14px;
  text-align: center;
}

/* Cancel is a way out, not a choice — it reads as text. */
.btn.link {
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px;
  font-size: 13px;
  align-self: center;
}

.btn.link:hover {
  color: var(--ink);
  text-decoration: underline;
  background: none;
}

/* Contractor fee panel, sized to sit inside the modal */
.fee-panel {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 16px 4px;
  margin-bottom: 18px;
}

.fee-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.fee-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.fee-line .sp {
  flex: 1;
}

.fee-line span:nth-child(2) {
  flex: 1;
}

.fee-line .tnum {
  font-variant-numeric: tabular-nums lining-nums slashed-zero;
  font-weight: 600;
}

.fee-line.total {
  background: var(--wash);
  font-weight: 700;
}

.fee-line.grand {
  border-bottom: none;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 14px;
}

.fee-line.grand .tnum {
  font-size: 19px;
  letter-spacing: -0.02em;
}

/* ============ VENDOR COMPLIANCE ============ */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-tile {
  cursor: pointer;
}

.doc-tile .val {
  font-size: 26px;
}

.doc-tile.is-missing {
  border-style: dashed;
}

.doc-tile.is-missing .val {
  font-size: 26px;
}

/* Bigger drop target, per the owner's note on the W-9 box */
.filebox.big {
  padding: 44px 20px;
}

.filebox.big .fb-main {
  font-size: 16px;
}

/* ============ RECONCILE ============ */
.acct-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.acct-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: 0.14s;
}

.acct-tab:hover {
  border-color: var(--brand);
}

.acct-tab.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.acct-tab .pill {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.acct-tab.on .pill {
  background: rgba(255, 255, 255, 0.25);
}

/* Connected banks strip */
.bank-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  flex-wrap: wrap;
}

.bank-strip b {
  font-size: 14.5px;
}

.bank-accts {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Account chips double as the filter — click one to switch the feed. */
.acct-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-soft);
  color: var(--brand-dk);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  transition: 0.14s;
}

.acct-chip:hover {
  border-color: var(--brand);
}

.acct-chip.on {
  background: var(--brand);
  color: #fff;
}

.acct-chip .n {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 0 7px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.acct-chip.on .n {
  background: rgba(255, 255, 255, 0.28);
}

/* Proposed match: bank line on the left, ledger line on the right. */
.recon-row {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.recon-row:last-child {
  border: none;
}

.recon-cell {
  padding: 14px 18px;
}

.recon-cell .v {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.recon-cell .m {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.match-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.match-ic .c {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.match-ic .c.ok {
  background: var(--brand-soft);
  color: var(--brand);
}

.match-ic .c.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ============ CHECK PREVIEW ============
   Pre-printed detail is greyed; what the portal actually prints is inked. */
.check-stock {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 16px 18px;
  font-size: 12.5px;
}

.cs-top {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f5;
  margin-bottom: 14px;
}

.cs-pre {
  color: #b5c0ca;
  font-weight: 700;
  font-size: 11.5px;
}

.cs-date,
.cs-payline,
.cs-words,
.cs-memo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.cs-date {
  justify-content: flex-end;
}

.cs-lbl {
  color: #b5c0ca;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  white-space: nowrap;
}

.cs-fill {
  border-bottom: 1px solid var(--line);
  padding: 2px 6px 3px;
  font-weight: 600;
  min-width: 90px;
}

.cs-fill.grow {
  flex: 1;
}

.cs-box {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cs-micr {
  color: #b5c0ca;
  font-size: 13px;
  letter-spacing: 3px;
  text-align: center;
  padding: 10px 0 12px;
}

.cs-stub {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.modal.narrow {
  max-width: 440px;
}

.modal.wide {
  max-width: 720px;
}

/* ============ SIGN IN ============ */
.masthead.lg {
  padding-bottom: 26px;
}

.masthead.lg .logo {
  height: 76px;
}

#login {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px 72px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: left;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  text-align: center;
}

.login-card p.sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 28px;
  text-align: center;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  font-size: 14px;
}

.login-foot {
  text-align: center;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.login-foot a {
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}

.login-foot a:hover {
  text-decoration: underline;
}

/* ============ SUBNAV ============ */
.subnav {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.subnav .inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
  min-height: 44px;
}

.subnav a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 44px;
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 3px solid transparent;
  transition: 0.14s;
  white-space: nowrap;
  cursor: pointer;
}

.subnav a:hover {
  background: rgba(255, 255, 255, 0.13);
}

.subnav a.on {
  background: rgba(255, 255, 255, 0.16);
  border-bottom-color: var(--accent);
}

/* ============ HOMEOWNER ============ */
.topbar .crumb {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.callout {
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.callout.owe {
  background: var(--red-soft);
  border-color: #eec7bd;
}

.callout.credit {
  background: var(--brand-soft);
  border-color: #c8dcef;
}

.callout.settled {
  background: var(--card);
}

.callout .lbl {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.callout .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 5px;
}

.flashes {
  list-style: none;
  max-width: 1500px;
  width: 100%;
  margin: 18px auto 0;
  padding: 0 30px;
}

.flashes li {
  background: var(--brand-soft);
  border: 1px solid #c8dcef;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--brand-dk);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.flashes li.warning {
  background: var(--amber-soft);
  border-color: #e8d5a8;
  color: #6b5518;
}

/* Role switcher — mockup only, not part of the product. */
.protobar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: #111820;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  flex-wrap: wrap;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
}

.protobar b {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: #8ea6bd;
}

.protobar a {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 5px 11px;
  color: #fff;
  cursor: pointer;
}

.protobar a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.protobar a.on {
  background: #14508c;
  border-color: #14508c;
}

.protobar .note {
  color: #8ea6bd;
  font-weight: 500;
  margin-left: auto;
}

body {
  padding-bottom: 44px;
}

/* ============ DOCUMENT VIEWER ============ */
.viewer-back {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 32, 0.72);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 60px;
}

.viewer {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 900px;
  height: 100%;
  max-height: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
  flex-shrink: 0;
}

.viewer-bar .sp {
  flex: 1;
}

.viewer-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 45%;
}

.viewer-body {
  flex: 1;
  overflow: auto;
  background: #eef2f5;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Stands in for the rendered file until storage is wired. */
.viewer-page {
  background: #fff;
  box-shadow: 0 2px 14px rgba(17, 24, 32, 0.14);
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-page.pdf {
  aspect-ratio: 8.5 / 11;
}

.viewer-page.image {
  min-height: 380px;
}

.viewer-ph {
  text-align: center;
  color: var(--muted);
}

.viewer-ph-i {
  font-size: 46px;
  color: #c2ccd6;
  line-height: 1;
  margin-bottom: 10px;
}

.viewer-ph-n {
  font-size: 13.5px;
  font-weight: 600;
}

.viewer-none {
  text-align: center;
  padding: 60px 20px;
}

.viewer-none-t {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 16px;
}

.screen {
  display: none;
}

.screen.on {
  display: block;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   APP-ONLY  —  nothing below here appears in the owner's mockup.
   The mockup is a static HTML file; a live Flask app needs three things it
   never had to show: screen-reader text, WTForms validation errors, and
   print rules for the three screens the owner asked to be printable.
   Nothing here restyles a mockup rule. Do not put design changes below.
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* WTForms field errors. */
.field-errors {
  margin-top: 6px;
}

.field-errors p,
.field .err,
.login-card .err {
  color: var(--red);
  font-size: 12.5px;
  margin-top: 6px;
  display: block;
}

/* The mockup only ever flashed neutral and warning notices. */
.flashes li.error {
  background: var(--red-soft);
  border-color: #eec7bd;
  color: #87301b;
}

/* ============ PRINT ============
   Owner 2026-08-23 asked for a print/PDF option on the job ledger and the
   vendor spend summary. (The third screen on that list, the job funding
   table, was removed 2026-09-01 as redundant; the vendor roll-up now also
   has real Excel/PDF exports, so this is the ledger's path.) No PDF library
   involved: the browser's
   own "Save as PDF" is the printer, so what prints has to be the page itself,
   cleaned up. */
@media print {
  @page { margin: 14mm; }

  .mainnav, .subnav, .flashes, .toolbar, .noprint,
  .topbar .btn, .topbar form, .filebox, .protobar { display: none !important; }

  /* Keep the masthead: a printed ledger handed to a homeowner or an
     accountant needs to say whose books it is. */
  .masthead { padding: 0 0 10px; border-bottom: 2px solid var(--brand); }

  .card { box-shadow: none; border: 1px solid #ccc; break-inside: auto;
          overflow: visible !important; }
  .content, .topbar { padding-left: 0; padding-right: 0; }

  table { width: 100%; font-size: 11px; }
  thead { display: table-header-group; }   /* repeat headers on every page */
  tr { break-inside: avoid; }
  a { text-decoration: none; color: inherit; }

  /* Money keeps its colour on paper -- "Save as PDF" and any colour printer
     preserve it, and the red/green IS the owner's requested signal. Do NOT
     synthesise a minus sign here: `money` already renders negatives with one,
     and `.neg` also colours positive withdrawal figures, so a ::before would
     produce "--$200.00" in the balance column. */
  body { font-size: 12px; }

  .job-card .grip { display: none !important; }
}

/* A modal, the document viewer and a filtered-out row are all markup Flask
   already rendered, waiting on `hidden`. .modal-back / .viewer-back set
   display:flex, which beats the browser's default [hidden] rule, so say it. */
.modal-back[hidden],
.viewer-back[hidden],
.job-card[hidden],
tr[hidden] {
  display: none !important;
}

/* The mockup drew a placeholder page here and said to swap in the real file
   once storage was wired. It is, so the file itself fills the same box. */
.viewer-page iframe,
.viewer-page img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.viewer-page.image img {
  height: auto;
}

/* The signature pad. Signing captures a typed name AND a drawn PNG
   (app/contracts/signing.py::decode_signature_png refuses an empty one), so
   the mockup's typed-name modal needs the one element a static mockup never
   had to draw: a canvas. It borrows the dashed drop-target look the mockup
   already uses for an input surface (.filebox) rather than inventing a style. */
.sigpad {
  display: block;
  width: 100%;
  height: 160px;
  border: 2px dashed #c9d4de;
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.sigpad + .btn {
  margin-top: 8px;
}

/* A disabled action still occupies its place in the row (the contracts Delete
   button once a signature exists). It has to READ as unavailable, not merely
   fail to respond. */
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn[disabled]:hover {
  background: inherit;
  border-color: var(--line);
}

/* The year filter on Business Expenses is a .seg of LINKS, not buttons: the
   filter is server-rendered, so each option is a real URL you can bookmark or
   hand to someone. His mockup's segs are all JS buttons and so had no reason to
   style an anchor. Same look, same on-state. */
.seg a {
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: var(--ink-soft);
  transition: 0.14s;
  display: inline-flex;
  align-items: center;
}

.seg a + a {
  border-left: 1px solid #c9d4de;
}

.seg a.on {
  background: var(--brand);
  color: #fff;
}

/* ============ BACK LINK IN THE TOPBAR (owner 2026-09-01) ============
   "Add back arrows where appropriate like by a job to all jobs etc."
   The .backlink above already exists for in-content use; in the topbar it sits
   directly over the page title, so it needs to be quieter and tighter than the
   in-content one -- the title is the thing you read, the arrow is the way out. */
.topbar .backlink {
  display: inline-block;
  margin-bottom: 4px;
  font-size: var(--t-sm);
  line-height: 1.2;
}

/* ============ ACCOUNT AVATAR + DROPDOWN (owner 2026-09-01) ============
   "Change password change login to an avatar on top with a dropdown."
   Everything here is the ONE blue: a translucent-white disc on the blue bar,
   and a plain white card underneath on the existing shadow/border tokens. No
   second blue, no green. */
.mainnav .acct {
  position: relative;
  gap: 0;
}

.acct-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.14s;
}

.acct-btn:hover,
.acct-btn[aria-expanded="true"] {
  background: #fff;
  border-color: #fff;
  color: var(--brand);
}

.acct-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.acct-menu {
  position: absolute;
  top: calc(100% - 6px);
  right: 0;
  z-index: 90;
  min-width: 224px;
  padding: 6px 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.acct-menu .acct-who {
  padding: 10px 14px 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.acct-menu .acct-who b {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.acct-menu .acct-who span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
  word-break: break-all;
}

/* Specificity: the inline `.mainnav .acct a` rules above are (0,2,1), so the
   menu's items have to be reached through .mainnav .acct too or they inherit
   white-on-white. */
.mainnav .acct .acct-menu a,
.mainnav .acct .acct-menu button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  opacity: 1;
  cursor: pointer;
  transition: 0.14s;
}

.mainnav .acct .acct-menu a:hover,
.mainnav .acct .acct-menu button:hover,
.mainnav .acct .acct-menu a:focus-visible,
.mainnav .acct .acct-menu button:focus-visible {
  background: var(--brand-soft);
  color: var(--brand-dk);
  text-decoration: none;
  outline: none;
}

/* ============ VENDOR SPEND — free date range + transaction drilldown ====
   Owner 2026-08-31: "vendor amount paid should be a rollup of all past
   transactions with all transactions showing in a dropdown filtered by
   year/date picker (its not a calendar year)". The per-calendar-year columns
   are gone; this is the range picker that replaced them and the drilldown
   that opens in place under a vendor. */

.daterange {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daterange label {
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--muted);
}

.daterange input[type=date] {
  border: 1px solid #c9d4de;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: var(--t-base);
  font-family: inherit;
  /* Money and dates both line up in tabular figures — the same rule the
     ledger columns use, so a range never reads as a different kind of number. */
  font-variant-numeric: tabular-nums lining-nums slashed-zero;
  outline: none;
  transition: 0.15s;
}

.daterange input[type=date]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* The credits line under a Paid figure. Small, and never bold: "paid" is the
   number he asked for and it must stay the one that reads first. */
.sub-note {
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.caret {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s;
}

.caret.open {
  transform: rotate(180deg);
  color: var(--brand);
}

tbody tr.vendor-drill > td {
  padding: 0;
  background: var(--wash);
}

.drill {
  padding: 14px 22px 18px;
}

.drill-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.drill-head .sp {
  flex: 1;
}

.drill-table {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.drill-table thead th {
  padding: 8px 12px;
  background: var(--card);
}

.drill-table tbody td {
  padding: 8px 12px;
  font-size: var(--t-sm);
}

.drill-table tbody tr.drill-total td {
  background: var(--wash);
  font-weight: 700;
  border-bottom: none;
}

/* The all-vendors line at the foot of the register. */
tbody tr.grand-row td {
  background: var(--wash);
  border-top: 2px solid var(--line);
  border-bottom: none;
  font-size: var(--t-base);
}

@media print {
  /* On paper an open drilldown is the point of printing the page, so it stays;
     the caret and the export links are screen furniture and go. */
  .caret, .drill-head, .daterange { display: none !important; }
}
