:root {
  --bg: #f6f7f6;
  --ink: #18211f;
  --muted: #65716d;
  --line: #d5dcda;
  --panel: #fff;
  --green: #176b52;
  --blue: #175cd3;
  --amber: #a15c07;
  --red: #b42318;
  --purple: #6941c6;
  --soft-green: #edf7f2;
  --soft-blue: #eef4ff;
  --soft-amber: #fff7e8;
  --soft-red: #fff1f2;
  --soft-purple: #f4f1fb;
}
body { margin:0; background:var(--bg); color:var(--ink); font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size:14px; }
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.login-panel { width:min(390px, 100%); padding:34px; }
.login-logo { width:112px; max-height:72px; object-fit:contain; }
.shell { max-width:1400px; margin:0 auto; padding:0 20px 24px; }
.app-header { position:sticky; top:0; z-index:900; margin:0 -20px 22px; padding:0 20px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.97); }
.app-header-main { min-height:64px; display:flex; align-items:center; gap:22px; }
.app-brand { display:flex; align-items:center; gap:10px; flex:0 0 auto; color:var(--ink); text-decoration:none; }
.app-brand:hover { color:var(--ink); }
.app-brand img { width:34px; height:34px; object-fit:contain; }
.app-brand-copy { display:grid; line-height:1.1; }
.app-brand-copy strong { font-size:.94rem; font-weight:800; }
.app-brand-copy > span { margin-top:3px; color:var(--green); font-size:.67rem; font-weight:800; text-transform:uppercase; }
.app-navigation { display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; flex:1; }
.primary-nav { display:flex; align-items:center; gap:4px; min-width:0; }
.nav-link { min-height:38px; display:inline-flex; align-items:center; gap:7px; border-radius:6px; padding:8px 10px; color:#4b5753; font-size:.84rem; font-weight:700; text-decoration:none; white-space:nowrap; }
.nav-link:hover { background:#f0f3f2; color:var(--ink); }
.nav-link.active, .nav-menu[data-active="true"] > .nav-link { background:#e8f3ee; color:var(--green); }
.nav-link svg, .nav-menu-item svg { width:17px; height:17px; stroke-width:2; flex:0 0 auto; }
.nav-menu, .account-menu { position:relative; }
.nav-menu summary, .account-menu summary { list-style:none; cursor:pointer; }
.nav-menu summary::-webkit-details-marker, .account-menu summary::-webkit-details-marker { display:none; }
.nav-chevron { width:14px !important; height:14px !important; margin-left:1px; }
.nav-menu[open] .nav-chevron { transform:rotate(180deg); }
.nav-menu-popover, .account-popover { position:absolute; top:calc(100% + 8px); right:0; z-index:950; min-width:210px; border:1px solid var(--line); border-radius:7px; background:#fff; box-shadow:0 14px 32px rgba(24,33,31,.14); padding:6px; }
.nav-menu-item { display:flex; align-items:center; gap:9px; border-radius:5px; padding:9px 10px; color:#34403c; font-size:.84rem; font-weight:700; text-decoration:none; }
.nav-menu-item:hover, .nav-menu-item.active { background:#edf3f1; color:var(--green); }
.nav-menu-item.danger { color:var(--red); }
.account-menu { margin-left:auto; }
.account-trigger { width:38px; height:38px; display:flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:50%; color:#4b5753; background:#fff; }
.account-trigger:hover { background:#f0f3f2; color:var(--ink); }
.account-trigger svg { width:20px; height:20px; }
.account-email { max-width:280px; padding:8px 10px; border-bottom:1px solid var(--line); color:var(--muted); font-size:.78rem; overflow-wrap:anywhere; }
.nav-toggle { display:none; width:40px; height:40px; align-items:center; justify-content:center; margin-left:auto; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); }
.nav-toggle svg { width:20px; height:20px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:36px; margin-bottom:14px; }
.title { font-size:1.45rem; font-weight:800; margin:0; letter-spacing:0; }
.subtitle { color:var(--muted); font-size:.9rem; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:7px; box-shadow:0 1px 2px rgba(24,33,31,.035); }
.panel-pad { padding:16px; }
.error-panel { max-width:680px; margin:70px auto 0; border-top:5px solid var(--amber); }
.error-message { font-size:1rem; color:#344054; }
.grid { display:grid; gap:12px; }
.grid-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns:repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns:repeat(4, minmax(0, 1fr)); }
.wide { grid-column:span 2; }
.full { grid-column:1 / -1; }
.label { font-weight:700; font-size:.76rem; color:#3f4d48; margin-bottom:5px; }
.header-actions, .row-actions, .filter-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.metric { border:1px solid var(--line); border-radius:7px; background:#fff; padding:14px; }
.metric-value { font-size:1.55rem; font-weight:900; line-height:1; }
.metric-label { color:var(--muted); font-size:.82rem; margin-top:4px; }
.queue-summary { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; }
.queue-metric { display:block; color:inherit; text-decoration:none; }
.queue-metric:hover { border-color:#aab8b3; box-shadow:0 3px 10px rgba(24,33,31,.06); }
.queue-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.queue-header > div:first-child { display:flex; align-items:center; gap:10px; min-width:0; }
.queue-step { width:30px; height:30px; border-radius:6px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; background:#26332f; color:#fff; font-weight:800; }
.queue-table td { vertical-align:top; }
.approval-queue-table { width:100%; min-width:0; table-layout:fixed; }
.approval-queue-table th, .approval-queue-table td { overflow-wrap:anywhere; }
.approval-queue-table th:nth-child(1) { width:14%; }
.approval-queue-table th:nth-child(2) { width:8%; }
.approval-queue-table th:nth-child(3) { width:25%; }
.approval-queue-table th:nth-child(4) { width:15%; }
.approval-queue-table th:nth-child(5) { width:11%; }
.approval-queue-table th:nth-child(6) { width:11%; }
.approval-queue-table th:nth-child(7) { width:16%; }
.urgency-inline { color:var(--amber); font-size:.76rem; font-weight:800; margin-top:3px; }
.approval-queue-table .queue-action-form { min-width:0; grid-template-columns:repeat(2, minmax(0, 1fr)); }
.approval-queue-table .queue-action-form .btn { min-width:0; padding-left:5px; padding-right:5px; font-size:.72rem; white-space:normal; }
.approval-queue-table .queue-action-form .queue-note-input { grid-column:1 / -1; }
.request-preview-trigger { border:0; background:transparent; color:var(--blue); padding:0; font:inherit; font-weight:850; text-align:left; text-decoration:none; }
.request-preview-trigger:hover { text-decoration:underline; }
.request-preview-trigger:focus { outline:2px solid rgba(37,99,235,.35); outline-offset:2px; border-radius:4px; }
.claim-detail-trigger { border:0; background:transparent; color:var(--blue); padding:0; font:inherit; font-weight:850; text-align:left; text-decoration:none; }
.claim-detail-trigger:hover { text-decoration:underline; }
.claim-detail-trigger:focus { outline:2px solid rgba(37,99,235,.35); outline-offset:2px; border-radius:4px; }
.queue-action-form { min-width:500px; display:grid; grid-template-columns:minmax(90px, .8fr) minmax(136px, 1fr) minmax(90px, .8fr); gap:6px; }
.queue-action-form .queue-note-input { grid-column:1 / -1; }
.owner-action-form { min-width:300px; grid-template-columns:1fr auto auto; }
.order-doc-actions { display:flex; align-items:end; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.order-form-warning { color:var(--red); font-weight:800; background:#fee4e2; border-radius:8px; padding:9px 11px; }
.recall-form, .cancel-order-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.recall-form .form-control, .cancel-order-form .form-control { width:220px; }
.recall-notice { border-left:5px solid var(--amber); }
.confirm-backdrop { position:fixed; inset:0; z-index:1000; background:rgba(15,23,42,.42); display:flex; align-items:center; justify-content:center; padding:16px; }
.confirm-dialog { width:min(420px, 100%); background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 20px 55px rgba(15,23,42,.24); padding:16px; }
.order-warning-dialog { width:min(520px, 100%); }
.order-confirm-list { margin-bottom:0; padding-left:20px; color:#344054; font-weight:700; }
.request-preview-dialog { width:min(720px, 100%); position:relative; }
.claim-detail-dialog { width:min(980px, 100%); max-height:88vh; overflow:auto; position:relative; padding:18px; }
.modal-close-button { position:absolute; top:10px; right:10px; width:32px; height:32px; border:1px solid var(--line); border-radius:999px; background:#fff; color:#344054; font-weight:900; line-height:1; display:flex; align-items:center; justify-content:center; }
.modal-close-button:hover { background:#f8fafc; color:var(--ink); }
.request-preview-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.claim-detail-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; }
.request-preview-field { border:1px solid var(--line); border-radius:8px; background:#f8fafc; padding:10px; min-width:0; overflow-wrap:anywhere; }
.claim-detail-header { display:flex; align-items:flex-start; justify-content:space-between; gap:42px; padding-right:36px; }
.claim-detail-total { font-size:1.05rem; font-weight:900; white-space:nowrap; }
.claim-detail-lines { display:grid; gap:8px; }
.claim-detail-file-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px; }
.claim-detail-file { min-width:0; overflow-wrap:anywhere; }
.claim-detail-line { border:1px solid var(--line); border-left:5px solid var(--blue); border-radius:8px; background:#fff; padding:10px; }
.claim-detail-line:nth-child(3n + 2) { border-left-color:var(--green); }
.claim-detail-line:nth-child(3n) { border-left-color:var(--amber); }
.claim-detail-line-main { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.claim-detail-file img { width:120px; max-height:90px; object-fit:cover; border:1px solid var(--line); border-radius:6px; background:#fff; }
.confirm-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.badge-soft { border-radius:999px; padding:4px 8px; font-weight:800; font-size:.74rem; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.badge-soft.green { background:var(--soft-green); color:var(--green); }
.badge-soft.blue { background:var(--soft-blue); color:var(--blue); }
.badge-soft.amber { background:var(--soft-amber); color:#92400e; }
.badge-soft.red { background:#fee4e2; color:var(--red); }
.badge-soft.purple { background:var(--soft-purple); color:var(--purple); }
.badge-soft.muted { background:#eef2f7; color:#475467; }
.filter-row { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)) auto; gap:10px; align-items:end; margin-bottom:14px; }
.table-wrap { overflow:auto; }
.data-table { min-width:1020px; margin:0; vertical-align:middle; }
.data-table th { font-size:.76rem; text-transform:uppercase; color:#475467; background:#f8fafc; white-space:nowrap; }
.data-table td { font-size:.86rem; }
.bill-row-actions { display:flex; align-items:center; gap:4px; flex-wrap:nowrap; white-space:nowrap; }
.bill-row-actions form { margin:0; }
.bill-row-actions .btn { padding:.25rem .45rem; font-size:.72rem; line-height:1.2; white-space:nowrap; }
.credit-card-table { min-width:1180px; }
.credit-card-match-select { max-width:260px; min-width:190px; font-size:.74rem; }
.credit-card-property-select { min-width:112px; font-size:.76rem; }
.credit-card-note-cell { min-width:190px; }
.credit-card-note-form { position:relative; margin:0; }
.credit-card-note-input { min-width:180px; font-size:.76rem; }
.credit-card-note-status { position:absolute; right:6px; top:50%; transform:translateY(-50%); color:#667085; font-size:.68rem; pointer-events:none; background:#fff; }
.credit-card-charge { color:#b42318; font-weight:850; }
.credit-card-refund { color:#176b52; font-weight:850; }
.table-tools { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 14px; border-top:1px solid var(--line); background:#fff; }
.compact-table { min-width:640px; }
.sort-link { display:inline-flex; align-items:center; gap:6px; color:#344054; text-decoration:none; }
.sort-link:hover { color:var(--ink); }
.table-sort-button { border:0; background:transparent; padding:0; display:inline-flex; align-items:center; gap:6px; color:#344054; font:inherit; font-weight:inherit; text-transform:inherit; }
.table-sort-button:hover { color:var(--ink); }
.sort-icon { width:10px; height:14px; position:relative; display:inline-block; flex:0 0 auto; }
.sort-icon::before, .sort-icon::after { content:""; position:absolute; left:1px; border-left:4px solid transparent; border-right:4px solid transparent; }
.sort-icon::before { top:1px; border-bottom:5px solid #98a2b3; }
.sort-icon::after { bottom:1px; border-top:5px solid #98a2b3; }
.sort-icon.asc::before { border-bottom-color:var(--ink); }
.sort-icon.asc::after { opacity:.25; }
.sort-icon.desc::before { opacity:.25; }
.sort-icon.desc::after { border-top-color:var(--ink); }
.column-menu { min-width:220px; }
.clickable-row { cursor:pointer; }
.clickable-row:hover td { background:#f8fafc; }
.clickable-row:focus { outline:2px solid var(--blue); outline-offset:-2px; }
.note-cell { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#475467; }
.card-list { display:grid; gap:10px; }
.request-card { border:1px solid var(--line); border-left:5px solid #94a3b8; border-radius:8px; background:#fff; padding:12px; }
.request-card.urgent { border-left-color:#d97706; background:#fffaf0; }
.request-card.emergency { border-left-color:#b42318; background:#fff1f2; }
.delivery-card { border:1px solid var(--line); border-left:5px solid #94a3b8; border-radius:8px; background:#fff; padding:14px; }
.delivery-card.open { border-left-color:var(--amber); background:#fffaf0; }
.delivery-card.complete { border-left-color:var(--green); }
.delivery-complete-note { color:var(--green); font-weight:800; background:var(--soft-green); border-radius:8px; padding:10px 12px; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.tab-btn, .chip { border:1px solid var(--line); background:#fff; border-radius:6px; padding:8px 12px; font-weight:700; color:#34403c; text-decoration:none; }
.tab-btn:hover, .chip:hover { border-color:#aab8b3; color:var(--ink); }
.tab-btn.active, .chip.active { background:#26332f; color:#fff; border-color:#26332f; }
.tab-count { display:inline-flex; align-items:center; justify-content:center; min-width:22px; min-height:22px; margin-left:6px; border-radius:999px; padding:2px 7px; background:#eef2f7; color:#344054; font-size:.72rem; }
.tab-btn.active .tab-count { background:#fff; color:#172033; }
.delivery-inline-row td { background:#f8fafc; }
.delivery-inline-panel { border:1px solid var(--line); border-radius:8px; background:#fff; padding:12px; }
.delivery-inline-form { border:1px solid var(--line); border-left:5px solid var(--amber); border-radius:8px; padding:12px; background:#fffaf0; }
.delivery-issue-card { border:1px solid #fecdd3; border-left:5px solid var(--red); border-radius:8px; background:#fff; padding:14px; }
.delivery-issue-links { display:flex; gap:8px; flex-wrap:wrap; }
.delivery-issue-note { border:1px solid #fed7aa; border-radius:8px; background:#fffaf0; color:#344054; padding:9px 11px; }
.delivery-resolution-form { display:grid; grid-template-columns:minmax(220px, 1fr) auto; gap:8px; align-items:start; }
.chip-grid { display:flex; flex-wrap:wrap; gap:7px; }
.chip-input { position:absolute; opacity:0; pointer-events:none; }
.chip-input:checked + .chip { background:#26332f; color:#fff; border-color:#26332f; }
.xero-category-map-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:10px; }
.xero-category-map-cell { min-width:0; padding:10px; border:1px solid var(--line); border-radius:8px; background:#f8fafc; }
.line-block { border:1px solid var(--line); border-radius:8px; padding:12px; background:#fff; }
.request-item-field { grid-column:span 2; }
.request-item-notes-field { min-width:0; }
.request-item-notes-field .form-control { max-width:220px; }
.timeline { display:grid; gap:8px; }
.timeline-entry { border-left:3px solid var(--line); padding-left:10px; }
.timeline-action { font-weight:850; }
.timeline-meta { color:var(--muted); font-size:.8rem; }
.managed-file-field { flex:1 1 420px; min-width:min(100%, 360px); }
.managed-file-dropzone { border:1px dashed #c8d1dc; border-radius:8px; padding:10px; background:#fff; transition:border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.managed-file-dropzone.drag-active, .managed-file-dropzone:focus-within { border-color:var(--green); background:var(--soft-green); box-shadow:0 0 0 3px rgba(23,107,82,.08); }
.managed-file-dropzone:focus { outline:2px solid rgba(37,99,235,.35); outline-offset:2px; }
.file-button { display:inline-flex; align-items:center; justify-content:center; border:1px solid #8aaea1; color:var(--green); background:var(--soft-green); border-radius:6px; padding:8px 12px; font-weight:800; cursor:pointer; min-height:38px; }
.file-input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.attachment-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; }
.attachment-tile { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#fff; min-width:0; }
.attachment-tile img { width:100%; height:96px; object-fit:cover; background:#eef2f7; display:block; }
.file-preview { min-height:96px; display:flex; align-items:center; justify-content:center; padding:10px; text-align:center; overflow-wrap:anywhere; text-decoration:none; color:#344054; font-weight:850; background:#f8fafc; }
.receipt-history { border-top:1px solid var(--line); padding-top:12px; }
.receipt-entry { border:1px solid var(--line); border-radius:8px; padding:10px; background:#fff; margin-top:8px; }
.receipt-form-grid { grid-template-columns:minmax(150px, 1fr) minmax(180px, 1fr) minmax(140px, .9fr) minmax(170px, 1.1fr); align-items:start; }
.receipt-line-field { min-width:0; }
.receipt-line-meta { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.receipt-attachment-grid, .upload-preview-grid { display:grid; grid-template-columns:repeat(4, minmax(96px, 1fr)); gap:8px; }
.receipt-attachment-tile, .upload-preview-tile { position:relative; min-height:112px; max-height:132px; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#f8fafc; }
.receipt-attachment-tile img, .upload-preview-tile img { width:100%; height:96px; object-fit:cover; display:block; background:#eef2f7; }
.attachment-delete, .upload-preview-remove { position:absolute; top:6px; right:6px; z-index:2; width:24px; height:24px; border:0; border-radius:999px; background:#b42318; color:#fff; font-weight:900; line-height:1; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(15,23,42,.22); }
.attachment-delete:hover, .upload-preview-remove:hover { background:#8a1c14; }
.pdf-preview, .upload-pdf-preview { min-height:96px; display:flex; flex-direction:column; gap:4px; align-items:center; justify-content:center; padding:10px; color:#344054; text-align:center; font-weight:900; background:#fff1f2; text-decoration:none; overflow-wrap:anywhere; }
.pdf-preview span, .upload-preview-name { font-size:.72rem; font-weight:700; color:var(--muted); max-width:100%; padding:4px 6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-error { grid-column:1 / -1; color:var(--red); font-weight:800; background:#fee4e2; border-radius:8px; padding:8px 10px; }
.ocr-result { border:1px solid #bbf7d0; border-left:5px solid var(--green); border-radius:8px; background:var(--soft-green); padding:10px 12px; }
.ocr-warnings { margin:8px 0 0; padding-left:18px; color:#92400e; font-weight:700; }
.ocr-populated-field { background:#ecfdf3; border-color:#86efac; box-shadow:inset 0 0 0 1px rgba(22, 163, 74, .12); }
.ocr-populated-field:focus { background:#f6fffa; border-color:#16a34a; box-shadow:0 0 0 .2rem rgba(22, 163, 74, .14); }
.ocr-subsection { margin-top:10px; }
.ocr-chip-row { display:flex; flex-wrap:wrap; gap:6px; }
.ocr-match-chip { border:1px solid #9db7d5; border-radius:999px; background:#fff; color:#1d4ed8; padding:6px 10px; font-weight:850; font-size:.78rem; }
.ocr-match-chip:hover { background:var(--soft-blue); border-color:#7aa2e3; }
.ocr-duplicate-list { margin-top:10px; display:grid; gap:6px; }
.ocr-duplicate-item { display:grid; gap:2px; border:1px solid #fed7aa; border-left:4px solid var(--amber); border-radius:8px; background:#fffaf0; color:#344054; padding:8px 10px; text-decoration:none; }
.ocr-duplicate-item:hover { color:#172033; border-color:#fbbf24; }
.ocr-duplicate-item span { font-size:.82rem; color:#667085; }
.xero-issue-list { display:grid; gap:4px; max-width:360px; color:#92400e; font-size:.82rem; font-weight:700; }
.xero-issue-list div { border-left:3px solid var(--amber); padding-left:7px; }
.claim-preflight-list { display:grid; gap:4px; max-width:420px; color:#b42318; font-size:.8rem; font-weight:750; }
.claim-preflight-list div { border-left:3px solid var(--red); padding-left:7px; overflow-wrap:anywhere; }
.claim-preflight-list.warning { color:#92400e; }
.claim-preflight-list.warning div { border-left-color:var(--amber); }
.claim-line-preflight { display:flex; flex-wrap:wrap; gap:4px; }
.claim-line-issue-chip { display:inline-flex; align-items:center; max-width:100%; border:1px solid #fecaca; border-radius:999px; background:#fff1f2; color:#b42318; padding:2px 7px; font-size:.72rem; font-weight:800; white-space:nowrap; }
.claim-line-issue-chip.muted { border-color:#d0d5dd; background:#f2f4f7; color:#475467; }
.claim-detail-preflight { border:1px solid #fecaca; border-left:5px solid var(--red); border-radius:8px; background:#fff7f7; padding:10px; }
.claim-detail-preflight.ready { border-color:#bbf7d0; border-left-color:var(--green); background:#f0fdf4; }
.claim-line-preflight-detail { display:grid; gap:4px; font-size:.82rem; font-weight:750; }
.claim-line-preflight-detail div { border-left:3px solid var(--red); padding-left:7px; color:#b42318; }
.claim-line-preflight-detail .warning { border-left-color:var(--amber); color:#92400e; }
.xero-action-stack { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:116px; }
.xero-action-stack form { margin:0; }
.xero-action-stack .btn { width:100%; white-space:nowrap; }
.xero-history-list { display:grid; gap:8px; }
.xero-history-entry { border:1px solid var(--line); border-left:4px solid #94a3b8; border-radius:8px; background:#fff; padding:10px; }
.xero-history-entry.success { border-left-color:var(--green); background:#f8fffb; }
.xero-history-entry.warning { border-left-color:var(--amber); background:#fffaf0; }
.xero-history-entry.danger { border-left-color:var(--red); background:#fff7f7; }
.xero-history-entry.info { border-left-color:var(--blue); background:#f8fbff; }
.xero-history-details { display:grid; gap:3px; margin-top:6px; color:#475467; font-size:.82rem; }
.xero-history-details div { border-left:3px solid var(--line); padding-left:7px; overflow-wrap:anywhere; }
.claim-editor-panel { border-top:3px solid var(--green); }
.claim-list-panel { border-top:3px solid #71807b; }
.claim-form-section { border:1px solid var(--line); border-radius:7px; padding:12px; background:#fafbfa; }
.claim-header-section { border-left:4px solid #7fa594; }
.claim-lines-section { border:1px solid #b9cbc4; border-left:4px solid var(--green); background:#f5faf7; margin-bottom:14px; }
.claim-section-title { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:0 0 10px; margin-bottom:10px; border-bottom:1px solid #cbd8d3; }
.claim-lines { display:grid; gap:8px; }
.claim-line { padding:9px; border:1px solid #c6d2ce; border-left:4px solid #789c8d; background:#fff; box-shadow:0 1px 2px rgba(24,33,31,.04); }
.claim-line:nth-child(3n + 1), .claim-line:nth-child(3n + 2), .claim-line:nth-child(3n) { border-left-color:#789c8d; }
.claim-line-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:-9px -9px 8px; padding:7px 9px; border-bottom:1px solid #d7dfdc; border-radius:6px 6px 0 0; background:#f1f5f3; }
.claim-line-number { color:var(--green); }
.claim-line-compact-grid { display:grid; grid-template-columns:minmax(118px, .8fr) minmax(150px, 1fr) minmax(260px, 2fr) 72px 110px 110px; gap:8px; align-items:end; }
.claim-line-compact-grid .label { margin-bottom:3px; font-size:.72rem; }
.claim-line-compact-grid .form-control-sm, .claim-line-compact-grid .form-select-sm { min-height:32px; font-size:.82rem; padding-top:4px; padding-bottom:4px; }
.claim-vendor-field { grid-column:span 2; }
.claim-notes-field { grid-column:span 4; }
.claim-line-file { display:flex; align-items:center; gap:8px; margin-top:0; padding:7px; min-width:0; background:#fffaf0; border:1px dashed #f2b25a; }
.claim-line-file .label { margin:0; white-space:nowrap; }
.claim-line-file .file-button { flex:0 0 auto; }
.claim-file-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:0 0 auto; }
.file-button-sm { min-height:32px; padding:5px 9px; font-size:.8rem; }
.claim-line-file .upload-preview-grid { flex:1 1 auto; display:grid; grid-template-columns:repeat(auto-fit, minmax(78px, 110px)); gap:6px; margin-top:0 !important; }
.claim-line-file .upload-preview-tile { min-height:74px; max-height:90px; }
.claim-line-file .upload-preview-tile img { height:56px; }
.claim-line-file .upload-pdf-preview { min-height:56px; padding:6px; }
.claim-line-attachment { position:relative; width:96px; flex:0 0 96px; border:1px solid var(--line); border-radius:8px; overflow:hidden; background:#f8fafc; }
.claim-line-attachment img { width:100%; height:56px; object-fit:cover; display:block; background:#eef2f7; }
.claim-line-attachment .file-preview, .claim-line-attachment .pdf-preview { min-height:56px; padding:6px; font-size:.74rem; }
.claim-existing-file-remove { position:absolute; top:4px; right:4px; z-index:2; width:22px; height:22px; border:0; border-radius:999px; background:#b42318; color:#fff; font-weight:900; line-height:1; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(15,23,42,.22); }
.claim-existing-file-remove:hover { background:#8a1c14; }
.claim-approval-form { grid-template-columns:1fr auto auto auto; }
.direct-xero-preview { border:1px solid var(--line); border-radius:8px; background:#f8fafc; padding:12px; }
.direct-xero-preview-issues { display:grid; gap:4px; margin-bottom:10px; color:#92400e; font-size:.84rem; font-weight:750; }
.direct-xero-preview-issues div { border-left:3px solid var(--amber); padding-left:8px; }
.direct-xero-preview-lines { border:1px solid var(--line); border-radius:6px; background:#fff; }
.direct-bill-form { position:relative; }
.direct-bill-form.is-ocr-submitting { cursor:progress; }
.form-busy-overlay { position:fixed; inset:0; z-index:2000; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(248,250,252,.82); backdrop-filter:blur(2px); pointer-events:auto; }
.form-busy-overlay > div { display:grid; gap:6px; min-width:min(360px, 100%); max-width:460px; border:1px solid #bfdbfe; border-left:5px solid var(--blue); border-radius:8px; background:#fff; box-shadow:0 16px 36px rgba(15,23,42,.18); padding:14px 16px; color:#172033; }
.form-busy-overlay strong { font-size:.95rem; }
.form-busy-overlay span { color:var(--muted); font-size:.84rem; }
.direct-bill-lines-table { border:1px solid var(--line); border-radius:8px; background:#fff; }
.direct-bill-lines-table table { min-width:900px; }
.direct-bill-lines-table th { font-size:.74rem; text-transform:uppercase; color:#475467; background:#f8fafc; white-space:nowrap; }
.direct-bill-lines-table td { vertical-align:top; }
.direct-bill-lines-table th:nth-child(1) { width:180px; }
.direct-bill-lines-table th.xero-tracking-header, .direct-bill-lines-table td.xero-tracking-cell { width:180px; max-width:180px; }
.direct-bill-lines-table th.direct-bill-description-header, .direct-bill-lines-table td.direct-bill-description-cell { width:auto; min-width:260px; }
.direct-bill-lines-table th.direct-bill-qty-header, .direct-bill-lines-table th.direct-bill-unit-header, .direct-bill-lines-table th.direct-bill-adj-header, .direct-bill-lines-table th.direct-bill-amount-header { width:120px; }
.form-help { color:var(--muted); font-size:.8rem; margin-top:4px; }
.mobile-stack { display:flex; gap:8px; flex-wrap:wrap; }
.progress-steps { display:flex; flex-wrap:wrap; gap:6px; }
.progress-step { border:1px solid var(--line); border-radius:999px; padding:5px 9px; font-weight:800; font-size:.75rem; color:#475467; background:#fff; }
.progress-step.done { background:var(--soft-green); border-color:#bbf7d0; color:var(--green); }
.progress-step.issue { background:#fee4e2; border-color:#fecdd3; color:var(--red); }
.btn { border-radius:6px; font-weight:700; }
.btn svg, .file-button svg { width:16px; height:16px; margin-right:5px; vertical-align:-3px; }
.btn-primary { --bs-btn-bg:var(--green); --bs-btn-border-color:var(--green); --bs-btn-hover-bg:#115c45; --bs-btn-hover-border-color:#115c45; --bs-btn-active-bg:#0e523d; --bs-btn-active-border-color:#0e523d; }
.btn-outline-primary { --bs-btn-color:var(--green); --bs-btn-border-color:#78a895; --bs-btn-hover-bg:var(--soft-green); --bs-btn-hover-color:#115c45; --bs-btn-hover-border-color:var(--green); --bs-btn-active-bg:var(--green); --bs-btn-active-border-color:var(--green); }
.btn-outline-secondary { --bs-btn-color:#45534e; --bs-btn-border-color:#bcc7c3; --bs-btn-hover-bg:#eef1f0; --bs-btn-hover-color:var(--ink); --bs-btn-hover-border-color:#9eaaa6; }
.form-control, .form-select { border-color:#bdc8c4; border-radius:6px; color:var(--ink); }
.form-control:focus, .form-select:focus { border-color:#4e947b; box-shadow:0 0 0 .2rem rgba(23,107,82,.12); }
.form-control::placeholder { color:#98a29e; }
.data-table th { border-bottom-color:#cbd4d1; background:#f3f5f4; color:#52605b; font-weight:800; }
.data-table > tbody > tr:last-child > td { border-bottom:0; }
.catalogue-admin-table th:first-child, .catalogue-admin-table td:first-child { width:32%; min-width:260px; }
a { color:var(--blue); }
.form-options { grid-column:1 / -1; border:1px solid var(--line); border-radius:7px; background:#fafbfa; }
.form-options summary { display:flex; align-items:center; gap:7px; padding:10px 12px; color:#45534e; font-weight:700; cursor:pointer; list-style:none; }
.form-options summary::-webkit-details-marker { display:none; }
.form-options summary svg { width:17px; height:17px; }
.form-options[open] summary { border-bottom:1px solid var(--line); }
.form-options-body { padding:12px; }
@media (max-width: 980px) {
  .shell { padding:0 12px 16px; }
  .app-header { margin:0 -12px 16px; padding:0 12px; }
  .app-header-main { min-height:58px; flex-wrap:wrap; gap:8px; }
  .app-brand img { width:31px; height:31px; }
  .nav-toggle { display:flex; }
  .app-navigation { display:none; flex:0 0 100%; align-items:stretch; padding:0 0 10px; }
  .app-navigation.open { display:flex; }
  .primary-nav { flex:1; align-items:stretch; flex-direction:column; }
  .nav-link { width:100%; min-height:42px; }
  .nav-menu-popover, .account-popover { position:static; margin-top:4px; box-shadow:none; }
  .account-menu { margin:0; }
  .account-trigger { width:100%; border-radius:6px; }
  .page-heading { margin-bottom:12px; }
  .title { font-size:1.3rem; }
  .grid-2, .grid-3, .grid-4, .filter-row, .receipt-form-grid, .queue-summary, .request-preview-grid, .claim-detail-grid { grid-template-columns:1fr; }
  .claim-detail-header, .claim-detail-line-main { flex-direction:column; gap:8px; }
  .claim-detail-line-main .text-end { text-align:left !important; }
  .claim-line-compact-grid { grid-template-columns:1fr; }
  .claim-description-field, .claim-vendor-field, .claim-notes-field { grid-column:auto; }
  .claim-line-file { align-items:stretch; flex-direction:column; }
  .claim-file-actions { width:100%; align-items:stretch; }
  .claim-file-actions .file-button, .claim-file-actions .btn { flex:1 1 160px; }
  .claim-line-file .upload-preview-grid { width:100%; grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .wide, .full { grid-column:auto; }
  .queue-action-form, .owner-action-form { min-width:260px; grid-template-columns:1fr; }
  .order-doc-actions { align-items:stretch; }
  .order-doc-actions .btn { width:100%; }
  .recall-form, .cancel-order-form { width:100%; align-items:stretch; }
  .recall-form .form-control, .cancel-order-form .form-control, .recall-form .btn, .cancel-order-form .btn { width:100%; }
  .delivery-resolution-form { grid-template-columns:1fr; }
  .attachment-grid, .receipt-attachment-grid, .upload-preview-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .btn, .form-control, .form-select { min-height:42px; }
}
