* {
    box-sizing: border-box;
}

/* 2026 system-wide usability overhaul */
:root {
    --ui-bg: #f1f4f8;
    --ui-card: #ffffff;
    --ui-soft: #f7f9fc;
    --ui-border: #d8e0e9;
    --ui-text: #13233c;
    --ui-muted: #617086;
    --ui-orange: #f5661f;
    --ui-orange-dark: #d9530f;
    --ui-shadow: 0 4px 14px rgba(15, 31, 54, .055);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--ui-bg);
    color: var(--ui-text);
}

.skip-link {
    background: #fff;
    border: 2px solid var(--ui-orange);
    border-radius: 8px;
    color: var(--ui-text);
    font-weight: 900;
    left: 12px;
    padding: 10px 14px;
    position: fixed;
    top: -70px;
    transition: top .15s ease;
    z-index: 1000;
}

.skip-link:focus {
    top: 12px;
}

.sidebar {
    box-shadow: 6px 0 24px rgba(11, 20, 35, .12);
    scrollbar-color: #4b5567 transparent;
    width: 224px;
    z-index: 40;
}

.brand {
    margin-bottom: 16px;
}

.brand-main {
    font-size: 37px;
}

.brand-sub {
    font-size: 12px;
}

.nav-group {
    margin-top: 3px;
}

.nav-group > summary {
    border-radius: 7px;
    min-height: 38px;
    padding: 8px 11px;
}

.nav-group-links {
    margin: 3px 0 5px 9px;
    padding-left: 7px;
}

.nav-group-links a {
    font-size: 13px;
    min-height: 34px;
    padding-bottom: 7px;
    padding-top: 7px;
}

.side-card {
    font-size: 12px;
    gap: 5px;
    margin-top: 18px;
    padding: 11px;
}

.main {
    overflow: hidden;
    padding: 16px clamp(14px, 1.8vw, 28px) 32px;
}

.topbar {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--ui-shadow);
    gap: 14px;
    margin-bottom: 16px;
    min-height: 72px;
    padding: 10px 13px;
    position: sticky;
    top: 8px;
    z-index: 30;
}

.topbar-brand {
    flex: 0 0 auto;
}

.topbar-brand h1 {
    font-size: 22px;
}

.topbar-brand p {
    white-space: nowrap;
}

.global-search {
    flex: 1 1 360px;
    max-width: 520px;
    min-width: 220px;
    position: relative;
}

.global-search > label {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
    clip: rect(0 0 0 0);
}

.global-search-input-wrap {
    align-items: center;
    background: var(--ui-soft);
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    display: flex;
    min-height: 42px;
    padding: 0 8px 0 12px;
}

.global-search-input-wrap:focus-within {
    background: #fff;
    border-color: var(--ui-orange);
    box-shadow: 0 0 0 3px rgba(245, 102, 31, .14);
}

.global-search-input-wrap > span {
    color: #667085;
    font-size: 22px;
    line-height: 1;
    margin-right: 7px;
}

.global-search-input-wrap input {
    background: transparent;
    border: 0;
    box-shadow: none !important;
    min-height: 40px;
    padding: 8px 2px;
}

.global-search-input-wrap button {
    align-items: center;
    background: #e8edf3;
    border: 0;
    border-radius: 999px;
    color: #475467;
    cursor: pointer;
    display: flex;
    font-size: 18px;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.global-search-results {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(15, 31, 54, .2);
    display: grid;
    left: 0;
    max-height: min(520px, 70vh);
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 100;
}

.global-search-results a {
    border-bottom: 1px solid #edf1f5;
    color: var(--ui-text);
    display: grid;
    gap: 2px 9px;
    grid-template-columns: 68px minmax(0, 1fr);
    padding: 9px 10px;
    text-decoration: none;
}

.global-search-results a:last-child {
    border-bottom: 0;
}

.global-search-results a:hover {
    background: #fff5ed;
    border-radius: 7px;
}

.global-search-type {
    align-self: start;
    background: #eef2f6;
    border-radius: 999px;
    color: #526178;
    font-size: 9px;
    font-weight: 900;
    grid-row: 1 / span 2;
    letter-spacing: .04em;
    padding: 4px 7px;
    text-align: center;
    text-transform: uppercase;
}

.global-search-results strong {
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-results small,
.global-search-empty {
    color: var(--ui-muted);
    font-size: 11px;
}

.global-search-empty {
    padding: 14px;
    text-align: center;
}

.topbar-quick-links {
    flex: 0 0 auto;
}

.topbar-account {
    flex: 0 0 auto;
}

.profile strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-head {
    margin-bottom: 13px;
}

.page-head h1 {
    font-size: clamp(24px, 2vw, 30px);
}

.page-head p {
    margin-top: 2px;
}

.panel,
.kpi {
    border-color: var(--ui-border);
    box-shadow: var(--ui-shadow);
}

.panel {
    padding: 17px;
}

.record-workspace,
.quote-workspace,
.grid {
    gap: 13px;
}

.record-workspace > *,
.quote-workspace > *,
.grid > * {
    min-width: 0;
}

.table-panel {
    border-radius: 11px;
    scrollbar-color: #aab4c1 #eef2f6;
    scrollbar-width: thin;
}

.table-panel-head {
    gap: 12px;
    margin-bottom: 10px;
}

.table-panel-head h2 {
    font-size: 20px;
}

.data-table th {
    background: #f1f4f8;
    color: #344054;
    font-size: 11px;
    letter-spacing: .035em;
    padding: 9px 8px;
}

.data-table td {
    font-size: 13px;
    padding: 9px 8px;
}

.data-table td > strong:first-child {
    color: var(--ui-text);
}

.data-table tbody tr:hover {
    background: #fff7f0;
}

.register-filter-bar,
.job-filter-bar {
    background: #f5f7fa;
    border-color: var(--ui-border);
    margin-bottom: 12px;
    padding: 9px;
}

.register-filter-bar label,
.job-filter-bar label {
    font-size: 11px;
}

.register-filter-bar input,
.register-filter-bar select,
.job-filter-bar input,
.job-filter-bar select {
    min-height: 40px;
}

input,
select,
textarea {
    border-color: #c8d1dc;
}

label {
    margin-bottom: 11px;
}

.button-row {
    margin-top: 3px;
}

.primary,
.secondary,
.danger,
.secondary-link {
    min-height: 38px;
}

.primary {
    background: var(--ui-orange);
}

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

.open-form-card {
    max-width: 330px;
    min-height: 62px;
    padding: 11px 14px;
}

.open-form-card span {
    font-size: 11px;
}

.open-form-card strong {
    font-size: 15px;
}

.notice {
    margin-bottom: 12px;
    padding: 12px 15px;
}

.office-action-card {
    position: relative;
}

.office-action-card::after {
    bottom: 10px;
    color: rgba(20, 35, 60, .42);
    content: "→";
    font-size: 16px;
    position: absolute;
    right: 11px;
}

.office-action-card:hover {
    box-shadow: 0 8px 22px rgba(15, 31, 54, .1);
    transform: translateY(-2px);
}

.dashboard-dropdown > summary,
.office-priority-list > summary,
.settings-section > summary {
    cursor: pointer;
}

@media (max-width: 1180px) {
    .topbar-quick-links {
        display: none;
    }

    .global-search {
        max-width: none;
    }
}

@media (max-width: 800px) {
    .sidebar {
        box-shadow: 0 5px 18px rgba(11, 20, 35, .18);
        width: 100%;
    }

    .main {
        padding: 10px 10px 26px;
    }

    .topbar {
        display: grid;
        gap: 9px;
        grid-template-columns: 1fr;
        position: static;
    }

    .topbar-brand {
        display: none;
    }

    .global-search {
        min-width: 0;
        order: -1;
        width: 100%;
    }

    .global-search-results {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 70px;
    }

    .topbar-account {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .topbar-account .account-switch-link {
        width: auto;
    }

    .profile {
        min-width: 145px;
        padding: 8px 10px;
        width: auto;
    }

    .page-head {
        padding: 0 3px;
    }

    .panel {
        padding: 13px;
    }

    .table-panel {
        margin-left: 0;
        margin-right: 0;
        padding-left: 8px;
        padding-right: 8px;
    }

    .data-table {
        min-width: 720px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 7px;
    }

    .entry-form-panel {
        padding: 14px;
    }
}

@media (max-width: 520px) {
    .topbar-account {
        grid-template-columns: 1fr;
    }

    .topbar-account .account-switch-link,
    .profile {
        width: 100%;
    }

    .global-search-results a {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .page-head h1 {
        font-size: 23px;
    }
}

.job-labour-save-summary {
    align-items: center;
    background: #fff8f1;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 11px;
}

.job-labour-save-summary span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.job-labour-save-summary strong {
    color: #172033;
    font-size: 15px;
}

/* Business intelligence */
.bi-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.bi-period { display:flex; align-items:flex-end; gap:12px; padding:12px 16px; background:#fff; border:1px solid #dbe3ec; border-radius:14px; }
.bi-period label { min-width:180px; }
.bi-period span { color:#64748b; white-space:nowrap; padding-bottom:12px; }
.bi-section { margin-top:18px; padding:22px 26px; }
.bi-section-head { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:16px; }
.bi-section-head > div:first-child { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bi-section-head h2, .bi-section-head p { margin:0; }
.bi-section-head p { width:100%; margin-left:42px; color:#64748b; }
.bi-step { display:inline-grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#ff681f; color:#fff; font-weight:800; }
.bi-kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.bi-kpis.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.bi-kpis > div, .bi-kpis > a { display:flex; flex-direction:column; gap:4px; min-width:0; padding:16px; border:1px solid #dbe3ec; border-left:5px solid #3478f6; border-radius:12px; background:#fff; color:inherit; text-decoration:none; }
.bi-kpis small { color:#526178; font-weight:700; }
.bi-kpis strong { font-size:clamp(1.2rem,2vw,1.75rem); }
.bi-kpis span { color:#64748b; font-size:.88rem; }
.bi-kpis .warn { border-left-color:#e2a20a; background:#fffaf0; }
.bi-kpis .danger { border-left-color:#d9362b; background:#fff6f4; }
.bi-kpis .good { border-left-color:#21a35b; background:#f5fcf7; }
.bi-margin { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.bi-margin input { width:84px; }
.bi-split { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.bi-split h3 { margin:0 0 10px; }
.bi-row-warn td { background:#fffaf0; }
.data-table td.negative { color:#b42318; font-weight:800; }
.data-table td.positive { color:#087a42; font-weight:800; }
.job-budget-form { grid-template-columns:repeat(4,minmax(0,1fr)); }

@media (max-width: 1150px) {
    .bi-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .bi-kpis.four { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .job-budget-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .bi-head, .bi-section-head, .bi-period { align-items:stretch; flex-direction:column; }
    .bi-period span { padding-bottom:0; }
    .bi-section { padding:17px; }
    .bi-section-head p { margin-left:0; }
    .bi-kpis, .bi-kpis.four, .bi-split, .job-budget-form { grid-template-columns:1fr; }
}

/* Jobs workspace: compact workflow-first register */
.job-filter-bar {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
    margin: 0 0 16px;
    padding: 12px;
}

.job-filter-bar label {
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}

.job-filter-bar label span {
    display: block;
    margin: 0 0 5px;
}

.job-filter-bar input {
    min-height: 40px;
}

.job-more-filters {
    position: relative;
}

.job-more-filters > summary,
.job-filter-clear {
    align-items: center;
    background: #e9eff5;
    border: 0;
    border-radius: 8px;
    color: #25364d;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    list-style: none;
    min-height: 40px;
    padding: 8px 12px;
    white-space: nowrap;
}

.job-more-filters > summary::-webkit-details-marker {
    display: none;
}

.job-more-filters[open] > summary {
    background: #dce6ef;
}

.job-more-filter-grid {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.16);
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    margin-top: 7px;
    padding: 12px;
    position: absolute;
    right: 0;
    width: 410px;
    z-index: 20;
}

@media (min-width: 801px) {
    .table-panel .job-register-table {
        min-width: 1060px;
        table-layout: fixed;
    }

    .job-register-table th:nth-child(1) { width: 17%; }
    .job-register-table th:nth-child(2) { width: 17%; }
    .job-register-table th:nth-child(3) { width: 15%; }
    .job-register-table th:nth-child(4) { width: 27%; }
    .job-register-table th:nth-child(5) { width: 13%; }
    .job-register-table th:nth-child(6) { width: 11%; }
}

.job-register-row > td {
    padding-bottom: 18px;
    padding-top: 18px;
    vertical-align: top;
}

.job-identity-cell,
.job-customer-cell {
    min-width: 0;
}

.job-identity-cell > span,
.job-customer-cell > span,
.job-customer-cell > strong {
    display: block;
}

.job-number-line {
    align-items: center;
    display: flex;
    gap: 8px;
}

.job-number-line strong {
    color: #10233f;
    font-size: 16px;
}

.job-number-line span {
    background: #eef2f6;
    border-radius: 999px;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7px;
}

.job-title {
    color: #344054;
    line-height: 1.4;
    margin-top: 7px;
}

.job-meta,
.job-customer-cell > span {
    color: #667085;
    font-size: 12px;
    margin-top: 6px;
}

.job-address {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.job-dates-cell .status {
    display: inline-flex;
    margin-bottom: 10px;
}

.job-financial-cell {
    min-width: 270px;
}

.job-financial-summary {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-financial-summary > div {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    min-width: 0;
    padding: 8px;
}

.job-financial-summary span,
.job-financial-summary strong {
    display: block;
}

.job-financial-summary span {
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.job-financial-summary strong {
    font-size: 13px;
    overflow-wrap: normal;
    white-space: nowrap;
}

.job-profit-value {
    background: #f0f9f5 !important;
    border-color: #b7e2ce !important;
}

.job-breakdown-grid {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 7px;
    padding: 9px;
}

.job-breakdown-grid span {
    color: #667085;
    display: flex;
    flex-direction: column;
    font-size: 11px;
}

.job-breakdown-grid strong {
    color: #25364d;
    font-size: 12px;
    margin-top: 2px;
}

.job-controls-cell {
    min-width: 126px;
}

.job-open-button {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 38px;
    text-decoration: none;
    white-space: nowrap;
}

.job-action-menu {
    display: block;
    margin-top: 8px;
    min-width: 0;
    width: 100%;
}

.job-action-menu summary {
    text-align: center;
}

.job-action-menu .action-menu-list {
    min-width: 230px !important;
}

.action-group-label {
    border-bottom: 1px solid #e4e9ef;
    color: #667085;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin: 4px 2px 1px;
    padding-bottom: 5px;
    text-transform: uppercase;
}

@media (max-width: 1150px) {
    .job-filter-bar {
        grid-template-columns: repeat(2, minmax(160px, 1fr)) auto auto;
    }
}

@media (max-width: 800px) {
    .job-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .job-more-filters,
    .job-filter-clear {
        width: 100%;
    }

    .job-more-filter-grid {
        grid-template-columns: 1fr;
        left: 0;
        right: auto;
        width: min(82vw, 360px);
    }

    .job-financial-summary {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .job-register-table td[data-label="Financial position"] {
        grid-column: 1 / -1;
    }
}

/* Vehicle MOT and tax lookup */
.vehicle-start-actions {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(300px, 0.75fr) minmax(460px, 1.25fr);
}

.vehicle-start-actions .open-form-card {
    height: 100%;
    margin: 0;
    width: 100%;
}

.vehicle-dvla-lookup-card {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 18px 20px;
}

.vehicle-dvla-lookup-card h2,
.vehicle-dvla-lookup-card p {
    margin-bottom: 0;
}

.vehicle-dvla-lookup-card .eyebrow {
    color: #f0641e;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.vehicle-dvla-lookup-controls {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(190px, 1fr) auto;
}

.vehicle-dvla-lookup-controls label {
    margin: 0;
}

.vehicle-dvla-lookup-controls input {
    text-transform: uppercase;
}

.vehicle-dvla-lookup-controls button {
    min-height: 48px;
    white-space: nowrap;
}

.vehicle-dvla-setup-note {
    background: #fff7ed;
    border-left: 4px solid #f0641e;
    border-radius: 7px;
    padding: 8px 10px;
}

@media (max-width: 900px) {
    .vehicle-start-actions,
    .vehicle-dvla-lookup-controls {
        grid-template-columns: 1fr;
    }
}

/* Clear, full-width weekly calendar planner */
.calendar-planner {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.planner-day {
    background: #ffffff;
    border: 1px solid #dfe5ec;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
}

.planner-day.today { border-color: #f26a21; }

.planner-day.selected {
    background: #fffaf5;
    box-shadow: 0 0 0 2px rgba(242, 106, 33, 0.13);
}

.planner-day-heading {
    align-items: flex-start;
    background: #f7f9fc;
    border: 0;
    border-right: 1px solid #dfe5ec;
    color: #172033;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 2px;
    justify-content: center;
    padding: 13px 15px;
    text-align: left;
}

.planner-day.selected .planner-day-heading { background: #fff3e8; }

.planner-day-heading span {
    color: #475467;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.planner-day-heading strong { font-size: 19px; }

.planner-day-heading small {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.planner-day-items {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    min-width: 0;
    padding: 9px;
}

.planner-free {
    align-self: center;
    color: #98a2b3;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 5px;
}

.planner-card {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-left: 5px solid #667085;
    border-radius: 8px;
    color: #172033;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    text-align: left;
    text-decoration: none;
}

.planner-card:hover {
    box-shadow: 0 3px 10px rgba(23, 32, 51, 0.1);
    transform: translateY(-1px);
}

.planner-card-top {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.planner-card-top b { font-size: 12px; }

.planner-card-top em {
    border-radius: 999px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    padding: 2px 7px;
    text-transform: uppercase;
}

.planner-card small {
    color: #667085;
    font-size: 12px;
}

.planner-card.calendar-job { background: #edf5ff; border-left-color: #3978c5; }
.planner-card.calendar-job em { background: #dbeafe; color: #1d4f91; }
.planner-card.calendar-survey { background: #fff5eb; border-left-color: #f26a21; }
.planner-card.calendar-survey em { background: #ffedd5; color: #9a430e; }
.planner-card.calendar-holiday { background: #effbf3; border-left-color: #27a45f; }
.planner-card.calendar-holiday em { background: #dcfce7; color: #176b3a; }
.planner-card.calendar-vehicle { background: #f5f1ff; border-left-color: #7a52c7; }
.planner-card.calendar-vehicle em { background: #ede9fe; color: #5839a0; }
.planner-card.calendar-other { background: #f8fafc; border-left-color: #667085; }
.planner-card.calendar-other em { background: #e4e7ec; color: #344054; }
.planner-card.calendar-apprentice { background: #ecfdfb; border-left-color: #0f9f95; }
.planner-card.calendar-apprentice em { background: #ccfbf1; color: #0f625c; }
.planner-card.calendar-labourer { background: #fffaeb; border-left-color: #e6a400; }
.planner-card.calendar-labourer em { background: #fef0c7; color: #854a0e; }
.planner-card.calendar-subcontractor { background: #f5f1ff; border-left-color: #7a52c7; }
.planner-card.calendar-subcontractor em { background: #e9ddff; color: #5839a0; }
.planner-card.calendar-plumber { background: #eaf8ff; border-left-color: #168aad; }
.planner-card.calendar-plumber em { background: #cceffc; color: #075a75; }
.planner-card.calendar-joiner { background: #fff1eb; border-left-color: #b85c2d; }
.planner-card.calendar-joiner em { background: #ffddcc; color: #823b18; }

.calendar-key.calendar-apprentice { background: #ccfbf1; color: #0f625c; }
.calendar-key.calendar-labourer { background: #fef0c7; color: #854a0e; }
.calendar-key.calendar-subcontractor { background: #e9ddff; color: #5839a0; }
.calendar-key.calendar-plumber { background: #cceffc; color: #075a75; }
.calendar-key.calendar-joiner { background: #ffddcc; color: #823b18; }

.calendar-trade-key {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: -3px 0 13px;
}

.calendar-trade-key > span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-right: 2px;
}

.calendar-trade-key b {
    border-left: 4px solid;
    border-radius: 6px;
    font-size: 11px;
    padding: 4px 8px;
}

.calendar-trade-key .trade-apprentice { background: var(--trade-apprentice-bg); border-color: var(--trade-apprentice-border); color: var(--trade-apprentice-text); }
.calendar-trade-key .trade-labourer { background: var(--trade-labourer-bg); border-color: var(--trade-labourer-border); color: var(--trade-labourer-text); }
.calendar-trade-key .trade-subcontractor { background: var(--trade-subcontractor-bg); border-color: var(--trade-subcontractor-border); color: var(--trade-subcontractor-text); }
.calendar-trade-key .trade-plumber { background: var(--trade-plumber-bg); border-color: var(--trade-plumber-border); color: var(--trade-plumber-text); }
.calendar-trade-key .trade-joiner { background: var(--trade-joiner-bg); border-color: var(--trade-joiner-border); color: var(--trade-joiner-text); }

.calendar-upcoming-disclosure { margin-top: 16px; }

/* Streamlined shared interface */
.nav-group {
    margin-top: 5px;
}

.nav-group > summary {
    align-items: center;
    border-radius: 7px;
    color: #d0d5dd;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    justify-content: space-between;
    list-style: none;
    padding: 9px 11px;
    text-transform: uppercase;
}

.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { color: #98a2b3; content: "+"; font-size: 16px; }
.nav-group[open] > summary::after { content: "\2212"; }
.nav-group > summary:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }

.nav-group-links {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 1px 0 7px 14px;
    padding-left: 7px;
}

.nav-group-links a {
    font-size: 13px;
    padding-bottom: 7px;
    padding-top: 7px;
}

.record-workspace {
    margin-bottom: 16px;
}

.open-form-card {
    align-items: center;
    border-left-width: 4px;
    display: inline-grid;
    gap: 0 10px;
    grid-template-columns: auto 1fr;
    max-width: min(100%, 340px);
    min-height: 50px;
    padding: 9px 42px 9px 13px;
    position: relative;
}

.open-form-card::after {
    align-items: center;
    background: #fff0e5;
    border-radius: 999px;
    color: #d95812;
    content: "+";
    display: flex;
    font-size: 18px;
    font-weight: 900;
    height: 26px;
    justify-content: center;
    position: absolute;
    right: 10px;
    top: 11px;
    width: 26px;
}

.open-form-card span {
    font-size: 11px;
    grid-column: 1 / -1;
    line-height: 1.1;
}

.open-form-card strong {
    font-size: 14px;
    grid-column: 1 / -1;
    line-height: 1.25;
}

.page-head > .secondary-link,
.page-head > .primary,
.page-head > a {
    flex: 0 0 auto;
}

.form-section-head {
    align-items: flex-start;
    gap: 16px;
}

.form-section-head .secondary.small {
    background: #f2f4f7;
    border-color: #d0d5dd;
    color: #344054;
}

.button-row {
    row-gap: 8px;
}

.button-row .primary:first-child {
    order: -1;
}

.panel > h2:first-child,
.table-panel > h2:first-child {
    letter-spacing: -0.02em;
}

.data-table td > span:not(.status) {
    color: #667085;
}

@media (max-width: 800px) {
    .nav-group > summary { min-height: 40px; }
    .nav-group-links { margin-left: 12px; }
    .open-form-card { display: grid; max-width: 100%; width: 100%; }
}

@media (max-width: 700px) {
    .calendar-overview-panel { padding: 12px; }
    .calendar-nav-controls > * { flex: 1 1 auto; }
    .calendar-nav-controls input { width: 100%; }
    .planner-day { grid-template-columns: 1fr; }

    .planner-day-heading {
        align-items: center;
        border-bottom: 1px solid #dfe5ec;
        border-right: 0;
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .planner-day-heading small { margin-left: auto; }
    .planner-day-items { grid-template-columns: 1fr; }
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #172033;
    -webkit-text-size-adjust: 100%;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #172033;
    color: white;
    padding: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.brand {
    margin-bottom: 24px;
}

.brand-main {
    color: #f26a21;
    font-size: 48px;
    font-weight: 900;
    line-height: 0.9;
}

.brand-sub {
    font-size: 17px;
    font-weight: 800;
    margin-top: 8px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav a {
    border-radius: 6px;
    color: white;
    font-weight: 700;
    padding: 11px 12px;
    text-decoration: none;
}

.nav a.active,
.nav a:hover {
    background: #f26a21;
}

.side-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    gap: 9px;
    margin-top: 28px;
    padding: 14px;
}

.side-card strong {
    color: #ffb26b;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 24px;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: 32px;
    margin: 0;
}

.topbar h1 span {
    color: #f26a21;
}

.topbar p,
.page-head p {
    color: #667085;
    margin: 4px 0 0;
}

.search {
    border: 1px solid #cfd6df;
    border-radius: 8px;
    padding: 12px 14px;
    width: min(420px, 40vw);
}

.topbar-account {
    align-items: center;
    display: flex;
    gap: 12px;
}

.topbar-account .account-switch-link {
    align-items: center;
    background: #f26a21;
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    min-height: 40px;
    padding: 10px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-account .account-switch-link:hover {
    background: #d95812;
}

.profile {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.logout-link {
    color: #d95812;
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

.page-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-head h1 {
    margin: 0;
}

.kpis {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 18px;
}

.salary-costs-panel {
    margin: 12px 0;
    padding: 12px 14px;
}

.salary-cost-kpis {
    margin: 10px 0 8px;
}

.salary-cost-details {
    margin-top: 4px;
}

.salary-cost-table {
    margin-top: 12px;
}

.compact-cost-kpis {
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 8px;
}

.compact-cost-kpis .kpi {
    border-left-width: 4px;
    gap: 2px;
    min-height: 64px;
    padding: 9px 11px;
}

.compact-cost-kpis .kpi small {
    font-size: 10px;
    line-height: 1.2;
}

.compact-cost-kpis .kpi strong {
    font-size: clamp(17px, 1.55vw, 21px);
    line-height: 1.05;
}

.combined-costs-panel {
    margin: 12px 0;
    padding: 12px 14px;
}

.combined-cost-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
}

.combined-cost-note {
    font-size: 11px;
    margin-bottom: 0;
}

.running-cost-note {
    font-size: 11px;
    margin: 4px 0 10px;
}

.salary-costs-panel .form-section-head,
.combined-costs-panel .form-section-head {
    margin-bottom: 0;
}

.salary-costs-panel .form-section-head h2,
.combined-costs-panel .form-section-head h2 {
    font-size: 19px;
    margin-bottom: 2px;
}

.salary-costs-panel .form-section-head p,
.combined-costs-panel .form-section-head p {
    font-size: 11px;
    margin: 0;
}

.salary-costs-panel .secondary-link {
    min-height: 34px;
    padding: 7px 10px;
}

.salary-cost-details > summary {
    font-size: 12px;
    padding: 8px 10px;
}

@media (max-width: 700px) {
    .compact-cost-kpis,
    .combined-cost-kpis {
        grid-template-columns: 1fr;
    }
}

/* Streamlined Jobs register. */
.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.job-overview-strip {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(230px, .7fr) minmax(540px, 2.3fr);
}

.job-overview-strip .open-form-card {
    height: 100%;
    margin: 0;
    max-width: none;
    min-height: 68px;
    width: 100%;
}

.job-money-overview {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    box-shadow: var(--ui-shadow);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 68px;
    overflow: hidden;
}

.job-money-overview > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 9px 16px;
}

.job-money-overview > div + div {
    border-left: 1px solid var(--ui-border);
}

.job-money-overview span {
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
}

.job-money-overview strong {
    color: var(--ui-text);
    font-size: clamp(17px, 1.6vw, 22px);
    line-height: 1.2;
    margin-top: 3px;
    white-space: nowrap;
}

.job-money-overview .job-money-total {
    background: #fff5ed;
    border-left: 4px solid var(--ui-orange);
}

.job-money-overview .job-money-total span {
    color: #9a430e;
}

.job-tracker-toolbar {
    align-items: center;
    background: #f5f7fa;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    margin-bottom: 10px;
    padding: 7px;
}

.job-quick-search {
    margin: 0;
}

.job-quick-search input {
    background: #fff;
    min-height: 40px;
    width: 100%;
}

.job-filter-disclosure {
    position: relative;
}

.job-filter-disclosure > summary,
.job-toolbar-clear {
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    gap: 7px;
    justify-content: center;
    list-style: none;
    min-height: 40px;
    padding: 8px 14px;
    white-space: nowrap;
}

.job-filter-disclosure > summary {
    background: #e8eef4;
    color: #25364d;
}

.job-filter-disclosure > summary::-webkit-details-marker { display: none; }
.job-filter-disclosure > summary::after { content: "▾"; font-size: 10px; }
.job-filter-disclosure[open] > summary { background: #dce6ef; }
.job-filter-disclosure[open] > summary::after { content: "▴"; }

.job-filter-disclosure > summary > span {
    background: var(--ui-orange);
    border-radius: 999px;
    color: #fff;
    display: inline-grid;
    font-size: 10px;
    min-height: 19px;
    min-width: 19px;
    place-items: center;
}

.job-filter-popover {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 24, 40, .16);
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: min(620px, 76vw);
    z-index: 25;
}

.job-filter-popover label {
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    margin: 0;
}

.job-filter-popover label span {
    display: block;
    margin-bottom: 4px;
}

.job-filter-popover select {
    min-height: 40px;
}

.job-toolbar-clear:disabled {
    cursor: default;
    opacity: .48;
}

@media (min-width: 801px) {
    .job-register-table th:nth-child(1) { width: 12%; }
    .job-register-table th:nth-child(2) { width: 15%; }
    .job-register-table th:nth-child(3) { width: 18%; }
    .job-register-table th:nth-child(4) { width: 18%; }
    .job-register-table th:nth-child(5) { width: 20%; }
    .job-register-table th:nth-child(6) { width: 17%; }

    .job-register-row > td {
        padding-bottom: 8px;
        padding-top: 8px;
    }

    .job-register-table .job-status-cell .status {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 900px) {
    .job-overview-strip { grid-template-columns: 1fr; }
    .job-filter-popover { grid-template-columns: 1fr; width: min(360px, 84vw); }
}

@media (max-width: 620px) {
    .job-money-overview { grid-template-columns: 1fr; }
    .job-money-overview > div + div { border-left: 0; border-top: 1px solid var(--ui-border); }
    .job-money-overview .job-money-total { border-left: 0; border-top: 3px solid var(--ui-orange); }
    .job-tracker-toolbar { grid-template-columns: 1fr auto; }
    .job-quick-search { grid-column: 1 / -1; }
}

/* Streamlined completed-job archive. */
.completed-jobs-page-head {
    align-items: end;
    gap: 18px;
    margin-bottom: 10px;
}

.completed-jobs-tools {
    align-items: center;
    display: grid;
    flex: 0 1 650px;
    gap: 8px;
    grid-template-columns: minmax(280px, 1fr) minmax(180px, .55fr);
}

.completed-jobs-search,
.completed-jobs-month-filter {
    display: block;
    flex: none;
    margin: 0;
    width: 100%;
}

.completed-jobs-search input,
.completed-jobs-month-filter select {
    min-height: 42px;
    width: 100%;
}

.completed-jobs-running-totals {
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    box-shadow: var(--ui-shadow);
    gap: 0;
    margin-bottom: 12px;
    overflow: hidden;
}

.completed-jobs-running-totals > div {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    justify-content: center;
    min-height: 66px;
    padding: 9px 14px;
}

.completed-jobs-running-totals > div + div {
    border-left: 1px solid var(--ui-border);
}

.completed-jobs-running-totals small {
    font-size: 11px;
}

.completed-jobs-running-totals strong {
    font-size: clamp(17px, 1.55vw, 21px);
    margin-top: 2px;
    white-space: nowrap;
}

.completed-jobs-running-totals .completed-jobs-profit-total {
    border-left: 4px solid #21a35b;
}

.completed-jobs-running-totals .completed-jobs-profit-total.is-loss {
    border-left-color: #d9362b;
}

.completed-jobs-list {
    gap: 8px;
}

.completed-job-card {
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .045);
}

.completed-job-summary {
    gap: 12px;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, auto) 24px;
    min-height: 76px;
    padding: 10px 14px;
}

.completed-job-summary-main h2 {
    font-size: 17px;
    margin-bottom: 3px;
}

.completed-job-summary-main h2 small {
    background: #eef2f6;
    border-radius: 999px;
    display: inline-block;
    font-size: 10px;
    margin-left: 4px;
    padding: 2px 6px;
    vertical-align: 2px;
}

.completed-job-summary-main p,
.completed-job-summary-main > span {
    display: inline;
    font-size: 11px;
}

.completed-job-summary-main p {
    display: block;
    max-width: 720px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.completed-job-summary-figures {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(135px, 1fr));
}

.completed-job-summary-figures > span {
    border: 0;
    border-left: 3px solid #d6dee7;
    border-radius: 6px;
    min-height: 46px;
    padding: 5px 10px;
}

.completed-job-summary-figures small {
    font-size: 10px;
}

.completed-job-summary-figures strong {
    font-size: 15px;
    margin-top: 1px;
}

.completed-job-summary-figures .completed-job-summary-profit {
    border: 0;
    border-left: 3px solid var(--ui-orange);
}

.completed-job-summary-toggle {
    height: 24px;
    width: 24px;
}

.completed-job-expanded {
    padding: 15px;
}

@media (max-width: 1000px) {
    .completed-jobs-page-head { align-items: stretch; flex-direction: column; }
    .completed-jobs-tools { flex-basis: auto; width: 100%; }
    .completed-job-summary { grid-template-columns: 1fr 24px; }
    .completed-job-summary-figures { grid-column: 1 / -1; grid-row: 2; }
    .completed-job-summary-toggle { grid-column: 2; grid-row: 1; }
}

@media (max-width: 620px) {
    .completed-jobs-tools { grid-template-columns: 1fr; }
    .completed-jobs-running-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .completed-jobs-running-totals > div + div { border-left: 0; }
    .completed-jobs-running-totals > div:nth-child(even) { border-left: 1px solid var(--ui-border); }
    .completed-jobs-running-totals > div:nth-child(n+3) { border-top: 1px solid var(--ui-border); }
    .completed-job-summary-figures { grid-template-columns: 1fr 1fr; }
}

.dashboard-financial-panel {
    margin-bottom: 18px;
}

.office-action-centre {
    border-top: 5px solid #f26a21;
    margin-bottom: 18px;
}

.office-action-head {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.office-action-head h2,
.office-action-head p {
    margin: 0;
}

.office-action-head p {
    color: #667085;
    font-size: 13px;
    margin-top: 3px;
}

.office-action-eyebrow {
    color: #d95812;
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.office-action-total {
    background: #fff4ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #9a3412;
    padding: 8px 12px;
    white-space: nowrap;
}

.office-action-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.office-action-card {
    background: #f8fafc;
    border: 1px solid #dce3eb;
    border-radius: 9px;
    color: #172033;
    display: flex;
    flex-direction: column;
    min-height: 90px;
    padding: 10px;
    text-decoration: none;
}

.office-action-card > span {
    font-size: 11px;
    font-weight: 800;
}

.office-action-card > strong {
    font-size: 24px;
    line-height: 1;
    margin: 6px 0 4px;
}

.office-action-card > small {
    color: #667085;
    font-size: 10px;
    line-height: 1.25;
}

.office-action-card.urgent {
    background: #fff1ef;
    border-color: #f3b3aa;
}

.office-action-card.attention {
    background: #fff8e7;
    border-color: #edd397;
}

.office-action-card.ready {
    background: #eef9f1;
    border-color: #b9e2c3;
}

.office-action-card.clear {
    opacity: 0.72;
}

.office-priority-list {
    margin-top: 12px;
}

.office-priority-list > summary {
    background: #eef2f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    padding: 9px 11px;
}

.office-priority-columns {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 9px;
}

.office-priority-columns a {
    align-items: center;
    border: 1px solid #e3e8ef;
    border-radius: 7px;
    color: #172033;
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    text-decoration: none;
}

.office-priority-columns a:hover {
    border-color: #f26a21;
}

.office-priority-columns span {
    color: #667085;
    font-size: 11px;
}

.receipt-inbox-summary {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 10px;
}

.receipt-queue-card {
    align-items: flex-start;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 9px;
    color: #172033;
    display: flex;
    flex-direction: column;
    min-height: 54px;
    padding: 7px 10px;
    text-align: left;
}

.receipt-queue-card:hover,
.receipt-queue-card.active {
    background: #fff4ed;
    border-color: #f26a21;
}

.receipt-queue-card span {
    color: #667085;
    font-size: 10px;
    font-weight: 800;
}

.receipt-queue-card strong {
    font-size: 19px;
    margin-top: 1px;
}

.receipt-inbox-workspace {
    margin-bottom: 10px;
}

.receipt-inbox-toolbar {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 9px 12px;
}

.receipt-inbox-toolbar > div {
    display: grid;
    gap: 1px;
    margin-right: auto;
}

.receipt-inbox-toolbar > div span {
    color: #667085;
    font-size: 11px;
}

.receipt-inbox-toolbar .primary,
.receipt-inbox-toolbar .secondary {
    min-height: 38px;
    padding: 8px 13px;
}

.receipt-bulk-upload-button {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.receipt-bulk-upload-button input {
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.receipt-inbox-upload-actions {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.receipt-bulk-upload-card {
    background: #fff;
    border: 1px solid #b8d4ff;
    border-left: 5px solid #2f6fed;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 68px;
    padding: 11px 16px;
    width: min(360px, 100%);
}

.receipt-bulk-upload-card span {
    color: #2f6fed;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.receipt-bulk-upload-card strong {
    font-size: 14px;
}

.receipt-bulk-upload-card input {
    font-size: 11px;
    margin-top: 5px;
    min-height: 0;
    padding: 0;
}

.receipt-inbox-register {
    margin-top: 0;
}

.receipt-list-filters {
    align-items: end;
    background: #f7f9fb;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(240px, 2fr) minmax(170px, 1fr) auto;
    margin: 0 12px 10px;
    padding: 9px 10px;
}

.receipt-list-filters label {
    font-size: 11px;
    margin: 0;
}

.receipt-list-filters input,
.receipt-list-filters select,
.receipt-list-filters button {
    min-height: 38px;
    padding-bottom: 7px;
    padding-top: 7px;
}

.receipt-profit-panel {
    margin-top: 12px;
    overflow: hidden;
    padding: 0;
}

.receipt-profit-toggle {
    align-items: center;
    background: #fff;
    border: 0;
    color: #172033;
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    text-align: left;
    width: 100%;
}

.receipt-profit-toggle:hover {
    background: #f7f9fb;
}

.receipt-profit-toggle > span:first-child {
    display: grid;
    gap: 2px;
}

.receipt-profit-toggle small {
    color: #667085;
    font-weight: 500;
}

.receipt-profit-toggle > span:last-child {
    background: #edf1f5;
    border-radius: 7px;
    padding: 7px 10px;
}

.receipt-profit-table {
    border-top: 1px solid #e1e7ee;
    padding: 0 12px 12px;
}

.receipt-quick-assign {
    align-items: center;
    display: flex;
    gap: 5px;
    min-width: 230px;
}

.receipt-quick-assign select {
    min-height: 36px;
    min-width: 150px;
    padding: 6px 8px;
}

.receipt-duplicate-warning {
    color: #b42318;
    display: block;
    font-size: 10px;
    font-weight: 900;
    margin-top: 4px;
}

@media (max-width: 1180px) {
    .office-action-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

@media (max-width: 700px) {
    .office-action-grid,
    .office-priority-columns,
    .receipt-inbox-summary {
        grid-template-columns: 1fr;
    }

    .receipt-inbox-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .receipt-inbox-toolbar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .receipt-inbox-toolbar > div {
        flex-basis: 100%;
    }

    .receipt-inbox-toolbar .primary,
    .receipt-inbox-toolbar .secondary {
        flex: 1 1 150px;
    }

    .receipt-list-filters {
        grid-template-columns: 1fr;
    }
}

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

.dashboard-financial-head h2,
.dashboard-financial-head p {
    margin-top: 0;
}

.month-filter {
    min-width: 190px;
}

.financial-kpis {
    margin-bottom: 14px;
}

.financial-expense-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.financial-expense-breakdown span {
    color: #667085;
}

.financial-expense-breakdown strong {
    color: #1f2937;
    margin-left: 5px;
}

.spend-analysis-panel {
    border-top: 5px solid #2f6fed;
    margin: 18px 0;
}

.spend-analysis-head {
    align-items: center;
}

.spend-analysis-highlights {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.spend-analysis-highlights > span {
    background: #f6f8fa;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    padding: 8px 10px;
}

.spend-analysis-highlights small {
    color: #667085;
    font-size: 10px;
    font-weight: 800;
}

.spend-analysis-highlights strong {
    font-size: 16px;
}

.spend-group-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 14px 0;
}

.spend-group-card {
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 9px;
    color: #172033;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 11px;
    text-align: left;
}

.spend-group-card:hover,
.spend-group-card.active {
    background: #f3f7ff;
    border-color: #2f6fed;
}

.spend-group-card > span {
    display: flex;
    flex-direction: column;
}

.spend-group-card > span > strong {
    font-size: 13px;
}

.spend-group-card small {
    color: #667085;
    font-size: 10px;
}

.spend-group-value {
    align-items: flex-end;
    text-align: right;
}

.spend-group-card i {
    background: #e7edf5;
    border-radius: 999px;
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
}

.spend-group-card i b {
    background: #2f6fed;
    border-radius: inherit;
    display: block;
    height: 100%;
}

.spend-detail-disclosure {
    margin-top: 10px;
}

.spend-detail-table {
    margin-top: 10px;
}

.spend-analysis-note {
    margin-bottom: 0;
}

@media (max-width: 1050px) {
    .spend-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .spend-analysis-highlights {
        flex-direction: column;
        width: 100%;
    }

    .spend-group-grid {
        grid-template-columns: 1fr;
    }
}

.account-switch-panel {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.account-switch-panel h2 {
    margin-bottom: 6px;
}

.account-switch-panel p {
    color: #667085;
    margin: 0;
}

.account-switch-panel > .primary {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    text-decoration: none;
}

.account-switch-help {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.account-switch-help span {
    color: #667085;
    font-size: 14px;
}

.mobile-access-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 0.8fr);
}

.mobile-access-card {
    border-left: 6px solid #f26a21;
}

.mobile-access-wide {
    grid-column: 1 / -1;
}

.mobile-link-box {
    background: #172033;
    border-radius: 8px;
    color: #ffffff;
    margin: 16px 0;
    padding: 18px;
    word-break: break-word;
}

.mobile-link-box strong {
    color: #ffb26b;
    display: block;
    font-size: 24px;
    line-height: 1.25;
}

.kpi,
.panel {
    background: white;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.kpi {
    border-left: 6px solid #f26a21;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 126px;
    padding: 18px;
}

.kpi.amber {
    border-left-color: #d99a1b;
}

.kpi.green {
    border-left-color: #1f9d55;
}

.kpi.red {
    border-left-color: #c9362b;
}

.kpi.blue {
    border-left-color: #2f6fed;
}

.kpi.purple {
    border-left-color: #7c5cc4;
}

.kpi.teal {
    border-left-color: #0f9f95;
}

.kpi small {
    color: #475467;
    font-weight: 800;
}

.kpi strong {
    font-size: 26px;
    line-height: 1.1;
}

.kpi a {
    color: #d95812;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

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

.dashboard-grid {
    grid-template-columns: 2fr 1fr 1fr;
}

.wide {
    grid-row: span 2;
}

.split-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.settings-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(300px, 520px) minmax(260px, 1fr);
}

.quote-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(520px, 0.95fr) minmax(0, 1.05fr);
}

.quote-workspace,
.record-workspace {
    display: grid;
    gap: 16px;
}

.open-form-card {
    background: #ffffff;
    border: 1px dashed #c4ccd6;
    border-radius: 8px;
    color: #172033;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 420px;
    min-height: 76px;
    padding: 16px 18px;
    text-align: left;
}

.open-form-card:hover {
    background: #fff7ed;
    border-color: #f26a21;
}

.open-form-card span {
    color: #f26a21;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.open-form-card strong {
    font-size: 18px;
}

.panel {
    padding: 20px;
}

.panel h2 {
    font-size: 19px;
    margin: 0 0 16px;
}

.staff-portal-dropdown {
    display: block;
    margin-bottom: 14px;
}

.staff-portal-dropdown > summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    color: #172033;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 58px;
    padding: 14px 16px;
}

.staff-portal-dropdown > summary::-webkit-details-marker {
    display: none;
}

.staff-portal-dropdown > summary::after {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #d95812;
    content: "+";
    display: grid;
    flex: 0 0 28px;
    font-size: 18px;
    font-weight: 900;
    height: 28px;
    place-items: center;
    width: 28px;
}

.staff-portal-dropdown[open] > summary::after {
    content: "-";
}

.staff-portal-dropdown > summary span {
    font-size: 18px;
    font-weight: 900;
}

.staff-portal-dropdown > summary small {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
    margin-left: auto;
    text-align: right;
}

.staff-portal-dropdown > .panel,
.staff-portal-dropdown > .split-grid {
    margin-top: 12px;
}

.staff-portal-dropdown > .panel > h2:first-child {
    display: none;
}

.panel-note {
    color: #475467;
    margin-bottom: 0;
}

.form-section {
    border-top: 1px solid #e3e8ef;
    margin-top: 16px;
    padding-top: 16px;
}

.form-section:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.form-section h3,
.form-section-head h2,
.invoice-lines-heading h3 {
    margin: 0;
}

.form-section h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.form-section-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.quote-meta-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1fr) 150px 140px;
}

.job-receipt-form-panel {
    max-width: 980px;
}

.job-receipt-upload-grid,
.job-receipt-meta-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.job-receipt-job-field {
    grid-column: 1 / -1;
}

.job-receipt-form-panel input[type="file"] {
    min-height: 46px;
    padding: 8px;
}

.job-receipt-form-panel textarea {
    min-height: 104px;
}

.postcode-lookup-row {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) auto;
}

.postcode-lookup-row label {
    margin-bottom: 0;
}

.postcode-lookup-row button {
    margin-bottom: 0;
    white-space: nowrap;
}

.postcode-message {
    margin: 8px 0 14px;
}

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

.holiday-days-field {
    grid-column: 1 / -1;
}

.notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #9a3412;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.login-shell {
    align-items: center;
    background: #172033;
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-brand {
    color: #ffffff;
    text-align: center;
}

.login-panel {
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    max-width: 420px;
    padding: 24px;
    width: 100%;
}

.login-panel h1 {
    margin: 0 0 8px;
}

.login-panel p {
    color: #667085;
    margin-top: 0;
}

.login-panel .primary,
.login-link {
    display: inline-flex;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

label {
    color: #344054;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    margin-bottom: 14px;
}

input,
select,
textarea {
    border: 1px solid #cfd6df;
    border-radius: 6px;
    color: #172033;
    font: inherit;
    min-height: 40px;
    padding: 10px 11px;
    width: 100%;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(242, 106, 33, 0.16);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

.check-row {
    align-items: center;
    flex-direction: row;
}

.check-row input {
    min-height: auto;
    width: auto;
}

.primary {
    background: #f26a21;
    border: 0;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 800;
    min-height: 42px;
    padding: 11px 16px;
}

.primary:hover {
    background: #d95812;
}

.button-row,
.table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-menu {
    display: inline-block;
    min-width: 118px;
    position: relative;
}

.action-menu summary {
    background: #eef2f6;
    border-radius: 6px;
    color: #344054;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
    min-height: 32px;
    padding: 7px 28px 7px 10px;
    position: relative;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu summary::after {
    content: "v";
    font-size: 11px;
    position: absolute;
    right: 10px;
    top: 9px;
}

.action-menu[open] summary {
    background: #dfe7ef;
}

.action-menu[open] summary::after {
    content: "^";
}

.action-menu-list {
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 7px;
    min-width: 172px;
    padding: 8px;
}

.action-menu-list button,
.action-menu-list .primary,
.action-menu-list .secondary-link,
.action-menu-list .status {
    text-align: left;
    width: 100%;
}

.action-menu-list a.primary {
    align-items: center;
    display: flex;
    text-decoration: none;
}

.secondary,
.danger {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    min-height: 38px;
    padding: 9px 13px;
}

.secondary {
    background: #eef2f6;
    color: #344054;
}

.secondary:hover {
    background: #dfe7ef;
}

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

.extraction-actions {
    margin: 12px 0 16px;
}

.danger {
    background: #fee4e2;
    color: #b42318;
}

.danger:hover {
    background: #fecdca;
}

.small {
    font-size: 13px;
    min-height: 32px;
    padding: 7px 10px;
}

.secondary-link {
    align-items: center;
    background: #eef2f6;
    border-radius: 6px;
    color: #344054;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    min-height: 32px;
    padding: 7px 10px;
    text-decoration: none;
}

.secondary-link:hover {
    background: #dfe7ef;
}

.table-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    border-collapse: collapse;
    min-width: 780px;
    width: 100%;
}

.data-table.compact {
    min-width: 620px;
}

.data-table th {
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
    text-align: left;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e3e8ef;
    padding: 11px 12px;
    vertical-align: top;
}

.data-table td span {
    color: #667085;
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.table-filter-row th {
    background: #ffffff;
    padding: 8px 6px;
}

.table-filter-row input {
    font-size: 12px;
    min-height: 34px;
    min-width: 92px;
    padding: 7px 8px;
}

.table-filter-row .filter-reset {
    min-height: 34px;
    white-space: nowrap;
    width: 100%;
}

.customer-records-table {
    min-width: 0;
    table-layout: fixed;
}

.customer-records-table th:nth-child(1) { width: 11%; }
.customer-records-table th:nth-child(2) { width: 12%; }
.customer-records-table th:nth-child(3) { width: 22%; }
.customer-records-table th:nth-child(4) { width: 24%; }
.customer-records-table th:nth-child(5) { width: 21%; }
.customer-records-table th:nth-child(6) { width: 10%; }

.customer-records-table th,
.customer-records-table td {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.customer-records-table .description-cell {
    max-width: none;
    min-width: 0;
}

.customer-records-table .description-box {
    max-width: 100%;
    min-width: 0;
}

.customer-records-table .table-filter-row input {
    min-width: 0;
}

.customer-records-table .action-menu {
    min-width: 0;
    width: 100%;
}

.customer-records-table .action-menu summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-number-picker {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.job-number-picker small {
    color: #667085;
    font-weight: 600;
}

.job-number-picker .field-error {
    color: #b42318;
}

.quick-labour-row td {
    background: #fffaf5;
    padding: 14px;
}

.quick-labour-panel {
    border: 2px solid #fed7aa;
    border-radius: 8px;
    padding: 16px;
}

.quick-labour-panel h3 {
    margin: 0;
}

.quick-labour-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(190px, 1.3fr) repeat(3, minmax(130px, 0.7fr));
    margin-top: 16px;
}

.quick-labour-notes {
    grid-column: 1 / -1;
}

.quick-labour-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.quick-labour-actions strong {
    margin-right: auto;
}

.job-dates-cell {
    min-width: 132px;
}

.job-dates-cell > span,
.job-dates-cell > strong {
    display: block;
}

.job-dates-cell .secondary {
    margin-top: 0.55rem;
    white-space: nowrap;
}

.job-schedule-grid {
    align-items: end;
}

.job-schedule-grid label small {
    display: block;
    margin-top: 0.3rem;
    color: var(--muted);
}

.job-schedule-grid .check-row {
    align-self: center;
    margin: 0;
}

.job-audit-panel {
    grid-column: 1 / -1;
}

.audit-filter-panel {
    margin-bottom: 18px;
}

.additional-work-panel {
    border-color: #fdba74;
}

.additional-work-form {
    grid-template-columns: minmax(150px, 0.7fr) repeat(2, minmax(150px, 0.7fr));
}

.additional-work-lines {
    border-bottom: 1px solid #fed7aa;
    margin: 16px 0;
    padding-bottom: 12px;
}

.additional-work-line {
    align-items: center;
    border-top: 1px solid #ffedd5;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(240px, 1fr) auto auto auto;
    padding: 10px 0;
}

.additional-work-line > div span {
    color: #667085;
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.additional-work-total {
    align-items: center;
    display: flex;
    font-size: 16px;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 10px;
}

.additional-work-indicator {
    background: #fff4e8;
    border: 1px solid #f5b57c;
    border-radius: 999px;
    color: #9a430e;
    cursor: pointer;
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-top: 7px;
    padding: 4px 8px;
    text-align: left;
}

.description-cell {
    max-width: 340px;
    min-width: 220px;
}

.description-box {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    color: #344054;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
    max-height: 78px;
    overflow-y: auto;
    padding: 8px 9px;
    white-space: pre-wrap;
    word-break: break-word;
}

.description-box:first-child {
    margin-top: 0;
}

.description-box.compact {
    max-height: 54px;
}

.material-cell {
    min-width: 170px;
}

.material-box {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    color: #101828;
    display: block;
    line-height: 1.35;
    max-width: 240px;
    padding: 9px;
    word-break: break-word;
}

.material-box strong {
    font-size: 14px;
}

.salary-cell {
    min-width: 190px;
}

.salary-summary {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px;
}

.salary-summary div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.salary-summary span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-top: 0;
}

.salary-summary strong {
    font-size: 14px;
}

.salary-more {
    margin-top: 6px;
}

.salary-more summary {
    color: #475467;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.finance-cell {
    min-width: 150px;
}

.finance-summary {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px;
}

.finance-summary span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-top: 0;
}

.finance-summary strong {
    font-size: 15px;
}

.finance-more {
    margin-top: 6px;
}

.finance-more summary {
    color: #475467;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.accounts-overview-grid {
    align-items: start;
}

.account-money-in {
    color: #027a48;
    font-weight: 900;
    white-space: nowrap;
}

.account-money-out {
    color: #b42318;
    font-weight: 900;
    white-space: nowrap;
}

.account-reference-row {
    background: #fbfcfe;
}

.account-reference-row td {
    color: #667085;
}

.job-files-cell {
    min-width: 210px;
}

.job-files-menu summary {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    padding: 9px;
}

.job-files-menu summary::-webkit-details-marker {
    display: none;
}

.job-files-menu summary strong {
    display: block;
    font-size: 14px;
}

.job-files-menu summary span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
}

.job-files-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    max-width: 380px;
    min-width: 300px;
}

.job-file-item {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: flex;
    gap: 9px;
    padding: 9px;
}

.job-file-thumb {
    background: #eef2f6;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    flex: 0 0 auto;
    height: 54px;
    object-fit: cover;
    width: 68px;
}

.job-file-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.job-file-copy strong {
    display: block;
    font-size: 13px;
}

.job-file-copy span {
    word-break: break-word;
}

.job-file-item .secondary {
    flex: 0 0 auto;
}

.status {
    background: #eef4ff;
    border: 1px solid #c7d7fe;
    border-radius: 999px;
    color: #2446a8;
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 9px;
    white-space: nowrap;
}

.metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.metric-grid.small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid div {
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    padding: 14px;
}

.metric-grid small {
    color: #667085;
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

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

.invoice-lines {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 12px;
}

.invoice-lines-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.invoice-line-row {
    border-top: 1px solid #e3e8ef;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) 80px 130px 100px auto;
    padding-top: 12px;
}

.invoice-line-row:first-of-type {
    border-top: 0;
}

.invoice-line-row label {
    margin-bottom: 10px;
}

.line-total {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

.line-total span,
.invoice-total-preview span {
    color: #667085;
    font-size: 13px;
    font-weight: 800;
}

.invoice-total-preview {
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
    padding: 12px;
}

.invoice-total-preview div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.invoice-total-preview strong {
    font-size: 18px;
}

.document-lines {
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    overflow: hidden;
}

.document-line-row {
    align-items: end;
    background: #ffffff;
    border-top: 1px solid #e3e8ef;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(200px, 1fr) 80px 130px 100px auto;
    padding: 12px;
}

.document-line-row:first-child {
    border-top: 0;
}

.document-line-row:nth-child(even) {
    background: #f8fafc;
}

.document-line-row label {
    margin-bottom: 0;
}

.document-line-row textarea {
    min-height: 74px;
}

.document-line-row .danger {
    margin-bottom: 1px;
}

.document-total-preview {
    background: #172033;
    border-radius: 8px;
    color: #ffffff;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0;
    padding: 14px;
}

.document-total-preview div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.document-total-preview span {
    color: #ffb26b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.document-total-preview strong {
    color: #ffffff;
    font-size: 19px;
}

.detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1.4fr 1fr;
    margin-bottom: 16px;
}

.stacked-sections {
    grid-template-columns: 1fr;
}

.calendar-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.calendar-toolbar h2 {
    margin-bottom: 4px;
}

.calendar-overview-panel {
    margin-bottom: 16px;
    padding: 18px;
}

.calendar-overview-head,
.calendar-nav-controls,
.calendar-filter-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-overview-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-overview-head h2 {
    margin-bottom: 3px;
}

.calendar-nav-controls input {
    min-height: 38px;
    width: auto;
}

.calendar-filter-bar {
    border-bottom: 1px solid #e3e8ef;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

.calendar-filter {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 999px;
    color: #344054;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 11px;
}

.calendar-filter strong {
    background: #ffffff;
    border-radius: 999px;
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
}

.calendar-filter.active {
    box-shadow: 0 0 0 2px rgba(23, 32, 51, 0.12);
    color: #172033;
}

.calendar-filter.job.active { background: #e9f2ff; border-color: #79aef2; }
.calendar-filter.survey.active { background: #fff4e8; border-color: #f5a45d; }
.calendar-filter.holiday.active { background: #ecfdf3; border-color: #6dcf91; }
.calendar-filter.vehicle.active { background: #f3edff; border-color: #a98be8; }
.calendar-filter.other.active { background: #eef2f6; border-color: #98a2b3; }

.diary-panel {
    border-left: 4px solid #f26a21;
}

.diary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.diary-entry {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 12px;
}

.diary-entry.calendar-job { border-left: 5px solid #3978c5; }
.diary-entry.calendar-survey { border-left: 5px solid #f26a21; }
.diary-entry.calendar-holiday { border-left: 5px solid #27a45f; }
.diary-entry.calendar-vehicle { border-left: 5px solid #7a52c7; }
.diary-entry.calendar-other { border-left: 5px solid #667085; }

.diary-time {
    background: #172033;
    border-radius: 6px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    min-height: 62px;
    padding: 10px;
}

.diary-time span {
    color: #d9e2ec;
    font-size: 12px;
}

.diary-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.diary-detail > span {
    color: #475467;
    font-size: 13px;
}

.diary-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.empty-state {
    background: #f8fafc;
    border: 1px dashed #c4ccd6;
    border-radius: 8px;
    color: #475467;
    font-weight: 700;
    margin: 16px 0 0;
    padding: 16px;
}

.settings-disclosure {
    background: #ffffff;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
}

.settings-disclosure summary {
    align-items: center;
    color: #172033;
    cursor: pointer;
    display: flex;
    font-size: 18px;
    font-weight: 900;
    gap: 10px;
    list-style: none;
    padding: 16px 18px;
}

.settings-disclosure summary::-webkit-details-marker {
    display: none;
}

.settings-disclosure summary::before {
    color: #f26a21;
    content: "\25B6";
    font-size: 13px;
}

.settings-disclosure[open] summary {
    background: #fff8f3;
}

.settings-disclosure[open] summary::before {
    content: "\25BC";
}

.settings-disclosure-body {
    border-top: 1px solid #e3e8ef;
    padding: 18px;
}

.settings-grid-collapsible {
    grid-template-columns: 1fr;
}

.settings-grid-collapsible > .settings-disclosure {
    overflow: hidden;
    padding: 0;
}

.settings-pin-gate {
    margin: 24px auto 0;
    max-width: 520px;
    padding: 28px;
    text-align: center;
}

.settings-pin-gate h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.settings-pin-gate > p {
    color: #5f6f86;
    margin: 0 auto 20px;
    max-width: 400px;
}

.settings-pin-gate label {
    margin: 0 auto 14px;
    max-width: 260px;
    text-align: left;
}

.settings-pin-gate input {
    font-size: 24px;
    letter-spacing: 12px;
    text-align: center;
}

.settings-pin-icon {
    align-items: center;
    background: #fff3ea;
    border-radius: 50%;
    display: inline-flex;
    font-size: 24px;
    height: 52px;
    justify-content: center;
    margin-bottom: 14px;
    width: 52px;
}

.calendar-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 170px;
    padding: 10px;
}

.calendar-day.today {
    border-color: #f26a21;
}

.calendar-day.selected {
    background: #fffaf5;
    box-shadow: 0 0 0 2px rgba(242, 106, 33, 0.16);
}

.calendar-day-heading {
    align-items: baseline;
    background: transparent;
    border: 0;
    color: #172033;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 1px 5px;
    grid-template-columns: auto 1fr;
    padding: 0 0 7px;
    text-align: left;
}

.calendar-day-heading span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-day-heading strong {
    font-size: 24px;
    grid-row: span 2;
}

.calendar-day-heading small,
.calendar-day-heading em {
    color: #667085;
    font-size: 11px;
    font-style: normal;
}

.calendar-day-heading em {
    grid-column: 1 / -1;
    margin-top: 3px;
}

.calendar-day-items {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.calendar-empty {
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 2px;
}

.appointment-card {
    background: white;
    border: 1px solid #d9e2ec;
    border-left: 4px solid #0f9f95;
    border-radius: 6px;
    color: #172033;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 3px;
    padding: 8px;
    text-align: left;
    text-decoration: none;
    min-width: 0;
    overflow-wrap: anywhere;
}

.appointment-card.calendar-job { background: #edf5ff; border-left-color: #3978c5; }
.appointment-card.calendar-survey { background: #fff5eb; border-left-color: #f26a21; }
.appointment-card.calendar-holiday { background: #effbf3; border-left-color: #27a45f; }
.appointment-card.calendar-vehicle { background: #f5f1ff; border-left-color: #7a52c7; }
.appointment-card.calendar-other { background: #f8fafc; border-left-color: #667085; }

.calendar-key {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    width: fit-content;
}

.calendar-key.calendar-job { background: #dbeafe; color: #1d4f91; }
.calendar-key.calendar-survey { background: #ffedd5; color: #9a430e; }
.calendar-key.calendar-holiday { background: #dcfce7; color: #176b3a; }
.calendar-key.calendar-vehicle { background: #ede9fe; color: #5839a0; }
.calendar-key.calendar-other { background: #e4e7ec; color: #344054; }

.appointment-card span,
.appointment-card small,
.muted {
    color: #667085;
    font-size: 12px;
}

.summary {
    list-style: none;
    margin: 0;
    padding: 0;
}

.summary li {
    border-bottom: 1px solid #e3e8ef;
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
}

.plain-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.plain-list li {
    border-bottom: 1px solid #e3e8ef;
    padding-bottom: 11px;
}

.plain-list strong,
.plain-list span {
    display: block;
}

.plain-list span {
    color: #667085;
    margin-top: 3px;
}

.mini-section {
    border-top: 1px solid #e3e8ef;
    margin-top: 16px;
    padding-top: 14px;
}

.mini-section h3 {
    color: #344054;
    font-size: 15px;
    margin: 0 0 12px;
}

.mini-section p {
    margin: 8px 0;
}

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

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

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

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

    .mobile-access-grid {
        grid-template-columns: 1fr;
    }

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

    .invoice-line-row,
    .invoice-total-preview,
    .document-line-row,
    .document-total-preview,
    .quote-meta-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .diary-entry {
        grid-template-columns: 1fr;
    }

    .diary-time {
        min-height: auto;
    }
}

/* Compact dashboard dropdowns */
.dashboard-dropdown {
    align-self: start;
    overflow: hidden;
    padding: 0;
}

.dashboard-dropdown > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 64px;
    padding: 15px 48px 15px 18px;
    position: relative;
}

.dashboard-dropdown > summary::-webkit-details-marker {
    display: none;
}

.dashboard-dropdown > summary::after {
    align-items: center;
    background: #fff3e8;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #d95812;
    content: "+";
    display: flex;
    font-size: 18px;
    font-weight: 900;
    height: 28px;
    justify-content: center;
    position: absolute;
    right: 16px;
    top: 17px;
    width: 28px;
}

.dashboard-dropdown[open] > summary {
    border-bottom: 1px solid #e3e8ef;
    margin-bottom: 16px;
}

.dashboard-dropdown[open] > summary::after {
    content: "\2212";
}

.dashboard-dropdown > summary span {
    color: #172033;
    font-size: 17px;
    font-weight: 900;
}

.dashboard-dropdown > summary small {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    margin-left: auto;
    text-align: right;
}

.dashboard-dropdown > :not(summary) {
    margin-left: 16px;
    margin-right: 16px;
}

.dashboard-dropdown > .data-table {
    width: calc(100% - 32px);
}

.dashboard-dropdown > :last-child:not(summary) {
    margin-bottom: 16px;
}

@media (max-width: 560px) {
    .dashboard-dropdown > summary {
        min-height: 58px;
        padding: 13px 44px 13px 14px;
    }

    .dashboard-dropdown > summary::after {
        right: 12px;
        top: 14px;
    }

    .dashboard-dropdown > summary span {
        font-size: 15px;
    }
}

/* Shared office interface polish */
:root {
    --brand-orange: #f26a21;
    --brand-orange-dark: #d95812;
    --navy: #172033;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --line: #dfe5ec;
    --muted: #667085;
    --trade-apprentice-bg: #ccfbf1;
    --trade-apprentice-border: #0f9f95;
    --trade-apprentice-text: #0f625c;
    --trade-labourer-bg: #fef0c7;
    --trade-labourer-border: #e6a400;
    --trade-labourer-text: #854a0e;
    --trade-subcontractor-bg: #e9ddff;
    --trade-subcontractor-border: #7a52c7;
    --trade-subcontractor-text: #5839a0;
    --trade-plumber-bg: #cceffc;
    --trade-plumber-border: #168aad;
    --trade-plumber-text: #075a75;
    --trade-joiner-bg: #ffddcc;
    --trade-joiner-border: #b85c2d;
    --trade-joiner-text: #823b18;
}

body {
    background: #f3f5f8;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

.sidebar {
    background: linear-gradient(180deg, #172033 0%, #111827 100%);
    padding: 20px 16px;
    width: 236px;
}

.sidebar-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
}

.brand {
    margin: 2px 8px 22px;
}

.brand-main {
    font-size: 42px;
    letter-spacing: -2px;
}

.brand-sub {
    font-size: 14px;
    letter-spacing: 0.12em;
}

.nav {
    gap: 3px;
}

.nav a {
    border-left: 3px solid transparent;
    border-radius: 7px;
    font-size: 14px;
    padding: 9px 11px;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.09);
    border-left-color: rgba(242, 106, 33, 0.8);
    transform: translateX(2px);
}

.nav a.active {
    background: var(--brand-orange);
    border-left-color: #ffffff;
    box-shadow: 0 6px 16px rgba(242, 106, 33, 0.22);
}

.nav-section {
    color: #98a2b3;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
    margin: 16px 11px 5px;
    text-transform: uppercase;
}

.nav-toggle-checkbox,
.mobile-nav-toggle {
    display: none;
}

.side-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    line-height: 1.35;
    margin: 24px 6px 0;
}

.main {
    padding: 22px clamp(18px, 2.2vw, 34px) 36px;
}

.topbar {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(223, 229, 236, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    margin-bottom: 22px;
    padding: 13px 16px;
}

.topbar h1 {
    font-size: 25px;
    letter-spacing: -0.03em;
}

.topbar p {
    font-size: 12px;
}

.topbar-quick-links {
    align-items: center;
    background: #f1f4f8;
    border: 1px solid #e4e9ef;
    border-radius: 9px;
    display: flex;
    gap: 3px;
    padding: 4px;
}

.topbar-quick-links a {
    border-radius: 6px;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}

.topbar-quick-links a:hover,
.topbar-quick-links a.active {
    background: #ffffff;
    color: var(--brand-orange-dark);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.page-head {
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.page-head h1 {
    font-size: clamp(25px, 2vw, 32px);
    letter-spacing: -0.035em;
}

.page-head p {
    font-size: 14px;
}

.kpi,
.panel {
    border-color: var(--line);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.045);
}

.panel {
    padding: 20px;
}

.open-form-card {
    border: 1px solid #fed7aa;
    border-left: 5px solid var(--brand-orange);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    max-width: 360px;
    min-height: 68px;
    padding: 13px 16px;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.open-form-card:hover {
    box-shadow: 0 8px 20px rgba(242, 106, 33, 0.11);
    transform: translateY(-1px);
}

.open-form-card strong {
    font-size: 16px;
}

.entry-form-panel {
    display: grid;
    gap: 0 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1040px;
}

.entry-form-panel > .form-section-head,
.entry-form-panel > .panel-note,
.entry-form-panel > .postcode-lookup-row,
.entry-form-panel > .invoice-lines,
.entry-form-panel > .button-row,
.entry-form-panel > .wide-field {
    grid-column: 1 / -1;
}

.entry-form-panel > .form-section-head {
    border-bottom: 1px solid #e7ebf0;
    margin-bottom: 16px;
    padding-bottom: 14px;
}

label {
    color: #344054;
    font-size: 13px;
}

input,
select,
textarea {
    background: #ffffff;
    border-color: #cbd3dd;
    border-radius: 8px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(242, 106, 33, 0.17);
    outline: none;
}

.primary,
.secondary,
.danger,
.secondary-link,
.action-menu summary {
    border-radius: 8px;
    transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.primary:hover,
.secondary:hover,
.danger:hover,
.secondary-link:hover {
    transform: translateY(-1px);
}

.table-panel {
    padding-top: 17px;
}

.table-panel-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 13px;
}

.table-panel-head h2,
.calendar-toolbar .table-panel-head h2 {
    margin: 0;
}

.table-panel-head p {
    color: var(--muted);
    font-size: 12px;
    margin: 3px 0 0;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #f4f6f9;
    border-bottom-color: #d9e0e8;
    color: #344054;
    font-size: 12px;
    letter-spacing: 0.015em;
    padding-bottom: 10px;
    padding-top: 10px;
    text-transform: uppercase;
}

.data-table tbody tr {
    transition: background-color 100ms ease;
}

.data-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.data-table tbody tr:hover {
    background: #fff8f2;
}

.data-table td {
    font-size: 14px;
    line-height: 1.35;
}

.table-filter-row th {
    background: #ffffff;
    border-bottom: 2px solid #dce2e9;
    padding: 7px 5px 9px;
}

.table-filter-row input {
    background: #f8fafc;
    border-color: #d5dce5;
    border-radius: 7px;
}

.table-filter-row input:focus {
    background: #ffffff;
}

.table-panel .data-table th:last-child,
.table-panel .data-table td:last-child {
    background: #ffffff;
    box-shadow: -8px 0 12px -12px rgba(15, 23, 42, 0.65);
    min-width: 124px;
    position: sticky;
    right: 0;
    z-index: 2;
}

.table-panel .data-table th:last-child {
    background: #f4f6f9;
    z-index: 3;
}

.table-panel .data-table .table-filter-row th:last-child {
    background: #ffffff;
}

.table-panel .data-table tbody tr:nth-child(even) td:last-child {
    background: #fbfcfd;
}

.table-panel .data-table tbody tr:hover td:last-child {
    background: #fff8f2;
}

.action-menu summary {
    border: 1px solid #dce2e9;
    min-height: 36px;
    padding-top: 8px;
}

.action-menu summary::after {
    content: "\25BE";
    top: 8px;
}

.action-menu[open] summary::after {
    content: "\25B4";
}

.action-menu-list {
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.status {
    font-size: 12px;
    padding: 4px 9px;
}

.notice {
    border-left: 5px solid var(--brand-orange);
    border-radius: 9px;
}

@media (max-width: 800px) {
    .sidebar {
        padding: 10px 12px;
    }

    .sidebar-head {
        align-items: center;
    }

    .brand {
        margin: 0;
    }

    .mobile-nav-toggle {
        align-items: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        color: #ffffff;
        cursor: pointer;
        display: flex;
        flex-direction: row;
        font-size: 13px;
        gap: 8px;
        margin: 0;
        min-height: 40px;
        padding: 8px 11px;
    }

    .sidebar .nav {
        display: none;
        flex-direction: column;
        max-height: calc(100vh - 82px);
        margin: 10px 0 0;
        overflow-y: auto;
        padding: 7px 0;
    }

    .nav-toggle-checkbox:checked + .nav {
        display: flex;
    }

    .nav a {
        min-height: 38px;
        width: 100%;
    }

    .nav-section {
        margin-top: 12px;
    }

    .topbar {
        align-items: stretch;
        padding: 12px;
    }

    .topbar-quick-links {
        display: none;
    }

    .entry-form-panel {
        grid-template-columns: 1fr;
    }

    .entry-form-panel > * {
        grid-column: 1;
    }

    .table-panel-head p {
        line-height: 1.35;
    }
}

@media (max-width: 560px) {
    .page-head {
        align-items: stretch;
    }

    .open-form-card {
        max-width: none;
        width: 100%;
    }

    .table-panel .data-table th:last-child,
    .table-panel .data-table td:last-child {
        min-width: 116px;
    }
}

@media (max-width: 800px) {
    body {
        background: #eef2f6;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        border-bottom: 4px solid #f26a21;
        height: auto;
        padding: 12px 14px;
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 20;
    }

    .brand {
        align-items: center;
        display: flex;
        gap: 9px;
        margin-bottom: 10px;
    }

    .brand-main {
        font-size: 30px;
        line-height: 1;
    }

    .brand-sub {
        font-size: 12px;
        letter-spacing: 0;
        margin-top: 0;
    }

    .nav {
        flex-direction: row;
        gap: 7px;
        margin: 0 -4px;
        overflow-x: auto;
        padding: 0 4px 4px;
        -webkit-overflow-scrolling: touch;
    }

    .nav a {
        flex: 0 0 auto;
        font-size: 13px;
        min-height: 40px;
        padding: 10px 11px;
        white-space: nowrap;
    }

    .side-card {
        display: none;
    }

    .main {
        padding: 14px;
    }

    .topbar,
    .page-head,
    .dashboard-financial-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }

    .month-filter {
        min-width: 0;
        width: 100%;
    }

    .topbar h1,
    .page-head h1 {
        font-size: 24px;
    }

    .topbar p,
    .page-head p {
        font-size: 13px;
        line-height: 1.35;
    }

    .search {
        width: 100%;
    }

    .topbar-account {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .topbar-account .account-switch-link {
        justify-content: center;
        width: 100%;
    }

    .profile {
        background: #ffffff;
        border: 1px solid #e3e8ef;
        border-radius: 8px;
        padding: 10px 12px;
        text-align: left;
        width: 100%;
    }

    .account-switch-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .account-switch-panel > .primary {
        justify-content: center;
        width: 100%;
    }

    .account-switch-help {
        align-items: flex-start;
        text-align: left;
    }

    .kpis,
    .dashboard-grid,
    .metric-grid,
    .metric-grid.small {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 14px;
    }

    .kpi {
        min-height: 0;
        padding: 14px;
    }

    .table-panel {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 44px;
    }

    .primary,
    .secondary,
    .danger,
    .secondary-link {
        min-height: 44px;
    }

    .small {
        font-size: 14px;
        min-height: 40px;
        padding: 9px 11px;
    }

    .quick-labour-grid {
        grid-template-columns: 1fr;
    }

    .postcode-lookup-row {
        grid-template-columns: 1fr;
    }

    .additional-work-line {
        grid-template-columns: 1fr;
    }

    .additional-work-line > button {
        width: 100%;
    }

    .quick-labour-actions > * {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .main {
        padding: 10px;
    }

    .panel {
        padding: 12px;
    }

    .button-row > button,
    .button-row > a {
        justify-content: center;
        width: 100%;
    }

    .invoice-lines,
    .document-lines,
    .document-total-preview,
    .invoice-total-preview,
    .notice {
        border-radius: 6px;
    }

    .document-line-row,
    .invoice-line-row {
        gap: 8px;
        padding: 10px;
    }

    .summary li {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .panel.dashboard-dropdown {
        padding: 0;
    }
}

@media (max-width: 800px) {
    .customer-records-panel {
        overflow-x: visible;
    }

    .customer-records-table,
    .customer-records-table thead,
    .customer-records-table tbody {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .customer-records-table thead > tr:first-child {
        display: none;
    }

    .customer-records-table .table-filter-row {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 14px;
    }

    .customer-records-table .table-filter-row th {
        border: 0;
        display: block;
        padding: 0;
        position: static;
        width: auto;
    }

    .customer-records-table tbody {
        display: grid;
        gap: 12px;
    }

    .customer-records-table tbody tr {
        background: #ffffff;
        border: 1px solid #dfe5ec;
        border-radius: 10px;
        display: grid;
        gap: 0 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        padding: 10px 12px;
    }

    .customer-records-table tbody tr:hover,
    .customer-records-table tbody tr:nth-child(even) {
        background: #ffffff;
    }

    .customer-records-table tbody td {
        border-bottom: 1px solid #edf0f4;
        display: block;
        min-width: 0;
        padding: 9px 0;
        position: static;
        width: auto;
    }

    .customer-records-table tbody td::before {
        color: #667085;
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.08em;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .customer-records-table tbody td:nth-child(3),
    .customer-records-table tbody td:nth-child(4),
    .customer-records-table tbody td:nth-child(5),
    .customer-records-table tbody td:last-child {
        grid-column: 1 / -1;
    }

    .customer-records-panel .customer-records-table tbody td:last-child {
        background: #ffffff;
        border-bottom: 0;
        box-shadow: none;
        min-width: 0;
        position: static;
    }

    .customer-records-table .description-box {
        max-height: none;
    }

    .customer-records-table .action-menu summary {
        text-align: center;
    }
}

@media (max-width: 430px) {
    .customer-records-table .table-filter-row,
    .customer-records-table tbody tr {
        grid-template-columns: 1fr;
    }

    .customer-records-table tbody td {
        grid-column: 1 !important;
    }
}

/* Customer table action controls */
.customer-records-table th:nth-child(1) { width: 11%; }
.customer-records-table th:nth-child(2) { width: 12%; }
.customer-records-table th:nth-child(3) { width: 21%; }
.customer-records-table th:nth-child(4) { width: 23%; }
.customer-records-table th:nth-child(5) { width: 21%; }
.customer-records-table th:nth-child(6) { width: 12%; }

.customer-records-panel .customer-records-table th:last-child,
.customer-records-panel .customer-records-table td:last-child {
    box-shadow: none;
    min-width: 0;
    position: static;
}

.customer-records-table .action-menu summary {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    overflow: visible;
    padding: 8px 10px;
    text-overflow: clip;
    white-space: nowrap;
}

.customer-records-table .action-menu summary::after {
    flex: 0 0 auto;
    margin-left: auto;
    position: static;
}

.customer-records-table .action-menu-list {
    min-width: 0;
    width: 100%;
}

@media (max-width: 800px) {
    .customer-records-table .action-menu summary {
        justify-content: center;
    }

    .customer-records-table .action-menu summary::after {
        margin-left: 4px;
    }
}

/* Fit all office registers within their page */
@media (min-width: 801px) {
    .table-panel .data-table {
        min-width: 0;
        table-layout: fixed;
    }

    .table-panel .data-table th,
    .table-panel .data-table td {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .table-panel .data-table .description-cell,
    .table-panel .data-table .finance-cell,
    .table-panel .data-table .salary-cell,
    .table-panel .data-table .job-files-cell,
    .table-panel .data-table .material-cell {
        max-width: none;
        min-width: 0;
    }

    .table-panel .data-table .description-box,
    .table-panel .data-table .finance-summary,
    .table-panel .data-table .salary-summary,
    .table-panel .data-table .material-box {
        max-width: 100%;
        min-width: 0;
    }

    .table-panel .data-table .table-filter-row input {
        min-width: 0;
    }

    .table-panel .data-table th:last-child,
    .table-panel .data-table td:last-child {
        box-shadow: none;
        min-width: 0;
        position: static;
    }

    .table-panel .data-table .action-menu {
        min-width: 0;
        width: 100%;
    }

    .table-panel .data-table .action-menu summary {
        align-items: center;
        display: flex;
        gap: 6px;
        justify-content: space-between;
        overflow: visible;
        padding: 8px 9px;
        text-overflow: clip;
        white-space: nowrap;
    }

    .table-panel .data-table .action-menu summary::after {
        flex: 0 0 auto;
        margin-left: auto;
        position: static;
    }

    .table-panel .data-table .action-menu-list {
        min-width: 0;
        width: 100%;
    }
}

/* Completed job archive */
.completed-jobs-page-head {
    align-items: end;
}

.completed-jobs-month-filter {
    color: #475467;
    display: grid;
    flex: 0 0 250px;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
}

.completed-jobs-month-filter select {
    min-height: 46px;
}

.completed-jobs-running-totals {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.completed-jobs-running-totals > div {
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 12px;
    box-shadow: 0 7px 22px rgba(19, 41, 75, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 82px;
    padding: 14px 16px;
}

.completed-jobs-running-totals small {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.completed-jobs-running-totals strong {
    font-size: 22px;
    margin-top: 5px;
}

.completed-jobs-running-totals .completed-jobs-profit-total {
    background: #eef9f1;
    border-color: #b9e2c3;
}

.completed-jobs-running-totals .completed-jobs-profit-total.is-loss {
    background: #fff1ef;
    border-color: #f3b3aa;
}

.completed-jobs-list {
    display: grid;
    gap: 18px;
}

.job-workflow-guidance {
    align-items: center;
    background: #fff8e7;
    border: 1px solid #edd397;
    border-left: 5px solid #d99a1b;
    border-radius: 10px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(120px, 0.25fr) minmax(260px, 1fr) auto;
    margin-bottom: 14px;
    padding: 11px 14px;
}

.job-workflow-guidance.ready {
    background: #eef9f1;
    border-color: #b9e2c3;
    border-left-color: #1f9d55;
}

.job-workflow-guidance > div {
    display: flex;
    flex-direction: column;
}

.job-workflow-guidance small,
.job-workflow-guidance span {
    color: #667085;
    font-size: 11px;
}

.job-workflow-guidance strong {
    font-size: 15px;
}

.job-workflow-next span {
    margin-top: 2px;
}

@media (max-width: 700px) {
    .job-workflow-guidance {
        grid-template-columns: 1fr;
    }
}

.completed-job-card {
    margin: 0;
}

.completed-job-disclosure {
    padding: 0;
    overflow: visible;
}

.completed-job-summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 1fr) auto 28px;
    list-style: none;
    min-height: 104px;
    padding: 18px 20px;
    transition: background-color 120ms ease;
}

.completed-job-summary::-webkit-details-marker {
    display: none;
}

.completed-job-summary:hover {
    background: #f8fafc;
}

.completed-job-summary-main h2 {
    font-size: 20px;
    margin: 0 0 6px;
}

.completed-job-summary-main h2 small {
    color: #667085;
    font-size: 12px;
}

.completed-job-summary-main p,
.completed-job-summary-main > span {
    color: #667085;
    display: block;
    font-size: 13px;
    margin: 0;
}

.completed-job-summary-figures {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.completed-job-summary-figures > span {
    background: #f6f8fa;
    border: 1px solid #dde3ea;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    min-height: 62px;
    padding: 9px 12px;
}

.completed-job-summary-figures small {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.completed-job-summary-figures strong {
    font-size: 17px;
    margin-top: 3px;
    white-space: nowrap;
}

.completed-job-summary-figures .completed-job-summary-profit {
    background: #fff4ed;
    border-color: #f8b58d;
}

.completed-job-summary-toggle {
    align-items: center;
    background: #e9eff5;
    border-radius: 50%;
    display: flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.completed-job-summary-toggle::before {
    content: "⌄";
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-2px);
}

.completed-job-disclosure[open] > .completed-job-summary {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.completed-job-disclosure[open] .completed-job-summary-toggle::before {
    content: "⌃";
    transform: translateY(2px);
}

.completed-job-expanded {
    padding: 20px;
}

.completed-receipt-form {
    border-left: 5px solid #f26a21;
    margin-bottom: 18px;
    max-width: 1050px;
}

.completed-labour-form {
    border-left: 5px solid #168aad;
    margin-bottom: 18px;
    max-width: 1050px;
}

.completed-reopen-form {
    border-left: 5px solid #7a52c7;
    margin-bottom: 18px;
    max-width: 780px;
}

.completed-labour-total {
    align-items: center;
    border-top: 1px solid #e3e8ef;
    margin-top: 14px;
    padding-top: 14px;
}

.completed-job-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin: 0;
}

.completed-job-metrics {
    margin: 18px 0;
}

.completed-job-metrics .profit-metric {
    background: #fff4ed;
    border-color: #f8b58d;
}

.completed-job-details > summary {
    background: #eef2f6;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    padding: 12px 14px;
}

@media (max-width: 900px) {
    .completed-jobs-running-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .completed-job-summary {
        grid-template-columns: 1fr 28px;
    }

    .completed-job-summary-figures {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .completed-job-summary-toggle {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 560px) {
    .completed-jobs-page-head {
        align-items: stretch;
    }

    .completed-jobs-month-filter {
        flex-basis: auto;
        width: 100%;
    }

    .completed-jobs-running-totals {
        grid-template-columns: 1fr;
    }

    .completed-job-summary {
        gap: 12px;
        padding: 15px;
    }

    .completed-job-summary-main h2 {
        font-size: 17px;
    }

    .completed-job-summary-figures {
        grid-template-columns: 1fr;
    }

    .completed-job-expanded {
        padding: 14px;
    }
}

.completed-detail-grid {
    display: grid;
    gap: 18px;
    margin-top: 16px;
}

.completed-detail-grid section {
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 14px;
}

.completed-detail-grid h3 {
    margin: 0 0 10px;
}

.completed-detail-line {
    align-items: flex-start;
    border-top: 1px solid #e5e9ef;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 9px 0;
}

.completed-detail-line:first-of-type {
    border-top: 0;
}

.completed-detail-line span {
    overflow-wrap: anywhere;
}

.completed-detail-line strong {
    flex: 0 0 auto;
}

.completed-detail-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.completed-delete-confirmation {
    align-items: end;
    background: #fff4f2;
    border: 1px solid #f4b4ad;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 10px;
    padding: 10px;
}

.completed-delete-confirmation label {
    margin: 0;
    max-width: 190px;
}

.completed-delete-confirmation input {
    margin-bottom: 0;
}

.completed-detail-line.sub-line {
    color: #667085;
    padding-left: 18px;
}

@media (min-width: 1000px) {
    .completed-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Guided job command centre */
.back-link {
    color: #667085;
    display: inline-block;
    font-weight: 700;
    margin-bottom: 6px;
    text-decoration: none;
}

.job-command-overview {
    margin-bottom: 18px;
}

.job-command-title {
    align-items: flex-start;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}

.job-command-title > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.job-flow {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    margin: 20px 0;
    overflow-x: auto;
}

.job-flow > div {
    align-items: center;
    background: #f2f4f7;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    color: #667085;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 90px;
    padding: 10px 7px;
    text-align: center;
}

.job-flow > div span {
    align-items: center;
    background: #d0d5dd;
    border-radius: 50%;
    display: flex;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.job-flow > div.done {
    background: #effaf3;
    border-color: #a8ddb8;
    color: #176b36;
}

.job-flow > div.done span {
    background: #22a75a;
    color: white;
}

.job-command-grid {
    display: grid;
    gap: 18px;
}

.job-command-grid > .panel {
    margin: 0;
}

.job-command-form {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    margin-top: 16px;
}

.job-command-form label {
    margin: 0;
}

.job-command-links {
    margin-top: 14px;
}

.job-final-pl .total-line {
    border-top: 2px solid #172033;
    font-size: 1.08rem;
}

@media (min-width: 1100px) {
    .job-command-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .job-command-grid .job-final-pl {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .job-command-title {
        flex-direction: column;
    }

    .job-command-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.quotation-register-table th:nth-child(1) { width: 11%; }
.quotation-register-table th:nth-child(2) { width: 11%; }
.quotation-register-table th:nth-child(3) { width: 24%; }
.quotation-register-table th:nth-child(4) { width: 11%; }
.quotation-register-table th:nth-child(5) { width: 11%; }
.quotation-register-table th:nth-child(6) { width: 11%; }
.quotation-register-table th:nth-child(7) { width: 9%; }
.quotation-register-table th:nth-child(8) { width: 12%; }

/* Convert every remaining register into labelled cards on smaller screens */
@media (max-width: 800px) {
    .responsive-register-table,
    .responsive-register-table tbody {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .responsive-register-table thead {
        display: none;
    }

    .responsive-register-table.has-filter-row thead {
        display: block;
        width: 100%;
    }

    .responsive-register-table.has-filter-row thead > tr:first-child {
        display: none;
    }

    .responsive-register-table .table-filter-row {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 14px;
    }

    .responsive-register-table .table-filter-row th {
        border: 0;
        display: block;
        padding: 0;
        position: static;
        width: auto;
    }

    .responsive-register-table tbody {
        display: grid;
        gap: 12px;
    }

    .responsive-register-table tbody tr {
        background: #ffffff;
        border: 1px solid #dfe5ec;
        border-radius: 10px;
        display: grid;
        gap: 0 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        padding: 10px 12px;
    }

    .responsive-register-table tbody tr:hover,
    .responsive-register-table tbody tr:nth-child(even) {
        background: #ffffff;
    }

    .responsive-register-table tbody td {
        background: #ffffff;
        border-bottom: 1px solid #edf0f4;
        box-shadow: none;
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
        padding: 9px 0;
        position: static;
        width: auto;
    }

    .responsive-register-table tbody td::before {
        color: #667085;
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.08em;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .responsive-register-table tbody td[data-label="Description"],
    .responsive-register-table tbody td[data-label="Address"],
    .responsive-register-table tbody td[data-label="Notes"],
    .responsive-register-table tbody td[data-label="Files"],
    .responsive-register-table tbody td[data-label="Actions"],
    .responsive-register-table tbody td[data-label="Action"],
    .responsive-register-table tbody td[data-full-width="true"] {
        grid-column: 1 / -1;
    }

    .responsive-register-table .description-cell,
    .responsive-register-table .finance-cell,
    .responsive-register-table .salary-cell,
    .responsive-register-table .job-files-cell,
    .responsive-register-table .material-cell {
        max-width: none;
        min-width: 0;
    }

    .responsive-register-table .description-box {
        max-height: none;
        max-width: 100%;
    }

    .responsive-register-table .action-menu {
        min-width: 0;
        width: 100%;
    }

    .responsive-register-table .action-menu summary {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 430px) {
    .responsive-register-table .table-filter-row,
    .responsive-register-table tbody tr {
        grid-template-columns: 1fr;
    }

    .responsive-register-table tbody td {
        grid-column: 1 !important;
    }
}

/* Keep long materials descriptions compact */
.materials-register-table th:nth-child(1) { width: 9%; }
.materials-register-table th:nth-child(2) { width: 8%; }
.materials-register-table th:nth-child(3) { width: 20%; }
.materials-register-table th:nth-child(4) { width: 13%; }
.materials-register-table th:nth-child(5) { width: 9%; }
.materials-register-table th:nth-child(6) { width: 7%; }
.materials-register-table th:nth-child(7) { width: 8%; }
.materials-register-table th:nth-child(8) { width: 8%; }
.materials-register-table th:nth-child(9) { width: 7%; }
.materials-register-table th:nth-child(10) { width: 11%; }

.materials-register-table .material-box {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.materials-register-table .material-box strong {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: normal;
}

@media (max-width: 800px) {
    .responsive-register-table tbody td[data-label="Material"] {
        grid-column: 1 / -1;
    }
}

/* Dense registers need readable columns and controlled horizontal scrolling */
@media (min-width: 801px) {
    .table-panel .data-table:not(.customer-records-table) {
        min-width: 1000px;
        table-layout: auto;
    }

    .table-panel .job-register-table {
        min-width: 1580px;
    }

    .table-panel .invoice-register-table {
        min-width: 1380px;
    }

    .table-panel .materials-register-table {
        min-width: 1260px;
    }

    .table-panel .quotation-register-table {
        min-width: 1180px;
    }

    .table-panel .data-table:not(.customer-records-table) th,
    .table-panel .data-table:not(.customer-records-table) td {
        overflow-wrap: normal;
        word-break: normal;
    }

    .table-panel .data-table:not(.customer-records-table) .description-cell {
        min-width: 220px;
    }

    .table-panel .data-table:not(.customer-records-table) .finance-cell {
        min-width: 155px;
    }

    .table-panel .data-table:not(.customer-records-table) .job-files-cell {
        min-width: 190px;
    }

    .table-panel .data-table:not(.customer-records-table) .material-cell {
        min-width: 240px;
    }

    .table-panel .data-table:not(.customer-records-table) th:last-child,
    .table-panel .data-table:not(.customer-records-table) td:last-child {
        box-shadow: none;
        min-width: 142px;
        position: static;
    }

    .table-panel .data-table:not(.customer-records-table) .action-menu {
        min-width: 118px;
        width: auto;
    }

    .table-panel .data-table:not(.customer-records-table) .action-menu summary {
        display: block;
        overflow: visible;
        padding: 8px 28px 8px 10px;
        text-overflow: clip;
        white-space: nowrap;
    }

    .table-panel .data-table:not(.customer-records-table) .action-menu summary::after {
        margin: 0;
        position: absolute;
        right: 10px;
        top: 8px;
    }

    .table-panel .data-table:not(.customer-records-table) .action-menu-list {
        min-width: 172px;
        width: auto;
    }
}

/* Keep the simplified Jobs register narrower than the other dense registers. */
@media (min-width: 801px) {
    .table-panel .job-register-table {
        min-width: 1060px;
        table-layout: fixed;
    }

    .table-panel .job-register-table .job-financial-cell {
        min-width: 270px;
    }

    .table-panel .job-register-table .job-files-cell {
        min-width: 0;
    }

    .table-panel .job-register-table .job-action-menu {
        min-width: 0;
        width: 100%;
    }

    .table-panel .job-register-table .job-action-menu .action-menu-list {
        min-width: 230px;
    }
}

/* Open Job command centre action hub */
.job-scope-panel {
    border-left: 5px solid #1f6fb2;
    margin-bottom: 18px;
    padding: 20px;
}

.job-scope-heading {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.job-scope-heading h2 {
    margin: 3px 0 0;
}

.job-scope-kicker {
    color: #1f6fb2;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.job-scope-total {
    background: #eff6fd;
    border: 1px solid #c5dcf2;
    border-radius: 10px;
    min-width: 220px;
    padding: 12px 14px;
}

.job-scope-total small,
.job-scope-total strong {
    display: block;
}

.job-scope-total small {
    color: #52657c;
    font-weight: 800;
    margin-bottom: 4px;
}

.job-scope-total strong {
    font-size: 21px;
}

.job-scope-lines {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.job-scope-line {
    align-items: start;
    border-top: 1px solid #e4e9ef;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, 1fr) 70px 130px 130px;
    padding: 12px 14px;
}

.job-scope-line:first-child {
    border-top: 0;
}

.job-scope-line-header {
    background: #f2f5f8;
    color: #475467;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.job-scope-line > :not(:first-child) {
    text-align: right;
}

.job-scope-fallback {
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 15px;
    padding: 14px;
}

.job-scope-fallback span {
    color: #667085;
    font-size: 13px;
}

.job-scope-added-work {
    background: #fff8ef;
    border: 1px solid #f2c99e;
    border-radius: 10px;
    margin-top: 12px;
    padding: 11px 13px;
}

.job-scope-added-work summary {
    color: #91450f;
    cursor: pointer;
    font-weight: 900;
}

.job-action-hub {
    border-top: 4px solid #f26a21;
    margin-bottom: 18px;
    padding: 18px;
}

.job-action-hub-heading {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.job-action-hub-heading h2,
.job-quick-action-panel h3 {
    margin: 0;
}

.job-action-toolbar {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-top: 14px;
}

.job-action-toolbar button {
    min-height: 44px;
    white-space: normal;
}

.job-action-payment > summary {
    align-items: center;
    display: flex;
    justify-content: center;
    list-style: none;
    min-height: 44px;
    text-align: center;
}

.job-action-payment > summary::-webkit-details-marker {
    display: none;
}

.job-action-payment[open] {
    grid-column: 1 / -1;
}

.job-action-payment[open] > summary {
    max-width: 190px;
}

.job-action-payment .job-quick-action-panel {
    color: #10233f;
}

.job-quick-action-panel {
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    margin-top: 14px;
    padding: 16px;
}

.job-quick-action-panel .job-command-form {
    margin-top: 12px;
}

.job-invoice-preview {
    margin: 14px 0;
}

.job-payment-direct-note {
    background: #eef8f2;
    border: 1px solid #b7e2c8;
    border-radius: 8px;
    color: #175c38;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 9px 12px;
}

.job-payment-direct-note span {
    font-size: 12px;
    margin-top: 2px;
}

.job-management-actions {
    border-top: 1px solid #dbe3ec;
    margin-top: 16px;
    padding-top: 14px;
}

.job-cost-entry {
    align-items: center;
    gap: 14px;
}

.job-cost-entry-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.job-cost-entry-actions strong {
    white-space: nowrap;
}

.assignment-hours-editor {
    align-items: center;
    display: inline-flex;
    flex-direction: row;
    gap: 7px;
    margin: 0;
}

.assignment-hours-editor span {
    color: #607089;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.assignment-hours-editor input {
    min-height: 38px;
    padding: 7px 9px;
    width: 76px;
}

.job-command-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-command-metrics .materials-cost-metric {
    background: #f0f7ff;
    border-color: #bfd8f5;
}

.job-command-metrics .labour-cost-metric {
    background: #fff8eb;
    border-color: #f1d29c;
}

.job-command-metrics .receipt-cost-metric {
    background: #f7f3ff;
    border-color: #d8c8f2;
}

.job-command-metrics .operating-cost-metric {
    background: #f2faf5;
    border-color: #bfe3ca;
}

.job-workspace-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
}

.job-workspace-nav button {
    min-height: 50px;
    padding: 10px 12px;
    border: 0;
    border-radius: 11px;
    background: #eef3f7;
    color: #263852;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.job-workspace-nav-streamlined button span {
    display: inline-grid;
    width: 24px;
    height: 24px;
    margin-right: 7px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #d94f0e;
    font-size: 0.78rem;
}

.job-workspace-nav-streamlined button.active span {
    color: #f5671f;
}

.job-workspace-nav button:hover {
    background: #e2eaf1;
}

.job-workspace-nav button.active {
    background: #f5671f;
    color: #fff;
    box-shadow: 0 6px 16px rgba(245, 103, 31, 0.24);
}

.job-action-toolbar-legacy,
.job-workspace-hidden {
    display: none !important;
}

.job-action-toolbar-simple {
    align-items: stretch;
}

.job-running-cost-entry {
    margin: 18px 0;
}

.job-running-cost-entry > summary {
    color: #172033;
    font-weight: 800;
}

.job-completion-panel {
    border-top: 5px solid #f5671f;
}

.job-completion-finance {
    align-items: center;
    border: 1px solid;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    margin: 16px 0;
    padding: 13px 15px;
}

.job-completion-finance > span {
    align-items: center;
    border-radius: 50%;
    display: flex;
    flex: 0 0 30px;
    font-size: 18px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
}

.job-completion-finance > div {
    display: grid;
    gap: 2px;
}

.job-completion-finance small {
    color: inherit;
}

.job-completion-finance.ready {
    background: #eefaf2;
    border-color: #a9ddba;
    color: #17663b;
}

.job-completion-finance.ready > span {
    background: #20ae63;
    color: #fff;
}

.job-completion-finance.waiting {
    background: #fff8eb;
    border-color: #efd094;
    color: #80520b;
}

.job-completion-finance.waiting > span {
    background: #f2c056;
    color: #4f3507;
}

.job-completion-checks {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0;
}

.job-completion-checks label {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    gap: 11px;
    margin: 0;
    padding: 13px;
}

.job-completion-checks label:has(input:checked) {
    background: #eefaf2;
    border-color: #a9ddba;
}

.job-completion-checks input {
    flex: 0 0 auto;
    height: 20px;
    margin-top: 2px;
    width: 20px;
}

.job-completion-checks label > span {
    display: grid;
    gap: 3px;
}

.job-completion-checks small {
    color: #667085;
    font-weight: 500;
    line-height: 1.35;
}

.job-completion-notes {
    display: block;
    margin-bottom: 16px;
}

@media (max-width: 760px) {
    .job-completion-checks {
        grid-template-columns: 1fr;
    }
}

.job-expense-review-list {
    margin-top: 8px;
}

.job-expense-review-item {
    border-bottom: 1px solid #e3e8ef;
}

.job-expense-review-item:last-child {
    border-bottom: 0;
}

.job-expense-review-item > summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    list-style: none;
    padding: 11px 4px 11px 24px;
    position: relative;
}

.job-expense-review-item > summary::-webkit-details-marker {
    display: none;
}

.job-expense-review-item > summary::before {
    color: #667085;
    content: "›";
    font-size: 22px;
    font-weight: 900;
    left: 5px;
    line-height: 1;
    position: absolute;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.job-expense-review-item[open] > summary::before {
    transform: rotate(90deg);
}

.job-expense-review-item > summary > span {
    display: grid;
    min-width: 0;
}

.job-expense-review-item > summary small {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.job-expense-review-item > summary span strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-expense-review-amount {
    white-space: nowrap;
}

.job-expense-review-detail {
    background: #f8fafc;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    justify-items: start;
    margin: 0 4px 10px 24px;
    padding: 10px 12px;
}

.job-expense-review-detail p {
    color: #475467;
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .job-expense-review-item > summary {
        gap: 8px;
        padding-bottom: 9px;
        padding-top: 9px;
    }

    .job-expense-review-item > summary span strong,
    .job-expense-review-amount {
        font-size: 14px;
    }
}

.job-team-diary-panel {
    display: block !important;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #f8fafc;
}

.job-team-diary-panel h3 {
    margin: 0;
}

.job-team-empty {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border: 1px dashed #cbd7e3;
    border-radius: 10px;
    background: #f8fafc;
    color: #667085;
}

.job-team-assignment-list {
    margin: 10px 0 18px;
    border-top: 1px solid #e3e8ef;
}

.job-team-assignment-list em {
    color: #667085;
    font-style: normal;
}

.job-team-assignment-form {
    padding-top: 16px;
    border-top: 1px solid #e3e8ef;
}

/* Shared compact register treatment used across operational pages. */
.register-filter-bar {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
    margin: 0 0 16px;
    padding: 10px;
}

.register-filter-bar.quotation-filter-bar {
    grid-template-columns: .85fr 1.25fr 1fr 1fr auto auto;
}

.register-filter-bar.payment-filter-bar,
.register-filter-bar.invoice-filter-bar {
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.register-filter-bar.materials-filter-bar {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.register-filter-bar.vehicle-filter-bar,
.register-filter-bar.user-filter-bar {
    grid-template-columns: 1.4fr 1fr 1fr auto;
}

.register-filter-bar.staff-filter-bar {
    grid-template-columns: 1.2fr 1fr 1.2fr 1fr auto;
}

.register-filter-bar label {
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}

.register-filter-bar label span {
    display: block;
    margin: 0 0 5px;
}

.register-filter-bar input,
.register-filter-bar select,
.register-filter-clear,
.register-more-filters > summary {
    height: 44px;
    min-height: 44px;
}

.register-filter-disclosure {
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    margin: 0 0 16px;
    overflow: hidden;
}

.register-filter-disclosure > summary {
    align-items: center;
    color: #25364d;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 54px;
    padding: 12px 16px;
}

.register-filter-disclosure > summary::-webkit-details-marker {
    display: none;
}

.register-filter-disclosure > summary small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
}

.register-filter-disclosure > summary::after {
    color: #f26a21;
    content: "\25BC";
    font-size: 13px;
}

.register-filter-disclosure[open] > summary {
    background: #eef3f8;
    border-bottom: 1px solid #dbe3ec;
}

.register-filter-disclosure[open] > summary::after {
    content: "\25B2";
}

.register-filter-disclosure .register-filter-bar {
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 12px;
}

.register-more-filters {
    position: relative;
}

.register-more-filters > summary,
.register-filter-clear {
    align-items: center;
    background: #e9eff5;
    border: 0;
    border-radius: 8px;
    color: #25364d;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    list-style: none;
    padding: 8px 12px;
    white-space: nowrap;
}

.register-more-filters > summary::-webkit-details-marker {
    display: none;
}

.register-more-filters > summary::after {
    content: "⌄";
    font-size: 15px;
    margin-left: 7px;
}

.register-more-filters[open] > summary {
    background: #dce6ef;
}

.register-more-filters[open] > summary::after {
    content: "⌃";
}

.register-more-filter-grid {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 24, 40, .16);
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(190px, 1fr));
    margin-top: 7px;
    min-width: 440px;
    padding: 14px;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
}

.quotation-filter-bar .register-more-filter-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    min-width: 560px;
}

.record-workspace > .table-panel,
.quote-workspace > .table-panel {
    border-top: 3px solid #e7edf3;
}

.record-workspace > .panel:not(.table-panel),
.quote-workspace > .panel:not(.table-panel) {
    border-top: 3px solid rgba(242, 106, 33, .62);
}

@media (max-width: 1000px) {
    .register-filter-bar,
    .register-filter-bar.quotation-filter-bar,
    .register-filter-bar.payment-filter-bar,
    .register-filter-bar.invoice-filter-bar,
    .register-filter-bar.materials-filter-bar,
    .register-filter-bar.vehicle-filter-bar,
    .register-filter-bar.user-filter-bar,
    .register-filter-bar.staff-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .register-more-filters,
    .register-filter-clear {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .register-filter-bar,
    .register-filter-bar.quotation-filter-bar,
    .register-filter-bar.payment-filter-bar,
    .register-filter-bar.invoice-filter-bar,
    .register-filter-bar.materials-filter-bar,
    .register-filter-bar.vehicle-filter-bar,
    .register-filter-bar.user-filter-bar,
    .register-filter-bar.staff-filter-bar {
        grid-template-columns: 1fr;
    }

    .register-more-filter-grid,
    .quotation-filter-bar .register-more-filter-grid {
        grid-template-columns: 1fr;
        min-width: 0;
        position: static;
        width: 100%;
    }
}

/* Compact Job Tracker: all detailed records now live in the Command Centre. */
@media (min-width: 801px) {
    .job-filter-bar {
        grid-template-columns: 12fr 13fr 19fr 22fr 24fr auto;
        gap: 6px;
        padding: 8px;
    }

    .job-filter-bar input,
    .job-filter-bar select,
    .job-filter-bar .job-filter-clear {
        height: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    .table-panel .job-register-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    .job-register-table th:nth-child(1) { width: 12%; }
    .job-register-table th:nth-child(2) { width: 14%; }
    .job-register-table th:nth-child(3) { width: 15%; }
    .job-register-table th:nth-child(4) { width: 16%; }
    .job-register-table th:nth-child(5) { width: 20%; }
    .job-register-table th:nth-child(6) { width: 23%; }

    .job-register-row > td {
        padding: 9px 5px;
        vertical-align: middle;
    }

    .job-register-table th {
        padding: 9px 5px;
    }

    .table-panel .job-register-table th:last-child,
    .table-panel .job-register-table td:last-child {
        min-width: 0;
        padding-left: 5px;
        padding-right: 5px;
    }

    .job-dates-cell .primary,
    .job-dates-cell .secondary {
        margin-top: 5px;
        min-height: 36px;
        padding: 7px 12px;
    }
}

.record-workspace > .table-panel {
    padding-left: 8px;
    padding-right: 8px;
}

.job-balance-due-cell strong,
.job-balance-due-cell span {
    display: block;
}

.job-balance-due-cell strong {
    color: #172033;
    font-size: 16px;
    white-space: nowrap;
}

.job-balance-due-cell span {
    color: #667085;
    font-size: 11px;
    margin-top: 3px;
}

.job-trade-cell > span {
    display: block;
}

.job-register-table .job-trade-cell.trade-assigned {
    background: var(--trade-bg, #f1f5f9);
    box-shadow: inset 4px 0 0 var(--trade-border, #64748b);
}

.job-register-table .job-trade-cell.trade-assigned > span {
    color: var(--trade-text, #334155);
    font-weight: 800;
}

.job-register-table .job-trade-cell.trade-assigned .job-quick-trade-button {
    background: var(--trade-button, #e2e8f0);
    border-color: var(--trade-button-border, #cbd5e1);
    color: var(--trade-text, #334155);
}

.job-register-table .job-trade-cell.trade-unassigned {
    background: #fff;
}

.trade-colour-joinery {
    --trade-bg: var(--trade-joiner-bg);
    --trade-border: var(--trade-joiner-border);
    --trade-button: var(--trade-joiner-bg);
    --trade-button-border: var(--trade-joiner-border);
    --trade-text: var(--trade-joiner-text);
}

.trade-colour-plumbing {
    --trade-bg: var(--trade-plumber-bg);
    --trade-border: var(--trade-plumber-border);
    --trade-button: var(--trade-plumber-bg);
    --trade-button-border: var(--trade-plumber-border);
    --trade-text: var(--trade-plumber-text);
}

.trade-colour-apprentice {
    --trade-bg: var(--trade-apprentice-bg);
    --trade-border: var(--trade-apprentice-border);
    --trade-button: var(--trade-apprentice-bg);
    --trade-button-border: var(--trade-apprentice-border);
    --trade-text: var(--trade-apprentice-text);
}

.trade-colour-labourer {
    --trade-bg: var(--trade-labourer-bg);
    --trade-border: var(--trade-labourer-border);
    --trade-button: var(--trade-labourer-bg);
    --trade-button-border: var(--trade-labourer-border);
    --trade-text: var(--trade-labourer-text);
}

.trade-colour-subcontractor {
    --trade-bg: var(--trade-subcontractor-bg);
    --trade-border: var(--trade-subcontractor-border);
    --trade-button: var(--trade-subcontractor-bg);
    --trade-button-border: var(--trade-subcontractor-border);
    --trade-text: var(--trade-subcontractor-text);
}

.trade-colour-electrical {
    --trade-bg: #fffbea;
    --trade-border: #eab308;
    --trade-button: #fef3c7;
    --trade-button-border: #facc15;
    --trade-text: #854d0e;
}

.trade-colour-plastering {
    --trade-bg: #f5f3ff;
    --trade-border: #8b5cf6;
    --trade-button: #ede9fe;
    --trade-button-border: #c4b5fd;
    --trade-text: #5b21b6;
}

.trade-colour-tiling {
    --trade-bg: #fff7ed;
    --trade-border: #f97316;
    --trade-button: #ffedd5;
    --trade-button-border: #fdba74;
    --trade-text: #9a3412;
}

.trade-colour-decorating {
    --trade-bg: #fdf2f8;
    --trade-border: #ec4899;
    --trade-button: #fce7f3;
    --trade-button-border: #f9a8d4;
    --trade-text: #9d174d;
}

.trade-colour-roofing {
    --trade-bg: #fdf8f3;
    --trade-border: #a16207;
    --trade-button: #fef3c7;
    --trade-button-border: #d6b46a;
    --trade-text: #713f12;
}

.trade-colour-labouring {
    --trade-bg: #f1f5f9;
    --trade-border: #64748b;
    --trade-button: #e2e8f0;
    --trade-button-border: #cbd5e1;
    --trade-text: #334155;
}

.trade-colour-groundworks {
    --trade-bg: #f0fdf4;
    --trade-border: #22a861;
    --trade-button: #dcfce7;
    --trade-button-border: #86efac;
    --trade-text: #166534;
}

.trade-colour-multi {
    --trade-bg: #fff5ef;
    --trade-border: #f5671f;
    --trade-button: #ffeadf;
    --trade-button-border: #fdba8c;
    --trade-text: #9a3412;
}

.trade-colour-other {
    --trade-bg: #f8fafc;
    --trade-border: #64748b;
    --trade-button: #eef2f6;
    --trade-button-border: #cbd5e1;
    --trade-text: #334155;
}

.job-quick-trade-button {
    margin-top: 7px;
    min-height: 32px;
    padding: 5px 10px;
}

.job-trade-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.job-trade-tags > span {
    background: var(--trade-bg, #f8fafc);
    border: 1px solid var(--trade-border, #64748b);
    border-radius: 999px;
    color: var(--trade-text, #334155);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    padding: 4px 7px;
}

.quick-trade-row > td {
    padding: 0 10px 14px !important;
}

.quick-trade-panel {
    align-items: start;
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-left: 5px solid #f5671f;
    border-radius: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, .8fr) minmax(320px, 2fr);
    padding: 12px;
}

.quick-trade-options {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    width: 100%;
}

.quick-trade-options .check-row {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: row;
    gap: 7px;
    margin: 0;
    min-height: 38px;
    padding: 7px 9px;
}

.quick-trade-options .check-row:has(input:checked) {
    background: #fff4ed;
    border-color: #f8b58d;
    color: #9a3412;
}

.quick-trade-options input {
    min-height: 0;
    width: auto;
}

.quick-trade-custom {
    grid-column: 2;
    display: grid;
    gap: 10px;
    grid-template-columns: 1.4fr 1fr 1fr;
    width: 100%;
}

.quick-trade-schedules {
    display: grid;
    gap: 8px;
    grid-column: 2;
    width: 100%;
}

.quick-trade-schedule-row {
    align-items: end;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    display: grid;
    gap: 9px;
    grid-template-columns: minmax(130px, 1.2fr) 1fr 1fr;
    padding: 9px;
}

.quick-trade-schedule-row > span {
    align-self: center;
    background: var(--trade-bg, #f8fafc);
    border: 1px solid var(--trade-border, #64748b);
    border-radius: 999px;
    color: var(--trade-text, #334155);
    font-size: 12px;
    font-weight: 800;
    justify-self: start;
    padding: 5px 8px;
}

.quick-trade-schedule-row label,
.quick-trade-custom label {
    margin: 0;
}

.quick-trade-actions {
    grid-column: 2;
}

.quick-trade-copy,
.quick-trade-copy span {
    display: block;
}

.quick-trade-copy span {
    color: #667085;
    font-size: 12px;
    margin-top: 3px;
}

.quick-trade-panel label {
    margin: 0;
}

.quick-trade-panel input,
.quick-trade-panel button {
    min-height: 40px;
}

@media (max-width: 800px) {
    .quick-trade-panel {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .quick-trade-custom,
    .quick-trade-schedules,
    .quick-trade-actions {
        grid-column: 1;
    }

    .quick-trade-custom,
    .quick-trade-schedule-row {
        grid-template-columns: 1fr;
    }
}

.job-register-table .job-status-cell .status {
    box-sizing: border-box;
    display: inline-flex !important;
    justify-content: flex-start;
    line-height: 1.15;
    max-width: min(100%, 220px);
    min-width: 0;
    padding: 8px 10px;
    text-align: left;
    white-space: normal;
    width: fit-content !important;
}

.job-number-open {
    align-items: center;
    color: #172033;
    display: inline-flex;
    font-weight: 900;
    gap: 7px;
    text-decoration: none;
    white-space: nowrap;
}

.job-number-open span {
    color: #f5671f;
    font-size: 18px;
    transition: transform 0.15s ease;
}

.job-number-open:hover {
    color: #d94f0e;
}

.job-number-open:hover span {
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .job-workspace-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .job-workspace-nav {
        display: flex;
        overflow-x: auto;
        scrollbar-width: thin;
        position: sticky;
        top: 0;
        z-index: 12;
    }

    .job-workspace-nav button {
        flex: 0 0 auto;
        min-width: 132px;
        min-height: 44px;
        font-size: 0.9rem;
    }
}

@media (max-width: 1250px) {
    .job-action-toolbar {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }
}

@media (max-width: 800px) {
    .job-scope-heading {
        flex-direction: column;
    }

    .job-scope-total {
        min-width: 0;
        width: 100%;
    }

    .job-scope-line-header {
        display: none;
    }

    .job-scope-line {
        grid-template-columns: 1fr 1fr;
    }

    .job-scope-line > strong:first-child {
        grid-column: 1 / -1;
    }

    .job-scope-line [data-label]::before {
        color: #667085;
        content: attr(data-label) ": ";
        font-size: 11px;
        font-weight: 800;
    }

    .job-command-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .job-action-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .job-action-hub-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .job-quick-action-panel .job-command-form {
        grid-template-columns: 1fr;
    }

    .job-cost-entry,
    .job-cost-entry-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .job-cost-entry-actions .danger {
        width: 100%;
    }

    .assignment-hours-editor {
        justify-content: space-between;
        width: 100%;
    }
}

@media (max-width: 1100px) and (min-width: 701px) {
    .job-command-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Jobs pipeline value strip. */
.job-value-summary-bar {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(300px, 1.25fr) repeat(3, minmax(190px, 1fr));
}

.job-value-summary-bar .open-form-card {
    box-sizing: border-box;
    height: 100%;
    margin: 0;
    max-width: none;
    min-height: 82px;
    width: 100%;
}

.job-value-summary-item {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 82px;
    padding: 13px 16px;
}

.job-value-summary-item span {
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.job-value-summary-item strong {
    color: #172033;
    font-size: clamp(18px, 1.5vw, 24px);
    line-height: 1.2;
    margin-top: 6px;
}

.job-value-summary-total {
    background: #fff6ef;
    border-color: #f8b58d;
    border-left: 5px solid #f26a21;
}

.job-value-summary-total span {
    color: #9a430e;
}

@media (max-width: 1100px) {
    .job-value-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .job-value-summary-bar {
        grid-template-columns: 1fr;
    }
}

.job-price-editor {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-left: 5px solid #f26a21;
    border-radius: 10px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1.5fr) minmax(190px, .7fr);
    margin-bottom: 18px;
    padding: 16px;
}

.job-price-editor > .button-row,
.job-price-preview {
    grid-column: 1 / -1;
}

.job-price-editor p {
    margin-bottom: 0;
}

.job-price-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.job-price-preview span {
    color: #667085;
    font-size: 13px;
}

.job-price-preview strong {
    color: #172033;
    margin-left: 5px;
}

@media (max-width: 700px) {
    .job-price-editor {
        grid-template-columns: 1fr;
    }

    .job-price-editor > .button-row,
    .job-price-preview {
        grid-column: 1;
    }
}

/* Compact staff register and readable salary summary. */
@media (min-width: 801px) {
    .staff-records-table {
        min-width: 0;
        table-layout: fixed;
        width: 100%;
    }

    .staff-records-table .staff-col-name { width: 8%; }
    .staff-records-table .staff-col-role { width: 11%; }
    .staff-records-table .staff-col-contact { width: 20%; }
    .staff-records-table .staff-col-emergency { width: 10%; }
    .staff-records-table .staff-col-salary { width: 14%; }
    .staff-records-table .staff-col-status { width: 10%; }
    .staff-records-table .staff-col-notes { width: 10%; }
    .staff-records-table .staff-col-actions { width: 17%; }

    .staff-records-table th,
    .staff-records-table td {
        padding: 9px 7px;
        vertical-align: top;
    }
}

.staff-records-table .salary-cell {
    min-width: 0;
    overflow: hidden;
}

.staff-records-table .staff-salary-compact {
    min-width: 0;
    padding: 2px 0;
}

.staff-records-table .staff-salary-compact > span,
.staff-records-table .staff-salary-compact > strong,
.staff-records-table .staff-salary-compact > small {
    display: block;
    margin: 0;
}

.staff-records-table .staff-salary-compact > span {
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.staff-records-table .staff-salary-compact > strong {
    color: #172033;
    font-size: 15px;
    line-height: 1.25;
    margin-top: 3px;
    white-space: nowrap;
}

.staff-records-table .staff-salary-compact > small {
    color: #475467;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4px;
    white-space: nowrap;
}

.staff-records-table .salary-summary {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    display: grid;
    gap: 5px;
    grid-template-columns: 1fr;
    padding: 7px 8px;
}

.staff-records-table .salary-summary div {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: 42px minmax(0, 1fr);
    min-width: 0;
}

.staff-records-table .salary-summary span {
    font-size: 11px;
    margin: 0;
}

.staff-records-table .salary-summary strong {
    display: block;
    font-size: 12px;
    line-height: 1.15;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
}

.staff-records-table .salary-summary strong small {
    color: #667085;
    display: block;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.staff-records-table .salary-more {
    margin-top: 6px;
}

.staff-records-table .salary-more summary {
    font-size: 11px;
    line-height: 1.25;
}

.staff-records-table .salary-more > span {
    font-size: 11px;
    line-height: 1.3;
}

.staff-records-table .description-cell {
    max-width: none;
}

.staff-records-table .action-menu summary {
    min-height: 36px;
    padding-left: 9px;
    padding-right: 26px;
}

/* Compact staff register and staff command centre */
.legacy-staff-document-register {
    display: none;
}

.staff-tracker-row td {
    vertical-align: middle;
}

.staff-tracker-row td:nth-child(3) span {
    color: #667085;
    display: block;
    font-size: 14px;
    margin-top: 3px;
}

.staff-command-overview,
.staff-command-section {
    margin-bottom: 18px;
}

.staff-command-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.staff-command-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.staff-command-full-width {
    grid-column: 1 / -1;
}

.staff-information-list {
    display: grid;
    gap: 0;
}

.staff-information-list > span {
    align-items: start;
    border-bottom: 1px solid #e2e8f0;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
    padding: 11px 0;
}

.staff-information-list > span:last-child {
    border-bottom: 0;
}

.staff-information-list small {
    color: #667085;
    font-weight: 800;
}

.staff-information-list strong {
    overflow-wrap: anywhere;
}

.staff-command-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0;
}

.staff-command-form label {
    min-width: 0;
}

.staff-command-form .wide-field {
    grid-column: 1 / -1;
}

.staff-command-form .check-row {
    align-items: center;
    display: flex;
    min-height: 48px;
}

.staff-command-form .check-row input {
    margin-right: 9px;
    width: auto;
}

.staff-document-list {
    margin-top: 18px;
}

.vehicle-mileage-entry {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(240px, 380px) auto;
    justify-content: start;
    margin-top: 16px;
}

.vehicle-mileage-entry label {
    margin: 0;
}

.input-with-suffix {
    align-items: center;
    display: flex;
    margin-top: 7px;
    position: relative;
}

.input-with-suffix input {
    padding-right: 70px;
}

.input-with-suffix span {
    color: #667085;
    font-size: 14px;
    font-weight: 800;
    pointer-events: none;
    position: absolute;
    right: 14px;
}

@media (min-width: 801px) {
    .staff-tracker-table {
        min-width: 0;
        table-layout: fixed;
        width: 100%;
    }

    .staff-tracker-table th:nth-child(1) { width: 25%; }
    .staff-tracker-table th:nth-child(2) { width: 22%; }
    .staff-tracker-table th:nth-child(3) { width: 35%; }
    .staff-tracker-table th:nth-child(4) { width: 18%; }

    .staff-tracker-table th,
    .staff-tracker-table td {
        padding: 11px 10px;
    }

    .staff-workspace-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .staff-command-grid,
    .staff-command-form {
        grid-template-columns: 1fr;
    }

    .staff-command-form .wide-field,
    .staff-command-full-width {
        grid-column: auto;
    }

    .staff-command-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-workspace-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-mileage-entry {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}

/* Final shared overrides: keep every office page compact and consistent. */
body {
    background: var(--ui-bg);
    color: var(--ui-text);
}

.sidebar {
    box-shadow: 6px 0 24px rgba(11, 20, 35, .12);
    width: 224px;
    z-index: 40;
}

.brand { margin-bottom: 16px; }
.brand-main { font-size: 37px; }
.brand-sub { font-size: 12px; }
.nav-group { margin-top: 3px; }
.nav-group > summary { border-radius: 7px; min-height: 38px; padding: 8px 11px; }
.nav-group-links { margin: 3px 0 5px 9px; padding-left: 7px; }
.nav-group-links a { font-size: 13px; min-height: 34px; padding-bottom: 7px; padding-top: 7px; }
.side-card { font-size: 12px; gap: 5px; margin-top: 18px; padding: 11px; }

.main {
    overflow: hidden;
    padding: 16px clamp(14px, 1.8vw, 28px) 32px;
}

.topbar {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--ui-shadow);
    gap: 14px;
    margin-bottom: 16px;
    min-height: 72px;
    padding: 10px 13px;
    position: sticky;
    top: 8px;
    z-index: 30;
}

.topbar-brand { flex: 0 0 auto; }
.topbar-brand h1 { font-size: 22px; }
.topbar-brand p { white-space: nowrap; }
.topbar-quick-links,
.topbar-account { flex: 0 0 auto; }
.profile strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-head { margin-bottom: 13px; }
.page-head h1 { font-size: clamp(24px, 2vw, 30px); }
.page-head p { margin-top: 2px; }

.panel,
.kpi { border-color: var(--ui-border); box-shadow: var(--ui-shadow); }
.panel { padding: 17px; }
.record-workspace,
.quote-workspace,
.grid { gap: 13px; }
.record-workspace > *,
.quote-workspace > *,
.grid > * { min-width: 0; }

.table-panel {
    border-radius: 11px;
    scrollbar-color: #aab4c1 #eef2f6;
    scrollbar-width: thin;
}
.table-panel-head { gap: 12px; margin-bottom: 10px; }
.table-panel-head h2 { font-size: 20px; }
.data-table th { background: #f1f4f8; color: #344054; font-size: 11px; letter-spacing: .035em; padding: 9px 8px; }
.data-table td { font-size: 13px; padding: 9px 8px; }
.data-table td > strong:first-child { color: var(--ui-text); }
.data-table tbody tr:hover { background: #fff7f0; }

.register-filter-bar,
.job-filter-bar {
    background: #f5f7fa;
    border-color: var(--ui-border);
    margin-bottom: 12px;
    padding: 9px;
}
.register-filter-bar label,
.job-filter-bar label { font-size: 11px; }
.register-filter-bar input,
.register-filter-bar select,
.job-filter-bar input,
.job-filter-bar select { min-height: 40px; }

input,
select,
textarea { border-color: #c8d1dc; }
label { margin-bottom: 11px; }
.button-row { margin-top: 3px; }
.primary,
.secondary,
.danger,
.secondary-link { min-height: 38px; }
.primary { background: var(--ui-orange); }
.primary:hover { background: var(--ui-orange-dark); }
.open-form-card { max-width: 330px; min-height: 62px; padding: 11px 14px; }
.open-form-card span { font-size: 11px; }
.open-form-card strong { font-size: 15px; }
.notice { margin-bottom: 12px; padding: 12px 15px; }

@media (max-width: 1180px) {
    .topbar-quick-links { display: none; }
    .global-search { max-width: none; }
}

@media (max-width: 800px) {
    .sidebar { box-shadow: 0 5px 18px rgba(11, 20, 35, .18); width: 100%; }
    .main { padding: 10px 10px 26px; }
    .topbar { display: grid; gap: 9px; grid-template-columns: 1fr; position: static; }
    .topbar-brand { display: none; }
    .global-search { min-width: 0; order: -1; width: 100%; }
    .global-search-results { left: 10px; position: fixed; right: 10px; top: 70px; }
    .topbar-account { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
    .topbar-account .account-switch-link { width: auto; }
    .profile { min-width: 145px; padding: 8px 10px; width: auto; }
    .page-head { padding: 0 3px; }
    .panel { padding: 13px; }
    .table-panel { margin-left: 0; margin-right: 0; padding-left: 8px; padding-right: 8px; }
    .data-table { min-width: 720px; }
    .data-table th,
    .data-table td { padding: 8px 7px; }
    .entry-form-panel { padding: 14px; }
}

@media (max-width: 520px) {
    .topbar-account { grid-template-columns: 1fr; }
    .topbar-account .account-switch-link,
    .profile { width: 100%; }
    .global-search-results a { grid-template-columns: 58px minmax(0, 1fr); }
    .page-head h1 { font-size: 23px; }
}
.quote-notes-scan {
    background: #f7faff;
    border: 1px dashed #a8bee0;
    border-radius: 14px;
}

.quote-notes-scan input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd7e7;
    border-radius: 10px;
    background: #fff;
}

/* Streamlined office workspace: primary work first, supporting information on demand. */
.dashboard-snapshot {
    margin: 0 0 13px;
    padding: 0;
}

.dashboard-snapshot > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    list-style: none;
    min-height: 58px;
    padding: 13px 17px;
}

.dashboard-snapshot > summary::-webkit-details-marker { display: none; }
.dashboard-snapshot > summary::after { color: var(--ui-orange); content: "+"; font-size: 22px; font-weight: 800; }
.dashboard-snapshot[open] > summary::after { content: "−"; }
.dashboard-snapshot > summary span { font-size: 18px; font-weight: 800; }
.dashboard-snapshot > summary small { color: var(--ui-muted); margin-left: auto; }
.dashboard-snapshot > .kpis { margin: 0; padding: 0 13px 13px; }

.topbar .global-search {
    margin-right: auto;
}

@media (max-width: 700px) {
    .dashboard-snapshot > summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .dashboard-snapshot > summary small {
        margin-left: 0;
        order: 3;
        width: 100%;
    }
}

/* 2026 system-wide workflow pass: compact, predictable and action-first. */
.main { padding-top: 12px; }

.topbar {
    margin-bottom: 12px;
    min-height: 60px;
    padding: 7px 10px;
}

.global-search-input-wrap { min-height: 40px; }

.topbar-quick-links {
    align-items: center;
    display: flex;
    gap: 6px;
}

.topbar-quick-links a {
    background: #f0f3f7;
    border: 1px solid #e0e6ed;
    border-radius: 9px;
    color: #1b2b44;
    font-size: 12px;
    font-weight: 800;
    padding: 9px 11px;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-quick-links a:hover {
    background: #fff1e8;
    border-color: #ffbd94;
    color: #b83d00;
}

.account-switch-link { min-height: 40px; padding: 9px 13px; }
.profile { min-height: 40px; padding-bottom: 5px; padding-top: 5px; }
.page-head { margin-bottom: 10px; }
.page-head h1 { line-height: 1.1; }

.panel {
    margin-bottom: 12px;
    padding: 14px;
}

.kpis { gap: 10px; margin: 10px 0 12px; }
.kpi { min-height: 96px; padding: 13px 15px; }
.kpi strong { line-height: 1.08; }

.register-filter-bar,
.job-filter-bar {
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
}

.table-panel { overflow-x: auto; }
.table-panel:has(.action-menu[open]) { overflow: visible; }
.action-menu[open] { position: relative; z-index: 90; }
.action-menu-list { z-index: 100; }
.action-menu summary,
details > summary { cursor: pointer; }

.data-table th,
.data-table td { vertical-align: middle; }
.data-table td:last-child,
.data-table th:last-child { white-space: nowrap; }

.office-action-centre { padding: 14px; }
.office-action-head p { margin-bottom: 0; }
.office-action-grid { gap: 8px; }
.office-action-card { min-height: 112px; padding: 12px; }
.office-priority-list:not([open]) { margin-bottom: 0; }

@media (min-width: 1200px) {
    .data-table td { line-height: 1.3; }
    .table-panel .data-table:not(.job-register-table):not(.customer-records-table) { min-width: 920px; }
}

@media (max-width: 800px) {
    .main { padding-top: 8px; }
    .topbar { margin-bottom: 9px; }
    .panel { margin-bottom: 9px; padding: 11px; }
    .kpi { min-height: 82px; padding: 11px; }
    .data-table { min-width: 680px; }
}

/* Dashboard: show decisions first and keep supporting detail on demand. */
.skip-link:not(:focus-visible) {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    left: 0;
    overflow: hidden;
    padding: 0;
    top: 0;
    white-space: nowrap;
    width: 1px;
}

.office-action-head {
    margin-bottom: 10px;
}

.office-action-head h2 {
    font-size: 21px;
    margin-bottom: 2px;
}

.office-action-head p {
    font-size: 13px;
}

.office-action-total {
    font-size: 15px;
    padding: 8px 12px;
}

.office-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.office-action-card {
    min-height: 88px;
    padding: 10px;
}

.office-action-card.clear {
    display: none;
}

.office-action-card > strong {
    font-size: 21px;
    margin: 4px 0 2px;
}

.office-action-card > small {
    font-size: 9px;
}

.office-priority-list > summary {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.office-priority-list > summary small {
    color: #667085;
    font-size: 10px;
}

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

.office-priority-columns a {
    min-width: 0;
    padding: 7px 9px;
}

.office-priority-columns strong,
.office-priority-columns span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-financial-compact {
    padding: 13px 15px;
}

.dashboard-financial-compact .dashboard-financial-head {
    align-items: center;
    margin-bottom: 7px;
}

.dashboard-financial-compact .dashboard-financial-head h2 {
    font-size: 20px;
    margin-bottom: 1px;
}

.dashboard-financial-compact .dashboard-financial-head p {
    font-size: 12px;
    margin: 0;
}

.dashboard-financial-compact .month-filter {
    margin: 0;
    max-width: 190px;
}

.dashboard-financial-compact .month-filter input {
    min-height: 38px;
    padding: 6px 9px;
}

.dashboard-financial-compact .financial-kpis {
    gap: 8px;
    margin: 6px 0;
}

.dashboard-financial-compact .financial-kpis .kpi {
    min-height: 86px;
    padding: 10px 12px;
}

.dashboard-financial-compact .financial-kpis .kpi strong {
    font-size: clamp(22px, 2vw, 29px);
}

.dashboard-financial-compact .financial-expense-breakdown {
    font-size: 11px;
    gap: 18px;
    padding-top: 4px;
}

.dashboard-grid {
    gap: 9px;
}

.dashboard-dropdown {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .office-priority-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .office-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .office-priority-columns { grid-template-columns: 1fr; }
    .dashboard-financial-compact .dashboard-financial-head { align-items: stretch; }
    .dashboard-financial-compact .month-filter { max-width: none; width: 100%; }
}

/* Accounting provider setup and connection status */
.accounting-profile-strip {
    align-items: center;
    border-left: 5px solid #ff641e;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(230px, .8fr) minmax(440px, 1.4fr) auto;
    margin-bottom: 18px;
}

.accounting-profile-copy h2,
.accounting-profile-copy p {
    margin: .15rem 0;
}

.accounting-connection-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.connection-state {
    border: 1px solid #dce3eb;
    border-radius: 11px;
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.connection-state small {
    color: #667085;
    font-weight: 800;
}

.connection-state strong {
    color: #10213d;
}

.connection-state.ready {
    background: #eef9f1;
    border-color: #9ed2ad;
}

.connection-state.setup {
    background: #fff7e8;
    border-color: #edc979;
}

.accounting-connection-settings h3 {
    border-top: 1px solid #e2e8f0;
    margin: 22px 0 10px;
    padding-top: 18px;
}

.accounting-connection-settings .notice {
    margin-bottom: 16px;
}

@media (max-width: 1000px) {
    .accounting-profile-strip { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .accounting-connection-grid { grid-template-columns: 1fr; }
}

.website-gallery-upload {
    margin-bottom: 20px;
}

.website-gallery-admin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.website-gallery-admin-card {
    background: #f8fafc;
    border: 1px solid #dce3eb;
    border-radius: 14px;
    overflow: hidden;
}

.website-gallery-admin-card > img {
    aspect-ratio: 16 / 10;
    display: block;
    object-fit: cover;
    width: 100%;
}

.website-gallery-admin-card > div {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.website-gallery-admin-card small {
    color: #667085;
}

.website-gallery-admin-card label {
    display: grid;
    gap: 6px;
}

@media (max-width: 850px) {
    .website-gallery-admin-grid { grid-template-columns: 1fr; }
}

/* Guided job workflow */
.job-process-rail {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0 0 14px;
}

.job-process-rail > a,
.job-process-rail > button {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    color: #10213d;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 1px 9px;
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 66px;
    padding: 9px 10px;
    text-align: left;
    text-decoration: none;
}

.job-process-rail > a:hover,
.job-process-rail > button:hover {
    border-color: #ff641e;
    box-shadow: 0 5px 14px rgba(16, 33, 61, .08);
}

.job-process-rail span {
    align-items: center;
    background: #e8eef5;
    border-radius: 50%;
    display: flex;
    font-size: 13px;
    font-weight: 900;
    grid-row: 1 / span 2;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.job-process-rail strong,
.job-process-rail small {
    grid-column: 2;
    min-width: 0;
}

.job-process-rail strong { font-size: 13px; }
.job-process-rail small { color: #667085; font-size: 11px; line-height: 1.2; }
.job-process-rail .done { background: #f1faf4; border-color: #a8d8b5; }
.job-process-rail .done span { background: #1f9458; color: #fff; }
.job-process-rail .attention { background: #fff7ed; border-color: #f5bc91; }
.job-process-rail .attention span { background: #ff641e; color: #fff; }

.job-automation-note,
.job-auto-cost-summary {
    align-items: center;
    background: #eef8f2;
    border: 1px solid #add8bb;
    border-left: 5px solid #219653;
    border-radius: 12px;
    color: #153c28;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px 14px;
}

.job-automation-note span,
.job-auto-cost-summary small {
    color: #4f6b5a;
}

.job-auto-cost-summary > div {
    display: grid;
    gap: 2px;
}

.job-auto-cost-summary > strong {
    color: #10213d;
    font-size: 20px;
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 950px) {
    .job-process-rail {
        grid-template-columns: repeat(6, minmax(170px, 1fr));
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

@media (max-width: 650px) {
    .job-automation-note,
    .job-auto-cost-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .job-auto-cost-summary > strong { margin-left: 0; }
}
