:root{color-scheme:dark;--bg:#0b0c14;--side:#11131f;--panel:#151724;--panel2:#1b1d2c;--line:#292b3c;--muted:#9194aa;--text:#f6f5fc;--purple:#885eff;--light:#b8a4ff;--green:#42d9a4;--orange:#ffc077;--red:#ff818f;--shadow:0 20px 80px #0008}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}input,select,textarea{color:var(--text);background:#10111c;border:1px solid #313348;border-radius:10px;outline:none;transition:border .15s}input:focus,select:focus,textarea:focus{border-color:var(--purple);box-shadow:0 0 0 3px #885eff23}a{color:var(--light)}.app{display:flex;min-height:100vh}.sidebar{width:252px;min-width:252px;position:sticky;top:0;height:100vh;background:var(--side);border-right:1px solid #252636;display:flex;flex-direction:column;padding:27px 16px}.brand{display:flex;align-items:center;gap:12px;padding:3px 12px 39px}.brand strong{display:block;font-weight:850;font-size:20px;line-height:21px;letter-spacing:3.4px}.brand small{color:#9793bd;font-size:9px;font-weight:800;letter-spacing:3.2px}.brand-symbol{width:35px;height:35px;position:relative;border-radius:10px;background:linear-gradient(150deg,#a780ff,#6643e0);display:flex;align-items:center;justify-content:center;gap:3px;box-shadow:0 5px 19px #6643e055}.brand-symbol span{width:4px;height:17px;border-radius:8px;background:white;transform:skew(-15deg)}.brand-symbol span:nth-child(2){height:22px}.brand-symbol span:nth-child(3){height:12px}.side-section-label{font-weight:750;color:#777c96;font-size:10px;letter-spacing:1.8px;padding:0 14px 12px}.side-nav{display:flex;flex-direction:column;gap:5px}.side-nav button{border:0;background:transparent;color:#a7a9bd;display:flex;gap:13px;align-items:center;border-radius:11px;padding:12px 13px;text-align:left;font-size:13px;font-weight:650;width:100%;transition:background .15s,color .15s}.side-nav button:hover,.side-nav button.active{background:#242039;color:#e4dafe}.side-nav button.active{box-shadow:inset 3px 0 0 var(--purple)}.nav-icon{width:21px;font-size:22px;text-align:center;font-weight:400}.nav-count{background:#39314f;border-radius:10px;padding:2px 7px;font-size:10px;margin-left:auto}.side-bottom{margin-top:auto}.workspace-status{border:1px solid var(--line);border-radius:13px;background:#171927;display:flex;align-items:center;padding:14px;gap:10px}.status-led{width:8px;height:8px;border-radius:100%;background:var(--green);box-shadow:0 0 0 4px #42d9a41d}.workspace-status b{display:block;font-size:12px}.workspace-status small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.sidebar-foot{font-size:11px;color:#595d76;text-align:center;margin-top:20px}.sidebar-foot span{color:var(--purple)}.main{min-width:0;flex:1}.topbar{height:79px;border-bottom:1px solid #252535;display:flex;align-items:center;justify-content:space-between;padding:0 38px;gap:20px}.breadcrumb{color:#777b93;font-size:11px;font-weight:750;letter-spacing:1px}.breadcrumb span{padding:0 11px;color:#575a70}.breadcrumb strong{color:#d1d0e1;letter-spacing:0;font-size:12px}.topbar-actions{display:flex;gap:11px}.btn{border-radius:10px;border:1px solid #37394d;padding:10px 15px;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-size:12px;font-weight:750;white-space:nowrap;min-height:40px}.btn-primary{border-color:#8f6bff;background:linear-gradient(135deg,#9b6dff,#7246e4);color:white;box-shadow:0 5px 24px #6b47e338}.btn-primary:hover{filter:brightness(1.1)}.btn-ghost{background:#202131;color:#e6e2f6}.btn-ghost:hover{background:#2b2c3c}.btn-outline{background:transparent;color:#c6c4da}.btn-danger{background:#432431;border-color:#693543;color:#ffbbc7}.btn-sm{padding:7px 10px;min-height:32px;font-size:11px}.btn-plus{font-size:19px;line-height:10px}.content{padding:38px;max-width:1500px;margin:0 auto}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.8px;color:var(--light);text-transform:uppercase;margin-bottom:11px}.page-intro{display:flex;justify-content:space-between;align-items:flex-end;gap:22px;margin-bottom:30px}.page-intro h1{font-size:clamp(26px,3vw,34px);font-weight:820;letter-spacing:-1.15px;line-height:1.1;margin:0 0 9px}.page-intro p{margin:0;color:var(--muted);font-size:13px;line-height:1.6}.intro-actions{display:flex;gap:10px;flex-wrap:wrap}.overview-line{font-size:12px;color:var(--muted);margin-top:3px}.overview-line strong{color:#ece8ff}.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:25px}.stat{background:linear-gradient(160deg,#1d1d2c 0%,#171824 100%);border:1px solid #2a2b3d;border-radius:17px;padding:20px;min-height:142px;position:relative;overflow:hidden}.stat.featured{background:linear-gradient(130deg,#4b3189,#271f46);border-color:#6950a8}.stat-label{font-size:11px;color:#adadc2;font-weight:700;margin-bottom:20px}.stat-val{font-size:clamp(21px,2.2vw,29px);font-weight:850;letter-spacing:-1px;font-variant-numeric:tabular-nums}.stat-sub{font-size:11px;color:#9395a9;margin-top:8px}.stat.featured .stat-sub,.stat.featured .stat-label{color:#d0c1ee}.stat-icon{position:absolute;right:17px;top:16px;color:#aea1f2;font-size:23px;background:#ffffff0b;width:35px;height:35px;display:grid;place-items:center;border-radius:10px}.section-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(290px,1fr);gap:18px;margin-bottom:23px}.panel{border:1px solid #292b3d;background:#151724;border-radius:17px;overflow:hidden}.panel-pad{padding:22px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:19px}.panel-heading h2{font-size:15px;letter-spacing:-.3px;margin:0}.panel-heading small{font-size:11px;color:#9697ad}.link-button{border:0;background:transparent;color:var(--light);font-size:12px;font-weight:750}.list-row{padding:13px 0;border-top:1px solid #27293a;display:flex;align-items:center;justify-content:space-between;gap:12px}.list-row:first-of-type{border-top:none}.product-dot{border-radius:10px;background:#2c2943;color:#af95ff;width:40px;height:40px;display:grid;place-items:center;font-size:16px;font-weight:750;flex-shrink:0}.row-main{min-width:0;flex:1}.row-main b{font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.row-main small{color:var(--muted);font-size:11px;display:block;margin-top:5px}.row-right{text-align:right;white-space:nowrap}.row-right b{display:block;font-variant-numeric:tabular-nums;font-size:12px}.row-right small{display:block;font-size:10px;margin-top:5px;color:var(--muted)}.alert-pill{display:inline-block;background:#4e3728;color:#ffd3a3;border:1px solid #775035;padding:4px 9px;border-radius:999px;font-size:10px;font-weight:750}.low-pill{background:#51303c;color:#ffb7c2;border:1px solid #77414f}.positive-pill{background:#1c433b;color:#7ff5bf;border:1px solid #315b50}.empty{padding:36px 20px;text-align:center;color:var(--muted);font-size:13px;line-height:1.7}.action-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.action-tile{background:#202132;border:1px solid #313249;border-radius:13px;padding:19px 15px;text-align:left;color:var(--text);min-height:120px}.action-tile:hover{border-color:#7554cc}.action-tile .a-icon{font-size:25px;color:#aa8eff;display:block;margin-bottom:17px}.action-tile b{font-size:12px;display:block}.action-tile small{font-size:10px;color:var(--muted);margin-top:6px;display:block}.toolbar{display:flex;flex-wrap:wrap;gap:11px;align-items:center;margin:0 0 16px}.search{display:flex;align-items:center;gap:9px;background:#1d1e2d;border:1px solid #343448;border-radius:11px;padding:0 13px;flex:1;min-width:220px;height:42px}.search span{color:#9d96bb;font-size:20px}.search input{width:100%;background:transparent;border:0;box-shadow:none!important;font-size:12px}.search input:focus{outline:0}.search input::placeholder{color:#898a9e}.toolbar select,.toolbar .small-select{height:42px;padding:0 13px;background:#1d1e2d;font-size:12px;min-width:140px}.results-info{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}.table-scroller{width:100%;overflow-x:auto}.inventory-table{border-collapse:collapse;width:100%;min-width:760px;text-align:left}.inventory-table th{background:#191b29;color:#8e90a9;font-size:10px;letter-spacing:.7px;text-transform:uppercase;padding:16px;font-weight:800;border-bottom:1px solid #303045}.inventory-table td{padding:13px 16px;border-bottom:1px solid #252637;font-size:12px;vertical-align:middle}.inventory-table tr:last-child td{border-bottom:0}.inventory-table tbody tr:hover{background:#1b1d2c}.table-name{font-weight:740;color:#eceaf5;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mono{font-size:11px;color:#9597ad;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.numeric{font-variant-numeric:tabular-nums}.muted{color:var(--muted)}.missing{color:#8c849b}.row-actions{display:flex;gap:6px}.tiny-btn{background:#27283a;border:1px solid #3d3d52;border-radius:7px;color:#dbd7f1;padding:6px 8px;font-size:11px;white-space:nowrap}.tiny-btn:hover{background:#35304d}.stock-number{font-weight:760}.stock-number.low{color:var(--red)}.mobile-products{display:none}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field{display:flex;flex-direction:column;gap:8px}.field.full{grid-column:1/-1}.field label{font-size:11px;color:#b8b8cf;font-weight:730}.field input,.field select,.field textarea{padding:12px 13px;min-height:42px;width:100%;font-size:13px}.field textarea{resize:vertical;min-height:75px}.hint{font-size:11px;color:var(--muted);line-height:1.6}.settings-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.settings-card{padding:24px}.settings-card h2{margin:0 0 8px;font-size:16px}.settings-card p{margin:0 0 21px;color:var(--muted);font-size:12px;line-height:1.6}.settings-actions{display:flex;flex-wrap:wrap;gap:9px}.inv-option{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;text-align:left;background:#1d1e2b;border:1px solid #38384c;border-radius:11px;padding:14px;margin:0 0 8px;color:var(--text)}.inv-option.active{border-color:#8c6df5;background:#2a2443}.inv-option b{display:block;font-size:13px}.inv-option small{display:block;color:var(--muted);font-size:10px;margin-top:6px}.inv-check{color:var(--green)}.notice{background:#252036;border:1px solid #4b3b73;border-radius:12px;padding:13px 15px;color:#cabdeb;font-size:12px;line-height:1.7;margin:12px 0 18px}.modal-backdrop{position:fixed;inset:0;background:#080913df;z-index:100;display:flex;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(7px)}.modal{background:#191b29;border:1px solid #414154;border-radius:19px;box-shadow:var(--shadow);width:min(590px,100%);max-height:min(92dvh,780px);overflow:auto}.modal.wide{width:min(700px,100%)}.modal-header{padding:22px 24px 18px;border-bottom:1px solid #333448;display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.modal-header h2{margin:0 0 7px;font-size:20px;letter-spacing:-.4px}.modal-header p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.close-modal{border:1px solid #414254;color:#c6c2d6;background:#27293a;width:30px;height:30px;border-radius:8px;font-size:18px;display:grid;place-items:center}.modal-body{padding:24px}.modal-footer{padding:17px 24px;border-top:1px solid #343447;display:flex;gap:10px;justify-content:flex-end}.reader-box{background:#08090e;border:1px solid #3c354f;border-radius:14px;overflow:hidden;min-height:255px;display:flex;align-items:center;justify-content:center;position:relative}.reader-box #reader{width:100%;min-height:255px}.reader-box video{width:100%!important;object-fit:cover}.reader-label{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;border:2px solid #9b79ff;border-radius:11px;width:min(65%,270px);height:120px;box-shadow:0 0 0 150px #03020a40}.scan-help{font-size:12px;color:#aaa7c1;text-align:center;margin-top:14px;line-height:1.5}.scan-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.scan-actions .btn{flex:1}.toast-root{position:fixed}.toast{position:fixed;bottom:25px;right:25px;z-index:300;background:#242337;color:#f4f2ff;padding:13px 17px;border:1px solid #6452a0;border-radius:11px;box-shadow:var(--shadow);max-width:min(95vw,410px);font-size:12px;line-height:1.5}.toast.error{border-color:#a74863}.mobile-nav{display:none}.kv-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #292a3b;padding:12px 0;font-size:12px}.kv-bar b{color:#eeeaff}.num-badge{background:#2c2646;color:#bca8ff;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:750}.unit-actions{display:flex;align-items:center;gap:5px}.unit-actions button{width:27px;height:27px;background:#242439;border:1px solid #414156;border-radius:7px;color:#dfd5ff;font-size:16px;line-height:1}.unit-actions b{min-width:35px;text-align:center;font-variant-numeric:tabular-nums}.note{color:#9799b0;font-size:11px}.print-only{display:none}
@media(max-width:1100px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.content{padding:29px}.section-grid{grid-template-columns:1fr}.action-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.sidebar{display:none}.topbar{height:68px;padding:0 18px}.desktop-only{display:none}.content{padding:24px 16px 110px}.breadcrumb{font-size:10px}.breadcrumb strong{font-size:11px}.page-intro{align-items:flex-start;flex-direction:column;gap:14px;margin-bottom:24px}.page-intro h1{font-size:29px}.cards{gap:10px}.stat{padding:15px;min-height:122px;border-radius:14px}.stat-label{margin-bottom:16px;font-size:10px}.stat-val{font-size:22px}.stat-sub{font-size:10px}.stat-icon{font-size:19px;right:11px;top:11px;width:29px;height:29px}.panel-pad{padding:18px}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;height:calc(72px + env(safe-area-inset-bottom));padding:7px 9px calc(7px + env(safe-area-inset-bottom));z-index:50;background:#161724ef;backdrop-filter:blur(15px);border-top:1px solid #363347;align-items:center;justify-content:space-around}.mobile-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:60px;background:transparent;border:0;color:#9496aa;font-size:10px;font-weight:650;padding:4px}.mobile-nav button span{font-size:22px}.mobile-nav button.active{color:#b9a0ff}.mobile-nav .scan-tab{min-width:60px;width:55px;height:55px;border-radius:16px;background:linear-gradient(135deg,#a978ff,#6f43e2);color:white;font-size:31px;box-shadow:0 6px 16px #8e58f14b;transform:translateY(-13px)}.inventory-table,.table-scroller{display:none}.mobile-products{display:block}.mobile-product{padding:16px;border-bottom:1px solid #2b2c3e}.mobile-product:last-child{border-bottom:0}.mobile-product-head{display:flex;gap:10px;align-items:center;margin-bottom:14px}.mobile-product-info{flex:1;min-width:0}.mobile-product-info b{font-size:13px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-product-info small{font-size:10px;color:var(--muted);margin-top:5px;display:block}.mobile-meta{display:flex;justify-content:space-between;align-items:center;gap:10px}.mobile-meta .row-actions{align-items:center}.mobile-meta b{font-size:13px}.settings-grid{grid-template-columns:1fr}.action-grid{gap:9px}.action-tile{min-height:105px;padding:14px 10px}.action-tile small{display:none}.action-tile .a-icon{margin-bottom:14px}.field-grid{grid-template-columns:1fr 1fr}.modal-backdrop{align-items:flex-end;padding:0}.modal{width:100%;max-height:95dvh;border-radius:20px 20px 0 0}.modal-body{padding:20px}.modal-header{padding:20px}.modal-footer{padding:15px 20px calc(16px + env(safe-area-inset-bottom))}.toast{bottom:85px;right:12px;left:12px;max-width:none}.toolbar{gap:8px}.toolbar select{flex:1;min-width:120px}.search{flex-basis:100%}.intro-actions .btn{flex:1}}
@media(max-width:380px){.field-grid{grid-template-columns:1fr}.stat-val{font-size:19px}.cards{gap:7px}.stat{padding:12px}.breadcrumb{letter-spacing:0}.btn{padding:9px 10px}}
@media print{*{color-scheme:light!important;box-shadow:none!important}body{background:#fff!important;color:#111!important}.sidebar,.topbar,.mobile-nav,.toolbar,.results-info,.page-intro,.intro-actions,.row-actions,.mobile-products,#modal-root,#toast-root,.screen-only{display:none!important}.main{width:100%}.content{padding:0;margin:0;max-width:none}.panel{border:0;background:#fff}.inventory-table{display:table!important;min-width:0}.table-scroller{display:block!important;overflow:visible}.inventory-table td,.inventory-table th{background:white!important;color:#111!important;font-size:9px;border-bottom:1px solid #ccc;padding:7px}.print-only{display:block!important;margin:0 0 20px;color:#111}thead{display:table-header-group}tr{page-break-inside:avoid}}

/* V2: photo thumbnails, actual PNG UI symbols, appearance choices */
.ui-icon{width:19px;height:19px;display:inline-block;object-fit:contain;vertical-align:middle;flex-shrink:0}
.nav-icon .ui-icon,.mobile-nav .ui-icon{width:21px;height:21px}
.mobile-nav button>.ui-icon{width:22px;height:22px}
.mobile-nav .scan-tab .ui-icon{width:26px;height:26px;filter:brightness(0) invert(1)}
.stat-icon .ui-icon{width:22px;height:22px}
.action-tile .a-icon .ui-icon{width:26px;height:26px}
.btn .ui-icon{width:16px;height:16px}
.btn-primary .ui-icon{filter:brightness(0) invert(1)}
.sidebar{padding-bottom:22px}.side-nav{margin-bottom:auto}
.product-picture{width:46px;height:46px;display:flex;align-items:center;justify-content:center;flex:0 0 46px;border-radius:11px;overflow:hidden;background:#2e2a41;border:1px solid #49415b}
.product-picture img{width:100%;height:100%;object-fit:contain;background:#fff}
.product-picture.empty-photo img,.product-picture .photo-fallback{width:22px;height:22px;background:transparent;opacity:.85}
.table-product{display:flex;gap:10px;align-items:center;min-width:185px}
.table-product .product-picture{width:44px;height:44px;flex-basis:44px}
.table-product .table-name{max-width:225px}
.photo-edit{display:flex;align-items:center;gap:17px;flex-wrap:wrap;background:var(--panel2);border:1px solid var(--line);padding:15px;border-radius:13px}
.photo-preview .product-picture{width:98px;height:98px;border-radius:13px}
.photo-preview .product-picture.empty-photo img{width:42px;height:42px}
.photo-edit-buttons{display:flex;gap:8px;align-items:center;flex-wrap:wrap;flex:1}
.photo-edit-buttons small{display:block;width:100%;color:var(--muted);font-size:10px}
.theme-choices{display:flex;gap:12px}
.theme-choice{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:8px;border-radius:14px;border:1px solid var(--line);background:var(--panel2);padding:15px;text-align:left;color:var(--text)}
.theme-choice.selected{border-color:var(--purple);box-shadow:0 0 0 2px #8b65ec40}
.theme-choice .ui-icon{width:25px;height:25px}
.theme-choice b{font-size:12px}.theme-choice small{color:var(--muted);font-size:10px}
/* Light theme: preserve layout and purple brand while making surfaces white */
:root[data-theme=light]{color-scheme:light;--bg:#f7f8fc;--side:#fff;--panel:#fff;--panel2:#f3f3fb;--line:#d9dbea;--muted:#676b83;--text:#202139;--purple:#7e50e3;--light:#6842c4;--red:#c32f56;--green:#18835a;--shadow:0 15px 36px #17204412}
[data-theme=light] .sidebar,[data-theme=light] .topbar{border-color:var(--line)}
[data-theme=light] .brand small,[data-theme=light] .side-section-label,[data-theme=light] .breadcrumb,[data-theme=light] .breadcrumb strong{color:#62677e}
[data-theme=light] .side-nav button{color:#575b71}
[data-theme=light] .side-nav button:hover,[data-theme=light] .side-nav button.active{background:#eee9fc;color:#6034b5}
[data-theme=light] .nav-count{background:#e6defa;color:#5a36aa}
[data-theme=light] .btn-ghost{background:#eeeaf8;color:#4b386f;border-color:#d9d0ea}
[data-theme=light] .btn-ghost:hover{background:#e7ddf7}
[data-theme=light] .btn-outline{color:#584a76}
[data-theme=light] .btn-danger{background:#ffeff2;color:#b9203c;border-color:#fac4cc}
[data-theme=light] input,[data-theme=light] select,[data-theme=light] textarea{background:#fff;color:var(--text);border-color:#d6d9e6}
[data-theme=light] .search,[data-theme=light] .toolbar select{background:#f7f7fc}
[data-theme=light] .search input{background:transparent}
[data-theme=light] .stat{background:#fff;border-color:#e2e3eb}
[data-theme=light] .stat.featured{background:linear-gradient(128deg,#8959eb,#6c45c9);border-color:#8460d5;color:#fff}
[data-theme=light] .stat-label,[data-theme=light] .stat-sub{color:#70748a}
[data-theme=light] .stat.featured .stat-label,[data-theme=light] .stat.featured .stat-sub{color:#f1e7ff}
[data-theme=light] .panel{border-color:#e0e3ed;background:#fff}
[data-theme=light] .panel-heading h2{color:#212138}
[data-theme=light] .list-row,[data-theme=light] .inventory-table td,[data-theme=light] .kv-bar,[data-theme=light] .mobile-product{border-color:#e9e9f0}
[data-theme=light] .table-name,[data-theme=light] .kv-bar b{color:#242439}
[data-theme=light] .inventory-table th{background:#f5f4fa;color:#5c6078;border-color:#e0e0ec}
[data-theme=light] .inventory-table tbody tr:hover{background:#faf8ff}
[data-theme=light] .action-tile,[data-theme=light] .inv-option,[data-theme=light] .tiny-btn,[data-theme=light] .unit-actions button{background:#f7f6fc;color:#242439;border-color:#dcddea}
[data-theme=light] .inv-option.active{background:#eee9fd;border-color:#976ff1}
[data-theme=light] .product-picture{background:#f0ecfc;border-color:#e1dbee}
[data-theme=light] .notice{background:#f2ecff;border-color:#d9c9fb;color:#5b4388}
[data-theme=light] .modal{background:#fff;border-color:#dfdcea}
[data-theme=light] .modal-header,[data-theme=light] .modal-footer{border-color:#e2e0ea}
[data-theme=light] .close-modal{background:#f0eff7;color:#44415b;border-color:#deddea}
[data-theme=light] .field label,[data-theme=light] .row-main b{color:#25263e}
[data-theme=light] .stock-number.low{color:var(--red)}
[data-theme=light] .mobile-nav{background:#fffffff2;border-color:#ddddec}
[data-theme=light] .mobile-nav button{color:#75758b}
[data-theme=light] .mobile-nav button.active{color:var(--purple)}
[data-theme=light] .mobile-nav .scan-tab{color:white}
[data-theme=light] .low-pill{background:#fff1f2;color:#b2334b;border-color:#f7cad1}
[data-theme=light] .positive-pill{background:#e6f8ef;color:#126740;border-color:#bbe5cf}
[data-theme=light] .alert-pill:not(.low-pill):not(.positive-pill){background:#fff1dd;color:#7c4c16;border-color:#f4d9ac}
[data-theme=light] .toast{background:#fff;color:#29213b}
@media print{
 .product-picture{width:29px!important;height:29px!important;flex-basis:29px!important;border:1px solid #ddd!important;background:#fff!important}
 .product-picture img{width:100%!important;height:100%!important;object-fit:contain!important}
 .product-picture.empty-photo img{width:18px!important;height:18px!important;opacity:.45!important}
 .table-product{gap:7px;min-width:0!important}
 .table-product .table-name{max-width:170px;font-size:9px}
 .inventory-table td{padding:5px!important}
 .inventory-table th{font-size:9px}
 .inventory-table .note{font-size:8px}
 .inventory-table .product-picture img{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}

.photo-attribution{font-size:9px;color:#555;margin-top:9px}
@media print{.photo-attribution{display:block!important}}

/* V3 - iPhone barcode scanning and product preview */
.reader-box{min-height:275px;background:#0d0e16}
.reader-box #reader{min-height:275px;line-height:normal}
.reader-box video{height:auto!important;min-height:260px;max-height:52dvh;object-fit:contain!important;background:#09090e}
.reader-label{width:min(88%,450px);height:clamp(100px,30vw,175px);box-shadow:none;border:2px solid #bb9fff}
.scan-line{position:absolute;left:8%;width:84%;top:50%;height:2px;background:#bb9fff77;box-shadow:0 0 14px #a77eff77}
.scan-body{padding:18px}
.scan-tip{color:var(--muted);font-size:12px;line-height:1.6;margin:8px 0 16px}
.scan-help{font-size:12px;line-height:1.55;color:var(--text);margin-top:12px;min-height:20px}
.scan-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}
.scan-actions .btn{white-space:normal;text-align:center}
.scan-product-card{display:grid;grid-template-columns:165px minmax(0,1fr);align-items:center;gap:20px;padding:8px 0 15px}
.scan-product-picture{border:1px solid var(--line);background:var(--bg);border-radius:16px;min-height:175px;display:grid;place-items:center;overflow:hidden}
.scan-product-picture .product-picture{width:145px;height:150px;border:none;background:transparent;display:grid;place-items:center}
.scan-product-picture .product-picture img{width:100%;height:100%;object-fit:contain}
.scan-product-details h3{font-size:22px;line-height:1.2;margin:8px 0 9px;overflow-wrap:anywhere}
.scan-success{font-size:12px;color:#70ebac;font-weight:800}
.scan-current{border:1px solid var(--line);background:var(--side);padding:11px 14px;border-radius:10px;margin-top:14px;font-size:13px}
.scan-current strong{font-size:21px;margin-left:6px}
.scan-price{color:var(--muted);font-size:12px;margin-top:12px}
.scan-photo-msg{padding:12px 14px;border-radius:11px;background:var(--side);border:1px solid var(--line);font-size:12px;line-height:1.5;color:var(--muted)}
.scan-footer{display:flex;gap:9px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:18px;margin-top:19px}
.scan-footer .btn{flex:1;min-width:125px}
.scan-match{display:flex;width:100%;gap:14px;align-items:center;text-align:left;padding:12px;background:var(--side);color:var(--text);border:1px solid var(--line);border-radius:12px;margin-bottom:10px}
.scan-match .product-picture{width:55px;height:55px;flex-shrink:0}
.scan-match span:nth-child(2){flex:1}.scan-match b{display:block}.scan-match small{display:block;margin-top:5px;color:var(--muted)}
@media(max-width:600px){.scan-product-card{grid-template-columns:120px minmax(0,1fr);gap:12px}.scan-product-picture{min-height:140px}.scan-product-picture .product-picture{width:110px;height:110px}.scan-product-details h3{font-size:17px}.scan-body{padding:14px}.reader-box,.reader-box #reader{min-height:210px}.reader-box video{min-height:210px}.scan-footer .btn{min-width:calc(50% - 10px)}}

/* v5 scanner: native camera video directly, no 3rd-party camera widget */
.reader-box #reader{width:100%;display:flex;justify-content:center;align-items:center;min-height:260px;overflow:hidden;background:#080a13}
.reader-box #reader video{width:100%;height:auto;max-height:54dvh;min-height:220px;object-fit:contain!important;display:block}
.reader-box #reader .empty{padding:60px 18px}
.scan-diagnostics{font-size:11px;line-height:1.5;color:var(--muted);border:1px solid var(--border);border-radius:9px;padding:9px;margin-top:6px;overflow-wrap:anywhere}

/* v6 camera: the guide is decorative; processing always scans the whole video frame */
.reader-label{width:min(91%,460px);opacity:.72}.reader-box #reader video{object-fit:contain!important;max-height:55dvh}.scan-actions .btn{min-height:44px}
