.shipping-sheet-content {min-width:0;}
.sheet-toolbar {display:grid;grid-template-columns:minmax(240px,1fr) 160px 160px auto auto;gap:10px;align-items:end;padding:14px;background:white;border:1px solid #dce6f0;border-radius:14px;}
.sheet-toolbar label,.sheet-day-form label {display:grid;gap:5px;font-size:12px;font-weight:650;color:#687b90;}
.sheet-production-link {display:inline-flex;align-items:center;justify-content:center;text-decoration:none;min-height:44px;padding:10px 14px;white-space:nowrap;}
.sheet-day-form {display:flex;align-items:end;gap:10px;margin:12px 0;}.sheet-day-form[hidden] {display:none;}
.sheet-hints {display:flex;justify-content:space-between;gap:18px;align-items:center;margin:10px 0;font-size:12px;}.sheet-hints p{margin:0;}.sheet-hints span{white-space:nowrap;color:#24826b;}.sheet-hints .sheet-save-error{color:#b1362c;}
.sheet-table-wrap {max-height:calc(100vh - 300px);min-height:350px;overflow:auto;border:1px solid #ccd9e7;border-radius:10px;background:#fff;}
.sheet-table {border-collapse:separate;border-spacing:0;table-layout:fixed;width:3027px;font-size:12px;line-height:1.35;}
.sheet-table th,.sheet-table td {padding:7px 6px;border-right:1px solid #dae2eb;border-bottom:1px solid #dae2eb;vertical-align:top;overflow-wrap:anywhere;}
.sheet-table thead th {position:sticky;top:0;z-index:6;background:#eaf0f7;text-align:left;color:#344b63;font-weight:750;vertical-align:middle;}
.sheet-table small {display:block;margin-top:4px;font-size:10px;color:#7a899b;}
.sheet-table textarea,.sheet-table input {display:block;width:100%;min-width:0;min-height:30px;padding:5px;border:1px solid transparent;border-radius:4px;background:transparent;font:inherit;color:#203c58;box-shadow:none;}
.sheet-table textarea {resize:vertical;min-height:48px;}.sheet-table input:focus,.sheet-table textarea:focus {background:#fff;border-color:#679ac9;outline:2px solid #dbe9f7;}
.sheet-table textarea:hover,.sheet-table input:hover {border-color:#c7d8e8;}
.sheet-day th {position:sticky;top:0;z-index:8;background:#b77aa0;color:#fff;font-size:18px;font-weight:750;padding:10px 12px;box-shadow:0 2px 5px #25435f26;}
.sheet-day th span {position:sticky;left:12px;}.sheet-day .sheet-remove {position:sticky;left:155px;}
.sheet-invoice-heading td {background:#f0f5fa;padding:7px 8px;color:#234e78;}.sheet-invoice-heading td>div {display:flex;align-items:center;gap:10px;width:max-content;max-width:calc(100vw - 330px);position:sticky;left:8px;}
.sheet-invoice-heading span {font-size:11px;color:#76879b;}.sheet-group-date {display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:11px;}.sheet-group-date input {width:140px;background:white;border:1px solid #d7e2ee;}
.sheet-table .sheet-shared {background:#fbfcfe;}.sheet-readonly {white-space:pre-wrap;}.sheet-product strong {display:block;white-space:pre-wrap;}.sheet-number strong {color:#285e94;}
.sheet-table .sheet-number small {font-size:9px;}.sheet-table .sheet-warning {color:#b3462c;}
.sheet-drag {display:inline-flex;align-items:center;justify-content:center;width:22px;min-height:24px;padding:0;border:1px solid #ccd9e6;border-radius:4px;color:#67829d;background:#fff;font-size:20px;line-height:1;cursor:grab;box-shadow:none;}
.sheet-remove {border:0;background:transparent;box-shadow:none;padding:0 5px;color:#b64d42;min-height:22px;font-size:20px;cursor:pointer;}.sheet-note .sheet-remove{float:right;}
.sheet-day .sheet-remove{color:#fff;}.sheet-dragging .sheet-drop-target>td,.sheet-dragging .sheet-drop-target>tr>th,.sheet-dragging tbody.sheet-drop-target>tr>td {box-shadow:inset 0 3px #e5b333;background:#fff4bd;}
.sheet-empty-day td {height:55px;color:#91a0b1;font-style:italic;background:#fbfcfe;}.sheet-footnote{font-size:12px;margin-top:10px;}
.sheet-col-drag{width:32px}.sheet-col-number{width:80px}.sheet-col-deadline{width:110px}.sheet-col-weight{width:120px}.sheet-col-product{width:310px}.sheet-col-quantity{width:90px}.sheet-col-packages{width:150px}.sheet-col-invoice{width:100px}.sheet-col-carrier{width:200px}.sheet-col-destination{width:240px}.sheet-col-phone{width:200px}.sheet-col-recipient{width:220px}.sheet-col-inn{width:130px}.sheet-col-payer{width:220px}.sheet-col-sender{width:160px}.sheet-col-delivery{width:140px}.sheet-col-note{width:220px}
@media(max-width:1000px){.sheet-toolbar{grid-template-columns:1fr 1fr}.sheet-toolbar>label:first-child{grid-column:1/-1}.sheet-hints{display:block}.sheet-table-wrap{max-height:65vh}.sheet-invoice-heading td>div{max-width:calc(100vw - 70px);flex-wrap:wrap}}
.sheet-table td.sheet-status-ready_to_ship {background:#e8f7ee;}.sheet-table td.sheet-status-in_production {background:#fff6dc;}.sheet-table td.sheet-status-shipped,.sheet-table td.sheet-status-cancelled {background:#f0f2f5;}
.sheet-table thead th {white-space:normal;font-size:10px;letter-spacing:.04em;}
/* Compact route overview and focused editing. */
.sheet-view-switch {display:flex;gap:4px;width:max-content;margin:12px 0 0;padding:4px;border:1px solid #d5e1ed;border-radius:10px;background:#fff;}
.sheet-view-switch button {min-height:32px;padding:6px 14px;border:0;border-radius:7px;background:transparent;box-shadow:none;color:#6c8096;font-size:12px;font-weight:700;}
.sheet-view-switch .is-active {background:#e8f1fa;color:#205089;}
.sheet-day-tools {display:flex;align-items:center;gap:12px;position:sticky;left:10px;width:max-content;max-width:calc(100vw - 340px);}
.sheet-day .sheet-day-tools span {position:static;font-size:11px;font-weight:500;color:#f8edf4;text-transform:none;letter-spacing:0;}
.sheet-day .sheet-day-tools strong {font-size:17px;letter-spacing:0;text-transform:none;}
.sheet-day .sheet-remove {position:static;}
.sheet-day-print {display:inline-flex;align-items:center;justify-content:center;flex:none;width:29px;min-width:29px;height:25px;min-height:25px;padding:3px;border:1px solid #ffffff88;border-radius:5px;background:#ffffff22;color:#fff;box-shadow:none;cursor:pointer;}
.sheet-day-print svg {width:18px;min-width:18px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;}
.sheet-day-print:hover {background:#ffffff44;}.sheet-day-print:disabled {opacity:.35;cursor:default;}
.sheet-day-dispatch {min-height:29px;padding:5px 12px;border:1px solid #bfe7d3;border-radius:7px;background:#e9f8f0;color:#176a4d;font-weight:750;box-shadow:none;cursor:pointer;white-space:nowrap;}
.sheet-day .sheet-day-dispatched {padding:5px 10px;border-radius:999px;background:#e4f1fd;color:#356b98;font-weight:750;}
.sheet-table tr.sheet-line-shipped>td,.sheet-compact tr.sheet-line-shipped>td {background:#edf6ff;}
.sheet-line-shipped .sheet-card-line {box-shadow:inset 4px 0 #81b5e1;}.sheet-line-shipped .sheet-card-product:after {content:'Отгружено · машина уехала';display:inline-block;margin-top:5px;padding:2px 7px;border-radius:999px;background:#d9ebfb;color:#356b98;font-size:10px;font-weight:750;}
.sheet-fill-button,.sheet-line-edit {min-height:29px;padding:4px 10px;border:1px solid #b8cee2;border-radius:6px;background:#fff;color:#2b5a87;font-size:12px;font-weight:700;box-shadow:none;cursor:pointer;white-space:nowrap;}
.sheet-line-edit {width:28px;padding:0;font-size:19px;}
.sheet-table.sheet-compact {width:100%;table-layout:fixed;}
.sheet-compact>colgroup,.sheet-compact>thead {display:none;}
.sheet-compact .sheet-invoice-heading td {padding:10px 12px;border-right:0;border-top:6px solid #eaf0f6;background:#f3f7fb;}
.sheet-compact .sheet-invoice-heading td>div {position:static;width:100%;max-width:none;flex-wrap:wrap;}
.sheet-card-title {display:flex;gap:12px;align-items:baseline;min-width:0;flex:1;}
.sheet-card-title strong {font-size:14px;}.sheet-card-title span {white-space:nowrap;}
.sheet-compact .sheet-group-date {margin-left:auto;}
.sheet-compact .sheet-card-delivery td {padding:10px 14px;border-right:0;background:#fcfdff;}
.sheet-delivery-grid {display:grid;grid-template-columns:.9fr 1.8fr 1.2fr 1fr;gap:8px 16px;}
.sheet-delivery-grid small {font-size:10px;margin:0 0 3px;color:#8493a5;}.sheet-delivery-grid span {display:block;color:#294762;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;}
.sheet-delivery-grid .sheet-value-empty {color:#b0bbc7;font-style:italic;}
.sheet-compact tr[data-plan-line]>td {padding:0;border-right:0;}
.sheet-card-line {display:grid;grid-template-columns:24px minmax(0,1fr) 90px 28px 24px;align-items:center;gap:12px;padding:10px 14px;}
.sheet-card-product strong {display:block;font-size:13px;line-height:1.5;}.sheet-product-number {color:#2b689f;margin-right:8px;}
.sheet-card-product small {font-size:10px;margin:2px 0 0;}.sheet-pack-info {display:flex;gap:18px;flex-wrap:wrap;color:#7a8fa5;font-size:11px;margin-top:5px;}
.sheet-line-note {margin:6px 0 0;font-size:11px;color:#946324;white-space:pre-wrap;}
.sheet-card-quantity {text-align:right;white-space:nowrap;}.sheet-card-quantity strong {font-size:18px;color:#244d74;}.sheet-card-quantity span{font-size:11px;color:#7c8ea1;margin-left:4px;}
.sheet-compact .sheet-empty-day td {height:34px;padding:8px 14px;font-size:11px;}
.sheet-editor {width:min(1100px,calc(100vw - 32px));max-height:90vh;padding:0;border:0;border-radius:16px;box-shadow:0 20px 80px #102b4d44;color:#253e58;overflow:auto;}
.sheet-editor::backdrop {background:#132d49aa;backdrop-filter:blur(3px);}
.sheet-editor>header {position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:20px;padding:18px 22px;background:#fff;border-bottom:1px solid #dfe8f2;}
.sheet-editor h2 {font-size:20px;margin:0;}.sheet-editor .eyebrow{font-size:10px;margin:0 0 5px;}
#sheet-editor-fields {padding:0 22px 18px;}.sheet-editor h3 {font-size:14px;margin:18px 0 10px;}
.sheet-editor-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.sheet-editor label {display:grid;gap:5px;color:#73859a;font-size:11px;font-weight:650;}
.sheet-editor textarea,.sheet-editor input {width:100%;min-height:40px;border:1px solid #d5e1ed;border-radius:7px;background:#fbfdff;padding:9px 10px;color:#203e5a;box-shadow:none;font:400 13px/1.4 Arial,sans-serif;}
.sheet-editor textarea {resize:vertical;min-height:58px;}.sheet-editor textarea:focus,.sheet-editor input:focus {outline:2px solid #dcebf9;border-color:#78a5cf;}
.sheet-edit-destination {grid-column:span 2;}.sheet-editor-line {padding:12px;margin:10px 0;border:1px solid #dae5f0;border-radius:10px;background:#f8fbfe;}
.sheet-editor-line>strong {display:block;font-size:13px;}.sheet-editor-line>small {display:block;color:#8b9aad;font-size:11px;margin:3px 0 10px;}
.sheet-editor-line-fields {display:grid;grid-template-columns:110px 1fr 1fr;gap:10px;}.sheet-editor-note {grid-column:1/-1;}
.sheet-editor>footer {position:sticky;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:12px 22px;background:#fff;border-top:1px solid #dfe8f2;}
.sheet-editor-state {color:#25846d;font-size:12px;}.sheet-editor-state.sheet-save-error{color:#b1362c;}
.sheet-dispatch-dialog {width:min(820px,calc(100vw - 28px));max-height:88vh;padding:0;border:0;border-radius:16px;box-shadow:0 20px 80px #102b4d44;color:#253e58;overflow:auto;}
.sheet-dispatch-dialog::backdrop {background:#132d49aa;backdrop-filter:blur(3px);}.sheet-dispatch-dialog>header,.sheet-dispatch-dialog>footer {position:sticky;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;background:#fff;border-bottom:1px solid #dfe8f2;}.sheet-dispatch-dialog>header{top:0}.sheet-dispatch-dialog>footer{bottom:0;border-top:1px solid #dfe8f2;border-bottom:0;justify-content:flex-end}.sheet-dispatch-dialog h2{margin:0;font-size:21px}.sheet-dispatch-dialog .eyebrow{margin:0 0 4px;font-size:10px}.sheet-dispatch-all {display:grid;grid-template-columns:24px 1fr;gap:2px 10px;margin:14px 20px;padding:13px;border:1px solid #9ac9b2;border-radius:10px;background:#eef9f3;cursor:pointer}.sheet-dispatch-all input{grid-row:1/3;width:19px;height:19px;margin-top:3px}.sheet-dispatch-all span{font-size:11px;color:#71889a}.sheet-dispatch-dialog section{margin:12px 20px}.sheet-dispatch-dialog section h3{margin:0;padding:8px 10px;background:#edf3f9;border-radius:7px;font-size:13px}.sheet-dispatch-line{display:flex;align-items:center;gap:10px;padding:10px;border-bottom:1px solid #e2eaf2;cursor:pointer}.sheet-dispatch-line input{width:18px;height:18px;flex:none}.sheet-dispatch-line span{display:grid;gap:3px}.sheet-dispatch-line small{color:#75899d}.sheet-dispatch-line.is-shipped{color:#356b98;background:#edf6ff}.sheet-dispatch-dialog [role=alert]{margin:10px 20px;color:#b1362c;font-weight:650}
.shipping-driver-frame {position:fixed;left:-10000px;top:0;width:1123px;height:794px;border:0;}
@media(max-width:1050px){.sheet-delivery-grid{grid-template-columns:1fr 1fr}.sheet-editor-grid{grid-template-columns:1fr 1fr}.sheet-edit-destination{grid-column:span 1}.sheet-day-tools{max-width:calc(100vw - 70px)}}
@media(max-width:650px){.sheet-card-line{grid-template-columns:22px minmax(0,1fr) 56px 26px 20px;gap:7px;padding:10px 8px}.sheet-delivery-grid{grid-template-columns:1fr 1fr;gap:8px}.sheet-card-title{flex-basis:calc(100% - 45px)}.sheet-compact .sheet-group-date{margin-left:0}.sheet-editor-grid,.sheet-editor-line-fields{grid-template-columns:1fr}.sheet-editor-note{grid-column:auto}.sheet-editor>header,#sheet-editor-fields,.sheet-editor>footer{padding-left:14px;padding-right:14px}.sheet-day .sheet-day-tools span{font-size:10px}}
.shipping-sheet-content .topbar h1 {font-size:32px;}
.sheet-toolbar {padding:10px 12px;}
.sheet-toolbar input {min-height:38px;height:38px;padding:8px 10px;}
.sheet-toolbar button,.sheet-toolbar .sheet-production-link {min-height:38px;padding:8px 12px;}
.sheet-day-form {display:inline-flex;margin:8px 0;vertical-align:middle;}
.sheet-view-switch {display:inline-flex;margin:8px 0 8px 12px;vertical-align:middle;}
.sheet-hints {margin:4px 0 10px;}
@media(max-width:650px){.sheet-view-switch{margin-left:0}.shipping-sheet-content .topbar h1{font-size:27px}}

.sheet-table td.sheet-status-shipped{background:#edf6ff}

.sheet-day[data-fold-day]{cursor:pointer}
.sheet-day .sheet-day-fold-toggle{display:inline-flex;align-items:center;gap:7px;padding:0!important;margin:0!important;border:0!important;border-radius:4px;background:transparent!important;color:inherit!important;box-shadow:none!important;font:inherit;cursor:pointer}
.sheet-day .sheet-day-fold-toggle:focus-visible{outline:2px solid #fff;outline-offset:3px}
.sheet-day-fold-arrow{font-size:15px;line-height:1}
.sheet-day-collapsed .sheet-day-tools{min-height:24px}

/* Single compact working bar for search, dates, print and view mode. */
.shipping-sheet-content>.sheet-toolbar{grid-template-columns:minmax(180px,1fr) 130px 130px auto auto auto;align-items:end;gap:10px;margin-bottom:12px}
.sheet-toolbar>button,.sheet-toolbar>.sheet-production-link{white-space:nowrap}
.sheet-toolbar #sheet-status{align-self:center;min-width:0;font-size:11px;line-height:1.35;color:#24826b;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sheet-toolbar .sheet-save-error{color:#b1362c}
@media(max-width:1100px){.shipping-sheet-content>.sheet-toolbar{grid-template-columns:minmax(180px,1fr) 130px 130px}.shipping-sheet-content>.sheet-toolbar>label:first-child{grid-column:auto}.sheet-toolbar #sheet-status{grid-column:1/-1}}
@media(max-width:600px){.shipping-sheet-content>.sheet-toolbar{grid-template-columns:1fr 1fr}.shipping-sheet-content>.sheet-toolbar>label:first-child{grid-column:1/-1}.sheet-toolbar .sheet-production-link{align-self:stretch}}

.sheet-day .sheet-day-tools .sheet-day-dispatched{color:#285477;background:#e4f1fd;font-weight:750;border:1px solid #aecde7;box-shadow:none;opacity:1}

#sheet-status[hidden]{display:none!important}

.sheet-table tr.sheet-line-ready>td,.sheet-compact tr.sheet-line-ready>td{background:#e8f7ee}
.sheet-line-ready .sheet-card-line{box-shadow:inset 4px 0 #78b995}
#shipping-sheet-body:not(.sheet-compact) td.sheet-shared:not(.sheet-cell-editing)>span {
    display: block;
    max-width: 100%;
    max-height: none;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
}
#shipping-sheet-body .sheet-invoice-heading>td>div{flex-wrap:wrap;width:max-content;max-width:calc(100vw - 40px)}
#shipping-sheet-body .sheet-invoice-heading>td>div>*{flex-shrink:0}
#shipping-sheet-body .sheet-accounting-document{white-space:nowrap;flex-wrap:nowrap}
#shipping-sheet-body .sheet-accounting-document input{box-sizing:border-box;width:150px;min-width:150px;max-width:150px;height:24px;min-height:24px}

/* Clearly separate ready products from dispatched products in both views. */
#shipping-sheet-body tr.sheet-line-ready>td{background:#b9edbd!important}
#shipping-sheet-body tr.sheet-line-shipped>td{background:#b4dcff!important}
#shipping-sheet-body tr.sheet-line-ready:hover>td{background:#a5e5aa!important}
#shipping-sheet-body tr.sheet-line-shipped:hover>td{background:#9ccfff!important}
#shipping-sheet-body.sheet-print-picking tr.sheet-print-picked>td{background:#91bff0!important;box-shadow:inset 0 2px #2869ab,inset 0 -2px #2869ab}

.sheet-product .sheet-remove-product { float: right; margin-inline-start: 6px; }

@media (max-width: 600px) {
  .shipping-sheet-content > .sheet-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sheet-toolbar > :is(label, button, a),
  .sheet-toolbar input {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
  .sheet-toolbar > button,
  .sheet-toolbar > .sheet-production-link { white-space: normal; }
}

#shipping-sheet-body .sheet-honest-sign {
 display:inline-flex; flex:none; flex-direction:column; align-items:center; gap:1px;
 color:#29415a; font-size:10px; line-height:1.05; white-space:nowrap;
}
#shipping-sheet-body .sheet-honest-sign img {
 display:block; width:12px; height:12px; object-fit:contain;
}

#shipping-sheet-body .sheet-upd-marked {
 display:inline-flex; align-items:center; gap:2px;
}
#shipping-sheet-body .sheet-upd-fit {
 position:relative; display:inline-block; max-width:150px; min-width:0; font-family:inherit;
}
#shipping-sheet-body .sheet-upd-fit > * {
 font-size:12px; font-family:inherit;
}
#shipping-sheet-body .sheet-upd-fit .sheet-upd-measure {
 display:block; height:24px; visibility:hidden; overflow:hidden; white-space:pre; padding-inline:8px 2px;
}
#shipping-sheet-body .sheet-upd-fit input {
 position:absolute; inset:0; width:100%; min-width:0; padding-inline:7px 1px;
}

#shipping-sheet-body .sheet-honest-sign {
 position:relative;
}
#shipping-sheet-body .sheet-honest-sign:has(.sheet-honest-sign-picker) {
 min-width:24px; min-height:24px; justify-content:center;
}
#shipping-sheet-body .sheet-honest-sign-mode:empty {
 display:none;
}
#shipping-sheet-body .sheet-honest-sign-picker {
 position:absolute; inset:0; width:100%; height:100%; min-width:0; min-height:0;
 margin:0; padding:0; opacity:0; cursor:pointer;
}
#shipping-sheet-body .sheet-honest-sign:focus-within {
 outline:2px solid #3279bf; outline-offset:1px; border-radius:3px;
}

/* Reserve room for the document and marking controls before laying out the date and actions. */
@media (min-width: 651px) {
 #shipping-sheet-body.sheet-compact .sheet-invoice-heading > td > div > .sheet-card-title {
  flex: 1 1 420px;
  max-width: 100%;
 }
}
#shipping-sheet-body.sheet-compact .sheet-card-title > strong { overflow-wrap: anywhere; }

/* Cancellation needs a full row and a usable touch target on phones. */
@media(max-width:650px){
 #shipping-sheet-body.sheet-compact .sheet-card-line:has([data-sheet-cancel-shipment]){grid-template-columns:22px minmax(0,1fr) 46px}
 #shipping-sheet-body.sheet-compact .sheet-line-actions:has([data-sheet-cancel-shipment]){grid-column:2/-1;width:100%;justify-content:flex-end;gap:8px}
 #shipping-sheet-body.sheet-compact [data-sheet-cancel-shipment]{min-height:44px!important;max-width:100%;padding:8px 12px!important;white-space:normal}
}
