:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #161616;
  background: #f6f6f6;
  font-synthesis: none;
  --ink: #161616;
  --muted: #707070;
  --line: #e2e2e2;
  --paper: #fff;
  --green: #55bb33;
  --green-dark: #34791f;
  --mono: 'Consolas', 'Courier New', monospace;
  --serif: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.loading-screen, .fatal-state { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; }
.brand-logo { display: block; width: 108px; height: 62px; padding: 3px; object-fit: contain; background: #fff; }
.loading-screen { color: var(--ink); font: 600 14px var(--mono); }
.fatal-state { flex-direction: column; text-align: center; padding: 32px; }
.fatal-state h1 { font: 600 30px var(--serif); }
.fatal-state p { color: var(--muted); }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, .9fr) 1.1fr; background: var(--paper); }
.auth-brand-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 36px clamp(30px, 6vw, 88px); color: #fff; background-color: #161616; background-image: linear-gradient(90deg, rgba(22,22,22,.9), rgba(22,22,22,.58)), url('/bridges-hero.jpg'); background-size: cover; background-position: center; }
.auth-brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: 0; }
.auth-brand > span, .brand-light { color: #d2d2d2; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.auth-statement { margin: auto 0; max-width: 510px; padding: 45px 0; }
.eyebrow, .auth-panel-foot, .side-caption, .topbar-label, .page-footer, .stat-top, .stat-index, .stat-foot, .result-count { font: 500 10px var(--mono); letter-spacing: 0; }
.auth-statement .eyebrow { color: var(--green); }
.auth-statement h1 { margin: 20px 0 14px; font: 700 64px/1.06 var(--serif); letter-spacing: 0; }
.auth-statement p { max-width: 360px; margin: 0; color: #bcc4bf; font-size: 16px; line-height: 1.7; }
.auth-panel-foot { display: flex; justify-content: space-between; color: #89958d; font-size: 9px; }
.auth-form-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 72px 32px 24px; position: relative; }
.auth-form-wrap { width: min(100%, 420px); margin-top: -16px; }
.auth-form-wrap > .eyebrow { color: var(--green-dark); }
.auth-form-wrap h2 { margin: 16px 0 8px; font: 700 36px/1.15 var(--serif); letter-spacing: 0; }
.auth-subtitle { margin: 0 0 34px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-stack, .dialog-fields { display: grid; gap: 19px; }
.form-stack label, .dialog-fields label { display: grid; gap: 8px; color: #414a44; font-size: 12px; font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid #dedede; border-radius: 2px; outline: none; background: #fff; color: var(--ink); padding: 12px 13px; font-size: 14px; transition: border-color .16s, box-shadow .16s; }
input::placeholder, textarea::placeholder { color: #a5aaa3; }
input:focus, textarea:focus, select:focus { border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(85,187,51,.16); }
textarea { resize: vertical; min-height: 76px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 2px; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .16s, border-color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button-primary { color: var(--ink); background: var(--green); }
.button-primary:hover { background: #48a52b; }
.button-wide { width: 100%; margin-top: 3px; }
.button-outline { color: var(--ink); border-color: #d7dbd2; background: transparent; }
.button-outline:hover { border-color: var(--green-dark); color: var(--green-dark); }
.form-note { margin: -8px 0 0; color: var(--muted); font-size: 11px; }
.form-error { min-height: 0; margin: 0; color: #ad3d2b; font-size: 12px; }
.auth-switch { margin-top: 25px; color: var(--muted); text-align: center; font-size: 12px; }
.text-button { border: 0; padding: 0; color: var(--green-dark); background: none; font-weight: 700; cursor: pointer; }
.auth-privacy { position: absolute; bottom: 24px; color: #929990; font: 500 9px var(--mono); letter-spacing: .08em; }
.auth-privacy span { padding: 0 8px; color: var(--green); }
.workspace { display: grid; min-height: 100vh; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 26px 16px 20px; color: #f4f4f4; background: #161616; }
.sidebar-brand { padding: 0 10px 32px; font-size: 13px; }
.sidebar-brand .brand-logo { width: 82px; height: 47px; }
.sidebar .brand-light { color: #bcbcbc; }
.side-caption { padding: 0 12px 11px; color: #a0a0a0; font-size: 9px; }
.main-nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 2px; color: #c2c9c3; background: transparent; text-align: left; cursor: pointer; font-size: 12px; }
.nav-link:hover { background: #292929; color: white; }
.nav-link.active { background: #292929; color: #fff; box-shadow: inset 3px 0 var(--green); }
.nav-number { color: #a0a0a0; font: 10px var(--mono); }
.nav-count { display: grid; min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; place-items: center; background: #3b3b3b; color: #fff; font: 10px var(--mono); }
.sidebar-lower { display: grid; gap: 15px; margin-top: auto; }
.workshop-chip { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid #344139; }
.workshop-chip div { display: grid; gap: 4px; }
.workshop-chip strong { font-size: 11px; font-weight: 600; }
.workshop-chip span:not(.status-light) { color: #89958d; font-size: 10px; }
.status-light { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(85,187,51,.16); }
.signout-button { display: flex; gap: 10px; align-items: center; padding: 8px 11px; border: 0; color: #aab4ac; background: none; text-align: left; cursor: pointer; font-size: 11px; }
.signout-button:hover { color: white; }
.main-panel { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.topbar { display: flex; min-height: 58px; justify-content: flex-end; align-items: center; gap: 20px; padding: 0 38px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar-label { overflow: hidden; max-width: 50%; color: #69716a; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; letter-spacing: .02em; }
.topbar-logout { border: 0; color: var(--green-dark); background: none; cursor: pointer; font-size: 11px; font-weight: 700; }
.mobile-brand { display: none; align-items: center; gap: 8px; margin-right: auto; font-weight: 700; font-size: 12px; }
.mobile-brand .brand-logo { width: 70px; height: 40px; }
.page-content { width: 100%; max-width: 1500px; flex: 1; margin: 0 auto; padding: 37px 38px 48px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading .eyebrow { color: var(--green-dark); font-size: 9px; }
.page-heading h1 { margin: 10px 0 5px; font: 700 36px/1.15 var(--serif); letter-spacing: 0; }
.page-heading p { margin: 0; color: #777f78; font-size: 12px; }
.page-heading .button { flex: 0 0 auto; }
.privacy-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: #566058; cursor: pointer; font-size: 11px; }
.privacy-toggle input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--green-dark); }
.financial-value { transition: filter .16s ease; }
.financial-blurred .financial-value { filter: blur(7px); user-select: none; }
.page-body { animation: rise-in .28s ease-out both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat-card { display: flex; min-height: 142px; flex-direction: column; justify-content: space-between; padding: 17px 18px 14px; border: 1px solid #e1e4e2; background: var(--paper); }
.stat-card.stat-ink { border-color: var(--ink); color: white; background: var(--ink); }
.stat-card.stat-unpaid { border-color: #d5e6ce; background: #f0f6ec; }
.stat-card[data-page] { color: var(--ink); text-align: left; cursor: pointer; }
.stat-card[data-page]:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 3px; }
.stat-unpaid .stat-top, .stat-unpaid .stat-foot { color: #486342; }
.stat-sales .stat-foot { margin-top: 4px; font-size: 8px; line-height: 1.35; letter-spacing: 0; }
.stat-sales .stat-comparison { padding-top: 5px; border-top: 1px solid rgba(255,255,255,.2); color: #d7dfd8; }
.stat-top { display: flex; justify-content: space-between; color: #707970; font-size: 9px; }
.stat-ink .stat-top, .stat-ink .stat-foot { color: #b7c1ba; }
.stat-index, .stat-mark { color: var(--green); font-size: 12px; }
.stat-card > strong { margin-top: 14px; font: 700 32px/1 var(--serif); letter-spacing: 0; }
.stat-foot { margin-top: 7px; color: #838a82; font-size: 9px; letter-spacing: .01em; }
.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.upcoming-mot-section, .low-stock-section { margin-top: 14px; padding: 20px; }
.top-spenders-section { margin-top: 14px; padding: 20px; }
.spender-rank { color: var(--green-dark); font: 10px var(--mono); }
.mot-expiry-soon { color: #a14330; font-weight: 700; }
.mot-empty-state { margin: 0; padding: 16px 0 5px; color: var(--muted); font-size: 11px; }
.mot-email-button { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 1px solid #d7dbd2; border-radius: 2px; color: var(--green-dark); background: transparent; text-decoration: none; cursor: pointer; font-size: 17px; }
.mot-email-button:hover:not(:disabled) { border-color: var(--green-dark); background: #eff6eb; }
.mot-email-button:disabled { color: #959b95; cursor: not-allowed; opacity: .6; }
.content-section { border: 1px solid #e1e4dc; background: var(--paper); }
.recent-section { min-width: 0; padding: 20px 20px 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 15px; }
.section-heading .eyebrow { color: var(--green-dark); font-size: 9px; }
.section-heading h2, .quick-panel h2 { margin: 6px 0 0; font: 600 20px var(--serif); letter-spacing: 0; }
.quiet-link { padding: 5px 0; border: 0; color: var(--green-dark); background: none; cursor: pointer; font-size: 11px; font-weight: 600; white-space: nowrap; }
.quiet-link span { padding-left: 5px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: #828980; font: 500 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 9px; border-bottom: 1px solid #eceee8; color: #59615b; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #29332d; font-size: 11px; font-weight: 600; }
td small { display: block; margin-top: 4px; color: #848b84; font-size: 10px; }
.align-right { text-align: right; }
.amount-cell { color: var(--ink); font: 500 11px var(--mono); white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-unpaid { border-color: #ead6a6; color: #886523; background: #fff8e8; }
.status-paid { border-color: #c6dfd0; color: #276949; background: #eef7f0; }
.status-overdue { border-color: #efc9bd; color: #a14330; background: #fff0eb; }
.quick-panel { display: flex; flex-direction: column; padding: 22px 21px 15px; color: var(--ink); background-color: var(--green); background-image: repeating-linear-gradient(135deg, transparent 0 24px, rgba(22,22,22,.035) 24px 25px); }
.quick-panel > .eyebrow { color: #244d1a; font-size: 9px; }
.quick-panel h2 { margin-top: 14px; font-size: 24px; line-height: 1.25; }
.quick-panel > p { max-width: 220px; margin: 9px 0 18px; color: #263522; font-size: 11px; line-height: 1.6; }
.quick-links { display: grid; margin-top: auto; }
.quick-links button { display: grid; grid-template-columns: 24px 1fr 14px; gap: 5px; align-items: center; min-height: 39px; padding: 0; border: 0; border-top: 1px solid rgba(22,22,22,.2); color: var(--ink); background: none; text-align: left; cursor: pointer; font-size: 10px; }
.quick-links button span { color: #244d1a; font: 9px var(--mono); }
.quick-links button b { color: #161616; }
.list-section { padding: 17px 20px 20px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.invoice-status-filter { display: flex; align-items: center; gap: 7px; color: #69716a; font-size: 10px; white-space: nowrap; }
.invoice-status-filter select { width: auto; min-width: 126px; height: 36px; padding: 0 9px; font-size: 11px; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(100%, 320px); height: 36px; padding: 0 10px; border: 1px solid #e1e4dc; background: white; color: #778078; }
.search-box span { font-size: 19px; line-height: 1; }
.search-box input { height: 32px; padding: 0; border: 0; box-shadow: none; font-size: 11px; }
.search-box input:focus { border: 0; box-shadow: none; }
.result-count { color: #7b837c; font-size: 9px; letter-spacing: .02em; }
.customer-table-row { cursor: pointer; }
.customer-table-row:hover td { background: #f8faf6; }
.customer-table-row:focus-visible { outline: 2px solid var(--green-dark); outline-offset: -2px; }
.person-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.person-initial { display: grid; width: 27px; aspect-ratio: 1; place-items: center; color: var(--green-dark); background: #e8f4e3; font: 600 11px var(--serif); }
.customer-row-indicator { margin-left: auto; color: #707970; transition: transform .16s; }
.customer-table-row[aria-expanded="true"] .customer-row-indicator { transform: rotate(180deg); }
.customer-detail-row td { padding: 0 20px 0 45px; background: #f3f5ef; }
.customer-detail-content { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 22px; padding: 15px 0; }
.customer-spend-summary, .customer-linked-vehicles { display: grid; align-content: start; gap: 5px; }
.customer-detail-content .eyebrow { color: var(--green-dark); font-size: 9px; }
.customer-spend-summary > strong { color: var(--ink); font: 700 21px var(--mono); }
.customer-spend-summary > small, .customer-linked-vehicles li small { color: var(--muted); font-size: 10px; }
.customer-outstanding { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; padding-top: 7px; border-top: 1px solid #dfe3d9; color: var(--muted); font-size: 10px; }
.customer-outstanding b { color: var(--ink); font-weight: 600; }
.customer-linked-vehicles > ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 18px; margin: 2px 0 0; padding: 0; list-style: none; }
.customer-linked-vehicles li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #dfe3d9; }
.customer-linked-vehicles li > span:last-child { display: grid; gap: 4px; }
.customer-linked-vehicles li strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.customer-linked-vehicles > p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.plate { display: inline-block; min-width: 72px; padding: 5px 7px; border: 1px solid #daddd5; border-radius: 2px; color: #36423a; background: #f6f6f0; text-align: center; font: 500 9px var(--mono); }
.row-actions { white-space: nowrap; }
.row-actions button { margin-left: 7px; padding: 4px 0 4px 6px; border: 0; color: var(--green-dark); background: none; cursor: pointer; font-size: 10px; font-weight: 600; }
.row-actions button:last-child { color: #a24735; }
.row-actions button.mark-paid-button { display: inline-grid; width: 27px; height: 27px; place-items: center; margin-left: 7px; padding: 0; border: 1px solid #c6dfd0; border-radius: 2px; color: #276949; background: #eef7f0; font-size: 16px; line-height: 1; }
.row-actions button.mark-paid-button:hover { border-color: #276949; background: #e5f2e7; }
.row-actions button.mark-paid-button:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.row-actions button.email-invoice-button { display: inline-grid; width: 27px; height: 27px; place-items: center; margin-left: 7px; padding: 0; border: 1px solid #d7dbd2; border-radius: 2px; color: var(--green-dark); background: transparent; font-size: 15px; line-height: 1; }
.row-actions button.email-invoice-button:hover { border-color: var(--green-dark); background: #eff6eb; }
.row-actions button.email-invoice-button:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.row-actions button.print-invoice-button { color: var(--green-dark); }
tr[hidden], .no-results[hidden] { display: none; }
.no-results { padding: 14px 9px; color: var(--muted); font-size: 11px; }
.empty-state { display: grid; min-height: 265px; justify-items: center; align-content: center; padding: 30px; border-top: 1px solid var(--line); text-align: center; }
.empty-stamp { display: grid; width: 36px; aspect-ratio: 1; place-items: center; border: 1px solid #d6dcd3; color: var(--green-dark); font: 11px var(--mono); }
.empty-state h3 { margin: 14px 0 5px; font: 600 18px var(--serif); }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.empty-state .button { min-height: 36px; }
.loading-inline { padding: 50px; color: var(--muted); text-align: center; font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; padding: 13px 38px; border-top: 1px solid var(--line); color: #858c85; font-size: 8px; }
.page-footer .status-light { width: 6px; height: 6px; margin-left: 6px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(400px, calc(100vw - 44px)); padding: 13px 17px; transform: translateY(12px); border-left: 3px solid var(--green); color: #fff; background: var(--ink); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; font-size: 12px; }
.toast.visible { transform: translateY(0); opacity: 1; }
.record-dialog { width: min(100% - 28px, 540px); max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid #dfe2da; border-radius: 2px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 70px rgba(20,34,27,.22); }
.record-dialog-wide { width: min(calc(100vw - 48px), 1000px); }
.record-dialog::backdrop { background: rgba(21,32,27,.58); backdrop-filter: blur(2px); }
.record-dialog form { display: flex; min-height: 100%; flex-direction: column; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-head .eyebrow { color: var(--green-dark); font-size: 9px; }
.dialog-head h2 { margin: 6px 0 0; font: 600 23px var(--serif); }
.close-button { width: 32px; height: 32px; border: 1px solid var(--line); color: #566058; background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.dialog-fields { padding: 20px 24px 23px; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.vehicle-lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.vehicle-lookup-row .button { min-height: 36px; font-size: 12px; }
.dashboard-dvla-section { margin-top: 14px; padding: 20px 24px; }
.dashboard-dvla-section form { max-width: 520px; }
.dashboard-dvla-section label { display: grid; gap: 8px; font-size: 11px; font-weight: 600; }
.dashboard-dvla-section input { font-size: 12px; }
.dvla-results-list { display: grid; gap: 12px; margin: 0; font-size: 12px; }
.dvla-results-list > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dvla-results-list dt { color: var(--muted); }
.dvla-results-list dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.dialog-fields label { font-size: 11px; }
.dialog-fields input, .dialog-fields textarea, .dialog-fields select { padding: 10px 11px; font-size: 12px; }
.product-tabs { border-top: 1px solid var(--line); padding-top: 12px; }
.product-tab-list { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.product-tab { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #707970; font-size: 12px; font-weight: 600; cursor: pointer; }
.product-tab[aria-selected="true"] { border-bottom-color: var(--green-dark); color: var(--green-dark); }
.product-tab:focus-visible { outline: 2px solid var(--green-dark); outline-offset: -2px; }
.product-tab-panel { display: grid; gap: 14px; padding-top: 16px; }
.product-tab-panel[hidden] { display: none; }
.product-tab-panel h3 { margin: 0; font: 600 18px var(--serif); }
.stock-history { margin-top: 14px; }
.stock-help { color: #707970; font-size: 12px; line-height: 1.5; }
#stock-movement-lines { min-width: 0; overflow-x: auto; }
.stock-movement-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 36px; align-items: end; gap: 8px; min-width: 440px; margin: 12px 0; padding-bottom: 12px; border-bottom: 1px solid #e1e4e2; font-size: 12px; }
.stock-movement-line > label { min-width: 0; }
.stock-movement-line > label:first-child { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.stock-movement-line > label:first-child input, .stock-movement-line > label:first-child select { grid-row: 2; min-width: 0; }
.stock-line-remove { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 2px; color: #5e655f; background: transparent; cursor: pointer; }
.stock-line-remove:hover:not(:disabled) { border-color: #b84d38; color: #a23f2e; }
.stock-line-remove:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.stock-line-remove:disabled { opacity: .4; cursor: default; }
[data-stock-add] { font-size: 12px; }
.stock-negative { color: #a63d32; }
.record-combobox { position: relative; display: grid; gap: 8px; }
.record-combobox > label { color: #414a44; font-size: 11px; font-weight: 600; }
.record-combo-options { position: absolute; z-index: 5; top: calc(100% - 2px); right: 0; left: 0; max-height: 220px; overflow-y: auto; border: 1px solid #cfd5cc; background: #fff; box-shadow: 0 8px 18px rgba(22,22,22,.12); }
.record-combo-options[hidden] { display: none; }
.record-combo-option { display: grid; gap: 3px; padding: 9px 11px; border-bottom: 1px solid #eceee8; cursor: pointer; }
.record-combo-option:last-child { border-bottom: 0; }
.record-combo-option:hover, .record-combo-option.active-option { background: #eff6eb; }
.record-combo-option strong { color: var(--ink); font-size: 12px; }
.record-combo-option small { color: var(--muted); font-size: 10px; }
.record-combo-option[hidden] { display: none; }
.invoice-record-entry { display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: end; gap: 9px; }
.invoice-record-entry .record-combobox { min-width: 0; }
.invoice-record-entry > .button { width: 104px; min-height: 39px; gap: 7px; padding: 0 6px; font-size: 10px; white-space: nowrap; }
.invoice-lines-heading, .invoice-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invoice-lines-section { min-width: 0; margin: 6px -24px 0; padding: 16px 24px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f2f4ef; }
.invoice-lines-heading { margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.invoice-lines-heading > div { display: grid; gap: 4px; }
.invoice-lines-heading .eyebrow { color: var(--green-dark); font-size: 9px; }
.invoice-lines-heading h3 { margin: 0; font: 700 15px var(--serif); }
.invoice-lines-heading .text-button { font-size: 11px; }
.service-checklist { margin: 6px -24px 0; padding: 16px 24px 8px; border-top: 1px solid var(--line); background: #f2f4ef; }
.service-checklist-heading, .service-result-line { display: grid; grid-template-columns: minmax(0, 1fr) 118px minmax(180px, .65fr); gap: 12px; align-items: center; }
.service-checklist-heading { padding-bottom: 8px; color: #737b74; font: 500 9px var(--mono); text-transform: uppercase; }
.service-checklist-heading > div:first-child { grid-column: 1; }
.service-checklist-heading h3 { margin: 4px 0 0; color: var(--ink); font: 700 15px var(--serif); text-transform: none; }
.service-checklist-heading > div:last-child { display: contents; }
.service-checklist-heading > div:last-child span { grid-row: 1; }
.service-result-line { padding: 8px 0; border-top: 1px solid var(--line); }
.service-result-description { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.service-result-description > span { color: var(--green-dark); font: 10px var(--mono); }
.service-result-description strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.service-result-line label { display: grid; gap: 5px; color: #414a44; font-size: 10px; font-weight: 600; }
.service-result-line select, .service-result-line input { min-width: 0; padding: 8px; font-size: 11px; }
.service-checklist-empty { margin: 0; padding: 14px 0; color: var(--muted); font-size: 11px; }
.invoice-grid-header, .invoice-line-row { display: grid; min-width: 860px; grid-template-columns: minmax(120px, 1.2fr) minmax(160px, 2fr) 72px minmax(100px, 1fr) minmax(110px, 1fr) minmax(100px, 1.25fr) 28px; gap: 8px; align-items: center; }
.invoice-grid-header { padding: 12px 0 7px; color: #737b74; font: 500 9px var(--mono); text-transform: uppercase; }
.invoice-lines-scroll { width: 100%; overflow-x: auto; }
.invoice-line-row { padding: 8px 0; border-top: 1px solid var(--line); }
.invoice-line-row input, .invoice-line-row select { min-width: 0; padding: 8px; font-size: 11px; }
.invoice-line-row .record-combobox { min-width: 0; gap: 0; }
.invoice-line-row .invoice-item-code-combo .record-combo-options { position: fixed; right: auto; bottom: auto; }
.line-remove { width: 26px; height: 26px; border: 1px solid var(--line); color: #5e655f; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; }
.line-remove:hover { border-color: #b84d38; color: #a23f2e; }
.invoice-total { padding: 12px 0; border-top: 1px solid var(--line); color: #525a53; font-size: 11px; }
.invoice-total strong { color: var(--ink); font: 700 18px var(--mono); }
.dialog-fields .checkbox-field { display: flex; width: max-content; align-items: center; gap: 9px; cursor: pointer; }
.dialog-fields .checkbox-field input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--green-dark); }
.dialog-fields .checkbox-field span { font-size: 12px; font-weight: 600; }
.dialog-fields .form-error { margin-top: -4px; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; padding: 14px 24px; border-top: 1px solid var(--line); background: #f5f6f0; }
.dialog-actions .button { min-height: 38px; font-size: 11px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .page-content { padding-right: 24px; padding-left: 24px; }
  .topbar { padding-right: 24px; padding-left: 24px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower { grid-template-columns: minmax(0, 1fr); }
  .quick-panel { min-height: 255px; }
}
@media (max-width: 850px) {
  .workspace { display: flex; flex-direction: column; }
  .sidebar { position: static; height: auto; padding: 12px 14px 0; }
  .sidebar-brand, .side-caption, .sidebar-lower { display: none; }
  .main-nav { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .nav-link { width: auto; min-width: max-content; min-height: 44px; gap: 7px; padding: 0 10px; font-size: 11px; }
  .nav-number { display: none; }
  .nav-link.active { box-shadow: inset 0 -2px var(--green); }
  .topbar { min-height: 48px; justify-content: flex-end; padding: 0 16px; }
  .mobile-brand { display: flex; }
  .mobile-brand .brand-logo { width: 66px; height: 38px; }
  .topbar-label { max-width: 42%; font-size: 9px; }
  .topbar-logout { font-size: 10px; }
}
@media (max-width: 700px) {
  .record-dialog-wide { width: calc(100vw - 28px); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 220px; padding: 20px 22px; }
  .auth-statement { margin: 28px 0 18px; padding: 0; }
  .auth-statement h1 { margin: 10px 0 6px; font-size: 36px; }
  .auth-statement p { max-width: 340px; font-size: 12px; }
  .auth-panel-foot { font-size: 8px; }
  .auth-form-side { min-height: 470px; padding: 48px 24px 76px; }
  .auth-form-wrap { margin-top: 0; }
  .auth-form-wrap h2 { font-size: 30px; }
  .auth-privacy { bottom: 20px; font-size: 8px; }
  .page-content { padding: 25px 15px 34px; }
  .page-heading { align-items: start; margin-bottom: 20px; }
  .page-heading h1 { margin-top: 8px; font-size: 27px; }
  .page-heading p { max-width: 240px; font-size: 11px; line-height: 1.5; }
  .page-heading .button { min-height: 37px; gap: 7px; padding: 0 9px; font-size: 10px; }
  .stat-grid { gap: 8px; }
  .stat-card { min-height: 115px; padding: 12px; }
  .stat-card > strong { font-size: 26px; }
  .stat-top { font-size: 8px; }
  .stat-foot { font-size: 8px; }
  .recent-section { padding: 16px 10px 8px; }
  .upcoming-mot-section, .low-stock-section { padding: 16px 10px; }
  .top-spenders-section { padding: 16px 10px; }
  .customer-detail-row td { padding-right: 10px; padding-left: 10px; }
  .customer-detail-content { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .service-checklist { margin-right: -24px; margin-left: -24px; padding-right: 12px; padding-left: 12px; }
  .service-checklist-heading, .service-result-line { grid-template-columns: minmax(0, 1fr) 92px minmax(130px, .6fr); gap: 7px; }
  .service-result-description { grid-template-columns: 20px minmax(0, 1fr); gap: 5px; }
  .section-heading { padding: 0 4px; }
  .section-heading h2 { font-size: 18px; }
  .quick-panel { min-height: 255px; }
  .list-section { padding: 12px 10px; }
  .table-wrap { margin: 0 -1px; }
  .list-toolbar { gap: 8px; }
  .search-box { width: min(100%, 250px); }
  .invoice-status-filter { gap: 4px; }
  .invoice-status-filter select { min-width: 104px; padding: 0 6px; font-size: 10px; }
  .result-count { font-size: 8px; white-space: nowrap; }
  table { min-width: 590px; }
  .page-footer { padding: 12px 15px; font-size: 7px; }
}
@media (max-width: 420px) {
  .page-heading { flex-direction: column; align-items: start; }
  .page-heading .button { align-self: flex-end; margin-top: -6px; }
  .page-heading h1 { font-size: 25px; }
  .stat-card { min-height: 105px; padding: 10px; }
  .stat-card > strong { font-size: 23px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .dialog-fields { padding: 16px; }
  .invoice-lines-section { margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
  .dialog-head { padding: 18px 16px 14px; }
  .dialog-actions { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}