:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f5f7fb;--border:#dfe5ef;--primary:#315efb;--success:#137a4b;--danger:#b42318;--warning:#b76e00;--sidebar:#fff}*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,select,textarea{font:inherit}button{border:0;border-radius:9px;padding:10px 15px;background:var(--primary);color:#fff;cursor:pointer;font-weight:700}button.secondary{background:#fff;color:#27324a;border:1px solid var(--border)}button.text-button{background:transparent;color:#526078;padding:4px}.hidden{display:none!important}.card{background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 5px 20px rgba(20,30,55,.04)}h1,h2,p{margin-top:0}h2{margin-bottom:6px;font-size:19px}p{color:#67728a}.message{min-height:20px}.message.success{color:var(--success)}.message.error{color:var(--danger)}
.login-screen{position:fixed;inset:0;display:grid;place-items:center;background:linear-gradient(135deg,#edf2ff,#f8f9fd);z-index:1000;padding:24px}.login-card{width:min(420px,100%);background:#fff;border:1px solid var(--border);border-radius:18px;padding:34px;box-shadow:0 24px 70px rgba(30,46,90,.16);display:grid;gap:15px}.login-card h1{margin:0}.login-card p{margin:0 0 6px}.login-card label,.dialog-card label{display:grid;gap:6px;color:#4c5870;font-size:13px;font-weight:700}.login-card input,.dialog-card input,.dialog-card textarea,.dialog-card select,#urlInput,#searchInput{width:100%;border:1px solid var(--border);border-radius:9px;padding:10px 11px;background:#fff}.login-card small{color:#7a8498;line-height:1.5}.brand-mark{display:grid;place-items:center;width:48px;height:48px;border-radius:13px;background:#315efb;color:#fff;font-weight:900}.brand-mark.small{width:34px;height:34px;border-radius:9px;font-size:12px}
.app-shell{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;background:var(--sidebar);border-right:1px solid var(--border);padding:18px 12px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 22px;font-size:18px}.main-nav{display:grid;gap:5px}.nav-item{display:flex;align-items:center;gap:11px;width:100%;background:transparent;color:#4a5770;text-align:left;padding:11px 12px}.nav-item:hover{background:#f3f6fd}.nav-item.active{background:#eaf0ff;color:#244ed5}.sidebar-footer{margin-top:auto;padding:14px 10px;border-top:1px solid var(--border);display:flex;justify-content:space-between;gap:8px;align-items:center}.sidebar-footer small,.sidebar-footer strong{display:block}.page-shell{min-width:0}.page-header{height:74px;background:#fff;border-bottom:1px solid var(--border);padding:14px 26px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:20}.page-header h1{font-size:22px;margin:0}.page-header p{font-size:12px;margin:4px 0 0}.page-shell main{padding:22px 26px 60px;max-width:1900px;margin:auto}
.import-panel{padding:19px;display:grid;grid-template-columns:minmax(240px,.8fr) minmax(400px,1.5fr);gap:20px;align-items:center}#importForm{display:flex;gap:10px}.import-panel .message{grid-column:1/-1}.dashboard{display:grid;grid-template-columns:repeat(6,minmax(125px,1fr));gap:12px;margin:17px 0}.metric{background:#fff;border:1px solid var(--border);padding:14px;border-radius:12px}.metric span{color:#6b758b;display:block;font-size:12px}.metric strong{font-size:21px;margin-top:7px;display:block}.dashboard-detail,.page-card{padding:20px}.dashboard-detail-grid,.report-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px;margin-top:15px}.detail-tile,.report-tile{border:1px solid var(--border);border-radius:11px;padding:14px}.detail-tile span,.report-tile span{font-size:12px;color:#68748b;display:block}.detail-tile strong,.report-tile strong{font-size:20px;margin-top:6px;display:block}
.workspace-shell{overflow:hidden}.workspace-toolbar{padding:17px 19px;display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid var(--border)}.workspace-toolbar p{margin:0;font-size:13px}#searchInput{max-width:380px}.workspace-list{padding:12px;display:grid;gap:12px}.workspace{border:1px solid var(--border);border-radius:12px;overflow:hidden}.workspace>.workspace-header{display:flex;gap:5px;align-items:center;background:#f8faff;padding:0}.workspace-header>button.workspace-header{flex:1;width:auto;display:flex;gap:10px;align-items:center;background:transparent;color:#172033;text-align:left;border-radius:0;padding:12px 11px}.workspace-header:hover{background:#f1f5ff}.workspace-title{font-weight:850;flex:1}.workspace-meta{font-size:12px;color:#6d7890;font-weight:600}.favorite-button{background:transparent;color:#9b7a00;padding:8px 4px 8px 14px;font-size:18px}.workspace-body.collapsed{display:none}.table-wrap{overflow:auto;max-height:64vh}.table-wrap table{width:100%;border-collapse:separate;border-spacing:0;min-width:1420px;table-layout:auto}th{position:sticky;top:0;z-index:2;background:#f7f9fd;color:#4b566e;text-align:left;font-size:10px;letter-spacing:.02em;padding:8px 7px;border-bottom:1px solid var(--border);white-space:nowrap}td{padding:5px 7px;border-bottom:1px solid #edf0f6;border-right:1px solid #f1f3f8;font-size:11.5px;background:#fff;vertical-align:middle;height:48px;white-space:nowrap}td[contenteditable=true]{cursor:text}td[contenteditable=true]:focus,.editable-model:focus{outline:2px solid var(--primary);outline-offset:-2px;background:#f4f7ff}tr:hover td{background:#fbfcff}.col-product_id{width:68px;min-width:68px}.col-type{width:90px;min-width:82px;white-space:normal}.col-model{width:96px;min-width:90px}.col-year{width:58px;min-width:54px}.col-color{width:72px;min-width:65px}.col-chip{width:54px;min-width:50px}.col-ram{width:56px;min-width:52px}.col-storage{width:66px;min-width:62px}.col-battery{width:62px;min-width:58px}.col-product_fees{width:124px;min-width:120px}.col-repair_fees{width:86px;min-width:82px}.col-total_cost{width:90px}.col-listing_title{min-width:220px;max-width:250px}.product-id{font-weight:850;color:#244ed5}.model-cell{display:grid;gap:3px;min-width:82px}.editable-model{font-weight:750;padding:2px 3px;border-radius:4px;min-height:18px}.country-pill{display:inline-flex;width:max-content;border-radius:999px;padding:2px 7px;font-size:9px;font-weight:850;color:#fff;cursor:pointer}.country-JP{background:#7c3aed}.country-US{background:#159447}.country-UK{background:#2563eb}.country-AU{background:#ea7b17}.country-CN{background:#d83a3a}.country-KR{background:#0891b2}.country-other{background:#6b7280}.status{border-radius:999px;padding:4px 8px;font-weight:750;background:#eef2ff}.smart-cell{display:grid;gap:2px;background:transparent;color:#172033;padding:0;text-align:left;width:100%}.smart-main{font-size:13px;font-weight:850}.smart-sub{color:#738099;font-size:9px;white-space:nowrap;letter-spacing:-.01em}.smart-warning{color:#d98200;font-size:12px;margin-left:3px}.notes-button{background:transparent;color:#27324a;padding:4px 5px}.progress{display:flex;align-items:center;gap:6px;min-width:92px}.progress-bar{width:52px;height:6px;background:#e6eaf2;border-radius:99px;overflow:hidden}.progress-bar i{display:block;height:100%;background:var(--primary)}.row-button{padding:5px 7px;font-size:10px}.source-link{color:#315efb;font-weight:750;text-decoration:none}.title-preview{display:block;width:220px;max-width:220px;padding:0;border:0;background:transparent;color:#33415f;font-weight:500;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.empty{padding:40px;text-align:center;color:#6b758b}
.simple-table-wrap{overflow:auto;margin-top:15px}.simple-table{width:100%;border-collapse:collapse}.simple-table th,.simple-table td{position:static;height:auto;padding:11px;border-bottom:1px solid var(--border);font-size:12px;background:#fff}.section-heading{display:flex;justify-content:space-between}.settings-card{max-width:900px}.settings-row{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:12px;padding:16px 0;border-bottom:1px solid var(--border)}.settings-row p{margin:4px 0 0;font-size:12px}.settings-value{color:#4d5a72;font-weight:750}
dialog{border:0;border-radius:16px;padding:0;width:min(620px,calc(100vw - 32px));max-height:88vh;box-shadow:0 25px 80px rgba(22,30,52,.28)}dialog::backdrop{background:rgba(20,27,43,.55)}.dialog-card{position:relative;padding:24px;display:grid;gap:13px;max-height:88vh;overflow:auto}.dialog-card .close{position:absolute;right:13px;top:12px;background:transparent;color:#27324a;font-size:22px;padding:3px 8px}.dialog-card textarea{min-height:70px;resize:vertical}.dialog-total{display:flex;justify-content:space-between;border-top:1px solid var(--border);padding-top:12px}.field-grid.two,.notes-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.repair-items{display:grid;gap:7px;max-height:220px;overflow:auto}.repair-item{display:grid;grid-template-columns:1fr auto auto;gap:9px;align-items:center;border:1px solid var(--border);border-radius:9px;padding:8px}.repair-item button{padding:5px 8px;font-size:10px}.inline-form{display:grid;grid-template-columns:minmax(180px,1fr) 120px auto;gap:8px}.full-listing-title{color:#172033;line-height:1.6;white-space:pre-wrap}pre{white-space:pre-wrap;max-height:220px;overflow:auto;background:#f6f8fc;padding:10px;border-radius:8px}
@media(max-width:1000px){.app-shell{grid-template-columns:76px minmax(0,1fr)}.brand strong,.nav-item span,.sidebar-footer div{display:none}.nav-item{justify-content:center;font-size:18px}.dashboard{grid-template-columns:repeat(3,1fr)}.import-panel{grid-template-columns:1fr}.import-panel .message{grid-column:auto}}@media(max-width:700px){.page-shell main{padding:14px}.page-header{padding:12px 14px}.dashboard{grid-template-columns:repeat(2,1fr)}.field-grid.two,.notes-grid{grid-template-columns:1fr}.inline-form{grid-template-columns:1fr}.workspace-toolbar{align-items:stretch;flex-direction:column}#searchInput{max-width:none}}

.inventory-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}.scope-tabs{display:inline-flex;border:1px solid var(--border);border-radius:10px;padding:3px;background:#f6f8fc}.scope-tab{background:transparent;color:#5c6880;padding:6px 11px;border-radius:7px;font-size:11px}.scope-tab.active{background:#fff;color:#244ed5;box-shadow:0 1px 5px rgba(31,53,105,.12)}.product-age-cell{display:block;margin:-5px -7px;padding:12px 7px;min-height:48px;border-radius:5px;font-weight:650;transition:background .2s ease}.product-age-cell.age-30{background:#fff6d9}.product-age-cell.age-45{background:#ffedbd}.product-age-cell.age-60{background:#ffdda1}.product-age-cell.age-90{background:#f7c7c2;color:#7b241c}.product-age-cell.fresh{background:transparent}@media(max-width:700px){.inventory-tools{align-items:stretch;flex-direction:column}.scope-tabs{width:100%;display:grid;grid-template-columns:repeat(4,1fr)}.scope-tab{padding:7px 5px}}

/* Part 2: Excel-style grid foundation */
.selection-toolbar{margin:12px 12px 0;padding:10px 12px;border:1px solid #cdd9ff;border-radius:10px;background:#f3f6ff;display:flex;align-items:center;gap:12px;position:sticky;top:74px;z-index:12}.selection-toolbar strong{color:#244ed5}.selection-hint{font-size:11px;color:#6c7890}.selection-actions{margin-left:auto;display:flex;align-items:center;gap:8px}.selection-actions button{padding:7px 10px;font-size:11px}.workspace-empty{padding:24px;text-align:center;color:#788399;background:#fff}.table-wrap{position:relative}.table-wrap table{border-collapse:separate}.selection-column{width:38px;min-width:38px;max-width:38px;text-align:center;padding-left:7px;padding-right:7px}.selection-column input{width:15px;height:15px;accent-color:var(--primary);cursor:pointer}.pinned-select{position:sticky!important;left:0;z-index:8!important;background:#f7f9fd!important}.table-wrap tbody .pinned-select{background:#fff!important;z-index:6!important}.col-product_id.pinned-data-column{position:sticky;left:38px;z-index:5;background:#fff}.table-wrap thead .col-product_id{z-index:9;background:#f7f9fd}.col-type.pinned-data-column{position:sticky;left:106px;z-index:5;background:#fff}.table-wrap thead .col-type{z-index:9;background:#f7f9fd}.col-status.pinned-data-column{position:sticky;left:196px;z-index:5;background:#fff;box-shadow:5px 0 8px -7px rgba(35,49,82,.55)}.table-wrap thead .col-status{z-index:9;background:#f7f9fd}.col-status{width:86px;min-width:86px}.row-selected td{background:#edf3ff!important}.row-selected .pinned-data-column,.row-selected .pinned-select{background:#e7efff!important}.header-label{display:block;overflow:hidden;text-overflow:ellipsis}.column-resizer{position:absolute;right:-3px;top:0;width:7px;height:100%;cursor:col-resize;z-index:4}.column-resizer:hover,.column-resizer:active{background:rgba(49,94,251,.25)}th[data-column-key]{cursor:grab;user-select:none}th[data-column-key]:active{cursor:grabbing}.column-dragging{opacity:.45}.column-drop-target{box-shadow:inset 3px 0 0 var(--primary)}
@media(max-width:700px){.selection-toolbar{position:static;align-items:flex-start;flex-wrap:wrap}.selection-actions{margin-left:0;width:100%}.selection-hint{display:none}}

/* Part 2 alignment refinement */
.col-product_id{width:72px;min-width:72px}
.col-type{width:118px;min-width:118px;padding-left:10px!important;padding-right:14px!important}
.col-model{width:112px;min-width:104px;padding-left:14px!important}
.col-year{width:56px;min-width:52px}
.col-color{width:68px;min-width:62px}
.col-chip{width:58px;min-width:54px}
.col-ram{width:56px;min-width:52px}
.col-storage{width:68px;min-width:64px}
.col-battery{width:64px;min-width:60px}
.col-status{width:92px;min-width:92px}

/* Left frozen area: checkbox + ID + Product only. */
.col-product_id.pinned-data-column{left:38px}
.col-type.pinned-data-column{left:110px;box-shadow:7px 0 10px -9px rgba(35,49,82,.75)}
.table-wrap thead .col-type{box-shadow:7px 0 10px -9px rgba(35,49,82,.75)}

/* Status stays visible at the far right instead of occupying the left frozen area. */
.pinned-right-column{position:sticky!important;right:0;z-index:7;background:#fff!important;box-shadow:-7px 0 10px -9px rgba(35,49,82,.75)}
.table-wrap thead .pinned-right-column{z-index:10;background:#f7f9fd!important}
.row-selected .pinned-right-column{background:#e7efff!important}

/* Cleaner row/header rhythm. */
th{padding:9px 8px}
td{padding:6px 8px;height:50px}
.table-wrap{scroll-padding-left:228px}


/* Compact core inventory columns */
.col-product_id{width:62px;min-width:62px;max-width:62px;padding-left:6px!important;padding-right:6px!important}
.col-type{width:98px;min-width:98px;max-width:118px;padding-left:8px!important;padding-right:10px!important}
.col-model{width:94px;min-width:88px;max-width:112px;padding-left:10px!important;padding-right:7px!important}
.col-color{width:58px;min-width:54px;max-width:72px;padding-left:6px!important;padding-right:6px!important}
.col-status{width:74px;min-width:74px;max-width:82px;padding-left:5px!important;padding-right:5px!important;font-size:10px}
.col-product_id.pinned-data-column{left:38px}
.col-type.pinned-data-column{left:100px}
.product-id{font-size:10.5px}
.product-age-cell{font-size:10.5px;padding-left:6px;padding-right:6px}
.model-cell{min-width:76px;gap:2px}
.editable-model{font-size:10.5px;padding:1px 2px}
.country-pill{font-size:8px;padding:1px 6px}
.col-status .status,.status{font-size:9px;padding:3px 6px;line-height:1.15}


/* Collapsible application sidebar */
:root{--sidebar-width:220px;--sidebar-collapsed-width:68px}
.app-shell{grid-template-columns:var(--sidebar-width) minmax(0,1fr);transition:grid-template-columns .2s ease}
.sidebar{width:var(--sidebar-width);overflow:hidden;transition:width .2s ease,padding .2s ease}
.brand{position:relative;min-height:40px;padding-right:38px;white-space:nowrap}
.sidebar-toggle{position:absolute;right:4px;top:5px;width:30px;height:30px;display:grid;place-items:center;padding:0;border:1px solid var(--border);border-radius:8px;background:#fff;color:#526078;font-size:20px;line-height:1;box-shadow:0 2px 8px rgba(20,30,55,.05)}
.sidebar-toggle:hover{background:#f3f6fd;color:#244ed5}
.nav-item{white-space:nowrap;overflow:hidden}
.nav-item>span{overflow:hidden;text-overflow:ellipsis}
.sidebar-logout{display:flex;align-items:center;gap:7px;white-space:nowrap}
.logout-icon{font-size:17px}
body.sidebar-collapsed{--sidebar-width:var(--sidebar-collapsed-width)}
body.sidebar-collapsed .sidebar{padding-left:8px;padding-right:8px}
body.sidebar-collapsed .brand{justify-content:center;padding:4px 0 22px}
body.sidebar-collapsed .brand strong,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-footer>div,
body.sidebar-collapsed .logout-label{display:none}
body.sidebar-collapsed .sidebar-toggle{right:-1px;top:7px;width:23px;height:23px;font-size:16px;border-radius:7px}
body.sidebar-collapsed .nav-item{justify-content:center;padding-left:8px;padding-right:8px;font-size:18px}
body.sidebar-collapsed .sidebar-footer{justify-content:center;padding-left:0;padding-right:0}
body.sidebar-collapsed .sidebar-logout{justify-content:center;padding:7px}
body.sidebar-collapsed .page-shell{min-width:0}
body.sidebar-collapsed .workspace-shell{max-width:none}
@media(max-width:1000px){:root{--sidebar-width:68px}.sidebar-toggle{display:none}.brand strong,.nav-item span,.sidebar-footer>div,.logout-label{display:none}.brand{justify-content:center;padding:4px 0 22px}.nav-item{justify-content:center;font-size:18px}.sidebar-footer{justify-content:center}.sidebar-logout{justify-content:center;padding:7px}}

/* Inclusive desktop condition/rank fields and mobile inventory cards */
.col-condition{width:132px;min-width:110px;max-width:180px}
.col-rank{width:58px;min-width:54px;max-width:72px;text-align:center}
.rank-pill{display:inline-flex;align-items:center;justify-content:center;min-width:28px;border-radius:999px;padding:2px 7px;font-size:9px;font-weight:850}
.rank-good{background:#dcfce7;color:#166534}
.rank-mid{background:#fef3c7;color:#92400e}
.rank-low{background:#ffedd5;color:#9a3412}
.rank-junk{background:#fee2e2;color:#991b1b}
.rank-neutral{background:#eef2f7;color:#566174}
.mobile-card-list{display:none}

@media(max-width:700px){
  .desktop-inventory-grid{display:none}
  .mobile-card-list{display:grid;gap:10px;padding:10px;background:#f7f9fd}
  .mobile-product-card{background:#fff;border:1px solid var(--border);border-radius:13px;padding:12px;box-shadow:0 3px 12px rgba(20,30,55,.04);display:grid;gap:9px}
  .mobile-product-card.selected{border-color:#8aa6ff;background:#f5f8ff}
  .mobile-card-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:9px}
  .mobile-select{padding-top:2px}.mobile-select input{width:17px;height:17px;accent-color:var(--primary)}
  .mobile-card-title{min-width:0;display:grid;gap:4px}.mobile-card-title>div:first-child{display:flex;gap:6px;align-items:baseline;min-width:0}.mobile-card-title strong{color:#244ed5}.mobile-card-title span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-card-badges{display:flex;gap:5px;align-items:center}
  .mobile-status{font-size:9px;font-weight:800;background:#eef2ff;color:#394b87;border-radius:999px;padding:4px 7px;max-width:86px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-card-meta{font-size:11px;color:#657189;font-weight:700}
  .mobile-preview{display:grid;gap:3px;width:100%;padding:8px 9px;border:1px solid #e7ebf3;background:#fbfcff;color:#27324a;text-align:left}
  .mobile-preview span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-condition{font-size:11px;font-weight:750}.mobile-note{font-size:10px;color:#6c7890}
  .mobile-finance{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.mobile-finance span{border:1px solid #edf0f5;border-radius:9px;padding:7px;min-width:0}.mobile-finance small{display:block;color:#7a8498;font-size:8px;text-transform:uppercase;letter-spacing:.03em}.mobile-finance strong{display:block;font-size:11px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-card-details{display:grid;gap:5px;padding:8px 9px;border-radius:9px;background:#f7f9fc;color:#59657b;font-size:10px}
  .mobile-card-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.mobile-card-actions button{padding:7px 6px;font-size:10px}
  .workspace-empty{padding:18px}
}

/* Mobile editable inventory workspace */
@media(max-width:700px){
  .mobile-product-card{gap:8px;padding:10px}
  .mobile-card-head{align-items:center}
  .mobile-card-title{display:flex;align-items:baseline;gap:7px;min-width:0}
  .mobile-card-title strong{color:#244ed5;font-size:12px}
  .mobile-card-title span{font-size:9px;color:#7a8498;white-space:nowrap}
  .mobile-primary-edit-grid,.mobile-secondary-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .mobile-spec-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .mobile-edit-field{display:grid;gap:3px;min-width:0}
  .mobile-edit-field>span{font-size:8px;font-weight:800;color:#7b8699;text-transform:uppercase;letter-spacing:.035em}
  .mobile-edit-field input,.mobile-edit-field select{width:100%;min-width:0;height:32px;border:1px solid #dfe5ef;border-radius:7px;background:#fff;padding:5px 7px;font:inherit;font-size:11px;color:#26324a;outline:none}
  .mobile-edit-field input:focus,.mobile-edit-field select:focus{border-color:#7797f8;box-shadow:0 0 0 2px rgba(74,112,230,.12)}
  .mobile-edit-field input.is-saving,.mobile-edit-field select.is-saving{opacity:.58}
  .mobile-field-wide{grid-column:1/-1}
  .mobile-spec-grid .mobile-edit-field>span{font-size:7px;text-align:center}
  .mobile-spec-grid input{height:30px;padding:4px;text-align:center;font-size:10px}
  .mobile-condition-field{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:6px;padding:0}
  .mobile-condition-field>span{font-size:8px}
  .mobile-condition-field input{height:29px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-details-toggle{width:100%;padding:7px;font-size:10px}
  .mobile-card-details{gap:9px;padding:9px}
  .mobile-detail-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .mobile-detail-actions button{padding:7px 5px;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-links{display:grid;gap:5px;padding-top:2px}
  .mobile-detail-link{font-size:10px;color:#315cd5;text-align:left;text-decoration:none}
  .button-link{border:0;background:transparent;padding:0;cursor:pointer}
  .mobile-muted{font-size:10px;color:#8b94a6}
  .mobile-card-actions{grid-template-columns:repeat(2,1fr)}
  .mobile-finance span{padding:6px}
}

@media(max-width:390px){
  .mobile-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* Compact mobile inventory cards */
@media(max-width:700px){
  .mobile-card-list{gap:6px;padding:6px}
  .mobile-product-card-compact{gap:5px;padding:7px 8px;border-radius:10px}
  .mobile-compact-head{display:grid;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:5px}
  .mobile-select{padding:0}.mobile-select input{width:14px;height:14px}
  .mobile-compact-title{display:flex;align-items:baseline;gap:5px;min-width:0;overflow:hidden}
  .mobile-compact-title strong{font-size:11px;color:#244ed5;flex:0 0 auto}
  .mobile-compact-title span{font-size:11px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-compact-badges{display:flex;align-items:center;gap:3px}
  .mobile-compact-badges .country-pill,.mobile-compact-badges .rank-pill{font-size:8px;min-width:22px;padding:2px 5px}
  .mobile-edit-icon{width:24px;height:24px;padding:0;border-radius:6px;font-size:12px;line-height:1}
  .mobile-compact-meta{display:flex;align-items:center;gap:5px;padding-left:23px;font-size:9px;color:#778197;font-weight:750}
  .mobile-compact-meta .mobile-status{padding:2px 5px;font-size:8px;max-width:92px}
  .mobile-compact-edit{margin-top:1px;padding:6px;border:1px solid #e5eaf2;border-radius:8px;background:#fafbfe;gap:5px}
  .mobile-spec-grid-compact{gap:3px}
  .mobile-spec-grid-compact .mobile-edit-field{gap:1px}
  .mobile-spec-grid-compact .mobile-edit-field>span{font-size:6.5px}
  .mobile-spec-grid-compact input{height:25px;padding:2px 3px;font-size:9px;border-radius:6px}
  .mobile-condition-compact{grid-template-columns:48px minmax(0,1fr);gap:4px}
  .mobile-condition-compact>span{font-size:7px}
  .mobile-condition-compact input{height:25px;padding:3px 6px;font-size:9px;border-radius:6px}
  .mobile-finance-compact{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
  .mobile-finance-compact .mobile-finance-static,.mobile-finance-compact .mobile-edit-field{min-width:0;border:1px solid #edf0f5;border-radius:7px;background:#fff;padding:4px;text-align:left;color:#26324a}
  .mobile-finance-compact .mobile-finance-static{display:block}
  .mobile-finance-compact small,.mobile-finance-compact .mobile-edit-field>span{display:block;font-size:6.5px;color:#7a8498;text-transform:uppercase;font-weight:800;letter-spacing:.02em}
  .mobile-finance-compact strong{display:block;font-size:9px;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-finance-compact .mobile-edit-field{gap:1px}
  .mobile-finance-compact input{height:18px;border:0;padding:0;font-size:9px;background:transparent;box-shadow:none}
  .mobile-compact-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
  .mobile-compact-actions button{padding:5px 4px;font-size:9px;border-radius:7px}
  .mobile-card-details{margin-top:1px;gap:6px;padding:7px}
}
@media(max-width:390px){
  .mobile-spec-grid-compact{grid-template-columns:repeat(4,minmax(0,1fr))}
  .mobile-finance-compact{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Compact mobile read-first specs and six-value pricing summary */
@media(max-width:700px){
  .mobile-spec-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
  .mobile-spec-strip span{min-width:0;padding:4px 3px;border:1px solid #edf0f5;border-radius:6px;background:#fbfcff;text-align:center;font-size:8.5px;font-weight:750;color:#40506b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-condition-line{min-width:0}
  .mobile-condition-input{display:block;width:100%;height:23px;border:1px solid #edf0f5;border-radius:6px;background:#fbfcff;padding:2px 6px;font:inherit;font-size:9px;color:#35425a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;outline:none}
  .mobile-condition-input:focus{border-color:#7797f8;box-shadow:0 0 0 2px rgba(74,112,230,.10);background:#fff}
  .mobile-condition-input.is-saving{opacity:.58}
  .mobile-finance-compact{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:350px){
  .mobile-finance-compact{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Part 3 bulk Mark Sold workflow */
.bulk-sale-dialog{width:min(960px,94vw);max-height:90vh;overflow:auto}
.bulk-sale-lines{margin-top:14px;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.bulk-sale-line{display:grid;grid-template-columns:minmax(160px,1.5fr) minmax(90px,.7fr) minmax(70px,.45fr) minmax(110px,.8fr) minmax(100px,.8fr) minmax(100px,.8fr);gap:10px;align-items:center;padding:9px 11px;border-top:1px solid var(--border);font-size:12px}
.bulk-sale-line:first-child{border-top:0}.bulk-sale-line-head{background:#f6f8fc;color:#657189;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.bulk-sale-line>span{min-width:0}.bulk-sale-line>span:first-child{display:grid;gap:2px}.bulk-sale-line small{color:#7b8699;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bulk-sale-line input{width:100%;min-width:0;padding:7px;border:1px solid #dfe5ef;border-radius:7px}
.bulk-sale-totals{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin-top:12px}.bulk-sale-totals span{padding:9px;border:1px solid var(--border);border-radius:9px;background:#fafbfe}.bulk-sale-totals small{display:block;color:#7b8699;font-size:9px;text-transform:uppercase}.bulk-sale-totals strong{display:block;margin-top:3px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
@media(max-width:700px){.bulk-sale-dialog{width:96vw;padding:14px}.bulk-sale-line-head{display:none}.bulk-sale-line{grid-template-columns:minmax(0,1fr) minmax(90px,.65fr);gap:6px;padding:8px}.bulk-sale-line>span:nth-child(2){text-align:right}.bulk-sale-line input{grid-column:1/-1}.bulk-sale-line [data-line-jpy]::before{content:"JPY ";color:#7b8699}.bulk-sale-line [data-line-profit]::before{content:"Profit ";color:#7b8699}.bulk-sale-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.bulk-sale-totals span:last-child{grid-column:1/-1}.bulk-sale-dialog .field-grid.two{grid-template-columns:1fr}}

/* Part 3 sale dialog responsive layout fix */
#bulkSaleDialog{
  width:min(980px,calc(100vw - 32px));
  max-width:980px;
  max-height:min(92vh,900px);
  overflow:hidden;
}
#bulkSaleDialog .bulk-sale-dialog{
  width:100%;
  max-width:none;
  max-height:min(92vh,900px);
  box-sizing:border-box;
  overflow:auto;
  padding:24px 28px;
}
#bulkSaleDialog .bulk-sale-lines{min-width:0}
#bulkSaleDialog .bulk-sale-line{
  grid-template-columns:minmax(190px,1.55fr) minmax(90px,.7fr) minmax(70px,.45fr) minmax(120px,.85fr) minmax(105px,.8fr) minmax(105px,.8fr);
}
#bulkSaleDialog .dialog-actions{
  position:sticky;
  bottom:-24px;
  z-index:3;
  margin:8px -28px -24px;
  padding:12px 28px;
  border-top:1px solid var(--border);
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
}

@media(max-width:700px){
  #bulkSaleDialog{
    width:calc(100vw - 12px);
    max-width:none;
    max-height:calc(100dvh - 12px);
    border-radius:14px;
  }
  #bulkSaleDialog .bulk-sale-dialog{
    width:100%;
    max-height:calc(100dvh - 12px);
    padding:14px 12px;
    gap:9px;
  }
  #bulkSaleDialog .bulk-sale-dialog h2{
    margin:0;
    padding-right:30px;
    font-size:18px;
    line-height:1.2;
  }
  #bulkSaleDialog #bulkSaleSubtitle{
    margin:0;
    font-size:12px;
  }
  #bulkSaleDialog .field-grid.two{
    grid-template-columns:1fr;
    gap:8px;
  }
  #bulkSaleDialog .bulk-sale-dialog label{
    gap:4px;
    font-size:11px;
  }
  #bulkSaleDialog .bulk-sale-dialog input,
  #bulkSaleDialog .bulk-sale-dialog textarea{
    padding:9px 10px;
    font-size:16px;
  }
  #bulkSaleDialog .bulk-sale-dialog textarea{
    min-height:54px;
  }
  #bulkSaleDialog .bulk-sale-lines{
    margin-top:4px;
    border-radius:9px;
  }
  #bulkSaleDialog .bulk-sale-line-head{display:none}
  #bulkSaleDialog .bulk-sale-line{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    padding:10px;
    font-size:11px;
  }
  #bulkSaleDialog .bulk-sale-line>span:first-child{
    grid-column:1/-1;
    padding-bottom:5px;
    border-bottom:1px solid #edf0f5;
  }
  #bulkSaleDialog .bulk-sale-line>span:nth-child(2),
  #bulkSaleDialog .bulk-sale-line [data-line-jpy],
  #bulkSaleDialog .bulk-sale-line [data-line-profit]{
    display:grid;
    gap:2px;
    text-align:left;
    min-width:0;
  }
  #bulkSaleDialog .bulk-sale-line>span:nth-child(2)::before{
    content:"Cost";
    color:#7b8699;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
  }
  #bulkSaleDialog .bulk-sale-line [data-line-jpy]::before{
    content:"JPY sale";
    color:#7b8699;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
  }
  #bulkSaleDialog .bulk-sale-line [data-line-profit]::before{
    content:"Profit";
    color:#7b8699;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
  }
  #bulkSaleDialog .bulk-sale-line input{
    grid-column:1/-1;
    height:38px;
    padding:7px 9px;
  }
  #bulkSaleDialog .bulk-sale-line input::before{content:none}
  #bulkSaleDialog .bulk-sale-line input{order:3}
  #bulkSaleDialog .bulk-sale-totals{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    margin-top:7px;
  }
  #bulkSaleDialog .bulk-sale-totals span{
    padding:7px 8px;
  }
  #bulkSaleDialog .bulk-sale-totals span:last-child{
    grid-column:auto;
  }
  #bulkSaleDialog .bulk-sale-totals strong{
    font-size:11px;
  }
  #bulkSaleDialog .dialog-actions{
    bottom:-14px;
    margin:5px -12px -14px;
    padding:10px 12px;
  }
  #bulkSaleDialog .dialog-actions button{
    flex:1;
    min-height:40px;
  }
}

@media(max-width:360px){
  #bulkSaleDialog .bulk-sale-totals{grid-template-columns:1fr 1fr}
  #bulkSaleDialog .bulk-sale-totals span:nth-child(5){grid-column:1/-1}
}

/* Part 4 sales workspace */
.sales-page-card{display:grid;gap:14px}.sales-heading{align-items:center;gap:14px}.sales-filter-bar{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}.sales-presets{display:flex;gap:4px;padding:4px;border:1px solid var(--border);border-radius:10px;background:#f6f8fc}.sales-presets button{border:0;background:transparent;color:#647087;padding:7px 10px;border-radius:7px;font-size:11px;font-weight:800}.sales-presets button.active{background:#fff;color:#244ed5;box-shadow:0 1px 4px rgba(35,52,90,.12)}.sales-custom-dates{display:flex;align-items:flex-end;gap:7px}.sales-custom-dates label{display:grid;gap:3px;color:#6f7a90;font-size:9px;font-weight:800;text-transform:uppercase}.sales-custom-dates input{height:34px;border:1px solid var(--border);border-radius:8px;padding:5px 8px;background:#fff}.sales-custom-dates button{height:34px;padding:0 12px}.sales-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.sales-summary-card{min-width:0;padding:11px;border:1px solid var(--border);border-radius:10px;background:#fafbfe}.sales-summary-card small{display:block;color:#7b8699;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}.sales-summary-card strong{display:block;margin-top:4px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sales-table-wrap{margin-top:0;border:1px solid var(--border);border-radius:10px}.sales-table th{position:sticky;top:0;z-index:1;background:#f5f7fb;color:#66728a;font-size:9px;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}.sales-table td{vertical-align:middle;white-space:nowrap}.sales-table td:nth-child(3),.sales-table td:nth-child(4){display:table-cell}.sales-table td:nth-child(3) small,.sales-table td:nth-child(4) small{display:block;max-width:180px;margin-top:2px;color:#7c879a;overflow:hidden;text-overflow:ellipsis}.sale-batch{display:inline-flex;padding:4px 7px;border-radius:999px;background:#edf2ff;color:#3158c8;font-size:9px;font-weight:850}.sale-batch.repeated{background:transparent;color:#9aa3b3}.positive{color:#157347!important}.negative{color:#b42318!important}.sales-empty{display:grid;place-items:center;gap:4px;min-height:180px;color:#7a8498}.sales-empty strong{color:#33405a}.sales-mobile-list{display:none}
@media(max-width:1000px){.sales-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.sales-page-card{padding:10px;gap:10px}.sales-heading{align-items:flex-start}.sales-heading h2{font-size:16px}.sales-heading p{font-size:10px}.sales-heading .secondary{padding:7px 9px;font-size:10px}.sales-filter-bar{display:grid;gap:7px}.sales-presets{width:100%;overflow:auto;scrollbar-width:none}.sales-presets::-webkit-scrollbar{display:none}.sales-presets button{flex:0 0 auto;padding:6px 8px;font-size:9px}.sales-custom-dates{display:grid;grid-template-columns:1fr 1fr auto;width:100%;align-items:end}.sales-custom-dates input{width:100%;min-width:0;height:31px;font-size:10px}.sales-custom-dates button{height:31px;padding:0 9px;font-size:9px}.sales-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.sales-summary-card{padding:7px}.sales-summary-card small{font-size:7px}.sales-summary-card strong{font-size:10px;margin-top:2px}.sales-table-wrap{display:none}.sales-mobile-list{display:grid;gap:6px}.sale-mobile-card{display:grid;gap:6px;padding:9px;border:1px solid var(--border);border-radius:10px;background:#fff}.sale-mobile-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.sale-mobile-head>div{display:flex;align-items:baseline;gap:5px;min-width:0}.sale-mobile-head strong{color:#244ed5;font-size:11px;flex:0 0 auto}.sale-mobile-head span:not(.sale-mobile-date){font-size:10px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sale-mobile-date{max-width:110px;color:#7a8498;font-size:8px;text-align:right}.sale-mobile-meta{display:flex;justify-content:space-between;gap:8px;color:#7a8498;font-size:8px}.sale-mobile-meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sale-mobile-money{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}.sale-mobile-money span{min-width:0;padding:5px 4px;border:1px solid #edf0f5;border-radius:7px;background:#fafbfe}.sale-mobile-money small{display:block;color:#7b8699;font-size:6.5px;text-transform:uppercase;font-weight:800}.sale-mobile-money strong{display:block;margin-top:1px;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:380px){.sales-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-mobile-money{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Part 4.1 grouped monthly sales history */
.sales-table-wrap{overflow:visible;background:transparent;border:0}
.sales-mobile-list{display:none!important}
.sales-month{margin-top:18px;border:1px solid var(--border);border-radius:16px;background:#f8fafc;overflow:hidden}
.sales-month-head{padding:15px 18px;background:#fff;border-bottom:1px solid var(--border)}
.sales-month-head h3{margin:0 0 4px;font-size:1.08rem}
.sales-month-head span{font-size:.82rem;color:var(--muted)}
.sales-month-batches{display:grid;gap:12px;padding:12px}
.sale-batch-card{background:#fff;border:1px solid #dbe3ef;border-left:5px solid #8b5cf6;border-radius:13px;overflow:hidden;box-shadow:0 2px 8px rgba(15,23,42,.04)}
.sale-batch-card:nth-child(3n+2){border-left-color:#0ea5e9}.sale-batch-card:nth-child(3n+3){border-left-color:#22c55e}
.sale-batch-head{padding:11px 14px;background:#f8fafc;border-bottom:1px solid var(--border)}
.sale-batch-head div{display:flex;justify-content:space-between;gap:12px;align-items:center}.sale-batch-head span{font-size:.78rem;color:var(--muted)}
.sale-batch-products{display:grid}
.sale-product-card{display:grid;grid-template-columns:minmax(230px,1.2fr) minmax(460px,2fr) auto;gap:14px;align-items:center;padding:12px 14px;border-bottom:1px solid #edf1f6}
.sale-product-title{display:flex;gap:8px;align-items:center}.sale-product-title strong{color:#6d28d9}.sale-product-title span{font-weight:700}
.sale-product-specs,.sale-product-condition{font-size:.78rem;color:var(--muted);margin-top:3px}.sale-product-condition{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px}
.sale-product-prices{display:grid;grid-template-columns:repeat(6,minmax(72px,1fr));gap:9px}.sale-product-prices span,.sale-batch-total span{display:grid;gap:2px}.sale-product-prices small,.sale-batch-total small{font-size:.67rem;color:var(--muted);text-transform:uppercase}.sale-product-prices strong{font-size:.82rem}
.sale-details-button{white-space:nowrap;padding:7px 10px;font-size:.76rem}
.sale-batch-total{display:grid;grid-template-columns:1.2fr repeat(6,minmax(80px,1fr));gap:10px;align-items:center;padding:10px 14px;background:#f8fafc;font-size:.8rem}
.sales-more-batches{display:grid;gap:12px}.sales-load-more{justify-self:center;margin:2px 0 5px}
.sale-details-dialog{width:min(820px,calc(100vw - 28px));max-width:none;padding:0;border:0;border-radius:18px;overflow:hidden}
.sale-details-sheet{position:relative;padding:24px;max-height:88vh;overflow:auto}.sale-detail-heading span{font-size:.75rem;color:var(--muted);text-transform:uppercase}.sale-detail-heading h2{margin:4px 38px 18px 0}
.sale-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.sale-detail-grid>div{padding:10px;background:#f8fafc;border:1px solid var(--border);border-radius:10px;display:grid;gap:3px}.sale-detail-grid small{color:var(--muted);font-size:.7rem}.sale-detail-grid strong{font-size:.86rem;overflow-wrap:anywhere}
.sale-detail-section{margin-top:20px}.sale-detail-section h3{margin:0 0 9px;font-size:.95rem}.sale-detail-section p{background:#f8fafc;border-radius:10px;padding:10px;margin:6px 0;white-space:pre-wrap}.sale-detail-link{display:inline-block;margin-top:18px}
@media(max-width:900px){.sale-product-card{grid-template-columns:1fr}.sale-product-prices{grid-template-columns:repeat(3,1fr)}.sale-details-button{justify-self:start}.sale-batch-total{grid-template-columns:repeat(3,1fr)}.sale-batch-total>strong{grid-column:1/-1}.sale-batch-head div{align-items:flex-start;flex-direction:column;gap:3px}}
@media(max-width:600px){.sales-month{margin-top:12px;border-radius:12px}.sales-month-head{padding:11px 12px}.sales-month-head span{display:block;line-height:1.45}.sales-month-batches{padding:8px;gap:8px}.sale-batch-head{padding:9px 10px}.sale-batch-head div{display:block}.sale-batch-head span{display:block;margin-top:3px}.sale-product-card{gap:8px;padding:10px}.sale-product-title{flex-wrap:wrap}.sale-product-title span{font-size:.88rem}.sale-product-specs,.sale-product-condition{font-size:.73rem}.sale-product-prices{grid-template-columns:repeat(3,1fr);gap:5px}.sale-product-prices span{background:#f8fafc;border-radius:7px;padding:6px}.sale-product-prices strong{font-size:.78rem}.sale-batch-total{grid-template-columns:repeat(2,1fr);padding:9px 10px}.sale-details-button{width:100%}.sale-details-dialog{width:100vw;height:100dvh;max-height:none;border-radius:0}.sale-details-sheet{min-height:100dvh;max-height:100dvh;padding:18px 14px}.sale-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-detail-heading h2{font-size:1.05rem}}

/* Part 4.2 compact grouped sales alignment */
@media (min-width:901px){
  .sale-product-card,
  .sale-batch-total{
    display:grid;
    grid-template-columns:
      minmax(250px,2.05fr)
      minmax(88px,.72fr)
      minmax(88px,.72fr)
      minmax(105px,.86fr)
      minmax(62px,.5fr)
      minmax(105px,.86fr)
      minmax(82px,.66fr)
      minmax(92px,.72fr);
    column-gap:12px;
    align-items:center;
  }
  .sale-product-prices{display:contents}
  .sale-batch-total::after{content:"";display:block}
}

.sale-batch-head{padding:8px 12px}
.sale-batch-head strong{font-size:.86rem;font-weight:750;letter-spacing:.01em}
.sale-batch-head span{font-size:.7rem}
.sale-product-card{padding:9px 12px}
.sale-product-title{gap:6px}
.sale-product-title strong{font-size:.82rem;font-weight:750}
.sale-product-title span{font-size:.88rem;font-weight:680}
.sale-product-specs,.sale-product-condition{font-size:.7rem;line-height:1.25;margin-top:2px}
.sale-product-prices span,.sale-batch-total span{min-width:0}
.sale-product-prices small,.sale-batch-total small{font-size:.58rem;letter-spacing:.045em}
.sale-product-prices strong{font-size:.74rem;font-weight:680;white-space:nowrap}
.sale-batch-total{padding:8px 12px;font-size:.74rem}
.sale-batch-total>strong{font-size:.76rem;font-weight:750}
.sale-batch-total span{font-size:.74rem;white-space:nowrap}
.sale-details-button{justify-self:end;padding:5px 8px;font-size:.68rem;border-radius:8px}

@media(max-width:900px){
  .sale-product-prices{display:grid}
  .sale-batch-total::after{display:none}
}

/* Part 4.3 mobile grouped Sales History fix */
@media(max-width:700px){
  :root{--sidebar-width:54px;--sidebar-collapsed-width:54px}
  .app-shell{grid-template-columns:54px minmax(0,1fr)}
  .sidebar{width:54px;padding:10px 6px}
  .brand{min-height:34px;padding:2px 0 16px;justify-content:center}
  .brand-mark.small{width:32px;height:32px;font-size:11px}
  .main-nav{gap:4px}
  .nav-item{padding:10px 6px;font-size:16px;border-radius:9px}
  .sidebar-footer{padding:10px 0}

  .page-header{height:62px;padding:8px 10px}
  .page-header h1{font-size:18px}
  .page-header p{font-size:10px;margin-top:2px}
  .page-header button{padding:8px 10px;font-size:11px}
  .page-shell main{padding:8px 8px 36px}

  .sales-page-card{width:100%;min-width:0;padding:9px;gap:9px;border-radius:12px}
  .sales-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start}
  .sales-heading h2{font-size:15px;margin-bottom:2px}
  .sales-heading p{font-size:9px;line-height:1.25;margin:0}
  .sales-heading .secondary{padding:7px 8px;font-size:9px;line-height:1.05}

  .sales-filter-bar{display:block;min-width:0}
  .sales-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:3px;padding:3px;overflow:visible}
  .sales-presets button{min-width:0;padding:6px 3px;font-size:8.5px;white-space:nowrap}
  .sales-custom-dates{margin-top:6px}

  .sales-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .sales-summary-card{padding:7px 8px}
  .sales-summary-card small{font-size:7px}
  .sales-summary-card strong{font-size:10px}

  /* The grouped history lives inside this wrapper; the old mobile rule hid it. */
  .sales-table-wrap{display:block!important;width:100%;min-width:0}
  .sales-month{width:100%;min-width:0;margin-top:8px;border-radius:10px}
  .sales-month-head{padding:9px 10px}
  .sales-month-head h3{font-size:14px;margin-bottom:2px}
  .sales-month-head span{font-size:9px;line-height:1.35}
  .sales-month-batches{padding:6px;gap:6px}

  .sale-batch-card{border-left-width:4px;border-radius:9px}
  .sale-batch-head{padding:7px 8px}
  .sale-batch-head strong{font-size:10px;overflow-wrap:anywhere}
  .sale-batch-head span{font-size:8px;line-height:1.3}

  .sale-product-card{gap:6px;padding:8px}
  .sale-product-title{gap:5px;line-height:1.2}
  .sale-product-title strong{font-size:10px}
  .sale-product-title span{font-size:11px}
  .sale-product-specs,.sale-product-condition{font-size:9px;line-height:1.25;margin-top:1px}
  .sale-product-condition{max-width:100%}
  .sale-product-prices{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .sale-product-prices span{padding:5px 6px;border-radius:6px}
  .sale-product-prices small,.sale-batch-total small{font-size:7px}
  .sale-product-prices strong{font-size:9px}
  .sale-details-button{width:auto;justify-self:start;padding:5px 8px;font-size:9px}

  .sale-batch-total{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:7px 8px}
  .sale-batch-total>strong{grid-column:1/-1;font-size:9px}
  .sale-batch-total span{padding:4px 5px;border-radius:6px;background:#fff;font-size:9px}

  .sales-load-more{padding:7px 10px;font-size:9px}
}

@media(max-width:360px){
  :root{--sidebar-width:48px;--sidebar-collapsed-width:48px}
  .app-shell{grid-template-columns:48px minmax(0,1fr)}
  .sidebar{width:48px;padding-left:4px;padding-right:4px}
  .page-header{padding-left:8px;padding-right:8px}
  .page-header p{display:none}
  .sales-presets{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Part 5 business dashboard */
.dashboard-page-card{display:grid;gap:18px;padding:22px}
.dashboard-heading{align-items:flex-start;gap:16px;flex-wrap:wrap}
.dashboard-presets{display:flex;gap:4px;padding:4px;border:1px solid var(--border);border-radius:11px;background:#f5f7fb;overflow:auto}
.dashboard-presets button{border:0;background:transparent;color:#5d6880;padding:8px 12px;border-radius:8px;font-size:12px;font-weight:800;white-space:nowrap}
.dashboard-presets button.active{background:#fff;color:#2452d6;box-shadow:0 1px 5px rgba(30,45,80,.12)}
.dashboard-custom-dates{display:flex;align-items:end;justify-content:flex-end;gap:9px;padding:12px;border:1px solid var(--border);border-radius:12px;background:#fafbfe}
.dashboard-custom-dates label{display:grid;gap:4px;font-size:10px;font-weight:800;color:#68738a;text-transform:uppercase}
.dashboard-custom-dates input{height:36px;padding:6px 9px;border:1px solid var(--border);border-radius:8px;background:#fff}
.dashboard-headline{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.dashboard-headline .metric{min-width:0;padding:15px;border:1px solid var(--border);border-radius:13px;background:#f9faff}
.dashboard-headline .metric span{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#738097;font-weight:800}
.dashboard-headline .metric strong{display:block;margin-top:5px;font-size:19px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-headline .metric-profit strong{color:#16834e}
.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.dashboard-panel{min-width:0;padding:16px;border:1px solid var(--border);border-radius:14px;background:#fff}
.dashboard-panel-wide{grid-column:span 2}
.dashboard-panel-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:12px}
.dashboard-panel-title h3{margin:0;font-size:15px}.dashboard-panel-title span{font-size:10px;color:#7b869a;font-weight:750}
.dashboard-ranking{display:grid;gap:7px}
.dashboard-rank-row{display:grid;grid-template-columns:25px minmax(0,1fr) auto;align-items:center;gap:9px;padding:8px 9px;border-radius:9px;background:#f8f9fc}
.dashboard-rank-number{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#e9efff;color:#3159cc;font-size:10px;font-weight:850}
.dashboard-rank-row div{min-width:0}.dashboard-rank-row strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-rank-row small{display:block;margin-top:2px;color:#8490a5;font-size:9px}.dashboard-rank-row>b{font-size:12px;color:#182238;white-space:nowrap}
.dashboard-empty{padding:18px;text-align:center;color:#8993a6;font-size:11px}
.dashboard-task-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.dashboard-task{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;border-radius:9px;background:#f8f9fc}.dashboard-task span{font-size:10px;color:#657087}.dashboard-task strong{font-size:16px}
.dashboard-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.dashboard-detail-grid .detail-tile{padding:10px;border-radius:9px;background:#f8f9fc}.dashboard-detail-grid .detail-tile span{font-size:9px}.dashboard-detail-grid .detail-tile strong{font-size:13px}
.dashboard-aging{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr);gap:16px}.dashboard-aging-buckets{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.dashboard-age-bucket{display:grid;place-items:center;gap:3px;padding:15px 6px;border-radius:10px}.dashboard-age-bucket strong{font-size:20px}.dashboard-age-bucket span{font-size:9px;font-weight:800}.age-fresh{background:#edf8f1;color:#197246}.age-watch{background:#fff8df;color:#8a6911}.age-warm{background:#fff0d8;color:#9b5c10}.age-hot{background:#ffe5d8;color:#a14725}.age-old{background:#fde4e5;color:#a0323a}
.dashboard-oldest h4{margin:0 0 7px;font-size:11px}.dashboard-oldest>div{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid #eef1f6;font-size:10px}.dashboard-oldest>div span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-oldest>div strong{color:#a14725}
@media(max-width:1200px){.dashboard-headline{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
  .dashboard-page-card{padding:10px;gap:12px;border-radius:12px}.dashboard-heading{display:grid;gap:9px}.dashboard-heading h2{font-size:17px}.dashboard-heading p{font-size:11px}.dashboard-presets{width:100%;overflow-x:auto}.dashboard-presets button{padding:7px 9px;font-size:10px}.dashboard-custom-dates{display:grid;grid-template-columns:1fr 1fr;gap:7px}.dashboard-custom-dates button{grid-column:1/-1}.dashboard-headline{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.dashboard-headline .metric{padding:10px}.dashboard-headline .metric strong{font-size:14px}.dashboard-grid{grid-template-columns:1fr;gap:8px}.dashboard-panel,.dashboard-panel-wide{grid-column:auto;padding:11px}.dashboard-aging{grid-template-columns:1fr;gap:10px}.dashboard-aging-buckets{gap:4px}.dashboard-age-bucket{padding:9px 3px}.dashboard-age-bucket strong{font-size:15px}.dashboard-age-bucket span{font-size:7px}.dashboard-rank-row{padding:7px}.dashboard-rank-row strong,.dashboard-rank-row>b{font-size:10px}.dashboard-task-list{gap:5px}.dashboard-task{padding:8px}.dashboard-detail-grid{gap:5px}
}
.inventory-import-panel{margin:0 0 12px;padding:14px 18px}.inventory-import-panel summary{display:flex;justify-content:space-between;gap:10px;cursor:pointer;list-style:none}.inventory-import-panel summary::-webkit-details-marker{display:none}.inventory-import-panel summary span{font-size:10px;color:#758198}.inventory-import-panel[open] summary{margin-bottom:10px}
@media(max-width:700px){.inventory-import-panel{padding:11px;margin-bottom:10px}.inventory-import-panel form{display:grid;gap:7px}}

/* Part 6 business reports */
.reports-page-card{display:grid;gap:16px;padding:22px}
.reports-heading{align-items:flex-start;gap:14px;flex-wrap:wrap}
.reports-filter-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.reports-presets{display:flex;gap:4px;padding:4px;border:1px solid var(--border);border-radius:11px;background:#f5f7fb;overflow:auto}
.reports-presets button{border:0;background:transparent;color:#5d6880;padding:8px 12px;border-radius:8px;font-size:12px;font-weight:800;white-space:nowrap}
.reports-presets button.active{background:#fff;color:#2452d6;box-shadow:0 1px 5px rgba(30,45,80,.12)}
.reports-custom-dates{display:flex;align-items:end;gap:8px;padding:10px;border:1px solid var(--border);border-radius:11px;background:#fafbfe}
.reports-custom-dates label{display:grid;gap:4px;font-size:9px;font-weight:800;color:#68738a;text-transform:uppercase}
.reports-custom-dates input{height:34px;padding:5px 8px;border:1px solid var(--border);border-radius:8px;background:#fff}
.reports-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.reports-summary-card{min-width:0;padding:13px 14px;border:1px solid var(--border);border-radius:12px;background:#f9faff}
.reports-summary-card small{display:block;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#758198}
.reports-summary-card strong{display:block;margin-top:4px;font-size:17px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reports-summary-card.is-profit strong{color:#16834e}
.reports-grid-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(280px,.8fr);gap:12px}
.reports-panel{min-width:0;padding:15px;border:1px solid var(--border);border-radius:13px;background:#fff}
.reports-panel-wide{grid-row:span 2}
.reports-panel-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:11px}
.reports-panel-title h3{margin:0;font-size:14px}.reports-panel-title span{font-size:10px;color:#7b869a;font-weight:750}
.reports-table-wrap{width:100%;overflow:auto}
.reports-table{width:100%;border-collapse:collapse;min-width:690px}
.reports-table th,.reports-table td{padding:9px 8px;border-bottom:1px solid #edf0f5;text-align:right;font-size:11px;white-space:nowrap}
.reports-table th{font-size:9px;text-transform:uppercase;letter-spacing:.035em;color:#778399;background:#fafbfe}
.reports-table th:first-child,.reports-table td:first-child{text-align:left}
.report-profit{color:#16834e;font-weight:750}
.reports-ranking{display:grid;gap:7px}
.reports-rank-row{display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px;border-radius:9px;background:#f8f9fc}
.reports-rank-row>span{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#e9efff;color:#3159cc;font-size:9px;font-weight:850}
.reports-rank-row div{min-width:0}.reports-rank-row div strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reports-rank-row div small{display:block;margin-top:2px;font-size:8px;color:#8490a5}
.reports-rank-row>b{font-size:10px;text-align:right;white-space:nowrap}.reports-rank-row>b small{display:block;margin-top:2px;color:#16834e;font-size:8px}
.reports-inventory{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.reports-inventory>div{padding:10px;border-radius:9px;background:#f8f9fc}.reports-inventory span{display:block;font-size:8px;font-weight:800;text-transform:uppercase;color:#78849a}.reports-inventory strong{display:block;margin-top:4px;font-size:12px}
.reports-empty{padding:24px;text-align:center;color:#8b95a8;font-size:11px}
@media(max-width:1050px){.reports-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.reports-grid-layout{grid-template-columns:1fr}.reports-panel-wide{grid-row:auto}}
@media(max-width:700px){
  .reports-page-card{padding:10px;gap:10px;border-radius:12px}.reports-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.reports-heading h2{font-size:16px}.reports-heading p{font-size:10px;line-height:1.3}.reports-heading .secondary{padding:7px 8px;font-size:9px}
  .reports-filter-bar{display:block}.reports-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;width:100%}.reports-presets button{min-width:0;padding:6px 3px;font-size:8.5px}.reports-custom-dates{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:7px}.reports-custom-dates button{grid-column:1/-1}
  .reports-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.reports-summary-card{padding:8px}.reports-summary-card small{font-size:7px}.reports-summary-card strong{font-size:11px}
  .reports-grid-layout{gap:8px}.reports-panel{padding:10px}.reports-panel-title h3{font-size:12px}.reports-panel-title span{font-size:8px}
  .reports-table{min-width:620px}.reports-table th,.reports-table td{padding:7px 6px;font-size:9px}.reports-table th{font-size:7px}
  .reports-rank-row{padding:7px}.reports-rank-row div strong{font-size:10px}.reports-inventory>div{padding:8px}.reports-inventory strong{font-size:10px}
}
@media(max-width:360px){.reports-presets{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Production safety pack */
.system-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }
.system-status-card { border:1px solid var(--border, #dbe2ea); border-radius:12px; padding:12px; background:var(--surface, #fff); min-width:0; }
.system-status-card small { display:block; color:var(--muted, #64748b); margin-bottom:4px; }
.system-status-card strong { display:block; font-size:14px; overflow-wrap:anywhere; }
.system-status-card.warning { border-color:#f59e0b; background:#fffbeb; }
.sale-safety-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.sale-safety-actions .danger { background:#b91c1c; border-color:#b91c1c; color:white; }
@media (max-width: 760px) { .system-status-grid { grid-template-columns:1fr; } .sale-safety-actions button { flex:1; } }


/* Sale/inventory consistency follow-up */
.sale-product-serial {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sale-product-serial small {
  margin-right: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
}
@media (max-width: 720px) {
  .sale-product-serial { font-size: 10px; }
}

/* Workflow hardening: repair history */
.repair-item-main{display:flex;flex-direction:column;min-width:0;gap:2px}.repair-item-main small{font-size:11px;color:var(--muted,#6b7280)}.repair-item.repair-completed{opacity:.72;background:#f8fafc}.repair-item.repair-completed .repair-item-main span{text-decoration:line-through}.danger-lite{color:#b42318;border-color:#f1b4ae}


/* Focused status workflow */
.col-repair_state{width:86px;min-width:82px}.col-status{width:102px;min-width:96px}.status-select{width:100%;min-width:88px;border:1px solid #d9deea;border-radius:999px;background:#f4f6ff;color:#27324a;padding:4px 7px;font-size:10px;font-weight:800}.repair-state-pill,.mobile-repair-state{border:0;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:800;white-space:nowrap}.repair-state-to-fix{background:#fff4dd;color:#9a5b00}.repair-state-repairing{background:#eaf2ff;color:#1d56a5}.repair-state-fixed{background:#e9f8ef;color:#187044}.repair-state-none{background:#f1f3f6;color:#778095}.mobile-repair-state{padding:2px 6px}.repair-item-actions{display:flex;gap:5px;flex-wrap:wrap}.repair-item{grid-template-columns:minmax(0,1fr) auto auto auto}
@media(max-width:720px){.mobile-compact-meta{gap:5px;flex-wrap:wrap}.mobile-status{font-size:10px}.mobile-repair-state{font-size:9px}.repair-item{grid-template-columns:1fr auto}.repair-item-actions{grid-column:1/-1}.repair-item>.danger-lite{grid-column:1/-1;justify-self:start}}

/* Open repair-cost reminder */
.repair-cost-cell{border:1px solid transparent;border-radius:7px;padding:4px 6px;transition:background .15s ease,border-color .15s ease}
.repair-cost-cell.repair-cost-open{background:#fff0f0;border-color:#efb4b4;color:#9f2727}
.repair-cost-cell.repair-cost-open .smart-sub{color:#a43b3b}
.repair-cost-cell.repair-cost-progress{background:#fff7e7;border-color:#e8ca8d;color:#855300}
.repair-cost-cell.repair-cost-progress .smart-sub{color:#8c6217}
.repair-item.repair-incomplete{background:#fff3f3;border-color:#efb8b8}
.repair-item.repair-incomplete .repair-item-cost{color:#a62828}
.repair-item.repair-in-progress{background:#fff8e9;border-color:#e7cd95}
.repair-item.repair-in-progress .repair-item-cost{color:#865800}
.repair-item.repair-completed .repair-item-cost{color:#187044}


/* Repair records remain editable while preserving status alert colors. */
.repair-item{grid-template-columns:minmax(150px,1fr) auto auto auto auto}
@media(max-width:640px){.repair-item{grid-template-columns:minmax(0,1fr) auto;gap:6px}.repair-item .repair-item-main{grid-column:1/-1}.repair-item strong{justify-self:start}.repair-item button{min-height:32px}.repair-item-actions{grid-column:1/-1}}

/* Prominent app-wide progress and error notice (OCR and long-running actions). */
.app-notice {
  position: fixed;
  z-index: 10000;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 28px));
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  color: #172033;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.app-notice.hidden { display: none; }
.app-notice-progress { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.app-notice-success { background: #ecfdf5; border-color: #86efac; color: #166534; }
.app-notice-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
#runOcrButton:disabled { opacity: 0.65; cursor: wait; }
#ocrResult:not(:empty) {
  max-height: 230px;
  overflow: auto;
  margin-top: 10px;
  padding: 10px;
  border-radius: 9px;
  background: #f8fafc;
  white-space: pre-wrap;
  font-size: 12px;
}
@media (max-width: 640px) {
  .app-notice { top: 10px; padding: 11px 13px; font-size: 13px; }
}


/* Archived product management */
.product-manage-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.product-manage-actions .row-button { padding: 5px 8px; font-size: 11px; }
.danger-lite { color: #9f2d2d; border-color: rgba(159,45,45,.32); background: rgba(159,45,45,.07); }
.danger-lite:hover { background: rgba(159,45,45,.13); }
@media (max-width: 760px) {
  .mobile-detail-actions .danger-lite { width: 100%; }
}

/* Editable import preview and sold inventory lock */
.import-preview-dialog{width:min(920px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:16px;overflow:hidden;margin:auto}
.import-preview-card{box-sizing:border-box;width:100%;max-width:none;height:min(900px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain;padding:20px 20px 0;scrollbar-gutter:stable}
.import-preview-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}.import-preview-heading h2{margin:0}.import-preview-heading p{margin:4px 0 0;color:var(--muted);font-size:12px}
.import-source-badge,.import-flag{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800}.import-source-badge{background:#eef2ff;color:#3447a6}.import-preview-flags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.import-flag.ocr{background:#eaf6ff;color:#176399}.import-flag.conflict{background:#fff1e7;color:#9b4d08}.import-flag.info{background:#eef8f1;color:#287046}
.import-preview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.import-preview-grid label{display:grid;gap:4px;font-size:10px;font-weight:800;color:#647087}.import-preview-grid input,.import-preview-grid select,.import-preview-grid textarea{width:100%;min-width:0;font-size:12px;padding:8px;border:1px solid #dbe1eb;border-radius:8px;background:#fff;color:#1c2434}.import-preview-wide{grid-column:span 2}.import-preview-total{display:flex;justify-content:flex-end;align-items:center;gap:16px;margin-top:12px;padding:12px;border-radius:10px;background:#f5f7fb}.import-preview-total span{font-size:11px;color:var(--muted);font-weight:800}.import-preview-total strong{font-size:18px}.import-preview-actions{position:sticky;z-index:8;bottom:0;margin:14px -20px 0;padding:12px 20px calc(12px + env(safe-area-inset-bottom));background:rgba(255,255,255,.98);border-top:1px solid #e5e9f0;box-shadow:0 -8px 18px rgba(33,43,68,.08);backdrop-filter:blur(8px)}.import-preview-actions button{min-width:122px}.import-preview-card>#importPreviewMessage{margin-bottom:0}
.sold-readonly-cell{background:#f7f8fa;color:#71798a;cursor:not-allowed}.sold-readonly{opacity:.85}.sold-status-lock{display:inline-flex;justify-content:center;cursor:not-allowed;background:#eef0f3;color:#5f6673}.sold-lock-badge{font-size:12px}.sold-mobile-note{padding:7px 9px;border-radius:8px;background:#f3f4f6;color:#656d7a;font-size:9px;line-height:1.3}.mobile-readonly-value{display:block;padding:5px 2px;color:#5f6775;font-size:10px}.mobile-readonly-grid span{padding:7px;border-radius:7px;background:#f6f7f9;font-size:9px;color:#798192}.mobile-readonly-grid strong{display:block;margin-top:2px;color:#343b49;font-size:10px}
@media(max-width:760px){.import-preview-dialog{inset:0;width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.import-preview-card{height:100dvh;max-height:100dvh;padding:14px 14px 0}.import-preview-heading{padding-right:26px}.import-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.import-preview-wide{grid-column:1/-1}.import-preview-actions{bottom:0;margin:12px -14px 0;padding:10px 14px calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr;gap:8px}.import-preview-actions button{width:100%;min-width:0}.import-preview-heading p{font-size:10px}.import-preview-grid input,.import-preview-grid select,.import-preview-grid textarea{font-size:16px}.import-preview-total{position:sticky;bottom:66px;z-index:7;margin-left:-2px;margin-right:-2px;box-shadow:0 -3px 12px rgba(33,43,68,.05)}}
@media(max-width:430px){.import-preview-grid{grid-template-columns:1fr}.import-preview-wide{grid-column:auto}.import-preview-heading{display:block}.import-source-badge{margin-top:8px}.import-preview-actions{grid-template-columns:1fr}.import-preview-total{bottom:112px}}
.sold-action-readonly{display:inline-flex;align-items:center;justify-content:center;opacity:.7;cursor:not-allowed}.smart-cell.sold-readonly{display:inline-flex;flex-direction:column}.notes-button.sold-readonly{display:inline-block;padding:5px 7px}.row-button.sold-readonly{display:inline-block}

/* Battery health/cycle display and live refresh */
.battery-info-cell{display:flex;flex-direction:column;gap:2px;min-width:76px;line-height:1.2}.battery-info-cell small{font-size:9px;font-weight:800;color:#667085}.battery-health{font-size:10px;font-weight:800;white-space:nowrap}.battery-health-edit{border-radius:5px;padding:2px 3px;margin-left:-3px}.battery-health-edit:focus{outline:2px solid rgba(66,99,235,.28);background:#fff}.mobile-battery-spec{display:flex!important;flex-direction:column;justify-content:center;gap:1px;line-height:1.15}.mobile-battery-spec small{font-size:8px;color:#667085}.mobile-battery-spec strong{font-size:9px;font-weight:800;white-space:nowrap}

/* Inventory section placement */
.import-section-hint{display:block;margin-top:4px;color:#9b4d08;font-size:10px;font-weight:800}.product-manage-actions{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.product-manage-actions .row-button{white-space:nowrap}
@media(max-width:760px){.import-section-hint{font-size:9px}.mobile-detail-actions [data-move-to-parts]{border-style:dashed}}

/* Parts inventory workflow */
.part-create-dialog{width:min(760px,calc(100vw - 24px));max-width:none;border:0;border-radius:16px;padding:0}.part-create-card{width:100%;max-width:none;box-sizing:border-box}.part-create-card>p{margin-top:-6px;color:var(--muted);font-size:11px}.part-create-grid .part-wide{grid-column:1/-1}.source-product-link{border:0;background:transparent;color:#315fb7;padding:0;font:inherit;font-weight:800;cursor:pointer}.source-product-link:hover{text-decoration:underline}.mobile-part-summary{display:grid;grid-template-columns:1fr 1.4fr .7fr;gap:6px;margin:7px 0}.mobile-part-summary span{min-width:0;padding:7px;border-radius:8px;background:#f5f7fa}.mobile-part-summary small{display:block;color:#7b8496;font-size:8px;text-transform:uppercase}.mobile-part-summary strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;margin-top:2px}.part-mobile-edit{margin-bottom:8px}
@media(max-width:760px){.inventory-tools>#addPartButton{order:-1;width:100%}.part-create-dialog{inset:0;width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.part-create-card{height:100dvh;max-height:100dvh;overflow:auto;padding-bottom:calc(16px + env(safe-area-inset-bottom))}.part-create-grid{grid-template-columns:1fr}.part-create-grid .part-wide{grid-column:auto}.mobile-part-summary{grid-template-columns:1fr 1fr}.mobile-part-summary span:nth-child(2){grid-column:1/-1}}
.preview-part-field{display:none!important}.import-preview-card.parts-selected .preview-part-field{display:grid!important}

/* Parts workflow polish and sales section badges */
.sale-product-title{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.sale-section-badge{font-style:normal;font-size:9px;font-weight:800;line-height:1;padding:4px 7px;border-radius:999px;background:#eef1f5;color:#4b5565}.sale-section-parts{background:#fff3dd;color:#8b5600}.sale-section-macbooks{background:#eaf1ff;color:#2857a5}.sale-section-accessories{background:#ebf8ef;color:#257043}.sale-section-others{background:#f1ecfa;color:#65469a}.part-create-dialog .dialog-actions button{min-width:110px}
/* Accessories and Other direct-create workflows */
.inventory-tools>#addAccessoryButton,.inventory-tools>#addOtherButton{white-space:nowrap}
.preview-general-field.hidden{display:none!important}
@media(max-width:760px){.inventory-tools>#addAccessoryButton,.inventory-tools>#addPartButton,.inventory-tools>#addOtherButton{width:100%}.inventory-tools>#addAccessoryButton{order:-3}.inventory-tools>#addPartButton{order:-2}.inventory-tools>#addOtherButton{order:-1}}
.import-preview-card .preview-general-field{display:none!important}.import-preview-card.general-selected .preview-general-field{display:grid!important}

/* Manual inventory row ordering */
.order-column{width:30px;min-width:30px;max-width:30px;text-align:center;color:#8a94a8;background:#f7f9fd}.row-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:22px;height:28px;border-radius:6px;color:#76819a;font-size:17px;cursor:grab;user-select:none;touch-action:none}.row-drag-handle:active{cursor:grabbing;background:#edf2ff}.inventory-row-dragging{opacity:.42}.inventory-row-drop-target td{box-shadow:inset 0 3px 0 var(--primary)}.mobile-order-controls{display:none}
@media(max-width:760px){.mobile-order-controls{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin:-2px 0 5px}.mobile-order-controls span{font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:#8791a5}.mobile-order-controls button{min-width:30px;padding:3px 7px;font-size:12px}}

/* Manual inventory row ordering */
.order-column{width:30px;min-width:30px;max-width:30px;text-align:center;color:#8a94a8;background:#f7f9fd}.row-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:22px;height:28px;border-radius:6px;color:#76819a;font-size:17px;cursor:grab;user-select:none;touch-action:none}.row-drag-handle:active{cursor:grabbing;background:#edf2ff}.inventory-row-dragging{opacity:.42}.inventory-row-drop-target td{box-shadow:inset 0 3px 0 var(--primary)}.mobile-order-controls{display:none}
@media(max-width:760px){.mobile-order-controls{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin:-2px 0 5px}.mobile-order-controls span{font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:#8791a5}.mobile-order-controls button{min-width:30px;padding:3px 7px;font-size:12px}}

/* Inventory filters and saved views */
.inventory-filter-panel{margin:10px 0 12px;border:1px solid #dfe5ee;border-radius:12px;background:#fafbfc;overflow:hidden}.inventory-filter-panel summary{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-weight:800;list-style:none}.inventory-filter-panel summary::-webkit-details-marker{display:none}.inventory-filter-panel summary small{margin-left:auto;color:var(--muted);font-weight:500}.inventory-filter-panel.has-active-filters{border-color:#8ea7e8;background:#f7f9ff}.filter-count{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border-radius:999px;background:#405dcc;color:#fff;font-size:10px}.inventory-filter-body{padding:0 12px 12px}.saved-view-bar{display:grid;grid-template-columns:minmax(180px,1fr) auto auto auto;gap:8px;align-items:end;padding:10px 0;border-top:1px solid #e7ebf1}.saved-view-bar label,.inventory-filter-grid label{display:grid;gap:4px;font-size:10px;font-weight:800;color:#687389}.saved-view-bar select,.inventory-filter-grid select,.inventory-filter-grid input{width:100%;min-width:0;border:1px solid #d6dde8;border-radius:8px;background:#fff;padding:8px;font-size:12px}.inventory-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.inventory-filter-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid #e7ebf1}.inventory-filter-actions span{color:var(--muted);font-size:11px}
@media(max-width:850px){.saved-view-bar{grid-template-columns:1fr 1fr}.inventory-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-filter-panel summary small{display:none}}
@media(max-width:480px){.saved-view-bar,.inventory-filter-grid{grid-template-columns:1fr}.inventory-filter-actions{align-items:stretch;flex-direction:column}.inventory-filter-actions button{width:100%}}

/* Repair Parts Needed and compatibility matching */
.required-parts-panel{margin:16px 0;padding:14px;border:1px solid #dfe5ee;border-radius:12px;background:#fafbfc}.required-parts-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.required-parts-heading h3{margin:0}.required-parts-heading p{margin:4px 0 0;color:var(--muted);font-size:11px}.required-parts-list{display:grid;gap:9px;margin:12px 0}.required-part-card{border:1px solid #dde3ec;border-left:4px solid #c5ccd8;border-radius:10px;padding:10px;background:#fff}.required-part-card.status-need_to_buy{border-left-color:#d84949}.required-part-card.status-reserved{border-left-color:#4177d5}.required-part-card.status-installed{border-left-color:#3a9b62;opacity:.78}.required-part-card header{display:flex;justify-content:space-between;gap:8px}.required-part-card header div{display:grid}.required-part-card header small,.part-match-row small{color:var(--muted);font-size:9px}.required-part-card header>span{font-size:9px;font-weight:900;text-transform:uppercase}.required-part-card footer{display:flex;justify-content:flex-end;gap:7px;margin-top:8px}.required-part-candidates{display:grid;gap:6px;margin-top:8px}.part-match-row{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:7px;background:#f3f7fb;border-radius:8px}.part-match-row>div{display:grid}.required-part-missing{margin-top:8px;padding:7px;border-radius:7px;background:#fff0f0;color:#9b3030;font-size:10px;font-weight:800}.reserved-part-line{color:#315f9e}.required-part-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.required-part-form label{display:grid;gap:3px;font-size:9px;font-weight:800;color:#657086}.required-part-form input,.required-part-form select{width:100%;min-width:0}.required-part-wide{grid-column:span 2}.compatibility-group-card{width:min(720px,calc(100vw - 24px))}.compatibility-groups-list{display:grid;gap:7px;max-height:260px;overflow:auto;margin:10px 0}.compatibility-group-row{display:grid;padding:9px;border-radius:8px;background:#f4f6f9}.compatibility-group-row span,.compatibility-group-row small{font-size:10px;color:var(--muted)}.repair-part-badge{display:inline-flex;margin-top:3px;padding:2px 5px;border-radius:999px;font-size:8px;font-weight:900}.repair-part-badge.need-buy{background:#ffe8e8;color:#a92c2c}.repair-part-badge.reserved{background:#e7efff;color:#315fa9}.repair-part-badge.matched{background:#e5f7eb;color:#287247}.dashboard-task.task-danger{border-left:3px solid #d84949}.dashboard-task.task-reserved{border-left:3px solid #4177d5}.dashboard-task.task-parts{border-left:3px solid #d28b1f}
@media(max-width:760px){.required-parts-heading{display:block}.required-parts-heading button{margin-top:8px}.required-part-form{grid-template-columns:1fr}.required-part-wide{grid-column:auto}.part-match-row{align-items:flex-start}.required-part-card footer{flex-wrap:wrap}}
.parts-needed-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.parts-needed-tabs button{background:#f2f4f7;color:#596273}.parts-needed-tabs button.active{background:#27365f;color:#fff}.parts-needed-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}.parts-needed-summary>div{display:grid;padding:10px;border-radius:9px;background:#f5f7fa}.parts-needed-summary small{color:var(--muted)}.parts-needed-summary strong{font-size:20px}.parts-needed-table{overflow:auto}.parts-needed-table table{width:100%;border-collapse:collapse}.parts-needed-table th,.parts-needed-table td{padding:8px;border-bottom:1px solid #e5e9ef;text-align:left;white-space:nowrap}.parts-needed-status{display:inline-flex;padding:3px 6px;border-radius:999px;font-size:9px;font-weight:900}.parts-needed-status.status-need_to_buy{background:#ffe7e7;color:#a52c2c}.parts-needed-status.status-reserved{background:#e4edff;color:#315fa9}.parts-needed-status.status-installed{background:#e5f7eb;color:#287247}@media(max-width:760px){.parts-needed-summary{grid-template-columns:repeat(2,1fr)}}

/* Simplified Required Part ↔ Reserved Part workflow */
.simple-required-parts{border-color:#ccd8ea;background:#f8fbff}.simple-required-form{grid-template-columns:repeat(3,minmax(0,1fr))}.simple-required-form small{font-weight:500;color:var(--muted)}
.required-part-cell{display:inline-flex;align-items:center;justify-content:center;max-width:150px;padding:5px 8px;border:0;border-radius:999px;font-size:9px;font-weight:900;white-space:normal;text-align:center}.required-part-cell.none{background:#f0f2f5;color:#596273}.required-part-cell.need-buy{background:#ffe7e7;color:#a52d2d}.required-part-cell.matched{background:#e5f7eb;color:#287247}.required-part-cell.reserved{background:#e7efff;color:#315fa9}.required-part-cell.installed{background:#e8f7ef;color:#287247}.reserved-for-link{border:0;background:#e7efff;color:#315fa9;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:900}.part-availability.available{display:inline-flex;padding:4px 7px;border-radius:999px;background:#e8f7ef;color:#287247;font-size:9px;font-weight:900}
@media(max-width:760px){.simple-required-form{grid-template-columns:1fr 1fr}.simple-required-form .required-part-wide{grid-column:1/-1}}
@media(max-width:430px){.simple-required-form{grid-template-columns:1fr}}

/* Repair-cost / required-part separation and direct assignment */
.required-part-dialog-card{width:min(760px,calc(100vw - 32px))}.part-availability.available{border:0;cursor:pointer}.part-availability.available:hover{filter:brightness(.96);box-shadow:0 0 0 2px rgba(40,114,71,.12)}
@media(max-width:760px){.required-part-dialog-card{width:100%;max-width:none}.required-part-form{grid-template-columns:1fr}.required-part-wide{grid-column:auto}}

/* Required-part summary inside Repair Cost dialog */
.repair-required-summary-panel{margin:10px 0 14px;padding:12px;border:1px solid #e0e5ee;border-radius:12px;background:#fafbfe}.repair-required-summary-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.repair-required-summary-heading h3{margin:0;font-size:14px}.repair-required-summary-heading p{margin:3px 0 0;color:var(--muted);font-size:10px}.repair-required-summary{display:grid;gap:8px}.repair-required-summary-item{display:grid;grid-template-columns:minmax(150px,1.4fr) repeat(3,minmax(90px,1fr));gap:10px;align-items:center;padding:10px;border:1px solid #e3e7ef;border-radius:10px;background:#fff}.repair-required-summary-item>div{display:grid;gap:2px;min-width:0}.repair-required-summary-item span,.repair-required-summary-item small{font-size:9px;color:var(--muted)}.repair-required-summary-item strong{font-size:11px;overflow-wrap:anywhere}.repair-required-summary-item p{grid-column:1/-1;margin:0;font-size:10px;color:#596274}.repair-required-summary-item.need_to_buy{border-left:4px solid #d94f4f}.repair-required-summary-item.matched{border-left:4px solid #d3a31c}.repair-required-summary-item.reserved{border-left:4px solid #4b73d1}.repair-required-summary-item.installed{border-left:4px solid #32955d}@media(max-width:760px){.repair-required-summary-heading{display:block}.repair-required-summary-heading button{width:100%;margin-top:8px}.repair-required-summary-item{grid-template-columns:1fr 1fr}.repair-required-summary-item>div:first-child{grid-column:1/-1}}

/* Required-part editor and explicit part assignment */
.part-assignment-card{width:min(760px,calc(100vw - 24px))}.part-assignment-list{display:grid;gap:8px;max-height:58vh;overflow:auto;margin:12px 0}.part-assignment-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:10px;border:1px solid #e0e5ed;border-radius:10px;background:#fff}.part-assignment-row>div{display:grid;gap:3px}.part-assignment-row small{font-size:9px;color:var(--muted)}.part-assignment-row>span{padding:3px 6px;border-radius:999px;background:#f0f2f5;font-size:8px;font-weight:900}.part-assignment-row.match-exact{border-left:4px solid #32955d}.part-assignment-row.match-compatible{border-left:4px solid #4b73d1}.part-assignment-row.match-possible{border-left:4px solid #d3a31c}.part-assignment-row.match-manual{border-left:4px solid #9ba3b2}.part-create-grid label small{font-size:9px;color:var(--muted);font-weight:500}
@media(max-width:760px){.part-assignment-card{width:100%;max-width:none}.part-assignment-row{grid-template-columns:1fr auto}.part-assignment-row>button{grid-column:1/-1;width:100%}}

/* Keep Part Usage visible and readable in the Parts inventory table. */
.col-part_usage{width:150px;min-width:125px;max-width:220px;white-space:normal}
.col-part_usage[contenteditable=true]{line-height:1.25}

/* Required-part management and reversible reservations */
.reserved-for-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.reservation-cancel-button{border:1px solid #f0b8b8;background:#fff4f4;color:#a42d2d;border-radius:999px;padding:4px 8px;font-size:9px;font-weight:800;cursor:pointer}.reservation-cancel-button:hover{background:#ffe8e8}.required-part-card footer{display:flex;gap:7px;flex-wrap:wrap}.required-part-card [data-edit-required]{font-weight:800}
@media(max-width:760px){.reserved-for-actions{align-items:stretch}.reserved-for-actions button{flex:1}.reservation-cancel-button{min-height:32px}}

.required-part-edit-banner{margin:8px 0 10px;padding:9px 11px;border:1px solid #8fb4ff;border-radius:9px;background:#eef5ff;color:#234f9b;font-size:11px;font-weight:800}.required-part-card footer [data-edit-required]{min-width:72px}.simple-required-form{scroll-margin-top:14px}


/* Dedicated Required Parts workspace */
.required-part-dialog-card{width:min(1120px,calc(100vw - 28px));max-height:min(92vh,900px);overflow:auto}
.required-part-dialog-title{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.required-part-dialog-title h2{margin-bottom:4px}.required-part-dialog-title p{margin:0;color:var(--muted)}
.required-part-workflow-label{padding:6px 9px;border-radius:999px;background:#eef5ff;color:#315fa9;font-size:10px;font-weight:800;white-space:nowrap}
.required-part-workspace{display:grid;grid-template-columns:minmax(340px,.9fr) minmax(420px,1.1fr);gap:16px;align-items:start}
.required-part-editor-panel,.required-part-saved-panel{border:1px solid #d9e1ec;border-radius:14px;background:#fff;padding:16px}
.required-part-editor-panel{position:sticky;top:0;background:#f8fbff}.required-part-editor-panel.is-editing{border-color:#6d9ef5;box-shadow:0 0 0 3px rgba(73,126,221,.12)}
.required-part-section-heading{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}.required-part-section-heading h3{margin:0 0 3px}.required-part-section-heading p{margin:0;color:var(--muted);font-size:11px}
.simple-required-form{display:grid;grid-template-columns:1fr 1fr;gap:11px}.simple-required-form label{min-width:0}.simple-required-form .required-part-wide{grid-column:1/-1}
.required-part-form-actions{display:flex;justify-content:flex-end;gap:9px;padding-top:4px}.required-part-form-actions button{min-width:130px}
.required-parts-list{display:grid;gap:10px}.required-part-card{margin:0}.required-part-card footer{display:flex;flex-wrap:wrap;gap:7px}.required-part-card footer button{min-height:34px}
.required-part-card footer [data-edit-required]{font-weight:800;border-color:#7ca3e9;color:#315fa9;background:#eef5ff}
@media(max-width:900px){.required-part-workspace{grid-template-columns:1fr}.required-part-editor-panel{position:static}.required-part-dialog-card{width:min(760px,calc(100vw - 20px))}}
@media(max-width:560px){.required-part-dialog-title{display:block}.required-part-workflow-label{display:inline-block;margin-top:8px}.simple-required-form{grid-template-columns:1fr}.simple-required-form .required-part-wide{grid-column:auto}.required-part-editor-panel,.required-part-saved-panel{padding:12px}.required-part-form-actions{flex-direction:column-reverse}.required-part-form-actions button{width:100%}}


/* Required Part editor visibility repair */
#requiredPartDialog .required-part-workspace{display:flex!important;flex-direction:column!important;gap:16px!important}
#requiredPartDialog #requiredPartEditorPanel{display:block!important;visibility:visible!important;opacity:1!important;position:static!important;order:1!important;width:100%!important}
#requiredPartDialog .required-part-saved-panel{display:block!important;order:2!important;width:100%!important}
#requiredPartDialog .required-part-dialog-title{display:flex!important}
#showRequiredPartEditor{white-space:nowrap}
@media(min-width:1050px){#requiredPartDialog .required-part-workspace{display:grid!important;grid-template-columns:minmax(360px,.9fr) minmax(440px,1.1fr)!important}}

/* Required Parts modal sizing and clipping repair */
#requiredPartDialog{width:min(1120px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:92vh;padding:0;overflow:hidden;box-sizing:border-box}
#requiredPartDialog::backdrop{background:rgba(22,31,49,.58)}
#requiredPartDialog .required-part-dialog-card{width:100%!important;max-width:none!important;min-width:0!important;max-height:92vh!important;margin:0!important;overflow:auto!important;box-sizing:border-box}
#requiredPartDialog .required-part-workspace,#requiredPartDialog .required-part-editor-panel,#requiredPartDialog .required-part-saved-panel{min-width:0;box-sizing:border-box}
@media(max-width:900px){#requiredPartDialog{width:min(760px,calc(100vw - 20px));max-width:calc(100vw - 20px)}}

/* Multi-user roles */
.user-management { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border, #dfe5ec); }
.users-list { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: minmax(140px, 1fr) 130px 110px auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border, #dfe5ec); border-radius: 10px; background: var(--surface, #fff); }
.user-row .user-name { font-weight: 700; }
.user-row .user-state { font-size: 12px; opacity: .75; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.role-badge { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2ff; }
body[data-role="VIEWER"] [data-edit], body[data-role="VIEWER"] .selection-toolbar, body[data-role="VIEWER"] #addPartButton, body[data-role="VIEWER"] #addAccessoryButton, body[data-role="VIEWER"] #addOtherButton, body[data-role="VIEWER"] #markSoldButton, body[data-role="VIEWER"] #importForm, body[data-role="VIEWER"] .inventory-import-panel { pointer-events: none; opacity: .55; }
.hidden-by-role { display: none !important; }
@media (max-width: 760px) { .user-row { grid-template-columns: 1fr 1fr; } .user-actions { grid-column: 1 / -1; justify-content: flex-start; } }


/* Receive stock */
.receive-stock-dialog { width:min(760px, calc(100vw - 24px)); }
.receive-stock-card { width:100%; max-width:none; }
.receive-stock-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.receive-stock-wide { grid-column:1 / -1; }
.stock-current-pill { padding:7px 11px; border-radius:999px; background:var(--surface-soft,#eef2f7); font-weight:700; white-space:nowrap; }
.receive-stock-preview { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
.receive-stock-preview > div { padding:12px; border:1px solid var(--border,#d9dee7); border-radius:12px; display:flex; justify-content:space-between; gap:10px; }
.receive-stock-preview span { color:var(--muted,#657080); }
.stock-receipt-history { display:grid; gap:8px; max-height:240px; overflow:auto; margin:8px 0 16px; }
.stock-receipt-row { display:grid; grid-template-columns:1fr auto; gap:8px 14px; padding:10px 12px; border:1px solid var(--border,#d9dee7); border-radius:10px; }
.stock-receipt-row small { color:var(--muted,#657080); }
@media (max-width:640px){ .receive-stock-grid,.receive-stock-preview{grid-template-columns:1fr}.receive-stock-wide{grid-column:auto} }


/* Sales pricing breakdown: clear per-unit and total accounting */
.sale-finance-card{display:grid!important;grid-template-columns:minmax(220px,1.25fr) minmax(260px,1fr) minmax(330px,1.35fr) auto!important;gap:14px!important;align-items:stretch!important}
.sale-unit-finance,.sale-total-finance{display:grid;gap:6px;padding:10px;border:1px solid #e2e8f0;border-radius:10px;background:#fff}
.sale-unit-finance{grid-template-columns:repeat(2,minmax(0,1fr))}
.sale-total-finance{grid-template-columns:repeat(3,minmax(0,1fr))}
.sale-unit-finance h4,.sale-total-finance h4{grid-column:1/-1;margin:0;font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b}
.sale-unit-finance span,.sale-total-finance span{display:flex;flex-direction:column;min-width:0}
.sale-unit-finance small,.sale-total-finance small{font-size:.59rem;color:#64748b;text-transform:uppercase;letter-spacing:.035em}
.sale-unit-finance strong,.sale-total-finance strong{font-size:.76rem;white-space:nowrap}
.sale-qty-badge{display:inline-flex;margin-top:6px;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:.72rem;width:max-content}
.sale-batch-finance-total{display:grid!important;grid-template-columns:minmax(120px,1.1fr) repeat(7,minmax(82px,1fr))!important;gap:10px!important}
@media(max-width:1100px){.sale-finance-card{grid-template-columns:1fr 1fr!important}.sale-product-main,.sale-details-button{grid-column:1/-1}.sale-details-button{width:100%}.sale-batch-finance-total{grid-template-columns:repeat(4,minmax(0,1fr))!important}}
@media(max-width:700px){.sale-finance-card{grid-template-columns:1fr!important}.sale-unit-finance,.sale-total-finance{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-batch-finance-total{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

.cost-basis-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:14px 0; }
.cost-basis-summary span { padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--soft); display:flex; flex-direction:column; gap:4px; }
.cost-basis-summary strong { font-size:1.05rem; }
.cost-basis-card small { display:block; margin-top:5px; color:var(--muted); }
@media (max-width:700px){ .cost-basis-summary{grid-template-columns:1fr;} }


/* Verified financial-column emphasis. Classes are attached by the table renderer,
   so column reordering and saved widths do not affect the styling. */
.inventory-table th.finance-cell,
.inventory-table td.finance-cell,
.table-scroll th.finance-cell,
.table-scroll td.finance-cell {
  background-clip: padding-box !important;
  box-shadow: inset 1px 0 rgba(100, 116, 139, .10), inset -1px 0 rgba(100, 116, 139, .08) !important;
}
.inventory-table th.finance-cost,
.table-scroll th.finance-cost { background: #eef1f5 !important; }
.inventory-table td.finance-cost,
.table-scroll td.finance-cost { background: #f5f7f9 !important; }
.inventory-table th.finance-sales,
.table-scroll th.finance-sales { background: #e8f0f8 !important; }
.inventory-table td.finance-sales,
.table-scroll td.finance-sales { background: #f1f6fb !important; }
.inventory-table th.finance-result,
.table-scroll th.finance-result { background: #e9f3ed !important; }
.inventory-table td.finance-positive,
.table-scroll td.finance-positive { background: #f0f7f2 !important; color: #285a3b !important; font-weight: 700; }
.inventory-table td.finance-negative,
.table-scroll td.finance-negative { background: #fbefef !important; color: #8a3535 !important; font-weight: 700; }
.inventory-table tr:hover td.finance-cost,
.table-scroll tr:hover td.finance-cost { background: #eceff3 !important; }
.inventory-table tr:hover td.finance-sales,
.table-scroll tr:hover td.finance-sales { background: #e7f0f8 !important; }
.inventory-table tr:hover td.finance-positive,
.table-scroll tr:hover td.finance-positive { background: #e5f1e8 !important; }
.inventory-table tr:hover td.finance-negative,
.table-scroll tr:hover td.finance-negative { background: #f7e3e3 !important; }

/* Financial highlights — actual inventory table wrapper is .table-wrap. */
.table-wrap th.finance-cell,
.table-wrap td.finance-cell {
  background-clip: padding-box !important;
  box-shadow: inset 1px 0 rgba(100,116,139,.12), inset -1px 0 rgba(100,116,139,.09) !important;
}
.table-wrap th.finance-cost { background:#e9edf2 !important; }
.table-wrap td.finance-cost { background:#f2f4f7 !important; }
.table-wrap th.finance-sales { background:#e3edf7 !important; }
.table-wrap td.finance-sales { background:#edf4fa !important; }
.table-wrap th.finance-result { background:#e4efe8 !important; }
.table-wrap td.finance-positive { background:#edf5ef !important; color:#285a3b !important; font-weight:700; }
.table-wrap td.finance-negative { background:#f9eaea !important; color:#8a3535 !important; font-weight:700; }
.table-wrap tbody tr:hover td.finance-cost { background:#e8ecf1 !important; }
.table-wrap tbody tr:hover td.finance-sales { background:#e3edf6 !important; }
.table-wrap tbody tr:hover td.finance-positive { background:#e2efe5 !important; }
.table-wrap tbody tr:hover td.finance-negative { background:#f4dede !important; }

/* Batch Mac Scan */
.mac-scan-card{width:min(980px,94vw);max-height:90vh;overflow:auto}.mac-scan-create{border:1px solid #dfe5ec;background:#f8fafc;border-radius:12px;padding:16px;margin-bottom:18px}.mac-scan-current{border:1px solid #cfd9e6;border-radius:14px;padding:16px;margin:16px 0;background:#fff}.mac-scan-access{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:10px;align-items:end}.mac-scan-access>div{background:#f3f6fa;border-radius:10px;padding:10px}.mac-scan-access span,.mac-scan-access strong{display:block}.mac-scan-access span{font-size:12px;color:#667085}.mac-scan-progress{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}.mac-scan-progress span{background:#eef2f7;padding:9px 12px;border-radius:999px}.mac-scan-controls{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.mac-scan-items article,.mac-scan-session-list article{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px;align-items:center;border-top:1px solid #e7ebf0;padding:10px 2px}.mac-scan-items small,.mac-scan-session-list small{display:block;color:#667085}.scan-state{font-size:12px;font-weight:800;padding:5px 8px;border-radius:999px}.scan-pending{background:#f2f4f7}.scan-scanned{background:#e7f6ed;color:#18794e}.scan-failed{background:#fdecec;color:#b42318}.scan-audit>div{padding:8px;border-top:1px solid #e7ebf0}.scan-audit small{display:block}.checkbox-label{display:flex!important;align-items:center;gap:8px}.checkbox-label input{width:auto!important}@media(max-width:760px){.mac-scan-access{grid-template-columns:1fr}.mac-scan-items article,.mac-scan-session-list article{grid-template-columns:1fr}.mac-scan-card{width:96vw}}

/* Batch Mac Scan — professional session workspace */
.mac-scan-dialog{padding:0;border:0;background:transparent}
.mac-scan-card{width:min(1040px,96vw);max-height:92vh;overflow:auto;padding:0;border-radius:20px;background:#f7f9fc;box-shadow:0 24px 70px rgba(15,23,42,.22)}
.mac-scan-card>.close{top:18px;right:18px;z-index:4}
.mac-scan-header{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:26px 30px 20px;background:#fff;border-bottom:1px solid #e6eaf0}
.mac-scan-header h2{margin:4px 0 5px;font-size:25px;letter-spacing:-.02em}
.mac-scan-header p{margin:0;color:#667085}
.eyebrow{font-size:11px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#49658f}
.mac-scan-tabs{display:flex;gap:6px;padding:12px 30px 0;background:#fff;border-bottom:1px solid #e6eaf0}
.mac-scan-tabs button{width:auto;padding:10px 14px;border:0;border-bottom:3px solid transparent;border-radius:9px 9px 0 0;background:transparent;color:#667085}
.mac-scan-tabs button.active{color:#173f78;border-bottom-color:#2f67ad;background:#f5f8fc}
.mac-scan-create,#macScanManagePanel{margin:22px 30px;padding:22px;border:1px solid #dfe5ed;border-radius:16px;background:#fff}
.mac-scan-panel-heading,.mac-scan-list-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.mac-scan-panel-heading h3,.mac-scan-list-heading h3{margin:0 0 4px}.mac-scan-panel-heading p,.mac-scan-list-heading p{margin:0;color:#667085}
.secure-pill{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:#eef4fb;color:#315d91;font-size:12px;font-weight:750;white-space:nowrap}
.mac-scan-extension{align-self:end;min-height:44px;padding:10px 12px;border:1px solid #e1e6ed;border-radius:10px;background:#fafbfc}
.mac-scan-create-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:18px}.mac-scan-create-actions .message{margin:0 auto 0 0}
.mac-scan-current{margin:0 0 24px;border:1px solid #d9e1ea;border-radius:16px;padding:20px;background:#fff}
.mac-scan-session-top{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}.mac-scan-session-top h3{margin:7px 0 3px;font-size:21px}.mac-scan-session-top p{margin:0;color:#667085}
.mac-scan-countdown{min-width:150px;text-align:right}.mac-scan-countdown span,.mac-scan-countdown strong{display:block}.mac-scan-countdown span{font-size:12px;color:#667085}.mac-scan-countdown strong{font-size:18px;margin-top:3px}
.mac-scan-access{display:grid;grid-template-columns:minmax(250px,2fr) minmax(130px,.7fr) minmax(140px,.8fr) auto;gap:10px;align-items:stretch;margin-bottom:16px}
.mac-scan-access-block{padding:12px 14px;border:1px solid #e1e6ed;border-radius:11px;background:#f8fafc;min-width:0}.mac-scan-access-block span,.mac-scan-access-block strong{display:block}.mac-scan-access-block span{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#667085}.mac-scan-access-block strong{margin-top:4px;overflow-wrap:anywhere}.session-code{font-size:20px;letter-spacing:.11em}.session-code-small{margin-left:7px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#49658f}
.mac-scan-progress-card{padding:14px;border:1px solid #e2e7ee;border-radius:13px;background:#fbfcfe}.mac-scan-progress-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.mac-scan-progress-summary div{text-align:center;padding:7px}.mac-scan-progress-summary strong,.mac-scan-progress-summary span{display:block}.mac-scan-progress-summary strong{font-size:20px}.mac-scan-progress-summary span{font-size:12px;color:#667085}
.mac-scan-progress-track,.mac-scan-session-mini-progress{height:7px;border-radius:999px;background:#e9edf2;overflow:hidden}.mac-scan-progress-track{margin-top:10px}.mac-scan-progress-track span,.mac-scan-session-mini-progress span{display:block;height:100%;border-radius:inherit;background:#5c87bd}
.mac-scan-controls{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin:14px 0}
.mac-scan-items{border:1px solid #e1e6ed;border-radius:13px;overflow:hidden}.mac-scan-items article{display:grid;grid-template-columns:minmax(250px,1fr) auto;gap:8px 14px;align-items:center;padding:13px 15px;border-top:1px solid #e8ecf1;background:#fff}.mac-scan-items article:first-child{border-top:0}.mac-scan-item-main small{display:block;margin-top:3px;color:#667085}.mac-scan-result{grid-column:1/-1;color:#667085}
.scan-state{display:inline-flex;align-items:center;justify-content:center;width:max-content;font-size:11px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;padding:5px 8px;border-radius:999px}.scan-active{background:#e8f3ff;color:#235b99}.scan-pending{background:#f0f2f5;color:#596273}.scan-scanned{background:#e7f5ec;color:#19704b}.scan-failed{background:#fdecec;color:#a9342b}.scan-closed,.scan-expired{background:#f1f1f3;color:#666b75}
.mac-scan-audit-details{margin-top:14px;border-top:1px solid #e7ebf0;padding-top:12px}.mac-scan-audit-details summary{cursor:pointer;font-weight:700}.mac-scan-audit-details summary span{display:inline-flex;min-width:22px;justify-content:center;margin-left:6px;padding:2px 6px;border-radius:999px;background:#eef1f5;font-size:11px}.scan-audit>div{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;padding:10px 0;border-top:1px solid #edf0f4}.scan-audit small{grid-column:2;color:#667085}
.mac-scan-session-list{display:grid;gap:10px}.mac-scan-session-row{display:grid;grid-template-columns:minmax(280px,1fr) minmax(110px,.35fr) minmax(150px,.45fr) auto;gap:14px;align-items:center;padding:14px;border:1px solid #e1e6ed;border-radius:13px;background:#fff}.mac-scan-session-row-main{display:flex;align-items:center;gap:12px}.mac-scan-session-row-main small{display:block;margin-top:3px;color:#667085}.mac-scan-session-mini-progress{width:100%}.mac-scan-session-row>small{color:#667085}
.mac-scan-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:140px;border:1px dashed #cfd7e2;border-radius:14px;color:#667085}.mac-scan-empty strong{color:#344054;margin-bottom:4px}
.mac-scan-card>.dialog-actions{padding:0 30px 24px;margin-top:0}
@media(max-width:820px){.mac-scan-header{padding:22px 22px 17px}.mac-scan-tabs{padding-left:22px}.mac-scan-create,#macScanManagePanel{margin:18px 20px;padding:17px}.mac-scan-access{grid-template-columns:1fr 1fr}.mac-scan-access-url{grid-column:1/-1}.mac-scan-session-row{grid-template-columns:1fr auto}.mac-scan-session-mini-progress,.mac-scan-session-row>small{grid-column:1/-1}.mac-scan-progress-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.mac-scan-card{width:100vw;max-height:100vh;border-radius:0}.mac-scan-header{align-items:flex-start;padding-right:56px}.mac-scan-header>button{display:none}.mac-scan-create,#macScanManagePanel{margin:14px 12px}.mac-scan-access{grid-template-columns:1fr}.mac-scan-access-url{grid-column:auto}.mac-scan-session-top{display:block}.mac-scan-countdown{text-align:left;margin-top:12px}.mac-scan-items article{grid-template-columns:1fr}.mac-scan-result{grid-column:auto}.mac-scan-create-actions{align-items:stretch;flex-direction:column}.mac-scan-create-actions button{width:100%}}

/* Batch Mac Scan layout v4 */
.mac-scan-dialog{width:auto;max-width:none;padding:0;border:0;background:transparent}
.mac-scan-card{display:flex;flex-direction:column;width:min(960px,94vw);height:min(860px,92vh);max-height:92vh;overflow:hidden;padding:0;border-radius:22px;background:#f7f9fc;box-shadow:0 24px 70px rgba(15,23,42,.24)}
.mac-scan-header,.mac-scan-tabs,.mac-scan-card>.dialog-actions{flex:0 0 auto}
#macScanCreatePanel,#macScanManagePanel{min-height:0;overflow:auto}
.mac-scan-create,#macScanManagePanel{margin:20px 26px;padding:24px}
.mac-scan-card>.dialog-actions{display:flex;justify-content:flex-end;padding:14px 26px 22px;border-top:1px solid #e5eaf0;background:#fff}
.mac-scan-card>.dialog-actions button{width:auto;min-width:100px}
.mac-scan-form-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,240px);gap:16px 18px;align-items:end}
.mac-scan-field{display:flex;min-width:0;flex-direction:column;gap:7px;font-weight:700;color:#475467}
.mac-scan-field input,.mac-scan-field select{width:100%;min-width:0}
.mac-scan-field-wide{grid-column:1/2}
.mac-scan-selected-box{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 18px;padding:13px 15px;border:1px solid #dce4ee;border-radius:12px;background:#f7f9fc}
.mac-scan-selected-box span{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:#667085}
.mac-scan-selected-box strong{text-align:right;color:#344054}
.mac-scan-extension{grid-column:2/3;align-self:stretch;display:flex!important;align-items:center;gap:10px;min-height:74px;padding:12px 14px}
.mac-scan-extension span{display:flex;flex-direction:column;gap:2px}
.mac-scan-extension small{font-weight:400;color:#667085}
.mac-scan-create-actions{position:sticky;bottom:-24px;z-index:2;margin:22px -24px -24px;padding:16px 24px;border-top:1px solid #e5eaf0;background:#fff}
.mac-scan-create-actions button{width:auto;min-width:150px}
.mac-scan-current{margin:0 0 18px;padding:20px}
.mac-scan-session-row{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"head button" "body button";gap:10px 18px;padding:16px 17px}
.mac-scan-session-row-head{grid-area:head;display:flex;align-items:center;justify-content:space-between;gap:12px}
.mac-scan-session-time{font-size:13px;color:#667085}
.mac-scan-session-row-body{grid-area:body;min-width:0}
.mac-scan-session-title{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:4px}
.mac-scan-session-title>strong{font-size:17px;color:#101828}
.mac-scan-session-title>span{font-size:13px;color:#667085}
.mac-scan-session-title b{margin-left:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:15px;letter-spacing:.08em;color:#315a8a}
.mac-scan-session-row-body>small{display:block;color:#667085}
.mac-scan-session-mini-progress{margin-top:10px}
.mac-scan-open-button{grid-area:button;align-self:center;width:auto;white-space:nowrap}
.mac-scan-list-heading{margin-bottom:14px}
.mac-scan-session-list{gap:12px}
.mac-scan-access button{width:auto;white-space:nowrap}
.mac-scan-controls button{width:auto}
@media(max-width:760px){
  .mac-scan-card{width:100vw;height:100vh;max-height:100vh;border-radius:0}
  .mac-scan-create,#macScanManagePanel{margin:14px 12px;padding:17px}
  .mac-scan-form-grid{grid-template-columns:1fr}
  .mac-scan-field-wide,.mac-scan-extension{grid-column:1}
  .mac-scan-selected-box{align-items:flex-start;flex-direction:column;gap:5px}
  .mac-scan-selected-box strong{text-align:left}
  .mac-scan-create-actions{bottom:-17px;margin:20px -17px -17px;padding:14px 17px}
  .mac-scan-session-row{grid-template-columns:1fr;grid-template-areas:"head" "body" "button"}
  .mac-scan-open-button{width:100%}
  .mac-scan-session-row-head{align-items:flex-start}
}

/* Batch Mac Scan: centered desktop modal and mobile full-screen sheet */
#macScanSessionDialog.mac-scan-dialog {
  position: fixed;
  inset: 0;
  width: fit-content;
  height: fit-content;
  max-width: none;
  max-height: none;
  margin: auto;
  overflow: visible;
}

#macScanSessionDialog .mac-scan-card {
  width: min(1040px, calc(100vw - 40px));
  height: min(860px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  margin: 0;
  box-sizing: border-box;
}

#macScanSessionDialog .mac-scan-header,
#macScanSessionDialog .mac-scan-tabs,
#macScanSessionDialog .dialog-actions {
  width: 100%;
  box-sizing: border-box;
}

#macScanSessionDialog .mac-scan-header > div {
  min-width: 0;
}

#macScanSessionDialog .mac-scan-header p {
  max-width: 720px;
}

#macScanSessionDialog .mac-scan-card > section {
  min-width: 0;
}

@media (max-width: 760px) {
  #macScanSessionDialog.mac-scan-dialog {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
  }

  #macScanSessionDialog .mac-scan-card {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  #macScanSessionDialog .mac-scan-header {
    align-items: flex-start;
    padding: 18px 52px 16px 18px;
  }

  #macScanSessionDialog .mac-scan-header h2 {
    font-size: 22px;
  }

  #macScanSessionDialog .mac-scan-header p {
    font-size: 14px;
    line-height: 1.45;
  }

  #macScanSessionDialog .mac-scan-header #refreshMacScanSessionsButton {
    display: none;
  }

  #macScanSessionDialog .mac-scan-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 8px 12px 0;
  }

  #macScanSessionDialog .mac-scan-tabs button {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  #macScanSessionDialog .mac-scan-create,
  #macScanSessionDialog #macScanManagePanel {
    margin: 12px;
    padding: 15px;
  }

  #macScanSessionDialog .mac-scan-session-row-head,
  #macScanSessionDialog .mac-scan-panel-heading,
  #macScanSessionDialog .mac-scan-list-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  #macScanSessionDialog .mac-scan-session-time {
    width: 100%;
  }

  #macScanSessionDialog .dialog-actions {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  #macScanSessionDialog .dialog-actions button {
    width: 100%;
  }
}
