:root{--bg:#f4fbff;--panel:#fff;--panel2:#f1f9ff;--line:#cfe7fb;--text:#16344f;--muted:#6a8ba4;--blue:#238ee2;--blue2:#64bdf2;--blue3:#e1f3ff;--danger:#e5484d;--shadow:0 10px 28px rgba(36,142,226,.13)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"Microsoft YaHei UI",sans-serif;color:var(--text);background:linear-gradient(180deg,#f2faff,#ffffff 48%,#eef8ff);font-size:14px;overscroll-behavior:none;touch-action:manipulation}body{overflow-x:hidden;user-select:none;-webkit-user-select:none}button,input,select{font:inherit}button{border:0;cursor:pointer}input,select{user-select:text;-webkit-user-select:text}.hidden{display:none!important}
.app-body{padding-bottom:74px}.app-header{height:42px;display:flex;align-items:center;justify-content:space-between;padding:5px 10px;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;backdrop-filter:blur(14px)}.title-block{min-width:0}.store-title{font-size:16px;font-weight:900;color:#0c5f9d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:58vw}.store-sub{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:58vw}.header-actions{display:flex;gap:5px;align-items:center}.lang-btn,.icon-btn,.small-btn{border:1px solid #bdddf4;background:linear-gradient(180deg,#fff,#eff8ff);color:#126fae;border-radius:10px;padding:6px 8px;font-weight:900;box-shadow:0 5px 14px rgba(35,142,226,.10)}.small-btn{padding:5px 9px;font-size:12px}
.datebar{position:sticky;top:42px;z-index:19;background:rgba(249,253,255,.95);border-bottom:1px solid var(--line);padding:5px 8px;backdrop-filter:blur(14px)}.date-row{display:flex;gap:6px;align-items:center}.date-row label{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:12px}.date-row input{width:120px;border:1px solid #b8dcf4;border-radius:9px;padding:5px 6px;background:#fff;color:var(--text);outline:none}.refresh-btn{margin-left:auto;background:linear-gradient(135deg,#5ab8f1,#238ee2);color:#fff;border-radius:10px;padding:6px 10px;font-weight:900;box-shadow:0 8px 18px rgba(35,142,226,.18)}.quick-dates{display:flex;gap:5px;margin-top:5px;overflow:hidden;flex-wrap:wrap}.quick-dates button{border:1px solid #c3e2f7;background:#fff;color:#1979b7;border-radius:999px;padding:5px 10px;font-weight:800;font-size:12px}.quick-dates button:active{background:#e2f4ff}.quick-dates button.active{background:linear-gradient(135deg,#238ee2,#64bdf2);color:#fff;border-color:#238ee2;box-shadow:0 6px 14px rgba(35,142,226,.24)}
.app-main{padding:8px;max-width:1480px;margin:0 auto}.cards{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;margin-bottom:8px}.card{position:relative;background:linear-gradient(180deg,#fff,#f0f9ff);border:1px solid #c8e6f9;border-radius:16px;padding:10px;box-shadow:var(--shadow);overflow:hidden}.card:before{content:"";position:absolute;right:-22px;top:-22px;width:68px;height:68px;background:radial-gradient(circle,rgba(35,142,226,.18),rgba(35,142,226,0) 68%)}.card span{display:block;color:var(--muted);font-size:12px;font-weight:800}.card strong{display:block;margin-top:4px;color:#0f5894;font-size:20px;line-height:1.12}.tax-cards{grid-template-columns:repeat(4,1fr)}
.panel{background:rgba(255,255,255,.94);border:1px solid #c8e6f9;border-radius:17px;padding:10px;box-shadow:var(--shadow);min-height:calc(100vh - 230px)}.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;gap:10px}.panel h2{margin:0;color:#123e5f;font-size:17px}.panel h3{margin:12px 0 8px;color:#145b91}.panel-actions{display:flex;gap:6px}.content-wrap{max-width:100%;overflow:hidden}.table-wrap{width:100%;max-width:100%;overflow-x:hidden;overflow-y:visible;padding-bottom:4px}table{width:100%;max-width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #d9edf9;border-radius:14px;overflow:hidden;box-shadow:0 6px 18px rgba(35,142,226,.08)}th,td{padding:8px 7px;border-bottom:1px solid #e5f3fc;text-align:left;white-space:normal;word-break:break-word;overflow-wrap:anywhere;vertical-align:middle}th{background:#eaf7ff;color:#316884;font-size:12px;font-weight:900}td{color:#1d3c55;font-size:13px}tbody tr:nth-child(even){background:#fbfdff}.right{text-align:right}.link{color:#0b82ce;font-weight:900;text-decoration:underline;text-underline-offset:3px}.empty{color:var(--muted);padding:18px;text-align:center}.error{padding:14px;border:1px solid #ffcaca;background:#fff4f4;color:#bf1d1d;border-radius:12px}
.chart-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:10px;margin-bottom:10px}.chart-card{background:linear-gradient(180deg,#fff,#f7fcff);border:1px solid #cde8fa;border-radius:16px;padding:10px;box-shadow:0 8px 20px rgba(35,142,226,.10);min-height:170px;overflow:hidden}.chart-card h3{margin:0 0 9px;color:#155f95;font-size:15px}.bar-row{display:grid;grid-template-columns:minmax(72px,1.05fr) 2fr minmax(58px,.72fr);gap:7px;align-items:center;margin:7px 0}.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#315b77;font-size:12px}.bar-track{height:12px;background:#e1f3ff;border-radius:999px;overflow:hidden;border:1px solid #c8e8fb}.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#67c5f4,#238ee2);box-shadow:0 0 10px rgba(35,142,226,.22)}.bar-value{text-align:right;color:#155f95;font-weight:900;font-size:12px}.vbar-wrap{height:160px;display:flex;gap:6px;align-items:end;border-left:1px solid #d6edf9;border-bottom:1px solid #d6edf9;padding:8px 4px 18px;overflow:hidden}.vbar-item{flex:1;min-width:12px;position:relative;height:100%;display:flex;align-items:end}.vbar-fill{width:100%;border-radius:8px 8px 2px 2px;background:linear-gradient(180deg,#74cef5,#238ee2);min-height:3px}.vbar-label{position:absolute;left:50%;bottom:-17px;transform:translateX(-50%);font-size:10px;color:#6a879a;white-space:nowrap}.pie-wrap{display:flex;gap:16px;align-items:center;justify-content:center;min-height:150px}.pie{width:124px;height:124px;border-radius:50%;box-shadow:inset 0 0 0 17px #fff,0 10px 24px rgba(35,142,226,.16);border:1px solid #cce8fa}.pie-legend{display:grid;gap:6px}.pie-legend div{display:flex;align-items:center;gap:7px;color:#315b77;font-size:12px}.pie-dot{width:10px;height:10px;border-radius:50%}.step-chart{height:160px;display:flex;align-items:flex-end;gap:5px;border-left:1px solid #d6edf9;border-bottom:1px solid #d6edf9;padding:8px 4px 18px;overflow:hidden}.step{flex:1;background:linear-gradient(180deg,#9ad9f6,#2d99df);border-radius:8px 8px 0 0;min-height:3px;position:relative}.step:after{content:attr(data-label);position:absolute;left:50%;bottom:-17px;transform:translateX(-50%);font-size:10px;color:#6a879a;white-space:nowrap}.summary-line{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px}.summary-line>div{background:#f2faff;border:1px solid #d3ebfa;border-radius:14px;padding:9px}.summary-line span{display:block;color:var(--muted);font-size:12px}.summary-line strong{display:block;color:#125b91;margin-top:4px}.prod-cell{display:flex;align-items:center;gap:8px;min-width:0}.prod-img{width:42px;height:42px;border-radius:10px;object-fit:cover;border:1px solid #cfe7fb;background:#f1f9ff;flex:0 0 auto}.empty-img{display:inline-block}.image-preview{text-align:center}.image-preview img{max-width:100%;max-height:72vh;border-radius:16px;border:1px solid #d6edf9;box-shadow:var(--shadow)}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;height:64px;background:rgba(255,255,255,.97);border-top:1px solid #c8e6f9;display:grid;grid-template-columns:repeat(4,1fr);z-index:30;box-shadow:0 -12px 28px rgba(35,142,226,.11);padding-bottom:env(safe-area-inset-bottom)}.nav-item{background:transparent;color:#59809b;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-weight:900}.nav-item span{font-size:18px;line-height:1}.nav-item em{font-style:normal;font-size:12px}.nav-item.active{color:#0b82ce;background:linear-gradient(180deg,#f4fbff,#e6f5ff)}.sheet,.modal{position:fixed;inset:0;background:rgba(20,53,78,.23);z-index:50;display:flex;align-items:flex-end;justify-content:center;backdrop-filter:blur(5px)}.sheet-card{width:min(760px,100%);background:#fff;border-radius:22px 22px 0 0;border:1px solid #c8e6f9;box-shadow:0 -18px 48px rgba(22,80,130,.18);padding:12px 12px calc(14px + env(safe-area-inset-bottom))}.sheet-head{height:34px;display:flex;justify-content:space-between;align-items:center;color:#155f95}.sheet-head button,.modal-head button{width:32px;height:32px;border-radius:50%;background:#e9f7ff;color:#0b82ce;font-size:18px;font-weight:900}.more-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.more-grid button{background:#f2faff;border:1px solid #cde8fa;color:#155f95;border-radius:14px;padding:11px 8px;font-weight:900}.more-grid button.active{background:#dff2ff;color:#0879bd;border-color:#91cef3}.modal{align-items:center;padding:12px}.modal-card{width:min(980px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:20px;border:1px solid #c8e6f9;box-shadow:0 22px 62px rgba(22,80,130,.22);padding:12px}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.modal-head h2{margin:0;color:#155f95;font-size:18px}
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#e9f7ff,#f9fdff)}.login-card{position:relative;width:min(430px,92vw);background:#fff;border:1px solid #c8e6f9;box-shadow:0 18px 52px rgba(35,142,226,.16);border-radius:26px;padding:30px}.login-lang{position:absolute;right:18px;top:18px;display:flex;gap:6px}.brand{font-size:30px;font-weight:900;color:#0f5894;letter-spacing:1px}.login-card h1{margin:8px 0;color:#123e5f}.login-card p{color:var(--muted)}.login-card input,.login-card select{width:100%;padding:13px;border:1px solid #b8dcf4;border-radius:14px;margin:6px 0 14px;background:#fff;color:var(--text);outline:none}.login-label{font-weight:800;color:#315b77}.login-card button#btnLogin{width:100%;padding:13px;border-radius:14px;background:linear-gradient(135deg,#5ab8f1,#238ee2);color:#fff;font-weight:900}.msg{margin-top:14px;color:#d4212b;min-height:20px}
@media(max-width:980px){.cards{grid-template-columns:repeat(2,1fr)}.chart-grid{grid-template-columns:1fr}.date-row{flex-wrap:wrap}.refresh-btn{margin-left:0}.panel{min-height:calc(100vh - 275px)}}
@media(max-width:700px){html,body{font-size:13px}.app-header{height:40px;padding:4px 8px}.datebar{top:40px}.store-title{font-size:15px;max-width:52vw}.store-sub{display:none}.lang-btn,.icon-btn{padding:5px 7px}.date-row input{width:110px;padding:5px}.quick-dates button{padding:5px 9px}.app-main{padding:7px}.cards{gap:7px}.card{padding:9px;border-radius:14px}.card strong{font-size:18px}.panel{padding:9px;border-radius:15px}.panel h2{font-size:16px}.bar-row{grid-template-columns:70px 1fr 54px;gap:5px}.summary-line{grid-template-columns:1fr 1fr}.bottom-nav{height:61px}.modal-card{width:98vw;max-height:92vh;padding:10px}table,thead,tbody,tr,td{display:block;width:100%}thead{display:none}table{border:0;background:transparent;box-shadow:none}tr{background:#fff;border:1px solid #d9edf9;border-radius:14px;margin-bottom:8px;overflow:hidden;box-shadow:0 5px 14px rgba(35,142,226,.07)}td{display:grid;grid-template-columns:40% 60%;gap:8px;border-bottom:1px solid #eaf5fc;padding:7px 8px;text-align:left!important}td:before{content:attr(data-label);font-weight:900;color:#4f7590}.right{text-align:left}.prod-img{width:36px;height:36px}.prod-cell{align-items:flex-start}.chart-card{min-height:160px}.pie-wrap{flex-direction:column;gap:8px}.pie{width:112px;height:112px}.tax-cards{grid-template-columns:repeat(2,1fr)}}
@media print{.app-header,.datebar,.bottom-nav,.panel-actions,.sheet{display:none!important}.app-body{padding-bottom:0;background:#fff}.app-main{padding:0}.panel,.card{box-shadow:none}.panel{border:0}.cards{grid-template-columns:repeat(4,1fr)}table,thead,tbody,tr,td,th{display:revert}.modal{position:static;background:transparent}.modal.hidden{display:none!important}}
/* v1.5 fixes */
.datebar{text-align:center}.date-row{justify-content:center}.date-row label{justify-content:center}.refresh-btn{margin-left:0}.quick-dates{justify-content:center}.panel-actions{flex-shrink:0}.inline-search{display:flex;gap:7px;align-items:center;justify-content:center;margin:0 0 10px}.inline-search input{width:min(520px,60vw);border:1px solid #b8dcf4;border-radius:12px;padding:10px 12px;background:#fff;color:var(--text);outline:none}.inline-search button{background:linear-gradient(135deg,#5ab8f1,#238ee2);color:#fff;border-radius:12px;padding:10px 12px;font-weight:900}.inline-search button+button{background:#eaf7ff;color:#0b82ce;border:1px solid #c8e6f9}.receipt{max-width:720px;margin:0 auto;background:#fff;color:#1b3348}.receipt-top{text-align:center;border-bottom:1px dashed #9ecde9;padding-bottom:8px;margin-bottom:8px}.receipt-top h3{margin:0;color:#0f5894}.receipt-top p{margin:3px 0;color:#5f7e95}.receipt-item{padding:8px 0;border-bottom:1px dashed #d1e8f6}.receipt-name{font-weight:900;color:#16344f;line-height:1.28}.receipt-name small{display:block;font-weight:500;color:#6a8ba4;margin-top:3px}.receipt-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;color:#45697f;font-size:12px}.receipt-meta span,.receipt-meta strong{background:#f3faff;border:1px solid #d7edf9;border-radius:8px;padding:3px 6px}.receipt-meta strong{margin-left:auto;color:#0f5894}.receipt-total{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:10px 0}.receipt-total>div{background:#f2faff;border:1px solid #d3ebfa;border-radius:12px;padding:8px;text-align:center}.receipt-total span{display:block;color:#6a8ba4;font-size:12px}.receipt-total strong{display:block;color:#0f5894;margin-top:3px}
@media(max-width:700px){.date-row{gap:5px}.date-row label span{display:none}.date-row input{width:112px}.quick-dates{gap:4px}.inline-search{justify-content:stretch}.inline-search input{width:100%;flex:1}.inline-search button{padding:9px 10px}.receipt-total{grid-template-columns:repeat(2,1fr)}.receipt-meta strong{margin-left:0}.receipt-meta span,.receipt-meta strong{font-size:11px}td{grid-template-columns:36% 64%}}
/* v1.6 list/pagination/readability fixes */
.panel h2,.panel h3,.chart-card h3{border-bottom:2px solid #9bd7f6;padding-bottom:6px;margin-bottom:10px}
.table-wrap{overflow:hidden!important}
table{table-layout:fixed!important;width:100%!important}
th,td{white-space:normal!important;word-break:break-word!important;overflow-wrap:anywhere!important;line-height:1.25}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;margin:10px 0 2px;color:#155f95;font-weight:900}.pager button{width:38px;height:30px;border-radius:10px;background:#e8f6ff;border:1px solid #bfe2f7;color:#0b82ce;font-size:18px;font-weight:900}.pager span{min-width:74px;text-align:center}.receipt-meta span,.receipt-meta strong{background:transparent;border:0;padding:2px 3px}.receipt-meta{border-top:1px dotted #d1e8f6;padding-top:3px}.prod-img[style*="display: none"]+.prod-name{margin-left:0}
@media(max-width:700px){
  table,thead,tbody,tr,td,th{display:revert!important;width:auto!important}
  thead{display:table-header-group!important}
  tr{display:table-row!important;background:transparent!important;border:0!important;border-radius:0!important;margin:0!important;box-shadow:none!important;overflow:visible!important}
  td,th{display:table-cell!important;padding:6px 5px!important;font-size:12px!important;text-align:left!important}
  td:before{content:none!important}
  .right{text-align:right!important}
  .table-wrap{border-radius:12px;overflow:hidden!important}
  table{font-size:12px!important}
  .receipt-meta{gap:5px;font-size:11px}
}
/* v1.7 list full width / sensitive detail / inventory filters / client compact */
.content-wrap,.panel,.table-wrap,.table-wrap table{width:100%!important;max-width:100%!important;box-sizing:border-box}
.table-wrap{display:block!important;margin-left:0;margin-right:0}
.table-wrap table{min-width:0!important}
.inline-search select{border:1px solid #b8dcf4;border-radius:12px;padding:10px 12px;background:#fff;color:var(--text);outline:none;min-width:135px}
.inventory-filter{width:100%;justify-content:center;flex-wrap:wrap}
.inventory-filter input{flex:1;min-width:220px;max-width:480px}
.detail-list{display:grid;grid-template-columns:1fr;gap:6px;margin-bottom:12px}.detail-list>div{display:grid;grid-template-columns:128px 1fr;gap:8px;background:#f6fbff;border:1px solid #d8edf9;border-radius:10px;padding:8px}.detail-list b{color:#145b91}.detail-list span{color:#243f55;word-break:break-word}.json-box{background:#082033;color:#dff6ff;border-radius:12px;padding:12px;white-space:pre-wrap;word-break:break-word;max-height:42vh;overflow:auto;font-size:12px;line-height:1.45}.client-cell{display:flex;flex-direction:column;gap:3px;min-width:0}.client-cell strong{color:#153c5a}.client-cell a{color:#0b82ce;text-decoration:none;font-weight:800}.email-copy{width:32px;height:28px;border-radius:9px;background:#eaf7ff;border:1px solid #bfe2f7;color:#0b82ce;font-weight:900;margin-left:6px}.client-cell+.email-copy{vertical-align:middle}
@media(max-width:700px){.table-wrap table{width:100%!important}.inline-search{flex-wrap:wrap}.inline-search select{flex:1;min-width:125px;padding:9px 8px}.inventory-filter input{min-width:100%;max-width:100%}.detail-list>div{grid-template-columns:92px 1fr}th,td{font-size:11.5px!important;padding:6px 4px!important}}
/* v1.8 auto columns / sensitive categories / purchase / filters */
table{table-layout:auto!important;width:100%!important}
th,td{width:auto!important}
.table-wrap{width:100%!important;overflow:hidden!important}
.quick-buttons{display:flex;gap:7px;flex-wrap:wrap;justify-content:center;margin:0 0 10px}
.quick-buttons button{border:1px solid #c3e2f7;background:#fff;color:#1979b7;border-radius:999px;padding:7px 11px;font-weight:900;font-size:12px}
.quick-buttons button.active{background:#dff2ff;border-color:#7cc8f3;color:#075f99}
.quick-buttons small{font-weight:800;color:#6090ad;margin-left:3px}
.mini-link{background:#eaf7ff;border:1px solid #bfe2f7;color:#0b82ce;border-radius:9px;padding:5px 9px;font-weight:900}
.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}
.detail-grid>div,.json-grid>div{display:grid;grid-template-columns:120px 1fr;gap:8px;background:#f6fbff;border:1px solid #d8edf9;border-radius:10px;padding:8px}
.detail-grid b,.json-grid b{color:#145b91}.detail-grid span,.json-grid span{color:#243f55;word-break:break-word}.json-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.email-copy.wide{min-width:42px;margin-left:0}
@media(max-width:700px){table{table-layout:auto!important}.detail-grid,.json-grid{grid-template-columns:1fr}.detail-grid>div,.json-grid>div{grid-template-columns:92px 1fr}.inventory-filter select{min-width:108px!important}}
/* v2.1 polish: light blue, compact list, safe modal, receipt purchase */
body{background:linear-gradient(180deg,#edf9ff 0,#f8fdff 38%,#ffffff 100%)}
.app-header{box-shadow:0 6px 22px rgba(35,142,226,.08)}
.store-title{letter-spacing:.2px}.datebar{box-shadow:0 8px 20px rgba(35,142,226,.07)}
.panel{border-color:#bfe4f8;background:rgba(255,255,255,.97)}
.panel-title{padding:2px 2px 8px;border-bottom:1px solid #d7edf9}.panel h2{border-bottom:0;padding-bottom:0;margin-bottom:0}
.table-wrap table{border-color:#cfeafa}.table-wrap tr:hover td{background:#f4fbff}th{background:linear-gradient(180deg,#e3f5ff,#f5fbff);color:#135d91}td{background-clip:padding-box}
.stack-cell{display:flex;flex-direction:column;gap:2px;min-width:0}.stack-cell strong{font-weight:900;color:#16344f}.stack-cell small{font-size:11px;color:#6a8ba4;line-height:1.18}
.modal{inset:0 0 68px 0!important;align-items:center!important;padding:10px!important;z-index:45!important}.modal-card{max-height:calc(100vh - 98px)!important;overflow:hidden!important;display:flex;flex-direction:column}.modal-head{flex:0 0 auto;border-bottom:1px solid #d8edf9;padding-bottom:8px}#modalBody{flex:1 1 auto;overflow:auto;min-height:0;padding-right:2px;-webkit-overflow-scrolling:touch}.bottom-nav{z-index:60!important}
.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.detail-grid>div.full{grid-column:1 / -1}.json-grid.inner{margin-top:6px}.json-items{display:flex;flex-direction:column;gap:8px}.json-item{background:#f8fcff;border:1px solid #d8edf9;border-radius:12px;padding:8px}.json-item>strong{display:inline-block;margin-bottom:6px;color:#0f5894}.json-item .json-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.receipt{padding:4px}.receipt-top{background:linear-gradient(180deg,#f4fbff,#fff);border:1px solid #d8edf9;border-radius:14px;padding:10px;margin-bottom:8px}.receipt-item{padding:9px 4px}.receipt-name{font-size:14px}.receipt-total{grid-template-columns:repeat(2,minmax(0,1fr))}.receipt-total>div{background:linear-gradient(180deg,#f2faff,#fff)}
@media(max-width:700px){.store-title{max-width:66vw}.header-actions .icon-btn{display:none}.modal{inset:0 0 61px 0!important;padding:8px!important}.modal-card{width:98vw!important;max-height:calc(100vh - 82px)!important;border-radius:18px}.detail-grid,.json-grid,.json-item .json-grid{grid-template-columns:1fr!important}.detail-grid>div,.json-grid>div{grid-template-columns:86px 1fr!important}.panel-title{position:sticky;top:96px;background:rgba(255,255,255,.96);z-index:9;border-radius:10px}.stack-cell small{font-size:10.5px}th,td{font-size:11.2px!important;padding:6px 4px!important}.receipt-top h3{font-size:16px}.receipt-meta{gap:4px}.receipt-meta span,.receipt-meta strong{font-size:10.8px}}
.sheet{inset:0 0 68px 0!important;z-index:45!important}.sheet-card{max-height:calc(100vh - 95px)!important;overflow:auto!important;border-radius:22px!important}.more-grid button{box-shadow:0 8px 18px rgba(35,142,226,.10)}
@media(max-width:700px){.sheet{inset:0 0 61px 0!important}.sheet-card{max-height:calc(100vh - 82px)!important}}
/* v2.2 modal/sensitive/supplier fixes */
.modal{align-items:flex-start!important;justify-content:center!important;padding:8px 10px!important;inset:0 0 70px 0!important;overflow:hidden!important}
.modal-card{width:min(760px,96vw)!important;max-height:calc(100dvh - 92px)!important;margin-top:4px!important;border-radius:18px!important;box-shadow:0 18px 42px rgba(23,111,174,.20)!important}
.modal-head{position:sticky;top:0;background:rgba(255,255,255,.98);z-index:5;padding:8px 10px!important;margin:0!important}
.modal-head h2{font-size:16px!important;line-height:1.2;margin:0!important;max-width:calc(100% - 42px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.modal-head button{width:34px!important;height:34px!important;border-radius:12px!important;background:#eaf7ff!important;color:#0b82ce!important;font-size:22px!important;line-height:1!important}
#modalBody{padding:8px 10px 12px!important;overflow:auto!important;max-height:calc(100dvh - 148px)!important}
.sensitive-modal .modal-card{width:min(680px,96vw)!important;max-height:calc(100dvh - 96px)!important}
.sensitive-modal #modalBody{max-height:calc(100dvh - 152px)!important}
.sensitive-modal .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
.sensitive-modal .detail-grid>div{padding:6px 8px!important;border-radius:9px!important;grid-template-columns:92px 1fr!important}
.sensitive-modal .detail-grid b,.sensitive-modal .json-grid b{font-size:12px!important}
.sensitive-modal .detail-grid span,.sensitive-modal .json-grid span{font-size:12px!important}
.sensitive-modal h3{font-size:14px;margin:8px 0 6px;border-bottom:1px solid #cae9fb;padding-bottom:4px}
.json-items{gap:6px!important}.json-receipt-item{background:#fff;border:1px solid #d7edf9;border-radius:12px;padding:7px 8px;margin-bottom:6px}.json-receipt-item .receipt-name{font-size:13px}.json-receipt-item .receipt-meta{font-size:11px;gap:5px}.json-receipt-item .json-grid.inner{margin-top:5px;grid-template-columns:repeat(2,minmax(0,1fr))}.json-receipt-item .json-grid.inner>div{padding:5px 6px}
.link-btn{background:transparent!important;border:0!important;padding:0!important;color:#0b82ce!important;font-weight:900!important;text-decoration:underline!important;cursor:pointer!important;text-align:left!important}.supplier-products-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.supplier-products-title button{border:1px solid #bfe2f7;background:#eaf7ff;color:#0b82ce;border-radius:10px;padding:7px 10px;font-weight:900}
@media(max-width:700px){.modal{inset:0 0 61px 0!important;padding:6px!important}.modal-card{width:96vw!important;max-height:calc(100dvh - 76px)!important;margin-top:2px!important}.sensitive-modal .modal-card{width:96vw!important;max-height:calc(100dvh - 78px)!important}#modalBody,.sensitive-modal #modalBody{max-height:calc(100dvh - 132px)!important;padding:7px 8px 10px!important}.sensitive-modal .detail-grid{grid-template-columns:1fr!important}.sensitive-modal .detail-grid>div{grid-template-columns:78px 1fr!important}.json-receipt-item .json-grid.inner{grid-template-columns:1fr!important}.json-receipt-item .receipt-meta span,.json-receipt-item .receipt-meta strong{font-size:10.5px!important;padding:1px 2px}.modal-head h2{font-size:15px!important}}

/* v2.3 注册页面 */
.register-body{background:linear-gradient(145deg,#eaf7ff,#f8fcff 48%,#dff2ff);}
.register-card{max-width:460px;}
.register-logo{width:54px;height:54px;border-radius:16px;box-shadow:0 10px 30px rgba(31,142,210,.22);margin:2px auto 10px;display:block;}
.reg-status-box{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0;padding:12px;border:1px solid rgba(55,148,220,.22);border-radius:16px;background:rgba(255,255,255,.72);}
.reg-status-box div{display:flex;flex-direction:column;gap:4px;min-width:0;}
.reg-status-box span{font-size:12px;color:#6b7d90;}
.reg-status-box strong{font-size:13px;color:#173b5c;word-break:break-word;}
#deviceId{width:100%;box-sizing:border-box;border:1px solid rgba(55,148,220,.25);border-radius:14px;padding:12px;background:#fff;color:#173b5c;font-weight:700;resize:none;outline:none;}
.reg-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px;}
@media(max-width:520px){.register-card{max-width:calc(100vw - 24px);padding:18px}.reg-status-box{grid-template-columns:1fr}.reg-actions{grid-template-columns:1fr}}

.filterbar{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap;margin:0 0 10px 0;padding:8px;background:#f3faff;border:1px solid #cfe7fb;border-radius:14px}.filterbar label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:12px;font-weight:900}.filterbar select{min-width:160px;border:1px solid #b8dcf4;border-radius:10px;padding:6px;background:#fff;color:var(--text);outline:none}.filterbar select[multiple]{min-height:88px;min-width:220px}.sensitive-filter{margin-top:0}

/* v2.4 红色主题：沿用旧版 HIPOS 报表红色视觉 */
:root{
  --bg:#f5f5f5;
  --panel:#ffffff;
  --panel2:#fff7f7;
  --line:#efcaca;
  --text:#222222;
  --muted:#777777;
  --blue:#d61f1f;
  --blue2:#ef4438;
  --blue3:#fff0f0;
  --danger:#c91414;
  --shadow:0 8px 24px rgba(180,24,24,.10);
}
html,body{color:#222;background:#f5f5f5}
.app-header{background:#cf1e1e;border-bottom-color:#b91515;box-shadow:0 4px 14px rgba(120,0,0,.18)}
.store-title,.store-sub{color:#fff}
.lang-btn,.icon-btn,.small-btn{border-color:#fff;background:#fff;color:#c91d1d;box-shadow:none}
.datebar{background:#fff;border-bottom-color:#e5bebe;box-shadow:0 5px 14px rgba(150,20,20,.08)}
.date-row label{color:#555}.date-row input{border-color:#dfb7b7;color:#222}
.refresh-btn,.inline-search button,.login-card button#btnLogin{background:#df2d24;box-shadow:0 5px 14px rgba(190,25,25,.20)}
.quick-dates button{border-color:#e4baba;color:#b91c1c;background:#fff}
.quick-dates button:active{background:#fff0f0}
.quick-dates button.active{background:#e53228;color:#fff;border-color:#d62020;box-shadow:none}
.card{background:#fff;border-color:#efcece;box-shadow:var(--shadow)}
.card:before{background:radial-gradient(circle,rgba(218,31,31,.13),rgba(218,31,31,0) 68%)}
.card strong{color:#c91f1f}
.panel{background:#fff;border-color:#efcece;box-shadow:var(--shadow)}
.panel h2,.panel h3,.chart-card h3,.summary-line strong,.bar-value,.modal-head h2{color:#b91c1c}
table{border-color:#eccaca;box-shadow:0 5px 16px rgba(170,25,25,.07)}
th{background:#e53228;color:#fff}
td{color:#222;border-bottom-color:#f2dada}tbody tr:nth-child(even){background:#fffafa}
.link,.link-btn,.client-cell a{color:#c91f1f!important}
.chart-card{background:#fff;border-color:#edcccc;box-shadow:0 6px 18px rgba(170,25,25,.08)}
.bar-track{background:#f9dddd;border-color:#ecc0c0}.bar-fill{background:linear-gradient(90deg,#f06a61,#d61f1f);box-shadow:none}
.vbar-wrap,.step-chart{border-color:#eccaca}.vbar-fill,.step{background:linear-gradient(180deg,#ef756c,#d61f1f)}
.pie{border-color:#edcccc;box-shadow:inset 0 0 0 17px #fff,0 8px 20px rgba(170,25,25,.12)}
.summary-line>div{background:#fff5f5;border-color:#efd0d0}
.prod-img{border-color:#ebcaca;background:#fff5f5}
.bottom-nav{background:#fff;border-top-color:#e4bcbc;box-shadow:0 -8px 20px rgba(160,20,20,.10)}
.nav-item{color:#777}.nav-item.active{color:#fff;background:#df2d24}
.sheet,.modal{background:rgba(80,0,0,.22)}
.sheet-card,.modal-card{border-color:#e9c1c1;box-shadow:0 -16px 42px rgba(120,10,10,.18)}
.sheet-head{color:#b91c1c}.sheet-head button,.modal-head button{background:#fff0f0!important;color:#c91f1f!important}
.more-grid button{background:#fff7f7;border-color:#ebcaca;color:#b91c1c;box-shadow:none}
.more-grid button.active{background:#e53228;color:#fff;border-color:#d51e1e}
.login-body,.register-body{background:linear-gradient(180deg,#fff4f4,#ffffff)}
.login-card{border-color:#ebcaca;box-shadow:0 16px 44px rgba(170,25,25,.13)}
.brand,.login-card h1{color:#b91c1c}.login-card input,.login-card select{border-color:#dfb7b7}.login-label{color:#5b3535}
.filterbar{background:#fff7f7;border-color:#eccaca}.filterbar select,.inline-search input{border-color:#dfb7b7}
.pager{color:#b91c1c}.pager button,.mini-link,.email-copy,.supplier-products-title button{background:#fff0f0;border-color:#e7bcbc;color:#c91f1f}
.receipt-top h3,.receipt-meta strong,.receipt-total strong{color:#b91c1c}.receipt-total>div,.receipt-meta span,.receipt-meta strong{background:#fff7f7;border-color:#eccaca}
.detail-list>div{background:#fff8f8;border-color:#edcccc}.detail-list b{color:#b91c1c}
@media(max-width:700px){tr{border-color:#eccaca;box-shadow:0 4px 12px rgba(170,25,25,.06)}td{border-bottom-color:#f2dddd}td:before{color:#9f3333}}


/* v2.4.1 红色主题修正 */
.panel-title{border-bottom-color:#df2d24!important}
.panel h3{border-bottom-color:#df2d24!important}
html.app-mode .app-header{display:none!important}
html.app-mode .datebar{top:0!important}
@media(max-width:700px){
  html.app-mode .panel-title{top:56px!important}
}

/* 老版报表日期导航：五个周期按钮置顶，日期两侧前后箭头 */
.report-periods{margin:0 -8px 7px;display:grid;grid-template-columns:repeat(5,1fr);gap:4px;overflow:visible;flex-wrap:nowrap}
.report-periods button{border:0;border-radius:0;background:#f0f0f0;color:#171717;padding:9px 4px;font-size:14px;font-weight:800;box-shadow:none}
.report-periods button.active{background:#e53228;color:#fff;border:0;box-shadow:none}
.period-date-row{justify-content:center;flex-wrap:nowrap}
.period-date-row label{margin:0}
.period-date-row .date-separator{font-weight:900;color:#222;padding:0 2px}
.period-arrow{width:36px;height:34px;flex:0 0 36px;border:2px solid #222;border-radius:7px;background:#fff;color:#111;font-size:28px;font-weight:900;line-height:25px;padding:0;display:flex;align-items:center;justify-content:center}
.period-arrow:active{background:#f3f3f3}
@media(max-width:700px){
  .report-periods{margin:-5px -8px 7px;gap:3px}
  .report-periods button{padding:9px 2px;font-size:14px}
  .period-date-row{gap:4px}
  .period-arrow{width:32px;height:32px;flex-basis:32px;font-size:25px}
  .period-date-row input{width:118px}
  .period-date-row .refresh-btn{padding:7px 8px}
}

/* v4: report period buttons use rounded lower corners */
.report-periods button{border-radius:0 0 10px 10px!important;}

/* v5: 日期快捷键默认日报高亮，并确保按钮可点击 */
.quick-dates.report-periods button {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  border-radius: 0 0 10px 10px;
}
.quick-dates.report-periods button.active {
  background: #e52b20 !important;
  color: #fff !important;
}


/* v6: 手机/WebView 点击修复 */
.hidden{display:none!important;pointer-events:none!important}
.report-periods,.period-date-row,.bottom-nav{pointer-events:auto!important}
.report-periods button,.period-arrow,.refresh-btn,.bottom-nav .nav-item{pointer-events:auto!important;touch-action:manipulation!important;-webkit-user-select:none;user-select:none}
.datebar{z-index:40!important}
.bottom-nav{z-index:70!important}

/* v8: 强制保证顶部日期区及更多菜单处于可点击层 */
.datebar{position:sticky!important;z-index:100!important;pointer-events:auto!important}
.report-periods,.report-periods button,.period-date-row,.period-date-row button,.period-date-row input{pointer-events:auto!important}
.sheet{z-index:120!important;pointer-events:auto!important}
.sheet-card,.more-grid,.more-grid button{position:relative;z-index:121;pointer-events:auto!important;touch-action:manipulation!important}


/* v10: lower the period shortcuts slightly; native date confirmation refreshes automatically */
.report-periods{margin-top:6px!important;}
.period-date-row{padding-bottom:3px;}
@media(max-width:700px){.report-periods{margin-top:6px!important;}}


/* v11: date bar flush to page top, shortcut buttons at zero page margin, manual refresh restored */
.datebar{padding-top:0!important;}
.report-periods{margin-top:0!important;margin-bottom:5px!important;}
.period-date-row{padding-bottom:3px!important;}
.date-confirm-btn{height:34px;min-width:48px;margin:0!important;padding:0 10px!important;border-radius:7px!important;background:#e53228!important;color:#fff!important;border:0!important;box-shadow:none!important;font-weight:900!important;}
.date-confirm-btn:active{background:#c8231a!important;}
@media(max-width:700px){
  .datebar{padding-top:0!important;}
  .report-periods{margin-top:0!important;}
  .date-confirm-btn{height:32px;min-width:44px;padding:0 7px!important;font-size:12px;}
  .period-date-row input{width:106px!important;}
}

/* v18 manual language selector */
.language-section{margin-top:12px;padding-top:12px;border-top:1px solid #ebcaca}
.language-title{font-weight:900;color:#b91c1c;margin:0 0 8px 2px}
.language-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.language-grid button{background:#fff7f7;border:1px solid #ebcaca;color:#b91c1c;border-radius:14px;padding:11px 8px;font-weight:900;touch-action:manipulation}
.language-grid button.active{background:#e53228;color:#fff;border-color:#d51e1e}

/* v2.4.2 弹窗高度按实际顶部 banner 与底部导航动态计算 */
:root{--overlay-top:42px;--overlay-bottom:68px}
.modal{
  top:var(--overlay-top)!important;
  right:0!important;
  bottom:var(--overlay-bottom)!important;
  left:0!important;
  padding:6px 10px!important;
  box-sizing:border-box!important;
}
.modal-card,.sensitive-modal .modal-card{
  max-height:calc(100dvh - var(--overlay-top) - var(--overlay-bottom) - 12px)!important;
  margin-top:0!important;
}
#modalBody,.sensitive-modal #modalBody{
  max-height:none!important;
  min-height:0!important;
  flex:1 1 auto!important;
  overflow:auto!important;
}
@media(max-width:700px){
  .modal{padding:5px 6px!important}
  .modal-card,.sensitive-modal .modal-card{max-height:calc(100dvh - var(--overlay-top) - var(--overlay-bottom) - 10px)!important}
}

/* v2.4.3 所有明细弹窗统一为整页顶层显示 */
.modal,
.modal.sensitive-modal,
.modal.receipt-modal,
.modal.image-modal{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  min-height:100vh!important;
  padding:0!important;
  margin:0!important;
  display:flex!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  overflow:hidden!important;
  background:#fff!important;
  backdrop-filter:none!important;
  z-index:99999!important;
}
.modal.hidden{display:none!important}
.modal-card,
.sensitive-modal .modal-card,
.receipt-modal .modal-card,
.image-modal .modal-card{
  position:relative!important;
  width:100vw!important;
  max-width:none!important;
  height:100dvh!important;
  min-height:100vh!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  background:#fff!important;
}
.modal-head{
  position:relative!important;
  top:auto!important;
  flex:0 0 auto!important;
  min-height:52px!important;
  margin:0!important;
  padding:8px 10px 8px 14px!important;
  border-bottom:1px solid #e9c1c1!important;
  background:#fff!important;
  z-index:100000!important;
  box-sizing:border-box!important;
}
.modal-head h2{
  font-size:17px!important;
  line-height:34px!important;
  max-width:calc(100% - 50px)!important;
}
.modal-head button{
  flex:0 0 38px!important;
  width:38px!important;
  height:38px!important;
  border-radius:12px!important;
  font-size:24px!important;
  line-height:1!important;
  z-index:100001!important;
}
#modalBody,
.sensitive-modal #modalBody,
.receipt-modal #modalBody,
.image-modal #modalBody{
  flex:1 1 auto!important;
  width:100%!important;
  min-height:0!important;
  max-height:none!important;
  padding:10px 12px calc(14px + env(safe-area-inset-bottom))!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  box-sizing:border-box!important;
  -webkit-overflow-scrolling:touch!important;
}
body.modal-open{overflow:hidden!important}
@media(max-width:700px){
  .modal-head{min-height:48px!important;padding:6px 8px 6px 12px!important}
  .modal-head h2{font-size:15px!important;line-height:36px!important}
  .modal-head button{width:36px!important;height:36px!important;flex-basis:36px!important}
  #modalBody,.sensitive-modal #modalBody,.receipt-modal #modalBody,.image-modal #modalBody{padding:8px 9px calc(12px + env(safe-area-inset-bottom))!important}
}
