:root{--red:#df4939;--button:#30363b;--button-hover:#242a2e;--button-active:#191e22;--ink:#202629;--muted:#737a80;--border:#e5e8eb;--bg:#f4f6f8}*{box-sizing:border-box}body{margin:0;font:16px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:var(--ink);background:var(--bg)}a{color:inherit;text-decoration:none}a:hover{color:var(--red)}button,input,select,textarea{font:inherit}button,.button{display:inline-flex;justify-content:center;align-items:center;gap:8px;border:1px solid var(--border);border-radius:8px;padding:11px 17px;background:white;color:var(--ink);cursor:pointer;font-size:14px;font-weight:600;white-space:nowrap}button:hover,.button:hover{border-color:var(--button);color:var(--ink)}button:disabled{opacity:.5;cursor:wait}.primary,.danger{background:var(--button);color:white;border-color:var(--button)}.primary:hover,.danger:hover{background:var(--button-hover);border-color:var(--button-hover);color:white}.primary:active,.danger:active{background:var(--button-active);border-color:var(--button-active);color:white}button:focus-visible,.button:focus-visible{outline:3px solid #737a80;outline-offset:3px}.full{width:100%}.spaced{margin-top:14px}.sidebar{position:fixed;inset:0 auto 0 0;width:246px;background:#fff;border-right:1px solid var(--border);display:flex;flex-direction:column;padding:30px 22px}.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:14px;letter-spacing:.5px}.brand small{font-size:10px;font-weight:500;letter-spacing:.3px;margin-top:4px}.mark{display:inline-flex;align-items:center;justify-content:center;background:var(--red);color:white;border-radius:10px;font-size:28px;width:44px;height:44px;flex-shrink:0}.nav-label{font-size:10px;letter-spacing:1.3px;color:#969da3;margin:44px 10px 14px}nav{display:grid;gap:7px}nav a{padding:13px 15px;border-radius:8px;display:flex;gap:14px;font-size:15px;color:#5b6269}nav a span{font-size:20px;line-height:23px}nav a.selected{background:#fceeea;color:#bf3c2f;font-weight:600}.sidebar-bottom{margin-top:auto;display:flex;align-items:center;gap:8px;font-size:14px}.sidebar-bottom form{margin-left:auto}.avatar{background:#ecedef;border-radius:50%;padding:7px 11px}.text-button{border:0;background:transparent;padding:0;color:var(--muted);font-weight:400}.workspace{margin-left:246px}header{height:78px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 38px;font-size:14px;background:#ffffffb0}.environment{font-size:12px;border:1px solid var(--border);border-radius:5px;padding:5px 10px;color:var(--muted)}.content{max-width:1480px;margin:auto;padding:34px 38px}.muted,small{color:var(--muted)}small{display:block;font-size:12px;font-weight:400;margin-top:4px}.eyebrow{font-size:11px;letter-spacing:1.8px;font-weight:700;color:var(--red);margin:0 0 10px}h1{font-size:32px;line-height:1.2;letter-spacing:-1px;margin:0 0 10px;font-weight:700}h2{font-size:18px;letter-spacing:-.3px;margin:0}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.page-heading p:last-child{margin-bottom:0;font-size:14px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin:26px 0}.stats article{background:white;border:1px solid var(--border);padding:23px;border-radius:12px}.stats article>span{font-size:14px;color:var(--muted)}.stats strong{display:block;font-size:32px;letter-spacing:-1px;margin:14px 0 8px}.stats .accent{background:#252d32;color:white;border-color:#252d32}.stats .accent span,.stats .accent small{color:#c1c9cf}.panel{background:white;border:1px solid var(--border);border-radius:12px;margin-bottom:22px;overflow:hidden}.panel-heading{padding:22px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px}.panel-heading .muted,.panel-heading a{font-size:13px}.panel-heading input{max-width:360px}table{border-collapse:collapse;width:100%;text-align:left;font-size:14px}th{background:#fafbfc;color:#7d8389;font-weight:500;font-size:12px;padding:13px 23px;border-bottom:1px solid var(--border)}td{padding:19px 23px;border-bottom:1px solid #eef0f2}tbody tr:last-child td{border-bottom:0}.right{text-align:right}.order-link{font-weight:650}.badge{display:inline-block;font-size:12px;font-weight:600;padding:5px 9px;border-radius:5px;vertical-align:middle;letter-spacing:0;white-space:nowrap}.new{background:#fff3dc;color:#9b6812}.assembled{background:#edf0ff;color:#5c63a1}.done{background:#eaf5ef;color:#35745a}.cancelled{background:#f0f1f2;color:#757c82}.empty{padding:45px 24px;text-align:center;color:var(--muted)}.quick{display:flex;justify-content:space-between;align-items:center;border:1px dashed #d0d6dc;border-radius:12px;padding:24px}.quick p{font-size:14px;color:var(--muted);margin-bottom:0}.editor{padding:24px}.editor h2{margin-bottom:22px}label{display:block;font-size:14px;font-weight:500;margin-bottom:17px}input,select,textarea{display:block;width:100%;border:1px solid #dce1e5;border-radius:7px;background:white;padding:11px 12px;outline:none;color:var(--ink);margin-top:6px;font-size:16px}input:focus,select:focus,textarea:focus{border-color:var(--red);box-shadow:0 0 0 3px #df493914}.catalog-grid{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:24px;align-items:start}.catalog-row{padding:20px 24px;border-top:1px solid var(--border);display:flex;justify-content:space-between;gap:16px}.catalog-row p{margin:8px 0 0}.catalog-row a,.row-actions{font-size:13px}.row-actions{display:grid;align-content:start;gap:12px}.order-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}.step{color:var(--red);font-size:13px;margin-right:10px}.product-table input{width:95px;font-size:15px}.product-table td,.product-table th{padding:17px 14px}.product-table .qty{width:80px}.has-qty{background:#fff9f7}.grand-total{font-size:36px;font-weight:700;letter-spacing:-1px;margin:9px 0}.summary{position:sticky;top:24px}.helper{font-size:12px;color:var(--muted);margin:20px 0}.filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:24px}.filters label{margin:0;flex:1;min-width:140px}.filters a{font-size:13px;padding-bottom:12px}.table-scroll{overflow-x:auto}.notice{padding:14px 18px;border:1px solid #b7d9c7;background:#edf7f1;border-radius:8px;margin-bottom:20px}.notice.error{background:#fff0ec;border-color:#eab5ab}.invoice{padding:28px}.invoice-head{display:flex;justify-content:space-between;color:var(--red);font-size:13px;border-bottom:2px solid var(--ink);padding-bottom:20px;margin-bottom:20px}.invoice-address{margin:24px 0}.invoice p{font-size:14px;margin:7px 0}.invoice table th,.invoice table td{padding:12px 6px}.invoice-total{display:flex;justify-content:space-between;font-size:23px;border-top:2px solid var(--ink);padding:18px 0}.signatures{display:flex;justify-content:space-between;margin-top:42px;gap:20px}.signatures p{font-size:12px}details{margin-top:24px;border-top:1px solid var(--border);padding-top:17px}summary{font-size:14px;color:#a6493e;cursor:pointer}.timeline{border-left:2px solid #eceef0;padding:0 0 18px 14px;font-size:13px}.timeline p{margin:5px 0}.login-wrap{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#e9edf0,#fff)}.login-card{max-width:430px;background:white;padding:38px;border:1px solid var(--border);border-radius:16px;box-shadow:0 20px 80px #2026290b}.login-card .eyebrow{margin-top:25px}.login-card h1{font-size:29px}.login-card form{margin-top:25px}[hidden]{display:none!important}
@media(max-width:1100px){.sidebar{width:210px;padding:24px 15px}.workspace{margin-left:210px}.content{padding:28px 22px}.order-grid,.catalog-grid{grid-template-columns:minmax(0,1fr)}.summary{position:static}.stats strong{font-size:26px}.brand{font-size:12px}}
@media(max-width:700px){.sidebar{position:static;width:auto;padding:15px;border-right:0;border-bottom:1px solid var(--border)}.brand small,.nav-label,.sidebar-bottom{display:none}nav{display:flex;overflow:auto;margin-top:16px;gap:4px}nav a{padding:9px 12px;white-space:nowrap;font-size:14px}nav a span{display:none}.workspace{margin:0}header{height:48px;padding:0 18px;font-size:12px}.environment{font-size:10px}.content{padding:25px 16px}.page-heading{align-items:start}h1{font-size:27px}.stats{grid-template-columns:1fr;gap:10px}.stats article{padding:16px}.stats strong{font-size:28px;margin:7px 0}.stats small{display:none}.quick{align-items:start;gap:15px;flex-direction:column}.panel-heading{padding:18px}.panel-heading input{max-width:160px}.product-table{min-width:530px}.invoice{padding:16px}.invoice td{font-size:12px}.signatures{flex-direction:column}.login-card{padding:26px}.login-wrap .content{padding:18px}.page-heading .badge{margin-top:9px}}
@page{size:A4;margin:10mm}@media print{body{background:white;font-size:10pt}.sidebar,header,.no-print,.filters,.notice,body:has(.invoice) .page-heading{display:none!important}.workspace{margin:0}.content{padding:0;max-width:none}.order-grid{display:block}.invoice,.panel{border:0;border-radius:0;padding:0;overflow:visible}.invoice-head{font-size:10pt}.invoice p,.invoice td{font-size:9pt}.invoice table th,.invoice table td{padding:7px 4px}tr{break-inside:avoid}thead{display:table-header-group}.invoice-total,.signatures{break-inside:avoid}.signatures{display:flex;flex-direction:row}.table-scroll{overflow:visible}.stats{display:block}.stats article{padding:8px}.stats strong{font-size:18px}.stats .accent{background:white;color:black}.stats .accent span,.stats .accent small{color:black}button{display:none}}
@media screen and (max-width:700px){.sidebar-bottom{display:flex;margin-top:12px;font-size:12px}.sidebar-bottom .avatar,.sidebar-bottom small{display:none}.product-table{min-width:0}.product-table thead{display:none}.product-table tbody{display:block}.product-table tr{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--border);padding:15px;gap:12px}.product-table td{display:block;border:0;padding:0}.product-table td:first-child{grid-column:1/-1}.product-table td:nth-child(2)::before{content:'Цена, ₸';font-size:12px;color:var(--muted)}.product-table td:nth-child(3)::before{content:'Количество';font-size:12px;color:var(--muted)}.product-table td:last-child{grid-column:1/-1}.product-table input,.product-table .qty{width:100%}.page-heading{flex-wrap:wrap}.catalog-row{padding:17px}.invoice-head{gap:10px}}

/* Existing layout retained; official logo uses its original aspect ratio. */
.brand-logo{display:block;width:100%;max-width:202px;height:auto;object-fit:contain}
.login-logo{display:block;width:100%;max-width:300px;height:auto;margin-bottom:26px}
.invoice-logo{display:block;width:175px;height:auto;object-fit:contain}
.print-actions{display:flex;gap:10px;flex-wrap:wrap}
input[data-integer]{font-variant-numeric:tabular-nums}
@media(max-width:700px){.brand-logo{max-width:210px}.print-actions .button{white-space:normal}.invoice-logo{width:155px}}

/* Match the printable invoice: total under the amount column, one courier signature. */
.invoice th:nth-child(3),.invoice th:nth-child(4),.invoice td:nth-child(3),.invoice td:nth-child(4){text-align:right}
.invoice .invoice-total-row td{border-top:2px solid var(--ink);font-weight:700;text-align:right;font-size:16px}
.invoice .signatures{display:block;margin-top:20px}
.invoice .signatures p{margin:12px 0;line-height:1.8}
@media print{.invoice .invoice-total-row td{font-size:10pt}.invoice .signatures{margin-top:10mm}}

.invoice .invoice-payment{text-align:right;padding-right:6px}
.invoice .signatures{display:grid;grid-template-columns:30% 70%;gap:0;align-items:start}
.invoice .signatures p{margin:0;font-size:11px;line-height:1.6}
.invoice .signatures p:first-child{padding-right:12px}
.invoice-cut-line{border:0;border-top:1px dashed #737a80;width:100%;margin:20px 0 2px}
.invoice-footer{break-inside:avoid}
@media print{.invoice .signatures p{font-size:8pt}.invoice-cut-line{margin-top:5mm}}

.invoice .signatures p:last-child{text-align:right}

.invoice-details,.invoice-products{display:grid;grid-template-columns:60% 40%;align-items:start}
.invoice-details{margin:20px 0 12px}.invoice-details .invoice-address{margin:0}
.invoice-comment,.invoice-acceptance{padding-left:8mm;text-align:right;overflow-wrap:anywhere}
.invoice .invoice-acceptance p{margin:0 0 18px;font-size:12px;line-height:1.6}
.invoice-products table{table-layout:fixed}.invoice-products th:first-child{width:43%}.invoice-products th:nth-child(2){width:13%}.invoice-products th:nth-child(3){width:21%}.invoice-products th:nth-child(4){width:23%}
.invoice-products td{overflow-wrap:anywhere;border-bottom:1px solid #c7ccd0}
.invoice-products tbody tr:nth-child(odd):not(.invoice-total-row){background:#f0f1f2}
.invoice .invoice-products th,.invoice .invoice-products td{padding:8px 4px;font-size:12px}
.invoice-footer{margin-top:16px}
@media print{.invoice .invoice-products th,.invoice .invoice-products td,.invoice .invoice-acceptance p{font-size:8.5pt}}

.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:700px){.dashboard-stats{grid-template-columns:1fr}}

.shop-picker{position:relative}.shop-phone-options{position:absolute;top:auto;left:0;right:0;z-index:10;max-height:260px;overflow:auto;border:1px solid #dce1e5;border-radius:7px;background:white;box-shadow:0 8px 24px #20262920}.shop-phone-options button{display:block;width:100%;text-align:left;white-space:normal;border:0;border-radius:0;border-bottom:1px solid #eef0f2;font-weight:400}.shop-phone-options button:hover,.shop-phone-options [aria-selected="true"]{background:#eef1f3;color:var(--ink)}
.panel:has(.shop-picker){overflow:visible}

/* Order selection and read-only sales matrix. */
.batch-toolbar{display:flex;align-items:center;gap:18px;margin:18px 0;flex-wrap:wrap}
.selection-cell{width:44px;text-align:center}.selection-cell input,.matrix-choices input{width:18px;height:18px;min-width:18px;accent-color:#343a40;margin:0}
button:disabled{opacity:.45;cursor:not-allowed}
.report-tabs{display:flex;gap:22px;border-bottom:1px solid #dde1e5;margin-bottom:22px;padding-bottom:12px}.report-tabs a{color:#69717d}.report-tabs .current{color:#252a30;font-weight:700}
.matrix-filters{padding:20px}.matrix-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.matrix-filter-grid label{display:flex;flex-direction:column;gap:7px}.matrix-filter-grid input,.matrix-filter-grid select{width:100%;min-width:0}
.matrix-options{display:flex;gap:14px;align-items:flex-start;margin-top:18px;flex-wrap:wrap}.matrix-options details{position:relative;min-width:180px}.matrix-options summary{padding:12px;border:1px solid #dce0e5;border-radius:8px;cursor:pointer}.matrix-choices{position:absolute;z-index:8;top:100%;left:0;width:320px;max-width:80vw;max-height:300px;overflow:auto;background:white;border:1px solid #dce0e5;border-radius:8px;box-shadow:0 8px 24px #0001;padding:8px}.matrix-choices label{display:flex;align-items:center;gap:10px;padding:9px;cursor:pointer}.matrix-options>a{padding:12px 0}
.matrix-scroll{overflow:auto;max-height:65vh;border-radius:12px}.sales-matrix{border-collapse:separate;border-spacing:0;width:100%}.sales-matrix th,.sales-matrix td{min-width:140px;text-align:right;white-space:nowrap;border-bottom:1px solid #e3e6e9}.sales-matrix th:first-child{position:sticky;left:0;z-index:2;text-align:left;min-width:210px;max-width:280px;white-space:normal;background:#fff;border-right:1px solid #dce0e5}.sales-matrix thead th{position:sticky;top:0;z-index:3;background:#f2f3f5;white-space:normal}.sales-matrix thead th:first-child{z-index:4;background:#f2f3f5}.sales-matrix small{white-space:nowrap}.sales-matrix .matrix-total{background:#f5f6f7;font-weight:700;border-left:1px solid #dde1e5}.sales-matrix tfoot th,.sales-matrix tfoot td{background:#e9ecef!important;font-weight:700;border-top:2px solid #c5cbd1}.sales-matrix tbody th{font-weight:500}.sales-matrix tbody tr:hover td,.sales-matrix tbody tr:hover th{background:#f5f6f7}
@media(max-width:700px){.matrix-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.matrix-filters{padding:14px}.matrix-options{gap:10px}.matrix-options details{min-width:0;flex:1 1 40%}.sales-matrix th:first-child{min-width:150px;max-width:170px}.sales-matrix th,.sales-matrix td{padding:12px;min-width:120px}.matrix-scroll{max-height:70vh}}
.matrix-filters{overflow:visible}.matrix-options details{margin:0;padding:0;border:0}.matrix-options summary{color:#343a40}.matrix-options details:nth-child(2) .matrix-choices{left:auto;right:0}

.replacement-control{display:flex;align-items:center;gap:7px;font-size:12px;margin:9px 0;color:#535c63;white-space:normal}.replacement-control input{width:17px;height:17px;min-width:17px;margin:0;accent-color:#343a40}.product .add-product-line,.product .remove-product-line{font-size:12px;white-space:normal;text-align:left}.is-replacement .price{background:#f0f2f3;color:#596169}.extra-product td{border-top:1px dashed #c9ced3}.product-table td:first-child{min-width:210px}.product-table input.price,.product-table input.qty{min-width:70px}
#kitchen-summary .panel-heading{padding:0 0 12px;flex-wrap:wrap}#kitchen-table td:nth-child(n+3),#kitchen-table th:nth-child(n+3){text-align:right}#kitchen-table tfoot{font-weight:700;border-top:2px solid #c9ced3;background:#f1f3f4}#kitchen-message:empty{display:none}

#courier-summary>.panel-heading{padding:0 0 12px;flex-wrap:wrap}#courier-message:empty{display:none}.courier-card+.courier-card{border-top:1px solid var(--border);margin-top:24px;padding-top:20px}.courier-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.courier-heading h3{font-size:18px;margin:0;overflow-wrap:anywhere}.courier-card td:last-child,.courier-card th:last-child{text-align:right}.courier-card tfoot{font-weight:700;background:#f1f3f4;border-top:2px solid #c9ced3}.courier-amount{text-align:right;font-weight:700;margin:18px 0 0}.courier-card td:first-child{overflow-wrap:anywhere}
@media(max-width:600px){.courier-heading{align-items:flex-start;flex-wrap:wrap}.courier-card td,.courier-card th{padding:12px 8px}.courier-card table{table-layout:fixed}.courier-card th:last-child{width:110px}.courier-amount{font-size:14px}}
