:root{
  --bg:#f6f7f9;
  --panel:#ffffff;
  --panel-soft:#fbfcfd;
  --ink:#101828;
  --ink-2:#344054;
  --muted:#475467;
  --muted-2:#667085;
  --placeholder:#98a2b3;
  --line:#dfe3e8;
  --line-soft:#eceff3;
  --accent:#0a8f6a;
  --accent-hover:#087b5c;
  --accent-soft:#e8f5f0;
  --blue:#175cd3;
  --blue-soft:#eff4ff;
  --amber:#a15c00;
  --amber-bg:#fff4e5;
  --red:#b42318;
  --red-bg:#fef3f2;
  --shadow-sm:0 1px 2px rgba(16,24,40,.04);
  --shadow-md:0 8px 24px rgba(16,24,40,.08);
  --radius:7px;
  --radius-sm:5px;
  --ease:150ms cubic-bezier(.2,.7,.2,1);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:13px;line-height:1.45;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,select{font:inherit;color:inherit}
button{user-select:none}

/* top application bar */
.topbar{height:60px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px;position:fixed;left:0;right:0;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:10px}
.brandmark{width:30px;height:30px;border-radius:7px;background:#111827;color:#fff;display:grid;place-items:center;font-weight:800;font-size:11px;letter-spacing:.02em}
.brandname{font-size:14px;font-weight:720;letter-spacing:-.01em;color:var(--ink)}
.brandsub{font-size:10px;color:var(--muted-2);margin-top:0}
.top-actions{display:flex;align-items:center;gap:10px}
.search-shell{width:228px;height:36px;border:1px solid var(--line);border-radius:6px;background:#fff;display:flex;align-items:center;padding:0 10px;gap:7px;transition:border-color var(--ease),box-shadow var(--ease),background var(--ease)}
.search-shell:hover{border-color:#c9d0d8}
.search-shell:focus-within{border-color:#84adff;box-shadow:0 0 0 3px rgba(23,92,211,.08)}
.search-shell input{border:0;outline:0;min-width:0;flex:1;color:var(--ink);background:transparent;font-size:12px}
.search-shell input::placeholder{color:var(--placeholder)}
.search-shell kbd{font-size:9px;color:var(--muted-2);font-weight:600}
.avatar{width:30px;height:30px;border-radius:50%;background:#182230;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:750}
.admin{font-weight:650;color:var(--ink-2);font-size:12px}

/* restrained navigation */
.sidebar{position:fixed;top:60px;bottom:0;left:0;width:212px;background:#fff;border-right:1px solid var(--line);padding:18px 10px 16px;display:flex;flex-direction:column;z-index:10}
.sidebar nav{display:flex;flex-direction:column;gap:3px}
.nav-item{height:38px;border:0;background:transparent;border-radius:6px;padding:0 11px;display:flex;align-items:center;gap:10px;color:var(--ink-2);text-align:left;cursor:pointer;transition:background var(--ease),color var(--ease),transform 80ms ease}
.nav-item:hover{background:#f3f5f7;color:var(--ink)}
.nav-item:active{transform:translateY(1px)}
.nav-item.active{background:#edf7f3;color:#087356;font-weight:700}
.nav-icon{width:16px;text-align:center;color:var(--muted-2);font-size:12px}
.nav-item.active .nav-icon{color:#087356}
.db-card{margin-top:auto;border-top:1px solid var(--line);padding:13px 8px 0;background:transparent}
.tiny-label{font-size:10px;color:var(--muted-2);font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.db-live{font-size:11px;color:#087356;font-weight:700;margin-top:5px}
.db-live i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#12a475;margin-right:5px}
.tiny-muted{font-size:10px;color:var(--muted-2);margin-top:2px}

main{margin-left:212px;padding:86px 26px 28px;min-height:100vh}
.page{max-width:1360px;margin:auto;animation:pageIn 150ms ease-out}
@keyframes pageIn{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:none}}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px}
.page-title{font-size:23px;line-height:1.2;font-weight:760;letter-spacing:-.025em;color:var(--ink)}
.page-sub{color:var(--muted);margin-top:4px;font-size:12px;font-weight:450}
.actions{display:flex;gap:7px;align-items:center}

/* controls */
.btn{border:1px solid #cfd5dd;height:36px;padding:0 13px;border-radius:6px;background:#fff;color:var(--ink-2);font-weight:650;font-size:12px;cursor:pointer;transition:background var(--ease),border-color var(--ease),box-shadow var(--ease),transform 80ms ease}
.btn:hover{background:#f8f9fb;border-color:#b9c1cb;box-shadow:var(--shadow-sm)}
.btn:active{transform:translateY(1px)}
.btn.primary{background:#182230;color:#fff;border-color:#182230}
.btn.primary:hover{background:#101828;border-color:#101828}
.btn.danger{color:var(--red);border-color:#f4c7c3;background:#fff}
.btn.small{height:31px;padding:0 10px;font-size:11px}
.btn.ghost{border-color:transparent;background:transparent;color:#087356}
.icon-btn{width:30px;height:30px;border:0;border-radius:5px;background:transparent;color:var(--muted);cursor:pointer;transition:background var(--ease),color var(--ease)}
.icon-btn:hover{background:#f1f3f5;color:var(--ink)}
.field,.select{width:100%;height:36px;border:1px solid #d3d9e1;border-radius:6px;background:#fff;padding:0 10px;color:var(--ink);outline:0;transition:border-color var(--ease),box-shadow var(--ease),background var(--ease)}
.field:hover,.select:hover{border-color:#bdc5cf}
.field:focus,.select:focus{border-color:#84adff;box-shadow:0 0 0 3px rgba(23,92,211,.08)}
.field::placeholder{color:var(--placeholder)}

/* content surfaces */
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.metric{background:#fff;border:1px solid var(--line);border-radius:7px;padding:15px 16px;min-height:90px;box-shadow:var(--shadow-sm)}
.metric-label{color:var(--muted);font-size:11px;font-weight:600}
.metric-value{font-size:25px;font-weight:760;margin-top:4px;letter-spacing:-.025em;color:var(--ink)}
.metric-foot{font-size:10px;color:var(--muted-2);margin-top:2px}
.panel{background:#fff;border:1px solid var(--line);border-radius:7px;box-shadow:var(--shadow-sm)}
.panel-head{min-height:50px;padding:0 14px;border-bottom:1px solid var(--line-soft);display:flex;align-items:center;justify-content:space-between}
.panel-title{font-size:13px;font-weight:720;color:var(--ink)}
.panel-body{padding:14px}
.empty{height:240px;display:grid;place-items:center;color:var(--muted-2);text-align:center}
.section-title{font-size:14px;font-weight:730;margin:16px 0 9px;color:var(--ink)}

/* list + detail page */
.split{display:grid;grid-template-columns:292px minmax(0,1fr);gap:12px}
.list-pane{background:#fff;border:1px solid var(--line);border-radius:7px;overflow:hidden;box-shadow:var(--shadow-sm)}
.list-head{padding:12px 13px;border-bottom:1px solid var(--line-soft);display:flex;align-items:center;justify-content:space-between}
.list-search{padding:9px 10px;border-bottom:1px solid var(--line-soft)}
.list-item{width:100%;border:0;background:#fff;text-align:left;padding:11px 12px;border-bottom:1px solid var(--line-soft);cursor:pointer;color:var(--ink);transition:background var(--ease),box-shadow var(--ease)}
.list-item:hover{background:#f7f9fa}
.list-item.active{background:#edf7f3;box-shadow:inset 3px 0 0 #0a8f6a}
.list-item .main{font-weight:700;color:var(--ink)}
.list-item .sub{font-size:10px;color:var(--muted);margin-top:2px}

/* dense enterprise table */
.table-wrap{overflow:auto}
.table{width:100%;border-collapse:collapse;table-layout:fixed}
.table th{height:38px;text-align:left;padding:0 11px;color:var(--ink-2);font-size:10px;letter-spacing:.015em;font-weight:750;border-bottom:1px solid #d9dee5;background:#fafbfc}
.table td{height:45px;padding:0 11px;border-bottom:1px solid var(--line-soft);vertical-align:middle;color:var(--ink-2);font-size:12px}
.table tbody tr{transition:background var(--ease)}
.table tbody tr:hover{background:#f8fafb}
.num{text-align:right;font-variant-numeric:tabular-nums}
.status{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:4px;font-size:10px;font-weight:700}
.status.green{color:#087356;background:#e7f5ef}.status.amber{color:#8a4b08;background:#fff2df}.status.red{color:#a9271d;background:#fef0ef}

.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);height:40px;align-items:flex-end}
.tab{height:40px;border:0;background:transparent;color:var(--muted);padding:0 1px 10px;font-weight:650;font-size:12px;cursor:pointer;border-bottom:2px solid transparent;transition:color var(--ease),border-color var(--ease)}
.tab:hover{color:var(--ink)}
.tab.active{color:var(--ink);border-color:#182230;font-weight:720}

/* costing */
.costing-grid{display:grid;grid-template-columns:minmax(180px,250px) 62px 86px 104px;column-gap:12px;align-items:center;justify-content:start;min-height:47px;border-bottom:1px solid var(--line-soft);padding:0 11px;color:var(--ink-2)}
.costing-grid:hover:not(.header){background:#fafbfc}
.costing-grid.header{font-size:10px;color:var(--ink-2);font-weight:750;min-height:36px;background:#fafbfc;border-bottom:1px solid #d9dee5}
.drag{display:inline-block;width:20px;color:#7a8699;cursor:grab}
.opname{font-weight:650;color:var(--ink)}
.check{appearance:none;width:18px;height:18px;border:1.5px solid #98a2b3;border-radius:4px;display:inline-grid;place-content:center;background:#fff;cursor:pointer;transition:all var(--ease);margin:0}
.check:hover{border-color:#667085}
.check:checked{background:#182230;border-color:#182230}
.check:checked:after{content:"✓";color:#fff;font-size:12px;font-weight:800;line-height:1}
.rate-input{width:72px;height:32px;border:1px solid #d3d9e1;border-radius:5px;padding:0 7px;text-align:right;color:var(--ink);outline:0;font-variant-numeric:tabular-nums;background:#fff}
.rate-input:focus{border-color:#84adff;box-shadow:0 0 0 2px rgba(23,92,211,.08)}
.rate-input:disabled{color:#8b95a5;background:#f5f6f8}
.summary-bar{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border:1px solid var(--line);border-radius:7px;background:#fff;margin-top:10px;box-shadow:var(--shadow-sm)}
.summary-group{display:flex;gap:26px}
.summary-label{font-size:10px;color:var(--muted);font-weight:600}
.summary-value{font-size:17px;font-weight:760;margin-top:1px;color:var(--ink)}
.summary-value.green{color:#087356}

/* contractor hierarchy */
.accordion{border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#fff;margin-bottom:7px}
.acc-head{height:47px;padding:0 12px;display:grid;grid-template-columns:22px minmax(180px,1fr) 120px 120px 102px 20px;align-items:center;cursor:pointer;transition:background var(--ease)}
.acc-head:hover{background:#f8fafb}
.acc-title{font-weight:700;color:var(--ink)}
.pill{display:inline-flex;height:21px;padding:0 7px;border-radius:4px;align-items:center;justify-content:center;font-size:9px;font-weight:750;width:max-content}
.pill.green{background:#e9f6f1;color:#087356}.pill.amber{background:#fff2df;color:#8a4b08}
.acc-body{border-top:1px solid var(--line-soft);padding:5px 12px 9px;background:#fbfcfd;animation:openIn 120ms ease-out}
@keyframes openIn{from{opacity:.25;transform:translateY(-1px)}to{opacity:1;transform:none}}
.contractor-row{height:39px;display:grid;grid-template-columns:minmax(180px,1fr) 112px 112px 96px;align-items:center;border-bottom:1px solid var(--line-soft);padding-left:22px;color:var(--ink-2)}
.variance.good{color:#087356;font-weight:700}.variance.bad{color:#b42318;font-weight:700}

/* modals closer to reference */
.modal-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.38);display:grid;place-items:center;z-index:100;animation:fadeIn 120ms ease-out}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal{width:min(540px,calc(100vw - 40px));background:#fff;border-radius:8px;border:1px solid #d5dae1;box-shadow:0 24px 70px rgba(16,24,40,.22);overflow:hidden;animation:modalIn 145ms cubic-bezier(.2,.8,.2,1)}
@keyframes modalIn{from{opacity:.45;transform:translateY(5px) scale(.995)}to{opacity:1;transform:none}}
.modal-head{padding:17px 20px 10px}
.modal-title{font-size:18px;font-weight:760;color:var(--ink)}
.modal-sub{color:var(--muted);font-size:11px;margin-top:3px}
.modal-body{padding:9px 20px 18px}
.modal-actions{padding:12px 20px;border-top:1px solid var(--line-soft);display:flex;justify-content:flex-end;gap:7px;background:#fafbfc}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.form-group label{display:block;font-size:10px;color:var(--ink-2);font-weight:700;margin-bottom:5px}
.form-group.full{grid-column:1/-1}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip-check{border:1px solid var(--line);border-radius:5px;padding:6px 8px;display:flex;gap:6px;align-items:center;background:#fff;cursor:pointer;color:var(--ink-2)}
.chip-check.selected{background:#edf7f3;border-color:#a9d7c8;color:#087356}
.toast{position:fixed;right:18px;bottom:18px;background:#182230;color:#fff;padding:11px 14px;border-radius:7px;box-shadow:var(--shadow-md);z-index:200;animation:toastIn 150ms ease-out;min-width:230px}
.toast strong{display:block;font-size:11px}.toast span{display:block;font-size:10px;opacity:.82;margin-top:2px}

/* control page */
.bar-row{display:grid;grid-template-columns:160px minmax(200px,1fr) 108px;align-items:center;gap:11px;margin:14px 0}
.bar-label{font-weight:650;color:var(--ink-2)}
.bar-track{height:7px;background:#e9edf1;border-radius:2px;overflow:hidden}
.bar-fill{height:100%;background:#175cd3;border-radius:2px;transition:width 500ms cubic-bezier(.2,.8,.2,1)}
.bar-value{text-align:right;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.masters-tabs{margin-bottom:12px}

@media(max-width:1100px){.grid4{grid-template-columns:repeat(2,1fr)}.split{grid-template-columns:270px 1fr}.search-shell{width:185px}}

/* V4.2 focused additions */
.alloc-row{display:grid;grid-template-columns:1fr 140px;gap:14px;align-items:center;margin-bottom:10px}
.allocation-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:12px 14px;border:1px solid var(--line);border-radius:7px;background:#fafbfc;margin-top:14px}
.allocation-warning{margin-top:9px;padding:9px 11px;border:1px solid #f4c88b;background:#fff8ed;color:#8a4b08;border-radius:6px;font-size:11px;font-weight:650}
.amber-text{color:#9a5b13!important}
.field-help{font-size:10px;color:var(--muted);margin-top:7px;line-height:1.45}
.optional{font-weight:500;color:var(--muted)}

.operations-head{gap:12px}.operations-search{width:min(420px,60%)}
.search-empty{padding:22px;text-align:center;color:var(--muted);font-size:11px;border-top:1px solid var(--line-soft)}

.matrix-note{display:flex;gap:18px;align-items:center;color:var(--muted);font-size:10px;margin:0 0 8px 2px}
.contractor-matrix-wrap{overflow:hidden}
.contractor-matrix{min-width:980px;table-layout:auto}
.contractor-matrix th,.contractor-matrix td{vertical-align:top}
.contractor-matrix th{white-space:nowrap}
.contractor-matrix .op-col{min-width:150px}.contractor-matrix .target-col{min-width:90px}.contractor-matrix .best-col{min-width:90px}
.matrix-unit{min-width:230px!important;text-align:left!important}.matrix-unit>div{font-weight:760;color:var(--ink)}.matrix-unit>span{display:block;margin-top:2px;color:var(--muted);font-weight:550;font-size:9px}
.matrix-operation{padding-top:15px!important;color:var(--ink)!important}.matrix-target,.matrix-best{padding-top:15px!important;font-variant-numeric:tabular-nums;font-weight:700;color:var(--ink)!important}
.matrix-cell{min-width:230px;padding:8px 10px!important;background:#fff}
.contractor-matrix tbody tr:hover .matrix-cell{background:#fafbfc}
.matrix-lines{display:flex;flex-direction:column;gap:6px}
.matrix-assignment{border:1px solid var(--line-soft);background:#fbfcfd;border-radius:5px;padding:7px 8px;transition:border-color var(--ease),background var(--ease)}
.matrix-assignment:hover{border-color:#cbd2da;background:#fff}
.matrix-party{font-size:10.5px;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:5px}
.matrix-inputs{display:grid;grid-template-columns:12px 62px 56px 20px;gap:5px;align-items:center;color:var(--muted);font-size:10px}
.matrix-rate,.matrix-qty{height:27px;border:1px solid #d6dce3;border-radius:4px;background:#fff;color:var(--ink);outline:0;padding:0 5px;font-size:10.5px;font-variant-numeric:tabular-nums}
.matrix-rate{width:62px;text-align:right}.matrix-qty{width:56px;text-align:right}
.matrix-rate:focus,.matrix-qty:focus{border-color:#84adff;box-shadow:0 0 0 2px rgba(23,92,211,.07)}
.matrix-remove{width:20px;height:20px;border:0;background:transparent;color:#8a94a3;border-radius:4px;cursor:pointer;font-size:15px;line-height:18px}.matrix-remove:hover{background:#fef0ef;color:#b42318}
.matrix-add{margin-top:6px;border:0;background:transparent;color:#087356;font-size:10px;font-weight:700;cursor:pointer;padding:3px 0}.matrix-add:hover{text-decoration:underline}
.matrix-cost{font-size:9px;color:var(--muted);margin-top:4px}.matrix-cost.warn{color:#9a5b13;font-weight:650}
@media(max-width:1250px){.matrix-unit{min-width:210px!important}.matrix-cell{min-width:210px}}

/* V4.3 corrections */
.operation-check-list{border:1px solid var(--line);border-radius:6px;max-height:245px;overflow:auto;background:#fff}
.operation-check-row{height:36px;display:flex;align-items:center;gap:9px;padding:0 10px;border-bottom:1px solid var(--line-soft);cursor:pointer;color:var(--ink-2);font-size:11px;font-weight:600;transition:background var(--ease)}
.operation-check-row:last-child{border-bottom:0}.operation-check-row:hover{background:#f7f9fb}
.op-list-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}.op-list-head label{margin:0!important}
.link-btn{border:0;background:transparent;color:#175cd3;font-size:10px;font-weight:700;cursor:pointer;padding:3px 6px}.link-btn:hover{text-decoration:underline}
.matrix-inputs.simple{grid-template-columns:12px 74px 22px}.matrix-inputs.simple .matrix-rate{width:74px}
.bill-inline-warning{padding:8px 10px;border:1px solid #f4c88b;background:#fff8ed;color:#8a4b08;border-radius:6px;font-size:10.5px;font-weight:650;line-height:1.45}
.bill-warning-box{margin:0 0 10px;padding:10px 12px;border:1px solid #f2c078;background:#fff8ed;color:#7a460b;border-radius:6px;font-size:10.5px;line-height:1.55}.bill-warning-box b{display:block;margin-bottom:3px;color:#7a460b}
.over-icon{color:#b26a12;font-size:11px;margin-left:4px}.over-track{background:#fff0d8}.over-fill{background:#d97706!important}.bar-row.over{background:#fffaf2;border-radius:5px;padding:5px 7px;margin-left:-7px;margin-right:-7px}
.btn.danger{color:#b42318;border-color:#f0c7c3;background:#fff}.btn.danger:hover{background:#fef3f2;border-color:#e5aaa4}

/* V4.4 consolidated report + keyboard-first bill entry */
.export-btn{border-color:#9fd6c4;color:#087356;background:#fff}.export-btn:hover{background:#edf8f4;border-color:#79c3aa}
.export-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}.export-choice{border:1px solid var(--line);background:#fff;border-radius:7px;padding:16px;text-align:left;cursor:pointer;color:var(--ink);transition:all var(--ease)}.export-choice:hover{border-color:#9ccdbd;background:#f6fbf9;transform:translateY(-1px)}.export-choice b{display:block;font-size:13px}.export-choice span{display:block;color:var(--muted);font-size:10px;margin-top:5px}
.bill-header-grid{display:grid;grid-template-columns:1.35fr .8fr .85fr 1.05fr 1fr;gap:11px;align-items:end}.bill-section-head{display:flex;justify-content:space-between;align-items:end}.radio-group{height:36px;display:flex;align-items:center;gap:18px;border:1px solid var(--line);border-radius:5px;padding:0 10px;background:#fff}.radio-group label{display:flex;align-items:center;gap:6px;color:var(--ink-2);font-size:11px;font-weight:650;cursor:pointer}.radio-group input{accent-color:#087356}
.search-combo{position:relative}.combo-menu{position:absolute;z-index:40;left:0;right:0;top:calc(100% + 4px);background:#fff;border:1px solid #cfd5dc;border-radius:6px;box-shadow:0 10px 30px rgba(16,24,40,.14);max-height:230px;overflow:auto;padding:4px}.combo-option{width:100%;height:36px;border:0;background:#fff;border-radius:4px;display:flex;align-items:center;justify-content:space-between;padding:0 9px;color:var(--ink);font-size:11px;cursor:pointer;text-align:left}.combo-option span{color:var(--muted);font-size:9px}.combo-option:hover,.combo-option.active{background:#edf7f3;color:#087356}.combo-empty{padding:12px;color:var(--muted);font-size:10px;text-align:center}
.add-row-strip{width:100%;height:34px;border:0;border-top:1px dashed #ccd3dc;background:#fafbfc;color:#344054;font-size:10.5px;font-weight:700;cursor:pointer}.add-row-strip:hover{background:#f3f6f8;color:#087356}.mini-warning{margin-top:2px;padding:6px 9px;border-radius:5px;background:#fff4e5;color:#8a4b08;font-size:10px;font-weight:700}
.report-toolbar{margin-bottom:12px}.report-kpis{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px}.warn-metric{background:#fffbf4}.danger-metric{background:#fff7f6}.status.blue{color:#175cd3;background:#eef4ff}.report-table tbody .report-row{cursor:pointer}.report-table tbody .report-row:hover{background:#f8fbfa}.detail-row td{padding:0!important;background:#fbfdfc}.detail-slot{padding:14px 16px;border-top:1px solid #b8ddcf;border-bottom:1px solid #b8ddcf}.detail-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}.operation-detail{padding:2px 0 4px}.report-table .status{white-space:nowrap}
@media(max-width:1250px){.bill-header-grid{grid-template-columns:1.2fr .8fr .8fr 1fr}.bill-header-grid .form-group:last-child{grid-column:1/-1}.report-kpis{grid-template-columns:repeat(3,1fr)}}

/* V4.5 consolidated revisions */
.native-select-hidden{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important}
.smart-select{position:relative;width:100%}.smart-select-input{padding-right:28px;background:#fff}
.smart-select:after{content:'⌄';position:absolute;right:10px;top:8px;color:var(--muted-2);font-size:13px;pointer-events:none}
.smart-select-menu{position:absolute;z-index:120;left:0;right:0;top:calc(100% + 4px);max-height:250px;overflow:auto;background:#fff;border:1px solid #cfd5dc;border-radius:6px;box-shadow:0 12px 30px rgba(16,24,40,.16);padding:4px}
.smart-option{display:block;width:100%;min-height:34px;border:0;border-radius:4px;background:#fff;text-align:left;padding:7px 9px;font-size:11px;color:var(--ink);cursor:pointer}.smart-option:hover,.smart-option.active{background:#edf7f3;color:#087356}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start}.modal-x{font-size:20px;line-height:1}
.submodal-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.28);display:grid;place-items:center;z-index:170}.submodal{width:min(430px,calc(100vw - 50px))}

/* compact contractor matrix: no best-rate/difference/qty columns */
.compact-matrix{min-width:760px}.compact-cell{padding:6px 9px!important;min-width:225px}.compact-lines{gap:4px}
.compact-assignment{display:grid;grid-template-columns:minmax(90px,1fr) 88px 24px;gap:7px;align-items:center;border:0;border-radius:0;padding:2px 0;background:transparent}
.compact-assignment:hover{background:transparent}.compact-party-label{font-size:10.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-rate-wrap{height:29px;border:1px solid #d6dce3;border-radius:5px;display:grid;grid-template-columns:18px 1fr;align-items:center;background:#fff;padding-left:5px;color:var(--muted)}
.compact-rate-wrap.rate-over{border-color:#e4b46f;background:#fff9ef}.compact-rate{border:0!important;box-shadow:none!important;width:100%!important;height:27px!important;padding:0 6px!important;text-align:right;background:transparent!important}
.compact-assignment .matrix-remove{margin-left:auto}.compact-cell .matrix-add{margin-top:4px}

/* job-work package builder */
.pkg-ops{border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#fff;max-height:330px;overflow-y:auto}.pkg-op-head,.pkg-op-row{display:grid;grid-template-columns:52px 1fr 140px;gap:10px;align-items:center;padding:0 10px}.pkg-op-head{height:32px;background:#f8fafb;border-bottom:1px solid var(--line);font-size:10px;color:var(--muted);font-weight:700}.pkg-op-row{min-height:43px;border-bottom:1px solid var(--line-soft)}.pkg-op-row:last-child{border-bottom:0}.pkg-op-name{font-weight:650;color:var(--ink-2)}.pkg-op-row .field{height:30px;text-align:right}.pkg-calc{border-top:1px solid var(--line);padding-top:10px}.pkg-calc-row{min-height:42px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line-soft);font-size:11px}.pkg-calc-row.margin label{margin:0;font-size:11px}.money-input{display:grid;grid-template-columns:18px 110px;align-items:center;color:var(--muted)}.money-input .field{height:32px;text-align:right}.package-rate-card{margin-top:11px;padding:13px 14px;border:1px solid #9fd6c4;background:#f4fbf8;border-radius:7px}.package-rate-value{font-size:23px;font-weight:800;color:#087356;margin:2px 0}.copy-checks,.radio-stack{display:flex;flex-direction:column;gap:8px;padding:9px 11px;border:1px solid var(--line);border-radius:6px;background:#fafbfc}.copy-checks label,.radio-stack label{display:flex!important;align-items:center;gap:8px;margin:0!important;font-size:11px!important}.copy-checks input,.radio-stack input{accent-color:#087356}

/* bill adjustment + history */
.adjustment-row{background:#fffaf2!important}.adjustment-help{margin-top:7px;padding:8px 10px;border-radius:5px;background:#fff4e5;color:#8a4b08;font-size:10px;font-weight:650}.row-type-radio{width:max-content}.status.soft{opacity:.82}.status.purple{color:#6941c6;background:#f4f3ff}.mini-adjustment{margin-top:4px;color:#9a5b13;font-size:10px;font-weight:700}.recent-head{display:flex;justify-content:space-between;align-items:center}.count-link{border:0;background:transparent;color:#175cd3;text-decoration:underline;cursor:pointer;font-weight:700}.bill-detail-meta{display:flex;gap:8px;color:var(--muted);font-size:10px;margin-bottom:8px}.style-pop-list{border:1px solid var(--line);border-radius:6px;overflow:hidden}.style-pop-row{display:grid;grid-template-columns:110px 1fr 120px;gap:10px;padding:10px;border-bottom:1px solid var(--line-soft);align-items:center}.style-pop-row:last-child{border-bottom:0}.style-pop-row small{color:var(--muted);text-align:right}.action-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:6px;overflow:hidden}.action-row{height:42px;border:0;border-bottom:1px solid var(--line-soft);background:#fff;text-align:left;padding:0 12px;cursor:pointer;font-weight:650}.action-row:last-child{border-bottom:0}.action-row:hover{background:#f7f9fb}.danger-text{color:var(--red)}
.history-filter-panel{padding:13px}.history-filters{display:grid;grid-template-columns:1.25fr repeat(2,.9fr) 1.15fr repeat(3,1fr);gap:10px;align-items:end}.history-filters .form-group label{font-size:9px}.history-reset{align-self:end}.database-filter-note{margin-top:10px;padding:8px 10px;border-radius:5px;background:#eff6ff;border:1px solid #c9dcff;color:#175cd3;font-size:10px}.history-kpis{margin:12px 0}.history-kpis .metric-value{font-size:20px}.metric-small{font-size:11px;color:var(--muted);font-weight:600}.history-table td{height:46px}.history-footer{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-top:1px solid var(--line-soft);color:var(--muted);font-size:10px}
@media(max-width:1280px){.history-filters{grid-template-columns:repeat(5,1fr)}.compact-cell{min-width:205px}.compact-assignment{grid-template-columns:minmax(80px,1fr) 84px 22px}}


/* V4.6 refinements */
input[type=number]{appearance:textfield;-moz-appearance:textfield}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.actions-col-head{text-align:center!important;width:220px}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}.action-primary{font-weight:720}
.copy-result-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}.copy-result-summary>div{border:1px solid var(--line);border-radius:6px;padding:9px 10px;background:#fafbfc}.copy-result-summary b,.copy-result-summary span{display:block}.copy-result-summary span{font-size:10px;color:var(--muted);margin-top:2px}.copy-issue-table{max-height:260px;border:1px solid var(--line);border-radius:6px}.copy-issue-table .table th,.copy-issue-table .table td{font-size:10px;height:36px}
.costing-summary-page{max-width:none}.summary-order-strip{display:flex;justify-content:flex-end;gap:0;margin:-55px 410px 14px auto;width:max-content;border:1px solid var(--line);border-radius:7px;background:#fff;overflow:hidden}.summary-order-strip>div{padding:8px 15px;border-right:1px solid var(--line)}.summary-order-strip>div:last-child{border-right:0}.summary-order-strip span{display:block;font-size:9px;color:var(--muted)}.summary-order-strip b{display:block;margin-top:2px;font-size:14px;color:var(--ink)}.summary-order-strip>div:first-child b{color:#087356}
.summary-panel{padding:12px}.summary-view-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:10px}.summary-toggle{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;margin-top:6px}.summary-tab{height:35px;padding:0 18px;border:0;border-right:1px solid var(--line);background:#fff;color:var(--ink-2);font-weight:700;font-size:11px;cursor:pointer}.summary-tab:last-child{border-right:0}.summary-tab:hover{background:#f8fafb}.summary-tab.active{background:#edf7f3;color:#087356;box-shadow:inset 0 0 0 1px #0a8f6a}
.summary-table-wrap{border:1px solid var(--line);border-radius:7px;max-width:100%;overflow:auto}.summary-matrix{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;table-layout:fixed}.summary-matrix th,.summary-matrix td{height:39px;min-width:92px;padding:0 8px;border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);text-align:center;font-size:11px;color:var(--ink);font-variant-numeric:tabular-nums}.summary-matrix th{background:#fafbfc;font-weight:760;color:var(--ink-2);position:sticky;top:0;z-index:3}.summary-matrix .summary-op{position:sticky;left:0;z-index:4;min-width:150px;max-width:170px;text-align:left;padding-left:13px;background:#fff;font-weight:720}.summary-matrix thead .summary-op{background:#fafbfc;z-index:5}.summary-matrix .summary-unit{min-width:115px;text-align:left}.summary-matrix tbody tr:hover td{background:#fbfcfd}.summary-matrix tbody tr:hover .summary-op{background:#fbfcfd}.summary-number{font-weight:700}.summary-zero{color:#7b8493;font-weight:650}.summary-unused{color:#a4acb8}.summary-total td{height:45px;background:#edf7f3!important;font-weight:800;color:#087356;font-size:13px}.summary-total .summary-op{background:#edf7f3!important}.summary-total-value{font-size:16px!important}.party-group{color:#087356!important;font-size:12px!important}.margin-row td{border-top:1px dashed #cbd3dc}.margin-row .summary-op{font-weight:760}.summary-contractor{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:120px;padding:2px 0}.summary-contractor span{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-size:10px}.summary-contractor b{font-size:10px;color:#087356}.contractor-summary td{min-width:150px}.jobwork-summary th,.jobwork-summary td{min-width:86px}.jobwork-summary .summary-op{min-width:145px}.pdf-btn{border-color:#f1b4b0!important;color:#b42318!important}
@media(max-width:1250px){.summary-order-strip{margin-right:0;margin-top:0}.actions-col-head{width:190px}.row-actions{gap:5px}.summary-matrix th,.summary-matrix td{min-width:82px;padding:0 6px}}

/* V4.7 compact list density */
.table.dense-table th,.table.dense-table td,.dense-table th,.dense-table td{padding:6px 10px;line-height:1.18;vertical-align:middle}
.table.dense-table th,.dense-table th{height:30px}
.table.dense-table td,.dense-table td{height:32px}
.table.dense-table .status,.dense-table .status{padding:3px 7px;font-size:11px}
.table.dense-table .btn.small,.dense-table .btn.small{min-height:26px;padding:4px 8px}
.icon-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}
.icon-action{width:27px;height:27px;border:1px solid var(--line,#dfe5e2);background:#fff;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:15px;line-height:1;color:#42504a;padding:0}
.icon-action:hover{background:#f4f7f5;border-color:#b9c7c0}
.danger-icon{color:#b83c3c}.danger-icon:hover{background:#fff3f3;border-color:#e7bcbc}
.compact-actions-head{width:78px}
.readonly-rate{background:#f5f7f6!important;color:#26332e;font-weight:700}
.bill-block-box{border:1px solid #d98b8b;background:#fff5f5;color:#8f2f2f;border-radius:8px;padding:10px 12px;display:grid;gap:4px;margin:8px 0}
.bill-block-box small{color:#705757}
.compact-money{max-width:108px;margin-left:auto}.compact-money .field{height:30px;padding:4px 5px}
.compact-filter-panel{margin-bottom:10px}.compact-history-filters{grid-template-columns:minmax(180px,1.6fr) repeat(6,minmax(118px,1fr)) auto;gap:8px;align-items:end}.compact-history-filters .form-group{margin:0}.compact-history-filters label{font-size:11px;margin-bottom:4px}.compact-history-filters .field,.compact-history-filters .smart-select-input{height:32px;padding-top:4px;padding-bottom:4px}.history-table-panel{margin-top:0}
.users-roles-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.permission-grid{display:grid;gap:6px}.permission-row{display:grid;grid-template-columns:1fr 150px;align-items:center;gap:12px;padding:5px 0;border-bottom:1px solid #eef1ef}.switch-user-list{display:grid;gap:6px}.switch-user-list .action-row{display:flex;justify-content:space-between;align-items:center}.user-switch-ready .avatar{cursor:pointer}
.success-outline{border-color:#69aa8a!important;color:#13734d!important;background:#f3fbf7!important}
/* complete active segment outline, including rounded outer corners */
.summary-toggle{overflow:visible!important}.summary-tab{position:relative;border:1px solid transparent!important}.summary-tab.active{z-index:2;border-color:#0a8f6a!important;background:#edf7f3!important;box-shadow:none!important}.summary-tab:first-child{border-radius:7px 0 0 7px!important}.summary-tab:last-child{border-radius:0 7px 7px 0!important}
@media(max-width:1250px){.compact-history-filters{grid-template-columns:repeat(4,minmax(140px,1fr))}.users-roles-grid{grid-template-columns:1fr}}

/* V4.7 final: compact lists and user-role controls */
.table th,.table td{vertical-align:middle}
.table.dense-table th,.dense-table th{height:29px;padding:5px 9px!important}
.table.dense-table td,.dense-table td{height:31px;padding:5px 9px!important}
.icon-actions{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
.compact-actions-head{text-align:center;width:76px}
.role-summary{font-size:10px;color:var(--muted);line-height:1.3}
.users-roles-grid .panel{min-width:0}
.avatar{cursor:pointer}
@media(max-width:1180px){.users-roles-grid{grid-template-columns:1fr}.compact-history-filters{grid-template-columns:repeat(4,minmax(130px,1fr))}}

/* V4.8 final refinements */
.bill-entry-card{background:#f8f9fb;border:1px solid #e5e8ec;border-radius:9px;padding:10px 10px 14px;margin-top:2px;box-shadow:0 1px 2px rgba(16,24,40,.025)}
.bill-entry-card>.panel{box-shadow:none;background:#fff}
.bill-entry-card .bill-section-head{margin-top:10px}
.bill-entry-card .summary-bar{margin-top:10px;margin-bottom:0}
.recent-head{margin-top:18px!important}
.center-col{text-align:center!important}.amount-col{text-align:right!important}.actions-center{text-align:center!important}
.actions-center .icon-actions,.compact-actions-head+.actions-center .icon-actions{justify-content:center}
.history-table .center-col{text-align:center!important}.history-table .amount-col{text-align:right!important}.history-table .actions-center{text-align:center!important}
.table td.amount-col,.table th.amount-col{padding-right:18px!important}
.table td.actions-center .icon-actions{display:inline-flex}
/* Compact list density is the default for list screens. */
.table.dense-table th,.dense-table th{height:28px;padding:4px 9px!important}
.table.dense-table td,.dense-table td{height:30px;padding:4px 9px!important;line-height:1.14}
.history-table td{height:30px!important}
.audit-filters{display:grid;grid-template-columns:1.45fr .85fr .85fr 1fr 1fr 1fr auto;gap:9px;align-items:end}
.audit-details{max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.login-screen{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;background:#f3f5f7}
.login-card{width:390px;background:#fff;border:1px solid #dfe3e8;border-radius:12px;padding:28px;box-shadow:0 18px 50px rgba(16,24,40,.12)}
.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:28px}.login-card h1{margin:0 0 6px;font-size:25px}.login-card p{margin:0 0 22px;color:var(--muted);font-size:12px}.login-card .form-group{margin-bottom:14px}.login-btn{width:100%;margin-top:4px;min-height:40px}.login-error{min-height:20px;color:#b42318;font-size:11px;margin:2px 0 4px}.login-foot{text-align:center;color:var(--muted);font-size:10px;margin-top:14px}
.logged-out #app{filter:blur(1px);pointer-events:none;user-select:none}

/* V4.9 stable export preview */
.export-preview-modal{width:min(900px,calc(100vw - 48px));max-height:calc(100vh - 56px);display:flex;flex-direction:column}
.export-preview-modal .modal-body{overflow:auto;padding-bottom:14px}
.export-choice.active{border-color:#7fb7a4;background:#f2faf7;box-shadow:inset 0 0 0 1px #7fb7a4}
.export-preview-head{display:flex;align-items:end;justify-content:space-between;margin:16px 1px 8px}.export-preview-head b{font-size:12px}.export-preview-head span{font-size:10px;color:var(--muted)}
.export-preview-area{border:1px solid #dfe4e8;background:#eef1f4;border-radius:8px;padding:14px;max-height:410px;overflow:auto}
.report-preview-sheet{background:#fff;border:1px solid #d9dee3;border-radius:4px;padding:18px;min-width:620px;color:#17212b;box-shadow:0 1px 3px rgba(16,24,40,.05)}
.preview-doc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;border-bottom:1px solid #e5e8ec;padding-bottom:12px}.preview-doc-head>div:first-child b{font-size:18px;display:block}.preview-doc-head>div:first-child span{font-size:10px;color:#6b7280}.preview-doc-head>div:last-child{text-align:right}.preview-doc-head small{display:block;color:#7b8492;font-size:9px}.preview-doc-head strong{display:block;font-size:12px;margin:2px 0}
.preview-meta{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:12px 0}.preview-meta small{display:block;font-size:9px;color:#7b8492}.preview-meta b{display:block;font-size:11px;margin-top:2px}
.preview-table-wrap{border:1px solid #e2e6ea;border-radius:4px;overflow:auto}.preview-table{width:100%;border-collapse:collapse;font-size:10px}.preview-table th,.preview-table td{padding:7px 8px;border-bottom:1px solid #edf0f2;text-align:left}.preview-table th{background:#f7f8fa;color:#4a5563;font-weight:750}.preview-table .num{text-align:right}.preview-total{margin-left:auto;margin-top:12px;width:220px;border-top:2px solid #cfd5dc;padding-top:8px;display:flex;justify-content:space-between;font-size:12px}.preview-total b{font-size:14px}
.preview-snapshot .table,.preview-snapshot table{width:100%;font-size:9px}.preview-snapshot .icon-actions,.preview-snapshot button{display:none!important}
@media(max-width:760px){.export-preview-modal{width:calc(100vw - 24px)}.export-choices{grid-template-columns:1fr}.report-preview-sheet{min-width:560px}}

/* V4.9.2 final UI refinements */
.compact-label{display:block;font-size:10px;font-weight:700;color:var(--muted);margin:0 0 5px 2px}
.list-empty{padding:20px 12px;text-align:center;color:var(--muted-2);font-size:11px;line-height:1.45}
.list-empty span{font-size:10px;color:var(--muted)}
.table td.table-empty,.dense-table td.table-empty{height:44px!important;padding:12px 16px!important;text-align:center!important;vertical-align:middle!important;white-space:nowrap!important;color:var(--muted-2)!important;font-size:11px!important;display:table-cell!important}
/* Mark Complete is intentionally neutral until the order is actually completed. */
#toggleOrder{background:#fff;border-color:var(--line);color:var(--ink)}

/* V4.9.3 CMT Control hierarchy */
.control-status-toggle{display:inline-flex;border:1px solid #d9e0e7;border-radius:8px;overflow:hidden;background:#fff;margin:2px 0 14px}.control-status-btn{border:0;background:#fff;color:#344054;padding:9px 18px;font-weight:650;cursor:pointer;border-right:1px solid #e4e7ec}.control-status-btn:last-child{border-right:0}.control-status-btn span{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border-radius:10px;background:#f2f4f7;font-size:11px;margin-left:6px}.control-status-btn.active{background:#eef8f4;color:#08765a}.control-status-btn.active span{background:#d9f0e7;color:#08765a}.control-order-section{margin-bottom:14px}.control-section-title{font-size:12px;font-weight:700;color:#667085;text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}.control-order-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:9px}.control-order-card{background:#fff;border:1px solid #dfe4ea;border-radius:9px;padding:13px 14px;text-align:left;cursor:pointer;min-height:70px;transition:border-color .12s,background .12s}.control-order-card:hover{border-color:#aab7c4;background:#fbfcfd}.control-order-card.selected{border-color:#7bbca8;background:#f4fbf8}.control-order-no{font-weight:750;color:#182230}.control-order-qty{font-size:13px;color:#667085;margin-top:8px}.control-empty-card{border:1px dashed #d0d5dd;border-radius:9px;padding:18px;color:#667085;background:#fff}.control-breadcrumb{display:flex;gap:8px;align-items:center;font-size:12px;color:#667085;margin:4px 0 9px}.control-breadcrumb .link-btn{padding:0}.control-order-summary{margin-top:8px}.control-summary-strip{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid #edf0f3;border-bottom:1px solid #edf0f3}.control-summary-strip>div{padding:12px 14px;border-right:1px solid #edf0f3}.control-summary-strip>div:last-child{border-right:0}.control-summary-strip span{display:block;font-size:11px;color:#667085;margin-bottom:5px}.control-summary-strip b{font-size:17px;color:#182230}.control-unit-bars{padding:13px 14px 14px}.control-subhead{font-size:12px;font-weight:750;color:#475467;margin-bottom:9px}.unit-progress-row{display:grid;grid-template-columns:190px 1fr;gap:12px;align-items:center;padding:7px 0}.unit-progress-label{display:flex;align-items:center;gap:7px;min-width:0}.unit-progress-main{display:grid;grid-template-columns:minmax(150px,1fr) 230px;gap:10px;align-items:center}.unit-progress-track,.style-progress-track,.operation-progress-track{height:8px;border-radius:6px;background:#eef1f4;overflow:hidden}.unit-progress-fill,.style-progress-fill,.operation-progress-fill{height:100%;background:#5aa98d;border-radius:6px}.unit-progress-meta{font-size:11px;color:#667085;white-space:nowrap}.control-styles-panel{margin-top:12px}.control-style-list{padding:0}.control-style-row{display:grid;grid-template-columns:minmax(0,1fr) 130px 24px;width:100%;align-items:center;border:0;border-top:1px solid #edf0f3;background:#fff;padding:10px 13px;text-align:left;cursor:pointer}.control-style-row:first-child{border-top:0}.control-style-row:hover,.control-style-row.selected{background:#f8fbfa}.control-style-row>div:first-child{display:flex;align-items:center;gap:14px;min-width:0}.control-style-row b{min-width:85px}.control-style-row span{color:#475467;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.control-style-qty{text-align:right;color:#344054;font-weight:650}.control-style-chevron{text-align:right;color:#98a2b3;font-size:18px}.control-style-empty{text-align:center!important;padding:18px!important}.control-style-detail-panel{margin-top:12px;padding-bottom:4px}.style-breadcrumb{padding:11px 14px 0;margin:0}.control-style-head{display:flex;justify-content:space-between;align-items:center;padding:8px 14px 10px}.control-unit-toggle{display:flex;gap:0;overflow-x:auto;border-top:1px solid #edf0f3;border-bottom:1px solid #edf0f3;padding:8px 14px}.control-unit-btn{border:1px solid #d9e0e7;background:#fff;padding:7px 13px;color:#475467;font-weight:650;cursor:pointer;margin-left:-1px;white-space:nowrap}.control-unit-btn:first-child{border-radius:7px 0 0 7px;margin-left:0}.control-unit-btn:last-child{border-radius:0 7px 7px 0}.control-unit-btn.active{background:#eef8f4;border-color:#68b49c;color:#08765a;position:relative;z-index:1}.control-all-units,.control-operation-view{padding:14px}.style-unit-progress{display:grid;grid-template-columns:210px minmax(180px,1fr) 48px;gap:12px;align-items:center;padding:8px 0}.style-unit-label{display:flex;flex-direction:column;gap:2px}.style-unit-label span{font-size:11px;color:#667085}.style-progress-pct{text-align:right;font-size:12px;color:#475467;font-weight:700}.operation-progress-row{display:grid;grid-template-columns:180px minmax(200px,1fr) 150px;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid #f0f2f4}.operation-progress-row:last-child{border-bottom:0}.operation-progress-name{font-weight:650}.operation-progress-value{text-align:right;font-size:12px;color:#475467}.control-inline-empty{padding:12px 0;color:#667085;font-size:13px}.status.purple{color:#6941c6;background:#f4f3ff}
@media(max-width:1100px){.control-summary-strip{grid-template-columns:repeat(2,1fr)}.unit-progress-row{grid-template-columns:1fr}.unit-progress-main{grid-template-columns:1fr 180px}.operation-progress-row{grid-template-columns:150px 1fr 130px}}

/* V4.9.4 in-place drill-down refinements */
.control-unit-btn.active,
.control-unit-btn[aria-selected="true"]{background:#e9f7f2!important;border-color:#46a989!important;color:#067257!important;box-shadow:inset 0 0 0 1px #46a989!important;position:relative;z-index:2}
.control-unit-btn[aria-selected="false"]{background:#fff;color:#475467}
#controlWorkspace{margin-top:12px}
.control-style-detail-panel{margin-top:0}
.control-styles-panel{margin-top:0}

/* V4.9.6 final alignment polish */
.audit-filters{grid-template-columns:minmax(210px,1.45fr) minmax(140px,.85fr) minmax(140px,.85fr) minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) auto;gap:10px;align-items:end}
.audit-filters .form-group{margin:0;min-width:0}
.audit-filters .form-group label{display:block;height:18px;line-height:18px;margin:0 0 4px}
.audit-filters .field,.audit-filters .select,.audit-filters>#auditReset{height:38px;min-height:38px}
.audit-table-panel table{table-layout:fixed;width:100%}
.audit-table-panel th:nth-child(1),.audit-table-panel td:nth-child(1){width:14%}
.audit-table-panel th:nth-child(2),.audit-table-panel td:nth-child(2){width:14%}
.audit-table-panel th:nth-child(3),.audit-table-panel td:nth-child(3){width:14%}
.audit-table-panel th:nth-child(4),.audit-table-panel td:nth-child(4){width:14%}
.audit-table-panel th:nth-child(5),.audit-table-panel td:nth-child(5){width:14%}
.audit-table-panel th:nth-child(6),.audit-table-panel td:nth-child(6){width:30%}
.history-export-preview th:nth-child(5),.history-export-preview td:nth-child(5){text-align:right}
@media(max-width:1280px){.audit-filters{grid-template-columns:1.4fr .9fr .9fr 1fr 1fr 1fr auto;gap:7px}}
\n\n/* V4.9.7 final Audit Log alignment correction */
.audit-filters{
  display:grid;
  grid-template-columns:minmax(220px,1.45fr) minmax(138px,.82fr) minmax(138px,.82fr) minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) 92px;
  column-gap:10px;
  row-gap:0;
  align-items:start;
}
.audit-filters .form-group,
.audit-reset-group{
  display:grid;
  grid-template-rows:18px 38px;
  row-gap:4px;
  margin:0;
  min-width:0;
  align-items:stretch;
}
.audit-filters .form-group label,
.audit-reset-group label{
  display:block;
  height:18px;
  line-height:18px;
  margin:0;
  padding:0;
  font-size:10px;
  font-weight:700;
  color:var(--muted);
  box-sizing:border-box;
}
.audit-reset-group label{visibility:hidden;user-select:none}
.audit-filters .field,
.audit-filters .select,
.audit-reset-group .btn{
  width:100%;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  box-sizing:border-box;
  align-self:stretch;
}
.audit-filters input[type="date"]{padding-top:0;padding-bottom:0}
.audit-reset-group .btn{display:flex;align-items:center;justify-content:center;white-space:nowrap;padding-left:10px;padding-right:10px}
.audit-table-panel .table-wrap{overflow-x:auto}
.audit-table-panel table{table-layout:fixed;width:100%;min-width:900px}
.audit-table-panel th,.audit-table-panel td{box-sizing:border-box}
.audit-table-panel th:nth-child(1),.audit-table-panel td:nth-child(1){width:14%}
.audit-table-panel th:nth-child(2),.audit-table-panel td:nth-child(2){width:14%}
.audit-table-panel th:nth-child(3),.audit-table-panel td:nth-child(3){width:14%}
.audit-table-panel th:nth-child(4),.audit-table-panel td:nth-child(4){width:14%}
.audit-table-panel th:nth-child(5),.audit-table-panel td:nth-child(5){width:14%}
.audit-table-panel th:nth-child(6),.audit-table-panel td:nth-child(6){width:30%}
.audit-table-panel td.audit-details{max-width:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1280px){
  .audit-filters{grid-template-columns:minmax(190px,1.35fr) minmax(128px,.85fr) minmax(128px,.85fr) minmax(135px,1fr) minmax(135px,1fr) minmax(135px,1fr) 86px;column-gap:7px}
}


/* V4.9.8 Audit Log baseline fix: labels and controls are two explicit grid rows. */
.audit-filters{
  display:grid!important;
  grid-template-columns:minmax(220px,1.45fr) minmax(138px,.82fr) minmax(138px,.82fr) minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) 92px!important;
  grid-template-rows:18px 38px!important;
  column-gap:10px!important;
  row-gap:4px!important;
  align-items:stretch!important;
}
.audit-filter-label{
  display:flex!important;
  align-items:center!important;
  height:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  line-height:18px!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  font-size:10px!important;
  font-weight:700!important;
  color:var(--muted)!important;
  white-space:nowrap!important;
}
.audit-filter-label-blank{visibility:hidden!important}
.audit-filters>.field,
.audit-filters>.select,
.audit-filters>.audit-reset-btn{
  width:100%!important;
  height:38px!important;
  min-height:38px!important;
  max-height:38px!important;
  margin:0!important;
  box-sizing:border-box!important;
  align-self:stretch!important;
}
.audit-filters>.audit-reset-btn{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 10px!important;
  white-space:nowrap!important;
}
.audit-filters>input[type="date"]{padding-top:0!important;padding-bottom:0!important}
@media(max-width:1280px){
  .audit-filters{
    grid-template-columns:minmax(190px,1.35fr) minmax(128px,.85fr) minmax(128px,.85fr) minmax(135px,1fr) minmax(135px,1fr) minmax(135px,1fr) 86px!important;
    column-gap:7px!important;
  }
}

/* V5.0 Audit Log: final geometry override for WKWebView. */
.audit-table-panel{margin-top:10px}
.compact-filter-panel:has(.audit-filters){padding:12px 12px 13px!important;overflow:visible}
.audit-filters{
  display:grid!important;
  grid-template-columns:minmax(220px,1.45fr) minmax(138px,.82fr) minmax(138px,.82fr) minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) 92px!important;
  grid-template-rows:14px 38px!important;
  column-gap:10px!important;
  row-gap:5px!important;
  align-items:stretch!important;
  width:100%!important;
}
.audit-filter-label{
  display:block!important;
  height:14px!important;
  min-height:14px!important;
  max-height:14px!important;
  line-height:14px!important;
  margin:0!important;
  padding:0!important;
  font-size:10px!important;
  font-weight:700!important;
  color:var(--muted)!important;
  white-space:nowrap!important;
  box-sizing:border-box!important;
  align-self:end!important;
}
.audit-filter-label-blank{visibility:hidden!important}
.audit-filters>.field,.audit-filters>.select,.audit-filters>.audit-reset-btn{
  width:100%!important;height:38px!important;min-height:38px!important;max-height:38px!important;
  margin:0!important;box-sizing:border-box!important;align-self:stretch!important;
}
.audit-filters>.audit-reset-btn{display:flex!important;align-items:center!important;justify-content:center!important;padding:0 10px!important;white-space:nowrap!important}
.audit-filters>input[type="date"]{padding-top:0!important;padding-bottom:0!important}
@media(max-width:1280px){.audit-filters{grid-template-columns:minmax(190px,1.35fr) minmax(128px,.85fr) minmax(128px,.85fr) minmax(135px,1fr) minmax(135px,1fr) minmax(135px,1fr) 86px!important;column-gap:7px!important}}

/* V5.0.1 final cross-engine layout normalization */
.bill-header-grid{display:grid!important;grid-template-columns:minmax(250px,1.45fr) minmax(145px,.85fr) minmax(155px,.9fr) minmax(210px,1.1fr) minmax(190px,1.05fr)!important;gap:12px!important;align-items:end!important}
.bill-header-grid .form-group{margin:0!important;min-width:0}.bill-header-grid .form-group>label{height:18px;line-height:18px;margin:0 0 5px!important;display:block}.bill-header-grid .field,.bill-header-grid .radio-group{height:38px;min-height:38px;box-sizing:border-box}.bill-header-grid .radio-group{display:flex;align-items:center;gap:18px;padding:0 14px}
.bill-lines-table{table-layout:fixed!important;width:100%!important}.bill-lines-table th,.bill-lines-table td{box-sizing:border-box!important}.bill-lines-table th:nth-child(1),.bill-lines-table td:nth-child(1){width:5%}.bill-lines-table th:nth-child(2),.bill-lines-table td:nth-child(2){width:28%;text-align:left}.bill-lines-table th:nth-child(3),.bill-lines-table td:nth-child(3){width:19%;text-align:left}.bill-lines-table th:nth-child(4),.bill-lines-table td:nth-child(4){width:13%;text-align:right}.bill-lines-table th:nth-child(5),.bill-lines-table td:nth-child(5){width:14%;text-align:right}.bill-lines-table th:nth-child(6),.bill-lines-table td:nth-child(6){width:15%;text-align:right}.bill-lines-table th:nth-child(7),.bill-lines-table td:nth-child(7){width:6%;text-align:center}.bill-lines-table td:nth-child(7) .icon-action{margin:auto}
.recent-bills-table{table-layout:fixed;width:100%}.recent-bills-table th:nth-child(1),.recent-bills-table td:nth-child(1){width:14%}.recent-bills-table th:nth-child(2),.recent-bills-table td:nth-child(2){width:16%}.recent-bills-table th:nth-child(3),.recent-bills-table td:nth-child(3){width:28%}.recent-bills-table th:nth-child(4),.recent-bills-table td:nth-child(4){width:12%;text-align:center}.recent-bills-table th:nth-child(5),.recent-bills-table td:nth-child(5){width:18%;text-align:right}.recent-bills-table th:nth-child(6),.recent-bills-table td:nth-child(6){width:12%;text-align:center}
.history-filters{align-items:end!important}.history-filters .form-group{margin:0!important;min-width:0}.history-filters .form-group>label{display:block!important;height:18px!important;line-height:18px!important;margin:0 0 5px!important}.history-filters .field,.history-filters .select,.history-reset .btn{height:38px!important;min-height:38px!important;box-sizing:border-box!important}.history-reset{display:flex;align-items:flex-end}
.compact-filter-panel:has(.audit-filters){padding:14px 12px!important}.audit-filters{display:grid!important;grid-template-columns:minmax(220px,1.45fr) minmax(138px,.82fr) minmax(138px,.82fr) minmax(150px,1fr) minmax(150px,1fr) minmax(150px,1fr) 92px!important;grid-template-rows:18px 38px!important;column-gap:10px!important;row-gap:5px!important;align-items:stretch!important}.audit-filter-label{height:18px!important;line-height:18px!important;margin:0!important;padding:0!important;align-self:end!important}.audit-filters>.field,.audit-filters>.select,.audit-filters>.audit-reset-btn{height:38px!important;min-height:38px!important;margin:0!important;box-sizing:border-box!important;align-self:stretch!important}.audit-reset-btn{display:flex!important;align-items:center!important;justify-content:center!important;padding:0 10px!important}
.modern-date-field{cursor:pointer;background-image:linear-gradient(45deg,transparent 50%,#667085 50%),linear-gradient(135deg,#667085 50%,transparent 50%);background-position:calc(100% - 17px) 16px,calc(100% - 13px) 16px;background-size:4px 4px,4px 4px;background-repeat:no-repeat;padding-right:34px!important}.date-popover{position:fixed;z-index:10000;width:286px;background:#fff;border:1px solid #d9e0e7;border-radius:12px;box-shadow:0 14px 36px rgba(16,24,40,.18);padding:12px;font-size:13px}.date-head{display:grid;grid-template-columns:34px 1fr 34px;align-items:center;margin-bottom:9px}.date-head b{text-align:center;color:#182230;font-size:14px}.date-head button{border:0;background:transparent;border-radius:7px;height:32px;font-size:22px;color:#475467;cursor:pointer}.date-head button:hover{background:#f2f4f7}.date-week,.date-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}.date-week{margin-bottom:4px}.date-week span{text-align:center;font-size:10px;color:#98a2b3;font-weight:700}.date-day,.date-empty{height:32px}.date-day{border:0;background:#fff;border-radius:7px;color:#344054;cursor:pointer}.date-day:hover{background:#f2f4f7}.date-day.today{box-shadow:inset 0 0 0 1px #98a2b3}.date-day.selected{background:#e9f7f2!important;color:#067257!important;font-weight:800;box-shadow:inset 0 0 0 1px #46a989}.date-foot{display:flex;justify-content:space-between;border-top:1px solid #edf0f3;margin-top:9px;padding-top:8px}
.path-bar{min-height:26px;padding:0 2px;margin:0 0 10px!important}.control-master-detail{display:grid;grid-template-columns:300px minmax(0,1fr);gap:12px;align-items:start}.control-style-master{overflow:hidden}.control-master-list{max-height:580px;overflow:auto}.control-master-row{width:100%;border:0;border-top:1px solid #edf0f3;background:#fff;padding:12px 13px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;text-align:left;cursor:pointer}.control-master-row:first-child{border-top:0}.control-master-row:hover{background:#fafcfb}.control-master-row.selected{background:#eef8f4;box-shadow:inset 3px 0 0 #25a47a}.control-master-row div{min-width:0;display:flex;flex-direction:column;gap:3px}.control-master-row span{color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}.control-master-row strong{font-size:12px;color:#475467}.control-style-detail-panel{margin:0!important;min-width:0}.control-unit-toggle{overflow-x:auto}.operation-progress-click{width:100%;border:0;background:#fff;text-align:left;cursor:pointer;font:inherit}.operation-progress-click:hover{background:#f8fbfa}.operation-progress-click .operation-progress-name{color:#182230}.operation-progress-click:hover .operation-progress-name{color:#067257}
@media(max-width:1180px){.bill-header-grid{grid-template-columns:1.3fr .8fr .9fr 1.05fr 1fr!important;gap:8px!important}.control-master-detail{grid-template-columns:260px minmax(0,1fr)}}

/* V5.0.2 CMT Control Qty / Amount refinement */
.control-metric-toggle{display:inline-flex;align-items:center;border:1px solid #d9e0e7;border-radius:7px;overflow:hidden;background:#fff;flex:0 0 auto}
.control-metric-btn{border:0;border-right:1px solid #e4e7ec;background:#fff;color:#475467;padding:7px 14px;font-weight:700;cursor:pointer;min-width:68px}
.control-metric-btn:last-child{border-right:0}
.control-metric-btn.active{background:#eef8f4;color:#08765a;box-shadow:inset 0 0 0 1px #68b49c}
.control-money-strip{border-top:0;background:#fbfcfd}
.control-money-strip b{font-size:16px}
.control-money-strip .negative{color:#b42318}
.control-order-summary .panel-head{align-items:center}
@media(max-width:900px){.control-order-summary .panel-head,.control-style-head{align-items:flex-start;gap:10px;flex-wrap:wrap}.control-metric-toggle{margin-left:auto}}

/* v5.1.1 Supabase password recovery */
.login-forgot{display:block;margin:10px auto 0;border:0;background:transparent;color:#356a9a;font:inherit;font-size:13px;font-weight:600;cursor:pointer;padding:6px 10px}
.login-forgot:hover{text-decoration:underline}.login-forgot:disabled{opacity:.55;cursor:default;text-decoration:none}
.login-error.login-success{color:#067647}
.login-btn:disabled{opacity:.92;cursor:wait}.login-btn.is-loading{display:flex;align-items:center;justify-content:center;gap:9px}.login-spinner{width:15px;height:15px;border:2px solid rgba(255,255,255,.42);border-top-color:#fff;border-radius:50%;animation:loginSpin .7s linear infinite;flex:0 0 auto}.login-progress{min-height:18px;margin:7px 0 0;text-align:center;color:var(--muted);font-size:11px}.login-card input:disabled{background:#f7f8fa;color:#667085}@keyframes loginSpin{to{transform:rotate(360deg)}}

/* V5.1.2 master cleanup */
.operation-check-row{height:38px;display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;column-gap:10px;padding:0 11px;box-sizing:border-box}
.operation-check-row .check{width:17px;height:17px;margin:0;justify-self:center;align-self:center;accent-color:#182230}
.operation-check-row span{display:block;line-height:1.25;min-width:0}
.delete-check-block{border:1px solid var(--line);border-radius:7px;padding:12px 13px;margin-bottom:10px}
.delete-check-block:last-child{margin-bottom:0}.delete-check-block>b{display:block;font-size:12px;margin-bottom:8px}
.danger-block{background:#fff9f8;border-color:#efc7c3}.safe-block{background:#f4fbf8;border-color:#b8ddcf}
.delete-ref-list{border-top:1px solid rgba(120,130,145,.18);margin-top:6px}
.delete-ref-list>div{display:flex;justify-content:space-between;gap:14px;padding:7px 0;border-bottom:1px solid rgba(120,130,145,.14);font-size:10.5px}
.delete-ref-list>div:last-child{border-bottom:0}.delete-ref-list strong{white-space:nowrap;font-variant-numeric:tabular-nums}

/* V5.1.6.1: editable bill quantity + compact Target CMT operation column */
.bill-qty-input{width:92px;height:34px;box-sizing:border-box;border:1px solid #d8dee6;border-radius:7px;background:#fff;color:#182230;text-align:right;padding:0 9px;font:inherit;font-weight:600}.bill-qty-input:focus{outline:none;border-color:#7bbca8;box-shadow:0 0 0 2px rgba(37,164,122,.10)}.bill-lines-table td:nth-child(4){padding-top:5px;padding-bottom:5px}

/* V5.1.6.2: use Target CMT right-side space for a compact style summary */
.cost-workspace{display:grid;grid-template-columns:minmax(520px,760px) minmax(205px,235px);gap:14px;align-items:start;justify-content:start}
.cost-side-summary{margin-top:14px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:var(--shadow-sm);overflow:hidden;position:sticky;top:12px}
.cost-side-title{padding:11px 13px;font-size:11px;font-weight:800;color:var(--ink);background:#fafbfc;border-bottom:1px solid var(--line-soft)}
.cost-side-metric{padding:12px 13px;border-bottom:1px solid var(--line-soft)}
.cost-side-metric span{display:block;font-size:9.5px;color:var(--muted);margin-bottom:4px}
.cost-side-metric b{display:block;font-size:16px;color:var(--ink);font-variant-numeric:tabular-nums}
.cost-side-metric b.green{color:#087356}
.cost-side-metric.emphasis b{font-size:18px}
.cost-side-note{padding:10px 13px;font-size:9.5px;line-height:1.45;color:var(--muted);background:#fcfcfd}
@media(max-width:1250px){.cost-workspace{grid-template-columns:minmax(0,1fr) 210px}}
@media(max-width:980px){.cost-workspace{grid-template-columns:1fr}.cost-side-summary{position:static;margin-top:0;display:grid;grid-template-columns:repeat(3,1fr)}.cost-side-title,.cost-side-note{display:none}.cost-side-metric{border-bottom:0;border-right:1px solid var(--line-soft)}.cost-side-metric:last-of-type{border-right:0}}

/* V5.1.8 Phase 2G: cloud reporting status + live dashboard */
.cloud-sync{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 11px;border:1px solid #d9e3df;border-radius:9px;background:#fff;color:#52606d;font-size:12px;font-weight:700;white-space:nowrap}
.cloud-sync.ok{color:#087356;background:#f2fbf7;border-color:#cce9dd}
.cloud-sync.cache{color:#8a5a00;background:#fff8e8;border-color:#efdca8}
.cloud-dot{width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px rgba(8,115,86,.08)}
.cloud-refresh-btn{min-width:82px}
.dashboard-secondary{margin-top:14px}
.metric-value.compact{font-size:22px;line-height:1.2}
.dash-activity{border-top:1px solid #e7eaee}
.dash-activity-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 14px;border-bottom:1px solid #eef0f2}
.dash-activity-row:last-child{border-bottom:0}
.dash-activity-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.dash-activity-main b{font-size:13px;color:#182230}
.dash-activity-main span{font-size:12px;color:#667085;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-activity-side{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex:0 0 auto;color:#667085;font-size:11px}
.dash-activity-side small{font-size:10px;color:#98a2b3}

/* V5.1.9 UI polish: Masters > Contractor > Allowed Operations */
.operation-check-list{
  display:grid;
  grid-template-columns:1fr;
  border:1px solid var(--line);
  border-radius:7px;
  max-height:245px;
  overflow-y:auto;
  overflow-x:hidden;
  background:#fff;
}
.operation-check-row{
  min-height:34px;
  height:auto;
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  align-items:center;
  column-gap:10px;
  padding:6px 11px;
  box-sizing:border-box;
  margin:0;
  border-bottom:1px solid var(--line-soft);
  cursor:pointer;
  color:var(--ink-2);
  font-size:11px;
  font-weight:600;
  line-height:1.3;
}
.operation-check-row:last-child{border-bottom:0}
.operation-check-row .check{
  width:17px;
  height:17px;
  margin:0;
  justify-self:center;
  align-self:center;
  flex:none;
}
.operation-check-row span{
  display:flex;
  align-items:center;
  min-height:17px;
  min-width:0;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.op-list-head{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
}
.op-list-head>div{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.op-list-head .link-btn{margin:0;padding:2px 0;line-height:1.2}

/* V5.1.9.1 hotfix: form-group label rule must not override operation checklist rows */
.form-group label.operation-check-row{
  display:grid !important;
  grid-template-columns:18px minmax(0,1fr) !important;
  align-items:center !important;
  column-gap:10px !important;
  min-height:36px !important;
  padding:0 11px !important;
  margin:0 !important;
  font-size:11px !important;
  line-height:1.25 !important;
  color:var(--ink-2) !important;
  font-weight:600 !important;
}
.form-group label.operation-check-row:last-child{border-bottom:0}
.form-group label.operation-check-row .check{margin:0 !important;align-self:center;justify-self:center}
.form-group label.operation-check-row span{display:block;min-width:0;line-height:1.25}

/* V5.1.9.2: operation master drag ordering */
.operations-reorder-table .drag-col{width:34px;padding-left:10px;padding-right:4px;text-align:center}
.master-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;color:#98a2b3;font-size:18px;line-height:1;cursor:grab;user-select:none}
.master-drag-handle:hover{background:#f2f4f7;color:#475467}
.operations-reorder-table tbody tr.dragging{opacity:.48}
.operations-reorder-table tbody tr.drag-over{box-shadow:inset 0 -2px 0 #2f8f6b}
.operation-order-help{margin-top:5px;font-size:10px}

/* V5.1.9.2: visible feedback during slower page/Supabase transitions */
.page-loading-overlay{position:fixed;inset:0;z-index:950;background:rgba(248,250,252,.56);backdrop-filter:blur(1.5px);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .12s ease}
.page-loading-overlay.show{opacity:1;pointer-events:auto}
.page-loading-card{display:flex;align-items:center;gap:11px;min-width:190px;padding:13px 18px;border:1px solid #dfe3e8;border-radius:10px;background:rgba(255,255,255,.97);box-shadow:0 12px 32px rgba(16,24,40,.12);font-size:12px;font-weight:650;color:#344054}
.page-loading-spinner{width:18px;height:18px;border:2px solid #d0d5dd;border-top-color:#2f8f6b;border-radius:50%;animation:page-loading-spin .72s linear infinite;flex:0 0 auto}
@keyframes page-loading-spin{to{transform:rotate(360deg)}}


/* V5.1.9.4: Operations master search toolbar + safe delete */
.operations-panel .operations-head{min-height:58px;padding:10px 14px;gap:16px;align-items:center}
.operations-search{position:relative;width:300px;max-width:calc(100% - 150px);flex:0 1 300px}
.operations-search .field{width:100%;height:34px;padding-left:31px;margin:0;display:block;box-sizing:border-box}
.operations-search-icon{position:absolute;left:10px;top:50%;transform:translateY(-52%);z-index:1;color:#98a2b3;font-size:15px;line-height:1;pointer-events:none}
.operation-order-help{margin:0;padding:0 14px 8px;border-bottom:1px solid var(--line-soft);font-size:10px;color:var(--muted);line-height:1.35}
.operations-reorder-table thead th{border-top:0}
.operation-actions-head{text-align:right;width:150px}
.operation-row-actions{justify-content:flex-end;gap:6px}
.danger-btn{border-color:#f0b8b3!important;background:#fff!important;color:#b42318!important}
.danger-btn:hover{background:#fff5f4!important;border-color:#e58c84!important}
.delete-warning-card{padding:12px 13px;border:1px solid #f3c7c2;background:#fff8f7;border-radius:7px;color:#7a271a}
@media(max-width:760px){.operations-panel .operations-head{align-items:stretch;flex-wrap:wrap}.operations-search{width:100%;max-width:none;flex:1 1 100%}.operations-panel .operations-head .btn{margin-left:auto}.operation-actions-head{width:132px}}
/* V5.2.0 Bill controls */
.bill-rate-input{width:92px;text-align:right;border:1px solid #d0d5dd;border-radius:7px;padding:7px 8px;background:#fff;color:#101828;font-weight:650}
.bill-rate-input:focus{outline:2px solid rgba(16,120,87,.14);border-color:#107857}
.bill-breakdown{font-size:12px;color:#475467;white-space:nowrap}
.status.red{background:#fff1f3;color:#c01048}.status.blue{background:#eff8ff;color:#175cd3}


/* V5.2.1 micro-interactions: save, export and cloud-sync feedback */
.btn{transition:transform .14s ease,box-shadow .14s ease,background-color .18s ease,border-color .18s ease,color .18s ease,opacity .18s ease}
.btn:not(:disabled):active{transform:scale(.975)}
.btn.action-loading,.btn.action-success,.btn.action-error{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:max-content}
.action-spinner{width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:micro-spin .62s linear infinite;opacity:.85}
.action-check{display:inline-flex;width:17px;height:17px;align-items:center;justify-content:center;border-radius:50%;background:rgba(255,255,255,.2);font-size:12px;font-weight:800;animation:micro-pop .28s cubic-bezier(.2,.8,.2,1)}
.btn.action-success{background:#08765a!important;border-color:#08765a!important;color:#fff!important;box-shadow:0 5px 14px rgba(8,118,90,.18)}
.btn.action-error{border-color:#e58c84!important;color:#b42318!important;background:#fff5f4!important}
.toast{animation:toast-in .28s cubic-bezier(.2,.8,.2,1)}
.cloud-dot{animation:cloud-pulse 2.2s ease-in-out infinite}
@keyframes micro-spin{to{transform:rotate(360deg)}}
@keyframes micro-pop{0%{transform:scale(.45);opacity:0}75%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
@keyframes toast-in{0%{transform:translateY(-8px) scale(.98);opacity:0}100%{transform:none;opacity:1}}
@keyframes cloud-pulse{0%,100%{box-shadow:0 0 0 0 rgba(47,143,107,0)}50%{box-shadow:0 0 0 4px rgba(47,143,107,.10)}}
@media (prefers-reduced-motion:reduce){.btn,.toast,.cloud-dot,.action-spinner,.action-check{animation:none!important;transition:none!important}}
