/* Colours come from the theme (theming/themes.py): base.html defines --color-<role> and
   --use-<part>. These names are what the rules below use; tints and hover shades are
   mixed here so every theme gets matching ones. */
:root {
  --page-bg: var(--use-page-bg);
  --text: var(--use-text);
  --muted: var(--use-text-muted);
  --heading: var(--use-heading);
  --link: var(--use-link);
  --brand: var(--use-banner-bg);
  --brand-text: var(--use-banner-text);
  --nav-bg: var(--use-sidenav-bg);
  --nav-text: var(--use-sidenav-text);
  --nav-muted: var(--use-sidenav-muted);
  --nav-accent: var(--use-sidenav-active);
  --nav-hover: color-mix(in srgb, var(--nav-accent) 7%, var(--nav-bg));
  --nav-active: color-mix(in srgb, var(--nav-accent) 13%, var(--nav-bg));
  --border: color-mix(in srgb, var(--use-divider) 35%, var(--page-bg));
  --input-border: var(--use-input-border);
  --input-bg: var(--use-input-bg);
  --menu-text: var(--use-topmenu-text);
  --menu-active: var(--use-topmenu-active);
  --menu-border: color-mix(in srgb, var(--use-topmenu-border) 35%, var(--page-bg));
  --th-bg: var(--use-table-header-bg);
  --th-text: var(--use-table-header-text);
  --btn-bg: var(--use-button-bg);
  --btn-text: var(--use-button-text);
  --btn-hover: color-mix(in srgb, var(--btn-bg) 82%, black);
  --btn2-bg: var(--use-button-secondary-bg);
  --btn2-text: var(--use-button-secondary-text);
  --disabled: var(--use-disabled);
  --focus: var(--use-focus-ring);
  --ok: var(--use-msg-success);
  --ok-bg: color-mix(in srgb, var(--ok) 13%, var(--page-bg));
  --warn: var(--use-msg-warning);
  --warn-bg: color-mix(in srgb, var(--warn) 15%, var(--page-bg));
  --warn-soft: color-mix(in srgb, var(--warn) 7%, var(--page-bg));
  --err: var(--use-msg-error);
  --err-bg: color-mix(in srgb, var(--err) 10%, var(--page-bg));
  --err-strong-bg: color-mix(in srgb, var(--err) 20%, var(--page-bg));
  --info: var(--use-msg-info);
  --info-bg: color-mix(in srgb, var(--info) 11%, var(--page-bg));
  --panel-accent: var(--use-panel-accent);
  --panel-bg: color-mix(in srgb, var(--panel-accent) 7%, var(--page-bg));
  --panel-border: color-mix(in srgb, var(--panel-accent) 22%, var(--page-bg));
  --badge-new: var(--use-badge-new);
  --badge-progress: var(--use-badge-progress);
  --badge-alert: var(--use-badge-alert);
  --badge-text: var(--use-button-text);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  display: flex;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
}
h1, h2, h3 { font-family: var(--font-heading); color: var(--heading); }
.client a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Side navigation */
.sidenav {
  flex: 0 0 242px;
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  color: var(--nav-text);
  border-right: 1px solid var(--border);
}

/* Signed-in user / log in, pinned to the bottom of the sidenav */
.account {
  margin-top: auto;
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .9em;
}
.account-email { display: block; margin-bottom: .25rem; overflow-wrap: anywhere; color: var(--nav-muted); }
.account form { margin: 0; }
.sidenav .account a:not(.banner) { padding: 0; border: 0; display: inline; color: var(--link); font-weight: 600; }
.sidenav .account a:not(.banner):hover { background: none; text-decoration: underline; }
button.link { padding: 0; background: none; color: var(--link); font-weight: 600; }
button.link:hover { background: none; text-decoration: underline; }

/* Login pages */
.login { display: grid; gap: .6rem; max-width: 24rem; justify-items: start; margin-top: 1rem; }
.login p { margin: 0; }
.login label { font-weight: 600; }
.login input[type=email], .login input[type=text], .login input[type=password] {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font: inherit;
}
.login .errorlist { margin: 0; padding: 0; list-style: none; color: var(--err); }
.login .hint a { color: var(--link); }

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  background: var(--brand);
  color: var(--brand-text);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .15em;
  padding-left: .15em; /* balances the trailing letter-spacing so the text stays centred */
  text-decoration: none;
}

.sidenav ul { list-style: none; margin: 0; padding: .5rem 0; }
.sidenav ul ul { padding: 0; }

.sidenav a:not(.banner) {
  display: block;
  padding: .6rem 1.25rem;
  border-left: 3px solid transparent;
  color: inherit;
  text-decoration: none;
}
.sidenav ul ul a:not(.banner) { padding-left: 2.25rem; font-size: .95em; }
.sidenav ul ul ul a:not(.banner) { padding-left: 3.25rem; }
.sidenav ul ul ul ul a:not(.banner) { padding-left: 4.25rem; font-size: .92em; } /* e.g. payables → payroll → timesheets → reports */
.sidenav ul ul ul ul ul a:not(.banner) { padding-left: 5.25rem; } /* → Jobber format → by staff */
.sidenav ul ul ul ul ul ul a:not(.banner) { padding-left: 6.25rem; } /* → by staff → & job id */
.sidenav a:not(.banner):hover { background: var(--nav-hover); }
.sidenav a[aria-current="page"] {
  background: var(--nav-active);
  border-left-color: var(--nav-accent);
  font-weight: 600;
}

/* Accordion groups (payroll, reports, jobs, hr): static/rad/sidenav.js */
.nav-group-head { display: flex; align-items: stretch; }
.nav-group-head a:not(.banner) { flex: 1; min-width: 0; }
.nav-toggle {
  flex: 0 0 auto;
  padding: 0 1rem;
  border-radius: 0;
  background: none;
  color: var(--nav-muted);
}
.nav-toggle:hover { background: var(--nav-hover); color: var(--nav-text); }
.nav-group-head:has(> a[aria-current="page"]) .nav-toggle { background: var(--nav-active); }
.nav-toggle .chevron {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
}
.nav-group.open > .nav-group-head .chevron { transform: rotate(45deg); }
.sidenav.accordion .nav-group:not(.open) > ul { display: none; }

/* Client area */
.client { flex: 1; min-width: 0; padding: 2rem; }
.client h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }

@media (max-width: 640px) {
  body { flex-direction: column; }
  .sidenav { flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .account { margin-top: 0; display: flex; align-items: baseline; gap: .75rem; }
  .account-email { margin: 0; flex: 1; min-width: 0; }
  .client { padding: 1.25rem 1rem; }
}

/* Banner menu across the top of a tool */
.menubar {
  display: flex;
  gap: .25rem;
  margin: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--menu-border);
}
.menubar a {
  padding: .6rem 1rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--menu-text);
  text-decoration: none;
}
.menubar a:hover { background: var(--nav-hover); }
.menubar a[aria-current="page"] { border-bottom-color: var(--menu-active); color: var(--menu-active); font-weight: 600; }

/* Forms */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.upload { display: grid; gap: .75rem; max-width: 40rem; justify-items: start; }

/* Timesheet upload tools: drop zone + camera */
.upload-tools { display: flex; flex-wrap: wrap; gap: .75rem; width: 100%; }
.dropzone {
  flex: 1 1 18rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 9rem;
  padding: 1.25rem;
  border: 2px dashed var(--input-border);
  border-radius: 8px;
  background: var(--nav-bg);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--nav-accent); background: var(--nav-active); }
.dropzone:focus-within, .camera:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone-title { font-weight: 600; }
.dropzone-sub { font-size: .9em; color: var(--muted); }
.camera {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.25rem;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  cursor: pointer;
}
.camera svg { width: 1.4rem; height: 1.4rem; fill: currentColor; }

/* Phones and tablets get the camera; mouse/trackpad devices get drag and drop */
.only-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .only-pointer { display: none; }
  .only-touch { display: inline; }
  .dropzone { min-height: 5rem; }
}
@media (hover: hover) and (pointer: fine) {
  .camera { display: none; }
}

.pending { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: .4rem; }
.pending li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.pending img { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: 4px; }
.pending span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pending .remove {
  padding: .1rem .55rem;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}
.pending .remove:hover { background: var(--nav-hover); }
.upload .hint { margin: 0; font-size: .9em; color: var(--muted); }
.upload .errorlist { margin: 0; padding: .6rem .9rem; list-style: none; background: var(--err-bg); color: var(--err); border-radius: 4px; }
button {
  padding: .5rem 1.25rem;
  border: 0;
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  cursor: pointer;
}
button:hover { background: var(--btn-hover); }
button:disabled { background: var(--disabled); cursor: not-allowed; }

/* Messages */
.messages { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.messages li { padding: .6rem .9rem; border-radius: 4px; background: var(--ok-bg); overflow-wrap: anywhere; }
.messages li.info { background: var(--info-bg); }
.messages li.error { background: var(--err-bg); color: var(--err); }
.messages li.warning { background: var(--warn-bg); color: var(--warn); }

/* Data tables */
.totals { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 .5rem; }
.totals div { padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 6px; min-width: 10rem; }
.totals dt { font-size: .85em; color: var(--muted); }
.totals dd { margin: .2rem 0 0; font-size: 1.3rem; font-weight: 600; }
.totals small { font-size: .7em; font-weight: 400; color: var(--muted); }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .9em; }
table.data th, table.data td { padding: .45rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--th-bg); color: var(--th-text); font-weight: 600; white-space: nowrap; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .nowrap { white-space: nowrap; }
table.data .bad { color: var(--err); font-weight: 600; }
.pager { display: flex; gap: 1rem; margin-top: 1rem; align-items: baseline; }
.pager a { color: var(--link); font-weight: 600; }

/* Timesheet review */
.filters { margin: 0 0 .5rem; }
.filters a { color: inherit; }
.filters a[aria-current="page"] { font-weight: 600; color: var(--link); }
.status { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .85em; background: var(--nav-bg); white-space: nowrap; }
.status-review { background: var(--warn-bg); color: var(--warn); }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-failed { background: var(--err-bg); color: var(--err); }
.bad-text { color: var(--err); font-weight: 600; }
.status-manual { background: var(--info-bg); color: var(--info); }
td.actions { white-space: nowrap; }
.data tr.selected td { background: var(--nav-active); }
td.actions form { display: inline; margin-left: .5rem; }
td.actions a { color: var(--link); font-weight: 600; margin-left: .5rem; }

.review-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem 1.25rem; margin-bottom: 1rem; }
.review-head > a { color: var(--link); }
.page-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.page-chips a { padding: .2rem .65rem; border: 1px solid var(--border); border-radius: 999px; color: inherit; text-decoration: none; font-size: .9em; }
.page-chips a.done { background: var(--ok-bg); }
.page-chips a[aria-current="page"] { border-color: var(--menu-active); font-weight: 600; }

.review { display: grid; grid-template-columns: minmax(260px, 4fr) 8fr; gap: 1.25rem; align-items: start; }
.review-image { position: sticky; top: 1rem; }
.review-image img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; cursor: zoom-in; }
.review-form { min-width: 0; }
.header-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem .75rem; border: 0; padding: 0; margin: 0 0 .5rem; }
.header-fields label { display: grid; gap: .2rem; font-size: .85em; color: var(--muted); }
.header-fields .checkbox-row { align-self: end; font-weight: 400; padding-bottom: .35rem; }
.review-form input[type=text], .review-form input[type=date], .review-form input[type=time], .review-form input[type=number] {
  width: 100%; min-width: 0; padding: .3rem .4rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; color: var(--text); background: var(--input-bg);
}
.review-form input:disabled { background: var(--nav-bg); color: var(--text); }
table.entries { font-size: .85em; }
table.entries th, table.entries td { padding: .3rem .35rem; vertical-align: middle; }
table.entries input[type=number] { width: 3.2rem; }
table.entries input[name$='-travel_minutes'] { width: 4rem; }
table.entries input[type=time] { width: 7.4rem; }
.time-adjust { display: inline-flex; align-items: center; gap: .2rem; }
.time-adjust button { padding: .05rem .3rem; font-size: .8em; line-height: 1.3; white-space: nowrap; }
table.entries input[type=date] { width: 8.6rem; }
table.entries input[name$='-worker'] { min-width: 8.5rem; }
table.entries td.check { text-align: center; }
table.entries td.written { color: var(--muted); font-size: .9em; }
table.entries tfoot td { font-weight: 600; border-bottom: 0; }
tr.row-check > td { background: var(--warn-soft); }
tr.row-error > td { background: var(--err-bg); }
tr.row-excluded > td { opacity: .55; }
tr.row-new > td { background: var(--nav-bg); }
tr.row-notes > td { padding-top: 0; }
.flag { display: inline-block; margin: 0 .35rem .25rem 0; padding: .1rem .45rem; border-radius: 4px; font-size: .82em; background: var(--warn-bg); color: var(--warn); }
.flag.bad { background: var(--err-strong-bg); color: var(--err); font-weight: 600; }
.banner-ok, .banner-bad { margin: 0 0 .75rem; padding: .6rem .9rem; border-radius: 4px; }
.banner-ok { background: var(--ok-bg); }
.banner-bad { background: var(--err-bg); color: var(--err); }
.payroll-note { margin: 0 0 .75rem; padding: .6rem .9rem; border-radius: 4px; background: var(--ok-bg); }
.payroll-note-bad { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.payroll-note summary { cursor: pointer; font-weight: 600; }
.payroll-note ul { margin: .5rem 0; padding-left: 1.25rem; }
.payroll-note .hint { margin: 0; }
.review-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1rem; }
button.secondary { background: var(--btn2-bg); color: var(--btn2-text); border: 1px solid var(--btn2-text); }
button.secondary:hover { background: var(--nav-hover); }

@media (max-width: 1000px) {
  .review { grid-template-columns: 1fr; }
  .review-image { position: static; max-width: 40rem; }
}
.banner-bad a, .banner-ok a { color: inherit; font-weight: 600; }

/* Settings */
.settings-section { max-width: 46rem; margin-top: 1rem; padding: 1.25rem 1.5rem; background: var(--panel-bg); border: 1px solid var(--panel-border); border-left: 4px solid var(--panel-accent); border-radius: 8px; }
.settings-section h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.settings-section h3 { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.settings-section > .status { margin: .25rem 0 .75rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-grid[hidden] { display: none; }
/* email settings: "same account as outgoing", and each account's test below its own save */
.settings-section .inline-check { display: flex; align-items: center; gap: .45rem; font-weight: 600; margin: .75rem 0 .25rem; }
.settings-section .inline-check input { width: auto; }
.settings-test { margin-top: 1.25rem; padding-top: .25rem; border-top: 1px solid var(--panel-border); }
.settings-section label { display: grid; gap: .25rem; font-weight: 600; font-size: .9em; }
.settings-section label .hint { font-weight: 400; }
.settings-section input, .settings-section select {
  width: 100%; min-width: 0; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; font-weight: 400; background: var(--input-bg); color: var(--text);
}
.settings-section .preset { max-width: 22rem; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-top: 1rem; }
.settings-actions.test label { flex: 1 1 16rem; }
.settings-section .errorlist { margin: 0; padding: 0; list-style: none; color: var(--err); font-weight: 400; }
@media (max-width: 640px) {
  .settings-section { padding: 1rem; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* Reports */
.report-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; margin: 1rem 0 .5rem; }
.report-filter label { display: grid; gap: .2rem; font-size: .85em; color: var(--muted); }
.report-filter input, .report-filter select { padding: .4rem .5rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; color: var(--text); background: var(--input-bg); }
.report-filter .download { color: var(--link); font-weight: 600; align-self: center; }
table.job-hours summary { cursor: pointer; font-weight: 600; }
table.job-hours table.workers { margin: .35rem 0 .25rem 1rem; border-collapse: collapse; font-size: .92em; }
table.job-hours table.workers td { border: 0; padding: .15rem .6rem .15rem 0; }
table.job-hours tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
table.job-hours tr.section-row td { background: var(--nav-bg); font-weight: 600; font-size: .9em; color: var(--muted); }
table.job-hours table.workers td { white-space: nowrap; }
.report-h2 { font-size: 1.05rem; margin: 1.5rem 0 .25rem; }

/* Sidenav badges */
.badge { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: var(--badge-new); color: var(--badge-text); font-size: .72em; font-weight: 700; letter-spacing: .02em; vertical-align: .1em; }
.badge[hidden] { display: none; }
.badge-progress { background: var(--badge-progress); font-variant-numeric: tabular-nums; }
.badge-alert { background: var(--badge-alert); }

/* Customers */
.customer-form { max-width: 46rem; margin-top: 1rem; }
.customer-form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9em; }
.customer-form input, .customer-form textarea {
  width: 100%; min-width: 0; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; font-weight: 400; background: var(--input-bg); color: var(--text);
}
.crawl-row { display: flex; gap: .75rem; align-items: end; margin-bottom: .25rem; }
.crawl-row label { flex: 1; }
.customer-form .settings-grid { margin-top: .75rem; }

/* Theme picker (superusers) and theme editor */
.theme-picker { margin-top: .6rem; }
.theme-picker label { display: flex; align-items: center; gap: .4rem; color: var(--nav-muted); }
.theme-picker select { flex: 1; min-width: 0; padding: .2rem .3rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.editor-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.editor-color { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--input-bg); }
.editor-swatch { height: 3.25rem; display: flex; align-items: end; padding: .4rem .6rem; }
.editor-swatch span { background: var(--page-bg); color: var(--text); padding: .05rem .4rem; border-radius: 4px; font-size: .8em; font-weight: 600; }
.editor-meta { padding: .4rem .6rem 0; }
.editor-meta p { margin: .2rem 0 0; }
.editor-uses { list-style: none; margin: 0; padding: .4rem .6rem .6rem; display: grid; gap: .45rem; }
.editor-uses label { display: block; font-size: .85em; margin-bottom: .15rem; }
.editor-uses select { width: 100%; padding: .25rem .3rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }

/* Cron field and cheat sheet */
.cron-row { display: flex; align-items: center; gap: .6rem; }
.cron-row input { flex: 1; }
.cron-help-link { font-weight: 600; white-space: nowrap; color: var(--link); }
input.mono, .cron-diagram, .cron-help code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.cron-help { max-width: 44rem; width: calc(100% - 2rem); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem 1.5rem; background: var(--page-bg); color: var(--text); }
.cron-help::backdrop { background: rgb(0 0 0 / .35); }
.cron-help h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.cron-help h3 { margin: 1.1rem 0 .4rem; font-size: 1rem; }
.cron-help-close { float: right; margin: 0; }
.cron-diagram { background: var(--th-bg); padding: .75rem 1rem; border-radius: 6px; font-size: .88em; line-height: 1.35; overflow-x: auto; }
.cron-help code { background: var(--th-bg); padding: .05rem .3rem; border-radius: 3px; }

/* Checkbox fields in forms */
.check-label span:first-child { display: flex; align-items: center; gap: .45rem; font-weight: 600; }
.check-label input[type=checkbox] { width: auto; }
.customer-form select { width: 100%; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.cron-help code { white-space: nowrap; }

/* Driver's license on a staff record */
.settings-section.license { margin: 1.5rem 0; }
.license-view { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; margin: .5rem 0; }
.license-view img { max-width: 22rem; max-height: 14rem; border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg); }
.license-view p { margin: 0 0 .4rem; }
.customer-form label .hint { font-weight: 400; }

/* A box with its own button beside it (settings: mailbox password). */
.inline-field { display: flex; gap: .5rem; align-items: center; }
.inline-field input { flex: 1; min-width: 0; }

/* Settings: the Gmail app password steps. */
.gmail-help { margin: 1rem 0 0; padding: .6rem .9rem; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--page-bg); }
.gmail-help[hidden] { display: none; }
.gmail-help summary { cursor: pointer; font-weight: 600; }
.gmail-help ol { margin: .5rem 0; padding-left: 1.4rem; }
.gmail-help li { margin: .3rem 0; }

/* Expenses. */
.upload-options { display: flex; flex-wrap: wrap; gap: .75rem 1rem; width: 100%; }
.upload-options label { display: grid; gap: .25rem; font-weight: 600; font-size: .9em; }
.upload-options select, .upload-options input { padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; font-weight: 400; background: var(--input-bg); color: var(--text); }
a.button { display: inline-block; padding: .45rem .8rem; border-radius: 4px; font-weight: 600; text-decoration: none; line-height: 1.2; }
a.button.secondary { background: var(--btn2-bg); color: var(--btn2-text); border: 1px solid var(--btn2-text); }
a.button.secondary:hover { background: var(--nav-hover); }
.date-range { display: inline-flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
table.receipts img.thumb { display: block; width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 4px; border: 1px solid var(--panel-border); }
table.receipts select, table.receipts input[type=text] { max-width: 12rem; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem; align-items: start; }
.receipt-layout.no-image { grid-template-columns: minmax(0, 46rem); }
.receipt-image img { display: block; max-width: 100%; max-height: 80vh; border: 1px solid var(--panel-border); border-radius: 4px; }
.receipt-form .settings-grid input, .receipt-form .settings-grid select, .receipt-form .settings-grid textarea {
  width: 100%; min-width: 0; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; font-weight: 400; background: var(--input-bg); color: var(--text);
}
.receipt-form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9em; }
.receipt-form .hint { font-weight: 400; }
.reviewed-toggle { margin-top: 1rem; }
@media (max-width: 760px) {
  .receipt-layout { grid-template-columns: minmax(0, 1fr); }
  .receipt-form .settings-grid { grid-template-columns: 1fr; }
}
button.link.danger { color: var(--err); margin-left: auto; }

/* myJobs: used on phones by people on site — big targets, one column. */
.job-cards { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; max-width: 36rem; }
.job-card { display: grid; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--panel-border); border-radius: 8px;
            background: var(--panel-bg); color: var(--text); text-decoration: none; }
.job-card.running { border-left: 5px solid var(--ok); }
.job-card-code { font-size: 1.25rem; font-weight: 700; color: var(--link); }
.job-card-meta { font-size: .9em; color: var(--muted); }
.my-job { max-width: 36rem; }
.my-job-title { font-size: 1.15rem; font-weight: 600; margin: .25rem 0; }
h1 a.back { color: var(--link); text-decoration: none; font-weight: 400; }
.timer { display: grid; justify-items: center; gap: .4rem; margin: 1.25rem 0; padding: 1.25rem 1rem;
         border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); }
.timer .clock { margin: 0; font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
button.big { width: 100%; min-height: 3.5rem; font-size: 1.2rem; font-weight: 700; border-radius: 10px; }
button.big.stop { background: var(--err); }
.status-box { margin: 1rem 0; padding: 1rem; border: 1px solid var(--panel-border); border-radius: 12px; }
.status-box h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.status-box form { display: grid; gap: .6rem; }
.status-box label { display: grid; gap: .25rem; font-weight: 600; font-size: .9em; }
.status-box select, .status-box input { min-height: 2.8rem; padding: .5rem .6rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text); }
.interval-list { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .5rem; }
.interval-list li { padding: .5rem 0; border-bottom: 1px solid var(--panel-border); }
.status-order { padding-left: 1.5rem; }
.status-order li { margin: .35rem 0; }
.status-order form { display: flex; align-items: center; gap: .5rem; }
.status-order form span { min-width: 12rem; }
.button.disabled { opacity: .4; cursor: not-allowed; }
.date-range span.button { display: inline-block; padding: .45rem .8rem; border-radius: 4px; font-weight: 600; border: 1px solid var(--btn2-text); color: var(--btn2-text); }
form.inline { display: inline; }
.account-tz { display: block; font-size: .8em; color: var(--nav-muted); margin-top: .15rem; }

/* Expense ledger (payables app, from wyatt) */
.menubar-sub { margin-top: -1rem; font-size: .92em; }
/* Tabs within a page (settings → email): links that work without script, panels toggled by it. */
.tabs { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 1px solid var(--menu-border); margin: 0 0 1rem; }
.tabs a { padding: .45rem .9rem; color: var(--menu-text); text-decoration: none; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.tabs a:hover { background: var(--nav-hover); }
.tabs a[aria-selected="true"] { border-color: var(--menu-border); background: var(--page-bg); color: var(--menu-active); font-weight: 600; }
.tab-panel[hidden] { display: none; }
.menubar-sub a { padding: .45rem .8rem; }
.ledger-groups { margin: 1rem 0; }
.ledger-groups summary { cursor: pointer; font-weight: 600; }
.ledger-groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; margin-top: .75rem; }
.ledger-groups-grid h3 { font-size: .95rem; margin: 0 0 .25rem; }
table.data tr.row-deleted td { color: var(--muted); text-decoration: line-through; }
.ledger-form { max-width: 52rem; }
.ledger-name { display: grid; gap: .35rem; align-content: start; }
.ledger-name .check-label span:first-child { font-weight: 400; font-size: .9em; }
.usd-helper { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; border: 1px solid var(--border); border-radius: 4px; padding: .5rem .9rem .75rem; margin: 0; }
.usd-helper legend { font-weight: 600; font-size: .9em; }
.usd-helper label { max-width: 10rem; }
.receipt-name { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.receipt-name label { display: grid; gap: .2rem; font-size: .85em; color: var(--muted); }
.receipt-name input { padding: .4rem .5rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; color: var(--text); background: var(--input-bg); max-width: 100%; }
.section-links { padding-left: 1.1rem; }
.section-links li { margin: .4rem 0; }
.section-links a { font-weight: 600; }

/* Job board (swim lanes): jobs/board.html + static/rad/job-board.js */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: stretch; margin-top: .75rem; }
.lane { flex: 0 0 15rem; display: flex; flex-direction: column; background: var(--nav-bg); border: 1px solid var(--border); border-radius: 6px; min-height: 12rem; transition: opacity .15s; }
.lane-head { margin: 0; padding: .55rem .75rem; font-size: .9rem; font-family: var(--font-body); color: var(--text); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; }
.lane-count { font-weight: 400; color: var(--muted); font-size: .9em; }
.lane-body { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: .6rem; }
.lane-over { outline: 2px solid var(--nav-accent); outline-offset: -2px; background: var(--nav-active); }
.lane-closed { opacity: .4; }
.tile { background: var(--page-bg); border: 1px solid var(--border); border-radius: 5px; padding: .5rem .6rem; font-size: .88em; cursor: grab; touch-action: none; user-select: none; }
.tile:hover { border-color: var(--nav-accent); }
.tile-code { font-weight: 700; color: var(--link); text-decoration: none; }
.tile-name { margin-top: .15rem; }
.tile-meta { display: flex; flex-wrap: wrap; gap: .2rem .6rem; margin-top: .3rem; color: var(--muted); font-size: .92em; }
.tile-type { font-style: italic; }
.tile-people { margin-top: .3rem; font-size: .9em; }
.tile-dragging { opacity: .35; }
.tile-ghost { position: fixed; z-index: 50; pointer-events: none; cursor: grabbing; box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 25%, transparent); transform: rotate(2deg); }
.board.dragging, .board.dragging * { cursor: grabbing; }
.board-message { margin-top: .5rem; }
/* CRM deal pipeline (crm/pipeline.html + static/rad/deal-pipeline.js), on the job board's lanes and tiles */
.lane-total { margin: 0; padding: .3rem .75rem; font-size: .82em; color: var(--muted); border-bottom: 1px solid var(--border); }
.lane-won .lane-head { color: var(--ok); }
.lane-lost .lane-head { color: var(--muted); }
.tile-late { color: var(--err); }
.stage-move { display: inline; }
.stage-move button { padding: .1rem .45rem; }
.overdue { color: var(--err); font-weight: 600; }
.activity-log { margin: .25rem 0 .6rem; }
.activity-is-done td { color: var(--muted); }
.activity-done { margin-top: .6rem; }
.timeline { list-style: none; padding-left: 0; margin: .4rem 0; }
.timeline li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.timeline-details { margin-top: .2rem; font-size: .9em; color: var(--muted); }
.checkbox-row { display: flex !important; align-items: center; gap: .4rem; font-weight: 600; }
.checkbox-row input { width: auto; }

/* settings → payment gateways */
.payment-key-value input { min-width: 22rem; max-width: 100%; }
.report-filter label[hidden] { display: none; }

/* Sidenav shortcuts (upload timesheets, my jobs): highlighted, set apart from the menu below */
.sidenav li.nav-shortcut > a:not(.banner) {
  margin: .25rem .6rem;
  padding: .55rem .8rem;
  border: 1px solid color-mix(in srgb, var(--nav-accent) 45%, var(--nav-bg));
  border-left-width: 1px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--nav-accent) 10%, var(--nav-bg));
  color: var(--nav-accent);
  font-weight: 600;
}
.sidenav li.nav-shortcut > a:not(.banner):hover { background: color-mix(in srgb, var(--nav-accent) 18%, var(--nav-bg)); }
.sidenav li.nav-shortcut > a[aria-current="page"] { background: var(--nav-accent); color: var(--nav-bg); border-color: var(--nav-accent); }
.sidenav li.nav-shortcut-last { padding-bottom: .4rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border); }
/* CRM: its own section, set apart from the ERP groups above it */
.sidenav li.nav-section { margin-top: .3rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.job-card.offered { border-left: 5px solid var(--nav-accent); }
.job-card.offered form { margin-top: .4rem; }
button.danger:not(.link) { background: var(--err); }
.report-h2 + .menubar-sub, .banner-bad + .menubar-sub { margin-top: .6rem; }

/* Jobber format: a day's hours split by service type */
.service-day { margin-bottom: 1.5rem; }
.service-day .errorlist { margin: 0 0 .5rem; padding: .6rem .9rem; list-style: none; background: var(--err-bg); color: var(--err); border-radius: 4px; }
.service-day select { max-width: min(36rem, 70vw); }
.service-day .settings-actions { margin-top: .5rem; }
button.small { padding: .2rem .6rem; font-size: .88em; }
.service-dialog { max-width: 40rem; width: calc(100% - 2rem); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem 1.5rem; background: var(--page-bg); color: var(--text); overflow: visible; }
.service-dialog::backdrop { background: rgb(0 0 0 / .35); }
.service-dialog h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.service-dialog-close { float: right; margin: 0; }
.service-dialog-lines { margin: 0 0 1rem; line-height: 1.6; }
.service-rows { width: 100%; }
.service-rows td { vertical-align: top; }
.service-rows tr.svc-bad input { border-color: var(--err); }
.svc-pick { position: relative; }
.svc-name { width: 100%; box-sizing: border-box; }
.svc-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; max-height: 16rem; overflow-y: auto; margin: 2px 0 0; padding: .25rem 0; list-style: none; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 4px; box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.svc-list li { padding: .3rem .6rem; cursor: pointer; }
.svc-list li[aria-selected="true"], .svc-list li[role="option"]:hover { background: var(--nav-active); }
.svc-list li.svc-none { color: var(--muted); cursor: default; }
.service-sum { margin: .25rem 0; color: var(--muted); }
.service-sum.svc-sum-ok { color: var(--ok); font-weight: 600; }
.service-error { margin: .25rem 0; padding: .5rem .8rem; background: var(--err-bg); color: var(--err); border-radius: 4px; }
.service-dialog-tools { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.dates-dialog { max-width: 60rem; }
.dates-dialog input[type=date] { font: inherit; }
.new-service-dialog { max-width: 46rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
h3.form-section { margin: 1.25rem 0 .4rem; font-size: 1rem; color: var(--heading); border-bottom: 1px solid var(--border); padding-bottom: .2rem; }
ul.issue-list { margin: 0; padding-left: 1.1rem; }
ul.issue-list li { margin: .1rem 0; }
ul.issue-counts { columns: 2 18rem; margin: 0 0 1rem; padding-left: 1.1rem; }

/* settings → api keys */
.api-permissions { margin-top: 1rem; border: 1px solid var(--input-border); border-radius: 4px; padding: .5rem 1rem 1rem; }
.api-permissions legend { font-weight: 600; padding: 0 .25rem; }
.api-area h3 { margin: .75rem 0 .25rem; font-size: 1em; }
.api-area .check-label { display: grid; gap: .1rem; margin: .35rem 0; }
.api-key-value { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.api-key-value input { flex: 1 1 20rem; min-width: 0; font-family: monospace; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); }
.api-usage { margin-top: 2rem; }
.api-docs { margin-top: 1.5rem; }
.api-op { margin: 1rem 0 1.5rem; }
.api-op h3 { margin-bottom: .25rem; }
.api-example { background: var(--th-bg); padding: .6rem .8rem; border-radius: 4px; overflow-x: auto; font-size: .85em; }

/* account statements (expenses) */
.statement-header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: .5rem 0 1rem; }
.statement-header dt { font-size: .8em; color: var(--muted); }
.statement-header dd { margin: 0; }
.statement-lines tr.match-confirmed td, .statement-lines tfoot tr.match-confirmed th, .legend.match-confirmed { background: var(--ok-bg); }
.statement-lines tr.match-proposed td, .legend.match-proposed { background: var(--warn-bg); }
.statement-lines tr[data-dialog] { cursor: pointer; }
.statement-lines tr[data-dialog]:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.legend { padding: 0 .35rem; border-radius: 3px; }
.statement-match { margin-top: .4rem; padding: .4rem .6rem; border-radius: 4px; background: var(--warn-bg); font-size: .9em; }
.statement-match.confirmed { background: var(--ok-bg); }
.statement-match .check-label { margin-top: .25rem; display: grid; gap: .1rem; }
.match-dialog-body { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.match-dialog-body .statement-header { flex: 1 1 18rem; }
.prompt-dialog { max-width: 52rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.prompt-dialog h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.prompt-message { display: flex; gap: .75rem; align-items: flex-start; }
.prompt-message textarea { flex: 1 1 auto; min-width: 0; font: inherit; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); }
.char-count { flex: 0 0 auto; min-width: 7.5rem; font-size: .85em; color: var(--muted); padding-top: .45rem; }
.prompt-search input { margin-left: .5rem; padding: .4rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.prompt-results { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; min-height: 1.5rem; }
.prompt-recipients .check-label input { width: auto; }
@media (max-width: 40rem) { .prompt-message { flex-direction: column; } .char-count { padding-top: 0; } }

/* Ledger: similar expenses on new expense, CCA / T2125 filled in from the payee + type (from wyatt). */
.ledger-duplicates { margin: 1rem 0; }
.duplicates { margin: .5rem 0; padding: .6rem .75rem; border-left: 3px solid var(--warn); background: var(--warn-soft); }
.duplicates-exact { border-left-color: var(--err); background: var(--err-bg); }
.duplicates h3 { margin: 0 0 .4rem; font-size: 1rem; }
.ledger-form input.is-filled { background: var(--ok-bg); }

/* Ledger: type chart (spending added up) and its 📈 launcher beside each type. */
.chart-link { margin-left: .35rem; text-decoration: none; font-size: .9em; opacity: .55; }
.chart-link:hover, .chart-link:focus-visible { opacity: 1; }
.type-chart { position: relative; margin: 1rem 0 1.5rem; padding: .75rem; border: 1px solid var(--border); border-radius: 6px; }
.type-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.type-chart [hidden] { display: none; }
.type-chart-grid { stroke: var(--border); stroke-width: 1; }
.type-chart-axis { stroke: var(--muted); stroke-width: 1; }
.type-chart-tick { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.type-chart-line { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.type-chart-bar { fill: var(--link); }
.type-chart-crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.type-chart-dot { fill: var(--link); stroke: var(--page-bg); stroke-width: 2; pointer-events: none; }
.type-chart-hit { fill: transparent; cursor: crosshair; }
.type-chart-tooltip {
  position: absolute; margin: .75rem; padding: .4rem .6rem; pointer-events: none; white-space: nowrap; font-size: .9rem;
  color: var(--text); background: var(--page-bg); border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 12%, transparent);
}
.type-chart-tooltip-label { color: var(--muted); }
.type-chart-tooltip-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Receipts from email: the email beside the receipt (sandboxed frame), and adding a receipt to the ledger. */
.receipt-email { margin: 0 0 1rem; }
.receipt-email summary { cursor: pointer; font-weight: 600; }
.receipt-email iframe { display: block; width: 100%; height: 60vh; margin-top: .5rem; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.thumb-email { display: inline-block; font-size: 2rem; text-decoration: none; }
.statement-checklist { margin-top: 1rem; }
.match-none td, .match-none th, .legend.match-none { color: var(--muted); }
.no-receipt-pick { display: inline-block; margin-left: .25rem; }
.no-receipt-pick summary { cursor: pointer; }
.checklist-missing td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.ledger-plan { margin-top: .25rem; font-size: .85rem; font-weight: 600; }
.receipt-text { max-height: 60vh; overflow: auto; margin: 0 0 .5rem; padding: .5rem; border: 1px solid var(--border); border-radius: 4px; white-space: pre; font-size: .8rem; tab-size: 4; }
.ledger-add { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.ledger-receipts { margin: .25rem 0 1rem; padding-left: 1.25rem; }

/* reconciled with a statement (green) or not yet (amber), as if highlighted on paper (user, 2026-10-10) */
table.data tr.reconciled td, .legend.reconciled { background: var(--ok-bg); }
table.data tr.unreconciled td, .legend.unreconciled { background: var(--warn-bg); }
.statement-opener { margin-left: .25rem; text-decoration: none; }
.statement-lines tr.is-target td { box-shadow: inset 0 2px 0 var(--link), inset 0 -2px 0 var(--link); }
.statement-replacement form { margin: 0 0 1rem; }
.statement-replace { margin-top: 1.5rem; }

/* Customer invoice form: the customer's jobs not invoiced yet, to tick (receivables). */
.invoice-jobs { border: 1px solid var(--border); border-radius: 6px; padding: .5rem .9rem .7rem; margin: 1rem 0; }
.invoice-jobs legend { padding: 0 .3rem; color: var(--heading); }
.invoice-jobs ul { list-style: none; margin: .2rem 0 0; padding: 0; max-height: 18rem; overflow-y: auto; }
.invoice-jobs li { padding: .2rem 0; }
.invoice-jobs [data-empty] { margin: .2rem 0; }
.invoice-jobs label { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; font-weight: normal; }
.invoice-jobs label input[type="checkbox"] { width: auto; margin: 0; flex: none; }
.invoice-jobs > ul > li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.invoice-jobs > ul > li:last-child { border-bottom: none; }
.invoice-jobs { max-height: none; }
.invoice-jobs > ul { max-height: none; }
.job-cost-line { display: block; margin: .15rem 0 0 1.6rem; font-size: .92em; color: var(--ok); }
.job-detail { margin: .3rem 0 0 1.6rem; }
.job-detail summary { cursor: pointer; color: var(--link); font-size: .92em; }
.job-detail .job-items { margin: .4rem 0; font-size: .9em; }
.job-items tr.not-counted td { color: var(--muted); }
.invoice-costs { margin: 1rem 0; }
.invoice-discounts { border: 1px solid var(--border); border-radius: 6px; padding: .5rem .9rem .7rem; margin: 1rem 0; }
.invoice-discounts legend { padding: 0 .3rem; color: var(--heading); }
.invoice-discounts table { margin: .6rem 0; }
.invoice-discounts input.bad { border-color: var(--err); }
.invoice-after { max-width: 28rem; }

/* Projects: status colours from the theme's message colours (Status.tone), progress bars (projects app). */
.status.tone-info { background: var(--info-bg); color: var(--info); }
.status.tone-success { background: var(--ok-bg); color: var(--ok); }
.status.tone-warning { background: var(--warn-bg); color: var(--warn); }
.status.tone-error { background: var(--err-bg); color: var(--err); }
.status.tone-neutral { background: var(--nav-bg); color: var(--muted); }
.progress { display: inline-block; width: 6rem; height: .5rem; vertical-align: middle; border-radius: 2px; background: var(--border); overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--ok); }
.project-tasks tr.task-is-done td { color: var(--muted); }
.project-description { margin: 0 0 1rem; max-width: 60rem; }
.project-statuses input[type="checkbox"] { width: auto; }
.project-statuses input.position { width: 5rem; }
h2.overdue { color: var(--err); }

/* Projects: the task board (projects/project_board.html + static/rad/task-board.js), on the job board's lanes and
   tiles. Only the board scrolls sideways (.board overflow-x), never the page. */
.task-board { align-items: flex-start; }
.task-board .lane { min-height: 8rem; }
.task-board .lane-head .status { font-size: .95em; }
.task-board a.lane-total { display: block; color: var(--link); }
.task-cards { list-style: none; margin: 0; min-height: 2.5rem; }
.task-card { border-left: 3px solid var(--border); }
.task-card.task-today { border-left-color: var(--warn); }
.task-card.task-overdue { border-left-color: var(--err); }
.task-card.task-overdue .task-card-due { color: var(--err); font-weight: 600; }
.task-card.task-done { border-left-color: var(--ok); }
.task-card.task-done .task-card-title { color: var(--muted); }
.task-card.task-saving { opacity: .7; }
.task-card-title { display: block; overflow-wrap: anywhere; font-weight: 600; color: var(--link); text-decoration: none; }
.task-card-title:hover { text-decoration: underline; }
.task-card .tile-meta:empty { display: none; }
.task-card .tile-meta .status { font-size: .95em; }
.task-card-move { margin-top: .35rem; }
.task-card-move select { max-width: 100%; padding: .15rem .3rem; font: inherit; font-size: .92em; color: var(--muted); background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 3px; }
.task-quick-add { padding: 0 .6rem .6rem; }
.task-quick-add input { width: 100%; padding: .4rem .5rem; font: inherit; font-size: .9em; color: var(--text); background: transparent; border: 1px dashed var(--input-border); border-radius: 4px; }
.task-quick-add input:focus { background: var(--input-bg); border-style: solid; }

/* Projects: subtasks and the task timeline (projects/task_form.html), on the CRM's .timeline */
.task-parent { display: inline-block; margin-left: .35rem; color: var(--muted); font-size: .9em; }
.task-card .task-parent { display: block; margin: .1rem 0 0; }
.task-section { max-width: 60rem; margin-top: 1.5rem; }
.subtask-add { margin-top: .5rem; }
.task-comment { margin-top: .25rem; }
.task-timeline { max-width: 46rem; }
.task-entry-when { color: var(--muted); font-size: .9em; }
.task-timeline .task-entry-comment .timeline-details { color: var(--text); font-size: 1em; }

/* Projects: labels (chips), waiting, time, and the timeline (gantt) view (phase 4) */
.chip { display: inline-block; padding: 0 .45rem; border: 1px solid var(--chip, var(--muted)); border-radius: 999px; color: var(--text); font-size: .8em; line-height: 1.5; white-space: nowrap; background: color-mix(in srgb, var(--chip, var(--muted)) 14%, var(--page-bg)); }
.chip.tone-info { --chip: var(--info); }
.chip.tone-success { --chip: var(--ok); }
.chip.tone-warning { --chip: var(--warn); }
.chip.tone-error { --chip: var(--err); }
.task-card .tile-meta .chip { font-size: .9em; }
.task-labels { display: flex; flex-wrap: wrap; gap: .25rem 1rem; border: 0; margin: 0; padding: 0; }
.task-labels legend { width: 100%; padding: 0; margin-bottom: .25rem; font-weight: 600; font-size: .9em; }
.task-labels .checkbox-row { font-weight: 400; }
.time-log input[type="date"] { min-width: 9rem; }
.time-log .errorlist { margin: 0; padding: 0; list-style: none; color: var(--err); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gantt { overflow-x: auto; margin: 1rem 0 .5rem; }
.gantt-row { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(32rem, 1fr); align-items: center; border-bottom: 1px solid var(--border); }
.gantt-head { font-size: .82em; color: var(--muted); background: var(--th-bg); }
.gantt-name { padding: .35rem .75rem .35rem .4rem; overflow-wrap: anywhere; font-size: .9em; }
.gantt-done .gantt-name a { color: var(--muted); }
.gantt-overdue .gantt-name a { color: var(--err); }
.gantt-track { position: relative; align-self: stretch; min-height: 2rem; }
.gantt-tick { position: absolute; bottom: .25rem; padding-left: .25rem; white-space: nowrap; border-left: 1px solid var(--border); }
.gantt-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.gantt-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--err); z-index: 1; }
.gantt-bar { position: absolute; top: 50%; height: .9rem; min-width: 4px; transform: translateY(-50%); border-radius: 3px; background: var(--bar, var(--muted)); z-index: 2; }
.gantt-bar.tone-info { --bar: var(--info); }
.gantt-bar.tone-success { --bar: var(--ok); }
.gantt-bar.tone-warning { --bar: var(--warn); }
.gantt-bar.tone-error { --bar: var(--err); }
.gantt-done .gantt-bar { opacity: .5; }

/* Business forms: page thumbnails with move / remove (businessforms/_pages.html) */
.form-pages { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; }
.form-pages li { display: grid; gap: .4rem; align-content: start; padding: .5rem; border: 1px solid var(--panel-border); border-radius: 6px; }
.form-pages img { display: block; width: 100%; height: 14rem; object-fit: contain; background: var(--nav-bg); border-radius: 4px; }
.form-page-info { display: grid; gap: .1rem; overflow-wrap: anywhere; }
.form-page-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.form-page-actions button { padding: .25rem .6rem; }

/* Job form: the job's ordered statuses (customers/job_form.html, static/rad/job-statuses.js) */
.status-steps { border: 1px solid var(--panel-border); border-radius: 6px; padding: .6rem .8rem; }
.status-steps legend { padding: 0 .3rem; }
.status-steps ol { margin: 0 0 .5rem; padding-left: 1.6rem; display: grid; gap: .3rem; }
.status-steps li > span { display: inline-block; min-width: 10rem; margin-right: .5rem; }
.status-steps li button { padding: .15rem .55rem; margin-right: .25rem; }
.status-steps-add { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Pay stub (payroll dry run): one page, printable. */
.stub-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.paystub { max-width: 52rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); }
.paystub-head, .paystub-parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.paystub-head { padding-bottom: .75rem; border-bottom: 2px solid var(--border); }
.paystub-title { text-align: right; }
.paystub-dry { padding: .05rem .4rem; border: 1px solid var(--err); border-radius: 4px; color: var(--err); font-size: .8em; text-transform: uppercase; }
.paystub-parties { margin: 1rem 0; }
.paystub-net { text-align: right; }
.paystub-net strong { font-size: 1.5rem; }
.paystub-table { width: 100%; margin: .75rem 0; }
.paystub-foot { margin: .5rem 0 0; }

/* Jobgrid use cases (the list ARS's testers work from) */
.use-cases-intro table { margin: .5rem 0 1rem; }
.use-case { margin: 1.25rem 0; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 8px; break-inside: avoid; }
.use-case h2 { font-size: 1.05rem; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.use-case h2 a { color: inherit; text-decoration: none; }
.use-case ul, .use-case ol { margin: .25rem 0 .5rem; }

@media print {
  .sidenav, .no-print, .messages { display: none !important; }
  main.client { margin: 0; padding: 0; }
  .paystub { max-width: none; border: 0; padding: 0; }
}

/* Jobgrid (JG-002): the whole window, a 5% wide week column and a 5% high day-name row, 5 x 7 equal cells. */
body.jobgrid-window { margin: 0; overflow: hidden; background: var(--page-bg); }
.jobgrid { display: grid; width: 100vw; height: 100vh; grid-template-columns: 5vw repeat(7, minmax(0, 1fr));
  grid-template-rows: 5vh repeat(5, minmax(0, 1fr)); }
.jobgrid > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; overflow: hidden; min-width: 0; min-height: 0; }
.jobgrid .jg-alt { background: color-mix(in srgb, var(--text) 5%, var(--page-bg)); }
.jg-dayname span { font-weight: 700; line-height: 1; white-space: nowrap; }
.jg-week > span { display: flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 700; }
.jg-week > span > span { display: block; height: 1em; }
/* JG-003: the date square in each day's upper right (same size in every cell) and the day details dialog. */
.jobgrid .jg-cell { position: relative; align-items: flex-start; justify-content: flex-start; }
/* JG-013: the 1st of each month: a 4px border inside the cell (border-box: the cell keeps its size). */
.jobgrid .jg-cell.jg-first { border: 4px solid var(--text); box-sizing: border-box; }
.jg-daynum { position: absolute; top: 0; right: 0; width: var(--jg-daynum, 2rem); height: var(--jg-daynum, 2rem);
  box-sizing: border-box; padding: 0 .3em 0 0; margin: 0; border: 0; border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text);
  font: inherit; font-weight: 600; font-size: calc(var(--jg-daynum, 2rem) * .5); line-height: 1;
  display: flex; align-items: center; justify-content: flex-end; cursor: pointer; }
/* JG-009: assignment markers; text colour is set per marker for contrast with its background. */
.jg-markers { position: absolute; inset: var(--jg-daynum, 2rem) 0 0 0; overflow-y: auto; padding: 0 3px 3px;
  display: flex; flex-direction: column; gap: 0; --jg-marker-base: clamp(.6rem, 1.3vh, .85rem); }
.jg-marker { margin: 3px 0 0; padding: .15em .35em; border-radius: 3px; border: 1px solid var(--border);
  font-size: calc(var(--jg-marker-base) * var(--jg-fit, 1)); line-height: 1.15; overflow: hidden; flex-shrink: 0; }
.jg-marker > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jg-marker-name { font-weight: 700; }
.jg-marker-job { font-size: 2em; font-weight: 700; line-height: 1.05; }
/* A busy day (user, 2026-10-21: up to 6 markers): one line each, job id first then the last name; the customer is in
   the marker's tip. jobgrid.js picks this when the full markers don't fit, then shrinks the text (--jg-fit). */
.jg-markers.jg-compact .jg-marker { display: flex; align-items: baseline; gap: .45em; margin-top: 2px; padding: .05em .35em; }
.jg-markers.jg-compact .jg-marker-job { order: -1; flex: none; font-size: 1.45em; line-height: 1.1; }
.jg-markers.jg-compact .jg-marker-name { flex: 1 1 auto; min-width: 0; font-size: 1.15em; }
.jg-markers.jg-compact .jg-marker-customer { display: none; }
/* JG-010: dragging a marker to another day. */
.jobgrid[data-move-url] .jg-marker { cursor: grab; touch-action: none; user-select: none; }
.jg-marker[data-editable] { cursor: pointer; }
.jobgrid[data-move-url] .jg-marker[data-editable] { cursor: grab; }
.jg-marker-moving { opacity: .35; }
.jg-marker-ghost { position: fixed; z-index: 1000; pointer-events: none; cursor: grabbing; opacity: .9;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--text) 30%, transparent); }
.jobgrid .jg-drop-target { outline: 3px solid var(--link); outline-offset: -3px; }
.jg-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 1001; margin: 0;
  padding: .6rem 1rem; border-radius: 6px; background: var(--err); color: var(--btn-text); max-width: 80vw;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--text) 30%, transparent); }
.jg-toast[hidden] { display: none; }
/* JG-011: the month letter's tip. */
.jg-month { cursor: default; }
.jg-tip { position: fixed; z-index: 1002; transform: translateY(-50%); padding: .3rem .6rem; border-radius: 4px;
  background: var(--text); color: var(--page-bg); font-size: .95rem; font-weight: 600; pointer-events: none; white-space: nowrap; }
.jg-tip[hidden] { display: none; }
/* JG-015: a marker's complete details, after resting on it for half a second. */
.jg-popup { position: fixed; z-index: 1002; max-width: min(26rem, calc(100vw - 16px)); padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--page-bg); color: var(--text); font-size: .9rem;
  pointer-events: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 25%, transparent); }
.jg-popup[hidden] { display: none; }
.jg-popup dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; }
.jg-popup dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.jg-popup dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
/* JG-012: week arrows in the top and bottom rows' month / date cells, a third of a character high. */
.jobgrid .jg-week { position: relative; }
.jg-shift { position: absolute; left: 50%; transform: translateX(-50%); aspect-ratio: 10 / 6;
  height: calc(var(--jg-char, 1.5rem) / 3); padding: 0; margin: 0; border: 0; background: transparent; color: var(--text);
  cursor: pointer; display: flex; }
.jg-shift svg { width: 100%; height: 100%; fill: currentColor; }
.jg-shift:hover, .jg-shift:focus-visible { color: var(--link); }
.jg-shift-up { top: 3px; }
.jg-shift-down { bottom: 3px; }
.jobgrid-color-picker input[type="color"] { width: 2.2rem; height: 1.4rem; padding: 0; border: 1px solid var(--border); vertical-align: middle; }
.jg-daynum:hover, .jg-daynum:focus-visible { background: color-mix(in srgb, var(--link) 12%, transparent); color: var(--link); }
.jg-dialog { width: 85vw; height: 85vh; max-width: none; max-height: none; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: var(--page-bg); color: var(--text); }
.jg-dialog::backdrop { background: color-mix(in srgb, var(--text) 35%, transparent); }
.jg-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border); }
.jg-dialog-head h2 { margin: 0; font-size: 1.2rem; }
/* JG-018: ‹ › beside the day's heading step to the day before / after; the day tab = its markers + details */
.jg-day-nav { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.jg-dialog-head .jg-day-step { min-width: 2.6rem; min-height: 2.4rem; padding: 0 .6rem; line-height: 0; flex: none; }
.jg-day-step svg { width: .8rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.jg-dv-markers { display: flex; flex-wrap: wrap; gap: .5rem; --jg-marker-base: .95rem; }
.jg-dv-markers .jg-marker { width: 13rem; max-width: 100%; margin: 0; cursor: pointer; }
.jg-dv-markers .jg-marker:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.jg-dv-markers .jg-marker[aria-selected="true"] { outline: 3px solid var(--text); outline-offset: 2px; }
.jg-dv-details { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.jg-dv-details h3 { margin: 0 0 .5rem; font-size: 1rem; }
.jg-dv-details dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: 0; }
.jg-dv-details dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.jg-dv-details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
/* JG-019: on a phone the details dialog takes the whole screen */
@media (max-width: 700px) {
  .jg-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .jg-dialog-head { padding: .5rem .75rem; gap: .5rem; }
  .jg-dialog-head h2 { font-size: 1rem; }
  .jg-dialog-body { padding: .75rem; }
  .jg-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .jg-dv-markers .jg-marker { width: 100%; }
  .jg-teams { grid-template-columns: 1fr; }
}
.jg-dialog-body { padding: 1rem; overflow: auto; height: calc(100% - 3.5rem); box-sizing: border-box; }
/* JG-004: the dialog's tabs, the same look as the settings page tabs, as buttons. */
.tabs button[role="tab"] { padding: .45rem .9rem; color: var(--menu-text); background: transparent; font: inherit;
  border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; margin-bottom: -1px; cursor: pointer; }
.tabs button[role="tab"]:hover { background: var(--nav-hover); }
.tabs button[role="tab"][aria-selected="true"] { border-color: var(--menu-border); background: var(--page-bg);
  color: var(--menu-active); font-weight: 600; }
/* JG-005: workers tab, home team | field team side by side. */
.jg-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.jg-team { min-width: 0; text-align: left; }
.jg-team h3 { margin: 0 0 .4rem; font-size: 1rem; }
.jg-team table { width: 100%; font-size: .85em; }
.jg-team td { overflow-wrap: anywhere; }
.jg-move { padding: .1rem .55rem; font-weight: 700; }
.jg-pager { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.jg-pager[hidden] { display: none; }
.jg-teams [data-team-error] { grid-column: 1 / -1; }
@media (max-width: 900px) { .jg-teams { grid-template-columns: 1fr; } }
/* words for where the other column is: beside it, or above it once stacked */
.jg-narrow-only { display: none; }
@media (max-width: 900px) { .jg-wide-only { display: none; } .jg-narrow-only { display: inline; } }
/* JG-006: assignments tab menu, pickable rows, create / update. */
.jg-menu { display: flex; gap: .4rem; margin: 0 0 .75rem; }
.jg-menu button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.jg-menu button:disabled { opacity: .45; cursor: not-allowed; }
.jg-asg-chosen { margin: 0 0 .5rem; font-weight: 600; }
.jg-pick-row { cursor: pointer; }
.jg-pick-row:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.jg-pick-row[aria-selected="true"] { background: color-mix(in srgb, var(--link) 20%, transparent); font-weight: 600; }
/* JG-017: the messages button at the end of each person in the assignment picker, and the messages tab */
.jg-msg-cell { width: 1%; text-align: right; }
.jg-msg-button { padding: .15rem .35rem; line-height: 0; }
.jg-msg-button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.jg-msg-people { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1rem; font-size: .9em; }
.jg-msg-people li { break-inside: avoid; }
.jg-msg-people button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: .2rem .4rem; border-radius: 3px; cursor: pointer; }
.jg-msg-people button:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.jg-msg-people button:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.jg-msg-people button[aria-selected="true"] { background: color-mix(in srgb, var(--link) 20%, transparent); font-weight: 600; }
.jg-msg-boxes { border: 0; margin: 0; padding: 0; }
.jg-msg-boxes label { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin-top: .6rem; }
.jg-msg-boxes .hint { margin: .1rem 0 0 1.6rem; }
.jg-msg-boxes:disabled { opacity: .5; }
.jg-asg-actions { margin-top: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.jg-asg-actions [data-asg-notice] { flex-basis: 100%; margin: 0; }
/* JG-008: delete with an in-page confirmation. */
.jg-asg button.jg-danger { color: var(--err); border-color: var(--err); }
.jg-asg button.jg-danger-solid { background: var(--err); border-color: var(--err); color: var(--btn-text); }
.jg-confirm { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.jg-confirm[hidden] { display: none; }

/* Quotes (quotes/form.html, static/rad/quote-form.js) */
.pick-row { display: flex; gap: .5rem; align-items: flex-start; }
.pick-row .svc-pick { flex: 1; }
.pick-row > button { margin: 0; white-space: nowrap; }
.svc-price { color: var(--muted); float: right; margin-left: 1rem; font-variant-numeric: tabular-nums; }
.quote-add { margin: 1rem 0; border: 1px solid var(--border); border-radius: 6px; padding: .5rem 1rem 1rem; }
.quote-add label { display: block; margin-top: .5rem; }
.quote-items td { vertical-align: top; }
.quote-items .quote-desc { width: 100%; min-width: 14rem; box-sizing: border-box; font: inherit; }
.quote-items .quote-qty { width: 5rem; text-align: right; }
.quote-items .quote-price { width: 7rem; text-align: right; }
.quote-items tfoot th { text-align: right; }
.quote-items .quote-total th, .quote-items .quote-total td { font-weight: 700; }
.quote-line.dragging { opacity: .6; background: var(--nav-active); }
.drag-handle { cursor: grab; touch-action: none; background: none; color: var(--muted); border: 0; padding: .2rem .35rem; font-size: 1.1rem; margin: 0; }
.drag-handle:active { cursor: grabbing; }
.remove-x { background: none; border: 1px solid transparent; color: var(--err); font-weight: 700; font-size: 1rem; padding: .15rem .45rem; margin: 0; cursor: pointer; border-radius: 4px; }
.remove-x:hover { background: var(--err-bg); border-color: var(--err); }
.warning-text { color: var(--text); background: var(--warn-bg); border-left: 4px solid var(--warn); padding: .3rem .5rem; border-radius: 4px; }
.error-text { color: var(--err); }
.quote-set-dialog label { display: block; margin-top: .5rem; }
.quote-set-dialog #set-name { width: 100%; box-sizing: border-box; }
.quote-customer-dialog { max-width: 56rem; }
.quote-customer-dialog iframe { width: 100%; height: min(75vh, 46rem); border: 0; }
body.popup-page .client { margin: 0; padding: 0 .25rem; max-width: none; }
.quote-send { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1.25rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.quote-send a.button:not(.secondary) { background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-bg); }
.quote-send a.button:not(.secondary):hover { background: var(--btn-hover); }
.quote-send button { margin: 0; }
.quote-send .hint { flex-basis: 100%; margin: .25rem 0 0; }
.quote-email-dialog label { display: block; margin-top: .6rem; }
.quote-email-dialog input, .quote-email-dialog textarea { width: 100%; box-sizing: border-box; font: inherit; }
.quote-pager { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.quote-pager button { margin: 0; padding: .25rem .6rem; }
.quote-per-page { display: inline-flex; gap: .4rem; align-items: center; margin-left: auto; }
.quote-items .quote-page-total th, .quote-items .quote-page-total td { font-weight: 400; font-style: italic; }
.quote-pager[hidden] { display: none; }
.customer-form.quote-form { max-width: 72rem; }
.quote-previous { margin: .75rem 0; }
.quote-previous li { margin: .2rem 0; }
.quote-set-dialog input[type=text], .quote-email-dialog input, .quote-email-dialog textarea {
  width: 100%; box-sizing: border-box; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; font-weight: 400; background: var(--input-bg); color: var(--text);
}
.quote-set-dialog label, .quote-email-dialog label { font-weight: 600; font-size: .9em; }

/* Quote signing page for customers (quotes/sign.html, static/rad/quote-sign.js) */
body.quote-sign-page { background: var(--page-bg); color: var(--text); margin: 0; }
.quote-sign { max-width: 56rem; margin: 0 auto; padding: 1rem; }
.quote-sign-pages { display: grid; gap: 1rem; margin: 1rem 0; }
.quote-sign-sheet { position: relative; border: 1px solid var(--border); box-shadow: 0 2px 10px rgb(0 0 0 / .12); }
.quote-sign-sheet img { display: block; width: 100%; height: auto; }
.quote-sign-field { position: absolute; margin: 0; padding: 0; border: 2px dashed var(--link); background: color-mix(in srgb, var(--link) 10%, transparent); color: var(--link); font-weight: 700; cursor: pointer; border-radius: 2px; }
.quote-sign-field:hover, .quote-sign-field:focus-visible { background: color-mix(in srgb, var(--link) 20%, transparent); }
.quote-sign-dialog { max-width: 36rem; }
.quote-sign-dialog input[type=text] { width: 100%; box-sizing: border-box; padding: .45rem .6rem; border: 1px solid var(--input-border); border-radius: 4px; font: inherit; background: var(--input-bg); color: var(--text); }
.quote-sign-dialog label, .quote-sign-label { display: block; font-weight: 600; font-size: .9em; margin: .6rem 0 .25rem; }
.quote-sign-pad { display: block; width: 100%; height: 11rem; border: 1px solid var(--input-border); border-radius: 4px; background: var(--input-bg); touch-action: none; cursor: crosshair; }
.quote-sign-done { font-weight: 600; background: var(--ok-bg); border-left: 4px solid var(--ok); padding: .6rem .8rem; }
.quote-signed p { margin: .3rem 0; }
.quote-sign-shown { position: absolute; object-fit: contain; padding: 2px; box-sizing: border-box; }
.quote-search { align-items: end; }
.quote-search input[type=search] { min-width: 16rem; }
.quote-dates { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.quote-dates > button { margin: 0; }
.quote-invoiced textarea, .quote-invoiced input { background: var(--th-bg); color: var(--muted); }
.quote-items .quote-invoiced-total th, .quote-items .quote-invoiced-total td { font-weight: 400; color: var(--muted); }

/* Invoice online for customers (receivables/online.html), laid out like Jobber's client hub */
body.quote-sign-page .quote-sign:has(.invoice-online-grid) { max-width: 76rem; }
.invoice-online-brand { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.invoice-online-brand span { font-weight: 700; font-size: 1.05rem; flex: 1; }
.invoice-online-brand img { height: auto; max-width: 40vw; }
.invoice-online-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
.invoice-online, .invoice-online-pay { border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem 1.5rem; background: var(--input-bg); }
.invoice-online-pay { position: sticky; top: 1rem; }
.invoice-online-title { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.invoice-online-title h1 { font-size: 1.2rem; margin: .1rem 0; }
.invoice-online-title .hint { margin: 0; }
.invoice-pill { white-space: nowrap; border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; font-weight: 600; }
.invoice-pill-past-due { background: var(--err-bg); color: var(--err); }
.invoice-pill-paid { background: var(--ok-bg); color: var(--ok); }
.invoice-pill-due { background: var(--warn-bg); color: var(--text); }
.invoice-online-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding-bottom: 1rem; border-bottom: 3px solid var(--border); }
.invoice-online-box { display: grid; grid-template-columns: auto auto; gap: .35rem 2rem; margin: 0; }
.invoice-online-box dt { color: var(--muted); }
.invoice-online-box dd { margin: 0; text-align: right; }
.invoice-online-lines { width: 100%; border-collapse: collapse; }
.invoice-online-lines th { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--border); }
.invoice-online-lines td { padding: .7rem .4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.invoice-online-lines .num { text-align: right; white-space: nowrap; }
.invoice-online-desc { color: var(--muted); }
.invoice-online-totals { display: grid; grid-template-columns: auto 9rem; gap: .35rem 1rem; justify-content: end; margin: 1rem 0; }
.invoice-online-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-online-total { font-weight: 700; border-top: 1px solid var(--border); padding-top: .35rem; }
.invoice-online-notes p { margin: .5rem 0; }
.invoice-online-amount { font-size: 2.2rem; font-weight: 700; margin: 0 0 1rem; }
.invoice-online-pay .hint { margin: 0; }
.invoice-pay button { width: 100%; font-size: 1.05rem; padding: .7rem 1.2rem; margin: 0; }
.invoice-online-secure { list-style: none; padding: 0; margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.invoice-online-secure li { margin: .3rem 0; }
@media (max-width: 860px) { .invoice-online-grid { grid-template-columns: minmax(0, 1fr); } .invoice-online-pay { position: static; } }

/* New / edit invoice (receivables/invoice_form.html, static/rad/invoice-form.js) */
.customer-form.invoice-form { max-width: 82rem; }
.invoice-pick { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.25rem; align-items: start; margin-top: 1rem; }
.invoice-tools { display: flex; gap: .5rem; margin-bottom: .5rem; }
.invoice-tools button { margin: 0; }
.invoice-items td { vertical-align: top; }
.invoice-items .invoice-desc { min-width: 12rem; }
.invoice-labour-row { border-top: 2px solid var(--border); }
.invoice-labour-row details { margin-top: .4rem; }
.invoice-markup { display: inline-flex; gap: .4rem; align-items: center; margin-left: .75rem; font-weight: 400; }
.invoice-markup input { width: 4.5rem; }
.invoice-shifts tr.muted td { color: var(--muted); }
.invoice-discount { margin: 1rem 0; }
.invoice-discount fieldset { border: 1px solid var(--border); border-radius: 6px; padding: .5rem 1rem 1rem; max-width: 32rem; }
.invoice-discount-kind { display: flex; gap: 1rem; margin-bottom: .5rem; }
.invoice-float { position: sticky; top: 1rem; border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1rem; background: var(--page-bg); box-shadow: 0 4px 16px rgb(0 0 0 / .12); }
.invoice-float dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; margin: .4rem 0; }
.invoice-float dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-float dt { color: var(--muted); }
.invoice-float-count { margin: 0 0 .4rem; font-weight: 600; }
.invoice-float-total { border-top: 1px solid var(--border); padding-top: .4rem; font-weight: 700; font-size: 1.1rem; }
.invoice-float-total dt { color: var(--text); }
.invoice-float button { width: 100%; margin: .6rem 0 0; }
.invoice-float [hidden] { display: none; }
@media (max-width: 900px) {
  .invoice-pick { grid-template-columns: minmax(0, 1fr); }
  .invoice-float { top: auto; bottom: 0; order: 2; }
}
.customer-form .invoice-discount-kind label { display: inline-flex; gap: .35rem; align-items: center; font-weight: 400; }
.customer-form .invoice-discount-kind input { width: auto; }
.inline-form { display: inline-flex; gap: .4rem; margin: 0; }
.inline-form button { margin: 0; }
.invoice-received { margin: .5rem 0 1rem; max-width: 52rem; }

/* AR report (receivables/ar_report.html) */
.ar-report .ar-customer-row th { text-align: left; font-weight: 400; }
.ar-toggle { background: none; border: 0; padding: 0; margin: 0 .4rem 0 0; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.ar-toggle::before { content: '▸ '; color: var(--muted); }
.ar-toggle[aria-expanded="true"]::before { content: '▾ '; }
.ar-invoices td { background: var(--warn-soft); font-size: .92em; }
.ar-invoices td:first-child { padding-left: 1.6rem; }
