:root{font-family:Inter,"Segoe UI",Tahoma,sans-serif;color:#272b30;background:#f6f7f8;font-synthesis:none;--ink:#15253c;--green:#173a6e;--muted:#727983;--line:#e4e6ea;--soft:#eff1f3;--amber:#ad7530}*{box-sizing:border-box}body{margin:0;font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button,a{touch-action:manipulation}button{cursor:pointer;background:white;border:1px solid #d8dce1;border-radius:8px;padding:10px 15px;color:var(--ink);font-weight:600}button:hover{background:#ecf0f7;border-color:#b8bec8}button:disabled{opacity:.5;cursor:wait}a{color:var(--green);text-decoration:none}.primary{background:var(--green);color:#fff;border-color:var(--green)}.primary:hover{background:#112e5a;color:white}.danger{color:#a34436}.sidebar{width:238px;position:fixed;inset:0 auto 0 0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:30px 18px;z-index:10}.brand{display:flex;align-items:center;gap:12px;padding:0 12px 36px;color:#17273e;font-weight:750;font-size:23px;letter-spacing:1px}.brand small{display:block;font-size:8px;letter-spacing:1.5px;color:#7f8691;margin-top:5px}.brand-mark{display:grid;place-items:center;background:var(--ink);color:#d3dded;border-radius:13px;width:41px;height:44px;font-size:26px}.nav-label{font-size:9px;font-weight:700;color:#979ca3;letter-spacing:1.7px;margin:0 15px 13px}.nav-button{border:0;background:transparent;text-align:left;width:100%;display:flex;gap:13px;align-items:center;font-weight:500;margin:3px 0;padding:12px 16px;color:#757b84}.nav-button.active{background:#e8edf5;color:#173a6e;font-weight:700}.nav-icon{font-size:19px;width:23px;text-align:center}.nav-count{margin-left:auto;font-size:10px;background:#fff;padding:3px 6px;border-radius:5px}.nav-divider{height:1px;background:var(--line);margin:18px 12px}.sidebar-foot{margin-top:auto;padding:22px 9px 0;display:flex;align-items:center;gap:10px;color:#535b68;font-size:11px}.sidebar-foot small{display:block;font-size:9px;color:#989ea6;margin-top:5px}.status-dot{width:8px;height:8px;border-radius:50%;background:#848e9e}.shell{margin-left:238px}.topbar{height:83px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 42px;background:#ffffffb8}.breadcrumb{color:#8c9199;font-size:12px}.slash{margin:0 16px;color:#c1c5cb}.topbar strong{font-size:12px;font-weight:600}.top-actions{display:flex;align-items:center;gap:20px}.today{font-size:11px;color:#828993}.avatar{background:#ebedf0;border:3px solid #fff;border-radius:50%;padding:10px;font-size:11px;color:#677283}.icon-button{font-size:21px;padding:4px 10px;border:0;background:transparent;color:#757d8a}main{max-width:1550px;margin:auto;padding:38px 42px 45px}footer{padding:20px 42px;color:#8f959e;font-size:10px;border-top:1px solid var(--line)}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:700;color:var(--green);text-transform:uppercase}.page-header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:28px}h1{font-size:31px;letter-spacing:-1px;font-weight:600;margin:10px 0}h2{font-size:18px;font-weight:600;letter-spacing:-.3px;margin:0}h3{font-size:14px;margin:0}p{line-height:1.65}.page-header p{margin:0;color:#8a8f96;font-size:12px}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:17px;margin-bottom:25px}.metric{background:#fff;border:1px solid var(--line);border-radius:12px;padding:22px;min-height:138px;box-shadow:0 3px 7px #32363d03}.metric .label{font-size:11px;color:#818790}.metric strong{display:block;font-weight:550;font-size:28px;letter-spacing:-1px;margin:17px 0 9px}.metric small{font-size:10px;color:#8b929c}.metric.accent{background:var(--ink);color:#fff;border:0}.metric.accent .label,.metric.accent small{color:#aeb5c0}.split{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(270px,1fr);gap:23px;margin-bottom:26px}.panel{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}.panel-title{padding:22px 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #f0f1f3}.panel-title small{color:#979da6;font-size:10px}.activity{padding:4px 24px}.activity-row{padding:19px 0;display:flex;gap:13px;align-items:center;border-bottom:1px solid #f1f2f4}.activity-row:last-child{border-bottom:0}.activity-icon{width:34px;height:34px;border-radius:10px;background:#eff1f3;display:grid;place-items:center;color:#626d7d}.activity-row small{display:block;color:#9197a0;margin-top:5px;font-size:10px}.activity-row strong{font-size:11px;font-weight:600}.activity-row .amount{margin-left:auto;font-size:12px;white-space:nowrap}.quick-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:25px 0}.quick{background:#fff;border:1px solid var(--line);border-radius:10px;text-align:left;padding:20px;display:flex;align-items:center;gap:15px}.quick span{font-size:23px;font-weight:400;color:#6a7687}.quick small{display:block;font-size:10px;margin-top:5px;color:#9499a1;font-weight:400}.quick strong{font-size:12px}.toolbar{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:20px}.search{max-width:350px;flex:1;min-width:180px}.toolbar input,.toolbar select{border:1px solid var(--line);border-radius:8px;padding:11px 14px;background:#fff;color:#4b535f}.segments{display:flex;gap:4px;background:#ebedef;border-radius:8px;padding:4px}.segments button{border:0;background:transparent;padding:7px 13px;font-size:11px}.segments .selected{background:white;box-shadow:0 1px 4px #17273e12}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}th{font-size:9px;letter-spacing:.8px;text-transform:uppercase;color:#8b919b;background:#f9fbfd;font-weight:650;padding:15px 21px;border-bottom:1px solid var(--line)}td{font-size:12px;padding:16px 21px;border-bottom:1px solid #eeeff1;color:#636b76}tr:last-child td{border-bottom:0}td strong{font-weight:600;color:#3a4049}td small{display:block;font-size:10px;color:#989ea6;margin-top:5px}.text-button{padding:0;background:none;border:0;color:var(--green);font-size:12px;text-align:left}.badge{display:inline-block;padding:5px 9px;font-size:9px;border-radius:5px;background:#eff0f2;color:#7a828e;font-weight:600}.badge.green{background:#e8eef6;color:#38598a}.badge.amber{background:#fcf3e4;color:#b18945}.badge.red{background:#fbefea;color:#bd7862}.badge.blue{background:#edf1fa;color:#728cb4}.empty{text-align:center;padding:55px 22px;color:#878f9b}.empty h3{font-size:16px;color:#4b5360}.empty p{font-size:12px}.table-footer{display:flex;justify-content:space-between;padding:14px 22px;font-size:10px;color:#9aa0a9;align-items:center}.table-footer button{font-size:10px;padding:6px 11px}.notice{padding:13px 17px;background:#eff1f3;border:1px solid #e1e4e8;color:#727e91;border-radius:8px;font-size:11px;line-height:1.6;margin:15px 0}.notice.amber{background:#fff8eb;color:#9c7b47;border-color:#f0e2c6}.amount{text-align:right}.muted{color:#9197a1}.chart{padding:23px 25px}.chart-head{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#9299a3}.bars{height:125px;display:flex;gap:12px;align-items:flex-end;margin:25px 0 15px}.bar-column{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px}.bar{background:#c2c7cf;width:70%;min-height:3px;border-radius:4px 4px 0 0}.bar-column:last-child .bar{background:#38598a}.bar-column small{font-size:9px;color:#9ea4ac}.loading{padding:60px;color:#7c8491}dialog{width:min(1000px,94vw);max-height:92vh;border:1px solid #dee1e5;border-radius:17px;padding:0;color:#3a4049;box-shadow:0 25px 100px #14223633}dialog::backdrop{background:#1a1c2055;backdrop-filter:blur(3px)}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:23px 27px;border-bottom:1px solid var(--line)}.modal-head h2{font-size:20px}.modal-head small{display:block;color:#989ea7;font-size:10px;margin-top:7px}.modal-content{padding:25px 27px}.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:17px}.form-grid label,.field{display:flex;flex-direction:column;gap:7px;font-size:10px;font-weight:600;color:#7e8691}.form-grid input,.form-grid select,.field input,.field select,.field textarea{width:100%;border:1px solid #e0e3e7;border-radius:7px;background:#fff;padding:10px 11px;color:#3c424c;font-size:12px;min-width:0}.field{margin:16px 0}.field textarea{min-height:70px}.wide{grid-column:1/-1}.form-actions{display:flex;gap:10px;justify-content:flex-end;padding-top:22px;border-top:1px solid var(--line);margin-top:22px}.line-tools{display:flex;gap:10px;margin:22px 0 12px;align-items:center}.line-tools h3{margin-right:auto}.line-tools button{font-size:11px;padding:8px 10px}.edit-line{display:grid;grid-template-columns:minmax(140px,3fr) 65px 86px 62px 60px 42px 55px;gap:8px;padding:13px 0;border-bottom:1px solid var(--line);align-items:center}.edit-line input,.edit-line select,.edit-line textarea{width:100%;padding:8px 6px;border:1px solid #e1e3e7;border-radius:5px;min-width:0;background:#fff;font-size:11px;color:#49515d}.edit-line button{padding:2px 5px;font-size:11px}.line-note{grid-template-columns:1fr 55px}.line-note textarea{min-height:52px}.line-head{font-size:9px;color:#9097a1}.line-controls{display:flex;gap:3px}.totals{margin:22px 0 5px auto;max-width:310px}.total-row{display:flex;justify-content:space-between;padding:7px 0;font-size:12px;color:#858e9b}.total-row.grand{font-size:21px;color:#1c3459;border-top:1px solid #dfe2e6;margin-top:8px;padding-top:17px}.form-error{color:#a84736;background:#fff1eb;padding:11px;font-size:12px;border-radius:7px}.form-error:empty{display:none}.doc-top{display:flex;justify-content:space-between;gap:30px;margin-bottom:23px}.doc-top h3{font-size:19px;color:#253b5c}.doc-top p{font-size:11px;color:#8c939d;white-space:pre-line}.doc-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:23px}.doc-actions button{font-size:11px}.note-row{white-space:pre-wrap;max-width:600px;color:#828994}.rules{padding:26px;line-height:1.8}.rules p,.rules li{color:#808792;font-size:12px}.rules h3{margin-top:23px}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);padding:14px 24px;border-radius:9px;color:#fff;background:#243857;box-shadow:0 6px 25px #121f3222;z-index:100;font-size:12px;max-width:80vw}#printArea{display:none}@media(max-width:1100px){main{padding:27px}.sidebar{width:205px}.shell{margin-left:205px}.topbar{padding:0 27px}.metrics{gap:10px}.metric{padding:17px}.metric strong{font-size:23px}.split{grid-template-columns:1fr}.quick-actions{gap:10px}.quick{padding:15px}}@media(max-width:740px){.sidebar{position:static;width:auto;padding:18px}.brand{padding:0 0 15px}.nav-label,.sidebar-foot{display:none}#nav{display:flex;overflow-x:auto}.nav-button{width:auto;white-space:nowrap;padding:10px}.nav-icon,.nav-count,.nav-divider{display:none}.shell{margin:0}.topbar{height:60px;padding:0 18px}.today{display:none}main{padding:22px 17px}.metrics{grid-template-columns:1fr 1fr}.page-header{align-items:flex-start}h1{font-size:26px}.page-header .primary{font-size:11px}.quick-actions{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr 1fr}.edit-lines{overflow:auto}.edit-line{min-width:660px}.modal-content{padding:17px}.toolbar{gap:8px}footer{padding:18px}.top-actions{gap:8px}}@media print{body>*{display:none!important}#printArea{display:block!important;padding:25px;color:#111;font-size:12px;background:white}#printArea h1{font-size:25px}#printArea table{white-space:normal}#printArea th,#printArea td{padding:9px;border-bottom:1px solid #ddd}#printArea .note-row{white-space:pre-wrap}#printArea .totals{break-inside:avoid}#printArea .print-meta{display:flex;justify-content:space-between;margin:20px 0}#printArea .print-label{font-size:10px;color:#666}#printArea a{color:#333}}
/* Keep navigation accessible in short windows without scrolling the content pane. */
.sidebar{height:100dvh;overflow:hidden}
.sidebar .brand,.sidebar .nav-label,.sidebar-foot{flex-shrink:0}
.sidebar #nav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#bbc1ca transparent}
.sidebar-foot{margin-top:0}
/* Personal order saves after a changed handle drag; route buttons remain navigation. */
.nav-menu-row{display:flex;align-items:center;border:2px solid transparent;border-radius:8px;margin:3px 0;min-width:0}
.nav-menu-row .nav-button{flex:1;min-width:0;width:auto;margin:0;padding:10px 8px 10px 12px}
.nav-menu-name{min-width:0;overflow-wrap:anywhere}
.nav-menu-row.active{background:#263d5c;color:#8bbcff}
.nav-menu-row.active .nav-button{background:transparent;color:inherit}
.sidebar-order-status{margin:5px 8px 10px;font-size:11px;line-height:1.5;color:var(--amber)}
.sidebar-drag-handle{flex-shrink:0;align-self:stretch;margin-left:auto;cursor:grab;touch-action:none;user-select:none;padding:5px 6px;border:0;background:transparent;font-size:19px;color:var(--muted)}
.sidebar-drag-handle:active{cursor:grabbing}
.sidebar-is-dragging,.sidebar-is-dragging *{cursor:grabbing!important;user-select:none}
.nav-menu-row.sidebar-drop-before{border-top-color:#5d83bd}
.nav-menu-row.sidebar-drop-after{border-bottom-color:#5d83bd}
@media(max-width:740px){.nav-menu-row{flex-shrink:0}.nav-menu-row .nav-button{padding:8px}.sidebar-order-status{flex-shrink:0;max-width:250px}}
.customer-picker{min-width:240px;max-width:480px;width:100%;margin:0}
.customer-info{margin-bottom:28px}
.customer-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin:0;padding:24px}
.customer-details dt{font-size:11px;color:#8a919b;margin-bottom:8px}
.customer-details dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}
.project-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:24px 0 16px}
.project-heading p{color:#818a97;font-size:12px}
.project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:20px}
.project-card h3{overflow-wrap:anywhere;line-height:1.5}
.project-body{padding:22px}
.project-description{white-space:pre-wrap;overflow-wrap:anywhere;color:#6d7684;margin-top:0}
.project-dates{display:flex;justify-content:space-between;gap:15px;background:#f5f6f7;border-radius:8px;padding:17px;margin:18px 0}
.project-dates small{display:block;font-size:9px;letter-spacing:1px;color:#8b939f;margin-bottom:8px}
.project-dates strong{font-size:13px;font-weight:600}
.form-grid textarea{font:inherit;padding:10px;border:1px solid #e0e3e7;border-radius:7px;resize:vertical}
@media(max-width:1000px){.project-grid{grid-template-columns:1fr}}
@media(max-width:740px){.sidebar{height:auto;overflow:visible}.sidebar #nav{flex:none;overflow-x:auto;overflow-y:hidden}.nav-button{flex-shrink:0}.customer-details{grid-template-columns:1fr}.project-heading{align-items:flex-start}.project-heading button{white-space:nowrap}.project-dates{flex-wrap:wrap}}
.project-name{font-size:14px;line-height:1.5;text-decoration:underline;text-decoration-color:#bbc1ca;text-underline-offset:4px}
.project-back{margin-bottom:18px}

.item-finder{margin:24px 0;padding:20px;background:#f2f5f9;border:1px solid #dadde2;border-radius:12px}.item-finder h3{margin:0 0 16px}.item-filters{display:grid;grid-template-columns:2fr 1fr;gap:16px}.item-choice{display:flex;gap:14px;align-items:end;margin-top:14px}.item-choice label{flex:1;min-width:0}.item-choice select{width:100%;text-overflow:ellipsis}.item-choice button{flex-shrink:0}.item-finder p{font-size:12px;margin:10px 0 0}@media(max-width:650px){.item-filters{grid-template-columns:1fr}.item-choice{align-items:stretch;flex-direction:column}}

.customer-documents{margin:24px 0}.customer-documents .panel-title p{font-size:13px;color:var(--muted);margin:8px 0 0}.customer-doc-filter{display:flex;align-items:end;gap:20px;padding:16px 24px}.customer-doc-filter label{min-width:230px}.customer-doc-table{max-height:460px;overflow:auto}.customer-doc-table thead th{position:sticky;top:0;background:#f8f8f9;z-index:1}@media(max-width:650px){.customer-documents .panel-title{align-items:stretch;flex-direction:column;gap:12px}.customer-doc-filter{flex-wrap:wrap}}

.pdf-preview{width:min(1100px,96vw);max-width:96vw;height:94dvh;max-height:94dvh;padding:0;background:#e8eaed}.pdf-preview-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:20px;padding:18px 24px;background:white;border-bottom:1px solid #d9dce1}.pdf-preview-header div{flex:1}.pdf-preview-header h2{margin:0}.pdf-preview-header p{font-size:12px;margin:6px 0 0}.pdf-preview-pages{padding:20px}.pdf-preview-pages figure{margin:0 auto 24px;max-width:834px}.pdf-preview-pages img{display:block;width:100%;height:auto;box-shadow:0 2px 12px #0002}.pdf-preview-pages figcaption{text-align:center;margin:0 0 10px;font-size:12px}@media(max-width:650px){.pdf-preview-header{flex-wrap:wrap;padding:12px;gap:10px}.pdf-preview-header div{flex-basis:100%}.pdf-preview-pages{padding:10px}}


/* =========================================================
   DARK THEME
   Keeps the existing green branding while switching the UI
   to a dark, low-glare color palette.
   ========================================================= */

:root{
  color-scheme:dark;
  --ink:#dfe2e6;
  --green:#3563a8;
  --muted:#8f98a5;
  --line:#2c3036;
  --soft:#1f2125;
  --amber:#d29a4d;
  background:#121417;
  color:#dfe2e6;
}

body{
  background:#121417;
  color:#dfe2e6;
}

button{
  background:#1e2125;
  border-color:#363c45;
  color:#dfe2e6;
}

button:hover{
  background:#282c31;
  border-color:#474f5b;
}

button:disabled{
  opacity:.45;
}

a,
.text-button{
  color:#3563a8;
}

.primary{
  background:#23487f;
  border-color:#23487f;
  color:#fff;
}

.primary:hover{
  background:#2d5899;
  color:#fff;
}

.sidebar{
  background:#17191d;
  border-right-color:#2c3036;
}

.brand{
  color:#dfe2e6;
}

.brand small{
  color:#818996;
}

.brand-mark{
  background:#0d1f3b;
  color:#9db4d7;
}

.nav-label{
  color:#707884;
}

.nav-button{
  color:#8f97a3;
}

.nav-button:hover{
  background:#202328;
}

.nav-button.active{
  background:#17253b;
  color:#436fb2;
}

.nav-count{
  background:#23262a;
  color:#9aa2ad;
}

.nav-divider{
  background:#2c3036;
}

.sidebar-foot{
  color:#9aa2ad;
}

.sidebar-foot small{
  color:#707884;
}

.status-dot{
  background:#5d83bd;
}

.topbar{
  background:#17191ddd;
  border-bottom-color:#2c3036;
  backdrop-filter:blur(10px);
}

.breadcrumb{
  color:#78808c;
}

.slash{
  color:#454d58;
}

.topbar strong{
  color:#cdd1d7;
}

.today{
  color:#818995;
}

.avatar{
  background:#25282d;
  border-color:#17191d;
  color:#9ea6b2;
}

.icon-button{
  color:#8f98a5;
}

.icon-button:hover{
  background:#202328;
  color:#dfe2e6;
}

footer{
  color:#717985;
  border-top-color:#2c3036;
}

.eyebrow{
  color:#426dad;
}

.page-header p{
  color:#848c98;
}

.metric,
.panel,
.quick{
  background:#1a1c20;
  border-color:#2c3036;
  box-shadow:0 5px 18px #00000022;
}

.metric .label{
  color:#818995;
}

.metric strong{
  color:#e2e5e9;
}

.metric small{
  color:#818995;
}

.metric.accent{
  background:#12233d;
  color:#fff;
  border-color:#1b345a;
}

.metric.accent .label,
.metric.accent small{
  color:#a1b7d8;
}

.panel-title{
  border-bottom-color:#2c3036;
}

.panel-title small{
  color:#818995;
}

.activity{
  background:#1a1c20;
}

.activity-row{
  border-bottom-color:#292d33;
}

.activity-icon{
  background:#26292e;
  color:#668ac0;
}

.activity-row small{
  color:#818995;
}

.activity-row strong{
  color:#cdd1d8;
}

.activity-row .amount{
  color:#cdd1d8;
}

.quick{
  color:#dfe2e6;
}

.quick:hover{
  background:#202328;
}

.quick span{
  color:#6489c0;
}

.quick small{
  color:#818995;
}

.toolbar input,
.toolbar select{
  background:#17191d;
  border-color:#353b43;
  color:#cdd1d7;
}

.toolbar input::placeholder{
  color:#666e7a;
}

.segments{
  background:#23262a;
}

.segments button{
  color:#8f97a3;
}

.segments .selected{
  background:#2d3137;
  color:#dfe2e6;
  box-shadow:0 1px 5px #00000040;
}

th{
  background:#16181c;
  color:#828a96;
  border-bottom-color:#2c3036;
}

td{
  color:#9aa2ad;
  border-bottom-color:#282b30;
}

td strong{
  color:#cdd1d8;
}

td small{
  color:#717985;
}

.badge{
  background:#272a2f;
  color:#939ba7;
}

.badge.green{
  background:#17263d;
  color:#6e90c4;
}

.badge.amber{
  background:#46351f;
  color:#d6a45e;
}

.badge.red{
  background:#422925;
  color:#d88772;
}

.badge.blue{
  background:#273449;
  color:#91a8d0;
}

.empty{
  color:#808895;
}

.empty h3{
  color:#aab2bd;
}

.notice{
  background:#23262b;
  border-color:#223654;
  color:#9aa3b0;
}

.notice.amber{
  background:#382d1d;
  color:#c8a064;
  border-color:#5b4528;
}

.muted{
  color:#7f8793;
}

.chart{
  background:#1a1c20;
}

.chart-head{
  color:#808895;
}

.bar{
  background:#505966;
}

.bar-column:last-child .bar{
  background:#3b619a;
}

.bar-column small{
  color:#7d8591;
}

.loading{
  color:#818996;
}

dialog{
  background:#1a1c20;
  border-color:#363c45;
  color:#cdd1d8;
  box-shadow:0 25px 100px #00000088;
}

dialog::backdrop{
  background:#070809aa;
  backdrop-filter:blur(4px);
}

.modal-head{
  border-bottom-color:#2c3036;
}

.modal-head small{
  color:#818995;
}

.modal-content{
  background:#1a1c20;
}

.form-grid label,
.field{
  color:#8d95a1;
}

.form-grid input,
.form-grid select,
.field input,
.field select,
.field textarea,
.form-grid textarea{
  background:#141619;
  border-color:#363c45;
  color:#cdd1d8;
}

.form-grid input::placeholder,
.field input::placeholder,
.field textarea::placeholder{
  color:#646c78;
}

.form-grid input:focus,
.form-grid select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:#3c639e;
  box-shadow:0 0 0 2px #2b528d25;
}

.form-actions{
  border-top-color:#2c3036;
}

.line-tools{
  color:#cdd1d8;
}

.edit-line{
  border-bottom-color:#2c3036;
}

.edit-line input,
.edit-line select,
.edit-line textarea{
  background:#141619;
  border-color:#363c45;
  color:#cdd1d8;
}

.line-head{
  color:#808894;
}

.total-row{
  color:#818996;
}

.total-row.grand{
  color:#6086be;
  border-top-color:#363c45;
}

.form-error{
  color:#e39a84;
  background:#3c2521;
}

.doc-top h3{
  color:#a5adb8;
}

.doc-top p{
  color:#818995;
}

.note-row{
  color:#818995;
}

.rules p,
.rules li{
  color:#818995;
}

.item-finder{
  background:#1d2024;
  border-color:#233754;
}

.item-finder h3{
  color:#cdd1d8;
}

.customer-details dt{
  color:#818995;
}

.customer-details dd{
  color:#cdd1d8;
}

.project-heading p{
  color:#818995;
}

.project-description{
  color:#828a97;
}

.project-dates{
  background:#212429;
}

.project-dates small{
  color:#818996;
}

.project-dates strong{
  color:#cdd1d8;
}

.project-name{
  text-decoration-color:#4c5460;
}

.customer-doc-filter label{
  color:#8d95a1;
}

.customer-doc-table thead th{
  background:#16181c;
}

.pdf-preview{
  background:#121315;
}

.pdf-preview-header{
  background:#1a1c20;
  border-bottom-color:#2c3036;
}

.pdf-preview-header p{
  color:#818995;
}

.pdf-preview-pages figcaption{
  color:#9aa2ad;
}

#toast{
  background:#23487f;
  box-shadow:0 6px 25px #00000055;
}

/* Scrollbars */
*{
  scrollbar-width:thin;
  scrollbar-color:#3e444e #16181b;
}

*::-webkit-scrollbar{
  width:9px;
  height:9px;
}

*::-webkit-scrollbar-track{
  background:#16181b;
}

*::-webkit-scrollbar-thumb{
  background:#3e444e;
  border-radius:8px;
  border:2px solid #16181b;
}

*::-webkit-scrollbar-thumb:hover{
  background:#4e5764;
}

/* Keep native controls dark where supported */
input,
select,
textarea,
button{
  color-scheme:dark;
}

.login-panel{max-width:520px;margin:70px auto;padding:36px;}
.login-panel form{display:grid;gap:20px;}
#sessionControls{font-size:13px;}
#sessionControls[hidden]{display:none;}
#sessionControls button{padding:6px 10px;font-size:12px;}
#optionsForm textarea{width:100%;}
@media(max-width:800px){.login-panel{margin:20px auto;padding:24px;}.top-actions{flex-wrap:wrap;}#sessionUser{display:none;}}
/* Print must remain white */
@media print{
  body{
    background:white;
    color:#111;
  }

  #printArea{
    background:white;
    color:#111;
  }
}
.note-editor{min-width:0;}
.note-image-tools{display:flex;align-items:center;gap:12px;margin:10px 0;}
.note-image-tools small{color:var(--muted);font-size:11px;}
.note-image-board{position:relative;width:100%;max-width:600px;white-space:normal;overflow:hidden;}
.note-image-board.editable{border:1px dashed var(--line);border-radius:8px;background:rgba(127,127,127,.05);}
.note-image{position:absolute;}
.note-image img{display:block;width:100%;height:100%;object-fit:contain;}
.editable .note-image{cursor:move;touch-action:none;outline:1px solid var(--green);}
.note-image .image-remove{position:absolute;top:0;right:0;background:rgba(0,0,0,.75);color:white;z-index:1;width:22px;height:22px;border:0;border-radius:3px;font-weight:700;}
.image-resize{position:absolute;right:0;bottom:0;width:18px;height:18px;background:var(--green);border:2px solid white;cursor:nwse-resize;touch-action:none;}
.note-row .note-image-board{margin:10px 0;}
@media(max-width:740px){.line-note{min-width:0;}.note-image-tools{flex-wrap:wrap;}}
.rich-note,.rich-note-view{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;max-width:600px;width:100%;}
.rich-note{border:1px solid var(--line);border-radius:7px;padding:12px;min-height:110px;max-width:none;background:var(--bg);font-size:12px;outline:none;}
.rich-note:focus{border-color:var(--green);box-shadow:0 0 0 2px rgba(45,154,132,.15);}
.rich-note:empty:before{content:'Type text or paste an image here…';color:#8a8f96;pointer-events:none;}
.inline-note-image{display:inline-block;position:relative;vertical-align:top;margin:4px;max-width:100%;white-space:normal;}
.inline-note-image img{display:block;width:100%;height:100%;object-fit:contain;}
.rich-note .inline-note-image{outline:1px solid var(--green);cursor:grab;}
.inline-image-remove{position:absolute;right:0;top:0;width:22px;height:22px;border:0;background:rgba(0,0,0,.75);color:white;border-radius:3px;z-index:1;}
.inline-image-resize{position:absolute;bottom:0;right:0;width:18px;height:18px;background:var(--green);border:2px solid white;cursor:nwse-resize;touch-action:none;}

.inline-note-image.wide-image{display:block;}

.note-format-tools{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0;align-items:center}.note-format-tools button{padding:5px 8px;font-size:11px}.note-format-tools label{display:flex;align-items:center;gap:5px;font-size:11px}.note-format-tools select{width:auto;padding:5px;min-height:28px}.note-format-tools input[type=color]{width:34px;height:28px;padding:2px}

/* Editor height is a workspace convenience, never part of a saved document. */
.rich-note{resize:vertical;overflow:auto;height:220px;position:relative;min-height:110px;}
.rich-note-view{position:relative;}
.inline-note-image.floating-image{position:absolute;z-index:2;margin:0;touch-action:none;display:block;cursor:move;}
.note-format-tools{position:sticky;top:0;z-index:5;background:var(--panel,var(--bg));border-bottom:1px solid var(--line);margin-bottom:10px;}

/* PDF note: A4 width minus 60pt page margins, 12pt frame inset and 8pt padding.
   Keep 515.276pt of text at 96 CSS pixels/inch, even on narrow screens. */
.note-editor{overflow-x:auto;padding:2px;}
.rich-note,.rich-note-view{box-sizing:content-box;width:515.276pt;max-width:none;padding:4pt;font-family:Tahoma,Arial,sans-serif;font-size:8pt;line-height:11pt;color:#000;background:#dfdfdf;white-space:pre-wrap;overflow-wrap:break-word;}
.rich-note{border-radius:0;height:220px;resize:vertical;overflow:auto;background:var(--bg);color:var(--ink);}
.rich-note:empty:before{color:var(--muted);}
.receipt-logo{display:block;width:175px;height:auto;margin-bottom:20px}
.receipt-amounts{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:24px 0;break-inside:avoid}
.receipt-amounts section{padding:16px;border:1px solid var(--line);border-radius:8px}
.receipt-amounts strong{display:block;font-size:24px;margin-top:12px;color:var(--green)}
.receipt-summary{margin:20px 0;break-inside:avoid}
.receipt-proof{margin:24px 0;break-inside:avoid}
.receipt-proof figcaption{font-size:12px;margin-bottom:12px}
.receipt-proof img{display:block;max-width:100%;max-height:440px;object-fit:contain}
.receipt-upload{margin:20px 0}
@media print{.receipt-amounts{grid-template-columns:1fr 1fr}.receipt-amounts strong,.receipt-summary{color:#111}.receipt-proof img{max-height:110mm}#printArea .notice{background:white;color:#111;border:1px solid #bbb}}

/* Grey and blue workspace palette. */
:root{--bg:#17191d;--panel:#202329;--ink:#e3e7ee;--green:#68a6ff;--muted:#a3acba;--line:#353b45;--soft:#292e36;background:#17191d;color:#e3e7ee}
body{background:#17191d;color:#e3e7ee}
.sidebar{background:#1d2026;border-color:#353b45}
.topbar{background:#202329;border-color:#353b45}
.panel,.metric,.quick,dialog{background:#202329;border-color:#353b45}
.nav-button.active{background:#263d5c;color:#8bbcff}
.primary{background:#2864b9;border-color:#397bd5;color:#fff}
.primary:hover{background:#3276d0;border-color:#5598f2;color:#fff}
.metric.accent{background:#223d61;color:#fff}
.metric.accent .label,.metric.accent small{color:#c0d4f0}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #8bbcff;outline-offset:3px}
.status-dot{background:#68a6ff}
@media print{body{background:white;color:#111}#printArea{background:white;color:#111}.receipt-amounts strong{color:#111}}

.editor-choice-controls{display:grid;gap:8px;margin-top:8px}
.choice-pages{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.choice-pages button{padding:5px 10px}
.choice-pages small{flex:1;min-width:140px}

/* Native customer disclosures retain full scrollable project/document lists. */
.customer-section>summary{padding:18px 24px;cursor:pointer;font-size:18px;font-weight:600;color:var(--ink)}
.customer-section>summary:focus-visible{outline:2px solid var(--green);outline-offset:-4px}
.customer-section>summary::marker{color:var(--green)}
.customer-section[open]>summary{border-bottom:1px solid var(--line)}
.customer-section-body{padding:22px 24px}
.customer-section .project-heading{margin:0 0 16px}
.customer-section .project-heading p{margin:0}
.customer-section .project-grid{margin-top:20px}
/* Native report disclosures keep tables scrollable and keyboard accessible. */
.report-section{margin-bottom:20px}
.report-section>summary{padding:18px 22px;cursor:pointer;font-size:18px;font-weight:600;color:var(--ink)}
.report-section>summary:focus-visible{outline:2px solid var(--green);outline-offset:-4px}
.report-section>summary::marker{color:var(--green)}
.report-section-note{padding:0 22px 16px;margin:0}
.report-section>.panel{border:0;margin:0;border-radius:0}

.expense-proof{max-width:100%;max-height:600px;object-fit:contain}

.access-editor {margin:1.5rem 0;padding-top:1rem;border-top:1px solid var(--line)}
.access-area {margin:0.6rem 0;padding:0.8rem;border:1px solid var(--line);border-radius:8px}
.access-area summary {cursor:pointer;font-weight:600;margin-bottom:0.6rem}
.access-actions {display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:0.5rem;margin-top:0.7rem}
.access-choice {display:flex;align-items:center;gap:0.6rem;padding:0.5rem}
.access-choice input {width:auto;min-width:16px}
.access-choice span {flex:1}
.access-choice small {display:block;opacity:0.7}
.access-choice button {font-size:0.75rem;padding:0.4rem}

.access-area > label {display:flex;align-items:center;gap:0.8rem}
.access-area select {padding:0.5rem;border:1px solid var(--line);border-radius:6px;background:var(--soft);color:inherit}

.purchase-scope{font-size:11px;margin:-12px 0 22px}
.purchase-list-actions{display:flex;gap:8px;align-items:center}
.purchase-filters{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:12px;margin-bottom:22px}
.purchase-filters label{display:grid;gap:6px;font-size:11px;color:var(--muted)}
.purchase-filters input,.purchase-filters select{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--ink);color-scheme:dark}
.purchase-table th,.purchase-table td{padding:14px 15px}
.purchase-table th:nth-child(n+6):nth-child(-n+9),.purchase-table td.purchase-centered{text-align:center}
.purchase-sales-reference{min-width:140px}
.linked-purchases{margin-top:24px;padding:18px}
.linked-purchases h3{margin-bottom:12px}
.linked-purchase-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0}
.linked-purchase-metric{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--soft)}
.linked-purchase-metric span,.linked-purchase-metric small{display:block;font-size:10px;color:var(--muted)}
.linked-purchase-metric strong{display:block;font-size:20px;margin:8px 0}
.linked-purchase-scope{font-size:11px}
.linked-purchase-heading,.linked-purchase-actions{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.linked-purchase-heading h3{margin:0}
.linked-purchase-options{display:flex;gap:14px;align-items:flex-start;flex-wrap:wrap;margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:8px}
.linked-purchase-choice{flex:1;min-width:190px}
.linked-purchase-choice p{font-size:11px;margin-bottom:0}
.linked-purchase-picker{margin:14px 0;padding:14px;background:var(--soft);border:1px solid var(--line);border-radius:8px}
.linked-purchase-picker h4{margin-top:0}
.linked-purchase-picker-tools{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.linked-purchase-picker-tools label{flex:1;min-width:220px}
.linked-purchase-picker-tools button{margin-bottom:10px}
.linked-purchase-margin{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;padding:12px;border:1px solid var(--line);border-radius:8px}
.linked-purchase-margin strong{font-size:20px}
.linked-purchase-margin small{flex-basis:100%;color:var(--muted)}
.linked-purchase-margin-note{font-size:11px}
.linked-purchase-table th:nth-child(n+4),.linked-purchase-table td:nth-child(n+4){text-align:center}
.linked-purchase-table td:nth-child(3){white-space:normal;min-width:150px;max-width:230px}
@media(max-width:650px){.linked-purchase-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.linked-purchases{padding:12px}}
.purchase-purpose{white-space:normal;min-width:140px;max-width:260px}
.modal-heading{display:flex;align-items:center;gap:18px;min-width:0}
.modal-heading>div{min-width:0}
.modal-head-actions{display:flex;align-items:center;gap:10px;flex-shrink:0;margin-left:20px}
.modal-head-actions>button:not(.icon-button){font-size:12px;white-space:nowrap}
.modal-back{white-space:nowrap;padding:7px 10px;font-size:12px}
.modal-back[hidden]{display:none}
.modal-stale-notice{padding:12px 15px;background:#fff8eb;border:1px solid #f0e2c6;border-radius:8px;color:#9c7b47;font-size:12px}
@media(max-width:600px){.modal-heading{gap:10px}.modal-back{padding:6px 8px}.modal-head h2{font-size:17px}.modal-head.has-actions{flex-wrap:wrap;gap:12px}.modal-head.has-actions .modal-head-actions{margin-left:auto}}
.purchase-overdue{color:#e69b88}
.purchase-review-items{margin:0;padding-left:16px;min-width:190px;font-size:11px;line-height:1.6}
.purchase-review-items li+li{margin-top:5px}
.purchase-review-related{display:block;color:var(--muted);font-size:10px}
.purchase-review-related .text-button{padding:0;font-size:inherit}
.purchase-review-notice{font-size:12px;line-height:1.6}
.purchase-fields,.purchase-summary{border:1px solid var(--line);border-radius:10px;padding:16px;margin:16px 0}
.purchase-fields [hidden],.purchase-header-grid [hidden]{display:none!important}
.note-format-tools[hidden]{display:none!important}
.purchase-header-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.purchase-evidence{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin:12px 0}
.purchase-evidence figure{margin:0;border:1px solid var(--line);border-radius:8px;padding:8px}
.purchase-evidence img{width:100%;height:140px;object-fit:contain;background:var(--soft)}
.purchase-evidence figcaption{font-size:11px;overflow-wrap:anywhere;margin:6px 0}
.purchase-line-stock{display:block;font-size:10px;margin-top:6px}
.purchase-line-stock select{max-width:100%;font-size:11px;padding:5px}
.purchase-cost-line input{min-width:0}
@media(max-width:1100px){.purchase-filters{grid-template-columns:repeat(2,minmax(150px,1fr))}.purchase-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.purchase-filters,.purchase-metrics,.purchase-header-grid{grid-template-columns:1fr}.purchase-list-actions{flex-wrap:wrap}.purchase-metrics .metric{min-height:100px}}

/* Separate staff workspace and permission-scoped profile sections. */
.staff-filters label,.staff-profile-controls>label{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#7e8691}
.staff-filters .search{align-self:flex-end}
.staff-filters input[type="month"],.staff-profile-controls input[type="month"]{border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:var(--soft);color:var(--ink);color-scheme:dark}
.staff-form input[type="time"]{background:var(--soft);color:var(--ink);color-scheme:dark}
.staff-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.staff-metrics .metric{min-height:110px;padding:16px}
.staff-metrics .metric strong{font-size:24px;margin:12px 0 7px}
.staff-number{text-align:center;white-space:nowrap}
.staff-profile-head,.staff-profile-controls{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:22px}
.staff-profile-head p{margin:6px 0;color:var(--muted)}
.staff-tabs{flex-wrap:wrap}
.staff-facts{display:grid;grid-template-columns:repeat(2,1fr);gap:22px;margin:22px 0}
.staff-facts small,.staff-facts strong{display:block;overflow-wrap:anywhere}
.staff-facts small{color:var(--muted);font-size:11px;margin-bottom:6px}
.staff-facts strong{font-size:13px;font-weight:500}
.staff-notes{white-space:pre-wrap;overflow-wrap:anywhere}
.staff-description{white-space:normal;min-width:180px;max-width:350px}
.staff-form textarea{width:100%;border:1px solid #e0e3e7;border-radius:7px;padding:10px 11px;font-size:12px;resize:vertical}
.staff-form small{font-size:10px;font-weight:400;line-height:1.4}
.staff-code{display:flex;flex-direction:column;gap:8px;justify-content:center}.staff-code strong{font-size:12px;font-weight:500;color:var(--ink)}
.staff-form input[readonly]{background:var(--soft);color:var(--muted)}
.staff-form fieldset{margin:6px 0;padding:16px;border:1px solid var(--line);border-radius:9px;min-width:0}.staff-form legend{padding:0 6px;font-size:13px;font-weight:600;color:var(--ink)}
.staff-form .staff-check{display:flex;flex-direction:row;align-items:center;gap:8px;font-size:12px;color:var(--ink)}.staff-form .staff-check input{width:auto}
.staff-initial-salary-fields[hidden]{display:none}.staff-initial-salary-fields{margin-top:15px}
.staff-schedule-row{display:grid;grid-template-columns:125px minmax(95px,1fr) minmax(95px,1fr) minmax(110px,1.2fr) minmax(95px,1fr);gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}.staff-schedule-row:last-child{border-bottom:0}.staff-schedule-row input:disabled,.staff-schedule-row select:disabled{opacity:.45}
.staff-target-field{margin-top:18px;max-width:360px}.staff-target-field label{margin-bottom:8px}.staff-target-field small{display:block;line-height:1.5;color:var(--muted)}
.staff-saturday-options{margin-top:16px;padding:14px;background:var(--soft);border:1px solid var(--line);border-radius:8px}.staff-saturday-options>label{max-width:360px}.staff-saturday-options .form-grid{margin-top:14px}.staff-saturday-options[hidden],#staffSaturdayRotation[hidden]{display:none!important}.staff-saturday-preview{display:flex;flex-wrap:wrap;gap:8px 20px;padding:12px 14px;background:var(--soft);border:1px solid var(--line);border-radius:8px;font-size:12px}.staff-saturday-preview span{color:var(--muted)}.staff-removal-confirm{display:flex;align-items:center;gap:10px;margin:20px 0;font-size:13px}.staff-removal-confirm input{width:auto}
.staff-salary-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px;background:var(--soft);border:1px solid var(--line);border-radius:10px;margin:22px 0}.staff-salary-card small{font-size:11px;color:var(--muted)}.staff-salary-card h3{font-size:20px;margin:8px 0}.staff-salary-card p{font-size:11px;line-height:1.6;color:var(--muted);margin:8px 0 0}.staff-salary-card button{white-space:nowrap}.staff-weekly-view{margin-bottom:25px}.staff-salary-label{color:var(--ink)}
.staff-metrics-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 12px}.staff-metrics-heading small,.staff-metrics-heading p{font-size:11px;color:var(--muted)}.staff-metrics-heading p{margin:6px 0 0;line-height:1.5}.staff-salary-totals{margin-bottom:22px;padding:0 18px}.staff-salary-totals .staff-metrics-heading{margin-top:16px}.staff-salary-total-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.staff-salary-total{padding:8px 16px 4px;border-right:1px solid var(--line)}.staff-salary-total:first-child{padding-left:0}.staff-salary-total:last-child{border:0}.staff-salary-total>small{font-size:11px;color:var(--muted)}.staff-salary-total strong{display:block;font-size:23px;font-weight:550;margin:9px 0;overflow-wrap:anywhere;color:var(--ink)}.staff-salary-total strong span{font-size:12px;font-weight:400;white-space:nowrap}.staff-salary-total p,.staff-salary-total-note{font-size:11px;color:var(--muted);line-height:1.5}.staff-salary-total p{margin:5px 0}.staff-salary-total-note{padding-top:10px;border-top:1px solid var(--line);margin:12px 0 14px}
.staff-cost-estimate{padding:16px 18px;margin:-10px 0 22px}.staff-cost-estimate .staff-metrics-heading{margin:0 0 12px}.staff-cost-estimate-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.staff-cost-estimate-grid small,.staff-cost-estimate>small,.staff-cost-estimate>p{font-size:11px;color:var(--muted);line-height:1.5}.staff-cost-estimate-grid strong{display:block;font-size:22px;margin-top:7px;overflow-wrap:anywhere}.staff-cost-estimate>p{margin:14px 0 5px}
@media(max-width:900px){.staff-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.staff-profile-controls{flex-direction:column;align-items:stretch}.staff-facts{grid-template-columns:1fr}.staff-filters label{flex:1}.staff-form{grid-template-columns:1fr}}
@media(max-width:600px){.staff-metrics{grid-template-columns:1fr}}
@media(max-width:700px){.staff-schedule-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.staff-schedule-row .staff-check{grid-column:1/-1}.staff-salary-card{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.staff-salary-total-grid,.staff-cost-estimate-grid{grid-template-columns:1fr}.staff-salary-total{padding:10px 0;border-right:0;border-bottom:1px solid var(--line)}.staff-metrics-heading{align-items:flex-start;flex-direction:column}}

/* Personal sidebar layout. The topbar button stays reachable in both modes. */
.topbar-heading{display:flex;align-items:center;min-width:0}
.sidebar-toggle{width:36px;height:36px;display:grid;place-items:center;flex-shrink:0;padding:7px;margin-right:10px;border:1px solid var(--line);border-radius:8px}
.sidebar-toggle[hidden]{display:none}
.sidebar-toggle-arrow{transform-origin:11.25px 10px}
.sidebar-collapsed .sidebar-toggle-arrow{transform:scaleX(-1)}
@media(min-width:741px){
 .sidebar-collapsed .sidebar{width:72px;padding:24px 8px}
 .sidebar-collapsed .shell{margin-left:72px}
 .sidebar-collapsed .brand{justify-content:center;padding:0 0 20px}
 .sidebar-collapsed .brand-mark{flex-shrink:0}
 .sidebar-collapsed .brand>span:last-child,.sidebar-collapsed .nav-label,.sidebar-collapsed .sidebar-foot,.sidebar-collapsed .nav-menu-name,.sidebar-collapsed .nav-count,.sidebar-collapsed .sidebar-drag-handle,.sidebar-collapsed .sidebar-order-status{display:none}
 .sidebar-collapsed .nav-menu-row .nav-button{justify-content:center;padding:11px 8px;gap:0;min-height:46px}
 .sidebar-collapsed .nav-icon{flex-shrink:0;width:23px}
 .sidebar-collapsed .nav-divider{margin:12px 8px}
}
@media(max-width:740px){
 .sidebar-collapsed .sidebar{display:none}
 .sidebar-toggle{margin-right:8px}
 .topbar-heading .breadcrumb,.topbar-heading .slash{display:none}
}

/* Distinct workspace selection shares the login and session controls. */
.workspace-switch{display:flex;flex-direction:column;gap:3px;font-size:10px;letter-spacing:.05em;color:var(--muted,#65778b);margin-right:12px}
.workspace-switch[hidden]{display:none}
.workspace-switch select{width:auto;max-width:280px;min-height:34px;padding:5px 28px 5px 10px;border:1px solid var(--line,#d7e1eb);border-radius:8px;font-size:13px;font-weight:650;letter-spacing:0;background:var(--bg,#fff);color:var(--ink,#19324a)}
.workspace-switch select:disabled{opacity:1;color:var(--ink,#19324a);cursor:default}
body[data-workspace="projects"] .sidebar .nav-label{color:#94d1c8}
@media(max-width:1100px){.topbar-heading{flex-wrap:wrap;gap:8px}.workspace-switch{margin-right:0}.workspace-switch select{max-width:230px}.topbar-heading .breadcrumb,.topbar-heading .slash{display:none}}
@media(max-width:700px){.topbar{flex-wrap:wrap;height:auto;gap:12px;padding:12px 16px}.topbar-heading{width:100%}.top-actions{flex-wrap:wrap;gap:8px}.workspace-switch select{max-width:min(280px,calc(100vw - 100px))}}

/* Search is a read-only popup and shares the existing theme controls. */
#globalSearchForm .global-search-toolbar{display:grid;grid-template-columns:minmax(200px,1fr) minmax(170px,240px) auto;align-items:end;gap:12px;margin-bottom:16px}
#globalSearchForm label{display:flex;flex-direction:column;gap:6px;margin:0;min-width:0}
#globalSearchForm input,#globalSearchForm select{width:100%;min-height:42px}
#globalSearchForm button{height:42px;align-self:end}
#globalSearchResults .panel{padding:18px;margin-top:12px}
#globalSearchResults h3{margin:0 0 12px}
#globalSearchButton{white-space:nowrap}
@media(max-width:700px){#globalSearchForm .global-search-toolbar{grid-template-columns:1fr}#globalSearchForm button{width:100%}}

.stock-count-sheet input[type="number"]{min-width:8rem;max-width:12rem}
.stock-count-sheet td:first-child{min-width:15rem}

.stock-scan{padding:14px;border:1px solid var(--line);border-radius:10px;margin:16px 0}
.stock-scan summary{cursor:pointer;font-weight:600}
.stock-scan-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;gap:12px;align-items:end;margin:12px 0}
.stock-scan canvas{max-width:100%;max-height:240px;object-fit:contain;border-radius:8px}
.stock-scan [data-scan="matches"]{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.stock-scan [data-scan="matches"] p{flex-basis:100%}
.stock-scan input,.stock-scan textarea,.stock-scan select{width:100%;min-width:0}
@media(max-width:700px){.stock-scan-controls{grid-template-columns:1fr}.stock-scan-controls button{width:100%}}
