:root {
    --ink: #18211d;
    --muted: #68736d;
    --paper: #f3f5f2;
    --surface: #ffffff;
    --line: #dce2de;
    --forge: #c6472d;
    --forge-dark: #98331f;
    --green: #267557;
    --amber: #9c6a0b;
    --red: #a92f35;
    --shadow: 0 8px 28px rgba(28, 39, 33, 0.07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--forge-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.2rem; }

.site-header { min-height: 68px; display: flex; align-items: center; gap: 28px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); color: white; background: #18211d; }
.brand { display: flex; align-items: center; gap: 10px; color: white; font-size: 1.1rem; font-weight: 750; }
.brand:hover, .site-header nav a:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--forge); }
.site-header nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.site-header nav > a, .nav-group > summary { padding: 8px 10px; border-radius: 7px; }
.site-header nav a, .link-button { color: #edf1ee; }
.site-header nav > a.active, .nav-group.current-section > summary { color: #fff; background: #34423b; }
.nav-group { position: relative; }
.nav-group summary { color: #edf1ee; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { margin-left: 6px; color: #9daaa3; content: "▾"; font-size: .7rem; }
.nav-dropdown { position: absolute; z-index: 20; top: calc(100% + 14px); left: -12px; display: grid; min-width: 210px; padding: 8px; border: 1px solid #34423b; border-radius: 9px; background: #1e2a24; box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.nav-dropdown a { padding: 9px 10px; border-radius: 6px; white-space: nowrap; }
.nav-dropdown a:hover { background: #2b3932; }
.nav-dropdown a.active { color: #fff; background: #34423b; }
.logout-form { margin-left: auto; }
.link-button { padding: 0; border: 0; background: none; color: var(--forge-dark); font: inherit; cursor: pointer; }
.danger-link { color: var(--red); }

.page-shell { max-width: 1320px; margin: 0 auto; padding: 38px 24px 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin-bottom: 5px; color: var(--forge); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }

.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; }
.dashboard-metrics { grid-template-columns: repeat(4, 1fr); }
.metric { display: flex; flex-direction: column; padding: 20px; color: var(--ink); }
.metric:hover { border-color: #bdc8c1; text-decoration: none; }
.metric strong { font-size: 2rem; line-height: 1; }
.metric span { margin-top: 8px; color: var(--muted); }
.metric.warning strong { color: var(--amber); }
.metric.danger strong { color: var(--red); }
.report-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.review-banner { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding: 14px 18px; border: 1px solid #efce8a; border-radius: 10px; background: #fff8e8; }
.document-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; }
.document-panel h2 { word-break: break-word; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.quick-actions { align-self: start; padding: 22px; }
.quick-actions .button { display: block; margin-top: 10px; text-align: center; }
.top-quick-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 16px 18px; }
.top-quick-actions h2 { margin: 0; }
.top-quick-actions .eyebrow { margin-bottom: 2px; }

.button { display: inline-block; padding: 10px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.button:hover { text-decoration: none; }
.button.primary { color: white; background: var(--forge); }
.button.primary:hover { background: var(--forge-dark); }
.filter-submit { min-height: 42px; padding-inline: 20px; box-shadow: 0 3px 9px rgba(152, 51, 31, .22); }
.button.secondary { border-color: var(--line); color: var(--ink); background: white; }
.button.danger { border-color: #dca8ac; color: var(--red); background: #fff5f5; }
.button.danger:hover { color: white; background: var(--red); }
.button-row { display: flex; align-items: center; gap: 10px; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #fafbf9; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.strong-link { font-weight: 750; }
.actions { display: flex; gap: 12px; white-space: nowrap; }
.empty-state { padding: 32px 22px; color: var(--muted); text-align: center; }

.badge { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 8px; border-radius: 999px; color: #4d5b53; background: #e9eeeb; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.badge.commercial-awaiting, .badge.status-outstanding { color: #775008; background: #fff0c8; }
.badge.commercial-completed, .badge.status-completed { color: #17583e; background: #def1e7; }
.badge.commercial-archived, .badge.status-archived { color: #59645e; background: #e9eeeb; }
.badge.commercial-neutral, .badge.neutral { color: #4f5a54; background: #eef1ef; }
.badge.completed, .badge.in_service { color: #17583e; background: #def1e7; }
.badge.out_of_service { color: #89252b; background: #f8e1e3; }
.badge.planned { color: #225a78; background: #e0f0f8; }
.badge.missed, .badge.overdue { color: #89252b; background: #f8e1e3; }
.badge.needs_review { color: #775008; background: #fff0c8; }
.badge.contract-active { color: #17583e; background: #def1e7; }
.badge.contract-inactive { color: #59645e; background: #e9eeeb; }
.badge.contract-upcoming { color: #225a78; background: #e0f0f8; }
.badge.contract-expired { color: #89252b; background: #f8e1e3; }
.badge.auto-renewal { color: #5d3b87; background: #eee5f8; }
.badge.confirmed { color: #17583e; background: #def1e7; }
.badge.awaiting { color: #775008; background: #fff0c8; }
.badge.assigned { color: #225a78; background: #e0f0f8; }
.badge.absence { color: #5d3b87; background: #eee5f8; }
.badge.night-call { color: #fff; background: #35405f; }
.badge.in_progress, .badge.approved { color: #225a78; background: #e0f0f8; }
.badge.outstanding, .badge.awaiting_work, .badge.awaiting_parts, .badge.awaiting_approval, .badge.contact_supplier, .badge.to_order, .badge.quoted, .badge.open, .badge.on_hold { color: #775008; background: #fff0c8; }
.badge.ordered { color: #225a78; background: #e0f0f8; }
.badge.delivered, .badge.booked_in { color: #17583e; background: #def1e7; }
.badge.awaiting_client { color: #775008; background: #fff0c8; }
.badge.actioned { color: #225a78; background: #e0f0f8; }
.badge.resolved { color: #17583e; background: #def1e7; }
.badge.no_action { color: #59645e; background: #e9eeeb; }
.badge.archived { color: #59645e; background: #e9eeeb; }
.badge.received, .badge.logged, .badge.assessing { color: #775008; background: #fff0c8; }
.badge.in_repair { color: #225a78; background: #e0f0f8; }
.badge.repaired, .badge.returned { color: #17583e; background: #def1e7; }
.badge.written_off, .badge.unrepairable { color: #89252b; background: #f8e1e3; }
.badge.report-sent { color: #17583e; background: #def1e7; }
.badge.report-unsent { color: #775008; background: #fff0c8; }
.badge.report-failed { color: #89252b; background: #f8e1e3; }
.badge.report-outdated { color: #775008; background: #fff0c8; }
.badge.report-type { color: #225a78; background: #e0f0f8; }
.report-register td:first-child { min-width: 210px; }
.report-register td:nth-child(2) { min-width: 220px; }
.report-delivery { min-width: 220px; }
.report-row-unsent .report-delivery, .report-row-outdated .report-delivery { border-left: 4px solid #d59a2e; background: #fffaf0; }
.report-row-failed .report-delivery { border-left: 4px solid var(--red); background: #fff5f5; }
.report-row-sent .report-delivery { border-left: 4px solid var(--green); background: #f2faf6; }
.report-error { display: inline-block; max-width: 300px; color: var(--red); }
.report-actions { flex-direction: column; align-items: stretch; min-width: 230px; }
.report-actions [hidden] { display: none !important; }
.report-actions form { margin: 0; width: 100%; }
.report-actions .button { width: 100%; white-space: nowrap; }
.client-email-destination, .client-email-missing { display: grid; gap: 2px; padding: 9px 10px; border-radius: 7px; background: #f4f6f4; font-size: .78rem; white-space: normal; }
.client-email-destination span, .client-email-missing span { color: var(--muted); }
.client-email-destination strong { overflow-wrap: anywhere; }
.client-email-missing { color: var(--red); background: #fff5f5; }
.client-email-inline-form { display: grid; gap: 8px; padding: 10px; border: 1px solid #edb3b6; border-radius: 9px; background: #fffafa; }
.client-email-inline-form label { display: grid; gap: 4px; color: var(--muted); font-size: .76rem; font-weight: 750; white-space: normal; }
.client-email-inline-form .form-control { min-width: 0; padding: 8px 9px; font-size: .82rem; }
.report-client-email-form { display: grid; gap: 5px; }
.report-client-email-form .save-state:not(:empty) { padding: 6px 8px; border-radius: 6px; background: #f4f6f4; white-space: normal; }
.report-email-notice { align-items: center; }
.report-filters label:first-of-type { max-width: none; }
.report-filters label:nth-of-type(2) { max-width: 280px; }
.repair-register td { min-width: 150px; }
.repair-register td:nth-child(2) { min-width: 280px; }
.renewal-note { color: var(--red); font-size: .78rem; font-weight: 750; }
.renewal-row td { background: #fff0f1; }
.renewal-row td:first-child { border-left: 5px solid var(--red); }
.renewal-flag { display: inline-block; margin-top: 5px; padding: 3px 8px; border-radius: 5px; color: white; background: var(--red); font-size: .76rem; font-weight: 800; }
.time-label { color: #244c61; font-weight: 750; white-space: nowrap; }
.anytime-label { color: var(--muted); font-size: .84rem; font-weight: 700; white-space: nowrap; }

.filter-bar { display: flex; align-items: end; gap: 14px; margin-bottom: 18px; padding: 16px; }
.filter-bar label { display: grid; flex: 1; gap: 5px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.compact-filter label { max-width: 620px; }
.schedule-filters { flex-wrap: wrap; }
.schedule-filters label:first-of-type { min-width: 220px; }
.schedule-filters label { min-width: 150px; }
.bulk-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-bottom: 12px; padding: 14px 16px; }
.bulk-toolbar > span { margin-right: auto; }
.bulk-toolbar .form-control { width: min(260px, 100%); }
.select-column { width: 42px; text-align: center; }
.select-column input { width: 17px; height: 17px; }
.assignment-form { display: flex; align-items: center; gap: 7px; }
.assignment-form select { max-width: 150px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.inline-status-control { display: grid; gap: 3px; min-width: 126px; }
.inline-status-select { width: 100%; padding: 6px 26px 6px 8px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: .76rem; font-weight: 750; cursor: pointer; }
.inline-status-select.status-in_service { border-color: #b6ddca; color: #17583e; background: #def1e7; }
.inline-status-select.status-out_of_service { border-color: #edbdc0; color: #89252b; background: #f8e1e3; }
.inline-status-state { min-height: 1em; text-align: center; }
.schedule-table td { padding-block: 15px; }
.schedule-table tbody tr { transition: background .15s ease; }
.schedule-table tbody tr:hover td { background: #fafbf9; }
.schedule-table .confirmed-row td { background: #f0faf5; }
.schedule-table .confirmed-row td:first-child { border-left: 4px solid var(--green); }
.row-actions { display: flex; gap: 12px; margin-top: 8px; font-size: .82rem; }
.confirmation-toggle label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 700; cursor: pointer; }
.confirmation-toggle input { width: 19px; height: 19px; accent-color: var(--green); }
.team-picker { min-width: 150px; }
.team-picker summary { color: var(--forge-dark); font-weight: 700; cursor: pointer; }
.team-picker form { display: grid; gap: 10px; min-width: 210px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf9; }
.team-options { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.team-options label { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.team-options input { width: 16px; height: 16px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; width: 100%; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf9; }
.checkbox-grid > div { min-width: 0; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; cursor: pointer; }
.checkbox-grid input[type="checkbox"] { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; padding: 0; }
.report-completion-form { gap: 22px; }
.report-form-grid { grid-template-columns: 1fr; }
.report-time-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-outcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf9; }
.report-outcome-grid .field { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.report-outcome-grid .field label { grid-column: 2; grid-row: 1; margin: 0; }
.report-outcome-grid .field input { grid-column: 1; grid-row: 1; width: 18px; height: 18px; margin: 0; }
.report-checklist-section { margin: 0; padding: 0; border: 0; }
.report-checklist-section + .report-checklist-section { padding-top: 20px; border-top: 1px solid var(--line); }
.report-checklist-section legend { margin-bottom: 12px; font-size: 1rem; font-weight: 800; }
.report-checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.report-submit-row { position: sticky; bottom: 12px; z-index: 5; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(248, 249, 247, .96); box-shadow: 0 8px 24px rgba(28, 40, 34, .12); }
.job-form { gap: 20px; }
.job-section-heading { align-items: flex-start; }
.job-section-heading .small { max-width: 670px; margin: 5px 0 0; }
.job-today-badge { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; color: #17583e; background: #def1e7; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.job-toggle-card { padding: 14px 16px; border: 1px solid #b9d9ca; border-radius: 9px; background: #f1faf5; }
.job-toggle-card .field { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 10px; }
.job-toggle-card .field label { grid-column: 2; grid-row: 1; margin: 0; }
.job-toggle-card .field input[type="checkbox"] { grid-column: 1; grid-row: 1; width: 19px; height: 19px; margin: 0; accent-color: var(--green); }
.job-toggle-card .field .help, .job-toggle-card .field .error { grid-column: 2; }
.job-toggle-warning { border-color: #ead39d; background: #fffaf0; }
.job-toggle-warning .field input[type="checkbox"] { accent-color: var(--amber); }
.job-assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.job-assignment-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf9; }
.job-assignment-card .checkbox-grid { grid-template-columns: 1fr; max-height: 360px; overflow-y: auto; background: white; }
.job-submit-row { position: sticky; bottom: 12px; z-index: 5; justify-content: space-between; padding: 14px 16px; border: 1px solid #cbd3ce; border-radius: 11px; background: rgba(255, 255, 255, .97); box-shadow: 0 8px 24px rgba(28, 40, 34, .14); }
.job-submit-row > div:first-child { display: grid; gap: 2px; }
.job-submit-row .button.primary { min-width: 128px; text-align: center; }
.small-button { padding: 7px 10px; font-size: .8rem; }
.form-card { max-width: 820px; padding: 24px; }
.form-notice { margin-bottom: 22px; padding: 13px 15px; border: 1px solid #b7d6e7; border-radius: 8px; color: #225a78; background: #edf7fb; line-height: 1.45; }
.wide-form { max-width: 1040px; }
.form-section { overflow: hidden; }
.form-section-body { display: grid; gap: 18px; padding: 22px; }
.two-column-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.additional-fields { border-top: 1px solid var(--line); }
.additional-fields summary { padding: 14px 22px; color: var(--forge-dark); font-weight: 750; cursor: pointer; }
.visible-notes { border-top: 1px solid var(--line); }
.stacked-form { display: grid; gap: 18px; }
.form-section > .month-selection-count { margin: 0; padding: 0 22px 20px; }
.button-row form { margin: 0; }
.field, .stacked-form > div { display: grid; gap: 6px; }
.field label, .stacked-form label { font-weight: 700; }
.form-control, .stacked-form input:not([type="checkbox"]):not([type="radio"]), .stacked-form select, .stacked-form textarea { width: 100%; padding: 10px 11px; border: 1px solid #bfc8c2; border-radius: 7px; color: var(--ink); background: white; font: inherit; }
textarea.form-control { min-height: 105px; resize: vertical; }
input[type="checkbox"].form-control, input[type="radio"].form-control { width: auto; padding: 0; }
.help { margin: 0; color: var(--muted); font-size: .83rem; }
.error { margin: 0; color: var(--red); font-size: .86rem; }
.has-error .form-control { border-color: var(--red); }
.staff-documents { margin-bottom: 24px; overflow: hidden; }
.staff-document-heading { align-items: flex-end; }
.sensitive-record-notice { margin: 18px 22px; padding: 13px 15px; border: 1px solid #efd08c; border-radius: 9px; color: #6b4c0e; background: #fff8e6; line-height: 1.45; }
.sensitive-record-notice strong { display: inline; color: #543a07; }
.staff-document-table td { vertical-align: top; }
.table-subtitle, .document-date { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.document-date + .document-date { margin-top: 2px; }
.badge.document-warning { color: #775008; background: #fff0c8; }
.badge.document-danger { color: #89252b; background: #f8e1e3; }
.staff-document-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 150px; }
.staff-document-actions form { margin: 0; }
.document-access-log { border-top: 1px solid var(--line); }
.document-access-log summary { padding: 15px 22px; color: var(--forge); font-weight: 750; cursor: pointer; }
.document-access-log[open] summary { border-bottom: 1px solid var(--line); }
.login-panel { max-width: 440px; margin: 9vh auto; padding: 30px; }

.detail-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 20px; margin-bottom: 20px; }
.detail-list { margin: 0; padding: 10px 22px 20px; }
.detail-list > div { display: grid; grid-template-columns: 155px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; }
.detail-list.compact > div { grid-template-columns: 130px 1fr; }
.notes { margin: 0 22px 22px; padding: 15px; border-radius: 8px; background: #f7f8f6; }
.section-gap { margin-bottom: 20px; }
.site-routing-summary { display: flex; gap: 42px; padding: 18px 22px; }
.site-routing-summary div { display: grid; gap: 3px; }
.inline-action { display: flex; justify-content: space-between; padding: 12px 16px; border: 1px dashed #bdc8c1; border-radius: 9px; color: var(--muted); }
.coverage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 22px 22px; }
.coverage-item { padding: 8px 10px; border-radius: 7px; color: #89252b; background: #f8e1e3; font-size: .83rem; font-weight: 700; }
.coverage-item::before { margin-right: 6px; content: "✕"; }
.coverage-item.included { color: #17583e; background: #def1e7; }
.coverage-item.included::before { content: "✓"; }
.inline-workflow-select { min-width: 165px; max-width: 210px; padding: 7px 28px 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; font-size: .78rem; font-weight: 700; }
.inline-workflow-select.status-completed, .inline-workflow-select.commercial-completed { border-color: #b6ddca; color: #17583e; background: #def1e7; }
.inline-workflow-select.status-in_progress { border-color: #b7d6e7; color: #225a78; background: #e0f0f8; }
.inline-workflow-select.status-outstanding, .inline-workflow-select.commercial-awaiting { border-color: #efcf88; color: #775008; background: #fff0c8; }
.inline-workflow-select.status-archived, .inline-workflow-select.commercial-archived { border-color: #d1d8d4; color: #59645e; background: #eef1ef; }
.inline-workflow-select.commercial-neutral { color: #59645e; background: #eef1ef; }
.inline-workflow-select.parts-ready { border-color: #b6ddca; color: #17583e; background: #def1e7; }
.inline-workflow-select.parts-ordered { border-color: #b7d6e7; color: #225a78; background: #e0f0f8; }
.inline-workflow-select.parts-waiting { border-color: #efcf88; color: #775008; background: #fff0c8; }
.inline-workflow-select.parts-neutral { color: #59645e; background: #eef1ef; }
.pending-quick-update { display: grid; gap: 3px; }
.next-step-cell { display: grid; min-width: 150px; gap: 8px; }
.next-step-link { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid #b9d9ca; border-radius: 8px; color: #17583e; background: #f1faf5; }
.next-step-link:hover { text-decoration: none; background: #e5f5ec; }
.next-step-link span { color: var(--muted); font-size: .76rem; }
.workflow-hint { max-width: 180px; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.pending-pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.pending-pipeline a { position: relative; display: grid; grid-template-columns: 30px auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); color: var(--ink); }
.pending-pipeline a:last-child { border-right: 0; }
.pending-pipeline a::after { position: absolute; right: -7px; z-index: 1; width: 13px; height: 13px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: white; content: ""; transform: rotate(45deg); }
.pending-pipeline a:last-child::after { display: none; }
.pending-pipeline a:hover, .pending-pipeline a.active { background: #f4f8f5; text-decoration: none; }
.pending-pipeline a.active::after { background: #f4f8f5; }
.pending-pipeline a > span { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: #68736d; background: #e9eeeb; font-size: .75rem; font-weight: 850; }
.pending-pipeline a.active > span { color: white; background: var(--forge); }
.pending-pipeline strong { font-size: 1.2rem; line-height: 1; }
.pending-pipeline small { overflow: hidden; color: var(--muted); font-size: .76rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pending-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.pending-toolbar .tabs { margin: 0; }
.pending-tabs a { display: flex; align-items: center; gap: 7px; }
.pending-tabs span { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; color: inherit; background: rgba(104, 115, 109, .12); font-size: .7rem; font-weight: 850; }
.pending-tabs a.active span { background: rgba(255, 255, 255, .16); }
.pending-search { display: flex; align-items: center; gap: 8px; width: min(480px, 100%); }
.pending-search .form-control { min-width: 0; }
.pending-search > a { font-size: .8rem; font-weight: 750; }
.pending-register { overflow: hidden; }
.pending-work-list { display: grid; }
.pending-work-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 26px; padding: 22px 24px 22px 28px; border-bottom: 1px solid var(--line); }
.pending-work-card:last-child { border-bottom: 0; }
.pending-work-card::before { position: absolute; inset: 0 auto 0 0; width: 5px; background: #d4971d; content: ""; }
.pending-work-card.status-completed::before { background: var(--green); }
.pending-work-card.status-archived::before { background: #9aa69f; }
.pending-work-card:hover { background: #fcfdfc; }
.pending-card-main { min-width: 0; }
.pending-card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pending-card-labels .commercial-completed, .pending-card-labels .status-completed { color: #17583e; background: #def1e7; }
.pending-card-labels .commercial-awaiting, .pending-card-labels .status-outstanding { color: #775008; background: #fff0c8; }
.pending-card-labels .commercial-archived, .pending-card-labels .status-archived { color: #59645e; background: #e9eeeb; }
.pending-card-labels .commercial-neutral, .pending-card-labels .neutral { color: #4f5a54; background: #eef1ef; }
.pending-card-labels .parts-ready { color: #17583e; background: #def1e7; }
.pending-card-labels .parts-ordered { color: #225a78; background: #e0f0f8; }
.pending-card-labels .parts-waiting { color: #775008; background: #fff0c8; }
.pending-card-labels .parts-neutral { color: #59645e; background: #eef1ef; }
.pending-card-main h2 { margin: 0 0 7px; font-size: 1.18rem; }
.pending-card-main h2 a { color: var(--ink); }
.pending-card-main > p { max-width: 820px; margin: 0 0 15px; color: #37423c; line-height: 1.48; }
.pending-card-meta { display: flex; flex-wrap: wrap; gap: 7px 20px; color: var(--muted); font-size: .82rem; }
.pending-card-meta span { min-width: 0; }
.pending-card-meta strong { margin-right: 4px; color: #4f5a54; }
.pending-card-actions { display: grid; align-content: start; gap: 9px; min-width: 0; padding-left: 22px; border-left: 1px solid var(--line); }
.pending-card-actions .button { width: 100%; text-align: center; }
.parts-readiness { display: grid; gap: 7px; margin-bottom: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; }
.parts-readiness > div { display: grid; gap: 2px; }
.parts-readiness > div > span { color: var(--ink); font-size: .76rem; font-weight: 850; }
.parts-readiness > div > small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.parts-readiness .pending-quick-update { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.parts-readiness .inline-workflow-select { width: 100%; min-width: 0; max-width: none; }
.parts-readiness .save-state { min-width: 0; }
.pending-decision-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pending-decision-form .save-state { grid-column: 1 / -1; min-height: 1em; text-align: center; }
.pending-next-step { display: grid; gap: 2px; margin-bottom: 3px; }
.pending-next-step > span { color: var(--forge); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.pending-next-step strong { line-height: 1.25; }
.pending-next-step small, .pending-document-refs { color: var(--muted); font-size: .78rem; }
.pending-document-refs { margin: 1px 0 0; text-align: center; }
.pending-status-controls { margin-top: 3px; border-top: 1px solid var(--line); }
.pending-status-controls summary { padding: 10px 0 2px; color: var(--muted); font-size: .78rem; font-weight: 750; cursor: pointer; }
.pending-status-controls > div { display: grid; gap: 10px; padding-top: 9px; }
.pending-status-controls label { display: grid; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.pending-status-controls .inline-workflow-select { width: 100%; min-width: 0; max-width: none; }
.pending-work-form { gap: 18px; }
.pending-commercial-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; }
.pending-commercial-summary h2 { margin-bottom: 3px; }
.pending-commercial-summary p:last-child { margin: 0; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 46px 22px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 1.05rem; }
.link-lift-panel { display: grid; grid-template-columns: minmax(260px, .7fr) 1fr; align-items: end; gap: 24px; padding: 22px; }
.contract-asset-picker { display: grid; gap: 9px; min-width: 0; }
.contract-asset-picker > label { color: var(--muted); font-size: .78rem; font-weight: 800; }
.contract-asset-selection-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .8rem; }
.contract-asset-options { display: grid; max-height: 330px; margin: 0; padding: 8px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; }
.contract-asset-options > div { border-bottom: 1px solid var(--line); }
.contract-asset-options > div:last-child { border-bottom: 0; }
.contract-asset-options label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 8px; border-radius: 6px; cursor: pointer; }
.contract-asset-options label:hover { background: white; }
.contract-asset-options input { width: 18px; height: 18px; accent-color: var(--forge); }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form .form-control { flex: 1; }
.tabs { display: flex; gap: 5px; margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 13px; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.tabs a.active { color: white; background: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.finding-summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr; margin-bottom: 18px; overflow: hidden; }
.finding-summary > div { display: grid; align-content: center; min-height: 100px; padding: 18px 22px; border-right: 1px solid var(--line); }
.finding-summary > div:last-child { border-right: 0; }
.finding-summary-intro { grid-template-columns: auto 1fr; column-gap: 12px; background: #fafbf9; }
.finding-summary-intro .eyebrow { grid-column: 1 / -1; margin-bottom: 4px; }
.finding-summary-intro strong { grid-row: 2 / 4; align-self: center; color: var(--forge-dark); font-size: 2.35rem; line-height: 1; }
.finding-summary-intro span { align-self: center; color: var(--muted); font-weight: 700; }
.finding-summary-stat { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.finding-summary-stat strong { font-size: 1.8rem; line-height: 1; }
.finding-summary-stat span { color: var(--muted); line-height: 1.3; }
.finding-summary-stat.urgent strong { color: var(--amber); }
.finding-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.finding-tabs { margin: 0; }
.finding-tabs a { display: flex; align-items: center; gap: 7px; border: 1px solid transparent; }
.finding-tabs a:not(.active) { border-color: var(--line); background: white; }
.finding-tabs span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; color: inherit; background: rgba(104, 115, 109, .12); font-size: .72rem; font-weight: 800; }
.finding-tabs a.active span { background: rgba(255, 255, 255, .18); }
.finding-search { display: flex; align-items: center; gap: 8px; width: min(500px, 100%); }
.finding-search .form-control { min-width: 0; }
.finding-clear { padding: 8px 2px; font-size: .82rem; font-weight: 700; }
.finding-register { overflow: hidden; }
.finding-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.finding-section-heading > div { display: flex; align-items: center; gap: 13px; }
.finding-section-heading h2 { margin-bottom: 2px; }
.finding-section-heading p:last-child { margin: 0; }
.finding-section-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #225a78; background: #e0f0f8; font-weight: 900; }
.finding-section-icon.warning-icon { color: #775008; background: #fff0c8; }
.finding-section-icon.archived-icon { color: #59645e; background: #e9eeeb; }
.finding-list { display: grid; }
.finding-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 24px; padding: 20px 22px 20px 26px; border-bottom: 1px solid var(--line); }
.finding-item:last-child { border-bottom: 0; }
.finding-item::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: #b7c2bc; content: ""; }
.finding-item.remedial-item::before { background: var(--amber); }
.finding-item.priority-action_required::before { background: var(--red); }
.finding-item.archived-finding::before { background: #9aa69f; }
.finding-item:hover { background: #fcfdfc; }
.finding-main { min-width: 0; }
.finding-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.finding-item h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.35; }
.finding-item h3 a { color: var(--ink); }
.finding-item p { max-width: 760px; margin-bottom: 12px; color: #37423c; }
.finding-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .82rem; }
.finding-meta span { display: inline-flex; gap: 5px; min-width: 0; }
.finding-meta strong { color: #4f5a54; }
.finding-actions { display: grid; align-content: center; justify-items: stretch; gap: 9px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); text-align: center; }
.finding-actions form, .finding-actions .button { width: 100%; }
.finding-actions > a { font-size: .82rem; font-weight: 700; }
.finding-status { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--amber); font-size: .78rem; font-weight: 800; }
.finding-status i { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.advisory-status { color: #59645e; }
.client-heading-identity { display: flex; align-items: center; gap: 18px; }
.client-logo { width: 86px; height: 86px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; object-fit: contain; background: white; box-shadow: var(--shadow); }
.asset-search-field { margin-bottom: 6px; padding: 14px; border: 1px solid #b7d6e7; border-radius: 10px; background: #f4fafd; }
.asset-search-field > label { display: block; margin-bottom: 6px; font-weight: 800; }
.asset-search-field .help { margin: 5px 0 0; }
.asset-search-result:not(:empty) { color: #225a78; font-weight: 750; }
.checklist-accordion { display: grid; gap: 10px; padding: 16px 18px 20px; }
.checklist-section { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; }
.checklist-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; background: #fafbf9; }
.checklist-section > summary::-webkit-details-marker { display: none; }
.checklist-section > summary > span:first-child { display: flex; align-items: baseline; gap: 9px; }
.checklist-section summary small { color: var(--muted); }
.checklist-section[open] > summary { border-bottom: 1px solid var(--line); }
.checklist-chevron { color: var(--muted); font-size: 1.15rem; transition: transform .15s ease; }
.checklist-section[open] .checklist-chevron { transform: rotate(180deg); }
.checklist-section .detail-list { margin: 0; }
.checklist-section .detail-list > div:last-child { border-bottom: 0; }
.action-item-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.action-item-buttons form { flex: 1 1 115px; }
.action-item-buttons .button { width: 100%; }
.priority-action_required .priority-badge { color: #89252b; background: #f8e1e3; }
.priority-monitor .priority-badge { color: #59645e; background: #e9eeeb; }
.section-nav { position: sticky; top: 8px; z-index: 8; display: flex; gap: 5px; margin-bottom: 18px; padding: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 18px rgba(28, 39, 33, .08); }
.section-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 7px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.section-nav a:hover { background: #f2f5f3; text-decoration: none; }
.section-nav span { display: grid; place-items: center; min-width: 22px; height: 22px; padding-inline: 5px; border-radius: 999px; color: white; background: var(--forge); font-size: .7rem; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.view-switch a, .view-switch span { padding: 7px 12px; border-radius: 6px; color: var(--muted); font-weight: 700; }
.view-switch a:hover { text-decoration: none; }
.view-switch .active { color: white; background: var(--ink); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 14px; }
.calendar-title { text-align: center; }
.calendar-title h2 { margin-bottom: 2px; }
.schedule-view-nav { margin-bottom: 16px; }
.week-planner-widget { overflow: hidden; }
.compact-week-planner { max-height: 560px; overflow: auto; }
.compact-week-planner .operations-heading { position: sticky; top: 0; z-index: 2; }
.compact-week-planner .engineer-heading { left: 0; z-index: 3; }
.compact-week-planner .engineer-cell { position: sticky; left: 0; z-index: 1; }
.inline-appointment { display: grid; min-width: 155px; gap: 6px; }
.inline-appointment .form-control { padding: 6px 7px; font-size: .82rem; }
.exact-time-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; cursor: pointer; }
.exact-time-toggle input { width: 16px; height: 16px; }
.save-state { min-height: 1.2em; }
.mini-week-grid { display: grid; grid-template-columns: repeat(7, minmax(145px, 1fr)); overflow-x: auto; }
.mini-day { min-height: 150px; padding: 8px; border-right: 1px solid var(--line); background: #fafbf9; }
.mini-day:last-child { border-right: 0; }
.mini-day.today { background: #fff8f3; box-shadow: inset 0 3px 0 var(--forge); }
.mini-day-heading { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: .78rem; }
.mini-job { display: grid; gap: 1px; margin-bottom: 5px; padding: 6px; border-left: 3px solid #4b84a1; border-radius: 5px; color: #244c61; background: #e9f4f9; font-size: .7rem; cursor: grab; }
.mini-job.confirmed { border-color: var(--green); color: #17583e; background: #e4f4eb; }
.mini-job:hover { text-decoration: none; }
.dragging { opacity: .45; }
.drop-zone.drag-over { outline: 3px dashed var(--forge); outline-offset: -4px; background: #fff3ed; }
.calendar { overflow: hidden; }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: 9px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbf9; font-size: .75rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 125px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.calendar-day:nth-child(7) { border-right: 0; }
.calendar-day.empty { background: #f7f8f6; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--forge); }
.day-number { display: block; margin-bottom: 6px; color: var(--muted); font-size: .8rem; font-weight: 800; }
.calendar-event { display: grid; margin-bottom: 5px; padding: 5px 6px; border-left: 3px solid #4b84a1; border-radius: 4px; color: #244c61; background: #e9f4f9; font-size: .72rem; line-height: 1.25; }
.calendar-event:hover { text-decoration: none; }
.calendar-event.completed { border-color: var(--green); color: #17583e; background: #e4f4eb; }
.calendar-event.missed { border-color: var(--red); color: #89252b; background: #fae9ea; }
.calendar-event.cancelled { border-color: #7c8781; color: #59645e; background: #eef1ef; }
.month-only-section { margin-top: 20px; }
.operations-board { overflow-x: auto; }
.operations-grid { display: grid; min-width: max-content; }
.operations-grid-7 { grid-template-columns: 180px repeat(7, minmax(165px, 1fr)); }
.operations-grid-1 { grid-template-columns: 210px minmax(520px, 1fr); min-width: 760px; }
.operations-heading { display: grid; gap: 2px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbf9; text-align: center; }
.operations-heading.today { color: var(--forge-dark); background: #fff4ef; }
.operations-heading.engineer-heading { place-items: center start; text-align: left; }
.engineer-cell { display: grid; align-content: start; gap: 3px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbf9; }
.engineer-cell span { color: var(--muted); font-size: .76rem; }
.operations-cell { min-height: 130px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.operations-cell.today { background: #fffaf7; }
.job-card { display: grid; gap: 1px; margin-bottom: 6px; padding: 7px; border-left: 4px solid #4b84a1; border-radius: 6px; color: #244c61; background: #e9f4f9; font-size: .72rem; line-height: 1.25; }
.job-card:hover { text-decoration: none; }
.job-card.confirmed { border-color: var(--green); color: #17583e; background: #e4f4eb; }
.job-card.completed { border-color: #7c8781; color: #59645e; background: #eef1ef; }
.job-card.unassigned { border-color: var(--amber); color: #775008; background: #fff5d9; }
.job-card.additional-job { border-left-style: double; }
.job-time, .job-state { font-weight: 800; }
.job-state { margin-top: 3px; }
.absence-block, .night-call-block { margin-bottom: 6px; padding: 6px 7px; border-radius: 6px; font-size: .73rem; font-weight: 800; }
.absence-block { color: #5d3b87; background: #eee5f8; }
.night-call-block { color: white; background: #35405f; }
.clash-warning, .workload-count { margin-bottom: 6px; padding: 4px 6px; border-radius: 5px; font-size: .69rem; font-weight: 800; }
.clash-warning { color: #89252b; background: #f8e1e3; }
.workload-count { color: #59645e; background: #eef1ef; }
.operations-cell.double-booked { box-shadow: inset 0 0 0 2px var(--red); }
.empty-cell { color: #a1aaa5; font-size: .72rem; }
.unassigned-heading, .unassigned-cell { background: #fffaf0; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; color: var(--muted); font-size: .8rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 11px; height: 11px; border-radius: 3px; }
.legend-planned { background: #4b84a1; }
.legend-confirmed { background: var(--green); }
.legend-absence { background: #8d67b2; }
.legend-night { background: #35405f; }
.dashboard-widget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.workflow-overview { overflow: hidden; }
.workflow-pipeline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; padding: 20px 22px 22px; }
.workflow-step { display: grid; align-content: start; gap: 3px; min-height: 112px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fafbf9; }
.workflow-step:hover { border-color: #b8c5bd; text-decoration: none; background: white; box-shadow: 0 7px 18px rgba(28, 39, 33, .08); }
.workflow-step.warning { border-color: #efcf88; background: #fffaf0; }
.workflow-step.success { border-color: #b6ddca; background: #f1faf5; }
.workflow-number { color: var(--forge-dark); font-size: 1.8rem; font-weight: 850; line-height: 1; }
.workflow-step small { color: var(--muted); line-height: 1.35; }
.workflow-arrow { align-self: center; color: #9aa69f; font-size: 1.3rem; }
.source-work-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 18px 20px; border-color: #b9d9ca; background: #f1faf5; }
.source-work-banner p:last-child { margin-bottom: 0; }
.action-centre { overflow: hidden; }
.action-centre-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.action-column { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--line); }
.action-column:last-child { border-right: 0; }
.action-column-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #fafbf9; }
.action-column-heading > div { display: grid; gap: 1px; }
.action-column-heading small { color: var(--muted); line-height: 1.3; }
.step-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 999px; color: white; background: var(--forge); font-size: .75rem; font-weight: 850; }
.count-pill { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 7px; border-radius: 999px; color: var(--ink); background: #e9eeeb; font-size: .75rem; font-weight: 850; }
.action-list { display: grid; align-content: start; gap: 10px; padding: 12px; }
.action-item { display: grid; gap: 8px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.action-item p { margin: 0; overflow-wrap: anywhere; }
.action-item-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.action-item-title > a { color: var(--ink); font-weight: 780; }
.action-item-muted { opacity: .72; background: #f7f8f6; }
.mini-empty { padding: 24px 12px; color: var(--muted); text-align: center; }
.column-footer-link { margin: auto 12px 12px; padding: 9px 11px; border-radius: 8px; background: #f4f6f4; font-size: .82rem; font-weight: 750; text-align: center; }
.column-footer-link:hover { text-decoration: none; background: #ecefec; }
.column-footer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: auto 12px 12px; }
.column-footer-actions .column-footer-link { margin: 0; }
.dashboard-widget { overflow: hidden; }
.pending-works-widget { grid-column: 1 / -1; }
.reported-issues-widget { grid-column: 1 / -1; }
.widget-summary { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: baseline; gap: 5px 9px; padding: 18px 20px; }
.widget-summary strong, .widget-hero strong { font-size: 2rem; line-height: 1; }
.widget-summary span, .widget-hero span { color: var(--muted); font-size: .82rem; }
.widget-hero { display: flex; align-items: baseline; gap: 9px; padding: 18px 20px; }
.danger-widget .widget-hero strong { color: var(--red); }
.warning-widget .widget-hero strong { color: var(--amber); }
.widget-list { border-top: 1px solid var(--line); }
.widget-list > a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .8rem; }
.widget-list > a:last-child { border-bottom: 0; }
.widget-list > a:hover { background: #fafbf9; text-decoration: none; }
.widget-list > a span:last-child { color: var(--muted); text-align: right; }
.widget-list > p { margin: 0; padding: 18px 20px; }
.attention-row td { background: #fffaf0; }
.deadline { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.deadline.overdue { color: var(--red); }
.deadline.due_soon { color: var(--amber); }
.deadline.okay { color: var(--green); }
.deadline.unknown { color: var(--muted); font-weight: 500; }
.subcontractor-table .subcontractor-company { min-width: 230px; }
.subcontractor-table .subcontractor-notes { width: 38%; min-width: 340px; white-space: normal; }
.electronic-repair-table .repair-notes { width: 25%; min-width: 260px; white-space: normal; }
.contract-renewal-form label { display: grid; gap: 5px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.contract-renewal-form .form-control { min-width: 180px; }
.messages { margin-bottom: 18px; }
.message { padding: 11px 14px; border: 1px solid #a9d8c3; border-radius: 8px; background: #e9f7ef; }
.error-message { border-color: #edb3b6; color: var(--red); background: #fcebed; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; color: var(--muted); }

.xero-row-link { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 750; }
.xero-connection { display: flex; align-items: center; gap: 12px; padding: 14px 17px; border: 1px solid #b6ddca; border-radius: 11px; background: #f1faf5; }
.xero-connection.error { border-color: #efcf88; background: #fffaf0; }
.xero-connection > div { display: grid; gap: 2px; }
.xero-connection span { color: var(--muted); }
.connection-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 4px rgba(38, 117, 87, .12); }
.xero-connection.error .connection-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(156, 106, 11, .12); }
.commercial-live-notice { margin: 0 0 20px; padding: 13px 16px; border: 1px solid #b6ddca; border-radius: 9px; color: #17583e; background: #f1faf5; font-weight: 700; }
.commercial-live-notice.error { border-color: #e7b5b8; color: #89252b; background: #fff7f7; }
.xero-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.commercial-work-summary { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 26px; padding: 22px 24px; }
.commercial-work-summary h2 { margin-bottom: 7px; }
.commercial-work-summary p:last-child { margin-bottom: 0; }
.commercial-work-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 13px 18px; margin: 0; padding-left: 24px; border-left: 1px solid var(--line); }
.commercial-work-summary dl div { min-width: 0; }
.commercial-work-summary dt { margin-bottom: 2px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.commercial-work-summary dd { margin: 0; font-weight: 750; }
.commercial-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; padding: 13px 18px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.commercial-progress span { position: relative; display: grid; justify-items: center; gap: 5px; color: var(--muted); font-weight: 750; }
.commercial-progress span::after { position: absolute; top: 14px; left: calc(50% + 19px); width: calc(100% - 38px); height: 2px; background: #d9dfdb; content: ""; }
.commercial-progress span:last-child::after { display: none; }
.commercial-progress i { z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: #68736d; background: #e9eeeb; font-size: .72rem; font-style: normal; }
.commercial-progress .done { color: var(--ink); }
.commercial-progress .done i { color: white; background: var(--green); }
.commercial-progress .done::after { background: #a9d8c3; }
.client-decision-section .card-heading { align-items: center; }
.client-decision-actions { display: flex; flex-wrap: wrap; }
.client-decision-actions > .button { flex: 1 1 190px; width: auto; text-align: center; }
.danger-button { border-color: #e7b5b8; color: #89252b; background: #fff7f7; }
.danger-button:hover { background: #fcebed; }
.commercial-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.commercial-sidebar { align-self: start; position: sticky; top: 18px; }
.commercial-section { overflow: hidden; }
.commercial-section-body { display: grid; gap: 16px; padding: 20px 22px 22px; }
.mapped-contact, .new-xero-contact { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; }
.mapped-contact > div, .new-xero-contact > div { display: grid; gap: 2px; }
.mapped-contact span, .new-xero-contact span { color: var(--muted); font-size: .83rem; }
.mapped-contact small { color: var(--muted); font-size: .76rem; }
.xero-contact-search { display: flex; align-items: end; gap: 10px; }
.xero-contact-search label { display: grid; flex: 1; gap: 5px; font-weight: 700; }
.compact-commercial-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.compact-commercial-form label, .compact-commercial-form .error { grid-column: 1 / -1; }
.commercial-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.commercial-divider::before, .commercial-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.commercial-lines { display: grid; gap: 10px; }
.commercial-line { display: grid; grid-template-columns: minmax(220px, 2fr) 90px 120px 110px 130px auto; align-items: end; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbf9; }
.commercial-line.removed { display: none; }
.commercial-line .field { min-width: 0; }
.commercial-line label { color: var(--muted); font-size: .74rem; }
.commercial-line .form-control { min-width: 0; padding: 8px 9px; }
.field-required { color: var(--red); }
.form-control.field-invalid { border-color: #b52f35; box-shadow: 0 0 0 3px rgba(181, 47, 53, .1); }
.inline-field-error { margin: 5px 0 0; color: #89252b; font-size: .74rem; font-weight: 750; line-height: 1.3; }
.line-remove { min-height: 38px; padding: 0 8px; border: 0; color: var(--red); background: none; font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.pricing-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pricing-total { display: grid; justify-items: end; gap: 2px; }
.pricing-total span { color: var(--muted); font-size: .76rem; }
.pricing-total strong { font-size: 1.2rem; }
.document-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.document-action-grid + .client-decision-section { margin-top: 20px; }
.draft-safety-note { margin: 0; padding: 11px 12px; border-radius: 8px; color: #5d4a1c; background: #fff8e8; font-size: .84rem; }
.document-success-note { margin: 0; padding: 11px 12px; border-radius: 8px; color: #17583e; background: #eef9f3; font-size: .84rem; }
.payment-terms-note { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fafbf9; font-size: .84rem; }
.invoice-later-section { border-top: 3px solid #d7dfda; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
.document-summary { display: grid; gap: 0; margin: 0; }
.document-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.document-summary > div:last-child { border-bottom: 0; }
.document-summary dt { color: var(--muted); }
.document-summary dd { margin: 0; font-weight: 750; }
.commercial-steps { display: grid; gap: 10px; margin: 18px 0; padding: 0; counter-reset: commercial-step; list-style: none; }
.commercial-steps li { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 8px; color: var(--muted); }
.commercial-steps li::before { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 999px; color: #68736d; background: #e9eeeb; counter-increment: commercial-step; content: counter(commercial-step); font-size: .72rem; font-weight: 850; }
.commercial-steps li.done { color: var(--ink); font-weight: 700; }
.commercial-steps li.done::before { color: white; background: var(--green); content: "✓"; }
.commercial-sidebar-summary { display: grid; margin: 16px 0; }
.commercial-sidebar-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.commercial-sidebar-summary dt { color: var(--muted); }
.commercial-sidebar-summary dd { margin: 0; text-align: right; font-weight: 750; }
.badge.draft { color: #225a78; background: #e0f0f8; }
.badge.sent, .badge.submitted, .badge.authorised, .badge.accepted { color: #17583e; background: #def1e7; }
.badge.declined, .badge.voided, .badge.deleted { color: #89252b; background: #f8e1e3; }
.badge.paid, .badge.invoiced { color: #17583e; background: #def1e7; }

@media (max-width: 900px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .content-grid, .detail-grid { grid-template-columns: 1fr; }
    .link-lift-panel { grid-template-columns: 1fr; }
    .site-header { flex-wrap: wrap; gap: 12px 22px; padding-block: 14px; }
    .site-header nav { order: 3; width: 100%; overflow-x: auto; }
    .dashboard-widget-grid { grid-template-columns: 1fr; }
    .pending-works-widget { grid-column: auto; }
    .reported-issues-widget { grid-column: auto; }
    .workflow-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow-arrow { display: none; }
    .action-centre-grid { grid-template-columns: 1fr; }
    .action-column { border-right: 0; border-bottom: 1px solid var(--line); }
    .action-column:last-child { border-bottom: 0; }
    .top-quick-actions { align-items: flex-start; flex-direction: column; }
    .top-quick-actions .button-row { flex-wrap: wrap; }
    .nav-dropdown { position: fixed; top: auto; }
    .finding-summary { grid-template-columns: 1fr 1fr; }
    .finding-summary-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
    .finding-summary-stat:nth-child(2) { border-bottom: 0; }
    .finding-toolbar { align-items: stretch; flex-direction: column; }
    .finding-search { width: 100%; }
    .commercial-layout { grid-template-columns: 1fr; }
    .commercial-sidebar { position: static; }
    .commercial-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .commercial-line .line-description { grid-column: 1 / -1; }
    .pending-pipeline { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; }
    .pending-toolbar { align-items: stretch; flex-direction: column; }
    .pending-search { width: 100%; }
    .pending-work-card { grid-template-columns: 1fr; gap: 18px; }
    .pending-card-actions { padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .commercial-work-summary { grid-template-columns: 1fr; }
    .commercial-work-summary dl { padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 620px) {
    .page-shell { padding: 25px 14px 45px; }
    .page-heading, .filter-bar { align-items: stretch; flex-direction: column; }
    .client-heading-identity { align-items: flex-start; }
    .client-logo { width: 68px; height: 68px; }
    .document-panel { align-items: stretch; flex-direction: column; }
    .document-panel .button-row { flex-wrap: wrap; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .report-metrics { grid-template-columns: repeat(3, minmax(105px, 1fr)); overflow-x: auto; }
    .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
    .two-column-fields, .job-assignment-grid { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr; }
    .report-time-grid, .report-outcome-grid, .report-checklist-grid { grid-template-columns: 1fr; }
    .report-submit-row, .job-submit-row { position: static; }
    .job-section-heading, .job-submit-row { align-items: stretch; flex-direction: column; }
    .job-today-badge { align-self: flex-start; }
    .job-submit-row > .button-row { width: 100%; }
    .job-submit-row > .button-row .button { flex: 1; text-align: center; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .bulk-toolbar { align-items: stretch; flex-direction: column; }
    .bulk-toolbar .form-control { width: 100%; }
    .calendar { overflow-x: auto; }
    .calendar-weekdays, .calendar-week { min-width: 840px; }
    .mini-week-grid { min-width: 1050px; }
    .workflow-pipeline { grid-template-columns: 1fr; padding: 14px; }
    .source-work-banner { align-items: flex-start; flex-direction: column; }
    .section-nav { top: 4px; }
    .finding-summary { grid-template-columns: 1fr; }
    .finding-summary-intro { grid-column: auto; }
    .finding-summary > div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .finding-summary > div:last-child { border-bottom: 0; }
    .finding-tabs { width: 100%; }
    .finding-tabs a { flex: 1; justify-content: center; }
    .finding-search { align-items: stretch; flex-wrap: wrap; }
    .finding-search .form-control { flex: 1 1 100%; }
    .finding-search .button { flex: 1 1 100%; width: 100%; }
    .finding-item { grid-template-columns: 1fr; gap: 16px; padding: 18px 18px 18px 22px; }
    .finding-meta span { display: block; width: 100%; }
    .finding-meta strong { margin-right: 5px; }
    .finding-actions { justify-items: start; padding: 15px 0 0; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
    .finding-actions form, .finding-actions .button { width: 100%; }
    .finding-section-heading { align-items: flex-start; flex-direction: column; }
    .xero-metrics, .document-action-grid, .commercial-line { grid-template-columns: 1fr; }
    .mapped-contact, .new-xero-contact, .xero-contact-search, .compact-commercial-form { align-items: stretch; flex-direction: column; grid-template-columns: 1fr; }
    .commercial-line .line-description { grid-column: auto; }
    .pending-pipeline { grid-template-columns: repeat(5, 145px); }
    .pending-tabs { width: 100%; }
    .pending-tabs a { flex: 1; justify-content: center; }
    .pending-search { flex-wrap: wrap; }
    .pending-search .form-control { flex: 1 1 100%; }
    .pending-search .button { flex: 1; }
    .pending-work-card { padding: 19px 18px 19px 22px; }
    .pending-card-meta span { display: block; width: 100%; }
    .pending-commercial-summary, .pricing-footer { align-items: stretch; flex-direction: column; }
    .pricing-total { justify-items: start; }
    .commercial-work-summary dl { grid-template-columns: 1fr; }
    .commercial-progress { padding-inline: 8px; }
    .commercial-progress small { font-size: .66rem; }
}
.character-counter {
    margin-top: 0.35rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.character-counter.at-limit {
    color: #b42318;
    font-weight: 700;
}

@media print {
    @page { margin: 14mm; }
    body { background: white; font-size: 11px; }
    .site-header, .page-heading > .button, .finding-toolbar, .finding-actions form { display: none !important; }
    .page-shell { max-width: none; padding: 0; }
    .page-heading { margin-bottom: 14px; }
    .card { box-shadow: none; }
    .finding-summary { grid-template-columns: 1.25fr 1fr 1fr; margin-bottom: 12px; }
    .finding-summary > div { min-height: 72px; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 0; }
    .finding-summary-intro { grid-column: auto; }
    .finding-register { overflow: visible; break-inside: auto; }
    .finding-section-heading { padding: 13px 15px; }
    .finding-item { grid-template-columns: minmax(0, 1fr) 145px; gap: 12px; padding: 13px 14px 13px 18px; break-inside: avoid; }
    .finding-item h3 { font-size: 12px; }
    .finding-item p { margin-bottom: 7px; }
    .finding-actions { padding-left: 12px; }
    .finding-actions > a { display: none; }
    .finding-status { justify-content: flex-start; text-align: left; }
}

/* Keep the operations dashboard compact without changing other registers. */
.dashboard-heading { align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.dashboard-heading p:last-child { margin-bottom: 0; }
.dashboard-heading .button-row { flex-wrap: wrap; }
.dashboard-page .metric-grid { margin-bottom: 12px; }
.dashboard-page .metric { min-width: 0; padding: 18px; }
.dashboard-page .metric span { font-weight: 700; color: var(--ink); }
.dashboard-page .metric small { margin-top: auto; padding-top: 12px; color: var(--forge-dark); }
.dashboard-portfolio-strip { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 22px; color: var(--muted); font-size: .85rem; }
.dashboard-portfolio-strip a { color: inherit; }
.dashboard-page .card-heading { padding: 16px 20px; }
.dashboard-page .card-heading > a { flex-shrink: 0; font-size: .82rem; }
.dashboard-page .card-heading p:last-child:not(.eyebrow) { margin: 6px 0 0; }
.dashboard-page .workflow-pipeline { padding: 16px 20px; }
.dashboard-page .workflow-step { min-height: 108px; }
.dashboard-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: .8rem; }
.dashboard-today { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.dashboard-side-stack { display: grid; gap: 16px; min-width: 0; }
.dashboard-inline-summary { margin: 0; padding: 14px 20px; font-size: .88rem; }
.dashboard-rows { border-top: 1px solid var(--line); }
.dashboard-job { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 20px; color: var(--ink); border-bottom: 1px solid var(--line); }
.dashboard-job:last-child, .dashboard-work-row:last-child { border-bottom: 0; }
.dashboard-job:hover { text-decoration: none; background: #fafbf9; }
.dashboard-job-time { font-size: .82rem; font-weight: 750; padding-top: 3px; }
.dashboard-row-main { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.dashboard-row-main > span, .dashboard-row-main > small { color: var(--muted); font-size: .8rem; }
.dashboard-job .badge { margin: 0; }
.dashboard-empty { margin: 0; padding: 16px 20px; color: var(--muted); font-size: .88rem; }
.dashboard-disclosure { overflow: hidden; }
.dashboard-disclosure summary { cursor: pointer; padding: 16px 20px; }
.dashboard-disclosure summary span { margin-left: 10px; color: var(--muted); font-size: .8rem; }
.dashboard-work-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 190px; align-items: center; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.dashboard-work-target, .dashboard-work-action { font-size: .8rem; }
.dashboard-work-action .button { width: 100%; text-align: center; }
.dashboard-secondary { align-items: start; }
.dashboard-view-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.dashboard-view-tabs a { padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: .85rem; }
.dashboard-view-tabs a[aria-current] { background: #e9eeeb; font-weight: 750; }
.dashboard-view-tabs strong { margin-left: 8px; }
.dashboard-page a:focus-visible, .dashboard-page summary:focus-visible { outline: 3px solid var(--forge-dark); outline-offset: 3px; }
@media (max-width: 1000px) {
    .dashboard-page .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-work-row { grid-template-columns: minmax(0, 1fr) 170px; }
    .dashboard-work-target { grid-column: 1; }
    .dashboard-work-action { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 760px) {
    .dashboard-today { grid-template-columns: 1fr; }
    .dashboard-page .card-heading { align-items: flex-start; flex-wrap: wrap; }
    .dashboard-page .card-heading > a { flex-shrink: 1; }
}
@media (max-width: 540px) {
    .dashboard-heading .button { font-size: .82rem; padding: 10px 12px; }
    .dashboard-page .metric { padding: 14px; }
    .dashboard-page .metric span { font-size: .85rem; }
    .dashboard-page .metric small { font-size: .75rem; }
    .dashboard-page .workflow-pipeline { grid-template-columns: 1fr; padding: 14px; }
    .dashboard-page .workflow-step { min-height: 0; }
    .dashboard-job { grid-template-columns: 52px minmax(0, 1fr); padding: 14px; gap: 10px; }
    .dashboard-job .badge { grid-column: 2; justify-self: start; }
    .dashboard-work-row { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 10px; }
    .dashboard-work-target, .dashboard-work-action { grid-column: auto; grid-row: auto; }
    .dashboard-work-action .button { width: auto; }
    .dashboard-disclosure summary span { display: block; margin: 5px 0 0; }
}

/* Shared portfolio register layout. */
.portfolio-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: -12px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.portfolio-nav a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.portfolio-nav a[aria-current] { color: var(--forge-dark); background: #f7eae4; }
.portfolio-register .page-heading { margin-bottom: 20px; }
.portfolio-register .page-heading p:last-child { margin-bottom: 0; }
.register-filter-panel > summary { display: none; }
.register-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.register-filters label, .register-bulk-route { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.register-filters .register-search { grid-column: span 2; }
.register-filters .form-control { width: 100%; min-width: 0; }
.register-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 42px; font-size: .85rem; }
.register-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; background: #e9eeeb; font-size: .85rem; }
.register-scope a:last-child { margin-left: auto; }
.register-results { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: .83rem; }
.register-results p { margin: 0; }
.register-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.register-pagination > * { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 10px; border-radius: 7px; }
.register-pagination .current { color: white; background: var(--forge-dark); font-weight: 750; }
.register-pagination [aria-disabled] { color: var(--muted); opacity: .65; }
.register-pagination a:hover { background: #e9eeeb; text-decoration: none; }
.register-table { table-layout: fixed; font-size: .88rem; }
.register-table th, .register-table td { padding: 14px 16px; overflow-wrap: anywhere; }
.register-table th { font-size: .72rem; }
.register-table tbody tr:hover { background: #fafbf9; }
.register-table .register-primary { line-height: 1.45; }
.register-primary > .strong-link { display: inline-block; margin-bottom: 3px; font-size: .94rem; }
.register-secondary { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.register-secondary a { color: inherit; }
.register-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.register-table-note { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); font-size: .8rem; }
.client-register-table th:first-child { width: 58%; }
.site-register-table th:first-child { width: 40%; }
.site-register-table th:nth-child(2) { width: 30%; }
.site-register-table th:last-child { width: 10%; }
.lift-register-table th:first-child { width: 44px; }
.lift-register-table th:nth-child(2) { width: 38%; }
.lift-register-table th:nth-child(3) { width: 23%; }
.lift-register-table th:nth-child(4) { width: 14%; }
.contract-register-table th:first-child { width: 34%; }
.contract-register-table th:nth-child(2) { width: 29%; }
.contract-register-table th:nth-child(3) { width: 15%; }
.contract-register-table th:nth-child(4) { width: 9%; }
.register-postcode, .register-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.count-link { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; font-weight: 750; }
.count-link span { font-weight: 400; }
.register-document { display: inline-block; margin-top: 8px; font-size: .8rem; }
.register-maintenance { display: grid; gap: 4px; }
.register-maintenance .badge { justify-self: start; }
.register-term .renewal-flag { display: block; margin-top: 6px; }
.portfolio-register .inline-status-select { max-width: 100%; min-width: 0; width: 100%; }
.portfolio-register .inline-status-state { display: block; }
.register-bulk-toolbar { align-items: end; justify-content: flex-start; }
.register-bulk-toolbar[hidden], #clear-selection[hidden] { display: none; }
.register-bulk-toolbar > div { flex: 1; }
.register-bulk-toolbar p { margin: 4px 0 0; max-width: 500px; }
.register-bulk-toolbar button { flex-shrink: 0; }
.register-mobile-select { display: none; }
.portfolio-register input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--forge-dark); }
.portfolio-register a:focus-visible, .portfolio-register button:focus-visible, .portfolio-register input:focus-visible, .portfolio-register select:focus-visible { outline: 3px solid var(--forge-dark); outline-offset: 3px; }
@media (max-width: 1050px) {
    .register-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .register-bulk-toolbar { flex-wrap: wrap; }
    .register-bulk-toolbar > div { flex-basis: 100%; }
    .register-table th, .register-table td { padding: 12px; }
}
@media (max-width: 760px) {
    .register-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
    .register-filter-panel { margin-bottom: 16px; }
    .register-filter-panel > summary { display: list-item; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; font-size: .85rem; font-weight: 700; }
    .register-filter-panel > summary span { margin-left: 8px; color: var(--forge-dark); font-weight: 400; }
    .register-filter-panel > summary:focus-visible { outline: 3px solid var(--forge-dark); outline-offset: 3px; }
    .register-filter-panel[open] > summary { margin-bottom: 8px; }
    .register-mobile-select { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .85rem; }
    .lift-register-table thead .select-page { display: none; }
    .register-filter-actions { grid-column: 1 / -1; }
    .register-table-card .table-wrap { overflow: visible; }
    .register-table, .register-table tbody { display: block; }
    .register-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
    .register-table caption { display: block; }
    .register-table tr { position: relative; display: block; padding: 14px; border-bottom: 1px solid var(--line); }
    .register-table tr:last-child { border-bottom: 0; }
    .register-table td { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 12px; padding: 6px 0; border: 0; text-align: left; }
    .register-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 700; }
    .register-table .register-primary { display: block; padding: 0 0 10px; }
    .lift-register-table .register-primary { padding-right: 30px; }
    .register-table .select-column { position: absolute; top: 15px; right: 14px; display: block; padding: 0; }
    .register-table td.numeric { text-align: left; }
    .portfolio-register .inline-status-select { font-size: 16px; }
    .register-table .badge { justify-self: start; }
    .register-filters select, .register-filters input { font-size: 16px; }
    .register-pagination > * { min-height: 40px; }
}
@media (max-width: 420px) {
    .portfolio-nav { gap: 2px; }
    .portfolio-nav a { padding: 8px 10px; font-size: .82rem; }
    .register-filters { grid-template-columns: minmax(0, 1fr); }
    .register-filters .register-search { grid-column: auto; }
    .register-results { gap: 8px; }
    .register-pagination { gap: 2px; }
    .register-pagination > * { padding-inline: 8px; }
}
@media print {
    .portfolio-register .register-filter-panel { display: none; }
    .portfolio-register .portfolio-nav, .portfolio-register .register-filters, .portfolio-register .register-filter-actions, .portfolio-register .register-pagination, .portfolio-register .register-bulk-toolbar, .portfolio-register .register-mobile-select, .portfolio-register .select-column { display: none !important; }
    .portfolio-register .register-table-card, .portfolio-register .table-wrap { overflow: visible; }
    .portfolio-register .register-table { display: table; table-layout: fixed; font-size: 9px; }
    .portfolio-register .register-table caption { display: table-caption; font-size: 9px; }
    .portfolio-register .register-table thead { position: static; display: table-header-group; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
    .portfolio-register .register-table tbody { display: table-row-group; }
    .portfolio-register .register-table tr { display: table-row; break-inside: avoid; }
    .portfolio-register .register-table th, .portfolio-register .register-table td { display: table-cell; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 9px; }
    .portfolio-register .register-table td::before { display: none; }
    .portfolio-register .register-primary > .strong-link { font-size: 10px; }
    .portfolio-register .register-secondary, .portfolio-register .register-table .badge, .portfolio-register .register-table-note { font-size: 8px; }
    .portfolio-register .inline-status-select { font-size: 9px; padding: 3px; }
    .portfolio-register .register-table .numeric { text-align: right; }
    .portfolio-register .register-results { font-size: 9px; }
    .portfolio-register .lift-register-table th:nth-child(2) { width: 36%; }
    .portfolio-register .lift-register-table th:nth-child(3) { width: 24%; }
    .portfolio-register .lift-register-table th:nth-child(4) { width: 16%; }
}

.acceptance-item { margin: 0 0 20px; padding: 16px; border: 1px solid #dce3e8; border-radius: 12px; min-width: 0; }
.acceptance-item legend { padding: 0 6px; font-weight: 700; }
.acceptance-item-fields { display: grid; grid-template-columns: 2fr .7fr 1fr 1.3fr 1fr; gap: 12px; }
.acceptance-item-fields[hidden] { display: none; }
.acceptance-item-fields .field { min-width: 0; }
@media (max-width: 900px) { .acceptance-item-fields { grid-template-columns: 1fr 1fr; } .acceptance-item-fields .field:first-child { grid-column: 1 / -1; } }
@media (max-width: 540px) { .acceptance-item-fields { grid-template-columns: 1fr; } }

.contract-panel { padding: 22px; }
.contract-panel > .card-heading { padding: 0 0 16px; margin-bottom: 16px; }
.button-row.contract-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contract-table-note { padding: 0 22px 12px; }
/* Contract creation shares the existing portfolio and contract register. */
.contract-builder { max-width: 1100px; }
.contract-builder [hidden] { display: none !important; }
.contract-builder .field { display: grid; gap: 6px; align-content: start; }
.contract-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.contract-lift-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.contract-lift-tools > label:first-child { flex: 1 1 260px; }
.contract-check { display: flex; align-items: center; gap: 8px; }
.contract-builder input[type=checkbox] { width: 19px; height: 19px; flex-shrink: 0; accent-color: var(--green); }
.contract-lift-list { max-height: 390px; overflow-y: auto; border: 1px solid #dce3e7; border-radius: 8px; }
.contract-lift-option { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid #e6ebee; cursor: pointer; }
.contract-lift-option:last-child { border-bottom: 0; }
.contract-lift-option:has(input:checked) { background: #fdf2ee; }
.contract-lift-option > span { display: grid; gap: 4px; }
.contract-lift-option:focus-within { outline: 2px solid var(--green); outline-offset: -2px; }
.contract-new-lift { min-width: 0; border: 1px solid #dce3e7; border-radius: 8px; padding: 20px; margin: 18px 0; }
.contract-new-lift legend { font-weight: 700; padding: 0 8px; }
.contract-new-lift.is-removed > :not(legend):not(.contract-delete) { display: none; }
.contract-save { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
@media (max-width: 700px) {
    .contract-fields { grid-template-columns: 1fr; }
    .contract-save, .contract-builder .card-heading { flex-direction: column; align-items: stretch; }
    .contract-new-lift { padding: 12px; }
}

/* Keep contract completion in one visible, ordered workflow. */
.contract-steps { display: flex; gap: .75rem; padding: 0; margin: 0 0 1.5rem; list-style: none; flex-wrap: wrap; }
.contract-steps li { flex: 1 1 190px; padding: .85rem 1rem; background: #f3f5f4; border: 1px solid #d7dfdc; border-radius: 10px; font-weight: 600; }
.contract-steps li[aria-current="step"] { border: 2px solid var(--green); background: #eaf3ee; }
.contract-next-step { border-left: 4px solid var(--green); }
.contract-next-step .button-row { margin-top: 1rem; }
.contract-steps + .contract-panel ul { margin-bottom: 1.5rem; }
