:root{--bg:#0f172a;--panel:#fff;--text:#111827;--muted:#64748b;--line:#e5e7eb;--primary:#0f766e;--primary2:#115e59;--danger:#b91c1c;--danger2:#991b1b;--shadow:0 10px 30px rgba(2,6,23,.12)}
*{box-sizing:border-box} body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#f3f4f6;color:var(--text)}
.view{display:none;min-height:100vh}.view.active{display:block}.card{background:var(--panel);border-radius:18px;box-shadow:var(--shadow);padding:18px;margin-bottom:18px}.auth-card{width:min(720px,94vw);margin:5vh auto;padding:28px;position:relative}.auth-card .primary{margin-top:10px}.auth-card-window{position:absolute;top:16px;right:16px}.auth-card-window .window-btn{padding:8px 12px;min-width:92px;font-size:13px}
h1,h2,h3{margin:0 0 10px} label{display:block;font-size:14px;margin:12px 0 6px;font-weight:700}
input,select,button{width:100%;border-radius:12px;border:1px solid #cbd5e1;padding:14px 16px;font-size:16px}
input[type="checkbox"]{width:auto;padding:0;margin-right:8px}
button{cursor:pointer;font-weight:700;background:#fff} button.primary{background:var(--primary);color:#fff;border-color:var(--primary)} button.primary:hover{background:var(--primary2)} button.danger{background:var(--danger);color:#fff;border-color:var(--danger)} button.danger:hover{background:var(--danger2)}
button.big{padding:16px 20px;font-size:18px}.message{min-height:22px;margin-top:12px;font-weight:700}.muted{color:var(--muted)}.recovery-panel{margin-top:14px;padding:16px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}.version-text{margin-top:10px;font-size:13px}.window-btn{width:auto;min-width:112px;background:#fff;box-shadow:var(--shadow)}
.topbar{background:var(--bg);color:#fff;padding:18px;display:flex;gap:16px;justify-content:space-between;align-items:flex-start;flex-wrap:wrap}.topbar .muted{color:#cbd5e1}.topbar-right{display:grid;gap:12px;justify-items:stretch;flex:1;min-width:min(920px,100%);max-width:100%}.topbar-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:10px;width:100%}.window-actions{display:flex;justify-content:flex-end;gap:10px;width:100%;flex-wrap:wrap}.topbar-actions button{width:100%;min-width:0}.tab-btn.active{outline:3px solid #5eead4}
main{padding:18px;max-width:1700px;margin:0 auto}.tab{display:none}.tab.active{display:block}.grid{display:grid;gap:14px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.full-span{grid-column:1/-1}.row{display:flex;gap:12px;align-items:center}.row.end{justify-content:flex-end}.row.spread{justify-content:space-between}.filter-row{flex-wrap:wrap;justify-content:flex-end}.filter-row input,.filter-row button{width:auto;min-width:0}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.dashboard-summary-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.95fr);gap:18px;align-items:start}.dashboard-summary-grid .card{margin-bottom:0}.compact-stats{margin-top:18px}.stat p{font-size:34px;margin:0;font-weight:800}.stat small{display:block;margin-top:6px;color:var(--muted);font-weight:700;line-height:1.4}.confirmation-card{margin-top:14px;padding:14px;border:1px solid #99f6e4;border-radius:14px;background:#f0fdfa}.checkbox-line{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.5}.checkbox-line input{margin-top:2px}.login-checkbox{margin-top:10px}.login-profiles-panel{margin:12px 0 18px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}.login-profiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}.login-profile-btn{padding:12px 14px;text-align:left;min-height:72px}.login-profile-btn strong{display:block;font-size:14px}.login-profile-btn span{display:block;font-size:12px;color:var(--muted);font-weight:600;margin-top:4px}.login-profile-btn.active{border-color:var(--primary);box-shadow:0 0 0 2px rgba(15,118,110,.15)}.table-wrap{position:relative;overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}.table-wrap.table-scroll-y{max-height:64vh}table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;background:#fff}table.table-tight{width:auto;min-width:max-content}th,td{border-bottom:1px solid var(--line);text-align:left;padding:10px 10px;font-size:13px;line-height:1.25;vertical-align:top;background:#fff}thead th{background:#f8fafc;position:sticky;top:0;z-index:4;white-space:nowrap;font-size:12px;letter-spacing:.02em;text-transform:none}table.table-tight th,table.table-tight td{padding:8px 10px}table.table-tight thead th{font-size:11px}tbody tr:nth-child(even) td{background:#fbfcfe}.table-row-clickable td{cursor:pointer}.table-row-clickable:hover td{background:#ecfeff}.number-cell{text-align:right;font-variant-numeric:tabular-nums}.actions-cell{white-space:nowrap}.actions-cell button{width:auto;display:inline-flex}.table-wrap.has-split{overflow:hidden}.table-split{display:grid;grid-template-columns:auto minmax(0,1fr);min-width:100%;background:#fff}.table-frozen{overflow:auto;max-height:64vh;overscroll-behavior:contain;scrollbar-width:none;-ms-overflow-style:none;border-right:1px solid var(--line);box-shadow:4px 0 10px rgba(15,23,42,.08);position:relative;z-index:2;background:#fff}.table-frozen::-webkit-scrollbar{width:0;height:0}.table-scroll{overflow:auto;min-width:0;max-height:64vh}.table-frozen table,.table-scroll table{min-width:100%;width:max-content}.table-frozen th,.table-frozen td{white-space:nowrap}.table-scroll th,.table-scroll td{white-space:nowrap}.table-scroll td:last-child{white-space:normal}.sticky-col{position:sticky;background:#fff}.sticky-col-last{box-shadow:4px 0 10px rgba(15,23,42,.08)}thead .sticky-col{background:#f8fafc;z-index:6}table[data-layout="transposed"]{min-width:100%;width:100%}table.table-tight[data-layout="transposed"]{width:auto;min-width:0}table[data-layout="transposed"] th:first-child,table[data-layout="transposed"] td:first-child{width:240px;min-width:240px;font-weight:700;background:#f8fafc}table.table-tight[data-layout="transposed"] th:first-child,table.table-tight[data-layout="transposed"] td:first-child{width:180px;min-width:180px}.table-category-grouped th,.table-category-grouped td{text-align:center}.table-category-grouped th.category-static,.table-category-grouped td.category-static{text-align:left}.table-category-grouped thead tr:first-child th{font-size:12px;padding:7px 8px;top:0;z-index:6}.table-category-grouped thead tr:first-child th[rowspan]{top:0;z-index:7}.table-category-grouped thead tr:last-child th{font-size:11px;padding:6px 4px;min-width:42px;top:var(--header-row-1,33px);z-index:5}.table-category-grouped td.category-cell{min-width:42px;padding:8px 6px}.table-category-grouped th.category-family-group{color:#0f172a;font-weight:800;border-bottom:1px solid rgba(15,23,42,.08)}.table-category-grouped th.category-family-group[data-family="android"]{background:#fbbf24}.table-category-grouped th.category-family-group[data-family="iphone"]{background:#a3e635}.table-category-grouped th.category-family-group[data-family="android-tablet"]{background:#38bdf8}.table-category-grouped th.category-family-group[data-family="ipad"]{background:#84cc16}.mini-table-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;padding:14px}.mini-table-card{border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}.mini-table-card h3{margin:0;padding:14px 14px 4px;font-size:16px}.mini-table-meta{margin:0;padding:0 14px 12px;color:var(--muted);font-size:13px;font-weight:700}.mini-table-wrap{border-top:1px solid var(--line);overflow:auto}.mini-table-wrap table{width:100%;min-width:0}.small-btn{width:auto;padding:8px 12px;font-size:13px}
.guide-panel .table-wrap{max-height:58vh}.guide-panel .table-compact th,.guide-panel .table-compact td{padding:7px 8px;font-size:12px;line-height:1.2}.guide-panel .table-compact thead th{font-size:11px}.guide-panel .table-compact td:nth-child(2){min-width:150px}.guide-panel .table-compact td:nth-child(5){min-width:120px}.guide-panel .table-compact td:nth-child(9){min-width:120px}.guide-panel .table-compact td:nth-child(10){min-width:220px;max-width:220px;white-space:normal;word-break:break-word}.guide-panel .table-compact .actions-cell{min-width:72px}.guide-panel .row input,.guide-panel .row button{padding:10px 12px;font-size:14px}
.backup-folder-row{align-items:stretch}.backup-folder-row input{flex:1}.backup-folder-row button{width:auto;min-width:140px}.backup-enable-line{margin-top:28px}.backup-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.backup-status-item{padding:14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc;display:grid;gap:6px}.backup-status-item span{color:var(--muted);font-size:13px;font-weight:700}.backup-status-item strong{font-size:15px;line-height:1.4;word-break:break-word}
.form-editor{width:100%;min-height:160px;font-family:Consolas,Monaco,'Courier New',monospace;font-size:13px;line-height:1.45;resize:vertical;white-space:pre-wrap}
.form-editor.small{min-height:140px}
.reset-guide-overview ul,.reset-guide-section ul,.reset-guide-section ol{margin:10px 0 0;padding-left:20px}.reset-guide-overview{margin-bottom:16px}.reset-brand-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.reset-brand-btn{width:auto;min-width:150px;padding:12px 14px}.reset-brand-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}.reset-guide-content{display:grid;gap:14px}.reset-guide-header{padding-bottom:6px;border-bottom:1px solid var(--line)}.reset-guide-section{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fff}.reset-guide-section h3,.reset-guide-tool h4{margin:0 0 8px}.reset-guide-tool+.reset-guide-tool{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.team-member-detail{margin:18px 0;padding:18px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,#f8fafc,#eefbf8)}.team-member-detail h3{margin:0 0 8px}.team-member-detail p{margin:0;color:var(--muted);font-weight:700}.team-member-detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:16px}.team-member-metric{padding:14px;border:1px solid #dbeafe;border-radius:14px;background:#fff}.team-member-metric strong{display:block;font-size:28px;line-height:1.1}.team-member-metric span{display:block;margin-top:6px;color:var(--muted);font-size:13px;font-weight:700}.team-chart-controls{display:grid;gap:8px;min-width:260px;max-width:320px}.team-chart-controls label{margin:0;font-size:13px}.team-chart-controls select{min-height:152px;padding:10px 12px;font-size:14px}.team-chart-controls .muted{margin:0;font-size:12px}.chart-panel{border:1px solid var(--line);border-radius:14px;background:#fff;padding:16px;display:grid;gap:14px}.chart-empty{color:var(--muted);font-weight:700}.chart-range-note{margin:0;color:var(--muted);font-size:12px;font-weight:700}.chart-legend{display:flex;flex-wrap:wrap;gap:12px}.chart-legend-item{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:700}.chart-swatch{width:12px;height:12px;border-radius:999px;display:inline-block}.chart-svg{width:100%;height:auto;display:block}.chart-axis-label{fill:#64748b;font-size:11px}.chart-grid-line{stroke:#e2e8f0;stroke-width:1}.chart-day-boundary{stroke:#cbd5e1;stroke-width:1;stroke-dasharray:3 4}.chart-day-band{pointer-events:none}.chart-bar{opacity:.92}.chart-bar:hover{opacity:1}.chart-line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart-point{stroke:#fff;stroke-width:2}
.team-controls-grid{display:grid;grid-template-columns:minmax(260px,330px) minmax(320px,1fr);gap:16px;margin-top:16px;align-items:stretch}.kpi-settings-panel{border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:14px}.kpi-settings-panel h3{margin-bottom:4px}.compact-form-grid{grid-template-columns:repeat(2,minmax(0,220px));align-items:end}.chart-category-tabs{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.chart-tab-btn{width:auto;min-width:112px;padding:10px 12px;font-size:13px}.chart-tab-btn.active{background:var(--primary);border-color:var(--primary);color:#fff}.display-body{background:#08131f;color:#e5f8f3}.display-shell{max-width:none;padding:24px}.display-header{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}.display-header h1{font-size:34px;letter-spacing:.02em}.display-header .muted,.display-body .muted{color:#9fb7b0}.display-filters{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.display-filters input,.display-filters button{width:auto;background:#10231e;color:#e5f8f3;border-color:#24443b}.display-target-card .row{align-items:stretch}.display-target-grid{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:12px;min-width:min(820px,100%)}.display-target-grid div{border:1px solid #24443b;border-radius:14px;background:#0d1d19;padding:14px}.display-target-grid span{display:block;color:#9fb7b0;font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.display-target-grid strong{display:block;margin-top:8px;color:#6ee7b7;font-size:28px;line-height:1}.display-body .card{background:#10231e;color:#e5f8f3;border:1px solid #1f3b34;box-shadow:0 14px 36px rgba(0,0,0,.22)}.display-body .chart-panel,.display-body .table-wrap,.display-body table,.display-body th,.display-body td{background:#0d1d19;color:#e5f8f3;border-color:#1f3b34}.display-body thead th{background:#142a24}.display-stat p{color:#6ee7b7}.display-body .chart-grid-line{stroke:#24443b}.display-body .chart-day-boundary{stroke:#31574d}.display-body .chart-axis-label{fill:#9fb7b0}
.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}.report-grid .card{margin-bottom:0}.report-chart-panel{min-height:260px;align-content:start;overflow:auto}.report-bar-row{display:grid;grid-template-columns:minmax(120px,190px) minmax(120px,1fr) 70px;gap:10px;align-items:center}.report-bar-row span{font-size:12px;font-weight:800;color:#334155;line-height:1.2}.report-bar-row strong{text-align:right;font-variant-numeric:tabular-nums}.report-bar-track{height:18px;border-radius:999px;background:#e2e8f0;overflow:hidden}.report-bar-fill{height:100%;border-radius:999px}.report-stat-card{margin-bottom:0}
.login-profiles{grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px;max-height:260px;overflow:auto}.login-profile-btn{padding:10px 12px;min-height:62px}.login-profile-btn strong{font-size:13px;line-height:1.15}.login-profile-btn span{font-size:11px;line-height:1.2}.kpi-availability-panel{border:1px solid var(--line);border-radius:14px;background:#fff;padding:14px}.availability-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;max-height:420px;overflow:auto;padding-right:4px}.availability-day-card{border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:12px;display:grid;gap:8px}.availability-day-header{display:flex;justify-content:space-between;gap:8px;align-items:center}.availability-day-header span{display:flex;gap:6px}.availability-operator{display:flex;gap:8px;align-items:center;margin:0;font-size:13px;font-weight:700}.availability-operator input{margin:0}.chart-category-tabs{justify-content:flex-start;align-items:center}.chart-category-check{display:inline-flex;align-items:center;gap:6px;width:auto;min-width:0;margin:0;padding:8px 10px;border:1px solid #cbd5e1;border-radius:999px;background:#fff;color:#0f172a;font-size:11px;font-weight:800;line-height:1.1;cursor:pointer}.chart-category-check input{margin:0}.chart-category-check.active{background:var(--primary);border-color:var(--primary);color:#fff}.display-body .chart-category-check{background:#0d1d19;color:#e5f8f3;border-color:#24443b}.display-body .chart-category-check.active{background:#0f766e;border-color:#2dd4bf}.chart-bar-label{fill:#0f172a;font-size:10px;font-weight:800}
.table-history-compact th,.table-history-compact td{padding:6px 7px;font-size:11px;line-height:1.18}.table-history-compact thead th{font-size:10px;letter-spacing:.01em}.table-history-compact .actions-cell button{padding:7px 9px;font-size:11px;border-radius:10px}.table-history-compact .field-created-at,.table-history-compact .field-updated-at,.table-history-compact .field-effective-date{max-width:118px;white-space:normal;overflow-wrap:anywhere}.table-history-compact .field-review-notes,.table-history-compact .field-notes,.table-history-compact .field-wipe-confirmation-statement,.table-history-compact .field-electronic-signature{max-width:220px;white-space:normal;overflow-wrap:anywhere}
.compact-checkbox{width:auto;margin:0;padding:10px 12px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;align-items:center;font-size:13px;white-space:nowrap}.compact-checkbox input{margin:0}.display-checkbox{background:#10231e;color:#e5f8f3;border-color:#24443b}
.table-wrap table{min-width:max-content}.table-frozen table,.table-scroll table{min-width:max-content;width:max-content}.table-history-compact .field-from-location,.table-history-compact .field-to-location,.table-history-compact .field-station-name,.table-history-compact .field-status{max-width:120px;white-space:nowrap}.table-history-compact .field-type{max-width:110px;white-space:nowrap}.table-history-compact .field-total-units{min-width:72px}
.dispatch-note-editor{margin-top:14px}.dispatch-note-status{padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc;font-weight:800}.dispatch-note-warning{margin:14px 0;padding:12px 14px;border:1px solid #fed7aa;border-radius:14px;background:#fff7ed;color:#9a3412;font-weight:800}.settings-logo-preview-wrap{margin-top:14px;min-height:70px}.settings-logo-preview{display:none;max-width:180px;max-height:90px;border:1px solid var(--line);border-radius:14px;background:#fff;padding:8px}.dispatch-note-editor textarea,.settings-only textarea{font-family:Arial,Helvetica,sans-serif}.field-customer-address,.field-customer-contact,.field-dispatch-reference,.field-transaction-reference{max-width:180px;white-space:normal;overflow-wrap:anywhere}
@media (max-width:1100px){.grid.four,.stats-grid,.team-member-detail-grid,.dashboard-summary-grid,.team-controls-grid,.display-target-grid,.report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}} @media (max-width:760px){.grid.two,.grid.four,.stats-grid,.team-member-detail-grid,.dashboard-summary-grid,.team-controls-grid,.compact-form-grid,.display-target-grid,.report-grid{grid-template-columns:1fr}.row,.row.spread,.row.end,.display-header{flex-direction:column;align-items:stretch}.topbar-actions button{min-width:0}.full-span{grid-column:auto}}


/* --- Mobile hamburger menu --- */
.menu-toggle{display:none;align-items:center;gap:10px;width:100%;padding:12px 16px;background:#0f172a;color:#fff;border:1px solid #334155;border-radius:10px;font-size:16px;font-weight:600;cursor:pointer}
.menu-toggle .menu-toggle-bars{position:relative;width:22px;height:2px;background:#fff;display:inline-block;flex:0 0 auto}
.menu-toggle .menu-toggle-bars::before,.menu-toggle .menu-toggle-bars::after{content:"";position:absolute;left:0;width:22px;height:2px;background:#fff}
.menu-toggle .menu-toggle-bars::before{top:-7px}
.menu-toggle .menu-toggle-bars::after{top:7px}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars{background:transparent}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before{top:0;transform:rotate(45deg)}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after{top:0;transform:rotate(-45deg)}
@media (max-width:760px){
  .menu-toggle{display:flex}
  .topbar-actions{display:none}
  .topbar-actions.open{display:grid;grid-template-columns:1fr}
}

/* Embedded inside the kiosk screen: no app header or menu, and no booking form (booking is done with the kiosk buckets). */
.embedded .topbar{display:none}
.embedded main{padding:12px}
.embedded #transactions > .card:first-child{display:none}

/* Team Insights: one folder per team member */
.operator-folders-h{margin:14px 0 4px}
.operator-folders{display:flex;flex-wrap:wrap;gap:16px;margin:14px 0 18px;padding-top:6px}
.operator-folder{position:relative;min-width:190px;padding:14px 16px;border:2px solid #cbd5e1;border-radius:4px 16px 16px 16px;background:#fff;color:#0f172a;text-align:left;display:flex;flex-direction:column;gap:3px;cursor:pointer;width:auto}
.operator-folder::before{content:"";position:absolute;left:-2px;top:-12px;width:64px;height:12px;background:#fff;border:2px solid #cbd5e1;border-bottom:0;border-radius:8px 8px 0 0}
.operator-folder strong{font-size:17px}
.operator-folder span{font-size:13px;color:#475569;font-weight:600}
.operator-folder.active{border-color:#0f766e;background:#f0fdfa;box-shadow:0 0 0 3px rgba(15,118,110,.18)}
.operator-folder.active::before{border-color:#0f766e;background:#f0fdfa}
.operator-folder.whole{border-style:dashed}

/* Receipt Values */
.val-switch{gap:10px;margin-top:8px}
.val-switch button.active{outline:3px solid #5eead4}
.val-actions{gap:10px;flex-wrap:wrap;margin-top:12px}
.val-actions button{width:auto}
.val-table input[type=text],.val-table input[type=number],.val-table input[type=date],.val-table select{width:100%;min-width:130px}
.val-table td{vertical-align:middle}
.val-table .val-num,.val-num{text-align:right;white-space:nowrap}
.val-sub{display:block;color:#64748b;font-size:11px;font-weight:600}
.val-head{align-items:center;flex-wrap:wrap}
.val-table tfoot td{background:#f1f5f9;font-size:14px}

/* Stock by Location matrix: clear gridlines between every column and row */
.stock-matrix-wrap{overflow:auto;max-height:78vh}
.stock-matrix{border-collapse:separate;border-spacing:0;width:100%;min-width:760px;font-size:14px;border-top:2px solid #334155;border-left:2px solid #334155}
.stock-matrix th,.stock-matrix td{border-bottom:1px solid #94a3b8;border-right:1px solid #475569;padding:8px 10px;background:#fff;white-space:nowrap}
.stock-matrix tr > :last-child{border-right:2px solid #334155}
.stock-matrix tbody tr:last-child > *{border-bottom:2px solid #334155}
.stock-matrix thead th{position:sticky;top:0;z-index:3;background:#0f766e;color:#fff;font-size:12px;white-space:normal;text-align:center;line-height:1.2;vertical-align:bottom;border-right:1px solid #ccfbf1;border-bottom:2px solid #334155}
.stock-matrix thead th:last-child{border-right:2px solid #334155}
.stock-matrix thead th.stock-name{text-align:left;min-width:170px;background:#0f766e;color:#fff;border-right:2px solid #334155}
.stock-matrix .stock-name{position:sticky;left:0;z-index:2;font-weight:500;background:#fff;border-right:2px solid #334155}
.stock-matrix thead th.stock-name{z-index:4}
.stock-matrix tr.stock-family th{background:#e2e8f0;color:#0f172a;font-size:15px;font-weight:800;text-align:left;padding:9px 10px;position:sticky;left:0;border-right:2px solid #334155}
.stock-matrix .stock-qty{text-align:right;font-weight:800;font-variant-numeric:tabular-nums}
.stock-matrix .stock-qty.zero{color:#9ca3af;font-weight:400}
.stock-matrix .stock-qty.neg{color:#b91c1c}
.stock-matrix tbody tr:not(.stock-family):hover td{background:#f0fdfa}
@media print{.stock-matrix-wrap{max-height:none;overflow:visible}.stock-matrix th,.stock-matrix td{border-color:#000}}
.stock-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.stock-actions button{width:auto;min-width:0}

/* ---- Transaction History: day-grouped list ---- */
.hx-search{margin:4px 0 10px;padding:12px 14px;font-size:15px}
.hx-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.hx-chip{width:auto;padding:8px 14px;font-size:13px;border-radius:999px;border:1.5px solid #cbd5e1;background:#fff;color:#334155;min-height:36px}
.hx-chip.on{background:var(--chip,#0f172a);border-color:var(--chip,#0f172a);color:#fff}
#txQuickChips .hx-chip.on{background:#0f172a;border-color:#0f172a}
.hx-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:6px 0 14px}
.hx-tile{border:1px solid var(--line);border-left:5px solid var(--tile,#0f172a);border-radius:12px;padding:10px 14px;background:#fff}
.hx-tile-label{display:block;font-size:12px;font-weight:700;color:var(--muted)}
.hx-tile-value{display:block;font-size:26px;font-variant-numeric:tabular-nums}
.hx-day{margin-bottom:16px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}
.hx-day-head{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#0f172a;color:#fff;padding:10px 14px;font-size:14px}
.hx-day-head span{color:#cbd5e1;font-size:13px}
.hx-row{border-top:1px solid var(--line);border-left:6px solid var(--bucket,#64748b)}
.hx-day-head + .hx-row{border-top:0}
.hx-row.superseded{opacity:.6}
.hx-row-head{display:grid;grid-template-columns:60px minmax(0,1fr) auto;gap:12px;align-items:start;padding:11px 14px;cursor:pointer}
.hx-row-head:hover,.hx-row.open .hx-row-head{background:#f8fafc}
.hx-row-head:focus-visible{outline:3px solid #5eead4;outline-offset:-3px}
.hx-time{font-size:13px;color:var(--muted);font-weight:700;font-variant-numeric:tabular-nums;padding-top:3px}
.hx-top{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.hx-move{color:#fff;font-size:12px;font-weight:800;border-radius:999px;padding:3px 10px;white-space:nowrap}
.hx-route{font-size:14px;font-weight:700}
.hx-badge{font-size:11px;font-weight:800;border-radius:6px;padding:2px 7px}
.hx-badge.late{background:#fef3c7;color:#92400e}
.hx-badge.corrected{background:#e0e7ff;color:#3730a3}
.hx-badge.pending{background:#fee2e2;color:#991b1b}
.hx-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.hx-tag{font-size:12px;font-weight:700;padding:3px 9px;border-radius:8px;background:#f1f5f9;border-left:5px solid var(--fam,#cbd5e1)}
.hx-side{text-align:right}
.hx-units{display:block;font-size:20px;font-variant-numeric:tabular-nums}
.hx-who{display:block;font-size:12px;color:var(--muted);font-weight:700;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hx-detail{display:none;padding:6px 14px 14px 86px;background:#f8fafc;border-top:1px dashed var(--line);gap:4px}
.hx-row.open .hx-detail{display:grid}
.hx-detail-line{display:flex;gap:10px;font-size:13px}
.hx-detail-key{flex:0 0 150px;color:var(--muted);font-weight:700}
.hx-detail-val{font-weight:600;word-break:break-word}
.hx-detail-actions{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.hx-empty{text-align:center;color:var(--muted);padding:30px 0;font-weight:700}
.hx-foot{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:6px}
.hx-foot button{width:auto;padding:12px 20px;font-size:14px}
.hx-foot-top{justify-content:flex-start;margin:0 0 10px}
@media (max-width:760px){
  .hx-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hx-row-head{grid-template-columns:minmax(0,1fr) auto;row-gap:2px}
  .hx-time{grid-column:1 / -1;padding-top:0}
  .hx-detail{padding-left:14px}
  .hx-detail-key{flex-basis:110px}
}
.hx-tools{margin:0 0 12px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}
.hx-tools summary{cursor:pointer;padding:10px 14px;font-size:14px;font-weight:700;list-style-position:inside}
.hx-tools .filter-row{justify-content:flex-start;padding:4px 14px 14px;gap:8px}
@media (max-width:760px){.hx-tools .filter-row input,.hx-tools .filter-row button{flex:1 1 45%}}

/* ---- user access ---- */
.perm-box{border:1px solid var(--line);border-radius:12px;padding:10px 14px;background:#f8fafc;margin-bottom:12px}
.perm-note{margin:2px 0 8px;font-size:13px}
.perm-line{display:flex;gap:10px;align-items:flex-start;margin:0;padding:8px 0;font-weight:400;border-top:1px solid var(--line)}
.perm-line input{width:22px;height:22px;margin:2px 0 0;flex:0 0 auto}
.perm-line strong{display:block;font-size:14px}
.perm-line small{display:block;color:var(--muted);font-size:12px;line-height:1.4}
.val-draft-status{min-height:20px;margin:2px 0 8px;font-size:13px;font-weight:700}
.stock-matrix tr.stock-total > *{font-weight:700;background:#f1f5f9;border-top:2px solid #334155}
.table-row-clickable td.field-id{color:#0f766e;font-weight:700;text-decoration:underline;cursor:pointer}
.tx-modal{position:fixed;inset:0;z-index:1000;background:rgba(15,23,42,.55);display:flex;align-items:flex-start;justify-content:center;padding:6vh 14px;overflow:auto}
.tx-modal-card{background:#fff;border-radius:14px;width:min(640px,100%);box-shadow:0 20px 50px rgba(0,0,0,.3);overflow:hidden}
.tx-modal-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.tx-modal-head h3{margin:0;flex:1}
.tx-modal-route{margin:0;padding:10px 16px 0;font-weight:600}
.tx-modal-card .hx-tags{padding:8px 16px 0}
.tx-modal-card .hx-detail{padding:10px 16px 16px;border-top:0}
/* transaction tables: Stock-by-Location style header, roomy text columns */
.table-history-compact thead th{background:#0f766e;color:#fff;border-right:1px solid #ccfbf1;border-bottom:2px solid #334155;text-align:center;vertical-align:bottom;white-space:normal;line-height:1.2}
.table-history-compact thead th:last-child{border-right:0}
.table-history-compact thead th.field-from-location,.table-history-compact thead th.field-to-location{text-align:left}
.table-history-compact .field-from-location,.table-history-compact .field-to-location{min-width:210px;max-width:none;white-space:nowrap}
.table-history-compact .field-type{min-width:120px;max-width:none;white-space:nowrap}
.table-history-compact .field-effective-date{min-width:92px;max-width:none;white-space:nowrap}
.table-history-compact .field-id{min-width:56px}
.table-history-compact .field-created-by-user-id{min-width:72px}
.table-history-compact .field-total-units{min-width:76px}
.table-history-compact td.category-cell{min-width:44px;text-align:center}
.table-history-compact thead th.field-moved-from,.table-history-compact thead th.field-moved-to{text-align:left}
.table-history-compact .field-moved-from,.table-history-compact .field-moved-to{min-width:190px;max-width:none;white-space:nowrap}
/* transaction window: full width */
.tx-modal{padding:0;align-items:stretch}
.tx-modal-card{width:100%;max-width:none;min-height:100%;border-radius:0;box-shadow:none}
.tx-modal-head{padding:18px 28px;position:sticky;top:0;background:#fff;z-index:1}
.tx-modal-route{padding:14px 28px 0;font-size:18px}
.tx-modal-card .hx-tags{padding:10px 28px 0}
.tx-modal-card .hx-detail{padding:14px 28px 28px;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:8px 36px}
.tx-modal-card .hx-detail-actions{grid-column:1/-1}
.table-history-compact .field-entered-by{min-width:150px;max-width:none;white-space:nowrap}
.table-history-compact th.category-solo{min-width:0;width:96px;max-width:96px;white-space:normal;overflow-wrap:anywhere;word-break:normal;hyphens:auto;font-size:10px;line-height:1.15}
.table-history-compact th.category-family-group:not([data-family="android"]):not([data-family="iphone"]):not([data-family="android-tablet"]):not([data-family="ipad"]){background:#c4b5fd}
/* transaction window: true full screen, roomier text */
.tx-modal{position:fixed;inset:0;width:100vw;height:100vh;padding:0;align-items:stretch;justify-content:stretch;overflow:auto}
.tx-modal-card{flex:1 1 auto;width:100%;max-width:none;min-height:100%}
.tx-modal-head h3{font-size:24px}
.tx-modal-route{font-size:20px}
.tx-modal-card .hx-detail{grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px 40px;padding:18px 32px 32px}
.tx-modal-card .hx-detail-line{font-size:16px}
.tx-modal-card .hx-detail-key{flex-basis:170px}
.tx-modal-card .hx-tag{font-size:15px;padding:6px 12px}
/* borders everywhere: a full grid on every data table */
table:not(.stock-matrix){border-top:1px solid #64748b;border-left:1px solid #64748b}
table:not(.stock-matrix) th,table:not(.stock-matrix) td{border-right:1px solid #94a3b8;border-bottom:1px solid #94a3b8}
table:not(.stock-matrix) thead th{border-bottom:2px solid #64748b}
table.table-history-compact thead th{border-right:1px solid #ccfbf1}
table.table-history-compact thead th:last-child{border-right:1px solid #94a3b8}
.table-split .table-scroll table{border-left:0}
/* the transaction window: every line boxed */
.tx-modal-card .hx-detail-line{border:1px solid #cbd5e1;border-radius:8px;padding:8px 12px;background:#fff}
/* Team Activity: date filter row, key column, by-day rows */
.ta-controls{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:flex-end;margin:12px 0 4px}
.ta-controls label{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:700;color:var(--muted)}
.ta-controls input[type="date"]{width:auto}
.ta-controls button{width:auto}
.ta-controls label.compact-checkbox{flex-direction:row;align-items:center;font-size:13px;color:inherit}
.ta-period{margin:4px 0 8px;font-weight:700}
.stock-matrix .stock-key{background:#ecfdf5;font-weight:800}
.stock-matrix thead th.stock-key{background:#065f46}
.stock-matrix td.stock-date{white-space:nowrap;font-weight:700;background:#f8fafc}
.stock-matrix .no-stick{position:static}
.stock-matrix tr.stock-daytotal > *{background:#f1f5f9;font-weight:700}
/* Stock page: the Failed column is a total of the failed locations next to it */
.stock-matrix thead th.stock-failed{background:#c2410c}
.stock-matrix td.stock-failed{background:#fff7ed;font-weight:800}
/* Receipt sheet: Add to Goods In */
.val-gi{min-width:150px}
.val-gi-btn{width:auto;white-space:nowrap}
.val-gi-done{display:block;font-weight:700;color:#065f46}
.val-gi-overlay{position:fixed;inset:0;z-index:3000;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:16px}
.val-gi-box{background:#fff;border-radius:14px;padding:20px;width:min(460px,100%);box-shadow:0 20px 50px rgba(0,0,0,.3)}
.val-gi-box h3{margin:0 0 8px}
.val-gi-box p{margin:0 0 12px;line-height:1.4}
.val-gi-grade{width:100%;margin-bottom:8px}
.val-gi-err{color:#b91c1c;font-weight:700;min-height:1em}
.val-gi-actions{display:flex;gap:10px;justify-content:flex-end}
.val-gi-actions button{width:auto}
