:root {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-muted: #eef2f5;
  --soft: #f7f9fb;
  --text: #1f2933;
  --text-soft: #3c4653;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6eaef;
  --line-strong: #d3dae2;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --acc-tint: #e6f2f0;
  --acc-line: rgba(15, 118, 110, 0.24);
  --ring: rgba(15, 118, 110, 0.18);
  --danger: #b42318;
  --warning: #7a4b00;
  --purple: #7a2ebf;
  --green: #15803d;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 32px -8px rgba(16, 24, 40, 0.14);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

@media (min-width: 981px) {
  .app-shell.app-shell--sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

.sidebar {
  align-self: start;
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  transition: padding 180ms ease;
}

.brand {
  align-items: center;
  display: flex;
  min-height: 44px;
  margin-bottom: 18px;
  padding-right: 48px;
  position: relative;
}

.brand__name {
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.sidebar-copy--compact {
  display: none;
}

.sidebar-toggle {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  height: 44px;
  justify-content: center;
  position: absolute;
  right: 0;
  top: -5px;
  width: 44px;
}

.sidebar-toggle:hover {
  background: var(--acc-tint);
  border-color: var(--acc-line);
  color: var(--primary-dark);
}

.nav {
  display: grid;
  gap: 3px;
}

.nav button {
  align-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  display: flex;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.nav button:hover {
  background: var(--soft);
  color: var(--text);
}

.nav button.active {
  background: var(--acc-tint);
  color: var(--primary-dark);
  font-weight: 700;
}

.nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--text-soft);
  display: flex;
  gap: 11px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 12px;
  position: relative;
  text-decoration: none;
}

.nav a:hover {
  background: var(--soft);
  color: var(--text);
}

.nav a.active {
  background: var(--acc-tint);
  color: var(--primary-dark);
  font-weight: 700;
}

.nav__icon {
  color: var(--muted);
  flex: 0 0 20px;
  height: 20px;
  width: 20px;
}

.nav a:hover .nav__icon,
.nav a.active .nav__icon {
  color: var(--primary);
}

.nav a.nav__group-start {
  border-top: 1px solid var(--line);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 7px;
  padding-top: 14px;
}

.nav a:first-child.nav__group-start {
  border-top: 0;
  border-radius: 8px;
  margin-top: 0;
  padding-top: 10px;
}

.sidebar-auth {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.sidebar-auth span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sidebar-auth__button {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  width: 100%;
}

.sidebar-auth__icon {
  color: var(--muted);
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.app-shell--sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.app-shell--sidebar-collapsed .sidebar-copy--full {
  display: none;
}

.app-shell--sidebar-collapsed .sidebar-copy--compact {
  display: inline;
}

.app-shell--sidebar-collapsed .brand {
  flex-direction: column;
  gap: 8px;
  justify-items: center;
  min-height: auto;
  padding-right: 0;
}

.app-shell--sidebar-collapsed .brand__name {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.app-shell--sidebar-collapsed .sidebar-toggle {
  position: static;
}

.app-shell--sidebar-collapsed .nav a {
  gap: 0;
  justify-content: center;
  min-height: 48px;
  padding: 10px 0;
}

.app-shell--sidebar-collapsed .nav__icon {
  flex-basis: 22px;
  height: 22px;
  width: 22px;
}

.app-shell--sidebar-collapsed .nav__count {
  align-items: center;
  background: var(--primary);
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 9px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 3px;
  position: absolute;
  right: 1px;
  top: 2px;
}

.app-shell--sidebar-collapsed .sidebar-auth {
  justify-items: center;
  width: 100%;
}

.app-shell--sidebar-collapsed .sidebar-auth__button {
  justify-content: center;
  padding: 0;
  width: 44px;
}

.main {
  align-self: start;
  min-width: 0;
  padding: 24px;
}

.auth-screen {
  align-items: center;
  background: var(--bg);
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  justify-self: center;
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.auth-card--loading {
  justify-items: start;
}

.auth-brand {
  display: grid;
  gap: 4px;
}

.auth-brand strong {
  color: #172026;
  font-size: 20px;
}

.auth-brand span,
.auth-muted,
.auth-heading p {
  color: var(--muted);
}

.auth-heading {
  display: grid;
  gap: 6px;
}

.auth-heading h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.auth-heading p {
  margin: 0;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: #344054;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.auth-form input {
  background: #ffffff;
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.auth-submit {
  margin-top: 2px;
  width: 100%;
}

.auth-alert,
.auth-error {
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
}

.auth-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.auth-error {
  background: #fee4e2;
  border: 1px solid #fecdca;
  color: var(--danger);
}

.topbar {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.topbar p {
  color: var(--muted);
  margin: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 110px;
  padding: 10px 12px;
}

.stat strong {
  display: block;
  font-size: 20px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel + .panel {
  margin-top: 12px;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 9px;
}

.panel-title h2,
.panel-title h3 {
  font-size: 18px;
  margin: 0;
}

.panel-title p {
  color: var(--muted);
  margin: 2px 0 0;
}

.grid-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.field {
  display: grid;
  gap: 3px;
}

[data-secondary-contact-fields][hidden] {
  display: none;
}

.termite-conditional-detail[hidden] {
  display: none;
}

.field.span-2 {
  grid-column: span 2;
}

.field.span-4 {
  grid-column: 1 / -1;
}

.field label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.field .field-sub-label {
  margin-top: 3px;
}

.price-gst-field {
  gap: 5px;
}

.field input,
.field select,
.field textarea {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  min-height: 34px;
  padding: 5px 8px;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.field textarea {
  min-height: 54px;
  resize: vertical;
}

@media (hover: hover) and (pointer: fine) and (max-width: 767px),
  (hover: hover) and (pointer: fine) and (min-width: 1181px) {
  .grid-form {
    gap: 8px;
  }

  .field {
    gap: 3px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 32px;
    padding: 4px 8px;
  }

  .field textarea {
    min-height: 48px;
  }

  .field label {
    font-size: 12px;
  }
}

.sectioned-form {
  display: grid;
  gap: 10px;
}

.form-sections {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.form-section > h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 7px;
}

.form-section--full {
  grid-column: 1 / -1;
}

.form-section--compact {
  padding: 8px 10px;
}

.form-section--compact > h3 {
  margin-bottom: 5px;
}

.form-section__fields {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr));
}

.form-section__fields .field.span-2 {
  grid-column: span 2;
}

.form-section__fields .field.span-4 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 880px) {
  .form-sections {
    grid-template-columns: 1fr;
  }
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  min-height: 44px;
  min-width: 44px;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.check-row label {
  align-items: center;
  color: #344054;
  display: inline-flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.check-row input {
  height: 16px;
  width: 16px;
}

.check-row label.termite-other-option {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: auto auto minmax(220px, 1fr);
  width: 100%;
}

.check-row label.termite-other-option input:not([type="checkbox"]) {
  height: auto;
  min-height: 34px;
  min-width: 0;
  padding: 5px 8px;
  width: 100%;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.actions.no-margin {
  margin-top: 0;
}

.page-primary-actions {
  margin-bottom: 9px;
}

.btn {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 13px;
  white-space: nowrap;
}

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

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #eef2f6;
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.btn.secondary:hover {
  background: #e4e9ef;
}

.btn.ghost {
  background: transparent;
  color: var(--primary-dark);
}

.btn.danger {
  background: #fdecea;
  border: 1px solid #f6d5d1;
  color: var(--danger);
}

.btn.small {
  min-height: 44px;
  min-width: 44px;
  padding: 6px 9px;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar input,
.toolbar select {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
}

.list {
  display: grid;
  gap: 10px;
}

.empty {
  background: var(--surface-muted);
  border: 1px dashed #b6c2cf;
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.date-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.date-heading {
  align-items: center;
  background: #edf5f3;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.date-heading strong {
  font-size: 15px;
}

.date-heading span {
  color: var(--muted);
  font-size: 13px;
}

.appointment-row {
  align-items: stretch;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.appointment-row__main {
  min-width: 0;
}

.appointment-row__main strong {
  display: block;
  margin-bottom: 3px;
}

.meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 9px;
}

.badge.green {
  background: #e7f4ec;
  color: var(--green);
}

.badge.red {
  background: #fdecea;
  color: var(--danger);
}

/* TASK 302B: 商 (commercial premises) marker so kefu can tell commercial from residential at a glance. */
.badge-commercial {
  background: #b45309;
  color: #fff;
}

/* Commercial marker sits in the card's top-right cluster (with the marker dots), no bottom row. */
.calendar-card__top-end,
.schedule-card__top-end {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calendar-card__top-end .badge-commercial,
.schedule-card__top-tools .badge-commercial {
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.badge.yellow {
  background: #fdf3e6;
  color: var(--warning);
  min-width: 20px;
  text-align: center;
}

.badge.purple {
  background: #f3ebfb;
  color: var(--purple);
}

.badge.recurring {
  background: #e0f2fe;
  color: #0369a1;
}

.badge.neutral {
  background: #eef1f4;
  color: #475569;
}

.badge.status-booked,
.badge.status-scheduled {
  background: #eaeef7;
  color: #42598c;
}

.badge.status-completed {
  background: #e7f4ec;
  color: var(--green);
}

.badge.status-open {
  background: var(--acc-tint);
  color: var(--primary-dark);
}

.badge.status-sent {
  background: #e8f1fb;
  color: #1d68c4;
}

.badge.status-paid {
  background: #e7f4ec;
  color: var(--green);
}

.badge.status-logged {
  background: var(--acc-tint);
  color: var(--primary-dark);
}

.badge.status-draft {
  background: #eef1f4;
  color: #475569;
}

.badge.status-void {
  background: #f2f4f7;
  color: #667085;
}

.badge.status-snoozed {
  background: #fdf3e6;
  color: var(--warning);
}

.badge.status-done {
  background: #e7f4ec;
  color: var(--green);
}

.badge.status-cancelled {
  background: #fdecea;
  color: var(--danger);
}

.board-range {
  display: grid;
  gap: 18px;
}

.day-board {
  display: grid;
  gap: 10px;
}

.day-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.day-title h3 {
  font-size: 17px;
  margin: 0;
}

.columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.tech-column {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 160px;
  padding: 10px;
}

.tech-column.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.tech-column__head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tech-column__head strong {
  font-size: 14px;
}

.card-list {
  display: grid;
  gap: 9px;
  min-height: 88px;
}

.appointment-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.appointment-card:active {
  cursor: grabbing;
}

.color-strip {
  display: grid;
  grid-auto-columns: minmax(18px, 1fr);
  grid-auto-flow: column;
  height: 5px;
}

.strip-green {
  background: var(--green);
}

.strip-red {
  background: var(--danger);
}

.strip-yellow {
  background: #eab308;
}

.strip-purple {
  background: var(--purple);
}

.strip-neutral {
  background: #94a3b8;
}

.appointment-card__body {
  display: grid;
  gap: 7px;
  padding: 8px 10px 10px;
}

.appointment-card__top {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.time-pill {
  background: #e8edf3;
  border-radius: 999px;
  color: #344054;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 7px;
}

.customer-line {
  min-width: 0;
}

.customer-line strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-line span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-detail {
  color: #475467;
  font-size: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.technician-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.technician-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px;
}

.technician-item input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 36px;
  padding: 7px 9px;
}

.customer-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.customer-table__head,
.customer-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.2fr 1fr 1.4fr 0.7fr 0.8fr;
}

.customer-table__head {
  background: var(--soft);
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}

.customer-row {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.history {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  margin: 0 -12px -12px;
  padding: 10px 12px;
}

.history h4 {
  font-size: 14px;
  margin: 0 0 8px;
}

.history-item {
  border-top: 1px solid #e5eaf0;
  color: #475467;
  display: grid;
  gap: 4px;
  padding: 8px 0;
}

.history-item:first-of-type {
  border-top: 0;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  padding: 10px 12px;
}

.app-feedback-region {
  display: grid;
  gap: 8px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  pointer-events: none;
  position: fixed;
  right: 16px;
  top: 16px;
  width: min(420px, calc(100vw - 32px));
  z-index: 1400;
}

.app-feedback {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 44px;
  padding: 10px 8px 10px 12px;
  pointer-events: auto;
}

.app-feedback--success {
  background: #dcfce7;
  border-left-color: var(--green);
}

.app-feedback--warning {
  background: #fef3c7;
  border-left-color: var(--warning);
}

.app-feedback--danger {
  background: #fee4e2;
  border-left-color: var(--danger);
}

.app-feedback__message {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  margin: 3px 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.app-feedback__dismiss {
  align-items: center;
  align-self: start;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
}

.app-feedback__dismiss:hover {
  background: rgba(15, 23, 42, 0.08);
}

.app-feedback__dismiss:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-draft-banner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 8px 10px;
}

.workspace-topbar {
  align-items: stretch;
  display: grid;
  gap: 10px;
}

.workspace-topbar__header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.page-flow {
  background: #e7f5f2;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  color: #115e59;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  padding: 10px 12px;
}

.content-region {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.content-region > * {
  min-width: 0;
}

.global-system-alert {
  align-items: flex-start;
  background: #fff4e5;
  border: 1px solid #f59e0b;
  border-left: 4px solid #b45309;
  border-radius: 8px;
  color: #7c2d12;
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.global-system-alert span {
  font-size: 13px;
}

.report-hub-panel {
  min-width: 0;
}

.flow-chip {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  padding: 10px 12px;
}

.flow-chip span + span::before {
  color: var(--muted);
  content: "->";
  margin-right: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-summary-panel {
  background: linear-gradient(145deg, #ffffff 0%, #f7fbfa 100%);
  border-color: #d7e5e2;
}

.dashboard-summary-head {
  align-items: center;
  border-bottom: 1px solid #dde9e6;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px 10px;
}

.dashboard-summary-head h2 {
  color: #123c3a;
  font-size: 18px;
  margin: 0;
}

.dashboard-release-bar {
  align-items: center;
  color: #667085;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.dashboard-release-bar .metric-card {
  align-items: baseline;
  background: transparent;
  border: 0;
  box-shadow: none;
  flex-direction: row;
  gap: 6px;
  min-height: 0;
  padding: 0;
}

.metric-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dce7e5;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(21, 62, 59, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  min-height: 82px;
  padding: 12px 14px;
  max-width: 100%;
  position: relative;
}

.metric-card::before {
  background: #158277;
  border-radius: 10px 10px 0 0;
  content: "";
  height: 3px;
  inset: -1px -1px auto;
  position: absolute;
}

.metric-card__label {
  color: #344054;
  display: block;
  font-size: 13px;
  font-weight: 750;
}

.metric-card strong {
  color: #102f2d;
  font-size: 25px;
  line-height: 1;
  white-space: nowrap;
}

.metric-card .metric-label-zh {
  display: block;
  font-style: normal;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.metric-label-en {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.dashboard-release-bar .metric-card::before {
  display: none;
}

.dashboard-release-bar .metric-card strong {
  color: #344054;
  font-size: 14px;
}

.dashboard-release-bar .metric-card .metric-label-zh {
  color: #667085;
  font-size: 12px;
}

.metric-card--danger {
  background: #fffafa;
  border-color: #f2d1ce;
}

.metric-card--danger::before {
  background: var(--danger);
}

@media screen and (max-width: 980px) {
  .dashboard-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-release-bar {
    justify-content: flex-start;
  }

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

@media screen and (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 76px;
    padding: 11px 12px;
  }

  .metric-card strong {
    font-size: 22px;
  }
}

.workflow-lane {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workflow-lane a {
  background: #edf5f3;
  border: 1px solid #c8ded9;
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
}

.workflow-lane span {
  color: var(--muted);
  font-weight: 800;
}

.page-placeholder {
  min-height: 220px;
}

.calendar-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.calendar-summary div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.calendar-summary strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1;
}

.calendar-summary span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-toolbar {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin: 10px 0;
}

.calendar-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-tool-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-tool-field span,
.calendar-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-check {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 44px;
}

.calendar-toolbar input,
.calendar-toolbar select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 9px;
  width: 100%;
}

.calendar-legend {
  align-items: center;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
  padding: 8px 0;
}

.calendar-legend span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.legend-dot.termite {
  background: #d92d20;
}

.legend-dot.contact {
  background: #f5c542;
}

.legend-dot.any-day {
  background: #22c55e;
}

.legend-dot.fix {
  background: #8b5cf6;
}

.calendar-panel {
  min-width: 0;
}

.calendar-board-shell {
  --calendar-day-column-width: clamp(180px, 12vw, 240px);
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.calendar-board-sticky {
  background: var(--surface);
  border-radius: 10px 10px 0 0;
  position: sticky;
  top: 0;
  z-index: 4;
}

.calendar-board-top-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.calendar-board-top-scroll__track,
.calendar-board-header-track,
.calendar-board {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  width: max-content;
}

.calendar-board-top-scroll__day,
.calendar-day-header,
.calendar-day-column {
  flex: 0 0 var(--calendar-day-column-width);
}

.calendar-board-top-scroll__day {
  height: 1px;
}

.calendar-board-header-viewport {
  max-width: 100%;
  overflow: hidden;
}

.calendar-board {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 10px;
}

.calendar-day-column {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  grid-template-rows: minmax(220px, 1fr);
  min-width: 0;
}

.calendar-day-column.is-weekend {
  background: #f3f7f8;
}

.calendar-day-header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: 9px 9px 0 0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 68px;
  padding: 8px;
}

.calendar-day-header.is-weekend {
  background: #f3f7f8;
}

.calendar-day-header strong,
.calendar-day-header span,
.calendar-day-header small {
  display: block;
}

.calendar-day-header strong {
  font-size: 14px;
}

.calendar-day-header span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-day-header small {
  color: var(--muted);
  font-size: 11px;
}

.calendar-day-header b {
  background: var(--acc-tint);
  border-radius: 999px;
  color: var(--primary-dark);
  flex: 0 0 auto;
  font-size: 12px;
  min-width: 28px;
  padding: 5px 7px;
  text-align: center;
}

.calendar-day-list {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 6px;
}

.calendar-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 8px;
  text-align: center;
}

.calendar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  position: relative;
}

.calendar-card.is-compact {
  gap: 3px;
  min-height: 82px;
  padding: 6px;
}

.calendar-card:hover {
  background: #f8fafc;
}

.calendar-card.is-cancelled {
  background: #f1f5f9;
  color: #667085;
  opacity: 0.72;
}

.calendar-card.is-completed {
  opacity: 0.72;
}

.calendar-card.has-termite {
  border-left: 4px solid var(--danger);
}

.calendar-card.has-contact {
  box-shadow: none;
}

.calendar-card.has-fix {
  border-bottom-color: var(--line);
}

.calendar-card.has-any-day:not(.has-termite) {
  border-left-color: var(--line);
}

.calendar-card__time {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.card-time-note {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.card-time-note .schedule-note-icon {
  flex: 0 0 auto;
}

.calendar-card__top {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-width: 0;
}

.calendar-card__service {
  background: #172026;
  border-radius: 999px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 3px 6px;
}

.calendar-card__location {
  color: #1f2933;
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__meta {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__service-line {
  color: #1f2933;
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__note-row {
  align-items: center;
  display: flex;
  gap: 6px;
  min-height: 15px;
}

.calendar-cancelled-label {
  background: #e5e7eb;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475467;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 5px;
}

.calendar-card__title {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-width: 0;
}

.calendar-card__title strong {
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__title span {
  background: #172026;
  border-radius: 999px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
}

.calendar-card__customer {
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__line {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-card__actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 2px;
}

.calendar-card__compact-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr;
  min-height: 12px;
}

.calendar-card__badge-row,
.schedule-card__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-left {
  justify-self: start;
}

.action-middle {
  justify-self: center;
}

.action-right {
  justify-self: end;
}

.calendar-card.is-compact .badge-row {
  gap: 3px;
}

.calendar-card.is-compact .badge {
  font-size: 9px;
  padding: 2px 5px;
}

.link-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--primary-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  text-decoration: underline;
}

.link-button:disabled {
  color: #9aa4b2;
  cursor: not-allowed;
  text-decoration: none;
}

.link-button.danger-link {
  color: var(--danger);
}

.link-button.confirm-link {
  color: var(--primary);
  font-weight: 950;
  min-width: 52px;
  padding-inline: 10px;
  text-align: center;
}

.link-button.unlock-link {
  color: #f59e0b;
}

.calendar-card .link-button {
  min-height: 0;
}

.calendar-card .link-button:not(.confirm-link) {
  min-width: 0;
}

.calendar-card .btn {
  min-height: 38px;
  min-width: 0;
}

.calendar-card .btn.small {
  min-height: 30px;
}

.calendar-form {
  margin-top: 10px;
}

.calendar-quick-paste {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
}

.calendar-quick-paste-control {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.calendar-quick-paste textarea {
  min-height: 42px;
}

.calendar-quick-paste small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.form-section--quick-entry .form-section__fields,
.form-section--pricing .form-section__fields,
.form-section--flags .form-section__fields {
  gap: 6px;
}

.form-section--pricing .price-gst-field {
  gap: 4px;
}

.pricing-section-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 5px;
}

.form-section--pricing .pricing-section-header > h3 {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.pricing-gst-toggle {
  align-items: center;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  justify-self: start;
  max-width: 100%;
  padding: 2px;
}

.pricing-gst-toggle__option {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  min-height: 44px;
  padding: 8px 10px;
  white-space: nowrap;
}

.pricing-gst-toggle__option.is-active {
  background: #0f766e;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.15);
  color: #ffffff;
}

.pricing-gst-toggle__option:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.form-section--pricing .calendar-service-prices {
  gap: 6px;
}

.calendar-form .form-section--assignment .form-section__fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.form-section--flags .check-row {
  gap: 8px 12px;
}

.calendar-form .form-section--flags .check-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

.calendar-billing-info-fields {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 8px;
}

.calendar-billing-info-fields[hidden] {
  display: none;
}

.calendar-billing-info-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.calendar-billing-info-fields small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

/* TASK 322 pilot: Add Appointment only. Removing .appt-saas restores the original form. */
.appt-saas {
  --saas-acc: var(--primary);
  --saas-acc-d: var(--primary-dark);
  --saas-acc-tint: var(--acc-tint);
  --saas-acc-line: var(--acc-line);
  --saas-ring: var(--ring);
  --saas-ground: var(--bg);
  --saas-card: var(--surface);
  --saas-soft: var(--soft);
  --saas-field: var(--surface);
  --saas-line: var(--line);
  --saas-line-strong: var(--line-strong);
  --saas-text: var(--text);
  --saas-text-soft: var(--text-soft);
  --saas-muted: var(--muted);
  --saas-faint: var(--faint);
  --saas-shadow-card: var(--shadow-card);
  background: var(--saas-ground);
  color: var(--saas-text);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: -13px -16px;
  min-height: calc(100vh - 48px);
  padding: 16px 18px 22px;
}

.appt-saas .panel-title {
  margin-bottom: 12px;
  padding: 0 2px;
}

.appt-saas .panel-title h2 {
  color: var(--saas-text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.appt-saas .calendar-form,
.appt-saas .jobs-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.appt-saas .form-sections {
  display: contents;
}

.appt-saas .form-section,
.appt-saas .form-actions {
  background: var(--saas-card);
  border: 1px solid var(--saas-line);
  border-radius: 10px;
  box-shadow: var(--saas-shadow-card);
  color: var(--saas-text);
  padding: 13px 14px 14px;
}

.appt-saas .form-section--quick-entry {
  background: var(--saas-soft);
}

.appt-saas .form-section--quick-entry,
.appt-saas .form-section--assignment {
  grid-column: 1 / -1;
}

.appt-saas .form-section--pricing,
.appt-saas .form-section--flags {
  grid-column: auto;
}

.appt-saas .form-sections > .form-section:last-child:not(:first-child) {
  grid-column: 1;
}

.appt-saas [data-jobs-adjust-amount-form] .form-actions {
  grid-column: 1 / -1;
}

.appt-saas .form-section > h3,
.appt-saas .pricing-section-header > h3 {
  align-items: center;
  color: var(--saas-text);
  display: flex;
  font-size: 13.5px;
  font-weight: 700;
  gap: 4px;
  letter-spacing: -0.1px;
  line-height: 22px;
  margin: 0 0 11px;
}

.appt-saas .form-section__number {
  align-items: center;
  background: var(--saas-acc-tint);
  border: 1px solid var(--saas-acc-line);
  border-radius: 7px;
  color: var(--saas-acc-d);
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 12px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  line-height: 1;
  margin-right: 2px;
  width: 22px;
}

.appt-saas .form-section__fields {
  gap: 9px 10px;
}

.appt-saas .form-section--quick-entry .form-section__fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.appt-saas .form-section--assignment .form-section__fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.appt-saas .field {
  gap: 5px;
}

.appt-saas .field label,
.appt-saas .calendar-customer-link > label,
.appt-saas .field .field-sub-label {
  color: var(--saas-text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.appt-saas .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.appt-saas .field select,
.appt-saas .field textarea,
.appt-saas .calendar-service-price > input,
.appt-saas .calendar-service-picker select {
  background-color: var(--saas-field);
  border: 1px solid var(--saas-line-strong);
  border-radius: 8px;
  color: var(--saas-text);
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  padding: 7px 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.appt-saas .field select,
.appt-saas .calendar-service-picker select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.appt-saas .field textarea {
  min-height: 56px;
}

.appt-saas .form-section:last-child .field textarea {
  min-height: 104px;
}

.appt-saas .field input::placeholder,
.appt-saas .field textarea::placeholder {
  color: var(--saas-faint);
}

.appt-saas .field input:focus,
.appt-saas .field select:focus,
.appt-saas .field textarea:focus,
.appt-saas .calendar-service-price > input:focus {
  border-color: var(--saas-acc);
  box-shadow: 0 0 0 3px var(--saas-ring);
  outline: none;
}

.appt-saas .field small,
.appt-saas .calendar-billing-info-fields small,
.appt-saas .calendar-quick-paste small,
.appt-saas .calendar-customer-search-status,
.appt-saas .calendar-manual-customer {
  color: var(--saas-muted);
  font-size: 11px;
}

.appt-saas .calendar-quick-paste,
.appt-saas .calendar-customer-link {
  background: transparent;
  border: 0;
  padding: 0;
}

.appt-saas .calendar-quick-paste textarea {
  min-height: 44px;
}

.appt-saas .calendar-customer-link {
  grid-column: span 2;
}

.appt-saas .calendar-selected-customer,
.appt-saas .calendar-customer-result,
.appt-saas .calendar-manual-customer {
  background: var(--saas-field);
  border: 1px solid var(--saas-line-strong);
  border-radius: 8px;
  color: var(--saas-text);
}

.appt-saas .calendar-selected-customer strong,
.appt-saas .calendar-customer-result strong,
.appt-saas .calendar-selected-customer span,
.appt-saas .calendar-customer-result small,
.appt-saas .linked-customer-pricing span {
  color: var(--saas-text);
}

.appt-saas .btn {
  background: #eef2f6;
  border: 1px solid var(--saas-line);
  border-radius: 8px;
  box-shadow: none;
  color: var(--saas-text-soft);
  font-size: 13px;
  font-weight: 650;
  min-height: 40px;
  padding: 8px 14px;
  transition: background 120ms ease, border-color 120ms ease;
}

.appt-saas .btn:hover {
  background: #e4e9ef;
}

.appt-saas .btn:focus-visible {
  outline: 2px solid var(--saas-acc);
  outline-offset: 2px;
}

.appt-saas .btn.primary {
  background: var(--saas-acc);
  border-color: var(--saas-acc);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
  color: #ffffff;
}

.appt-saas .btn.primary:hover {
  background: var(--saas-acc-d);
  border-color: var(--saas-acc-d);
}

.appt-saas :is(.calendar-service-chip) {
  background: var(--saas-acc-tint);
  border: 1px solid var(--saas-acc-line);
  box-shadow: none;
  color: var(--saas-acc-d);
  font-weight: 750;
  min-height: 30px;
}

.appt-saas :is(.calendar-service-chip) button {
  color: var(--saas-acc-d);
}

.appt-saas .time-specific-toggle,
.appt-saas .check-row label,
.appt-saas .service-package-price-toggle label {
  background: var(--saas-field);
  border: 1px solid var(--saas-line-strong);
  border-radius: 8px;
  color: var(--saas-text-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 12px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.appt-saas .time-specific-toggle:has(input:checked),
.appt-saas .check-row label:has(input:checked),
.appt-saas .service-package-price-toggle label:has(input:checked) {
  background: var(--saas-acc-tint);
  border-color: rgba(15, 118, 110, 0.4);
  color: var(--saas-acc-d);
}

.appt-saas input[type="checkbox"],
.appt-saas input[type="radio"] {
  accent-color: var(--saas-acc);
}

.appt-saas .pricing-section-header {
  align-items: center;
  margin-bottom: 9px;
}

.appt-saas .pricing-section-header > h3 {
  margin-bottom: 0;
}

.appt-saas .pricing-gst-toggle {
  background: #eef2f6;
  border: 1px solid var(--saas-line);
  border-radius: 9px;
  box-shadow: none;
  gap: 2px;
  padding: 2px;
}

.appt-saas .pricing-gst-toggle__option {
  border-radius: 7px;
  color: var(--saas-muted);
  font-size: 12px;
  font-weight: 650;
  min-height: 34px;
  padding: 6px 12px;
}

.appt-saas .pricing-gst-toggle__option.is-active {
  background: var(--saas-acc);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.15);
  color: #ffffff;
}

.appt-saas :is(.calendar-service-price) {
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 128px) auto;
}

.appt-saas .calendar-service-price span {
  color: var(--saas-text-soft);
  font-size: 12.5px;
}

.appt-saas .calendar-service-price input {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.appt-saas .calendar-service-price__tbd {
  border: 1px dashed var(--saas-line-strong);
  border-radius: 7px;
  color: var(--saas-muted);
  font-size: 11px;
  font-weight: 600;
  min-height: 40px;
  padding: 7px 9px;
}

.appt-saas .calendar-price-total {
  align-items: center;
  background: var(--saas-soft);
  border: 1px solid var(--saas-line);
  color: var(--saas-muted);
  display: flex;
  font-size: 12.5px;
  font-weight: 600;
  justify-content: space-between;
  margin: 0;
  padding: 8px 13px;
}

.appt-saas .calendar-price-total strong {
  color: var(--saas-text-soft);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.appt-saas .calendar-price-total:has([data-calendar-price-gst]) {
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  margin-top: 4px;
}

.appt-saas .calendar-price-total:has([data-calendar-price-total]) {
  border-radius: 0 0 10px 10px;
  color: var(--saas-text);
  font-size: 13px;
  font-weight: 700;
}

.appt-saas .calendar-price-total:has([data-calendar-price-total]) strong {
  color: var(--saas-acc-d);
  font-size: 18px;
  letter-spacing: -0.3px;
}

.appt-saas :is(.pricing-tag-selector) {
  background: #eef2f6;
  border: 1px solid var(--saas-line);
  border-radius: 9px;
  gap: 2px;
  padding: 2px;
}

.appt-saas .pricing-tag-option {
  border-radius: 7px;
  font-size: 12px;
  min-height: 34px;
  padding: 6px 10px;
}

.appt-saas .calendar-billing-info-fields {
  border-top: 1px dashed var(--saas-line-strong);
  margin-top: 6px;
  padding-top: 11px;
}

.appt-saas .calendar-billing-info-grid {
  gap: 9px 10px;
}

/* Completed / terminal appointments: locked controls read as clearly non-editable. */
.appt-saas .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):disabled,
.appt-saas .field select:disabled,
.appt-saas .field textarea:disabled,
.appt-saas :is(.calendar-service-price) input:disabled,
.appt-saas .calendar-service-picker select:disabled {
  background-color: #f1f4f7;
  border-color: var(--saas-line);
  color: var(--saas-muted);
  cursor: not-allowed;
  opacity: 1;
}

.appt-saas .btn:disabled {
  background: #f1f4f7;
  border-color: var(--saas-line);
  box-shadow: none;
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .time-specific-toggle:has(input:disabled),
.appt-saas .check-row label:has(input:disabled),
.appt-saas .service-package-price-toggle label:has(input:disabled) {
  background: #f1f4f7;
  border-color: var(--saas-line);
  border-style: dashed;
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .time-specific-toggle:has(input:checked:disabled),
.appt-saas .check-row label:has(input:checked:disabled),
.appt-saas .service-package-price-toggle label:has(input:checked:disabled) {
  background: #e8edf1;
  border-color: var(--saas-line-strong);
  border-style: solid;
  color: var(--saas-muted);
}

.appt-saas .pricing-gst-toggle.is-disabled {
  background: #f1f4f7;
  cursor: not-allowed;
}

.appt-saas .pricing-gst-toggle.is-disabled .pricing-gst-toggle__option {
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .pricing-gst-toggle.is-disabled .pricing-gst-toggle__option.is-active {
  background: var(--saas-muted);
  box-shadow: none;
  color: #ffffff;
}

.appt-saas :is(.pricing-tag-selector):has(input:disabled) {
  background: #f1f4f7;
  cursor: not-allowed;
}

.appt-saas .pricing-tag-selector input:disabled + .pricing-tag-option {
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .pricing-tag-selector input:checked:disabled + .pricing-tag-option--none,
.appt-saas .pricing-tag-selector input:checked:disabled + .pricing-tag-option--groupbuy,
.appt-saas .pricing-tag-selector input:checked:disabled + .pricing-tag-option--discount {
  background: var(--saas-muted);
  border-color: var(--saas-muted);
  box-shadow: none;
  color: #ffffff;
}

.appt-saas :is(.calendar-service-chip) button:disabled {
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .calendar-service-price__tbd:has(input:disabled) {
  border-color: var(--saas-line);
  color: var(--saas-faint);
  cursor: not-allowed;
}

.appt-saas .form-actions,
.appt-saas .form-actions.form-modal__action-bar {
  align-items: center;
  border-top: 1px solid var(--saas-line);
  bottom: auto;
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 0;
  min-height: 100%;
  padding: 13px 14px 14px;
  position: relative;
  width: 100%;
  z-index: auto;
}

.appt-saas .form-actions .btn {
  flex: 1;
  min-height: 48px;
}

.appt-saas .form-actions .btn.primary {
  flex: 2;
  font-size: 14.5px;
}

@media screen and (pointer: coarse) and (min-width: 768px) {
  .appt-saas .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .appt-saas .field select,
  .appt-saas .field textarea,
  .appt-saas .calendar-service-price > input,
  .appt-saas .calendar-service-picker select {
    min-height: 40px;
  }

  .appt-saas button,
  .appt-saas .btn,
  .appt-saas .time-specific-toggle,
  .appt-saas .check-row label,
  .appt-saas .service-package-price-toggle label,
  .appt-saas .pricing-gst-toggle__option,
  .appt-saas .pricing-tag-option,
  .appt-saas .calendar-service-price__tbd {
    min-height: 40px;
  }

  .appt-saas .btn.primary {
    min-height: 44px;
  }

  .appt-saas .form-actions .btn {
    min-height: 48px;
  }

  .appt-saas .calendar-service-chip {
    min-height: 40px;
  }

  .appt-saas .calendar-service-chip button {
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    width: 44px;
  }
}

@media (max-width: 720px) {
  .appt-saas .calendar-form,
  .appt-saas .jobs-form,
  .appt-saas .form-section--quick-entry .form-section__fields,
  .appt-saas .form-section--assignment .form-section__fields {
    grid-template-columns: 1fr;
  }

  .appt-saas .form-section,
  .appt-saas .form-actions,
  .appt-saas .calendar-customer-link {
    grid-column: 1 / -1;
  }

  .appt-saas .panel-title h2 {
    font-size: 17px;
  }
}

/* TASK 587 compact expanded sidebar */
@media (min-width: 981px) {
  .app-shell:not(.app-shell--sidebar-collapsed) {
    grid-template-columns: 145px minmax(0, 1fr);
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .sidebar {
    padding-inline: 10px;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .nav {
    padding-inline: 2px;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .nav a {
    gap: 9px;
    padding-inline: 10px;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .sidebar-auth {
    gap: 6px;
    grid-template-columns: 1fr;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .sidebar-auth__email {
    grid-column: 1 / -1;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .sidebar-auth__button {
    font-size: 12px;
    gap: 5px;
    justify-content: center;
    min-width: 0;
    padding-inline: 6px;
  }

  .app-shell:not(.app-shell--sidebar-collapsed) .sidebar-auth__icon {
    flex-basis: 16px;
    height: 16px;
    width: 16px;
  }
}

.calendar-customer-link {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.calendar-customer-link > label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.calendar-selected-customer,
.calendar-customer-result,
.calendar-manual-customer {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  margin-top: 8px;
  padding: 9px 10px;
}

.calendar-selected-customer,
.calendar-customer-result {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  text-align: left;
  width: 100%;
}

.calendar-selected-customer[hidden],
.calendar-customer-result[hidden],
.calendar-manual-customer[hidden] {
  display: none;
}

.calendar-customer-result {
  cursor: pointer;
}

.calendar-customer-result:hover {
  background: #edf2f7;
}

.calendar-selected-customer strong,
.calendar-customer-result strong {
  color: #1f2933;
  display: block;
  font-size: 13px;
}

.calendar-selected-customer span,
.calendar-customer-result small,
.calendar-manual-customer,
.calendar-customer-search-status {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.linked-customer-pricing {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.calendar-selected-customer .linked-customer-pricing span,
.job-selected-customer .linked-customer-pricing span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 650;
  margin-top: 0;
}

.calendar-selected-customer .linked-customer-pricing .linked-customer-pricing-hint,
.job-selected-customer .linked-customer-pricing .linked-customer-pricing-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.pricing-tag-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  margin-left: 6px;
  min-width: 20px;
  padding: 0 6px;
  vertical-align: middle;
}

.pricing-tag-badge--groupbuy,
.linked-customer-pricing .pricing-tag-badge--groupbuy {
  background: #faeeda;
  color: #854f0b;
}

.pricing-tag-badge--discount,
.linked-customer-pricing .pricing-tag-badge--discount {
  background: #e1f5ee;
  color: #0f6e56;
}

.customer-price-reminder {
  align-items: center;
  background: #fff6cf;
  border: 1px solid #e8bd4f;
  border-radius: 8px;
  color: #6f4300;
  display: grid;
  gap: 4px 8px;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  margin-top: 7px;
  padding: 7px 9px;
}

.customer-price-reminder strong,
.calendar-selected-customer .customer-price-reminder strong {
  color: #9a3412;
  font-size: 12px;
  white-space: nowrap;
}

.customer-price-reminder span,
.calendar-selected-customer .customer-price-reminder span {
  color: #6f4300;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-price-reminder .link-button {
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-price-reminder--compact {
  grid-template-columns: auto minmax(96px, 1fr) auto;
  margin: 0 0 5px;
  max-width: 420px;
  padding: 5px 7px;
}

.customer-price-reminder-editor {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 12px 0;
  padding: 12px;
}

.customer-price-reminder-editor.has-reminder {
  background: #fffaf0;
  border-color: #e8bd4f;
}

.customer-price-reminder-editor__heading,
.customer-price-reminder-editor__form {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.customer-price-reminder-editor__heading small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.customer-price-reminder-editor__form {
  margin-top: 9px;
}

.customer-price-reminder-editor__form textarea {
  min-height: 62px;
  resize: vertical;
}

.customer-price-reminder-editor__form .btn {
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .customer-price-reminder,
  .customer-price-reminder--compact {
    grid-template-columns: 1fr auto;
  }

  .customer-price-reminder > strong {
    grid-column: 1 / -1;
  }

  .customer-price-reminder-editor__heading,
  .customer-price-reminder-editor__form {
    align-items: stretch;
    flex-direction: column;
  }
}

.pricing-tag-field {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  width: 100%;
}

.field .pricing-tag-field__label {
  flex: 0 0 auto;
  margin-top: 0;
  white-space: nowrap;
}

.pricing-tag-selector {
  align-items: center;
  background: var(--surface-1, #f8fafc);
  border: 0.5px solid rgba(148, 163, 184, 0.65);
  border-radius: 999px;
  display: flex;
  flex: 1 1 280px;
  gap: 4px;
  padding: 5px;
  width: 100%;
}

.pricing-tag-selector label {
  align-items: center;
  display: inline-flex;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.pricing-tag-selector input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.pricing-tag-option {
  align-items: center;
  background: transparent;
  border: 0.5px solid transparent;
  border-radius: 999px;
  color: #667085;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  padding: 8px 10px;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
  white-space: nowrap;
  width: 100%;
}

.pricing-tag-option__icon {
  align-items: center;
  color: currentColor;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  height: 16px;
  justify-content: center;
  line-height: 1;
  width: 16px;
}

.pricing-tag-option__icon path,
.pricing-tag-option__icon circle {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pricing-tag-selector input:checked + .pricing-tag-option--none {
  background: var(--surface-2, #ffffff);
  border-color: rgba(148, 163, 184, 0.75);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #1f2937;
}

.pricing-tag-selector input:checked + .pricing-tag-option--groupbuy {
  background: #ba7517;
  border-color: #ba7517;
  box-shadow: 0 2px 6px rgba(186, 117, 23, 0.22);
  color: #ffffff;
}

.pricing-tag-selector input:checked + .pricing-tag-option--discount {
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.22);
  color: #ffffff;
}

.pricing-tag-selector label:focus-within .pricing-tag-option {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.calendar-customer-search-status {
  min-height: 16px;
  padding-top: 6px;
}

.calendar-customer-search-status[data-status-kind="error"] {
  color: var(--danger);
}

.calendar-customer-results {
  display: grid;
  gap: 6px;
}

.form-modal {
  align-items: flex-start;
  display: flex;
  inset: 0;
  justify-content: center;
  overflow: hidden;
  padding: 24px 16px;
  position: fixed;
  z-index: 900;
}

.form-modal__backdrop {
  background: rgba(15, 23, 42, 0.45);
  inset: 0;
  position: fixed;
}

.form-modal__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 13px 16px;
  position: relative;
  scrollbar-gutter: stable;
  width: min(960px, 94vw);
  z-index: 1;
}

.form-modal__action-bar {
  background: var(--surface);
  border-top: 1px solid var(--line);
  bottom: -13px;
  box-shadow: 0 -8px 16px rgba(15, 23, 42, 0.08);
  margin-bottom: -13px;
  padding-bottom: 13px;
  padding-top: 12px;
  position: sticky;
  z-index: 6;
}

.form-modal__action-bar > .actions {
  margin-top: 0;
}

.form-modal__panel:has([data-form-anchor^="finance-view-"]) {
  padding: 12px 14px;
}

.finance-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 14px 0;
}

.finance-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-weight: 650;
  gap: 8px;
  margin-bottom: -1px;
  min-height: 44px;
  padding: 8px 13px;
}

.finance-tab:hover {
  color: var(--text-soft);
}

.finance-tab strong {
  background: #eef1f4;
  border-radius: 999px;
  color: #475569;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  padding: 4px 7px;
  text-align: center;
}

.finance-tab.is-active {
  background: transparent;
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
}

.finance-tab.is-active strong {
  background: var(--acc-tint);
  color: var(--primary-dark);
}

.finance-task-table td {
  vertical-align: top;
}

.finance-task-table .btn {
  white-space: nowrap;
}

.table-density-control {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.table-density-control__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.table-density-control__options {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
}

.table-density-control__option {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  min-height: 44px;
  min-width: 44px;
  padding: 5px 10px;
  white-space: nowrap;
}

.table-density-control__option.is-active,
.table-density-control__option[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.18);
}

.table-density-control__option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:is(.finance-task-row--ps) {
  background: #fff8dc;
}
.finance-task-table .finance-full-content {
  display: block;
  max-width: none;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}

.finance-task-table .finance-billing-name {
  display: block;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-task-table td.finance-service-address-cell {
  max-width: 34ch;
  width: 34ch;
}

.finance-task-table .finance-service-address-cell .finance-full-content {
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-note-preview {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  max-width: 24ch;
  min-width: 14ch;
  padding: 0;
  text-align: left;
}

.finance-note-preview:hover strong,
.finance-note-preview:focus-visible strong {
  color: var(--primary-dark);
  text-decoration: underline;
}

.finance-note-preview:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.finance-note-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.finance-note-preview strong {
  display: -webkit-box;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finance-note-add {
  min-width: 74px;
}

.form-modal__panel:has([data-form-anchor^="finance-notes-"]) {
  width: min(720px, 94vw);
}

.finance-notes-modal {
  display: grid;
  gap: 16px;
}

.finance-notes-modal__header p {
  max-width: 62ch;
  overflow-wrap: anywhere;
}

.finance-note-form {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.finance-note-form .modal-actions {
  margin-top: 0;
}

.finance-note-timeline {
  display: grid;
  gap: 8px;
}

.finance-note-timeline h3 {
  font-size: 15px;
  margin: 0;
}

.finance-note-timeline__item {
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  display: grid;
  gap: 6px;
  padding: 9px 11px;
}

.finance-note-timeline__item > div {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 8px;
}

.finance-note-timeline__item p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}


.finance-task-row--exception {
  background: #fff7f7;
}

.form-modal__panel:has([data-form-anchor^="finance-payment-"]) {
  width: min(460px, 94vw);
}

body.modal-open {
  overflow: hidden;
}

.confirm-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px 16px;
  position: fixed;
  z-index: 1200;
}

.confirm-modal__backdrop {
  background: rgba(15, 23, 42, 0.45);
  inset: 0;
  position: fixed;
}

.confirm-modal__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 420px;
  padding: 20px;
  position: relative;
  width: min(420px, 94vw);
  z-index: 1;
}

.confirm-modal__title {
  color: var(--text);
  font-size: 20px;
  margin: 0 0 10px;
}

.confirm-modal__message {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
  white-space: pre-line;
}

.confirm-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.app-zoom-control {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 16px;
  box-shadow: var(--shadow);
  display: none;
  gap: 6px;
  padding: 6px;
  position: fixed;
  right: 16px;
  z-index: 850;
}

.app-zoom-control button {
  align-items: center;
  background: var(--primary);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  line-height: 1;
  width: 44px;
}

.app-zoom-control__value {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  min-width: 44px;
  text-align: center;
}

@media (pointer: coarse) and (min-width: 768px) {
  .app-zoom-control {
    display: flex;
  }
}

.calendar-duplicate-dialog {
  align-items: center;
  background: rgba(15, 23, 42, 0.34);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1000;
}

.calendar-duplicate-dialog__panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  max-width: 680px;
  width: min(680px, 100%);
}

.calendar-duplicate-dialog__header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.calendar-duplicate-dialog__header h3 {
  color: #1f2933;
  font-size: 18px;
  margin: 0 0 6px;
}

.calendar-duplicate-dialog__header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.calendar-duplicate-dialog__list {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 14px 18px;
}

.calendar-duplicate-customer {
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.calendar-duplicate-customer.is-address {
  border-left-color: var(--primary);
}

.calendar-duplicate-customer strong,
.calendar-duplicate-customer span,
.calendar-duplicate-customer small {
  display: block;
}

.calendar-duplicate-customer strong {
  color: #1f2933;
  font-size: 14px;
}

.calendar-duplicate-customer span,
.calendar-duplicate-customer small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.calendar-duplicate-dialog__actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding: 14px 18px 18px;
}

.calendar-time-range-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.calendar-time-range-control[hidden] {
  display: none;
}

.calendar-time-range-control span {
  color: var(--muted);
  font-weight: 900;
}

.time-specific-toggle {
  align-items: center;
  color: #344054;
  display: inline-flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
}

.time-specific-toggle input {
  height: 16px;
  width: 16px;
}

.calendar-service-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.calendar-service-picker .btn {
  min-height: 44px;
}

.calendar-service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.calendar-service-chip {
  align-items: center;
  background: #edf5f3;
  border: 1px solid #c8ded9;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  min-height: 30px;
  padding: 5px 9px 5px 11px;
}

.calendar-service-chip span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-service-chip button {
  background: transparent;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
  height: 44px;
  line-height: 1;
  padding: 0;
  width: 44px;
}

.schedule-board-shell {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 244px;
  margin-top: 14px;
  min-width: 0;
}

.schedule-board {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.schedule-day {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
}

.schedule-day__header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 54px;
  position: relative;
}

.schedule-day__header-main {
  align-items: baseline;
  display: flex;
  gap: 9px;
  justify-content: center;
  text-align: center;
}

.schedule-day__weekday {
  background: #e8edf3;
  border-radius: 999px;
  color: #344054;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 7px;
}

.schedule-day__header-main strong {
  background: transparent;
  border-radius: 0;
  color: #111827;
  font-size: 22px;
  padding: 0;
}

.schedule-day__iso {
  color: var(--muted);
  font-size: 12px;
}

.schedule-day__note-area {
  align-items: center;
  display: flex;
  gap: 8px;
  left: 2px;
  max-width: min(38%, 420px);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.schedule-day__note-button {
  flex: 0 0 auto;
  min-height: 44px;
}

.schedule-day__note-button.is-active {
  background: #dff6ef;
  border-color: #62b8a7;
  color: #075e54;
}

.schedule-day__note-preview {
  color: #475467;
  display: block;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-day__header-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
}

.schedule-day__resting-toggle {
  min-height: 44px;
}

.schedule-day__count {
  background: #e8edf3;
  border-radius: 999px;
  color: #344054;
  display: inline-grid;
  flex: 0 0 28px;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  place-items: center;
  width: 28px;
}

@media (max-width: 560px) {
  .schedule-day__header {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-day__header-main {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .schedule-day__header-actions {
    justify-content: space-between;
    position: static;
    transform: none;
  }
}

.schedule-columns {
  display: grid;
  gap: 10px;
  grid-auto-columns: minmax(220px, 260px);
  grid-auto-flow: column;
  overflow-x: auto;
  padding-bottom: 4px;
}

.schedule-column {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 112px;
  padding: 8px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.schedule-column.drag-over {
  background: #edf5f3;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.schedule-column.is-unassigned {
  background: #fffbeb;
  border-color: #f5d38a;
}

.schedule-column.is-unassigned .schedule-column__header {
  background: rgba(254, 243, 199, 0.72);
  border-radius: 6px;
  margin: -2px -2px 8px;
  padding: 6px;
}

.schedule-column.is-inactive-tech {
  background: #fff7ed;
  border-color: #fed7aa;
}

.schedule-column.is-unavailable-tech {
  background: #111827;
  border-color: #111827;
  color: #f8fafc;
}

.schedule-column.is-unavailable-tech.drag-over {
  background: #1f2937;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}

.schedule-column__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.schedule-column__header > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.schedule-column__header strong {
  font-size: 13px;
}

.schedule-column__header em {
  color: #facc15;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.schedule-column__header span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-column.is-unavailable-tech .schedule-column__header span,
.schedule-column.is-unavailable-tech .schedule-column__note {
  color: #cbd5e1;
}

.schedule-column__tools {
  align-items: center;
  display: flex;
  gap: 6px;
}

.schedule-copy-all {
  font-size: 11px;
  white-space: nowrap;
}

.schedule-column__note {
  color: #9a3412;
  font-size: 12px;
  margin: -2px 0 8px;
}

.schedule-card-list {
  display: grid;
  gap: 4px;
}

.schedule-empty {
  background: var(--soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.schedule-fix-rail {
  background: #fffbeb;
  border: 1px solid #f5d38a;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(146, 64, 14, 0.12);
  max-height: calc(100vh - 32px);
  overflow: auto;
  position: sticky;
  top: 14px;
}

.schedule-fix-rail.drag-over {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18), 0 12px 28px rgba(146, 64, 14, 0.12);
}

.schedule-fix-rail__header {
  align-items: center;
  background: #fef3c7;
  border-bottom: 1px solid #f3cf82;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.schedule-fix-rail__header strong {
  color: #78350f;
  font-size: 14px;
}

.schedule-fix-rail__header span {
  background: #92400e;
  border-radius: 999px;
  color: #fff7ed;
  display: inline-grid;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  place-items: center;
  width: 24px;
}

.schedule-fix-rail__list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.schedule-fix-rail__empty {
  border: 1px dashed #e7b75f;
  border-radius: 8px;
  color: #92400e;
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.schedule-fix-pool-card {
  background: #ffffff;
  border: 1px solid #f0c168;
  border-left: 4px solid #d97706;
  border-radius: 8px;
  cursor: grab;
  display: grid;
  gap: 7px;
  padding: 9px;
}

.schedule-fix-pool-card:active {
  cursor: grabbing;
}

.schedule-fix-pool-card.is-dragging {
  opacity: 0.6;
}

.schedule-fix-pool-card__top {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.schedule-fix-pool-card__top strong {
  color: #111827;
  font-size: 13px;
}

.schedule-fix-pool-card__top span,
.schedule-fix-pool-card__line,
.schedule-fix-pool-card__meta span,
.schedule-fix-pool-card__tech span {
  color: var(--muted);
  font-size: 11px;
}

.schedule-fix-pool-card__line {
  line-height: 1.35;
}

.schedule-fix-pool-card__meta,
.schedule-fix-pool-card__tech {
  display: grid;
  gap: 2px;
}

.schedule-fix-pool-card__meta strong {
  color: #374151;
  font-size: 12px;
}

.schedule-fix-pool-card__tech {
  background: #fff7ed;
  border-radius: 6px;
  padding: 7px;
}

.schedule-fix-pool-card__tech strong {
  color: #9a3412;
  font-size: 15px;
}

.schedule-fix-pool-card__note {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #a16207;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.schedule-fix-pool-card__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.schedule-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.schedule-column.is-unavailable-tech .schedule-card {
  color: #1f2933;
}

.schedule-card:active {
  cursor: grabbing;
}

.schedule-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.99);
}

.schedule-card.has-flexible {
  background: #ffffff;
}

.schedule-card.has-fix {
  border-left-color: var(--line);
}

.schedule-card.has-termite {
  border-left-color: var(--danger);
  border-left-width: 4px;
}

.schedule-card.has-yellow {
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.45);
}

.schedule-card.has-on-hold {
  background: #fff7ed;
  border-color: #fdba74;
  border-left-color: #f97316;
  border-left-width: 5px;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.14);
}

.schedule-card.is-readonly {
  cursor: default;
  opacity: 0.72;
}

.schedule-card.is-locked {
  background: #dbeafe;
  border-color: #93c5fd;
  border-left-color: #2563eb;
  border-left-width: 7px;
  color: #1f2933;
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.schedule-card.is-locked .schedule-card__summary,
.schedule-card.is-locked .schedule-card__summary strong,
.schedule-card.is-locked .schedule-card__address,
.schedule-card.is-locked .schedule-card__top strong {
  color: #1f2933;
}

.schedule-card.is-locked .schedule-card__summary span,
.schedule-card.is-locked .schedule-card__top span {
  color: #475467;
}

.schedule-card.is-completed {
  background: #dcfce7;
  border-color: #86efac;
  border-width: 2px;
  border-left-color: #16a34a;
  border-left-width: 6px;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.schedule-card__top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.schedule-card__top-tools {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
}

.schedule-copy-card {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--primary-dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
}

.schedule-copy-card.is-copied,
.schedule-copy-all.is-copied {
  color: #16a34a;
}

.schedule-card__top strong {
  font-size: 13px;
}

.schedule-card__top span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.schedule-card__summary {
  color: #475467;
  display: grid;
  font-size: 12px;
  gap: 4px;
}

.schedule-card__summary strong {
  color: #1f2933;
  font-size: 13px;
  font-weight: 800;
}

.schedule-card__address {
  color: #1f2933;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.schedule-note-icon {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  justify-self: start;
  padding: 2px 5px;
}

.schedule-marker-dots {
  display: inline-flex;
  gap: 5px;
}

.schedule-marker-dot {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(31, 41, 51, 0.18);
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.schedule-marker-dot.is-termite {
  background: var(--danger);
}

.schedule-marker-dot.is-contact {
  background: #ffeb00;
}

.schedule-marker-dot.is-on-hold {
  background: #f97316;
}

.schedule-marker-dot.is-fix {
  background: #8b5cf6;
}

.schedule-marker-dot.is-flexible {
  background: #16a34a;
}

.schedule-card__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.schedule-card__actions .link-button {
  font-size: 11px;
}

.schedule-lock-status {
  color: inherit;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.schedule-time-editor {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.schedule-time-editor__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.schedule-card-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px;
}

.schedule-card-preview div {
  display: grid;
  gap: 2px;
}

.schedule-card-preview .span-full {
  grid-column: 1 / -1;
}

.schedule-card-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.schedule-card-preview strong {
  color: #1f2933;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.schedule-on-hold-panel {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.schedule-card-preview .schedule-on-hold-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.badge.on-hold {
  background: #fdf3e6;
  color: #9a3412;
}

.schedule-assign-panel {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.schedule-card-preview .schedule-preview-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 7px;
}

.schedule-card-preview .schedule-preview-copy-actions {
  display: flex;
  gap: 6px;
  margin-right: auto;
}

.schedule-assign-options {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 5px;
}

.schedule-assign-options .btn {
  font-size: 11px;
  line-height: 1.1;
  min-height: 44px;
  min-width: 44px;
  overflow: hidden;
  padding-inline: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-reassign-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  margin-top: 5px;
}

.schedule-reassign-summary strong {
  font-size: 12px;
}

.schedule-reassign-collapse {
  justify-self: start;
  margin-top: 3px;
}

.schedule-day-off-toggle {
  padding-left: 7px;
  padding-right: 7px;
}

.datebase-filters-panel {
  margin: 14px 0;
}

.datebase-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 2fr) repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 10px;
}

.datebase-check {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  min-height: 44px;
}

.datebase-more-filters {
  flex-basis: 100%;
  grid-column: 1 / -1;
  margin-top: 6px;
}

.datebase-filters-panel.datebase-more-filters {
  margin: 14px 0;
}

.datebase-filters-panel > summary,
.datebase-more-filters > summary {
  color: #0f766e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.filter-panel__summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  min-height: 34px;
}

.filter-panel__summary::-webkit-details-marker {
  display: none;
}

.filter-panel__summary::before {
  color: var(--muted);
  content: "›";
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease-out;
}

.filter-panel[open] > .filter-panel__summary::before {
  transform: rotate(90deg);
}

.filter-panel__label {
  white-space: nowrap;
}

.filter-panel__count {
  align-items: center;
  background: #dff3ef;
  border: 1px solid #b7ded7;
  border-radius: 999px;
  color: #0f766e;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  min-height: 24px;
  padding: 2px 8px;
}

.filter-panel__chips {
  align-items: center;
  display: inline-flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.filter-panel__chip {
  background: #f2f7f6;
  border: 1px solid #cfe0dc;
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
  max-width: 250px;
  min-height: 28px;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel__chip span {
  color: #0f766e;
  font-weight: 800;
}

.filter-panel__chip strong {
  font-size: 14px;
  margin-left: 2px;
}

.filter-panel__chip:hover {
  background: #e4f2ef;
  border-color: #9fcfc5;
  color: var(--text);
}

.filter-panel__chip:focus-visible,
.filter-panel__clear:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.filter-panel__clear {
  background: transparent;
  border: 0;
  color: #0f766e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  min-height: 28px;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.filter-panel__clear:hover {
  color: #0b5f59;
}

.datebase-more-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.datebase-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 14px 0;
}

.datebase-summary div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.datebase-summary strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1;
}

.datebase-summary span {
  color: var(--muted);
  font-size: 12px;
}

.settings-section-nav {
  align-items: center;
  align-self: start;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 6px;
  position: sticky;
  top: 8px;
  z-index: 20;
}

.settings-section-nav__label {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
  white-space: nowrap;
}

.settings-section-nav button {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.settings-section-nav button:hover,
.settings-section-nav button:focus-visible {
  background: #edf5f3;
  outline: none;
}

.settings-section-nav button:focus-visible {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.settings-section-target {
  scroll-margin-top: 76px;
}

.settings-section-target:focus:not(:focus-visible) {
  outline: none;
}

.settings-price-list__images {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-price-list__image-link {
  border: 1px solid #d5dfdc;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: block;
  line-height: 0;
  overflow: hidden;
}

.settings-price-list__image-link:hover,
.settings-price-list__image-link:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.settings-price-list__image-link img {
  display: block;
  height: auto;
  width: 100%;
}

.settings-add-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) auto;
  margin-bottom: 14px;
}

.settings-add-row input,
.settings-tech-row input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.settings-tech-list {
  display: grid;
  gap: 6px;
}

.settings-tech-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  padding: 6px 8px;
}

.settings-tech-row.is-inactive {
  background: #fff7ed;
}

.settings-tech-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-availability-list {
  display: grid;
  gap: 6px;
}

.settings-availability-row {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-availability-summary {
  align-items: center;
  cursor: pointer;
  min-height: 44px;
  overflow-x: auto;
  padding: 8px 10px;
  white-space: nowrap;
}

.settings-availability-summary > span {
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  margin-right: 16px;
}

.settings-availability-summary__name {
  align-items: center;
  color: var(--ink) !important;
  gap: 8px;
  min-width: 190px;
}

.settings-availability-editor {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 10px;
}

.settings-availability-chip-section {
  gap: 7px;
}

.settings-availability-chips {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start !important;
  padding: 0 !important;
}

.settings-availability-chip {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  padding: 3px 4px 3px 9px;
}

.settings-weekly-off {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-weekly-off label {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 8px;
}

.settings-range-off {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
}

.settings-range-off input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 8px;
}

.settings-single-day-off {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 240px) auto;
  justify-content: start;
}

.settings-single-day-off input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 44px;
  padding: 6px 8px;
}

.settings-single-day-list {
  display: grid;
  gap: 6px;
}

.settings-single-day-list div {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 8px;
}

.settings-range-list {
  display: grid;
  gap: 6px;
}

.settings-range-list div {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 8px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.price-breakdown-line {
  margin-top: 2px;
  line-height: 1.25;
  white-space: normal;
}

.import-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 14px 0;
}

.import-summary div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.import-summary strong {
  font-size: 24px;
  line-height: 1;
}

.import-summary span {
  color: var(--muted);
  font-size: 12px;
}

.import-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.import-grid h3 {
  font-size: 15px;
  margin: 0 0 8px;
}

.import-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.import-table-wrap.compact {
  max-height: 420px;
  overflow: auto;
}

.import-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.import-table th,
.import-table td {
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 12px;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.import-table th {
  background: var(--soft);
  font-weight: 800;
}

.import-table tbody tr:hover {
  background: #f8fafc;
}

.import-rule-grid {
  display: grid;
  gap: 10px;
}

.import-rule-grid > div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.import-rule-grid strong {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.import-rule-row {
  align-items: center;
  border-top: 1px solid #e5eaf0;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 0;
}

.import-rule-row:first-of-type {
  border-top: 0;
}

.import-rule-row span,
.import-rule-row b {
  font-size: 12px;
}

.import-rule-row b {
  color: var(--primary-dark);
  text-align: right;
}

.import-control-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
}

.import-control-row label {
  align-items: center;
  color: #344054;
  display: inline-flex;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}

.import-tool-output {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  margin-top: 12px;
  padding: 12px;
}

.import-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.import-result-grid span {
  background: #e8edf3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  padding: 5px 8px;
}

.import-review {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.import-review__header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.import-review__header h3 {
  font-size: 15px;
  margin: 0;
}

.import-review__header p {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
}

.import-category-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.import-category-list div {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 7px 9px;
}

.import-category-list span,
.import-category-list strong {
  font-size: 12px;
}

.datebase-filters input:not([type="checkbox"]),
.datebase-filters select {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.datebase-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.datebase-table {
  border-collapse: collapse;
  min-width: 1260px;
  width: 100%;
}

.datebase-table.is-full {
  min-width: 1840px;
}

.datebase-table th,
.datebase-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.datebase-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.datebase-table tbody tr:hover {
  background: #f8fafc;
}

.datebase-table td[data-datebase-column="address"] {
  max-width: 279px;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.datebase-table td[data-datebase-column="customerName"] {
  max-width: 231px;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.datebase-table td[data-datebase-column="customerName"] strong {
  display: inline-block;
  margin-right: 6px;
  max-width: 199px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.table-checkbox-hitbox {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.table-checkbox-hitbox input {
  margin: 0;
}

.datebase-note-cell {
  max-width: 220px;
  white-space: normal;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.column-manager {
  display: inline-flex;
  min-width: 0;
  position: relative;
}

.column-manager__trigger {
  min-height: 38px;
  white-space: nowrap;
}

.column-manager__trigger[aria-expanded="true"] {
  background: #dfe6ee;
  border-color: #b8c4d1;
  color: var(--text);
}

.column-manager__popover {
  animation: action-menu-enter 120ms ease-out;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 10px;
  max-height: min(560px, calc(100vh - 16px));
  max-width: calc(100vw - 16px);
  min-width: min(350px, calc(100vw - 16px));
  overflow: hidden;
  padding: 12px;
  position: fixed;
  width: 350px;
  z-index: 1100;
}

.column-manager__popover[hidden] {
  display: none;
}

.column-manager__header {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.column-manager__header strong {
  font-size: 14px;
}

.column-manager__header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.column-manager__search input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.column-manager__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.column-manager__actions .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

.column-manager__list {
  border-block: 1px solid var(--line);
  display: grid;
  margin-inline: -12px;
  max-height: 360px;
  overflow-y: auto;
  padding: 5px 8px;
}

.column-manager__option {
  align-items: center;
  border-radius: 7px;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 9px;
  min-height: 38px;
  padding: 7px 8px;
}

.column-manager__option:hover {
  background: #eef2f6;
  color: var(--text);
}

.column-manager__option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.column-manager__option:has(input:disabled) {
  color: var(--muted);
  cursor: not-allowed;
}

.column-manager__option input {
  margin: 0;
}

.column-manager__empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 16px 8px;
  text-align: center;
}

.action-menu {
  display: inline-flex;
  position: relative;
}

.action-menu__trigger {
  font-size: 21px;
  letter-spacing: 1px;
  line-height: 1;
  padding-inline: 10px;
}

.action-menu__trigger[aria-expanded="true"] {
  background: #dfe6ee;
  border-color: #b8c4d1;
  color: var(--text);
}

.action-menu__popup {
  animation: action-menu-enter 120ms ease-out;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  display: grid;
  max-height: min(520px, calc(100vh - 16px));
  max-width: min(420px, calc(100vw - 16px));
  min-width: 220px;
  overflow-y: auto;
  padding: 6px;
  position: fixed;
  width: max-content;
  z-index: 1100;
}

.action-menu__popup[hidden] {
  display: none;
}

.action-menu__group + .action-menu__group {
  margin-top: 3px;
  padding-top: 3px;
}

.action-menu__group-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 6px 9px 4px;
  text-transform: uppercase;
}

.action-menu__items {
  display: grid;
  gap: 2px;
}

.action-menu__items > .btn {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 13px;
  justify-content: flex-start;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: 8px 9px;
  text-align: left;
  text-decoration: none;
  white-space: normal;
  width: 100%;
}

.action-menu__items > .btn:hover {
  background: #eef2f6;
  color: var(--text);
}

.action-menu__items > .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.action-menu__items > .btn:disabled,
.action-menu__items > .btn[aria-disabled="true"] {
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.58;
}

.action-menu__group--danger {
  border-top: 1px solid var(--line);
  margin-top: 5px !important;
  padding-top: 5px !important;
}

.action-menu__group--danger .action-menu__group-label,
.action-menu__group--danger .action-menu__items > .btn {
  color: var(--danger);
}

.action-menu__group--danger .action-menu__items > .btn:hover {
  background: #fdecea;
  color: var(--danger);
}

.billing-action-state {
  align-self: center;
  white-space: nowrap;
}

@keyframes action-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .action-menu__popup,
  .column-manager__popover {
    animation: none;
  }

  .filter-panel__summary::before {
    transition: none;
  }
}

.datebase-form {
  margin-top: 6px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-card {
  align-items: start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.history-card p {
  color: var(--muted);
  margin: 4px 0 0;
}

.history-card__meta {
  color: #344054;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  justify-content: flex-end;
}

.jobs-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 14px 0;
}

.jobs-summary div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.jobs-summary strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1;
}

.jobs-summary span {
  color: var(--muted);
  font-size: 12px;
}

.collections-table {
  min-width: 1180px;
}

.collections-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  margin: 14px 0;
}

.collections-filters label {
  display: grid;
  gap: 5px;
}

.collections-filters label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.collections-filters select {
  min-height: 44px;
  width: 100%;
}

.collections-page .btn,
.collections-billing-info > summary,
.billing-table a[href="#/collections"] {
  min-height: 44px;
}

.collections-overdue-badge.is-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.collections-overdue-badge.is-high {
  background: #fecaca;
  color: #7f1d1d;
}

.collections-overdue-badge.is-severe {
  background: #ef4444;
  color: #ffffff;
}

.collections-overdue-badge.is-critical {
  background: #991b1b;
  box-shadow: 0 0 0 2px #fecaca;
  color: #ffffff;
}

.collections-row-actions {
  align-items: flex-start;
  min-width: 390px;
}

.collections-billing-info {
  min-width: 150px;
}

.collections-billing-info > summary {
  list-style: none;
}

.collections-billing-info > summary::-webkit-details-marker {
  display: none;
}

.collections-billing-info dl {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 10px;
}

.collections-billing-info dl div {
  display: grid;
  gap: 2px;
}

.collections-billing-info dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.collections-billing-info dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.collections-log-form textarea {
  min-height: 110px;
}

.collections-latest-chase__note {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.collections-chase-history {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.collections-chase-history__title {
  font-size: 15px;
  margin: 0 0 10px;
}

.collections-chase-history__list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 0;
}

.collections-chase-history__item {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.collections-chase-history__meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 6px 12px;
}

.collections-chase-history__note {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.collections-chase-history__empty {
  color: var(--muted);
  margin: 0;
}

.settings-data-health {
  margin: 12px 0;
}

.settings-data-health-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.settings-data-health-run {
  min-height: 44px;
}

.settings-deletion-log {
  margin: 12px 0;
}

.settings-deletion-log > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  min-height: 44px;
}

.settings-deletion-log__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.settings-deletion-log__load {
  min-height: 44px;
}

.settings-deletion-log__table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.settings-deletion-log__table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.settings-deletion-log__table th,
.settings-deletion-log__table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.settings-deletion-log__table th {
  background: var(--soft);
  font-size: 12px;
}

.settings-deletion-log__table tr:last-child td {
  border-bottom: 0;
}

.data-health-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 14px;
}

.data-health-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.data-health-grid strong {
  font-size: 22px;
  line-height: 1;
}

.data-health-grid span {
  color: var(--muted);
  font-size: 12px;
}

.jobs-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin: 14px 0;
}

.jobs-filters input:not([type="checkbox"]),
.jobs-filters select {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.jobs-filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.jobs-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.explicit-search-control {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  width: 100%;
}

.explicit-search-control input {
  min-width: 0;
  width: 100%;
}

.explicit-search-control .btn {
  min-height: 38px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

.jobs-show-all {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  min-height: 44px;
}

.jobs-table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.jobs-table {
  border-collapse: collapse;
  min-width: 1420px;
  width: 100%;
}

.jobs-table th,
.jobs-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.jobs-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.jobs-table tbody tr:hover {
  background: #f8fafc;
}

.jobs-table td[data-jobs-column="address"] {
  max-width: 281px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jobs-table td[data-jobs-column="customerName"] {
  max-width: 201px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-table-density="compact"] .jobs-table,
body[data-table-density="compact"] .datebase-table {
  min-width: 0;
  width: max-content;
}

body[data-table-density="compact"] .datebase-table.is-full {
  min-width: 0;
}

body[data-table-density="compact"] .jobs-table th,
body[data-table-density="compact"] .jobs-table td,
body[data-table-density="compact"] .datebase-table th,
body[data-table-density="compact"] .datebase-table td,
:is([data-table-density="compact"]) :is(.recurring-due-table) th,
:is([data-table-density="compact"]) :is(.recurring-due-table) td {
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 7px;
}

body[data-table-density="compact"] .jobs-table .btn,
body[data-table-density="compact"] .datebase-table .btn {
  font-size: 12px;
  min-height: 44px;
  min-width: 44px;
  padding: 5px 7px;
}

body[data-table-density="spacious"] .jobs-table th,
body[data-table-density="spacious"] .jobs-table td,
body[data-table-density="spacious"] .datebase-table th,
body[data-table-density="spacious"] .datebase-table td,
:is([data-table-density="spacious"]) :is(.recurring-due-table) th,
:is([data-table-density="spacious"]) :is(.recurring-due-table) td {
  font-size: 13.5px;
  line-height: 1.5;
  padding: 14px 16px;
}

body[data-table-density="spacious"] .jobs-table .btn,
body[data-table-density="spacious"] .datebase-table .btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
}

.recurring-due-toolbar {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto auto;
  margin-bottom: 14px;
  padding: 12px;
}

.recurring-due-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.recurring-due-toolbar > .explicit-search-control {
  grid-column: 1 / -1;
}

.recurring-due-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recurring-due-toolbar select {
  min-height: 44px;
}

.recurring-due-count {
  align-items: center;
  align-self: end;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  min-width: 68px;
}

.recurring-due-columns {
  align-self: end;
  position: relative;
  z-index: 20;
}

.recurring-due-columns__trigger {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  list-style: none;
  min-height: 44px;
  white-space: nowrap;
}

.recurring-due-columns__trigger::-webkit-details-marker {
  display: none;
}

.recurring-due-columns__trigger::after {
  content: "▾";
  font-size: 11px;
  margin-left: 7px;
}

.recurring-due-columns[open] .recurring-due-columns__trigger::after {
  transform: rotate(180deg);
}

.recurring-due-columns__menu {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 12px;
  padding: 14px;
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  width: min(430px, calc(100vw - 48px));
  z-index: 30;
}

.recurring-due-columns__heading {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.recurring-due-columns__heading span {
  color: var(--muted);
  font-size: 12px;
}

.recurring-due-columns__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recurring-due-columns__actions .btn {
  min-height: 44px;
}

.recurring-due-columns__options {
  display: grid;
  gap: 4px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recurring-due-columns__options label {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: auto 1fr auto;
  min-height: 44px;
  padding: 6px 8px;
}

.recurring-due-columns__options label:hover {
  background: #f8fafc;
}

.recurring-due-columns__option > span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.recurring-due-columns__option.is-locked {
  cursor: default;
}

.recurring-due-columns__options input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.recurring-due-columns__options small {
  color: var(--muted);
  font-size: 11px;
}

.recurring-due-table-wrap {
  --recurring-due-status-width: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 7px;
  overflow-x: auto;
}

.recurring-due-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  width: max-content;
}

.recurring-due-table th,
.recurring-due-table td {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  line-height: 1.25;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.recurring-due-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 3;
}

.recurring-due-table tbody tr:hover td {
  background: #f8fafc;
}

.recurring-due-table th[data-recurring-column="address"],
.recurring-due-table td[data-recurring-column="address"] {
  min-width: 280px;
}

.recurring-due-table th[data-recurring-column="actions"],
.recurring-due-table td[data-recurring-column="actions"] {
  box-shadow: -1px 0 0 var(--line), -8px 0 14px rgba(15, 23, 42, 0.06);
  min-width: 300px;
  position: sticky;
  right: var(--recurring-due-status-width);
  z-index: 2;
}

.recurring-due-table th[data-recurring-column="scheduleStatus"],
.recurring-due-table td[data-recurring-column="scheduleStatus"] {
  min-width: var(--recurring-due-status-width);
  position: sticky;
  right: 0;
  width: var(--recurring-due-status-width);
  z-index: 2;
}

.recurring-due-table th[data-recurring-column="actions"],
.recurring-due-table th[data-recurring-column="scheduleStatus"] {
  background: var(--soft);
  z-index: 5;
}

.recurring-due-table td > small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.recurring-due-address-cell {
  font-weight: 700;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-due-customer-cell {
  min-width: 180px;
  white-space: nowrap;
}

.recurring-due-customer-cell strong {
  display: inline-block;
  margin-right: 6px;
  max-width: 198px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.recurring-due-inline-edit-cell {
  cursor: pointer;
  min-width: 132px;
}

.recurring-due-inline-edit-cell:focus-visible {
  box-shadow: inset 0 0 0 2px var(--primary);
  outline: 0;
}

.recurring-due-inline-select,
.recurring-due-inline-input {
  font: inherit;
  margin: -5px -7px;
  min-height: 34px;
  min-width: 148px;
  width: calc(100% + 14px);
}

.recurring-due-inline-input {
  min-width: 200px;
}

.recurring-due-inquiry-cell {
  min-width: 128px;
}

.recurring-due-inquiry-meta {
  display: inline-flex;
  margin-top: 5px;
  white-space: nowrap;
}

.recurring-due-note-cell {
  max-width: 260px;
  min-width: 220px;
  white-space: normal;
}

.recurring-due-note-cell > span {
  display: block;
  white-space: pre-wrap;
}

.recurring-due-skip-streak-cell {
  text-align: center;
}

.recurring-due-table th[data-recurring-column="source"],
.recurring-due-table td[data-recurring-column="source"] {
  max-width: 108px;
  min-width: 108px;
  width: 108px;
}

.recurring-due-table th[data-recurring-column="cycle"],
.recurring-due-table td[data-recurring-column="cycle"] {
  max-width: 92px;
  min-width: 92px;
  width: 92px;
}

.recurring-due-table th[data-recurring-column="skipStreak"],
.recurring-due-table td[data-recurring-column="skipStreak"] {
  max-width: 88px;
  min-width: 88px;
  width: 88px;
}

.recurring-due-skip-streak {
  background: #eef2f6;
  color: #344054;
  white-space: nowrap;
}

.recurring-due-row-actions {
  flex-wrap: wrap;
  min-width: 300px;
}

.recurring-due-row-actions .btn {
  min-height: 44px;
  min-width: 44px;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1181px) {
  :is(.recurring-due-row-actions) {
    flex-wrap: nowrap;
    min-width: auto;
  }

  :is(.recurring-due-row-actions) :is(.btn) {
    min-height: 34px;
    min-width: auto;
  }
}

.recurring-due-row-actions .btn.warning {
  background: #fff7e6;
  border-color: #f0b44d;
  color: #7a4b00;
}

.recurring-due-overdue-days {
  background: transparent;
  color: #b42318;
  padding: 0;
  white-space: nowrap;
}

.recurring-due-schedule-cell {
  min-width: var(--recurring-due-status-width);
}

@media (max-width: 980px) {
  .recurring-due-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recurring-due-count {
    justify-self: start;
  }

  .recurring-due-columns {
    justify-self: start;
  }

  .recurring-due-columns__menu {
    left: 0;
    right: auto;
  }
}

@media (max-width: 560px) {
  .recurring-due-columns__options {
    grid-template-columns: 1fr;
  }
}

.job-customer-link {
  display: grid;
  gap: 8px;
}

.job-customer-link > label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.job-customer-results {
  display: grid;
  gap: 6px;
}

.job-customer-result,
.job-selected-customer {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.job-customer-result {
  cursor: pointer;
}

.job-customer-result:hover {
  background: #edf2f7;
}

.job-customer-result strong,
.job-selected-customer strong {
  color: #1f2933;
  display: block;
  font-size: 13px;
}

.job-customer-result span,
.job-selected-customer span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.job-linked-customer {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.job-linked-customer span,
.job-linked-customer small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.job-linked-customer strong {
  color: #1f2933;
  display: block;
  margin: 3px 0;
}

.customer-jobs-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 7px;
  overflow-x: auto;
}

.customer-jobs-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.customer-jobs-table th,
.customer-jobs-table td {
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.customer-jobs-table th {
  background: var(--soft);
  font-weight: 800;
}

.customer-summary-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.customer-summary-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 7px 9px;
}

.customer-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.customer-summary-grid strong {
  color: #1f2933;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.customer-quick-actions {
  flex-wrap: wrap;
}

.customer-timeline-wrap {
  margin-top: 7px;
}

.datebase-history-state {
  background: var(--soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 16px;
}

.datebase-history-state strong {
  color: var(--text);
  display: block;
  font-size: 14px;
}

.datebase-history-state p,
.datebase-history-state small {
  color: var(--muted);
  display: block;
  margin: 4px 0 0;
}

.datebase-history-state--error {
  align-items: center;
  background: #fff7f6;
  border-color: rgba(180, 35, 24, 0.28);
  grid-template-columns: minmax(0, 1fr) auto;
}

.datebase-history-state--error strong {
  color: var(--danger);
}

.datebase-history-progress {
  background: #dfe8e7;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  position: relative;
}

.datebase-history-progress span {
  animation: datebase-history-progress 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, var(--primary-dark), #18a397);
  border-radius: inherit;
  height: 100%;
  left: 0;
  position: absolute;
  width: 42%;
}

@keyframes datebase-history-progress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

@media (prefers-reduced-motion: reduce) {
  .datebase-history-progress span {
    animation: none;
    left: 0;
    width: 100%;
  }
}

.customer-timeline-table {
  min-width: 1180px;
}

.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-type {
  background: #eef2ff;
  color: #344054;
}

.sub-panel-title {
  margin-top: 10px;
}

.report-form {
  align-items: start;
}

.report-section-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.report-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.report-products-table {
  border-collapse: collapse;
  min-width: 860px;
  width: 100%;
}

.report-products-table th,
.report-products-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.report-products-table th {
  background: #edf2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.report-products-table input {
  min-width: 150px;
}

.billing-line-title {
  align-items: center;
  margin-bottom: 8px;
}

.billing-line-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.billing-line-table input {
  min-width: 130px;
}

.billing-line-table td:nth-child(1) input {
  min-width: 260px;
}

.billing-cc-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.billing-cc-list {
  display: grid;
  gap: 6px;
}

.billing-cc-row {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.billing-cc-overflow-notice {
  color: var(--warning);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 6px;
}

.billing-cc-header [hidden] {
  display: none;
}

.billing-totals {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.billing-totals div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.billing-totals span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-totals strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.report-check-grid {
  align-items: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.report-safety-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-safety-item {
  display: grid;
  gap: 6px;
}

.report-safety-item span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.report-safety-item.termite-system-linked-field {
  border: 1px solid #f0b429;
  border-radius: 8px;
  background: #fff8df;
  padding: 8px;
}

.termite-system-linked-field [data-termite-system-link-note] {
  display: block;
  margin-top: 5px;
  color: #9a5b00;
  font-size: 0.76rem;
  line-height: 1.3;
}

.report-signature-canvas {
  background: #ffffff;
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  height: 190px;
  touch-action: none;
  width: 100%;
}

.report-photo-limit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-photo-status {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.report-photo-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.report-photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 240px));
  justify-content: start;
}

.report-photo-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 240px;
  padding: 10px;
}

.report-photo-thumb {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.report-photo-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.report-photo-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-photo-meta strong,
.report-photo-meta span,
.report-photo-error {
  overflow-wrap: anywhere;
}

.report-photo-meta strong {
  color: #1f2933;
  font-size: 13px;
}

.report-photo-meta span,
.report-photo-error {
  color: var(--muted);
  font-size: 12px;
}

.report-photo-error {
  color: var(--danger);
  padding: 8px;
  text-align: center;
}

.report-print-preview {
  align-items: center;
  background: rgba(15, 23, 42, 0.45);
  border: 0;
  border-radius: 0;
  inset: 0;
  justify-content: center;
  margin: 0;
  overflow: auto;
  padding: 24px;
  position: fixed;
  z-index: 1000;
}

.report-print-preview[hidden] {
  display: none !important;
}

.report-print-preview:not([hidden]) {
  display: flex;
}

.print-preview-modal-open {
  overflow: hidden;
}

.job-receipt-capture-host {
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 420px;
  z-index: -1;
}

.job-receipt-card {
  background: #ffffff;
  border-radius: 14px;
  box-sizing: border-box;
  color: #2b332f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  width: 420px;
}

.job-receipt-header {
  align-items: center;
  background: #1f3d33;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 24px 20px;
  text-align: center;
}

.job-receipt-header strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.job-receipt-header span {
  color: #cfe0d9;
  font-size: 11px;
  line-height: 1.4;
}

.job-receipt-body {
  padding: 24px;
}

.job-receipt-title {
  color: #1f3d33;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
}

.job-receipt-subtitle {
  color: #8a9891;
  font-size: 11px;
  margin-top: 6px;
  text-align: center;
}

.job-receipt-divider {
  border-top: 1px dashed #d7ddda;
  margin: 20px 0;
}

.job-receipt-details {
  display: grid;
  gap: 14px;
  margin: 0;
}

.job-receipt-row {
  align-items: flex-start;
  display: flex;
  font-size: 13.5px;
  gap: 18px;
  justify-content: space-between;
  line-height: 1.4;
}

.job-receipt-row dt,
.job-receipt-row dd {
  margin: 0;
}

.job-receipt-row dt {
  color: #7c8a83;
  flex: 0 0 auto;
}

.job-receipt-row dd {
  color: #2b332f;
  font-weight: 600;
  max-width: 265px;
  overflow-wrap: anywhere;
  text-align: right;
}

.job-receipt-total {
  align-items: center;
  background: #f4f8f6;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding: 17px 18px;
}

.job-receipt-total span {
  color: #4d5a54;
  font-size: 13px;
  font-weight: 600;
}

.job-receipt-total strong {
  color: #1f3d33;
  font-size: 24px;
  font-weight: 800;
}

.job-receipt-body footer {
  color: #a3aca7;
  font-size: 11px;
  margin-top: 22px;
  text-align: center;
}

.job-receipt-preview-image-wrap {
  background: #eef3f0;
  border-radius: 10px;
  padding: 14px;
}

.job-receipt-preview-image {
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(31, 61, 51, 0.18);
  display: block;
  height: auto;
  max-width: min(420px, calc(100vw - 84px));
  width: 420px;
}

.report-print-preview-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  max-height: 92vh;
  max-width: min(92vw, 860px);
  overflow: auto;
  padding: 14px;
  width: max-content;
}

.report-print-preview-panel > .report-print-toolbar {
  background: #ffffff;
  border-radius: 10px 10px 0 0;
  margin: -14px -14px 14px;
  padding: 14px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.report-print-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.report-print-toolbar h2 {
  font-size: 18px;
  margin: 0;
}

.report-print-toolbar p {
  color: var(--muted);
  margin: 4px 0 0;
}

.report-print-toolbar p.is-error {
  color: var(--danger);
  font-weight: 700;
}

.report-print-document {
  background: #f5f8fc;
  display: grid;
  gap: 14px;
  margin: 0 auto;
  min-width: 733px;
  padding: 14px;
  width: 733px;
}

.report-print-document.report-pdf-root {
  background: #ffffff;
  box-sizing: border-box;
  display: block;
  min-width: 733px;
  padding: 0;
  width: 733px;
}

.report-pdf-root,
.report-pdf-root * {
  box-sizing: border-box;
}

.report-print-page {
  background: #ffffff;
  border: 0;
  color: #16294d;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: visible;
  padding: 34px 34px 24px 48px;
  position: relative;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.report-pdf-root .report-print-page {
  break-after: auto;
  display: grid;
  gap: 12px;
  page-break-after: auto;
  padding: 22px 24px 18px 32px;
}

.report-pdf-root .report-print-page + .report-print-page {
  border-top: 1px solid #e2e8e6;
}

.report-pdf-root .report-print-cover-page,
.report-pdf-root .report-print-contents-page {
  break-after: auto;
  page-break-after: auto;
}

.report-print-header {
  align-items: start;
  background: #ffffff;
  color: #16294d;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: 18px;
  position: relative;
}

.report-pdf-root .report-print-header {
  gap: 14px;
}

.report-print-header::after {
  background: #d8e3e0;
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}

.report-print-brand {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
}

.report-print-logo-slot {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8ebe7;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(22, 41, 77, 0.12);
  display: flex;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}

.report-print-logo-slot img {
  display: block;
  height: 54px;
  object-fit: contain;
  width: 54px;
}

.report-print-logo-slot span[hidden] {
  display: none;
}

.report-print-logo-slot span {
  align-items: center;
  background: #16294d;
  border-radius: 10px;
  color: #ffffff;
  display: flex;
  font-size: 18px;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.report-print-company {
  display: grid;
  gap: 2px;
}

.report-print-company > strong {
  color: #16294d;
  font-size: 16px;
  font-weight: 900;
}

.report-print-icon-line {
  align-items: center;
  color: #52627a;
  display: flex;
  font-size: 10.5px;
  gap: 5px;
  line-height: 1.45;
}

.report-print-icon {
  fill: none;
  flex: none;
  height: 14px;
  stroke: #0f766e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 14px;
}

.report-print-title-panel {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.report-print-title-panel h1 {
  color: var(--primary);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.report-pdf-root .report-print-title-panel h1 {
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-print-title-underline {
  background: var(--primary);
  border-radius: 999px;
  display: block;
  height: 3px;
  width: 86px;
}

.report-print-number {
  color: #16294d;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.report-print-cover {
  align-content: center;
  display: grid;
  gap: 18px;
  min-height: 560px;
}

.report-pdf-root .report-print-cover {
  align-content: start;
  min-height: 0;
}

.report-print-kicker {
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.report-print-cover h1 {
  font-size: 34px;
  letter-spacing: 0;
  margin: 0;
}

.report-print-cover-address {
  background: #f5f7f8;
  border: 1px solid #e2e8e6;
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.report-print-cover-address span,
.report-print-detail span,
.report-print-signature span,
.termite-print-signature-panel span {
  color: #52627a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-print-cover-address strong {
  font-size: 20px;
}

.report-print-page h2,
.report-print-page h3,
.report-print-page h4,
.report-print-lines p {
  margin: 0;
}

.report-print-page h2 {
  color: var(--primary);
  font-size: 21px;
  line-height: 1.25;
  padding-left: 13px;
  position: relative;
}

.report-print-page h2::before {
  background: var(--primary);
  border-radius: 999px;
  content: "";
  display: block;
  height: 22px;
  left: 0;
  position: absolute;
  top: 2px;
  width: 5px;
}

.report-print-page h3 {
  color: #12343b;
  font-size: 15px;
}

.report-print-page h4 {
  color: #52627a;
  font-size: 13px;
}

.print-pdf-root .report-print-page h2,
.print-pdf-root .report-print-page h3,
.print-pdf-root .report-print-page h4 {
  break-after: avoid;
  page-break-after: avoid;
}

.report-print-detail-grid,
.report-print-safety-list,
.report-print-two-col,
.report-print-signoff {
  display: grid;
  gap: 10px;
}

.report-print-detail-grid,
.report-print-safety-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-print-two-col,
.report-print-signoff {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-print-recommendations > div + div {
  border-left: 1px solid #d9e1e4;
  padding-left: 12px;
}

.report-print-recommendations h4 {
  font-weight: 800;
}

.report-print-recommendations .report-print-lines {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
}

.report-print-recommendations .report-print-lines li::marker {
  color: var(--primary);
}

.report-print-safety-list.general-pest-safety-list .answer-yes {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
}

.report-print-safety-list.general-pest-safety-list .answer-no {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.report-print-detail {
  background: #f8fbfa;
  border: 1px solid #e2e8e6;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 8px 10px;
}

.report-print-detail strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.report-print-block {
  background: #ffffff;
  border: 1px solid #e2e8e6;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.report-print-block--granular {
  border: 0;
  border-radius: 0;
  padding: 0;
}

.report-print-section-lead {
  display: grid;
  gap: 8px;
}

.report-contents-block {
  gap: 14px;
}

.report-contents-list {
  display: grid;
  gap: 9px;
}

.report-contents-row {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(24px, 1fr) minmax(24px, auto);
}

.report-contents-title {
  color: #16294d;
  font-size: 13px;
  font-weight: 750;
}

.report-contents-leader {
  border-bottom: 1px dotted #8aa6a0;
  height: 1px;
  transform: translateY(-4px);
}

.report-contents-page-number {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  min-width: 24px;
  text-align: right;
}

.report-contents-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.report-print-table {
  border: 1px solid #d8e3e0;
  border-collapse: separate;
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
  width: 100%;
}

.report-print-table th,
.report-print-table td {
  border-bottom: 1px solid #e2e8e6;
  border-right: 1px solid #e2e8e6;
  font-size: 11px;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.report-print-table th:last-child,
.report-print-table td:last-child {
  border-right: 0;
}

.report-print-table tbody tr:last-child td {
  border-bottom: 0;
}

.report-print-table th {
  background: #f2f5f4;
  color: #16294d;
  font-weight: 900;
  text-transform: uppercase;
}

.report-print-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-print-risk-list span {
  background: #f3fbf8;
  border: 1px solid #b7ddd5;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
}

.report-print-lines {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-print-lines p,
.report-print-lines li {
  font-size: 12px;
  line-height: 1.45;
  max-width: 100%;
  min-width: 0;
  orphans: 2;
  overflow-wrap: anywhere;
  white-space: normal;
  widows: 2;
  word-break: break-word;
}

.report-print-lines .report-print-line--break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.report-print-signature,
.termite-print-signature-panel {
  background: #f8fbfa;
  border: 1px solid #e2e8e6;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px;
}

.report-print-signature img,
.termite-print-signature-panel img,
.report-print-signature-blank {
  height: 96px;
  max-width: 320px;
  object-fit: contain;
}

.report-print-signature-blank {
  border-bottom: 1px solid #52627a;
}

.termite-print-signature-boundary {
  margin-top: -16px;
  padding-top: 16px;
}

.report-print-photo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-print-photo {
  background: #ffffff;
  border: 1px solid #e2e8e6;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px;
}

.report-print-photo-frame {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f2f5f4;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.report-print-photo-frame img {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.report-print-photo figcaption,
.report-print-empty {
  color: #52627a;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.report-print-footer {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  margin: 10px 0 0;
  padding: 10px 14px;
}

.termite-print-document > .report-print-footer {
  display: none;
}

.report-print-footer strong,
.report-print-footer span {
  color: #ffffff;
  font-size: 11px;
}

.print-blank {
  color: #98a2b3;
}

.report-print-detail,
.report-print-photo,
.report-print-signature,
.report-print-table tr,
.report-print-risk-list span,
.report-contents-row,
.termite-print-inspector-atomic,
.termite-print-property-atomic,
.termite-print-limitation-callout,
.termite-print-action-callout,
.certificate-print-tnc p,
.certificate-print-tnc li,
.certificate-print-tnc h3,
.certificate-print-tnc-entry,
.report-print-lines p,
.report-print-lines li,
.print-pdf-root .report-print-page h2,
.print-pdf-root .report-print-page h3,
.print-pdf-root .report-print-page h4 {
  break-inside: avoid;
  page-break-inside: avoid;
}

.answer-yes,
.answer-no {
  border-radius: 999px;
  display: inline-block;
  font-weight: 800;
  line-height: 1.2;
  padding: 2px 7px;
}

.answer-yes {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
}

.answer-no {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.termite-print-standard {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.termite-print-title-block {
  background: #f3fbf8;
  border: 1px solid #b7ddd5;
  border-left: 5px solid var(--primary);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.termite-print-title-block span,
.termite-print-section-note {
  color: #52627a;
  font-size: 12px;
  margin: 0;
}

.termite-print-table td:first-child {
  width: 45%;
}

.termite-print-tnc {
  display: block;
}

.termite-print-tnc p {
  break-inside: avoid;
  color: #344054;
  font-size: 10.25px;
  line-height: 1.32;
  margin: 0;
  orphans: 3;
  page-break-inside: avoid;
  widows: 3;
}

.termite-print-tnc p + p {
  margin-top: 5px;
}

.termite-print-tnc-entry {
  break-inside: avoid;
  page-break-inside: avoid;
}

.termite-print-tnc p.termite-print-tnc-heading {
  break-after: avoid;
  color: #102a43;
  font-size: 10.75px;
  font-weight: 800;
  margin-top: 3px;
  page-break-after: avoid;
}

.termite-print-tnc p.termite-print-tnc-subheading {
  break-after: avoid;
  color: #243b53;
  font-weight: 750;
  margin-top: 2px;
  page-break-after: avoid;
}

.termite-reason-controls {
  display: grid;
  gap: 8px;
}

.termite-reason-controls select,
.termite-reason-controls textarea {
  width: 100%;
}

.termite-print-tnc-version {
  color: #52627a;
  font-size: 9.5px;
  font-weight: 700;
  margin: 0;
}

.termite-print-inspector-atomic {
  break-inside: avoid;
  page-break-inside: avoid;
}

.termite-print-limitation-callout,
.termite-print-action-callout {
  border: 1px solid;
  border-left-width: 5px;
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.termite-print-limitation-callout {
  background: #fff8ed;
  border-color: #f2b84b;
  color: #7a2e0e;
}

.termite-print-action-callout {
  background: #eff8ff;
  border-color: #53a7d8;
  color: #123d63;
}

.termite-print-limitation-callout > :first-child,
.termite-print-action-callout > :first-child {
  margin-top: 0;
}

.termite-print-limitation-callout > :last-child,
.termite-print-action-callout > :last-child {
  margin-bottom: 0;
}

.termite-print-document .report-print-photo-frame {
  background: #ffffff;
  border: 1px solid #d8ebe7;
}

.termite-print-document .report-print-photo-frame img {
  image-orientation: from-image;
  object-fit: contain;
}

.termite-issue-panel {
  border: 1px solid;
  border-radius: 10px;
  display: grid;
  gap: 7px;
  padding: 12px 14px;
}

.termite-issue-panel.is-ready {
  background: #edf9f5;
  border-color: #88caba;
  color: #145847;
}

.termite-issue-panel.is-blocked {
  background: #fff5e8;
  border-color: #e2a43a;
  color: #7a2e0e;
}

.termite-issue-panel ul,
.termite-print-limitation-callout ul,
.termite-print-action-callout ul {
  margin: 0;
  padding-left: 20px;
}

.termite-issue-panel [data-termite-issue-jump] {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 1px 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  white-space: normal;
}

.termite-issue-panel [data-termite-issue-jump]:hover,
.termite-issue-panel [data-termite-issue-jump]:focus-visible {
  color: #a52318;
  outline: 2px solid rgba(165, 35, 24, 0.25);
  outline-offset: 2px;
}

.termite-collapsible-section.has-validation-error > summary {
  color: #b42318;
  font-weight: 800;
}

.termite-field-error {
  background: #fff4f2;
  border-color: #d92d20 !important;
  border-radius: 8px;
  box-shadow: inset 3px 0 0 #d92d20;
  padding: 8px;
}

.termite-field-error > label,
.termite-field-error > span,
.termite-field-error .report-section-heading label,
.termite-field-error .report-safety-item > span {
  color: #b42318;
  font-weight: 800;
}

.report-form [data-termite-issue-control][aria-invalid="true"] {
  border-color: #d92d20 !important;
  box-shadow: 0 0 0 2px rgba(217, 45, 32, 0.12);
}

.termite-inline-error {
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  margin: 6px 0 0;
}

.termite-damage-assessment {
  background: #f5fbfa;
  border: 1px solid #b7ddd5;
  border-radius: 10px;
  padding: 12px;
}

.termite-conditional-region {
  display: contents;
}

.termite-conditional-region[hidden] {
  display: none;
}

.termite-retained-evidence-warning {
  align-items: center;
  background: #fff4f2;
  border: 1px solid #f0b7ad;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 8px 0 12px;
  padding: 10px;
}

.termite-retained-evidence-warning p {
  color: #9f2418;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 720px) {
  .termite-retained-evidence-warning {
    align-items: stretch;
    flex-direction: column;
  }
}

.termite-print-cover-meta {
  color: #52627a;
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  gap: 6px 16px;
  justify-content: center;
}

.termite-print-draft-watermark {
  color: rgba(170, 36, 36, 0.16);
  font-size: 44px;
  font-weight: 900;
  left: 50%;
  letter-spacing: 2px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  top: 48%;
  transform: translate(-50%, -50%) rotate(-28deg);
  width: 90%;
  z-index: 12;
}

.termite-print-document figcaption {
  color: #42526a;
  font-size: 9px;
  font-weight: 700;
  margin-top: 4px;
  text-align: center;
}

.certificate-print-standard {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.certificate-print-title-block {
  background: #f3fbf8;
  border: 1px solid #b7ddd5;
  border-left: 5px solid var(--primary);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.certificate-print-title-block h2,
.certificate-print-title-block p {
  margin: 0;
}

.certificate-print-title-block span,
.certificate-print-title-block p {
  color: #52627a;
  font-size: 12px;
  line-height: 1.45;
}

.certificate-print-photo-section {
  break-inside: avoid;
  margin-top: -16px;
  padding-top: 16px;
  page-break-inside: avoid;
}

/* Keep visible content clear of html2pdf's rounded avoid-break boundary. */
.certificate-print-placement-field {
  display: block;
  margin-top: -16px;
  padding-top: 16px;
}

.certificate-print-placement-field > h3 {
  margin-bottom: 6px;
}

.certificate-print-document .report-print-photo-frame img {
  object-fit: contain;
}

.certificate-print-products th:nth-child(2),
.certificate-print-products th:nth-child(3),
.certificate-print-products td:nth-child(2),
.certificate-print-products td:nth-child(3) {
  width: 18%;
}

.certificate-print-signature {
  break-inside: avoid;
  page-break-inside: avoid;
}

.certificate-print-tnc {
  display: grid;
  gap: 7px;
}

/* html2pdf A4 inner height at the shared 733px capture width and PDF margins. */
.certificate-print-tnc-page--full,
.print-pdf-root .report-print-page.certificate-print-tnc-page--full {
  min-height: 1046px;
}

.certificate-print-tnc-page--full > .report-print-block {
  align-self: start;
}

.certificate-print-tnc h3,
.certificate-print-tnc p {
  line-height: 1.35;
  margin: 0;
}

.certificate-print-tnc h3 {
  font-size: 11px;
  font-weight: 900;
}

.certificate-print-tnc p {
  font-size: 9.5px;
}

.certificate-print-tnc-entry {
  display: grid;
  gap: 4px;
}

.certificate-print-tnc ul {
  margin: 0;
  padding-left: 20px;
}

.certificate-print-tnc li {
  font-size: 9.5px;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.certificate-print-tnc li + li {
  margin-top: 2px;
}

.certificate-print-tnc p.certificate-print-tnc-continuation {
  color: #12343b;
  font-weight: 900;
}

.billing-print-page {
  background: #ffffff;
  border: 0;
  box-sizing: border-box;
  color: #16294d;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  width: 100%;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.billing-print-page-inner {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 22px 24px 24px 32px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.billing-print-accent-stripe {
  background: #27a996;
  bottom: 0;
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
  z-index: 0;
}

.billing-print-page::before {
  content: none;
  display: none;
}

.billing-print-document {
  justify-self: center;
  margin: 0 auto;
  min-width: 733px;
  overflow: visible;
  width: 733px;
}

.billing-print-preview {
  overflow-x: auto;
}

@media (max-width: 860px) {
  .billing-print-preview {
    padding-inline: 10px;
  }

  .billing-print-preview .report-print-preview-panel {
    max-width: calc(100vw - 20px);
  }

  .billing-print-preview .report-print-toolbar {
    min-width: 733px;
  }

  .billing-print-preview .billing-print-document {
    margin-left: 0;
    margin-right: 0;
  }
}

.billing-print-header {
  align-items: start;
  background: #ffffff;
  color: #16294d;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
}

.billing-print-brand {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
}

.billing-print-logo-box {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8ebe7;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(22, 41, 77, 0.08);
  display: flex;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}

.billing-print-logo-box img {
  display: block;
  height: 54px;
  object-fit: contain;
  width: 54px;
}

.billing-print-logo-box span[hidden] {
  display: none;
}

.billing-print-logo-box span {
  align-items: center;
  background: #16294d;
  border-radius: 6px;
  color: #ffffff;
  display: flex;
  font-size: 18px;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.billing-print-company {
  display: grid;
  gap: 2px;
}

.billing-print-company strong {
  color: #16294d;
  font-size: 16px;
  font-weight: 900;
}

.billing-print-icon-line {
  align-items: center;
  color: #52627a;
  display: flex;
  font-size: 10.5px;
  gap: 5px;
  line-height: 1.45;
}

.billing-print-icon {
  fill: none;
  flex: none;
  height: 14px;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 14px;
}

.billing-print-title-panel {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.billing-print-title-panel h1 {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.billing-print-title-underline {
  background: var(--primary);
  border-radius: 999px;
  display: block;
  height: 3px;
  width: 86px;
}

.billing-print-title-panel > strong {
  color: #16294d;
  font-size: 14px;
  font-weight: 900;
}

.billing-print-divider {
  background: #d8e3e0;
  height: 1px;
  margin-top: 18px;
}

.billing-print-main {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.billing-print-parties {
  background: #f5f7f8;
  border: 1px solid #e2e8e6;
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}

.billing-print-party-card {
  border-right: 1px solid #d8e3e0;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 16px;
}

.billing-print-card-label,
.billing-print-date-item span,
.billing-print-payment-field span,
.billing-print-totals span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.billing-print-party-card strong {
  color: #16294d;
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.billing-print-party-card p {
  color: #52627a;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.billing-print-date-card {
  align-content: center;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.billing-print-date-item {
  align-items: center;
  display: flex;
  gap: 8px;
}

.billing-print-date-item div {
  display: grid;
  gap: 3px;
}

.billing-print-date-item strong {
  color: #16294d;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.billing-print-table {
  background: #ffffff;
  border: 1px solid #d8e3e0;
  border-collapse: separate;
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
  table-layout: fixed;
  width: 100%;
}

.billing-print-table th {
  background: #f2f5f4;
  color: #16294d;
  font-size: 10px;
  padding: 9px 10px;
  text-transform: uppercase;
}

.billing-print-table td {
  border-bottom: 1px solid #e2e8e6;
  color: #24324a;
  font-size: 11.5px;
  padding: 9px 10px;
}

.billing-print-table th,
.billing-print-table td {
  line-height: 1.35;
}

.billing-print-table th:nth-child(2),
.billing-print-table th:nth-child(3),
.billing-print-table th:nth-child(4),
.billing-print-table th:nth-child(5),
.billing-print-number {
  text-align: right;
}

.billing-print-number {
  white-space: nowrap;
}

.billing-print-table td:nth-child(5) {
  color: #16294d;
  font-weight: 900;
}

.billing-print-table th:nth-child(1) {
  width: 38%;
}

.billing-print-table th:nth-child(2) {
  width: 8%;
}

.billing-print-table th:nth-child(3) {
  width: 18%;
}

.billing-print-table th:nth-child(4) {
  width: 16%;
}

.billing-print-table th:nth-child(5) {
  width: 20%;
}

.billing-print-table td:first-child {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.billing-print-summary-row {
  display: grid;
  justify-items: end;
}

.billing-print-totals {
  align-self: end;
  background: #ffffff;
  border: 1px solid #d8e3e0;
  border-radius: 8px;
  display: grid;
  gap: 0;
  justify-self: end;
  min-width: 330px;
  overflow: hidden;
  width: 47%;
}

.billing-print-totals div {
  border-bottom: 1px solid #e2e8e6;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto;
  padding: 8px 12px;
}

.billing-print-totals strong {
  color: #16294d;
  font-size: 13px;
}

.billing-print-amount-due {
  background: #e6f4ef;
  border-bottom: 0 !important;
  color: var(--primary);
  padding: 13px 14px !important;
}

.billing-print-amount-due span,
.billing-print-amount-due strong {
  color: var(--primary);
}

.billing-print-amount-due strong {
  font-size: 22px;
  font-weight: 900;
}

.billing-print-bottom {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.billing-print-payment {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #d8e3e0;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: 126px minmax(0, 1fr);
  padding: 8px 10px;
}

.billing-print-payment-head {
  padding-left: 4px;
}

.billing-print-payment-head > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.billing-print-payment h2 {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  margin: 0;
}

.billing-print-payment-head p {
  color: #52627a;
  font-size: 9.5px;
  margin: 0;
  /* Align under PAYMENT and clear the h2::before 5px accent bar (which is 22px
     tall and extends down over this line), so the first letter isn't clipped. */
  padding-left: 13px;
}

.billing-print-payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr) minmax(0, 0.85fr) minmax(0, 1.25fr);
}

.billing-print-payment-field {
  border-left: 1px solid #e2e8e6;
  display: grid;
  gap: 2px;
  padding: 0 8px;
}

.billing-print-payment-field:first-child {
  border-left: 0;
}

.billing-print-payment-field strong {
  color: #16294d;
  font-size: 10.5px;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.billing-print-terms-note p {
  color: #52627a;
  display: inline;
  font-size: 10px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.billing-print-terms-note {
  color: #52627a;
  font-size: 10px;
  overflow-wrap: anywhere;
  padding-top: 2px;
  word-break: break-word;
}

.billing-print-terms-note p + p::before {
  content: " ";
}

.billing-print-terms-note strong {
  color: var(--primary);
}

.pesticide-notice-filters {
  grid-template-columns: minmax(260px, 1fr);
}

.pesticide-notice-promo-input {
  min-height: 150px;
}

.pesticide-notice-choice-group {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 10px;
}

.pesticide-notice-choice-group--radio {
  grid-template-columns: 1fr;
}

.pesticide-notice-choice {
  align-items: start;
  background: #ffffff;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  color: #344054;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.35;
  padding: 8px 10px;
}

.pesticide-notice-choice input {
  margin-top: 2px;
}

.pesticide-notice-choice span {
  font-size: 13px;
}

.pesticide-notice-other-field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.pesticide-notice-print-page {
  align-content: start;
  background: #ffffff;
  color: #16294d;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding: 22px 24px 24px 32px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pesticide-notice-print-header {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.pesticide-notice-print-brand {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 86px minmax(0, 1fr);
}

.pesticide-notice-print-logo-box {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7e0ee;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(22, 41, 77, 0.08);
  display: flex;
  height: 86px;
  justify-content: center;
  overflow: hidden;
  width: 86px;
}

.pesticide-notice-print-logo-box img {
  display: block;
  height: 72px;
  object-fit: contain;
  width: 72px;
}

.pesticide-notice-print-logo-box span[hidden] {
  display: none;
}

.pesticide-notice-print-logo-box span {
  align-items: center;
  background: #12343b;
  border-radius: 12px;
  color: #ffffff;
  display: flex;
  font-size: 22px;
  font-weight: 900;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.pesticide-notice-print-title {
  background: #12343b;
  border-radius: 18px;
  color: #ffffff;
  display: grid;
  gap: 10px;
  padding: 22px;
}

.pesticide-notice-print-company {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.pesticide-notice-print-company strong,
.pesticide-notice-print-company span {
  display: block;
}

.pesticide-notice-print-company strong {
  color: #16294d;
  font-size: 17px;
}

.pesticide-notice-print-company span,
.pesticide-notice-print-header p {
  color: #52627a;
  font-size: 11px;
  line-height: 1.45;
}

.pesticide-notice-print-header h1 {
  color: #ffffff;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-align: right;
}

.pesticide-notice-print-header p {
  color: #d8e6e9;
  margin: 8px 0 0;
  text-align: right;
}

.pesticide-notice-print-details {
  background: #ffffff;
  border: 1px solid #d8e2ec;
  border-radius: 14px;
  display: grid;
  overflow: hidden;
}

.pesticide-notice-print-row {
  border-bottom: 1px solid #d8e2ec;
  display: grid;
  gap: 12px;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 34px;
  padding: 8px 10px;
}

.pesticide-notice-print-row:last-child {
  border-bottom: 0;
}

.pesticide-notice-print-row span {
  color: #52627a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pesticide-notice-print-row strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pesticide-notice-print-row-block {
  align-items: start;
}

.pesticide-notice-promo {
  background: #ffffff;
  border: 1px solid #d8e2ec;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}

.pesticide-notice-qr-block {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.pesticide-notice-booking-heading {
  color: #12343b;
  font-size: 14px;
  font-weight: 900;
  margin: 0;
}

.pesticide-notice-booking-options {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: auto minmax(0, 1fr);
}

.pesticide-notice-booking-option {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.pesticide-notice-booking-option--email {
  border-left: 1px solid #d8e2ec;
  justify-items: start;
  padding-left: 20px;
  text-align: left;
}

.pesticide-notice-qr-img {
  background: #ffffff;
  border: 2px solid #12343b;
  border-radius: 12px;
  display: block;
  height: 118px;
  padding: 4px;
  width: 118px;
}

.pesticide-notice-qr-block p {
  color: #344054;
  font-size: 13px;
  margin: 0;
}

.pesticide-notice-booking-value {
  font-weight: 700;
  word-break: break-word;
}

/* Shared contract for every html2pdf capture root. */
.report-print-document.print-pdf-root,
.print-pdf-root {
  background: #ffffff;
  box-sizing: border-box;
  display: block;
  gap: 0;
  margin: 0 auto;
  max-width: 733px;
  min-width: 733px;
  overflow: visible;
  padding: 0;
  width: 733px;
}

.print-pdf-root,
.print-pdf-root * {
  box-sizing: border-box;
}

.print-pdf-root .print-document-page {
  background: #ffffff;
  color: #16294d;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  padding: 22px 24px 24px 32px;
  width: 100%;
}

.print-pdf-root .billing-print-page {
  padding: 0;
}

.print-pdf-root .billing-print-page-inner {
  min-height: 0;
  min-width: 0;
  padding: 22px 24px 24px 32px;
  width: 100%;
}

.print-document-header {
  align-items: start;
  background: #ffffff;
  color: #16294d;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  min-width: 0;
  padding: 0 0 14px;
  position: relative;
}

.print-document-header::after {
  background: #d8e3e0;
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}

.print-document-brand {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
  min-width: 0;
}

.print-document-logo {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8ebe7;
  border-radius: 8px;
  box-shadow: none;
  display: flex;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 64px;
}

.print-document-logo img {
  display: block;
  height: 54px;
  object-fit: contain;
  width: 54px;
}

.print-document-company {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.print-document-company > strong,
.print-document-company strong {
  color: #16294d;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.print-document-company span,
.print-document-company .billing-print-icon-line,
.print-document-company .report-print-icon-line {
  color: #52627a;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.print-document-title {
  align-content: start;
  background: transparent;
  border-radius: 0;
  color: #16294d;
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 0;
  padding: 0;
}

.print-document-title h1,
.pesticide-notice-print-header .print-document-title h1 {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.08;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: normal;
}

.print-document-title p,
.pesticide-notice-print-header .print-document-title p {
  color: #52627a;
  font-size: 10px;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.print-document-section,
.print-document-table,
.print-document-photo {
  overflow-wrap: anywhere;
}

.report-print-cover-photo .report-print-photo-frame {
  aspect-ratio: auto;
  height: 300px;
}

.report-print-photo-grid--bounded,
.termite-print-section-opening,
.termite-print-detail-group,
.termite-print-photo-group,
.certificate-print-long-field,
.certificate-print-technician-block,
.certificate-print-tnc-entry,
.billing-print-table-group,
.pesticide-notice-qr-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

.report-print-photo-grid--bounded + .report-print-photo-grid--bounded {
  margin-top: 12px;
}

.termite-print-detail-group,
.termite-print-photo-group,
.certificate-print-long-field {
  display: grid;
  gap: 7px;
}

.billing-print-table-groups {
  display: grid;
  gap: 10px;
}

.billing-print-table-group {
  min-width: 0;
}

.billing-print-bottom {
  min-width: 0;
  overflow: visible;
}

.billing-print-terms-note {
  display: grid;
  gap: 4px;
  overflow: visible;
}

.billing-print-terms-note p {
  break-inside: avoid;
  display: block;
  page-break-inside: avoid;
}

.billing-print-terms-note p + p::before {
  content: none;
}

.pesticide-notice-print-page {
  align-content: start;
  background: #ffffff;
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding: 22px 24px 24px 32px;
}

.pesticide-notice-print-header {
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
}

.pesticide-notice-print-brand {
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
}

.pesticide-notice-print-logo-box {
  border-radius: 8px;
  box-shadow: none;
  height: 64px;
  width: 64px;
}

.pesticide-notice-print-logo-box img {
  height: 54px;
  width: 54px;
}

.pesticide-notice-print-title {
  background: transparent;
  border-radius: 0;
  color: #16294d;
  gap: 6px;
  padding: 0;
}

.pesticide-notice-print-details,
.pesticide-notice-promo {
  border-color: #d8e3e0;
  border-radius: 8px;
}

.pesticide-notice-print-row {
  gap: 12px;
  grid-template-columns: 190px minmax(0, 1fr);
  min-width: 0;
  padding: 6px 8px;
}

.pesticide-notice-print-row > * {
  min-width: 0;
}

.pesticide-notice-promo {
  overflow-wrap: anywhere;
  padding: 10px;
}

.pesticide-notice-print-row .report-print-lines p,
.pesticide-notice-promo .report-print-lines p {
  font-size: 10.5px;
  line-height: 1.35;
}

.pesticide-notice-qr-block {
  gap: 12px;
  grid-template-columns: 78px minmax(0, 1fr);
  margin-top: 0;
}

.pesticide-notice-qr {
  border-radius: 8px;
  font-size: 11px;
}

/* TASK 617: compact resident offer and booking options for Pesticide Notices. */
.pesticide-notice-offer {
  background: #ffffff;
  border: 1.5px solid #0f857b;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.pesticide-notice-offer-title {
  align-content: center;
  border-right: 1px solid #cbdad8;
  color: #0b7d72;
  display: grid;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.7px;
  line-height: 0.98;
  margin: 0;
  padding: 15px 20px;
  text-transform: uppercase;
}

.pesticide-notice-offer-title span:first-child,
.pesticide-notice-offer-title span:last-child {
  color: #16294d;
}

.pesticide-notice-offer .pesticide-notice-promo {
  align-content: center;
  border: 0;
  border-radius: 0;
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 14px 18px;
}

.pesticide-notice-offer .pesticide-notice-promo .report-print-lines p {
  color: #253957;
  font-size: 10.5px;
  line-height: 1.4;
  margin: 0;
}

.pesticide-notice-qr-block {
  background: #ffffff;
  border: 1.5px solid #16294d;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
  min-width: 0;
  padding: 8px 14px 12px;
}

.pesticide-notice-booking-heading {
  align-items: center;
  color: #16294d;
  display: grid;
  font-size: 15px;
  font-weight: 900;
  gap: 12px;
  grid-template-columns: minmax(28px, 1fr) auto minmax(28px, 1fr);
  margin: 0;
  text-align: center;
}

.pesticide-notice-booking-heading::before,
.pesticide-notice-booking-heading::after {
  background: #8090a8;
  content: "";
  height: 1px;
}

.pesticide-notice-booking-options {
  align-items: stretch;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.pesticide-notice-booking-option {
  align-content: center;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.pesticide-notice-booking-option--email {
  align-items: center;
  border-left: 1px solid #cbd4e0;
  display: flex;
  gap: 15px;
  justify-content: center;
  justify-items: initial;
  padding: 8px 18px;
  text-align: left;
}

.pesticide-notice-booking-email-icon {
  align-items: center;
  background: #e5f4f1;
  border-radius: 50%;
  color: #0f857b;
  display: flex;
  flex: 0 0 58px;
  height: 58px;
  justify-content: center;
  position: relative;
  width: 58px;
}

.pesticide-notice-booking-email-icon::before {
  border: 2.5px solid currentColor;
  border-radius: 4px;
  box-sizing: border-box;
  content: "";
  height: 24px;
  position: absolute;
  width: 34px;
}

.pesticide-notice-booking-email-icon::after {
  border-bottom: 2.5px solid currentColor;
  border-left: 2.5px solid currentColor;
  content: "";
  height: 14px;
  position: absolute;
  top: 13px;
  transform: rotate(-45deg);
  width: 14px;
}

.pesticide-notice-qr-img {
  background: #ffffff;
  border: 2px solid #12343b;
  border-radius: 9px;
  display: block;
  height: 104px;
  padding: 4px;
  width: 104px;
}

.pesticide-notice-qr-block p {
  color: #344054;
  font-size: 11.5px;
  line-height: 1.3;
  margin: 0;
}

.pesticide-notice-booking-value {
  color: #0b7d72 !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@page {
  margin: 12mm;
  size: A4;
}

@media print {
  .form-modal {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  body.report-print-active .sidebar,
  body.report-print-active .workspace-topbar,
  body.report-print-active .content-region > .panel {
    display: none !important;
  }

  body.report-print-active .content-region > .panel.report-print-host {
    display: block !important;
  }

  body.report-print-active .report-print-host > :not(.report-print-preview) {
    display: none !important;
  }

  body.report-print-active .report-print-host > [data-billing-print-mount] {
    display: block !important;
  }

  body.report-print-active .app-shell,
  body.report-print-active .main,
  body.report-print-active .content-region,
  body.report-print-active .panel,
  body.report-print-active [data-billing-print-mount],
  body.report-print-active .report-print-preview,
  body.report-print-active .report-print-document {
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.report-print-active .app-shell {
    min-height: auto;
  }

  body.report-print-active .report-print-toolbar {
    display: none !important;
  }

  body.report-print-active .report-print-page {
    border: 0;
    break-after: auto;
    color: #16294d;
    display: grid !important;
    min-height: 0;
    padding: 0;
    page-break-after: auto;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.report-print-active .report-print-page-last {
    break-after: auto;
    page-break-after: auto;
  }

  body.report-print-active .report-print-page:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  body.report-print-active .report-print-header {
    background: #ffffff !important;
    color: #16294d !important;
  }

  body.report-print-active .report-print-footer {
    background: var(--primary) !important;
    color: #ffffff !important;
  }

  body.report-print-active .billing-print-page {
    background: #ffffff !important;
    break-after: auto;
    box-sizing: border-box;
    color: #16294d;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    page-break-after: auto;
    padding: 0;
    width: 100%;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.report-print-active .billing-print-page-inner {
    box-sizing: border-box;
    min-height: 0;
    min-width: 0;
    padding: 10mm 12mm 7mm 13mm;
    width: 100%;
  }

  body.report-print-active .pesticide-notice-print-page {
    background: #ffffff !important;
    break-after: auto;
    color: #16294d;
    gap: 10px;
    min-height: 0;
    overflow: visible;
    page-break-after: auto;
    padding: 6mm 6mm 7mm 8mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.report-print-active .pesticide-notice-print-header,
  body.report-print-active .pesticide-notice-print-details,
  body.report-print-active .pesticide-notice-print-row,
  body.report-print-active .pesticide-notice-promo,
  body.report-print-active .pesticide-notice-qr {
    border-color: #000000;
  }

  body.report-print-active .report-print-table th {
    background: #f2f5f4 !important;
    color: #16294d !important;
  }

  body.report-print-active .billing-print-document,
  body.report-print-active .pesticide-notice-print-document,
  body.report-print-active .report-print-document.report-pdf-root,
  body.report-print-active .print-pdf-root {
    min-width: 733px !important;
    overflow: visible !important;
    width: 733px !important;
  }

  body.report-print-active .print-pdf-root .print-document-page {
    padding: 22px 24px 24px 32px;
  }

  body.report-print-active .print-pdf-root .billing-print-page {
    padding: 0;
  }

  body.report-print-active .billing-print-document,
  body.report-print-active .billing-print-page,
  body.report-print-active .billing-print-page *,
  body.report-print-active .pesticide-notice-print-document,
  body.report-print-active .pesticide-notice-print-page,
  body.report-print-active .pesticide-notice-print-page *,
  body.report-print-active .report-print-document,
  body.report-print-active .report-print-page,
  body.report-print-active .report-print-page * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.report-print-active .billing-print-logo-box,
  body.report-print-active .billing-print-date-card,
  body.report-print-active .billing-print-party-card,
  body.report-print-active .billing-print-table,
  body.report-print-active .billing-print-table td,
  body.report-print-active .billing-print-totals,
  body.report-print-active .billing-print-totals div,
  body.report-print-active .billing-print-payment,
  body.report-print-active .billing-print-payment-field,
  body.report-print-active .billing-print-terms-note {
    border-color: #d8ebe7;
  }

  body.report-print-active .pesticide-notice-print-logo-box,
  body.report-print-active .pesticide-notice-print-details,
  body.report-print-active .pesticide-notice-print-row,
  body.report-print-active .pesticide-notice-promo {
    border-color: #d7e0ee;
  }

  body.report-print-active .billing-print-table th {
    background: #f2f5f4 !important;
    color: #16294d !important;
  }

  body.report-print-active .pesticide-notice-qr {
    border-color: #12343b;
  }

  body.report-print-active .billing-print-amount-due {
    background: #e6f4ef !important;
    color: var(--primary) !important;
  }

  body.report-print-active .billing-print-amount-due span,
  body.report-print-active .billing-print-amount-due strong {
    color: var(--primary) !important;
  }

  body.report-print-active .termite-print-title-block,
  body.report-print-active .certificate-print-title-block {
    border-color: #b7ddd5;
  }

  body.report-print-active .certificate-print-tnc h3,
  body.report-print-active .certificate-print-tnc p,
  body.report-print-active .certificate-print-tnc li,
  body.report-print-active .certificate-print-tnc-entry,
  body.report-print-active .report-print-lines p,
  body.report-print-active .report-print-lines li,
  body.report-print-active .print-pdf-root .report-print-page h2,
  body.report-print-active .print-pdf-root .report-print-page h3,
  body.report-print-active .print-pdf-root .report-print-page h4,
  body.report-print-active .report-contents-row,
  body.report-print-active .report-print-photo-grid--bounded,
  body.report-print-active .termite-print-section-opening,
  body.report-print-active .termite-print-detail-group,
  body.report-print-active .termite-print-photo-group,
  body.report-print-active .billing-print-table-group,
  body.report-print-active .pesticide-notice-qr-block,
  body.report-print-active .certificate-print-photo-section,
  body.report-print-active .certificate-print-signature,
  body.report-print-active .certificate-print-technician-block,
  body.report-print-active .report-print-photo,
  body.report-print-active .report-print-detail,
  body.report-print-active .report-print-signature,
  body.report-print-active .termite-print-inspector-atomic,
  body.report-print-active .termite-print-property-atomic,
  body.report-print-active .termite-print-limitation-callout,
  body.report-print-active .termite-print-action-callout,
  body.report-print-active .report-print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.report-print-active .report-print-photo,
  body.report-print-active .report-print-table th,
  body.report-print-active .report-print-table td,
  body.report-print-active .report-print-risk-list span,
  body.report-print-active .report-print-logo-slot {
    border-color: #d8ebe7;
  }

  body.report-print-active .termite-print-title-block,
  body.report-print-active .certificate-print-title-block,
  body.report-print-active .report-print-cover-address,
  body.report-print-active .report-print-detail,
  body.report-print-active .report-print-signature,
  body.report-print-active .termite-print-signature-panel {
    border-left-color: var(--primary) !important;
  }

  body.report-print-active .answer-yes {
    background: #fef3f2 !important;
    border-color: #fecdca !important;
    color: #b42318 !important;
  }

  body.report-print-active .answer-no {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
  }

  body.report-print-active .report-print-safety-list.general-pest-safety-list .answer-yes {
    background: #ecfdf3 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
  }

  body.report-print-active .report-print-safety-list.general-pest-safety-list .answer-no {
    background: #fef3f2 !important;
    border-color: #fecdca !important;
    color: #b42318 !important;
  }
}

.reminders-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(150px, 1fr)) auto;
  margin: 14px 0;
}

.reminders-filters input,
.reminders-filters select {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.reminders-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.reminders-table {
  border-collapse: collapse;
  min-width: 1520px;
  width: 100%;
}

.reminders-table th,
.reminders-table td {
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.reminders-table th {
  background: var(--soft);
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.reminders-table tbody tr:hover {
  background: #f8fafc;
}

.reminder-actions {
  flex-wrap: wrap;
  min-width: 0;
}

.reminders-note-cell {
  max-width: 260px;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.communications-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)) auto;
  margin: 14px 0;
}

.communications-filters input,
.communications-filters select {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.communications-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.jobs-table-wrap,
.datebase-table-wrap,
.reminders-table-wrap,
.communications-table-wrap,
.recurring-due-table-wrap,
.billing-table-wrap {
  overflow-x: auto;
}

.communications-table {
  border-collapse: collapse;
  min-width: 1760px;
  width: 100%;
}

.communications-table th,
.communications-table td {
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.communications-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.billing-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

:is(
  .datebase-table,
  .jobs-table,
  .reminders-table,
  .communications-table,
  .billing-table
) th {
  white-space: nowrap;
}

.communications-table tbody tr:hover {
  background: #f8fafc;
}

.communications-actions {
  min-width: 300px;
}

.datebase-table th:first-child,
.datebase-table td:first-child,
.jobs-table th:first-child,
.jobs-table td:first-child,
.reminders-table th:first-child,
.reminders-table td:first-child,
.communications-table th:first-child,
.communications-table td:first-child,
.billing-table th:first-child,
.billing-table td:first-child {
  background: #ffffff;
  border-right: 1px solid var(--line-strong);
  left: 0;
  position: sticky;
  z-index: 2;
}

.datebase-table th:last-child,
.datebase-table td:last-child,
.jobs-table th:last-child,
.jobs-table td:last-child,
.reminders-table th:last-child,
.reminders-table td:last-child,
.communications-table th:last-child,
.communications-table td:last-child,
.billing-table th:last-child,
.billing-table td:last-child {
  background: #ffffff;
  border-left: 1px solid var(--line-strong);
  position: sticky;
  right: 0;
  z-index: 2;
}

.datebase-table th:first-child,
.datebase-table th:last-child,
.jobs-table th:first-child,
.jobs-table th:last-child,
.reminders-table th:first-child,
.reminders-table th:last-child,
.communications-table th:first-child,
.communications-table th:last-child,
.billing-table th:first-child,
.billing-table th:last-child {
  background: var(--soft);
  z-index: 4;
}

/* TASK 620: user-selectable fixed columns for Datebase and Recurring Due only. */
body[data-table-edge-mode="free"] .datebase-table th:first-child {
  left: auto;
}

body[data-table-edge-mode="free"] .datebase-table th:last-child {
  right: auto;
}

body[data-table-edge-mode="free"] .datebase-table td:first-child,
body[data-table-edge-mode="free"] .datebase-table td:last-child {
  left: auto;
  position: static;
  right: auto;
  z-index: auto;
}

body[data-table-edge-mode="free"] .recurring-due-table th[data-recurring-column="actions"],
body[data-table-edge-mode="free"] .recurring-due-table th[data-recurring-column="scheduleStatus"] {
  box-shadow: none;
  right: auto;
}

body[data-table-edge-mode="free"] .recurring-due-table td[data-recurring-column="actions"],
body[data-table-edge-mode="free"] .recurring-due-table td[data-recurring-column="scheduleStatus"] {
  box-shadow: none;
  position: static;
  right: auto;
  z-index: auto;
}

:is(
  .datebase-table,
  .jobs-table,
  .reminders-table,
  .communications-table,
  .billing-table
) td:last-child:has(.action-menu.is-open) {
  z-index: 6;
}

.billing-address-line {
  background: var(--soft);
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
}

.billing-overdue-badge {
  display: inline-block;
  margin-top: 4px;
}

.datebase-table tbody tr:hover td:first-child,
.datebase-table tbody tr:hover td:last-child,
.jobs-table tbody tr:hover td:first-child,
.jobs-table tbody tr:hover td:last-child,
.reminders-table tbody tr:hover td:first-child,
.reminders-table tbody tr:hover td:last-child,
.communications-table tbody tr:hover td:first-child,
.communications-table tbody tr:hover td:last-child,
.billing-table tbody tr:hover td:first-child,
.billing-table tbody tr:hover td:last-child {
  background: #f8fafc;
}

/* Status tints follow the generic sticky hover rule so edge cells keep their row colour. */
.billing-table tbody tr.billing-row-overdue td,
.billing-table tbody tr.billing-row-overdue:hover td,
.billing-table tbody tr.billing-row-overdue:hover td:first-child,
.billing-table tbody tr.billing-row-overdue:hover td:last-child {
  background: #fdecea;
}

.recurring-due-table tbody tr.is-overdue td,
.recurring-due-table tbody tr.is-overdue:hover td,
.recurring-due-table tbody tr.is-overdue:hover td[data-recurring-column="address"],
.recurring-due-table tbody tr.is-overdue:hover td[data-recurring-column="actions"],
.recurring-due-table tbody tr.is-overdue:hover td[data-recurring-column="scheduleStatus"] {
  background: #fff4cc;
  color: #111827;
}

.recurring-due-table tbody tr.is-soon td,
.recurring-due-table tbody tr.is-soon:hover td,
.recurring-due-table tbody tr.is-soon:hover td[data-recurring-column="address"],
.recurring-due-table tbody tr.is-soon:hover td[data-recurring-column="actions"],
.recurring-due-table tbody tr.is-soon:hover td[data-recurring-column="scheduleStatus"] {
  background: #fff7e6;
}

.recurring-due-table tbody tr.is-near td,
.recurring-due-table tbody tr.is-near:hover td,
.recurring-due-table tbody tr.is-near:hover td[data-recurring-column="address"],
.recurring-due-table tbody tr.is-near:hover td[data-recurring-column="actions"],
.recurring-due-table tbody tr.is-near:hover td[data-recurring-column="scheduleStatus"] {
  background: #fffbf2;
}

.recurring-due-table tbody tr.is-later td,
.recurring-due-table tbody tr.is-later:hover td,
.recurring-due-table tbody tr.is-later:hover td[data-recurring-column="address"],
.recurring-due-table tbody tr.is-later:hover td[data-recurring-column="actions"],
.recurring-due-table tbody tr.is-later:hover td[data-recurring-column="scheduleStatus"] {
  background: #ffffff;
}

.datebase-table tbody tr.datebase-row-termite,
.datebase-table tbody tr.datebase-row-termite td,
.datebase-table tbody tr.datebase-row-termite:hover,
.datebase-table tbody tr.datebase-row-termite:hover td,
.datebase-table tbody tr.datebase-row-termite:hover td:first-child,
.datebase-table tbody tr.datebase-row-termite:hover td:last-child {
  background: #fee4e2;
}

.jobs-table tbody tr.jobs-row-termite,
.jobs-table tbody tr.jobs-row-termite td,
.jobs-table tbody tr.jobs-row-termite:hover,
.jobs-table tbody tr.jobs-row-termite:hover td,
.jobs-table tbody tr.jobs-row-termite:hover td:first-child,
.jobs-table tbody tr.jobs-row-termite:hover td:last-child {
  background: #fee4e2;
}

.job-detail-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.job-detail-grid div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 7px 9px;
}

.job-detail-grid span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.job-detail-grid strong {
  color: #1f2933;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    transition: none;
  }

  .sidebar {
    align-self: stretch;
    height: auto;
    overflow-y: visible;
    padding: 14px;
    position: static;
  }

  .sidebar-toggle {
    display: none;
  }

  .brand,
  .app-shell--sidebar-collapsed .brand {
    flex-direction: row;
    justify-items: start;
    min-height: 44px;
    padding-right: 0;
  }

  .app-shell--sidebar-collapsed .sidebar {
    padding: 14px;
  }

  .app-shell--sidebar-collapsed .sidebar-copy--full {
    display: inline;
  }

  .app-shell--sidebar-collapsed .sidebar-copy--compact {
    display: none;
  }

  .app-shell--sidebar-collapsed .nav a {
    gap: 11px;
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
  }

  .app-shell--sidebar-collapsed .sidebar-auth {
    justify-items: stretch;
  }

  .app-shell--sidebar-collapsed .sidebar-auth__button {
    justify-content: flex-start;
    padding: 8px 14px;
    width: 100%;
  }

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

  .topbar {
    display: grid;
  }

  .workspace-topbar__header {
    display: grid;
  }

  .stats {
    justify-content: stretch;
  }

  .stat {
    flex: 1;
  }

  .calendar-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-board-shell {
    grid-template-columns: 1fr;
  }

  .schedule-board {
    grid-template-columns: 1fr;
  }

  .schedule-fix-rail {
    max-height: none;
    position: static;
  }

  .datebase-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jobs-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminders-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .communications-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-tech-row {
    grid-template-columns: auto minmax(180px, 1fr) auto;
  }

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

  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px;
  }

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

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

  .field.span-2,
  .field.span-4 {
    grid-column: 1;
  }

  .appointment-row {
    grid-template-columns: 1fr;
  }

  .customer-table__head {
    display: none;
  }

  .customer-row {
    grid-template-columns: 1fr;
  }

  .calendar-summary,
  .calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .calendar-day-column {
    flex-basis: var(--calendar-day-column-width);
  }

  .calendar-board-shell {
    --calendar-day-column-width: 82vw;
  }

  .calendar-quick-paste-control {
    grid-template-columns: 1fr;
  }

  .calendar-card__actions {
    justify-content: flex-start;
  }

  .schedule-day__header {
    align-items: flex-start;
    display: grid;
  }

  .schedule-day__note-area,
  .schedule-day__header-actions {
    max-width: 100%;
    position: static;
    transform: none;
  }

  .schedule-card__actions {
    justify-content: flex-start;
  }

  .datebase-filters {
    grid-template-columns: 1fr;
  }

  .jobs-filters {
    grid-template-columns: 1fr;
  }

  .reminders-filters {
    grid-template-columns: 1fr;
  }

  .communications-filters {
    grid-template-columns: 1fr;
  }

  .settings-add-row {
    grid-template-columns: 1fr;
  }

  .import-summary {
    grid-template-columns: 1fr;
  }

  .settings-tech-row {
    grid-template-columns: 1fr;
  }

  .settings-tech-row__actions {
    justify-content: flex-start;
  }

  .settings-availability-summary > span {
    margin-right: 10px;
  }

  .settings-price-list__images {
    grid-template-columns: 1fr;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .history-card__meta {
    justify-content: flex-start;
  }

  .flow-chip {
    align-items: flex-start;
    display: grid;
  }

  .flow-chip span + span::before {
    content: "";
    margin-right: 0;
  }
}

@media screen and (pointer: coarse) and (min-width: 768px) {
  .sidebar {
    padding: 14px 12px;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .workspace-topbar__header {
    gap: 12px;
  }

  .panel {
    padding: 12px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select:not([multiple]),
  textarea {
    min-height: 40px;
  }

  button,
  .btn,
  .btn.small,
  .calendar-card .btn,
  .calendar-card .btn.small,
  .calendar-card .link-button {
    min-height: 44px;
  }
}

@media screen and (pointer: coarse) and (min-width: 981px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .calendar-summary,
  .calendar-toolbar,
  .datebase-filters,
  .jobs-filters,
  .reminders-filters,
  .communications-filters,
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-sections,
  .schedule-board-shell,
  .schedule-board,
  .settings-tech-row,
  .import-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (min-width: 768px) and (max-width: 1180px) {
  .grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select:not([multiple]),
  textarea,
  .appt-saas .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .appt-saas .field select,
  .appt-saas .field textarea,
  .appt-saas .calendar-service-price > input,
  .appt-saas .calendar-service-picker select {
    min-height: 44px;
  }

  button,
  .btn,
  .btn.small,
  .calendar-card .btn,
  .calendar-card .btn.small,
  .calendar-card .link-button,
  .appt-saas button,
  .appt-saas .btn,
  .appt-saas .time-specific-toggle,
  .appt-saas .check-row label,
  .appt-saas .service-package-price-toggle label,
  .appt-saas .pricing-gst-toggle__option,
  .appt-saas .pricing-tag-option,
  .appt-saas .calendar-service-price__tbd,
  .appt-saas .calendar-service-chip {
    min-height: 44px;
  }
}

.calendar-service-prices {
  container-type: inline-size;
  display: grid;
  gap: 8px;
}

.service-price-breakdown {
  display: grid;
  gap: 8px;
}

.service-price-breakdown[hidden],
.service-package-price-field[hidden] {
  display: none;
}

.service-package-price-toggle {
  display: flex;
  margin-bottom: 10px;
}

.service-package-price-toggle label {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f9fafb;
  white-space: nowrap;
  cursor: pointer;
}

.service-package-price-toggle input {
  margin: 0;
}

.service-package-price-field {
  max-width: 440px;
}

.calendar-service-price {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 120px) auto;
}

.calendar-service-price span {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.calendar-service-price > span:first-child {
  align-self: center;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.calendar-service-price input {
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.calendar-service-price input:disabled {
  background: #f3f4f6;
  color: #98a2b3;
}

.calendar-service-price__tbd {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.calendar-service-price__tbd input {
  min-height: auto;
  padding: 0;
  width: auto;
}

@container (max-width: 360px) {
  .calendar-service-price {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .calendar-service-price > span:first-child {
    grid-column: 1 / -1;
  }

  .calendar-service-price > input[data-service-price] {
    grid-column: 1;
  }

  .calendar-service-price__tbd {
    grid-column: 2;
    justify-self: start;
  }
}

.calendar-price-total {
  color: #1f2933;
  font-weight: 800;
  display: inline-block;
  margin: 6px 22px 0 0;
}

.calendar-board::-webkit-scrollbar,
.schedule-columns::-webkit-scrollbar,
.datebase-table-wrap::-webkit-scrollbar,
.jobs-table-wrap::-webkit-scrollbar,
.recurring-due-table-wrap::-webkit-scrollbar,
.billing-table-wrap::-webkit-scrollbar,
.reminders-table-wrap::-webkit-scrollbar,
.communications-table-wrap::-webkit-scrollbar,
.import-table-wrap::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.calendar-board::-webkit-scrollbar-track,
.schedule-columns::-webkit-scrollbar-track,
.datebase-table-wrap::-webkit-scrollbar-track,
.jobs-table-wrap::-webkit-scrollbar-track,
.recurring-due-table-wrap::-webkit-scrollbar-track,
.billing-table-wrap::-webkit-scrollbar-track,
.reminders-table-wrap::-webkit-scrollbar-track,
.communications-table-wrap::-webkit-scrollbar-track,
.import-table-wrap::-webkit-scrollbar-track {
  background: #eef2f5;
  border-radius: 8px;
}

.calendar-board::-webkit-scrollbar-thumb,
.schedule-columns::-webkit-scrollbar-thumb,
.datebase-table-wrap::-webkit-scrollbar-thumb,
.jobs-table-wrap::-webkit-scrollbar-thumb,
.recurring-due-table-wrap::-webkit-scrollbar-thumb,
.billing-table-wrap::-webkit-scrollbar-thumb,
.reminders-table-wrap::-webkit-scrollbar-thumb,
.communications-table-wrap::-webkit-scrollbar-thumb,
.import-table-wrap::-webkit-scrollbar-thumb {
  background: #b6c2cf;
  border: 2px solid #eef2f5;
  border-radius: 8px;
}

.calendar-board::-webkit-scrollbar-thumb:hover,
.schedule-columns::-webkit-scrollbar-thumb:hover,
.datebase-table-wrap::-webkit-scrollbar-thumb:hover,
.jobs-table-wrap::-webkit-scrollbar-thumb:hover,
.recurring-due-table-wrap::-webkit-scrollbar-thumb:hover,
.billing-table-wrap::-webkit-scrollbar-thumb:hover,
.reminders-table-wrap::-webkit-scrollbar-thumb:hover,
.communications-table-wrap::-webkit-scrollbar-thumb:hover,
.import-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* TASK 341: referral operations workspace */
.referrals-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.referrals-tab-panel {
  min-width: 0;
}

.referrals-heading {
  align-items: flex-start;
}

.referrals-tabs {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
}

.referrals-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.referrals-tab:hover {
  color: var(--text);
}

.referrals-tab.is-active {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
  color: var(--primary-dark);
}

.referral-booking-list {
  display: grid;
  gap: 14px;
}

/* TASK 613: dense referral operations tables */
.referral-ops-table-wrap {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  width: 100%;
}

.referral-ops-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 1240px;
  table-layout: fixed;
  width: 100%;
}

.referral-ops-table th {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
}

.referral-ops-table td {
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  vertical-align: top;
}

.referral-ops-table .referral-ops-row > td:nth-child(1) { width: 12%; }
.referral-ops-table .referral-ops-row > td:nth-child(2) { width: 15%; }
.referral-ops-table .referral-ops-row > td:nth-child(3) { width: 15%; }
.referral-ops-table .referral-ops-row > td:nth-child(4) { width: 19%; }
.referral-ops-table .referral-ops-row > td:nth-child(5) { width: 14%; }
.referral-ops-table .referral-ops-row > td:nth-child(6) { width: 14%; }
.referral-ops-table .referral-ops-row > td:nth-child(7) { width: 11%; }

.referral-ops-row td > strong,
.referral-ops-row td > span,
.referral-ops-row td > small {
  display: block;
}

.referral-ops-row td > strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.referral-ops-row td > span,
.referral-ops-row td > small {
  color: var(--muted);
  line-height: 1.35;
  margin-top: 3px;
}

.referral-ops-row.has-risk,
.referral-ops-detail-row.has-risk {
  background: #fff8ec;
}

.referral-ops-row.is-failed,
.referral-ops-detail-row.is-failed,
.referral-ops-row.is-stale,
.referral-ops-detail-row.is-stale {
  background: #fff4f4;
}

.referral-ops-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.referral-ops-actions-cell .btn.small {
  min-height: 32px;
  padding: 5px 8px;
}

.referral-ops-detail-row > td {
  background: var(--surface-muted);
  padding: 0 9px 4px;
}

.referral-row-details > summary,
.referral-outbox-detail > summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  list-style-position: inside;
  padding: 5px 0;
}

.referral-row-details .referral-booking-grid,
.referral-outbox-detail > div {
  padding: 8px 0 10px;
}

.referral-job-match-row > td {
  background: var(--acc-tint);
  padding: 10px 12px;
}

.referral-job-match--compact {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
}

.referral-job-match--compact .referral-job-results {
  margin-top: 0;
  max-height: 220px;
}

.referral-row-actions-menu {
  width: 100%;
}

.referral-row-actions-menu > summary {
  cursor: pointer;
  list-style: none;
  width: fit-content;
}

.referral-row-actions-menu > div {
  display: grid;
  gap: 5px;
  margin-top: 5px;
}

.referral-ops-table .text-danger { color: var(--danger); }
.referral-ops-table .text-success { color: var(--primary); }

.referral-ops-table--sync { min-width: 980px; }
.referral-ops-table--reconciliation { min-width: 1120px; }

@media (max-width: 760px) {
  .referral-job-match--compact {
    grid-template-columns: minmax(0, 1fr);
  }
}

.referral-withdrawal-notice,
.referral-booked-queue-summary,
.referral-booked-queue-warning,
.referral-booked-queue-pagination {
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 11px 13px;
}

.referral-withdrawal-notice {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  margin-bottom: 14px;
}

.referral-booked-queue-summary {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  justify-content: space-between;
  margin-bottom: 14px;
}

.referral-booked-queue-warning {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}

.referral-booked-queue-warning span + span::before {
  content: "·";
  margin-right: 8px;
}

.referral-booked-queue-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  margin-top: 14px;
  padding-inline: 0;
}

.list-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}

.paged-list-results {
  position: relative;
}

.paged-list-loading-overlay {
  align-items: center;
  background: rgb(255 255 255 / 72%);
  color: var(--text);
  display: flex;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 8;
}

.referral-booking-actions small {
  color: var(--muted);
}

.referral-booking-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.referral-booking-card.has-risk {
  border-left-color: #d97706;
}

.referral-booking-card__header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.referral-booking-card__header h3,
.referral-booking-card__header p {
  margin: 0;
}

.referral-booking-card__header h3 {
  font-size: 18px;
  margin-top: 3px;
}

.referral-booking-card__header p,
.referral-booking-card__eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.referral-booking-card__status,
.referral-booking-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.referral-risk-strip {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
}

.referral-booking-grid {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.referral-booking-grid > div {
  min-width: 0;
}

.referral-booking-grid > .is-wide {
  grid-column: 1 / -1;
}

.referral-booking-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.referral-booking-grid dd {
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}

.referral-link-state {
  background: var(--acc-tint);
  border: 1px solid var(--acc-line);
  border-radius: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 650;
  padding: 9px 11px;
}

.referral-dismissed-state {
  align-items: center;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: var(--warning);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 11px;
}

.referral-dismissed-state > div {
  display: grid;
  gap: 2px;
}

.referral-dismissed-state strong {
  color: #5f3a00;
}

.referral-job-match {
  flex: 1 1 100%;
}

.referral-job-match summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 12px 0;
}

.referral-job-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  margin-top: 8px;
  max-height: 310px;
  overflow-y: auto;
}

.referral-job-result {
  align-items: flex-start;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  text-align: left;
}

.referral-job-result:last-child {
  border-bottom: 0;
}

.referral-job-result:hover {
  background: var(--soft);
}

.referral-job-result span,
.referral-job-result small {
  color: var(--muted);
}

.referrals-error-state,
.referrals-placeholder {
  background: var(--soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
}

.referrals-error-state p,
.referrals-placeholder p {
  color: var(--muted);
}

.referrals-placeholder span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.referral-decision-dialog {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.referral-decision-dialog textarea {
  min-height: 110px;
  resize: vertical;
}

.referral-checkbox-row {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 10px;
}

.referral-checkbox-row input {
  margin-top: 3px;
}

@media (max-width: 900px) {
  .referral-booking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .referral-booking-card__header {
    display: grid;
  }

  .referral-booking-grid {
    grid-template-columns: 1fr;
  }

  .referral-booking-grid > .is-wide {
    grid-column: auto;
  }

  .referral-booking-actions > .btn {
    flex: 1 1 100%;
  }

  .referral-dismissed-state {
    align-items: stretch;
    flex-direction: column;
  }
}

/* TASK 342: sync recovery and reconciliation */
.referral-outbox-list,
.referral-reconciliation-list {
  display: grid;
  gap: 14px;
}

.referral-outbox-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--danger);
  border-radius: 10px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.referral-outbox-card.is-review {
  border-left-color: #d97706;
}

.referral-outbox-card.is-active {
  border-left-color: #2563eb;
}

.referral-outbox-card.is-stale {
  background: #fff7f7;
}

.referral-sync-heartbeat {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.referral-sync-heartbeat.is-missing,
.referral-sync-stale-warning {
  background: #fff4e5;
  border-color: #f59e0b;
  color: #9a3412;
}

.referral-sync-heartbeat span,
.referral-sync-progress-hint,
.referral-sync-stale-warning {
  font-size: 13px;
}

.referral-sync-stale-warning,
.referral-sync-progress-hint {
  border-radius: 8px;
  padding: 10px 12px;
}

.referral-sync-progress-hint {
  background: #eff6ff;
  color: #1d4ed8;
}

.referral-outbox-card > header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.referral-outbox-card h3 {
  font-size: 15px;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.referral-outbox-detail {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.referral-outbox-detail summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 12px 0;
}

.referral-outbox-detail pre {
  background: #111827;
  border-radius: 8px;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  margin: 6px 0 12px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.referral-review-hint {
  align-items: center;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #92400e;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.referral-reconciliation {
  display: grid;
  gap: 16px;
}

.referral-reconciliation__toolbar {
  align-items: flex-start;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px;
}

.referral-reconciliation__toolbar h3,
.referral-reconciliation__toolbar p {
  margin: 0;
}

.referral-reconciliation__toolbar p {
  color: var(--muted);
  margin-top: 5px;
}

.referral-reconciliation__summary {
  background: var(--acc-tint);
  border: 1px solid var(--acc-line);
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 650;
  padding: 10px 12px;
}

.referral-reconciliation-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 14px;
  padding: 18px;
}

.referral-reconciliation-card__match {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.referral-reconciliation-card__match.is-verified {
  color: var(--primary);
}

.referral-reconciliation-card__match.is-mismatch {
  color: var(--danger);
}

.referral-reconciliation-pair {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.referral-reconciliation-pair > section {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
  padding: 14px;
}

.referral-reconciliation-pair > section > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.referral-reconciliation-pair h3,
.referral-reconciliation-pair p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.referral-reconciliation-pair p {
  color: var(--muted);
  font-size: 13px;
}

.referral-reconciliation-pair dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.referral-reconciliation-pair dt {
  color: var(--muted);
  font-size: 11px;
}

.referral-reconciliation-pair dd {
  margin: 2px 0 0;
}

.referral-reconciliation-pair__arrow {
  align-self: center;
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.referral-reconciliation-card .referral-booking-actions small {
  color: var(--muted);
  flex: 1 1 100%;
}

@media (max-width: 760px) {
  .referral-reconciliation__toolbar,
  .referral-reconciliation-pair {
    display: grid;
    grid-template-columns: 1fr;
  }

  .referral-reconciliation-pair__arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}

.calendar-time-range-layout {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .calendar-time-range-layout {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }
}

:is(.calendar-card__time, .schedule-card__time).is-customer-requested-time {
  background: #dc2626;
  border-radius: 5px;
  color: #ffffff;
  padding: 2px 5px;
}

/* TASK 403: keep the shared appointment time controls usable inside half-width form cards. */
:is(.calendar-time-range-field) {
  container-name: calendar-time-range;
  container-type: inline-size;
  grid-column: 1 / -1;
}

@container calendar-time-range (max-width: 360px) {
  :is(.calendar-time-range-layout) {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Collections priority-source rows stay visible through hover and sticky edge cells. */
.collections-table tbody tr:is(.collections-row--priority-source) > td,
.collections-table tbody tr:is(.collections-row--priority-source):hover > td,
.collections-table tbody tr:is(.collections-row--priority-source):hover > td:first-child,
.collections-table tbody tr:is(.collections-row--priority-source):hover > td:last-child {
  background: #fff8dc;
}

@media screen and (max-width: 720px) {
  :is(.collections-filters) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.metric-card strong.is-danger {
  color: var(--danger);
}

/* TASK 481 technician portal */
.technician-portal {
  --tech-ink: #123c3a;
  --tech-deep: #0d2f2d;
  --tech-accent: #e87524;
  --tech-paper: #f5f1e8;
  --tech-line: #d7d1c5;
  background: var(--tech-paper);
  color: #173230;
  min-height: 100vh;
}

.technician-portal__header {
  align-items: flex-start;
  background: var(--tech-deep);
  border-bottom: 5px solid var(--tech-accent);
  color: #ffffff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 18px 18px;
}

.technician-portal__eyebrow {
  color: #f7ad6f !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin: 0 0 5px !important;
}

.technician-portal__header h1 {
  color: #ffffff;
  font-size: clamp(25px, 7vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0;
}

.technician-portal__header h1 span {
  color: #b9d4d1;
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0;
}

.technician-portal__header p {
  color: #b9d4d1;
  font-size: 12px;
  margin: 7px 0 0;
}

.technician-portal__header-actions {
  display: grid;
  gap: 8px;
}

.technician-portal__icon-btn {
  background: transparent;
  border: 1px solid #527573;
  border-radius: 7px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  min-height: 42px;
  padding: 8px 10px;
  white-space: nowrap;
}

.technician-portal__icon-btn:hover,
.technician-portal__icon-btn:focus-visible {
  background: #174946;
  border-color: #f7ad6f;
  outline: 0;
}

.technician-portal__content {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 780px;
  padding: 18px 12px 44px;
}

.technician-portal__state {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--tech-line);
  border-radius: 10px;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 190px;
  padding: 28px;
  text-align: center;
}

.technician-portal__state span {
  color: #687875;
  font-size: 13px;
}

.technician-portal__state--error {
  border-top: 5px solid #b33b32;
}

.technician-portal__spinner {
  animation: technician-spinner 0.8s linear infinite;
  border: 3px solid #d7e3e1;
  border-radius: 50%;
  border-top-color: var(--tech-accent);
  height: 30px;
  width: 30px;
}

@keyframes technician-spinner {
  to { transform: rotate(360deg); }
}

.technician-day {
  display: grid;
  gap: 10px;
}

.technician-day__header,
.technician-history > header {
  align-items: center;
  border-bottom: 2px solid var(--tech-ink);
  display: flex;
  justify-content: space-between;
  padding: 0 2px 8px;
}

.technician-day__header > div,
.technician-history > header > div {
  display: grid;
  gap: 2px;
}

.technician-day__header span,
.technician-history > header span {
  color: var(--tech-deep);
  font-size: 17px;
  font-weight: 900;
}

.technician-day__header small,
.technician-history > header small {
  color: #697975;
  font-size: 11px;
}

.technician-day__header > strong,
.technician-history > header > strong {
  align-items: center;
  background: var(--tech-ink);
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  font-size: 13px;
  height: 30px;
  justify-content: center;
  min-width: 30px;
}

.technician-day--overdue .technician-day__header {
  border-color: #b33b32;
}

.technician-day--overdue .technician-day__header > strong {
  background: #b33b32;
}

.technician-day__jobs {
  display: grid;
  gap: 11px;
}

.technician-day__empty {
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed #c8c1b5;
  border-radius: 8px;
  color: #74817e;
  font-size: 13px;
  margin: 0;
  padding: 18px;
  text-align: center;
}

.technician-job-card {
  background: #ffffff;
  border: 1px solid var(--tech-line);
  border-left: 5px solid var(--tech-accent);
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(22, 49, 46, 0.08);
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 15px;
}

.technician-job-card.is-complete {
  border-left-color: #388b72;
  opacity: 0.82;
}

.technician-job-card__topline {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.technician-job-card__topline > span {
  color: #71807d;
  font-size: 11px;
  font-weight: 800;
}

.technician-job-card__time {
  background: var(--tech-deep);
  border-radius: 5px;
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 7px 9px;
}

.technician-job-card h2 {
  color: #132e2c;
  font-size: 21px;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.technician-job-card__address,
.technician-job-card__phone {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 10px;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 11px;
  text-decoration: none;
}

.technician-job-card__address {
  background: #eaf2f0;
  color: var(--tech-deep);
}

.technician-job-card__phone {
  background: #f5eee4;
  color: #7e3b0d;
}

.technician-job-card__address span,
.technician-job-card__phone span {
  flex: 0 0 auto;
  font-size: 11px;
  text-transform: uppercase;
}

.technician-job-card__details {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.technician-job-card__details > div {
  border: 1px solid #e1ddd4;
  border-radius: 7px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.technician-job-card__details span,
.technician-job-card__note > span {
  color: #71807d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.technician-job-card__details strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.technician-job-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.technician-chip {
  background: #dcebe8;
  border-radius: 999px;
  color: #205a53;
  font-size: 10px;
  font-weight: 900;
  padding: 6px 8px;
}

.technician-chip--fix {
  background: #e9e1f3;
  color: #64468a;
}

.technician-chip--alert {
  background: #fae5c9;
  color: #9b4a0c;
}

.technician-job-card__note {
  background: #fff8de;
  border: 1px solid #ead89c;
  border-radius: 7px;
  padding: 11px;
}

.technician-job-card__note p {
  font-size: 14px;
  line-height: 1.45;
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.technician-job-card__submission {
  border-radius: 7px;
  display: grid;
  gap: 3px;
  padding: 11px;
}

.technician-job-card__submission strong {
  font-size: 13px;
}

.technician-job-card__submission span {
  font-size: 11px;
}

.technician-job-card__submission.is-waiting {
  background: #fff0dc;
  color: #8b470f;
}

.technician-job-card__submission.is-applied {
  background: #dff0e8;
  color: #23644f;
}

.technician-job-card__submission.is-returned {
  background: #f9e2df;
  color: #96372e;
}

.technician-job-card__complete {
  background: var(--tech-accent);
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  min-height: 50px;
  padding: 11px 16px;
  width: 100%;
}

.technician-job-card__complete:hover,
.technician-job-card__complete:focus-visible {
  background: #c65d16;
  outline: 3px solid rgba(232, 117, 36, 0.25);
}

.technician-completion {
  inset: 0;
  position: fixed;
  z-index: 1500;
}

.technician-completion__backdrop {
  background: rgba(6, 24, 23, 0.67);
  inset: 0;
  position: absolute;
}

.technician-completion__sheet {
  background: #ffffff;
  border-radius: 14px 14px 0 0;
  bottom: 0;
  box-shadow: 0 -15px 40px rgba(7, 34, 32, 0.22);
  display: grid;
  gap: 15px;
  left: 0;
  max-height: 92vh;
  overflow-y: auto;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  position: absolute;
  right: 0;
}

.technician-completion__handle {
  background: #ccd4d2;
  border-radius: 999px;
  height: 4px;
  justify-self: center;
  width: 46px;
}

.technician-completion__sheet > header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.technician-completion__sheet > header p {
  color: #a65317;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.technician-completion__sheet > header h2 {
  color: var(--tech-deep);
  font-size: 21px;
  margin: 0;
}

.technician-completion__sheet > header button {
  background: #edf1f0;
  border: 0;
  border-radius: 50%;
  color: var(--tech-deep);
  font-size: 25px;
  height: 42px;
  width: 42px;
}

.technician-completion__sheet label {
  display: grid;
  gap: 6px;
}

.technician-completion__sheet label > span {
  color: #344e4b;
  font-size: 12px;
  font-weight: 850;
}

.technician-completion__sheet input,
.technician-completion__sheet select,
.technician-completion__sheet textarea {
  border: 1px solid #aebbb8;
  border-radius: 7px;
  color: #183633;
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  padding: 10px;
  width: 100%;
}

.technician-completion__sheet textarea {
  min-height: 84px;
  resize: vertical;
}

.technician-completion__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.technician-completion__money {
  align-items: center;
  border: 1px solid #aebbb8;
  border-radius: 7px;
  display: flex;
  min-height: 48px;
}

.technician-completion__money b {
  padding-left: 11px;
}

.technician-completion__money input {
  border: 0;
  min-width: 0;
}

.technician-completion__free-fix {
  background: #e8dff3;
  border: 2px solid #7652a0;
  border-radius: 8px;
  grid-template-columns: 28px 1fr;
  padding: 12px;
}

.technician-completion__free-fix input {
  height: 24px;
  margin: 0;
  min-height: 24px;
  width: 24px;
}

.technician-completion__free-fix span {
  display: grid;
  gap: 2px;
}

.technician-completion__free-fix strong {
  color: #56377b;
  font-size: 14px;
}

.technician-completion__free-fix small {
  color: #725a8e;
  font-size: 11px;
}

.technician-completion__error {
  background: #fbe5e2;
  border-left: 4px solid #b33b32;
  color: #8f3028;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
  padding: 10px;
}

.technician-completion__actions {
  display: grid;
  gap: 9px;
  grid-template-columns: 0.8fr 1.2fr;
}

.technician-completion__actions .btn {
  min-height: 50px;
}

.technician-history {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.technician-history__list {
  background: #ffffff;
  border: 1px solid var(--tech-line);
  border-radius: 8px;
  overflow: hidden;
}

.technician-history__list article {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.technician-history__list article + article {
  border-top: 1px solid #e3dfd7;
}

.technician-history__list article > div {
  display: grid;
  gap: 3px;
}

.technician-history__list article > div:last-child {
  text-align: right;
}

.technician-history__list strong {
  font-size: 12px;
}

.technician-history__list span {
  color: #71807d;
  font-size: 10px;
}

@media (min-width: 680px) {
  .technician-portal__header {
    padding: 24px max(24px, calc((100vw - 780px) / 2));
  }

  .technician-portal__content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .technician-completion__sheet {
    border-radius: 14px;
    bottom: 24px;
    left: 50%;
    max-width: 620px;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 36px);
  }
}

@media (max-width: 460px) {
  .technician-portal__header {
    align-items: stretch;
    display: grid;
  }

  .technician-portal__header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .technician-job-card__details,
  .technician-completion__grid {
    grid-template-columns: 1fr;
  }
}.metric-card--link {
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.metric-card--link:hover,
.metric-card--link:focus-visible {
  border-color: #0f766e;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

/* TASK 485 office technician-submission queue */
.technician-submissions-page {
  --submission-ink: #18312f;
  --submission-line: #d8e3e1;
  --submission-soft: #f4f8f7;
}

.technician-submissions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--submission-line);
  border-radius: 10px;
  background: var(--submission-soft);
}

.technician-submissions-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.technician-submissions-toolbar strong {
  color: #b42318;
  font-size: 1.6rem;
}

.technician-submissions-list {
  display: grid;
  gap: 14px;
}

.technician-submission-card {
  overflow: hidden;
  border: 1px solid var(--submission-line);
  border-left: 5px solid #64748b;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 54, 51, 0.06);
}

.technician-submission-card.status-submitted,
.technician-submission-card.status-review_required,
.technician-submission-card.status-failed {
  border-left-color: #b42318;
}

.technician-submission-card.status-claimed,
.technician-submission-card.status-processing {
  border-left-color: #d97706;
}

.technician-submission-card.status-applied {
  border-left-color: #15803d;
}

.technician-submission-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--submission-line);
  background: #fbfdfc;
}

.technician-submission-card__header > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.technician-submission-card__header small,
.technician-submission-card__technician {
  color: #667773;
}

.technician-submission-card__technician {
  font-weight: 700;
}

.technician-submission-card__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 15px 0;
}

.technician-submission-card__flags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4e5;
  color: #9a4d00;
  font-size: 0.76rem;
  font-weight: 700;
}

.technician-submission-card__flags span.is-danger {
  background: #fff0ef;
  color: #b42318;
}

.technician-submission-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  background: var(--submission-line);
  border-top: 1px solid var(--submission-line);
  border-bottom: 1px solid var(--submission-line);
}

.technician-submission-compare > section {
  min-width: 0;
  padding: 13px 15px;
  background: #fff;
}

.technician-submission-compare h3 {
  margin: 0 0 10px;
  color: var(--submission-ink);
  font-size: 0.88rem;
}

.technician-submission-reported {
  background: #f5faf8 !important;
}

.technician-submission-detail {
  display: grid;
  grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  gap: 9px;
  padding: 5px 0;
}

.technician-submission-detail span {
  color: #71807d;
  font-size: 0.76rem;
}

.technician-submission-detail strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #263a37;
  font-size: 0.8rem;
}

.technician-submission-message {
  margin: 11px 15px 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: #eef5f3;
  color: #36514d;
  font-size: 0.82rem;
}

.technician-submission-message.is-warning {
  background: #fff4e5;
  color: #8a4500;
}

.technician-submission-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 15px;
}

.technician-submission-return {
  display: flex;
  flex: 1 1 360px;
  justify-content: flex-end;
  gap: 8px;
}

.technician-submission-return input {
  width: min(360px, 100%);
}

@media (max-width: 980px) {
  .technician-submission-compare {
    grid-template-columns: 1fr;
  }

  .technician-submission-return {
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .technician-submission-card__header,
  .technician-submissions-toolbar,
  .technician-submission-return {
    align-items: stretch;
    flex-direction: column;
  }

  .technician-submission-actions .btn,
  .technician-submission-return input {
    width: 100%;
    min-height: 46px;
  }

  .technician-submission-detail {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* TASK 503 unified compact CRM workspace */
:root {
  --crm-control-height: 38px;
  --crm-toolbar-gap: 8px;
  --crm-date-width: 158px;
  --crm-select-width: 176px;
  --crm-search-action-width: 66px;
}

.app-shell {
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

.main {
  padding: 18px 20px 22px;
}

.workspace-topbar {
  gap: 0;
  margin-bottom: 12px;
}

.workspace-topbar__header {
  min-height: 52px;
}

.workspace-topbar__header > div:first-child {
  min-width: 0;
}

.workspace-topbar h1 {
  font-size: 24px;
  letter-spacing: -0.35px;
  margin-bottom: 3px;
}

.workspace-topbar p {
  font-size: 13px;
  line-height: 1.35;
}

.flow-chip {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  box-shadow: none;
  font-size: 12px;
  gap: 6px;
  padding: 7px 10px;
}

.flow-chip span + span::before {
  margin-right: 6px;
}

.content-region {
  gap: 12px;
}

.content-region > .panel + .panel {
  margin-top: 0;
}

.panel {
  border-radius: 11px;
  box-shadow: var(--shadow-card);
  padding: 12px;
}

.page-primary-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
  min-height: 0;
}

.page-primary-actions:empty {
  display: none;
}

.btn {
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.2;
  min-height: var(--crm-control-height);
  min-width: var(--crm-control-height);
  padding: 7px 11px;
}

.btn.small {
  min-height: 34px;
  min-width: 34px;
  padding: 5px 9px;
}

.content-region > .panel > .notice {
  font-size: 13px;
  margin: 8px 0;
  padding: 9px 11px;
}

.explicit-search-control {
  gap: 6px;
  grid-template-columns: var(--crm-search-action-width) minmax(220px, 1fr) var(--crm-search-action-width);
}

.explicit-search-control .btn {
  font-size: 13px;
  min-height: var(--crm-control-height);
  padding-inline: 7px;
  width: var(--crm-search-action-width);
}

:is(.jobs-filters, .reminders-filters, .communications-filters, .calendar-toolbar, .recurring-due-toolbar) {
  gap: var(--crm-toolbar-gap);
}

:is(.jobs-filters, .reminders-filters, .communications-filters, .calendar-toolbar, .recurring-due-toolbar)
  :is(input:not([type="checkbox"]):not([type="radio"]), select) {
  border-color: var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  min-height: var(--crm-control-height);
  padding: 7px 9px;
}

:is(.jobs-filter-field, .calendar-tool-field, .datebase-filters > label, .communications-filters > label, .recurring-due-toolbar > label) > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.list-summary-bar {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 7px 16px;
  margin: 8px 0;
  min-height: 38px;
  padding: 7px 11px;
}

.list-summary-bar strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.list-summary-bar.datebase-summary {
  display: flex;
  margin: 8px 0;
}

.list-summary-bar.datebase-summary strong,
.list-summary-bar.datebase-summary span {
  font-size: 12px;
}

[data-datebase-primary-filters],
[data-jobs-primary-filters] {
  align-items: end;
  grid-template-columns: minmax(420px, 1fr) var(--crm-date-width) var(--crm-date-width) minmax(176px, 196px);
  margin: 8px 0 5px;
}

[data-datebase-primary-filters] > [data-filter-slot="search"],
[data-jobs-primary-filters] > [data-filter-slot="search"] {
  min-width: 0;
}

[data-filter-slot="date-range"] {
  display: grid;
  gap: 4px;
  min-width: 0;
}

[data-filter-slot="record-limit"] {
  min-width: 176px;
}

.datebase-filters-panel.datebase-more-filters {
  margin: 8px 0 10px;
}

.datebase-filters-panel > summary,
.datebase-more-filters > summary {
  font-size: 12px;
}

.datebase-more-filters > .datebase-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.datebase-more-filters > .datebase-filters > :is(select, label) {
  flex: 1 1 150px;
  max-width: 220px;
  min-width: 145px;
}

.datebase-more-filters > .datebase-filters > .btn {
  align-self: end;
}

.billing-primary-filters {
  grid-template-columns: minmax(360px, var(--crm-search-width)) repeat(2, var(--crm-select-width));
  justify-content: start;
  margin: 8px 0 5px;
}

.billing-secondary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.billing-secondary-filters > select {
  flex: 0 1 var(--crm-select-width);
  max-width: var(--crm-select-width);
  min-width: 138px;
}

@media (max-width: 760px) {
  .billing-primary-filters,
  .billing-secondary-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .billing-secondary-filters > select {
    max-width: none;
    width: 100%;
  }
}

.calendar-summary,
.jobs-summary {
  gap: 8px;
  margin: 8px 0;
}

.calendar-summary div,
.jobs-summary div {
  border-radius: 8px;
  gap: 2px;
  min-height: 58px;
  padding: 8px 10px;
}

.calendar-summary strong,
.jobs-summary strong {
  font-size: 20px;
}

.calendar-toolbar-presets {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 7px 0 4px;
}

.calendar-toolbar-presets > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.calendar-range-buttons {
  gap: 6px;
}

.calendar-range-buttons .btn {
  min-height: 34px;
  padding: 5px 10px;
}

.calendar-toolbar {
  align-items: end;
  grid-template-columns: var(--crm-date-width) minmax(420px, 1fr) 180px 160px max-content 150px 72px;
  margin: 5px 0 8px;
}

.calendar-tool-search-control {
  align-items: end;
}

.calendar-tool-search-control > .btn {
  align-self: end;
}

.calendar-check {
  gap: 6px;
  min-height: var(--crm-control-height);
  white-space: nowrap;
}

.calendar-check input {
  height: 18px;
  width: 18px;
}

:is(.reminders-filters, .communications-filters, .finance-filters) {
  align-items: end;
  grid-template-columns: minmax(420px, 2fr) repeat(auto-fit, minmax(145px, 1fr));
  margin: 8px 0 10px;
}

.reminders-quick-filters {
  gap: 6px;
  margin-top: 6px;
}

.recurring-due-toolbar {
  align-items: end;
  grid-template-columns: repeat(4, minmax(145px, 180px)) max-content max-content minmax(170px, 1fr);
  margin: 0 0 9px;
}

.report-hub-workflow {
  display: grid;
  gap: 10px;
}

.report-hub-section {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
}

.report-hub-section__heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  padding-bottom: 8px;
}

.report-hub-section__heading h2 {
  font-size: 15px;
  margin: 0;
}

.report-hub-section__heading p {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0;
}

.report-hub-section .pesticide-notice-filters {
  grid-template-columns: minmax(420px, 1fr) minmax(155px, 190px) minmax(145px, 170px);
  margin: 0;
}

.report-hub-section--create .pesticide-notice-filters {
  grid-template-columns: minmax(420px, 1fr) minmax(160px, auto);
}

.report-hub-section [data-report-record-results]:not(:empty) {
  margin-top: 8px;
}

.form-modal:has(.finance-payment-dialog) {
  align-items: center;
}

.form-modal__panel:has([data-form-anchor^="finance-payment-"]) {
  padding: 0;
  width: min(520px, 94vw);
}

.finance-payment-dialog {
  display: grid;
}

.finance-payment-dialog__header {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 14px 16px 12px;
}

.finance-payment-dialog__header h2 {
  font-size: 18px;
}

.finance-payment-dialog__header p {
  font-size: 12px;
}

.modal-close-button {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-size: 22px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.modal-close-button:hover {
  background: #e4e9ef;
  color: var(--text);
}

.finance-payment-dialog__body {
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 14px 16px;
}

.finance-payment-grid {
  align-items: end;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-payment-grid .field {
  display: grid;
  gap: 5px;
  grid-template-rows: minmax(30px, auto) var(--crm-control-height);
}

.finance-payment-grid .field > span {
  align-items: end;
  display: flex;
  font-size: 12px;
  line-height: 1.25;
}

.finance-payment-grid select {
  min-height: var(--crm-control-height);
  width: 100%;
}

.finance-payment-dialog__actions {
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 11px 16px 14px;
}

.finance-payment-dialog__actions.form-modal__action-bar {
  box-shadow: none;
  margin: 0;
  position: static;
}

@media (max-width: 1500px) {
  .calendar-toolbar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .calendar-tool-search-control {
    grid-column: span 3;
  }
}

@media (max-width: 1280px) {
  [data-datebase-primary-filters],
  [data-jobs-primary-filters] {
    grid-template-columns: var(--crm-date-width) var(--crm-date-width) minmax(176px, 220px) minmax(0, 1fr);
  }

  [data-datebase-primary-filters] > [data-filter-slot="search"],
  [data-jobs-primary-filters] > [data-filter-slot="search"] {
    grid-column: 1 / -1;
  }

  :is(.reminders-filters, .communications-filters, .finance-filters) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(.reminders-filters, .communications-filters) > .explicit-search-control {
    grid-column: 1 / -1;
  }

  .calendar-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .calendar-tool-search-control {
    grid-column: 1 / -1;
  }

  .recurring-due-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-hub-section .pesticide-notice-filters,
  .report-hub-section--create .pesticide-notice-filters {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) minmax(145px, 170px);
  }

  .report-hub-section .pesticide-notice-filters > .explicit-search-control,
  .report-hub-section--create .pesticide-notice-filters > .explicit-search-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root {
    --crm-control-height: 40px;
    --crm-search-action-width: 58px;
  }

  .main {
    padding: 12px;
  }

  .workspace-topbar {
    margin-bottom: 9px;
  }

  .workspace-topbar h1 {
    font-size: 21px;
  }

  .flow-chip {
    display: none;
  }

  .panel {
    padding: 10px;
  }

  .explicit-search-control {
    grid-template-columns: var(--crm-search-action-width) minmax(0, 1fr) var(--crm-search-action-width);
  }

  [data-datebase-primary-filters],
  [data-jobs-primary-filters],
  :is(.reminders-filters, .communications-filters, .finance-filters),
  .calendar-toolbar,
  .recurring-due-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-datebase-primary-filters] > [data-filter-slot="search"],
  [data-jobs-primary-filters] > [data-filter-slot="search"],
  :is(.reminders-filters, .communications-filters) > .explicit-search-control,
  .calendar-tool-search-control {
    grid-column: 1 / -1;
  }

  [data-filter-slot="record-limit"] {
    grid-column: 1 / -1;
  }

  .calendar-toolbar-presets {
    align-items: flex-start;
  }

  .calendar-toolbar-presets > span {
    flex-basis: 100%;
  }

  .report-hub-section .pesticide-notice-filters,
  .report-hub-section--create .pesticide-notice-filters {
    grid-template-columns: 1fr;
  }

  .report-hub-section .pesticide-notice-filters > .explicit-search-control,
  .report-hub-section--create .pesticide-notice-filters > .explicit-search-control {
    grid-column: auto;
  }

  .finance-payment-grid {
    grid-template-columns: 1fr;
  }

  .finance-payment-grid .field {
    grid-template-rows: auto var(--crm-control-height);
  }
}

@media (pointer: coarse) {
  .app-shell .btn,
  .app-shell :is(.jobs-filters, .reminders-filters, .communications-filters, .calendar-toolbar, .recurring-due-toolbar)
    :is(input:not([type="checkbox"]):not([type="radio"]), select) {
    min-height: 42px;
  }

  .table-edge-mode-control .table-density-control__option {
    min-height: 42px;
    min-width: 42px;
  }
}
/* TASK 503 remaining workspace controls */
.app-shell {
  grid-template-columns: 218px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 12px;
}

.brand {
  margin-bottom: 18px;
  padding-inline: 4px;
}

.nav {
  gap: 4px;
}

.nav a,
.nav button {
  border-radius: 7px;
  font-size: 14px;
  min-height: 40px;
  padding: 8px 10px;
}

.app-shell .appt-saas {
  font-family: inherit;
}

.table-density-control {
  gap: 6px;
}

.table-density-control__label {
  font-size: 11px;
}

.table-density-control__options {
  padding: 2px;
}

.table-density-control__option {
  font-size: 11px;
  min-height: 32px;
  min-width: 38px;
  padding: 4px 8px;
}

.collections-filters {
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 190px));
  margin: 8px 0 10px;
}

.collections-filters label {
  gap: 4px;
}

.collections-filters label > span {
  font-size: 11px;
  font-weight: 750;
}

.collections-filters select {
  border-color: var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  min-height: var(--crm-control-height);
  padding: 7px 9px;
}

.technician-submissions-toolbar {
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.technician-submissions-toolbar strong {
  font-size: 20px;
}

.technician-submissions-toolbar p {
  font-size: 13px;
  margin: 0;
}

@media (max-width: 1280px) and (min-width: 981px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .main {
    padding-inline: 14px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

/* TASK 504 iPad-safe compact filters and tables */
:root {
  --crm-date-width: 150px;
  --crm-select-width: 154px;
  --crm-search-width: 520px;
}

.explicit-search-control {
  grid-template-columns: var(--crm-search-action-width) minmax(0, 1fr) var(--crm-search-action-width);
  max-width: 100%;
  width: min(var(--crm-search-width), 100%);
}

[data-datebase-primary-filters],
[data-jobs-primary-filters] {
  grid-template-columns: minmax(360px, var(--crm-search-width)) var(--crm-date-width) var(--crm-date-width) var(--crm-select-width);
  justify-content: start;
}

[data-filter-slot="record-limit"] {
  min-width: 0;
  width: var(--crm-select-width);
}

[data-datebase-primary-filters] > [data-filter-slot="record-limit"],
[data-jobs-primary-filters] > [data-filter-slot="record-limit"] {
  width: var(--crm-select-width);
}

[data-filter-slot="date-range"] input[type="date"],
.calendar-tool-field input[type="date"],
.finance-filters input[type="date"] {
  appearance: auto;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  -webkit-appearance: auto;
}

:is(
  [data-filter-slot="date-range"] input[type="date"],
  .calendar-tool-field input[type="date"],
  .finance-filters input[type="date"]
)::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

:is(
  [data-filter-slot="date-range"] input[type="date"],
  .calendar-tool-field input[type="date"],
  .finance-filters input[type="date"]
)::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 2px;
}

.datebase-more-filters > .datebase-filters > :is(select, label) {
  flex: 0 1 var(--crm-select-width);
  max-width: var(--crm-select-width);
  min-width: 138px;
}

.calendar-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: var(--crm-date-width) minmax(360px, var(--crm-search-width)) var(--crm-select-width) var(--crm-select-width) max-content 140px 72px;
  justify-content: flex-start;
}

.calendar-toolbar > .calendar-tool-field {
  flex: 0 0 var(--crm-select-width);
  width: var(--crm-select-width);
}

.calendar-toolbar > .calendar-tool-field:first-child {
  flex-basis: var(--crm-date-width);
  width: var(--crm-date-width);
}

.calendar-toolbar > .calendar-tool-search-control {
  flex: 0 1 var(--crm-search-width);
  min-width: min(360px, 100%);
  width: var(--crm-search-width);
}

.calendar-toolbar > :is(.calendar-check, .btn) {
  flex: 0 0 auto;
}

:is(.reminders-filters, .communications-filters) {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: minmax(360px, var(--crm-search-width)) repeat(auto-fit, minmax(138px, var(--crm-select-width)));
  justify-content: flex-start;
}

:is(.reminders-filters, .communications-filters) > .explicit-search-control {
  flex: 0 1 var(--crm-search-width);
  grid-column: auto;
  min-width: min(360px, 100%);
}

:is(.reminders-filters, .communications-filters) > :is(select, label) {
  flex: 0 0 var(--crm-select-width);
  width: var(--crm-select-width);
}

:is(.reminders-filters, .communications-filters) > .btn {
  flex: 0 0 auto;
}

.finance-filters,
.collections-filters {
  grid-template-columns: repeat(auto-fit, minmax(138px, var(--crm-select-width)));
  justify-content: start;
}

.recurring-due-toolbar {
  grid-template-columns: repeat(4, var(--crm-select-width)) max-content max-content minmax(170px, 280px);
  justify-content: start;
}

.report-hub-section .pesticide-notice-filters {
  grid-template-columns: minmax(360px, var(--crm-search-width)) var(--crm-select-width) var(--crm-select-width);
  justify-content: start;
}

.report-hub-section--create .pesticide-notice-filters {
  grid-template-columns: minmax(360px, var(--crm-search-width)) max-content;
}

.report-hub-section .pesticide-notice-filters > .explicit-search-control,
.report-hub-section--create .pesticide-notice-filters > .explicit-search-control {
  grid-column: auto;
}

.table-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.table-truncate[role="button"] {
  cursor: zoom-in;
  touch-action: manipulation;
}

.table-truncate[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.table-truncate.is-expanded {
  background: var(--surface, #ffffff);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  cursor: zoom-out;
  max-width: min(68vw, 680px) !important;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 2px 4px;
  position: relative;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  z-index: 3;
}

td.table-truncate-expanded {
  max-width: min(68vw, 680px) !important;
  overflow: visible !important;
  white-space: normal !important;
}

.table-customer-name {
  max-width: 20ch;
}

.commercial-address {
  color: #b42318 !important;
}

.table-address {
  max-width: 34ch;
}

.table-service-type {
  max-width: 15ch;
}

.table-message {
  max-width: 28ch;
}

.price-breakdown-grid {
  display: grid;
  gap: 1px;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
}

.price-breakdown-grid > span {
  display: block;
}

body[data-table-density="compact"] :is(
  .datebase-table,
  .jobs-table,
  .reminders-table,
  .communications-table,
  .customer-jobs-table,
  .recurring-due-table
) :is(th, td) {
  font-size: 12px;
  line-height: 1.3;
  padding: 7px 8px;
}

.datebase-table {
  min-width: 1120px;
}

.datebase-table.is-full {
  min-width: 1600px;
}

.jobs-table {
  min-width: 1240px;
}

.reminders-table {
  min-width: 1320px;
}

.communications-table {
  min-width: 1540px;
}

.datebase-table td[data-datebase-column="address"],
.jobs-table td[data-jobs-column="address"] {
  max-width: 34ch;
}

.datebase-table td[data-datebase-column="customerName"],
.jobs-table td[data-jobs-column="customerName"] {
  max-width: 21ch;
}

.datebase-table td[data-datebase-column="customerName"] strong.table-customer-name {
  max-width: 20ch;
}

.datebase-table td[data-datebase-column="serviceType"],
.jobs-table td[data-jobs-column="serviceType"] {
  max-width: 15ch;
  white-space: nowrap;
}

.datebase-table td[data-datebase-column="price"],
.jobs-table td[data-jobs-column="price"] {
  min-width: 190px;
}

.billing-table .billing-customer-name-line,
.billing-table .billing-address-line {
  max-width: 30ch;
}

.recurring-due-customer-cell strong {
  max-width: 20ch;
}

.recurring-due-table td[data-recurring-column="price"] {
  min-width: 190px;
}

@media (max-width: 1500px) and (min-width: 721px) {
  .calendar-toolbar {
    grid-template-columns: var(--crm-date-width) minmax(360px, var(--crm-search-width)) var(--crm-select-width);
  }

  .calendar-tool-search-control {
    grid-column: auto;
  }
}

@media (max-width: 1280px) and (min-width: 721px) {
  [data-datebase-primary-filters],
  [data-jobs-primary-filters] {
    grid-template-columns: minmax(360px, var(--crm-search-width)) var(--crm-date-width) var(--crm-date-width);
  }

  [data-datebase-primary-filters] > [data-filter-slot="search"],
  [data-jobs-primary-filters] > [data-filter-slot="search"] {
    grid-column: auto;
  }

  [data-filter-slot="record-limit"] {
    grid-column: 1;
    justify-self: start;
  }

  :is(.reminders-filters, .communications-filters) > .explicit-search-control {
    grid-column: auto;
  }

  .report-hub-section .pesticide-notice-filters,
  .report-hub-section--create .pesticide-notice-filters {
    grid-template-columns: minmax(360px, var(--crm-search-width)) var(--crm-select-width) var(--crm-select-width);
  }

  .report-hub-section .pesticide-notice-filters > .explicit-search-control,
  .report-hub-section--create .pesticide-notice-filters > .explicit-search-control {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .list-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .list-pagination > span {
    flex: 1 0 100%;
    order: -1;
    text-align: center;
  }

  .list-pagination > .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .explicit-search-control {
    width: 100%;
  }

  [data-datebase-primary-filters],
  [data-jobs-primary-filters],
  :is(.reminders-filters, .communications-filters, .finance-filters),
  .calendar-toolbar,
  .recurring-due-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-datebase-primary-filters] > [data-filter-slot="search"],
  [data-jobs-primary-filters] > [data-filter-slot="search"],
  :is(.reminders-filters, .communications-filters) > .explicit-search-control,
  .calendar-tool-search-control {
    grid-column: 1 / -1;
  }

  [data-filter-slot="record-limit"],
  [data-datebase-primary-filters] > [data-filter-slot="record-limit"],
  [data-jobs-primary-filters] > [data-filter-slot="record-limit"] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .report-hub-section .pesticide-notice-filters,
  .report-hub-section--create .pesticide-notice-filters {
    grid-template-columns: 1fr;
  }
}

/* 财报 Financial Reports (TASK 603, owner-only) */
.financial-reports {
  display: grid;
  gap: 18px;
}

.financial-reports__toolbar {
  display: grid;
  gap: 8px;
}

.financial-reports__range {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.financial-reports__range label {
  display: grid;
  gap: 4px;
}

.financial-reports__range label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.financial-reports__hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.financial-reports__state {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  padding: 18px;
}

.financial-reports__state--error {
  align-items: center;
  border-color: #f2b8b5;
  color: var(--danger);
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.financial-reports__cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.financial-reports__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.financial-reports__card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.financial-reports__card-value {
  color: var(--text);
  font-size: 22px;
}

.financial-reports__card-hint {
  color: var(--muted);
  font-size: 12px;
}

.financial-reports__section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.financial-reports__section h2 {
  font-size: 15px;
  margin: 0;
}

.financial-reports__empty {
  color: var(--muted);
  margin: 0;
}

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

.fr-table th,
.fr-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
}

.fr-table th {
  color: var(--muted);
  font-size: 12px;
}

.fr-table__month-start td {
  border-top: 2px solid var(--line-strong);
}

.fr-table__bar-col {
  min-width: 120px;
  width: 26%;
}

.fr-bar {
  background: var(--soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.fr-bar__fill {
  background: var(--primary);
  border-radius: 999px;
  height: 100%;
}

/* Dashboard 运营图表 (TASK 604) */
.dv-updated {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
}

.dv-state {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  padding: 16px;
}

.dv-state--error {
  align-items: center;
  border-color: #f2b8b5;
  color: var(--danger);
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.dv-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.dv-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
}

.dv-card__title {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  margin: 0;
}

.dv-card__subtitle {
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 6px;
}

.dv-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0;
}

.dv-trend-svg {
  display: block;
  width: 100%;
}

.dv-trend-labels {
  color: var(--muted);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  padding: 2px 6px 0;
}

.dv-card--gauge {
  align-items: center;
  text-align: center;
}

.dv-gauge-svg {
  display: block;
  margin-top: auto;
  max-width: 220px;
  width: 100%;
}

.dv-gauge-value {
  color: var(--text);
  font-size: 22px;
  font-weight: 750;
  margin: -4px 0 0;
}

.dv-gauge-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 auto;
}

.dv-donut-svg {
  align-self: center;
  display: block;
  max-width: 150px;
  width: 100%;
}

.dv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 8px;
}

.dv-legend span {
  align-items: center;
  color: var(--text-soft);
  display: inline-flex;
  font-size: 11px;
  gap: 4px;
}

.dv-legend i {
  border-radius: 2px;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.dv-legend--split {
  justify-content: space-between;
}

.dv-bars {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.dv-bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 74px minmax(0, 1fr) 44px;
}

.dv-bar-row__label {
  color: var(--text-soft);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dv-bar-row__track {
  background: var(--soft);
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.dv-bar-row__fill {
  border-radius: 999px;
  display: block;
  height: 100%;
}

.dv-bar-row__value {
  color: var(--text-soft);
  font-size: 12px;
  text-align: right;
}

.dv-split {
  border-radius: 6px;
  display: flex;
  height: 26px;
  margin-top: 18px;
  overflow: hidden;
}

.dv-card--split .dv-split {
  height: 34px;
  margin-top: auto;
}

.dv-card--split .dv-legend {
  margin-bottom: auto;
}

.dv-split__segment {
  align-items: center;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 1180px) {
  .dv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dv-grid {
    grid-template-columns: 1fr;
  }
}
