:root{--ink:#17202a;--muted:#68727d;--line:#d9dee3;--paper:#f4f6f7;--white:#fff;--red:#a9342b;--redbg:#fff0ee;--green:#26714d;--greenbg:#edf8f1;--amber:#8a5a10;--amberbg:#fff7df;--shadow:0 18px 60px rgba(23,32,42,.18)}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:"Avenir Next",Avenir,"Helvetica Neue",Arial,sans-serif;font-size:14px}.app-head{height:66px;background:#26313a;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}.brand{display:flex;gap:11px;align-items:center}.brand>span{display:grid;place-items:center;width:34px;height:34px;background:#fff;color:#26313a;font-weight:800;border-radius:2px}.brand div{display:flex;flex-direction:column}.brand strong{font-size:15px}.brand small{color:#bdc6cd}.app-head nav{display:flex;height:100%}.tab{border:0;border-bottom:3px solid transparent;background:transparent;color:#cbd2d7;padding:0 20px;font:inherit;font-weight:650;cursor:pointer}.tab.active{color:#fff;border-color:#76a9cf}.tab:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,tr:focus-visible{outline:3px solid #76a9cf;outline-offset:2px}main{max-width:1500px;margin:0 auto;padding:28px}.view{display:none}.view.active{display:block}.page-title{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;margin-bottom:22px}.page-title h1{font-size:26px;letter-spacing:-.025em;margin:0 0 5px}.page-title p{margin:0;color:var(--muted)}.counts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.metric{background:var(--white);border:1px solid var(--line);padding:8px 12px;min-width:105px}.metric b{display:block;font-size:19px}.metric small{color:var(--muted)}.metric.danger b{color:var(--red)}.toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 190px 180px auto;gap:10px;align-items:end;background:#e7ebee;border:1px solid #cbd2d7;border-bottom:0;padding:12px}.toolbar.compact{grid-template-columns:minmax(260px,1fr) 190px auto}.toolbar label{display:flex;flex-direction:column;gap:4px}.toolbar label span{font-size:12px;color:#52606a}.toolbar input,.toolbar select{width:100%;height:38px;border:1px solid #bfc7cd;background:#fff;border-radius:2px;padding:0 10px;color:var(--ink);font:inherit}.toolbar>strong{padding:0 4px 10px;white-space:nowrap}.ledger{background:var(--white);border:1px solid #cbd2d7;overflow:auto;max-height:calc(100vh - 235px)}table{width:100%;border-collapse:collapse;min-width:1050px}th{position:sticky;top:0;background:#f8f9fa;color:#4f5b65;font-size:12px;text-align:left;border-bottom:1px solid #bfc7cd;padding:10px 12px;z-index:1}td{border-bottom:1px solid #e4e8eb;padding:10px 12px;vertical-align:middle}tbody tr{cursor:pointer}tbody tr:hover{background:#f4f8fb}tbody tr.approved{background:#f0f7f3}td strong,td small{display:block}td small{color:var(--muted);margin-top:2px}.num{text-align:right;font-variant-numeric:tabular-nums}.pill{display:inline-block;border-radius:99px;padding:4px 8px;font-size:12px;font-weight:700;white-space:nowrap}.pill.accepted,.pill.matched,.pill.approved{color:var(--green);background:var(--greenbg)}.pill.problem,.pill.rejected{color:var(--red);background:var(--redbg)}.pill.pending,.pill.unknown{color:var(--amber);background:var(--amberbg)}.plain-status{font-size:12px;font-weight:700}.plain-status.no{color:var(--red)}.plain-status.yes{color:var(--green)}.empty{padding:36px;text-align:center;color:var(--muted)}dialog{width:min(980px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:0;border:1px solid #aeb7be;border-radius:4px;box-shadow:var(--shadow);color:var(--ink)}dialog::backdrop{background:rgba(22,29,35,.55)}.dialog-head{display:flex;justify-content:space-between;gap:20px;padding:22px 24px 18px;border-bottom:1px solid var(--line)}.dialog-head h2{margin:2px 0 3px;font-size:22px}.dialog-head p,.dialog-head small{margin:0;color:var(--muted)}.close{border:1px solid var(--line);background:#fff;width:36px;height:36px;font-size:24px;cursor:pointer}.dialog-status{padding:12px 24px;background:#f7f8f9;border-bottom:1px solid var(--line);display:flex;gap:10px;align-items:center}.match-strip{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line)}.match-card{padding:18px 20px;border-right:1px solid var(--line)}.match-card:last-child{border-right:0}.match-card small,.match-card span{display:block;color:var(--muted)}.match-card b{display:block;font-size:17px;margin:6px 0}.detail-section{padding:20px 24px}.detail-section h3{margin:0 0 12px;font-size:15px}.line-table{border:1px solid var(--line);max-height:280px;overflow:auto}.line-table table{min-width:700px}.line-table th{position:sticky}.line-table tr{cursor:default}.line-table tr:hover{background:transparent}dialog footer{border-top:1px solid var(--line);padding:16px 24px;display:flex;align-items:center;gap:14px;background:#f7f8f9}.approve-button{border:0;background:var(--green);color:#fff;padding:11px 16px;border-radius:2px;font:inherit;font-weight:750;cursor:pointer}.approve-button.is-approved{background:#d9e7df;color:#20583e}.error{background:#fff;border:1px solid var(--red);padding:24px}.change-up{color:var(--red);font-weight:750}.change-down{color:var(--green);font-weight:750}
@media(max-width:800px){.app-head{padding:0 14px}.brand small{display:none}.tab{padding:0 10px}main{padding:16px}.page-title{align-items:flex-start;flex-direction:column}.counts{justify-content:flex-start}.toolbar,.toolbar.compact{grid-template-columns:1fr}.ledger{max-height:none}.match-strip{grid-template-columns:1fr}.match-card{border-right:0;border-bottom:1px solid var(--line)}dialog footer{align-items:flex-start;flex-direction:column}}
.compare-table{max-height:360px}.compare-table table{min-width:1120px}.line-table tr.line-different{background:#fff8f6}.line-table tr.line-same{background:#f5faf7}.compare-table .pill{white-space:normal;line-height:1.35}
body{font-size:13px}.app-head{height:56px;padding:0 20px}.brand>span{width:30px;height:30px}.brand strong{font-size:14px}.tab{padding:0 16px}main{padding:20px;max-width:1450px}.page-title{margin-bottom:16px}.page-title h1{font-size:22px}.metric{padding:6px 10px;min-width:96px}.metric b{font-size:17px}.toolbar{grid-template-columns:minmax(230px,1fr) 155px 155px 155px auto;padding:9px;gap:8px}.toolbar input,.toolbar select{height:34px}.ledger{max-height:calc(100vh - 195px)}th{font-size:11px;padding:8px 10px}td{padding:8px 10px}.pill{font-size:11px;padding:3px 7px}dialog{width:min(900px,calc(100vw - 28px))}.dialog-head{padding:16px 18px 13px}.dialog-head h2{font-size:19px}.dialog-status{padding:9px 18px}.match-card{padding:13px 16px}.match-card b{font-size:15px;margin:4px 0}.detail-section{padding:15px 18px}.detail-section h3{font-size:14px}.line-table{max-height:250px}dialog footer{padding:12px 18px}.approve-button{padding:9px 13px}
.range-filter{min-width:240px}.range-filter>span{display:flex;justify-content:space-between}.range-filter input[type="range"]{height:34px;padding:0;accent-color:#26714d;cursor:pointer}.range-filter strong{color:var(--ink);font-variant-numeric:tabular-nums}
body{font-size:12px}.app-head{height:48px;padding:0 16px}.brand>span{width:26px;height:26px}.brand strong{font-size:13px}.tab{padding:0 13px}main{padding:12px;max-width:1600px}.page-title{margin-bottom:10px}.page-title h1{font-size:18px}.page-title p{font-size:11px}.counts{gap:5px}.metric{padding:4px 8px;min-width:84px}.metric b{font-size:15px}.metric small{font-size:10px}.toolbar{padding:6px;gap:6px}.toolbar label{gap:2px}.toolbar label span{font-size:10px}.toolbar input,.toolbar select{height:29px;padding:0 7px}.toolbar>strong{padding-bottom:7px}.ledger{max-height:calc(100vh - 150px)}table{min-width:900px}th{font-size:10px;padding:6px 7px}td{padding:6px 7px}.pill{font-size:10px;padding:2px 6px}.plain-status{font-size:10px}#invoiceDialog{width:min(1280px,calc(100vw - 16px));max-height:calc(100vh - 16px)}.dialog-head{padding:10px 14px 8px}.dialog-head h2{font-size:17px}.close{width:30px;height:30px;font-size:20px}.dialog-status{padding:7px 14px}.match-card{padding:9px 12px}.match-card b{font-size:14px;margin:2px 0}.detail-section{padding:10px 14px}.detail-section h3{font-size:13px;margin-bottom:7px}.line-table{max-height:220px}.compare-table{max-height:300px}.compare-table table{min-width:1040px;table-layout:fixed}.compare-table th:nth-child(1){width:11%}.compare-table th:nth-child(2){width:20%}.compare-table th:nth-child(3){width:10%}.compare-table th:nth-child(4){width:20%}.compare-table th:nth-child(5),.compare-table th:nth-child(6){width:7%}.compare-table th:nth-child(7),.compare-table th:nth-child(8){width:12%}.compare-table td{overflow-wrap:anywhere}dialog footer{padding:8px 14px}.approve-button{padding:7px 11px}.range-filter input[type="range"]{height:29px}
@media(max-width:800px){.app-head{padding:0 12px}main{padding:12px}.toolbar,.toolbar.compact{grid-template-columns:1fr}.ledger{max-height:none}}
@media(prefers-reduced-motion:no-preference){dialog[open]{animation:open .14s ease-out}@keyframes open{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}}
.line-table tr.line-mismatch{background:#fff8f6}.line-table td.value-mismatch{color:var(--red);background:#fff0ee}.compare-table th:nth-child(9){width:12%}
.document-button{border:1px solid #87939c;background:#fff;color:var(--ink);padding:7px 11px;border-radius:2px;font:inherit;font-weight:700;cursor:pointer}#invoiceDocumentDialog{width:min(1200px,calc(100vw - 20px));height:calc(100vh - 20px);max-height:none}#invoiceDocumentFrame{display:none;width:100%;height:calc(100% - 76px);border:0;background:#fff}.document-message{padding:24px;color:var(--muted)}#invoiceDocumentDialog.ready #invoiceDocumentFrame{display:block}#invoiceDocumentDialog.ready .document-message{display:none}
.bulk-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-height:36px;padding:5px 7px;background:#f4f6f7;border:1px solid #cbd2d7;border-bottom:0}.bulk-actions span{margin-right:auto;color:var(--muted);font-variant-numeric:tabular-nums}.bulk-actions button{border:1px solid #26714d;background:#26714d;color:#fff;border-radius:2px;padding:6px 10px;font:inherit;font-weight:700;cursor:pointer}.bulk-actions .quiet-button{border-color:#aeb7be;background:#fff;color:var(--ink)}.bulk-actions button:disabled{opacity:.45;cursor:default}.select-col{width:34px;min-width:34px;text-align:center;padding-left:6px;padding-right:6px}.select-col input{width:15px;height:15px;margin:0;accent-color:#26714d;cursor:pointer}.select-col input:focus-visible{outline:2px solid #76a9cf;outline-offset:2px}
@media(max-width:800px){.bulk-actions{justify-content:flex-start;flex-wrap:wrap}.bulk-actions span{width:100%;margin-right:0}}
.stock-price-panel{margin-bottom:12px;border:1px solid var(--line);background:#f7f8f9;padding:10px}.stock-price-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}.stock-price-heading small{color:var(--muted)}.stock-price-grid{display:grid;grid-template-columns:repeat(5,minmax(105px,1fr));border:1px solid var(--line);background:#fff}.stock-price-grid>div{display:flex;flex-direction:column;gap:3px;padding:8px 10px;border-right:1px solid var(--line)}.stock-price-grid>div:last-child{border-right:0}.stock-price-grid strong{font-size:15px}.stock-price-grid span{font-size:9px;color:var(--muted)}.stock-price-grid .currency-label{width:max-content;padding:2px 5px;border:1px solid var(--line);background:#eef1f3;color:var(--ink);font-size:9px}.stock-price-grid .currency-label.foreign{border-color:#b98b28;background:#fff4d6;color:#6b4b00}.stock-price-panel.pending{display:flex;align-items:center;gap:12px;color:var(--muted)}.stock-price-panel.pending strong{color:var(--ink)}
@media(max-width:800px){.stock-price-heading{align-items:flex-start;flex-direction:column}.stock-price-grid{grid-template-columns:repeat(2,1fr)}.stock-price-grid>div{border-bottom:1px solid var(--line)}}
.head-actions{display:flex;align-items:center;height:100%;gap:8px}.head-actions nav{height:100%}.refresh-data-button{border:1px solid #8fa0aa;background:#fff;color:#26313a;border-radius:2px;padding:6px 10px;font:inherit;font-weight:750;cursor:pointer}.refresh-data-button.running{background:#fff7df;color:#6b4b00;border-color:#c9a554}.sync-dialog{width:min(620px,calc(100vw - 28px))}.sync-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:16px 18px}.sync-fields label{display:flex;flex-direction:column;gap:4px}.sync-fields label:first-child,.sync-fields label:nth-child(2){grid-column:1/-1}.sync-fields span{color:#52606a;font-size:11px}.sync-fields input{height:34px;border:1px solid #bfc7cd;border-radius:2px;padding:0 9px;color:var(--ink);font:inherit}.sync-status{margin:0 18px 4px;padding:9px 10px;border-left:3px solid #8fa0aa;background:#f4f6f7;color:var(--muted)}.sync-status.running{border-color:#c9a554;background:#fff7df;color:#6b4b00}.sync-status.success{border-color:var(--green);background:var(--greenbg);color:var(--green)}.sync-status.error{border-color:var(--red);background:var(--redbg);color:var(--red)}
@media(max-width:800px){.head-actions{gap:2px}.refresh-data-button{padding:5px 7px}.sync-fields{grid-template-columns:1fr}.sync-fields label:first-child,.sync-fields label:nth-child(2){grid-column:auto}}
.sort-button{display:flex;align-items:center;gap:4px;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-align:left;cursor:pointer}.num .sort-button{justify-content:flex-end;text-align:right}.sort-button:hover,.sort-button.active{color:var(--ink)}.sort-marker{display:inline-block;min-width:10px;color:#87939c;font-size:10px;line-height:1}.sort-button.active .sort-marker{color:var(--green);font-weight:800}
.stock-code-button{border:0;border-bottom:1px solid #26714d;background:transparent;color:#205f43;padding:0;font:inherit;font-weight:800;cursor:pointer}.stock-code-button:hover{color:#123b29;border-bottom-width:2px}.stock-overview{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border:1px solid var(--line);margin-bottom:12px;background:#fff}.stock-overview>div{min-height:74px;padding:10px 12px;border-right:1px solid var(--line)}.stock-overview>div:last-child{border-right:0}.stock-overview small,.stock-overview span{display:block;color:var(--muted)}.stock-overview strong{display:block;font-size:16px;margin:5px 0;font-variant-numeric:tabular-nums}.stock-overview .stock-low{background:var(--redbg)}.stock-overview .stock-low strong{color:var(--red)}.stock-overview .stock-ok strong{color:var(--green)}.movement-heading{margin:14px 0 7px;font-size:13px}.sales-history{margin-bottom:6px}.sales-empty{border-top:1px solid var(--line);margin-top:14px;padding-top:14px}
@media(max-width:800px){.stock-overview{grid-template-columns:repeat(2,1fr)}.stock-overview>div{border-bottom:1px solid var(--line)}}
.stock-price-panel.pending{justify-content:space-between}.stock-price-panel.pending>div{display:flex;flex-direction:column;gap:3px}.stock-refresh-button{border:1px solid #26714d;background:#26714d;color:#fff;padding:8px 12px;font:inherit;font-weight:800;cursor:pointer;white-space:nowrap}.stock-refresh-button:hover{background:#205f43}.stock-refresh-button:focus-visible{outline:3px solid #bfe0cf;outline-offset:2px}.sales-empty{display:flex;align-items:center;justify-content:space-between;gap:12px}
@media(max-width:800px){.stock-price-panel.pending,.sales-empty{align-items:stretch;flex-direction:column}.stock-refresh-button{width:100%;white-space:normal}}
[hidden]{display:none!important}
#accountDialog,#userDialog{width:min(460px,calc(100vw - 28px))}
#accountForm,#userForm{grid-template-columns:1fr}
#accountError,#userError{color:var(--red)}
#syncForm>label,#editConnection{margin:10px 18px;display:block}
#autoSyncStatus{margin:2px 0 0;color:#dce4e8;font-size:11px}
:root { --order-border: #d6dde1; }
.order-notice { color: #63717a; font-size: 12px; margin: 12px 0; }
.order-line { border: 1px solid var(--order-border); margin: 16px 0; border-radius: 6px; overflow: hidden; }
.order-line-head { display: flex; justify-content: space-between; gap: 20px; padding: 14px; background: #f4f7f6; }
.order-line-head small { display: block; margin-top: 6px; color: #61716a; }
.order-line-head label { white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.order-quantities { display: flex; flex-wrap: wrap; gap: 24px; padding: 12px 14px; border-bottom: 1px solid var(--order-border); }
.order-line > p { padding: 12px 14px; }
.order-invoice-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
#orderDialog { width: min(1500px, 96vw); }
#orderDialog table { font-size: 12px; }
#orderDialog .order-line { margin: 10px 0; }
#orderDialog .order-line-head { padding: 9px 12px; }
#orderDialog .order-detail-table th,#orderDialog .order-detail-table td { padding: 9px 10px; }
#orderDialog .order-total { background: #f4f6f7; white-space: nowrap; }
#orderDialog .order-remaining { color: #8a5a10; background: #fff7df; }

/* Compact working ledger: numeric comparisons take precedence over decoration. */
.reviewer-summary { display: block; margin-top: 3px; color: var(--muted); }
body { font-family: Arial, "Helvetica Neue", sans-serif; font-size: 11px; line-height: 1.3; }
main { padding: 8px 10px; max-width: none; }
.app-head { height: 44px; padding: 0 10px; }
.tab { padding: 0 9px; }
.page-title h1 { font-size: 16px; }
.page-title { margin-bottom: 7px; }
.dialog-head h2 { font-size: 15px; }
.dialog-head { padding: 8px 10px; }
.detail-section { padding: 8px 10px; }
th,td { padding: 4px 6px; }
td strong,.stock-code-button { font-weight: 600; }
.pill { border-radius: 3px; font-weight: 600; }
.toolbar input,.toolbar select { height: 27px; }
.match-card { padding: 6px 10px; }
.match-card b,.stock-overview strong,.stock-price-grid strong { font-size: 13px; }
.stock-overview>div { min-height: 56px; padding: 7px 9px; }
.stock-price-panel { padding: 7px; margin-bottom: 8px; }
.stock-price-grid>div { padding: 5px 7px; }
.movement-heading { margin: 9px 0 5px; font-size: 12px; }
#orderDialog .order-line { margin: 7px 0; border-radius: 2px; }
#orderDialog .order-line-head { padding: 6px 9px; gap: 10px; }
#orderDialog .order-line-head small { margin-top: 2px; font-size: 10px; }
#orderDialog .order-detail-table { font-size: 11px; }
#orderDialog .order-detail-table th,#orderDialog .order-detail-table td { padding: 5px 7px; }
#orderDialog .order-notice { margin: 6px 0; font-size: 10px; }
#orderDialog .order-invoice-links { margin-bottom: 7px; }
@media(max-width:800px) {
  .app-head { height: auto; min-height: 44px; flex-wrap: wrap; }
  .head-actions { flex-wrap: wrap; }
  .toolbar,.toolbar.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .order-line-head { flex-wrap: wrap; }
}

/* 2026 workspace refresh: one calm, dense accounting surface. */
:root {
  --ink: #243038;
  --muted: #66727a;
  --line: #d3dadd;
  --paper: #eef1f2;
  --white: #ffffff;
  --green: #236a51;
  --greenbg: #eaf4ef;
  --red: #a33a31;
  --redbg: #fbefed;
  --amber: #815b1b;
  --amberbg: #f8f1df;
  --shadow: 0 12px 34px rgba(27, 42, 50, .16);
}
body { background: var(--paper); color: var(--ink); letter-spacing: 0; }
.app-head {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid #c9d1d5;
  box-shadow: 0 1px 0 rgba(34,48,56,.03);
}
.brand>span { background: #236a51; color: #fff; }
.brand small,#autoSyncStatus { color: var(--muted); }
.head-actions>button:not(.refresh-data-button) { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 5px 8px; }
.refresh-data-button { border-color: #aebabe; color: var(--ink); }
.tab { color: #56636b; border-bottom-width: 2px; font-weight: 600; }
.tab:hover { color: var(--ink); background: #f5f7f7; }
.tab.active { color: #1f604a; border-color: #236a51; background: #edf5f1; }
main { padding: 9px 12px 12px; }
.page-title { align-items: center; min-height: 39px; margin-bottom: 6px; }
.page-title h1 { font-size: 15px; letter-spacing: -.01em; margin-bottom: 2px; }
.page-title p { font-size: 10px; }
.counts { gap: 0; border: 1px solid var(--line); background: #fff; }
.metric { min-width: 92px; padding: 4px 9px; border: 0; border-left: 1px solid var(--line); background: transparent; }
.metric:first-child { border-left: 0; }
.metric b { font-size: 14px; line-height: 1.15; }
.metric.invalid b { color: var(--red); }
.toolbar {
  grid-template-columns: minmax(190px,1.05fr) minmax(230px,1.6fr) minmax(250px,1.25fr) 145px 130px auto;
  background: #f7f8f8;
  border-color: var(--line);
  padding: 6px 7px;
}
.toolbar.compact { grid-template-columns: minmax(260px,1fr) 170px 150px; }
.toolbar input,.toolbar select { border-color: #bcc7cb; border-radius: 1px; background: #fff; }
.date-inputs { display: grid; grid-template-columns: minmax(105px,1fr) auto minmax(105px,1fr) 25px; align-items: center; gap: 4px; }
.toolbar .date-inputs { color: var(--muted); font-size: 11px; }
.date-inputs i { font-style: normal; text-align: center; }
.date-inputs button { height: 27px; border: 1px solid #bcc7cb; background: #fff; color: var(--muted); font: 17px/1 Arial,sans-serif; cursor: pointer; }
.date-inputs button:hover { color: var(--red); border-color: #d6aaa5; background: var(--redbg); }
.bulk-actions { background: #fff; border-color: var(--line); min-height: 31px; }
.ledger { border-color: var(--line); box-shadow: 0 1px 1px rgba(31,47,55,.03); }
th { background: #f1f4f4; color: #536068; border-bottom-color: #bcc7cb; }
tbody tr:nth-child(even):not(.approved) { background: #fafbfb; }
tbody tr:hover { background: #eef5f3 !important; }
tbody tr.approved { background: #edf5f1; }
.pill { border: 1px solid transparent; padding: 2px 5px; }
.pill.accepted,.pill.matched,.pill.approved { border-color: #cce2d7; }
.pill.problem,.pill.rejected { border-color: #efd2ce; }
.pill.pending,.pill.unknown { border-color: #eadcb8; }
.invalid-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; color: #fff; background: var(--red); font-weight: 800; }
dialog { border-radius: 2px; border-color: #9faaaf; }
.dialog-head { background: #fff; }
.dialog-status,.match-strip,dialog footer { background: #f6f8f8; }
.order-line { border-radius: 1px; border-color: var(--line); }
.order-line-head { background: #f1f5f3; }
@media(max-width:1050px) {
  .app-head { height: auto; min-height: 44px; flex-wrap: wrap; }
  .head-actions { flex-wrap: wrap; }
  .toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
.party-name { color: #162f40; font-weight: 750; }
#orderSubtitle { display:flex; flex-wrap:wrap; align-items:baseline; gap:7px; }
.order-supplier { color:#1b3546; font-size:13px; font-weight:750; }
.order-product { display:grid; grid-template-columns:auto 1fr; align-items:baseline; gap:7px; }
.order-product .product-code {
  padding:2px 5px;
  border:1px solid #b9cec5;
  border-radius:3px;
  color:#155d43;
  background:#fff;
  font-weight:750;
}
.order-product>strong { color:#142c3b; font-size:12px; font-weight:750; }
.order-product>small { grid-column:1/-1; }
.control-reason { max-width:240px; color:#6b7780; line-height:1.3; }
.order-warning-detail { display:block; margin-top:4px; color:#536773; font-weight:650; }
.source-discrepancy { display:block; margin-top:4px; color:#6e5a2b; font-weight:500; white-space:normal; }

/* User-scoped operational log: compact enough to scan like an accounting journal. */
.log-toolbar { grid-template-columns: 170px 140px minmax(280px,1fr) auto auto; }
.log-toolbar>button { align-self:end; height:27px; border:1px solid #aebabe; background:#fff; color:var(--ink); padding:0 10px; font:inherit; font-weight:600; cursor:pointer; }
.log-ledger table { min-width:920px; }
.log-ledger th:nth-child(1) { width:145px; }
.log-ledger th:nth-child(2) { width:130px; }
.log-ledger th:nth-child(3) { width:85px; }
.log-ledger th:nth-child(4) { width:160px; }
.log-ledger th:nth-child(6) { width:180px; }
.log-time { white-space:nowrap; font-variant-numeric:tabular-nums; }
.log-level { display:inline-block; min-width:52px; padding:2px 5px; border:1px solid var(--line); border-radius:2px; font-size:10px; font-weight:650; }
.log-level.error { color:var(--red); background:var(--redbg); border-color:#efd2ce; }
.log-level.warning { color:var(--amber); background:var(--amberbg); border-color:#eadcb8; }
.log-level.success { color:var(--green); background:var(--greenbg); border-color:#cce2d7; }
.log-level.info { color:#52606a; background:#f1f4f4; }
@media(max-width:1050px) { .log-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Professional operations desk: dense, calm and built around comparison data. */
:root {
  --ink: #182631;
  --muted: #64737d;
  --line: #d6dde1;
  --paper: #edf1f3;
  --white: #fff;
  --green: #166448;
  --greenbg: #e9f4ee;
  --red: #a43b32;
  --redbg: #fbefed;
  --amber: #7b5819;
  --amberbg: #faf3df;
  --navy: #183044;
  --navy-soft: #26465c;
  --focus: #3f86b5;
  --shadow: 0 14px 38px rgba(16, 39, 54, .18);
}
body {
  min-width: 720px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.35;
}
.app-head {
  min-height: 52px;
  height: 52px;
  padding: 0 16px;
  background: var(--navy);
  color: #fff;
  border: 0;
  box-shadow: 0 2px 10px rgba(17, 38, 52, .2);
}
.brand { min-width: 260px; }
.brand>span {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.brand strong { color: #fff; font-size: 13px; letter-spacing: .005em; }
.brand small,#autoSyncStatus { color: #b9c9d4; }
.head-actions { gap: 6px; }
.head-actions>span { color: #e4edf2; font-weight: 650; margin-right: 2px; }
.head-actions>button:not(.refresh-data-button),.refresh-data-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #587185;
  border-radius: 4px;
  background: var(--navy-soft);
  color: #fff;
}
.head-actions>button:hover,.refresh-data-button:hover { background: #31556e; border-color: #7590a2; }
.head-actions nav { margin-left: 5px; }
.tab {
  padding: 0 13px;
  color: #c5d2da;
  border-bottom: 3px solid transparent;
  font-weight: 650;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.tab.active { color: #fff; background: rgba(255,255,255,.1); border-color: #65bf98; }
main { padding: 13px 16px 16px; }
.page-title { min-height: 48px; margin-bottom: 9px; }
.page-title h1 { font-size: 18px; font-weight: 720; color: #172a38; }
.page-title p { color: var(--muted); font-size: 11px; }
.counts {
  overflow: hidden;
  border: 1px solid #cbd4d9;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20,45,60,.04);
}
.metric { min-width: 105px; padding: 7px 11px; }
.metric b { color: #193246; font-size: 16px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 10px; }
.toolbar {
  grid-template-columns: minmax(180px,1.05fr) minmax(225px,1.5fr) minmax(250px,1.25fr) 140px 130px auto;
  gap: 8px;
  padding: 8px;
  background: #f7f9fa;
  border: 1px solid #cbd4d9;
  border-radius: 5px 5px 0 0;
}
.toolbar label { gap: 3px; }
.toolbar label>span:first-child { color: #536571; font-size: 10px; font-weight: 650; }
.toolbar input,.toolbar select {
  height: 31px;
  padding: 0 8px;
  border: 1px solid #b9c6cd;
  border-radius: 4px;
  color: #20323f;
  background: #fff;
}
.toolbar input:hover,.toolbar select:hover { border-color: #8ea3af; }
.toolbar input:focus,.toolbar select:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(63,134,181,.12); }
.date-inputs button { height: 31px; border-radius: 4px; }
.bulk-actions {
  min-height: 36px;
  padding: 5px 8px;
  border-color: #cbd4d9;
  background: #fff;
}
.bulk-actions button,.approve-button,.stock-refresh-button {
  border-radius: 4px;
  background: var(--green);
  border-color: var(--green);
}
.ledger {
  border-color: #cbd4d9;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 2px 5px rgba(21,44,58,.05);
}
th {
  padding: 8px 9px;
  color: #435762;
  background: #eef3f5;
  border-bottom: 1px solid #b8c5cc;
  font-size: 10px;
  font-weight: 720;
}
td { padding: 7px 9px; border-bottom-color: #e0e6e9; }
tbody tr:nth-child(even):not(.approved) { background: #f9fbfb; }
tbody tr:hover { background: #edf5f3 !important; box-shadow: inset 3px 0 0 #4c9475; }
tbody tr.approved { background: #eef6f2; }
.pill { border-radius: 4px; font-weight: 700; }
.plain-status { font-weight: 700; }
.sort-button:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,tr:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
dialog { border-radius: 7px; border-color: #8fa1ab; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(13,31,43,.58); }
.dialog-head { background: #fff; border-bottom-color: #ccd6db; }
.dialog-head h2 { color: #162d3c; }
.close { border-radius: 4px; color: #354955; }
.dialog-status,.match-strip,dialog footer { background: #f4f7f8; }
.match-card b { font-variant-numeric: tabular-nums; }
.order-line { border-radius: 4px; }
.order-line-head { background: #edf4f1; }
@media(max-width:1050px) {
  body { min-width: 0; }
  .app-head { height: auto; min-height: 52px; }
  .brand { min-width: auto; }
  .toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
