:root{color-scheme:light;--bg:#f4f7fa;--panel:#fff;--text:#172938;--muted:#506372;--line:#d9e1e8;--accent:#166451;--soft:#e9f3ef;--warn:#865610;--error:#9f2833;font-family:Arial,sans-serif;font-size:16px;color:var(--text);background:var(--bg)}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:10px 14px;min-height:44px}button:hover{border-color:var(--accent)}button:disabled{opacity:.5;cursor:wait}.primary{background:var(--accent);border-color:var(--accent);color:white}input,select,textarea{width:100%;padding:11px;border:1px solid var(--line);border-radius:7px;background:var(--panel)}input[type=checkbox]{width:auto}input[type=number]{max-width:120px}label{display:flex;flex-direction:column;gap:7px;font-size:.9rem}label.check{flex-direction:row;align-items:center}header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:18px 28px;background:var(--panel);border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px;font-weight:bold}.logo{padding:11px 15px;background:var(--accent);color:white;border-radius:11px}small{display:block;font-size:.8rem;font-weight:normal;color:var(--muted);margin-top:5px}#session{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#shell{max-width:1440px;margin:auto;display:grid;grid-template-columns:210px minmax(0,1fr)}#shell.auth-shell{grid-template-columns:1fr}nav{display:flex;flex-direction:column;gap:5px;padding:22px 12px}nav button{text-align:left;border-color:transparent;background:transparent}nav button.selected{background:var(--soft);color:var(--accent)}main{padding:28px;min-width:0}.auth{max-width:470px;margin:28px auto}.stack{display:flex;flex-direction:column;gap:16px}.panel{background:var(--panel);padding:22px;border:1px solid var(--line);border-radius:12px;margin-bottom:16px}.heading,.row,.toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}.heading{margin-bottom:22px}.row{justify-content:flex-start}.toolbar{margin-bottom:18px}.grid,.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.full{grid-column:1/-1}.muted{color:var(--muted)}.warn{color:var(--warn)}h1{font-size:1.65rem;margin:0}h2{font-size:1.2rem;margin:0 0 12px}h3{font-size:1.05rem;margin:0}p{line-height:1.5;margin:10px 0}.notice{padding:14px 18px;background:var(--soft);border-radius:9px;margin-bottom:18px}.notice.error{background:#ffedf0;color:var(--error)}.badge{display:inline-block;background:var(--soft);padding:6px 9px;border-radius:6px;color:var(--accent);font-size:.9rem}.empty{padding:32px;text-align:center}.entry{width:100%;display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;padding:18px;background:var(--panel)}.entry span{min-width:0;overflow-wrap:anywhere}.product{display:flex;flex-direction:column;gap:14px}.product img{width:100%;height:150px;object-fit:contain;background:var(--bg);border-radius:8px}.product .category{background:var(--soft);padding:12px;border-radius:8px;color:var(--accent)}.catalog-list{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:0 16px}.catalog-item{display:grid;grid-template-columns:minmax(150px,1fr) 130px 95px 120px;gap:14px;padding:14px 0;align-items:center;border-bottom:1px solid var(--line)}.catalog-item:last-child{border:0}.quantity{max-width:100px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:.9rem}th,td{text-align:left;padding:13px 10px;border-bottom:1px solid var(--line);vertical-align:middle}td.number{text-align:right;font-variant-numeric:tabular-nums}th{color:var(--muted);font-weight:normal}.price-table input{min-width:95px}.address-row{display:grid;grid-template-columns:1fr auto;gap:10px;margin:12px 0}.summary{border-top:1px solid var(--line);padding-top:16px}.gap-top{margin-top:18px}footer{text-align:center;padding:20px;color:var(--muted);font-size:.8rem}[hidden]{display:none!important}:focus-visible{outline:3px solid #67b7f0;outline-offset:2px}@media(max-width:800px){#shell{grid-template-columns:1fr}nav{flex-direction:row;flex-wrap:wrap;padding:12px}main{padding:16px}header{padding:14px}.grid,.fields{grid-template-columns:1fr}.full{grid-column:auto}.catalog-item{grid-template-columns:1fr 90px 1fr}.catalog-name{grid-column:1/-1}.panel{padding:16px}.auth{margin:16px auto}}@media(prefers-color-scheme:dark){:root{color-scheme:dark;--bg:#151c24;--panel:#202a35;--text:#edf3f8;--muted:#b7c5d1;--line:#3d4b59;--accent:#1b765f;--soft:#253d36;--warn:#f1c478}.badge,.product .category,nav button.selected{color:#90dec4}.notice.error{background:#49252e;color:#ffbac5}}
.profile-contacts{border:1px solid var(--line);border-radius:14px;padding:.8rem 1rem;background:var(--panel)}
.client-organizations[hidden]{display:none}
.client-organization-row{border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0}
.client-organization-row label,.cart-organization{min-width:0}
.client-organization-row input,.client-organization-row select,.cart-organization select{max-width:100%;min-width:0}
.secondary{background:#e9eef7;border-color:#b9c8df;color:#294766}.order-detail-toolbar{justify-content:flex-start}.order-detail-toolbar .badge{margin-left:auto}.settings-section{padding:0;overflow:hidden}.settings-section>summary{cursor:pointer;padding:18px 22px;font-weight:700;color:var(--accent);list-style:none}.settings-section>summary::-webkit-details-marker{display:none}.settings-section>summary::after{content:'⌄';float:right;transition:transform .15s}.settings-section[open]>summary{border-bottom:1px solid var(--line)}.settings-section[open]>summary::after{transform:rotate(180deg)}.settings-section-body{padding:22px}.settings-section-body form{margin:0}@media(prefers-color-scheme:dark){.secondary{background:#263b58;border-color:#486987;color:#c8e0ff}}
.profile-contacts summary,.profile-password summary{cursor:pointer;color:var(--accent);font-weight:700}
.profile-password form{margin-bottom:0}
.view-switch{display:flex;gap:6px;align-items:center}
.icon-button{width:44px;padding:6px;font-size:1.45rem;line-height:1}
.icon-button.selected{color:var(--accent);background:var(--soft);border-color:var(--accent)}
.danger{color:var(--error);border-color:color-mix(in srgb,var(--error) 35%,var(--line));}
.news-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
.news-card{position:relative;border-left:4px solid var(--brand,#a6192e)}
.news-card.unread::after{content:'';position:absolute;right:16px;top:16px;width:9px;height:9px;border-radius:50%;background:#a6192e}
.news-card h2{margin:.45rem 0}.news-card p{line-height:1.5;white-space:normal}
.news-news{border-left-color:#6b6465}.news-promotion{background:linear-gradient(135deg,var(--panel,#fff),var(--soft,#f7e8eb))}
.import-dialog{width:min(520px,calc(100% - 32px));padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text);box-shadow:0 20px 60px #0004}.import-dialog::backdrop{background:#17293888;backdrop-filter:blur(2px)}.import-dialog h2{margin:0}.import-dialog .row button{flex:1}
.report-preview-dialog{width:min(1200px,calc(100% - 32px))}.report-preview-table-wrap{max-height:min(65vh,720px);overflow:auto;border:1px solid var(--line);border-radius:10px}.report-preview-table-wrap table{width:max-content;min-width:100%;border-collapse:collapse;font-size:.88rem}.report-preview-table-wrap td{padding:7px 10px;border:1px solid var(--line);white-space:pre-wrap;vertical-align:top}.report-preview-table-wrap tr:first-child td{font-weight:700;background:var(--soft)}
.order-client-link{padding:0;border:0;background:transparent;color:inherit;text-align:left}.order-client-link:hover{text-decoration:underline}.order-client-link.authorized-client{font-weight:700}
.report-preview-table-wrap td:nth-child(n+3){width:150px;max-width:150px;white-space:normal;overflow-wrap:anywhere}
.admin-orders-toolbar{justify-content:flex-start;align-items:flex-end}.admin-orders-toolbar::after{content:"";flex-basis:100%;height:0;order:0}.admin-orders-toolbar>button,.admin-orders-toolbar select,.admin-orders-toolbar input{height:44px}.admin-orders-toolbar>label{min-width:160px;order:1}.admin-orders-toolbar>label:has(#order-category){min-width:250px}.admin-orders-toolbar>label:has(#order-client){min-width:210px}.admin-orders-toolbar>[data-page="orders"]{order:-3}.admin-orders-toolbar>#order-import-start{order:-2}.admin-orders-toolbar>#order-report-start{order:-1}@media(max-width:800px){.admin-orders-toolbar::after{display:none}.admin-orders-toolbar>button,.admin-orders-toolbar>label{width:100%}.admin-orders-toolbar>label{min-width:0!important}}
.admin-orders-toolbar{gap:12px}.admin-orders-toolbar::after{display:none}.admin-orders-toolbar>.order-toolbar-break{flex-basis:100%;height:0}.admin-orders-toolbar>label{min-width:160px;order:initial}.admin-orders-toolbar>label:has(#order-category){min-width:250px}.admin-orders-toolbar>label:has(#order-client){min-width:210px}.admin-orders-toolbar>[data-page="orders"],.admin-orders-toolbar>#order-import-start,.admin-orders-toolbar>#order-report-start{order:initial}.admin-orders-toolbar>#order-delivery-clear{align-self:flex-end;width:44px;padding:6px;font-size:1.5rem;line-height:1}.admin-orders-toolbar>#order-filters-reset{align-self:flex-end}@media(max-width:800px){.admin-orders-toolbar>.order-toolbar-break{display:none}.admin-orders-toolbar>button,.admin-orders-toolbar>label{width:100%}.admin-orders-toolbar>label{min-width:0!important}.admin-orders-toolbar>#order-delivery-clear{width:100%}}
.admin-orders-toolbar{display:block}.admin-orders-toolbar>.order-toolbar-row{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:12px}.admin-orders-toolbar>.order-toolbar-row:last-child{margin-bottom:0}.admin-orders-toolbar>.order-toolbar-row>label{min-width:160px}.admin-orders-toolbar>.order-toolbar-row>label:has(#order-category){min-width:250px}.admin-orders-toolbar>.order-toolbar-row>label:has(#order-client){min-width:210px}.admin-orders-toolbar .order-toolbar-primary-filters #order-delivery-clear{width:44px;padding:6px;font-size:1.5rem;line-height:1}.admin-orders-toolbar .order-toolbar-row button{height:44px}.admin-orders-toolbar .order-toolbar-extra-filters[hidden]{display:none}@media(max-width:800px){.admin-orders-toolbar>.order-toolbar-row{display:block}.admin-orders-toolbar>.order-toolbar-row>button,.admin-orders-toolbar>.order-toolbar-row>label{display:block;width:100%;margin:0 0 12px}.admin-orders-toolbar>.order-toolbar-row>label{min-width:0!important}.admin-orders-toolbar .order-toolbar-primary-filters #order-delivery-clear{width:100%}.admin-orders-toolbar>.order-toolbar-row>button:last-child,.admin-orders-toolbar>.order-toolbar-row>label:last-child{margin-bottom:0}}
.admin-orders-toolbar>.order-filters-panel{display:block;padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}.admin-orders-toolbar .order-filter-fields{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.admin-orders-toolbar .order-filter-fields+.order-filter-fields{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.admin-orders-toolbar .order-filter-fields>label{min-width:160px}.admin-orders-toolbar .order-filter-fields>label:has(#order-category){min-width:250px}.admin-orders-toolbar .order-filter-fields>label:has(#order-client){min-width:210px}.admin-orders-toolbar .order-filter-fields label:has(#order-date){min-width:0;max-width:12rem}.admin-orders-toolbar .order-filter-fields #order-date{block-size:44px;min-block-size:44px;max-block-size:44px;min-inline-size:0}.admin-orders-toolbar .order-filter-fields #order-delivery-clear{width:44px;padding:6px;font-size:1.5rem;line-height:1}.admin-orders-toolbar #order-filters-toggle,.admin-orders-toolbar #order-filters-toggle-less{margin-left:auto;border:0;background:transparent;color:var(--accent);padding:8px 4px;height:40px}.admin-orders-toolbar #order-filters-toggle:hover,.admin-orders-toolbar #order-filters-toggle-less:hover{background:transparent;text-decoration:underline}.admin-orders-toolbar #order-toolbar-extra-filters[hidden]{display:none}@media(max-width:800px){.admin-orders-toolbar>.order-filters-panel{padding:12px}.admin-orders-toolbar .order-filter-fields{display:block}.admin-orders-toolbar .order-filter-fields>button,.admin-orders-toolbar .order-filter-fields>label{display:block;width:100%;margin:0 0 12px}.admin-orders-toolbar .order-filter-fields>label{min-width:0!important}.admin-orders-toolbar .order-filter-fields label:has(#order-date){max-width:none}.admin-orders-toolbar .order-filter-fields #order-date{inline-size:100%;block-size:44px;min-block-size:44px;max-block-size:44px}.admin-orders-toolbar .order-filter-fields #order-delivery-clear{width:100%}.admin-orders-toolbar .order-filter-fields>button:last-child,.admin-orders-toolbar .order-filter-fields>label:last-child{margin-bottom:0}.admin-orders-toolbar #order-filters-toggle,.admin-orders-toolbar #order-filters-toggle-less{text-align:left;margin-left:0}}
.clients-toolbar{justify-content:flex-start;align-items:flex-end}.clients-toolbar>button,.clients-toolbar input{height:44px}.clients-toolbar>label{width:min(420px,100%)}.client-picker-results{max-height:240px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel)}.client-picker-results:empty{display:none}.client-picker-option{display:block;width:100%;min-height:0;padding:10px 12px;border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left}.client-picker-option:last-child{border-bottom:0}.client-picker-option.selected{background:var(--soft);color:var(--accent)}@media(max-width:800px){.clients-toolbar>button,.clients-toolbar>label{width:100%}}
.merge-suggestions:not(:empty){padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--soft)}.merge-suggestions strong{display:block;margin-bottom:8px}.merge-suggestions .client-picker-option{background:var(--panel)}.merge-suggestions p{margin:8px 0 0}
#one-c-price-summary:empty{display:none}
.debt-report-table{table-layout:fixed}.debt-report-table th,.debt-report-table td{text-align:right;font-variant-numeric:tabular-nums}.debt-report-table td{font-size:1rem}@media(max-width:800px){.debt-report-table{min-width:680px}}
.debt-details-table th:first-child,.debt-details-table td:first-child{text-align:left;width:36%}.debt-details-table td:first-child{white-space:normal}.debt-details-table{margin-top:8px}
.home-debt{margin:4px 0 0;color:#b51632;font-size:1.08rem;font-weight:800}.profile-debt>summary{cursor:pointer;color:var(--accent);font-weight:700}.profile-debt form{margin-bottom:12px}
.debt-loading{display:flex;align-items:center;gap:10px;margin-top:12px;padding:12px 14px;border:1px solid var(--line);border-radius:9px;color:var(--muted)}.debt-spinner{width:20px;height:20px;flex:0 0 20px;border:3px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:debt-spin .8s linear infinite}@keyframes debt-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.debt-spinner{animation-duration:2s}}
.order-weight-cell{text-align:center!important}
.invoice-dialog{width:min(940px,calc(100% - 24px));height:calc(100vh - 24px);padding:0;border:1px solid var(--line);border-radius:14px;background:var(--bg);color:var(--text);box-shadow:0 20px 60px #0005;overflow:hidden}.invoice-dialog[open]{display:flex;flex-direction:column}.invoice-dialog::backdrop{background:#17293899}.invoice-actions{display:grid;grid-template-columns:max-content minmax(240px,1fr) max-content max-content max-content;gap:12px;align-items:end;padding:12px 16px;background:var(--panel);border-bottom:1px solid var(--line)}.invoice-actions label{min-width:0;margin:0}.invoice-actions button,.invoice-actions input{height:44px;margin:0}.invoice-actions button{white-space:nowrap}.invoice-mail-status{grid-column:1/-1;margin:0}.invoice-mail-status:empty{display:none}.invoice-frame{display:block;flex:1 1 auto;min-height:0;width:100%;height:auto;border:0;background:#fff}.order-price-input{width:110px;min-width:90px;text-align:right}.grouped-lines td:has(.order-price-input){text-align:center}@media(max-width:800px){.invoice-dialog{width:calc(100% - 12px);height:calc(100vh - 12px)}.invoice-actions{grid-template-columns:1fr;align-items:stretch;max-height:55vh;overflow:auto}.invoice-actions>*{width:100%}.invoice-frame{height:auto}.order-price-input{width:100%}}
.orders-table{padding:12px 16px}.orders-table th,.orders-table td{padding:8px;line-height:1.2}.orders-table button{min-height:38px;padding:7px 12px;white-space:nowrap}.orders-table .order-category-cell{width:320px;max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.orders-table .order-date-cell,.orders-table .order-amount-cell{white-space:nowrap}.orders-table .order-amount-cell{width:125px}.orders-table small{margin-top:3px}
.select-all-orders{white-space:nowrap;font-size:.85rem;color:var(--text)}
.order-category-summary th{background:var(--soft);color:var(--text);font-weight:700;padding:11px 10px}.order-category-summary th>span{float:left}.order-category-summary strong{float:right;white-space:nowrap;color:var(--accent)}
.admin-nav-picker{display:none}@media(max-width:800px){body[data-role="admin"] #nav{display:block;padding:12px 16px;background:var(--panel);border-bottom:1px solid var(--line)}body[data-role="admin"] #nav>button{display:none}body[data-role="admin"] .admin-nav-picker{display:flex;width:100%;font-weight:700}body[data-role="admin"] main{padding-top:14px}}
.products-toolbar{display:block;margin-bottom:18px}.product-actions,.product-filter-fields{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.product-actions{margin-bottom:12px}.product-actions button,.product-filter-fields button,.product-filter-fields select{height:44px}.product-filters-panel{padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}.product-filter-fields>label{min-width:220px}.product-filter-fields>label:has(#product-manufacturer-filter){min-width:280px}.product-filter-fields+.product-filter-fields{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}#product-tools-toggle,#product-tools-toggle-less{margin-left:auto;border:0;background:transparent;color:var(--accent);padding:8px 4px}#product-tools-toggle:hover,#product-tools-toggle-less:hover{background:transparent;text-decoration:underline}@media(max-width:800px){.product-actions,.product-filter-fields{display:block}.product-actions button,.product-filter-fields>button,.product-filter-fields>label{display:block;width:100%;margin:0 0 12px}.product-filter-fields>label{min-width:0!important}#product-tools-toggle,#product-tools-toggle-less{text-align:left;margin-left:0}.product-actions button:last-child,.product-filter-fields>button:last-child,.product-filter-fields>label:last-child{margin-bottom:0}}
.product-import-help{position:relative;align-self:center}.product-import-help>summary{display:inline;color:var(--accent);font-size:1.05rem;font-weight:700;text-decoration:underline;cursor:pointer;list-style:none}.product-import-help>summary::-webkit-details-marker{display:none}.product-import-help-card{position:absolute;z-index:20;top:30px;left:-120px;width:min(520px,calc(100vw - 40px));max-height:min(620px,75vh);overflow:auto;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 16px 45px #0003;font-size:.9rem}.product-import-help-card p{margin:8px 0}.product-import-help-card ol,.product-import-help-card ul{margin:8px 0;padding-left:22px}.product-import-help-card li{margin:5px 0}@media(max-width:800px){.product-import-help{display:inline-block;margin:0 0 12px 6px}.product-import-help-card{position:fixed;top:80px;left:20px;right:20px;width:auto}}
.prices-toolbar{margin-bottom:18px}.price-actions{display:flex;gap:12px;margin-bottom:12px}.price-filters-panel{display:flex;align-items:flex-end;padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}.price-filters-panel label{min-width:260px}.price-matrix th:not(:first-child),.price-matrix td:not(:first-child){white-space:nowrap}.price-matrix input{min-width:110px}.dictionary-form{display:grid;grid-template-columns:minmax(240px,1fr) auto auto;gap:12px;align-items:end}.price-type-form{display:grid;grid-template-columns:100px minmax(240px,1fr) auto auto;gap:12px;align-items:end}.dictionary-form button,.price-type-form button{height:44px}.price-type-form .price-type-number input{max-width:none}@media(max-width:800px){.price-actions button,.price-filters-panel label{width:100%}.dictionary-form,.price-type-form{grid-template-columns:1fr}.dictionary-form button,.price-type-form button{width:100%}}
.report-category-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px 16px;border:1px solid #ddd;border-radius:12px;padding:12px}
.report-category-list legend{padding:0 6px}
