.top-actions{display:flex;align-items:center;gap:12px}
[hidden]{display:none!important}
.user-chip{padding-left:12px;border-left:1px solid #ffffff24;color:#dce9ee;font-size:12px}
.top-link{border:0;background:transparent;color:#bcd2dc;cursor:pointer;padding:4px;font:inherit;font-size:12px}
.top-link:hover{color:#fff}
.settings-tabs{overflow:auto}
.settings-tab{flex:1 0 120px!important;white-space:nowrap}
.button.danger{border-color:#c9685c;background:#fff3f1;color:#ad443a}
.button.danger:hover{background:#f9e3df}
.dialog-form,#warehouse-form{padding:22px}
.dialog-form>label{margin-top:13px}
.dialog-actions.left{justify-content:flex-start}
.status-switch{display:inline-flex;align-items:center;gap:7px;border:0;background:none;color:inherit;cursor:pointer;font:inherit;padding:0}
.switch-track{width:34px;height:19px;border-radius:20px;background:#aabac1;padding:2px;transition:.2s}
.switch-track::after{content:"";display:block;width:15px;height:15px;border-radius:50%;background:#fff;transition:.2s}
.status-switch.on .switch-track{background:var(--primary)}
.status-switch.on .switch-track::after{transform:translateX(15px)}
.system-tag{display:inline-block;border-radius:999px;background:#e3ecef;color:#526d79;padding:2px 8px;font-size:11px;margin-left:6px}
.maintenance-grid{display:grid;gap:16px}
.full-backup-card{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-bottom:16px;border-color:#b9d6d3;background:linear-gradient(120deg,#f4faf9,#edf5f6)}
.full-backup-copy{max-width:850px}.full-backup-copy h2{margin:7px 0 5px}.full-backup-copy p{margin:0 0 4px;color:#365461}.full-backup-copy small{color:var(--muted)}
.backup-label{display:inline-block;padding:3px 9px;border-radius:999px;background:#d8ece9;color:#276e69;font-size:12px;font-weight:600}
.backup-status{margin-top:11px;color:#426571;font-size:13px;font-weight:500}
.full-backup-actions{display:grid;gap:9px;min-width:190px}.full-backup-actions .button{text-decoration:none;white-space:nowrap}
.maintenance-types{display:flex;gap:8px;margin-bottom:14px}
.maintenance-types button{border:1px solid var(--line);background:#f5f9fa;color:#4b6572;border-radius:7px;padding:9px 18px;cursor:pointer;font:inherit}
.maintenance-types button.active{background:var(--primary);border-color:var(--primary);color:#fff}
.maintenance-toolbar{display:flex;align-items:end;gap:12px;margin-bottom:14px}
.maintenance-toolbar label{width:min(360px,100%)}
.maintenance-toolbar span{margin-left:auto;color:var(--muted);padding-bottom:8px}
.maintenance-toolbar button{margin-bottom:1px}
.check-cell{width:48px;text-align:center}
.check-cell input{width:16px;min-height:16px;accent-color:var(--primary)}
.db-table-cards{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:8px;margin:0 0 16px}
.db-table-card{padding:10px;border:1px solid var(--line);border-radius:7px;background:#f7fafb;cursor:pointer}
.db-table-card strong,.db-table-card small{display:block}
.db-table-card small{color:var(--muted);margin-top:3px}
.warning{background:#fff3dd;color:#795d2d;margin-top:14px}
.reset-zone{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:16px;border-color:#e6b7b0;background:#fff8f7}
.reset-zone h2{margin:7px 0 4px;color:#8e352d}
.reset-zone p{margin:0 0 4px}
.reset-zone small{color:var(--muted)}
.test-label{display:inline-block;padding:2px 8px;border-radius:999px;background:#f7ddd8;color:#9a4036;font-size:11px}
.movement-status{display:inline-block;padding:3px 8px;border-radius:999px;font-size:12px;background:#dcebea;color:#28726f}
.movement-status.voided{background:#eceff1;color:#77868e}
.movement-status.reversal{background:#e5e9eb;color:#66757d}
.movement-status-cell{min-width:210px;vertical-align:middle}
.movement-status-block{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.movement-void-details{display:grid;gap:4px;width:100%;font-size:12px;line-height:1.45}
.movement-void-details div{display:grid;grid-template-columns:58px minmax(0,1fr);gap:7px;align-items:start}
.movement-void-details span{color:#84939b;white-space:nowrap}
.movement-void-details strong{color:#536975;font-weight:500;overflow-wrap:anywhere}
.movement-voided td{color:#829098;background:#f5f7f8}
.movement-voided td:not(.row-actions){text-decoration-color:#aeb9be}
.movement-reversal td{color:#718088;background:#f4f6f7}
.image-cell{width:66px;text-align:center}
.product-image{width:46px;height:46px;display:inline-grid;place-items:center;flex:none;padding:0;border:1px solid #cbd9df;border-radius:8px;background:#edf2f4;color:#78909a;overflow:hidden;vertical-align:middle}
button.product-image{cursor:zoom-in}
.product-image img{display:block;width:100%;height:100%;object-fit:cover}
.product-image.placeholder span{font-size:20px;opacity:.7}
.product-image.tiny{width:32px;height:32px;border-radius:6px}
.product-image.tiny .placeholder span{font-size:15px}
.product-image.large{width:94px;height:94px;border-radius:10px}
.product-image.large.placeholder span{font-size:32px}
.product-image-editor{display:grid;grid-template-columns:94px 1fr;gap:16px;align-items:center;padding:14px;margin-bottom:16px;border:1px dashed #b9cbd3;border-radius:9px;background:#f5f9fa}
.product-image-editor strong{display:block;margin-bottom:3px}
.product-image-editor p{margin:0 0 9px;color:var(--muted);font-size:12px}
.image-upload-button{display:inline-flex}
.product-choice-preview{display:flex;align-items:center;gap:8px;min-height:32px;margin-top:3px;color:var(--muted);font-size:12px}
.product-table-cell{display:flex;align-items:center;gap:9px;min-width:160px}
.product-table-cell>span>small{display:block}
.stock-hint{display:flex;align-items:center;gap:9px}
.image-preview-dialog{width:min(900px,calc(100% - 30px));padding:18px;background:#132b37}
.image-preview-dialog .dialog-head{color:#fff;margin-bottom:12px}
.image-preview-dialog .close{color:#fff}
.image-preview-dialog img{display:block;max-width:100%;max-height:78vh;margin:auto;border-radius:8px;object-fit:contain}
.warehouse-label.tone-0{background:#2f7d78}
.warehouse-label.tone-1{background:#54788e}
.warehouse-label.tone-2{background:#8a7043}
.warehouse-label.tone-3{background:#6d658d}
.movement-controls{display:grid;grid-template-columns:160px 150px 150px minmax(250px,1fr) auto;align-items:end}
.movement-controls label,.movement-controls label:nth-child(2){min-width:0}
.movement-doc-cell{width:168px;white-space:nowrap}
.movement-date,.movement-document-no{display:block}
.movement-date{font-weight:600;color:#365461}
.movement-document-no{margin-top:3px;color:var(--muted);font-family:Consolas,"Microsoft YaHei",sans-serif}
.movement-type{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border-radius:7px;font-weight:600;white-space:nowrap}
.movement-type i{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#ffffffaa;font-style:normal;font-size:14px}
.movement-type.inbound{background:#d8ece5;color:#216e58}
.movement-type.transfer{background:#dce8f0;color:#355f78}
.movement-type.sale{background:#f4e0d9;color:#934f3c}
.movement-type.adjustment{background:#f2ead2;color:#7b6422}
.movement-type.voided{background:#e5e9eb;color:#66757d}
.movement-type.voided i{background:#f4f6f7;color:#66757d;font-family:"Segoe UI Symbol","Segoe UI Emoji",sans-serif}
.activity li{grid-template-columns:11px 32px 1fr auto}
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.dashboard-stats article{min-height:170px}
.dashboard-stat-detail{display:grid;gap:7px;margin-top:4px;color:#5c727e;font-size:13px;line-height:1.5}
.dashboard-breakdown{display:grid;gap:3px}
.dashboard-breakdown span{display:flex;align-items:center;justify-content:space-between;gap:8px}
.dashboard-breakdown b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;color:#637984}
.dashboard-breakdown em{flex:none;color:#385665;font-style:normal;font-weight:600;font-variant-numeric:tabular-nums}
.dashboard-stat-detail p{margin:2px 0 0;padding-top:6px;border-top:1px dashed #d3dfe4;color:#71858f}
.activity small,.activity time{font-size:13px}
.activity-handler{margin-top:2px;color:#476673!important}
.missing-price{display:inline-block;color:#8a979d;font-size:12px;white-space:nowrap}
.product-type{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600}
.product-type.self{background:#dcebe6;color:#276c59}
.product-type.purchased{background:#e3e8f1;color:#53647f}
.product-controls{display:flex;flex-wrap:wrap;align-items:end;gap:12px}.product-controls>label,.product-controls>label:nth-child(2){flex:0 1 180px;min-width:0}.product-controls>label:first-child{flex:1 1 280px}.product-controls>label input,.product-controls>label select{min-height:38px}.product-controls>#product-reset-search{flex:0 0 auto;min-height:38px;white-space:nowrap}
.inbound-entry{grid-template-columns:minmax(320px,2fr) minmax(180px,1fr)}
.inbound-entry>label{min-width:0}
.adjustment-entry{grid-template-columns:minmax(280px,2fr) minmax(150px,1fr) minmax(150px,1fr) minmax(190px,1.15fr);align-items:end}
.adjustment-difference{display:flex;flex-direction:column;justify-content:center;min-height:74px;padding:10px 14px;border-radius:8px;background:#edf2f3;color:#5e737b}
.adjustment-difference span,.adjustment-difference small{font-size:11px}
.adjustment-difference strong{font-size:19px;margin:3px 0}
.adjustment-difference.positive{background:#e1f0e8;color:#237056}
.adjustment-difference.negative{background:#f5e5e1;color:#9b493a}
.sale-entry-grid{grid-template-columns:1.1fr 1.8fr 1fr 1fr 1.15fr}
.retail-reference{display:flex;flex-direction:column;justify-content:center;min-height:74px;padding:10px 14px;border-radius:8px;background:#e8f1f2;color:#45626e}
.retail-reference span,.retail-reference small{font-size:11px}
.retail-reference strong{font-size:19px;color:#246d69;margin:3px 0}
.button:disabled{opacity:.5;cursor:not-allowed}
.module-tabs,.sub-tabs{display:inline-flex;width:max-content;gap:3px;padding:4px;border-radius:9px;margin-bottom:11px}
.module-tabs{background:#d8e4e9;border:1px solid #c4d5dc}
.module-tabs button,.sub-tabs button{border:0;background:transparent;padding:8px 20px;border-radius:6px;color:#496473;cursor:pointer;font:inherit;line-height:1.2}
.module-tabs button.active{background:#287f7c;color:#fff;box-shadow:0 2px 6px #205f5c2f;font-weight:600}
.sub-tabs{background:#f8fbfc;border:1px solid #cfdee3;padding:3px;margin-left:8px}
.sub-tabs button{padding:6px 16px;font-size:14px}
.sub-tabs button.active{background:#dcefed;color:#176b68;box-shadow:inset 0 -2px #4ca8a2;font-weight:600}
.cost-workspace{display:grid;grid-template-columns:minmax(420px,.9fr) minmax(480px,1.1fr);gap:16px;align-items:start}
.cost-product-list{padding-bottom:0}
.cost-product-list .table-wrap{max-height:560px;margin:12px -20px 0}
.cost-product-list table{min-width:100%;table-layout:auto}
.cost-product-list th:first-child,.cost-product-list td:first-child{width:58%}
.cost-product-row{cursor:pointer}
.cost-product-row:hover td{background:#f0f6f7}
.cost-product-row.selected td{background:#e2eff0}
.version-toolbar{display:flex;gap:14px;align-items:end;margin:10px 0 16px}
.version-toolbar label{min-width:240px}
.version-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}
.version-summary.other{grid-template-columns:minmax(220px,360px)}
.version-summary span{display:flex;flex-direction:column;gap:5px;padding:14px;border-radius:9px;background:#e7f0f1;color:#58717b}
.version-summary strong{font-size:21px;color:#246d69}
.version-meta{padding-bottom:12px;color:var(--muted);font-size:12px;border-bottom:1px solid var(--line)}
.cost-item-readonly{display:grid;gap:0;margin-top:6px}
.cost-item-readonly>div{display:flex;justify-content:space-between;align-items:center;padding:12px 4px;border-bottom:1px solid var(--line)}
.cost-item-readonly em,.commission-tag{display:inline-block;margin-left:7px;padding:2px 7px;border-radius:999px;background:#ece8f2;color:#6d5c82;font-size:10px;font-style:normal;vertical-align:middle}
.cost-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}
.cost-fields label{margin:0}
.cost-live-summary{display:flex;gap:12px;margin:15px 0}
.cost-live-summary span{flex:1;display:flex;flex-direction:column;gap:5px;padding:13px;border-radius:8px;background:#edf4f4;color:#58717b}
.cost-live-summary strong{font-size:18px;color:#246d69}
.wide-dialog{width:min(920px,calc(100% - 30px));padding:22px}
.inline-cost-item-form{display:grid;grid-template-columns:minmax(220px,1fr) 220px 100px auto;gap:12px;align-items:end;margin-bottom:16px}
.inline-cost-item-form label{margin:0}
.statistics-filter{display:grid;grid-template-columns:190px 190px auto auto;align-items:end}.statistics-filter label{min-width:0!important}
.statistics-tabs{display:inline-flex;gap:4px;padding:4px;margin-bottom:14px;border:1px solid #c7d7dd;border-radius:9px;background:#dfe9ed}
.statistics-tabs button{border:0;border-radius:6px;background:transparent;color:#496473;padding:8px 22px;cursor:pointer;font:inherit}
.statistics-tabs button.active{background:#287f7c;color:#fff;font-weight:600;box-shadow:0 2px 7px #234d5c25}
.statistics-panel{display:none}
.statistics-panel.active{display:block}
.statistics-summary{grid-template-columns:repeat(4,1fr)}
.statistics-summary article{min-height:235px}
.statistics-summary article:last-child{background:#e5f0ef;border-color:#c5dcda}
.statistics-summary .negative-number{color:#b14e3d}
.statistics-breakdown{display:grid;gap:5px;margin-top:7px;padding-top:9px;border-top:1px solid #d5e2e6;font-size:13px}
.statistics-breakdown span{display:flex;justify-content:space-between;align-items:center;gap:10px}
.statistics-breakdown b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#607985;font-weight:500}
.statistics-breakdown em{flex:none;color:#315361;font-style:normal;font-weight:600;font-variant-numeric:tabular-nums}
.statistics-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 0 16px}
.statistics-kpis article{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px;border:1px solid var(--line);border-radius:9px;background:#f5f9fa}
.statistics-kpis span{color:#647b87;font-size:13px}.statistics-kpis strong{color:#284b5a;font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.statistics-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.statistics-wide{grid-column:1/-1}
.chart-legend{display:flex;gap:14px;color:var(--muted);font-size:13px}
.chart-legend span::before{content:"";display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px}
.chart-legend .revenue::before{background:#527b96}
.chart-legend .gross::before{background:#42a099}
.chart-legend .net::before{background:#d29a55}
.trend-card{padding-bottom:12px}
.column-chart{height:230px;overflow-x:auto;overflow-y:hidden;padding:0 2px}
.column-chart svg{display:block;width:100%;height:220px}
.chart-grid-line{stroke:#dbe5e9;stroke-width:1}.chart-zero-line{stroke:#9db1bb;stroke-width:1.2}
.chart-axis-label,.chart-month-label{fill:#647b87;font:12px "Microsoft YaHei","PingFang SC",sans-serif}
.column-group{height:100%;min-width:64px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}
.column-bars{height:225px;display:flex;align-items:flex-end;justify-content:center;gap:4px}
.column-bars i{display:block;width:13px;min-height:0;border-radius:4px 4px 1px 1px;transition:.2s}
.column-bars i:hover,.daily-column i:hover{filter:brightness(.88)}
.column-bars .revenue{background:#527b96}.column-bars .gross{background:#42a099}.column-bars .net{background:#d29a55}
.column-bars .unavailable{height:3px;background:#cfd9dd}
.column-bars .negative,.daily-column .negative{background:#c9685c}
.column-group small,.daily-column small{color:var(--muted);font-size:12px;white-space:nowrap}
.donut-layout{min-height:255px;display:grid;grid-template-columns:170px 1fr;gap:22px;align-items:center}
.donut-chart{position:relative;width:165px;height:165px;border-radius:50%;background:#e8eef0;display:grid;place-items:center}
.donut-chart::after{content:"";position:absolute;width:98px;height:98px;border-radius:50%;background:var(--panel)}
.donut-chart>span{position:relative;z-index:1;width:88px;text-align:center;color:var(--muted);font-size:13px}
.donut-chart>span strong{display:block;color:var(--ink);font-size:14px}
.donut-legend{display:grid;gap:8px;max-height:230px;overflow:auto}
.donut-legend>div{display:grid;grid-template-columns:10px minmax(80px,1fr) 52px 88px;align-items:center;gap:8px;font-size:13px}
.donut-legend i{width:9px;height:9px;border-radius:50%}
.donut-legend strong,.donut-legend small{text-align:right;font-variant-numeric:tabular-nums}
.donut-legend small{color:var(--muted)}
.daily-bar-chart{height:225px;display:flex;align-items:flex-end;gap:7px;overflow-x:auto;padding:14px 8px 2px;border-bottom:1px solid var(--line)}
.daily-column{height:100%;min-width:28px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px}
.daily-column i{display:block;width:16px;background:#42a099;border-radius:4px 4px 1px 1px}
.positive-number{color:#23735c!important;font-weight:600}.negative-number{color:#b14e3d!important;font-weight:600}
.commission-number{color:#786544;font-weight:600}.statistics-table td small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.sql-result-wrap{margin-top:14px;max-height:360px}
.sql-result-wrap table{min-width:600px}
.sql-result-wrap td{max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.form-error{min-height:20px;color:#b5443b;margin:0}
.login-body{min-height:100vh;background:linear-gradient(135deg,#163b4d 0%,#24566b 52%,#e9f0f3 52%,#f5f8f9 100%);display:grid;place-items:center;padding:24px}
.login-shell{width:min(860px,100%);display:grid;grid-template-columns:1fr 380px;align-items:center;gap:70px}
.login-brand{color:#fff;display:flex;gap:18px;align-items:center}
.login-brand h1{font-size:30px;margin:0 0 8px}
.login-brand p{color:#bad0da;margin:0}
.brand-icon.large{width:58px;height:58px;font-size:30px}
.login-card{background:#fff;border-radius:14px;padding:34px;box-shadow:0 25px 80px #09233355;display:grid;gap:18px}
.login-card h2{font-size:23px;margin:5px 0}
.login-card p{margin:0}
.login-card small{text-align:center;color:var(--muted)}
.login-kicker{color:var(--primary);font-size:11px;letter-spacing:2px;font-weight:700}
@media(max-width:1250px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1050px){.cost-workspace{grid-template-columns:1fr}.sale-entry-grid,.adjustment-entry{grid-template-columns:1fr 1fr}.inline-cost-item-form{grid-template-columns:1fr 1fr}.statistics-summary{grid-template-columns:1fr 1fr}.statistics-kpis{grid-template-columns:1fr 1fr}}
@media(max-width:800px){.login-body{background:#e9f0f3}.login-shell{grid-template-columns:1fr;gap:25px}.login-brand{color:var(--ink);justify-content:center}.login-brand p{color:var(--muted)}.db-table-cards{grid-template-columns:repeat(2,1fr)}.maintenance-toolbar{align-items:stretch;flex-direction:column}.maintenance-toolbar span{margin-left:0}.maintenance-types{overflow:auto}.maintenance-types button{white-space:nowrap}.reset-zone,.full-backup-card{align-items:stretch;flex-direction:column}.full-backup-actions{width:100%}.movement-controls{grid-template-columns:1fr 1fr}.movement-controls label:last-of-type{grid-column:1/-1}.product-controls{grid-template-columns:1fr 1fr}.inbound-entry{grid-template-columns:1fr}.version-summary{grid-template-columns:1fr}.cost-fields{grid-template-columns:1fr}.statistics-filter{grid-template-columns:1fr 1fr}.statistics-grid{grid-template-columns:1fr}.statistics-wide{grid-column:auto}}
@media(max-width:520px){.dashboard-stats{grid-template-columns:1fr}.product-image-editor{grid-template-columns:1fr}.movement-controls,.product-controls,.sale-entry-grid,.adjustment-entry,.inline-cost-item-form,.statistics-filter,.statistics-summary,.statistics-kpis{grid-template-columns:1fr}.movement-controls label:last-of-type{grid-column:auto}.cost-live-summary{flex-direction:column}.donut-layout{grid-template-columns:1fr}.donut-chart{margin:auto}}
@media(max-width:600px){.user-chip{display:none}}
/* Product search occupies its own row on narrow screens. */
@media(max-width:800px){.product-controls>label:first-child{flex-basis:100%}.product-controls>label,.product-controls>label:nth-child(2){flex:1 1 160px}}
@media(max-width:600px){.product-controls>label,.product-controls>label:nth-child(2),.product-controls>label:first-child{flex:0 0 auto;width:100%}.product-controls>#product-reset-search{align-self:flex-end;width:auto}}
