:root {
  color-scheme: light;
  --ink: #10243e;
  --muted: #617087;
  --line: #dce5ee;
  --paper: #ffffff;
  --wash: #f3f7fa;
  --navy: #102c50;
  --blue: #1769e0;
  --blue-dark: #0d4fab;
  --cyan: #15b7c8;
  --success-bg: #e8f7f0;
  --success: #177250;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.topbar { height: 86px; display: flex; align-items: center; gap: 34px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-logo { display: block; width: 250px; height: 78px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px 4px 10px 4px; background: linear-gradient(135deg, var(--cyan), #37d3a7); color: #06293f; font-weight: 900; }
.brand-mark.large { width: 54px; height: 54px; margin: 0 auto; font-size: 1.2rem; }
nav { display: flex; align-self: stretch; gap: 8px; }
nav a { display: flex; align-items: center; padding: 0 14px; color: #b9c9da; border-bottom: 3px solid transparent; }
nav a { white-space:nowrap; }
@media(min-width:801px) and (max-width:1250px) { .topbar { gap:12px; padding:0 20px; } .brand-logo { width:190px; } nav a { padding:0 9px; font-size:14px; } }
nav a.active { color: white; border-color: var(--cyan); }
.topbar form { margin-left: auto; }
.link-button { border: 0; background: transparent; color: #c7d4e2; cursor: pointer; }
.shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.dashboard-head-actions { display: flex; align-items: center; gap: 18px; }
.debt-summary { display: grid; gap: 1px; min-width: 205px; padding: 8px 12px; border-left: 3px solid var(--blue); color: var(--muted); font-size: .8rem; line-height: 1.35; }
.debt-summary span { display: flex; justify-content: space-between; gap: 18px; }
.debt-summary span:last-child { margin-top: 2px; color: var(--ink); }
.debt-summary strong { color: var(--ink); white-space: nowrap; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -.045em; }
h2 { margin-bottom: 6px; font-size: 1.2rem; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.primary, .secondary { min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 750; cursor: pointer; }
.primary { background: var(--blue); color: white; box-shadow: 0 7px 18px rgba(23,105,224,.18); }
.primary:hover { background: var(--blue-dark); }
.download-document-button { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.download-document-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary:disabled { opacity: .65; cursor: wait; }
.secondary { border-color: var(--line); background: white; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 20px rgba(31,54,80,.04); }
.stat-card span { color: var(--muted); font-weight: 650; }
.stat-card strong { font-size: 1.75rem; }
.stat-card.selected { border-color: var(--blue); box-shadow: inset 4px 0 var(--blue), 0 5px 20px rgba(31,54,80,.05); }
.stat-card.future-account { border-style: dashed; }
.export-card, .upload-card, .codes-card, .table-card { margin-bottom: 18px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 7px 24px rgba(31,54,80,.045); }
.export-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.export-card p { margin: 0; color: var(--muted); }
.export-card textarea { grid-column: 1 / -1; width: 100%; min-height: 110px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: #243e5a; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.7; }
.table-title { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.table-title h2 { margin: 0; }
.table-controls { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; flex: 1; }
.sort-control { display: grid; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.shipment-sort-controls { display: flex; gap: 6px; align-items: flex-end; }
.sort-direction { width: 38px; height: 44px; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.sort-direction:hover { background: #eef4ff; }
#shipments-table .packing-gray > td { background: #eef0f3; }
#shipments-table .packing-light > td { background: #fff; }
#shipments-table .packing-group-header > td { padding: 10px 12px; font-size: .8rem; font-weight: 700; border-top: 2px solid var(--line); }
#shipments-table .packing-group-header a { color: var(--muted); }
.sort-control select { min-height: 44px; padding: 8px 34px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
input[type="search"], .stack input { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
input[type="search"] { width: min(360px, 100%); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
#shipments-table { table-layout: auto; }
#shipments-table th:first-child, #shipments-table td:first-child { min-width: 190px; width: 20%; }
#shipments-table th:nth-child(4), #shipments-table td:nth-child(4) { width: 34%; }
#shipments-table th:last-child, #shipments-table td:last-child { width: 150px; }
th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 15px 12px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 2px; color: var(--muted); }
.status-pill { display: inline-block; max-width: 420px; padding: 5px 9px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.status-pill.green { background: #e4f7ed; color: #117044; }
.status-pill.blue { background: #e4effb; color: #285a86; }
.status-pill.orange { background: #fff0d2; color: #9a5600; }
.status-pill.tomorrow { border: 1px solid #edae36; background: #ffd98a; color: #713800; box-shadow: 0 2px 7px rgba(174, 101, 0, .14); }
.status-pill.today { border: 1px solid #df8b00; background: #ffc95c; color: #542b00; box-shadow: 0 2px 8px rgba(174, 101, 0, .2); }
.status-pill.red { background: #ffe5e7; color: #a32634; }
.status-pill.purple { background: #f0e6ff; color: #6b34a5; }
.status-pill.neutral { background: #eaf1f8; color: #395a78; }
.status-pill.warning { background: #fff4d6; color: #8a5a00; }
.status-pill.missing { background: #f2f4f7; color: #68768a; }
.received-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.received-toggle input { width: 18px; height: 18px; accent-color: #6b34a5; cursor: pointer; }
.m9915-status { display: grid; justify-items: start; gap: 7px; }
.m9915-status .received-toggle { color: var(--muted); font-size: .78rem; font-weight: 650; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 46px 20px; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 1.1rem; }
.empty.compact { padding: 24px 12px; }
.shipment-code { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.shipment-code strong { white-space: nowrap; }
.image-indicator { color: var(--blue); font-size: 1.2rem; line-height: 1; }
.shipment-code:hover strong { color: var(--blue); }
.shipment-linked .shipment-code strong { color: #137348; }
.shipment-unlinked .shipment-code strong { color: #b52d3b; }
.shared-shipment-label { display: inline-block !important; width: fit-content; margin-bottom: 3px; padding: 3px 7px; border-radius: 999px; background: #dcecff; color: #075bc7 !important; font-weight: 800; }
.chevron { display: inline-block; color: var(--blue); font-size: 1.35rem; line-height: 1; transition: transform .18s ease; }
.shipment-code.expanded .chevron { transform: rotate(90deg); }
.row-actions { display: flex; flex-wrap: nowrap; gap: 7px; min-width: 132px; }
.archive-received { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; color: #6b34a5; font-size: .78rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.archive-received input { width: 17px; height: 17px; accent-color: #6b34a5; }
.action-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; padding: 0; border: 1px solid #cfdbe7; border-radius: 10px; background: white; color: #21425f; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.action-icon:hover { border-color: var(--blue); background: #f1f7ff; color: var(--blue); transform: translateY(-1px); }
.action-icon.copy-button { background: #eaf3ff; color: var(--blue-dark); }
.action-icon.history-price-action { border-color: #f0c66d; background: #fff7df; color: #8a5a00; }
.action-icon.history-price-action.active { border-color: #d99e25; background: #ffeab5; }
.action-icon.history-price-action strong { font-size: .82rem; }
.action-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mini-button { padding: 6px 9px; border: 1px solid #cfdbe7; border-radius: 8px; background: white; color: #21425f; font-size: .78rem; font-weight: 700; cursor: pointer; }
.mini-button:hover { border-color: var(--blue); color: var(--blue); }
.copy-button { background: #eaf3ff; border-color: #c6dcfb; color: var(--blue-dark); }
.detail-row td { padding: 0; background: #f7fafc; }
.inline-detail { padding: 18px 20px 22px 36px; border-bottom: 1px solid var(--line); }
.arrived-history-row td { background: #fffdf8; }
.arrived-history-form { padding: 18px 22px 22px; border: 1px solid #f0d79f; border-width: 1px 0; }
.arrived-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.arrived-history-heading > div { display: grid; gap: 3px; }
.arrived-history-heading small { color: var(--muted); }
.arrived-history-heading .detail-close { border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.arrived-history-fields { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; }
.arrived-history-fields label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.arrived-history-fields input { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font: inherit; }
.arrived-history-groups { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.arrived-history-groups > summary { display: flex; justify-content: space-between; padding: 10px 12px; color: var(--blue-dark); font-size: .82rem; font-weight: 800; cursor: pointer; }
.arrived-history-groups > summary span { color: var(--muted); font-weight: 600; }
.arrived-history-groups > div { display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 130px; padding: 0 12px 12px; overflow: auto; }
.arrived-history-groups label { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.arrived-history-submit { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.shipment-freight-cell small { display: block; color: #137348; font-size: .68rem; font-weight: 700; }
.detail-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.detail-heading span { color: var(--muted); }
.contents-table { min-width: 720px; background: white; border: 1px solid var(--line); }
.contents-table th, .contents-table td { padding: 9px 10px; border: 1px solid var(--line); }
.contents-table tfoot th { background: #edf5ff; color: var(--ink); }
.cz-contents th:nth-child(3), .cz-contents td:nth-child(3) { min-width: 280px; }
.cz-invoice { min-width: 680px; border: 1px solid #6d8092; }
.cz-invoice-title { padding: 18px; background: #fffbd2; font-size: 1.45rem; font-weight: 800; text-align: center; }
.cz-invoice table { table-layout: fixed; }
.cz-invoice th, .cz-invoice td { padding: 13px 14px; border: 1px solid #8293a3; text-align: center; }
.cz-invoice th { background: #e6f8e7; color: var(--ink); font-size: .9rem; letter-spacing: 0; text-transform: none; }
.cz-invoice tr:nth-child(even) td { background: #fffde2; }
.loading { padding: 30px; color: var(--muted); text-align: center; }
.inline-error { padding: 16px; border-radius: 10px; background: #fff0f1; color: #a92736; }
.detail-modal { width: min(960px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 80px rgba(5,24,45,.35); }
.detail-modal::backdrop { background: rgba(6,25,46,.58); backdrop-filter: blur(2px); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: white; }
.modal-head h2 { margin: 0; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf2f7; color: var(--ink); font-size: 1.55rem; cursor: pointer; }
.modal-content { padding: 22px; overflow: auto; }
.source-image-wrap { display: grid; place-items: start center; }
.source-invoice-image { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.invoice-wrap { overflow-x: auto; }
.invoice-language-switch { position: sticky; top: 0; z-index: 1; display: inline-flex; gap: 3px; margin-bottom: 14px; padding: 3px; border-radius: 10px; background: #e8eef5; }
.invoice-language-switch button { padding: 7px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.invoice-language-switch button.active { background: white; color: var(--blue-dark); box-shadow: 0 1px 5px rgba(20,45,70,.14); }
.invoice-table { min-width: 700px; table-layout: fixed; border-collapse: collapse; text-align: center; }
.invoice-table td { padding: 8px; border: 1px solid #607487; }
.invoice-table tr:nth-child(6n+1), .invoice-table tr:nth-child(6n+2) { background: #fffbd2; }
.invoice-table tr:nth-child(6n+3), .invoice-table tr:nth-child(6n+4) { background: #e6f8e7; }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 0 0 22px 28px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 7px; width: 10px; height: 10px; border: 3px solid #6ac48e; border-radius: 50%; background: white; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 20px; bottom: 0; width: 2px; background: #d8e5dc; }
.timeline time { color: #258fc3; font-weight: 750; }
.timeline .status-pill { justify-self: start; border-radius: 10px; white-space: normal; }
.drop-zone { display: grid; place-items: center; padding: 34px 24px; border: 2px dashed #b7c8d9; border-radius: 14px; background: #f8fbfd; cursor: pointer; text-align: center; }
.drop-zone:hover { border-color: var(--blue); background: #f4f8ff; }
.drop-zone.drag-active { border-color: var(--blue); background: #eaf3ff; box-shadow: inset 0 0 0 2px rgba(23,105,224,.12); }
.drop-zone.drag-active .upload-icon { transform: translateY(-3px); background: var(--blue); color: white; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 50%; background: #e2edff; color: var(--blue); font-size: 1.4rem; transition: transform .15s, background .15s, color .15s; }
.file-name { margin-top: 5px; color: var(--muted); }
.document-upload-form .upload-choice { padding: 10px 18px; border-radius: 9px; background: var(--blue); color: white; }
.document-upload-form .upload-hint { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.document-upload-form .files-selected { border-color: #16815e; background: #eefaf5; }
.document-upload-form .files-selected .file-name { color: #086447; font-size: 1rem; font-weight: 700; }
.selected-upload-files { padding: 12px 16px 12px 34px; border: 1px solid #b9ddcf; border-radius: 10px; background: #f5fbf8; max-height: 180px; overflow: auto; overflow-wrap: anywhere; }
.selected-upload-files li { padding: 3px 0; font-size: .85rem; }
.document-upload-status:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; padding: 16px; border: 1px solid #8eb8f6; border-radius: 10px; background: #eaf3ff; color: #1451a0; }
.document-upload-status > span:last-child { flex-basis: 100%; font-size: .85rem; }
.upload-type-warning { margin: 12px 0; padding: 14px; background: #fff4dc; border: 1px solid #e8bd69; border-radius: 10px; font-size: .85rem; color: #7c4a00; }
.upload-type-warning p { margin: 6px 0 10px; }
.upload-type-warning label { display: flex; align-items: flex-start; gap: 8px; }
.upload-type-warning input { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 3px; }
.upload-spinner { width: 20px; height: 20px; border: 3px solid #bdd3f4; border-top-color: #1769e0; border-radius: 50%; animation: upload-spin 1s linear infinite; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upload-spinner { animation: none; } }
.upload-card .primary { width: 100%; margin-top: 12px; }
.compact-upload .drop-zone { padding: 20px; }
.cargo-select { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.cargo-select select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; }
.document-list { display: grid; }
.document-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.quick-draft-panel { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 4px 0 10px; padding: 14px 16px; border: 1px solid #cddfff; border-radius: 12px; background: #f3f7ff; }
.quick-draft-copy { display: grid; gap: 3px; }
.quick-draft-copy span { color: var(--muted); font-size: .86rem; }
.quick-draft-form { display: flex; align-items: end; gap: 9px; }
.quick-draft-form label { display: grid; gap: 4px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.quick-draft-form input { width: 128px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font: inherit; }
.quick-draft-form .primary { min-height: 38px; padding: 7px 13px; white-space: nowrap; }
.select-all, .date-picker { color: var(--muted); font-size: .9rem; font-weight: 650; }
.date-picker { display: grid; gap: 4px; }
.date-picker input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); }
.danger-button { min-height: 40px; padding: 8px 14px; border: 1px solid #d64a58; border-radius: 9px; background: #bd2e3d; color: white; font-weight: 750; cursor: pointer; }
.danger-button:disabled { opacity: .45; cursor: default; }
.document-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 15px 4px; border-bottom: 1px solid #edf1f5; }
.document-row.filtered-out { display: none; }
.document-row.document-received { background: #f0f2f5; border-radius: 10px; }
.document-row.document-partially-received { background: #fff8e9; border-radius: 10px; }
.document-row:last-child { border-bottom: 0; }
.document-link { display: flex; min-width: 0; flex-direction: column; }
.document-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-link span { color: var(--muted); font-size: .9rem; }
.arrival-label { font-size: .8rem; font-weight: 650; }
.repacked-suggestion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.repacked-suggestion ul { margin: 6px 0 0; padding-left: 20px; font-size: .85rem; color: var(--muted); }
.document-link .arrival-label { font-size: .8rem; }
.arrival-label.arrival-expected { color: #285a86; }
.arrival-label.arrival-today { color: #9a5600; }
.arrival-label.arrival-overdue { color: #a32634; }
.arrival-label.arrival-arrived { color: #117044; }
.arrival-label.arrival-unknown { color: var(--muted); font-weight: 400; }
.document-link .arrival-note, .arrival-note { color: var(--muted); font-size: .75rem; margin: 0; }
.document-delivery-card { margin-bottom: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.document-delivery-heading { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.document-delivery-list { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 8px; }
.document-delivery-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px; }
.document-delivery-list code { color: #137348; font-size: .85rem; }
.document-admin-panel { padding: 14px 18px; margin-bottom: 16px; }
.document-admin-panel > summary { cursor: pointer; color: var(--ink); font-weight: 750; }
.document-admin-panel > summary span { margin-left: 12px; color: var(--muted); font-size: .8rem; font-weight: 400; }
.document-admin-panel[open] > summary { margin-bottom: 14px; }
.document-admin-panel .document-tags-card p { margin-bottom: 0; font-size: .85rem; }
.document-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.document-row-actions { display: flex; align-items: center; gap: 5px; }
.document-cost-link, .document-copy-rmb, .document-preview-link { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #bdd8ff; border-radius: 8px; background: #edf5ff; color: #075cc9; font-size: .95rem; font-weight: 800; cursor: pointer; }
.document-preview-link { border-color: #b9dfcf; background: #eef9f4; color: #137348; }
.document-preview-link:hover { background: #dcf2e8; }
.document-cost-link { border-color: #c8d6e6; background: #f4f7fa; color: #173d63; }
.document-cost-link:hover { background: #e8eef5; }
.document-copy-rmb:hover { background: #dfeeff; }
.document-copy-rmb.rmb-copied { border-color: #0b6945; background: #0b6945; color: #fff; }
.document-copy-rmb.rmb-copied:hover { border-color: #085638; background: #085638; }
.document-copy-rmb:disabled { opacity: .6; cursor: wait; }
.document-delete { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: #fff0f1; color: #a92736; font-size: 1.3rem; cursor: pointer; }
.calculation-badge { padding: 5px 9px; border-radius: 999px; font-size: .82rem; font-weight: 750; white-space: nowrap; }
.calculation-draft { background: #fff0d2; color: #8d5500; }
.calculation-final { background: #e3efff; color: #075cc9; }
.confirm-modal { width: min(430px, calc(100% - 28px)); padding: 24px; border: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 24px 80px rgba(5,24,45,.35); }
.confirm-modal::backdrop { background: rgba(6,25,46,.58); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.match-count { padding: 5px 9px; border-radius: 999px; background: #e2edff; color: var(--blue-dark); font-weight: 700; font-size: .85rem; }
.match-count.match-complete { background: #e4f7ed; color: #117044; }
.match-count.match-received { background: #0b6945; color: #fff; box-shadow: inset 0 0 0 1px #085638; }
.match-count.match-arrived { background: #e2edff; color: #075cc9; box-shadow: inset 0 0 0 1px #c4d9fa; }
.match-count.match-partial { background: #fff0d2; color: #9a5600; }
.match-count.match-none { background: #ffe5e7; color: #a32634; }
.document-receipt-toggle { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #bad9cc; border-radius: 8px; background: #f0faf5; color: #125f40; cursor: pointer; }
.document-receipt-toggle input { width: 14px; height: 14px; margin: 0; accent-color: #0b6945; cursor: pointer; }
.document-receipt-toggle span { display: none; }
.document-receipt-toggle:has(input:checked) { border-color: #0b6945; background: #dcf3e8; }
.document-receipt-toggle:has(input:disabled) { opacity: .58; cursor: wait; }
.document-partial-toggle { border-color: #e7c788; background: #fff8e9; color: #8d5500; }
.document-partial-toggle input { accent-color: #ae6b00; }
.document-partial-toggle span { display: none; }
.document-partial-toggle:has(input:checked) { border-color: #ae6b00; background: #ffe5aa; }
.freight-changed { color: #9a5600; background: #fff8e8; font-weight: 700; }
.freight-changed small { display: block; color: #9a5600; font-weight: 600; font-size: .72rem; margin-top: 3px; }
.expected-date { min-width: 112px; white-space: nowrap; }
.expected-overdue { border-radius: 8px; background: #ffe8eb !important; color: #ad2637; font-weight: 800; }
.expected-overdue small { display: block; margin-top: 3px; color: #ad2637; font-size: .68rem; font-weight: 700; }
.code-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.code-cloud code { padding: 7px 10px; border-radius: 7px; background: #edf3f8; color: #23476b; font-size: .9rem; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--blue); font-weight: 700; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 12px 16px; border-radius: 10px; background: var(--navy); color: white; box-shadow: 0 12px 32px rgba(13,35,59,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #a92736; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #174778, var(--navy) 45%, #0a1c30); }
.login-card { width: min(420px, 100%); padding: 34px; border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(0,0,0,.3); text-align: center; }
.login-logo { display: block; width: min(300px, 100%); height: auto; margin: 0 auto 18px; padding: 12px; border-radius: 14px; background: var(--navy); }
.login-card h1 { margin-top: 14px; font-size: 2.1rem; }
.login-card > p { color: var(--muted); }
.stack { display: grid; gap: 14px; text-align: left; }
.stack label { display: grid; gap: 6px; font-weight: 700; }
.stack .primary { margin-top: 5px; }
.alert { padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; }
.alert.error { background: #fff0f1; color: #a92736; }
.alert.notice { background: #eaf3ff; color: #174f91; }
.alert.multiline { white-space: pre-line; }
.manual-match-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1fr) auto; gap: 10px; align-items: start; }
.document-tags-card { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.2fr); gap: 22px; align-items: end; }
.document-tags-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.document-tags-form input { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.document-tags-form .secondary { white-space: nowrap; }
.manual-match-form input, .manual-match-form select { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.manual-group-picker { max-height: 190px; overflow: auto; margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.manual-group-picker legend { padding: 0 5px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.manual-group-picker label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 3px; cursor: pointer; }
.manual-group-picker input { min-height: auto; margin-top: 3px; padding: 0; }
.manual-group-picker span { line-height: 1.25; }
.manual-group-picker small { display: block; color: var(--muted); }
.manual-match-form .primary { width: auto; margin: 0; }
.permission-note { display: grid; gap: 5px; border-style: dashed; }
.manual-candidate-panel { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfd; overflow: hidden; }
.manual-candidate-panel > summary { padding: 12px 14px; color: var(--blue); font-weight: 800; cursor: pointer; }
.manual-candidate-panel > summary span { margin-left: 5px; color: var(--muted); font-weight: 600; }
.manual-candidate-search { width: calc(100% - 24px); margin: 0 12px 10px; }
.manual-candidate-list { max-height: 280px; overflow: auto; border-top: 1px solid var(--line); background: #fff; }
.manual-candidate-list label { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 13px; border-bottom: 1px solid #edf2f7; cursor: pointer; }
.manual-candidate-list label:hover { background: #f1f7ff; }
.manual-candidate-list label[hidden] { display: none; }
.manual-candidate-list input { min-height: auto; margin: 0; padding: 0; }
.manual-candidate-list small { display: block; margin-top: 2px; color: var(--muted); }
.candidate-state { padding: 4px 7px; border-radius: 999px; font-size: .72rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.candidate-state.free { background: #e5f6ed; color: #137348; }
.candidate-state.tolerance { background: #fff0ca; color: #955a00; }
.linked-code-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); }
.linked-code-list code { padding: 5px 8px; border-radius: 7px; background: #e8f7f0; color: #137348; }
.linked-code-list a:hover code, .shipment-document-link:hover { color: var(--blue); text-decoration: underline; }
.document-link-action { background: #e8f7f0; color: #137348; border-color: #bfe4d2; }
.match-conflict { margin: 12px 0; padding: 14px; border: 1px solid #efc56c; border-radius: 10px; background: #fff8e8; }
.match-conflict p, .match-conflict ul { margin-bottom: 10px; }
.match-conflict a { color: var(--blue); }
.confirm-multiple-form { display: flex; justify-content: flex-end; gap: 10px; }
.shipment-document-list { display: grid; gap: 10px; }
.shipment-document-list a { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.shipment-document-list a:hover { border-color: var(--blue); background: #f1f7ff; }
.shipment-document-list svg { width: 26px; height: 26px; fill: none; stroke: #137348; stroke-width: 1.8; }
.shipment-document-list small { display: block; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.joint-card { margin: 0 0 18px; padding: 22px; border: 1px solid #9bc4ff; border-radius: 16px; background: #f1f7ff; }
.joint-card h2 { margin: 3px 0 16px; }
.joint-shipment { padding-top: 14px; border-top: 1px solid #cfe1f8; }
.joint-shipment > span { display: block; margin-top: 3px; color: var(--muted); }
.joint-documents { display: grid; gap: 8px; margin-top: 12px; }
.joint-documents a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.joint-documents a.current { border-color: var(--blue); background: #eef6ff; }
.joint-documents small { color: var(--muted); white-space: nowrap; }
.weight-warning { display: block; margin-top: 10px; color: #9a5a00; }
.cost-head { align-items: flex-end; }
.cost-form { display: grid; gap: 18px; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.cost-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.cost-grid input, .cost-grid select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.cost-grid input:focus { outline: 2px solid #9bc4ff; border-color: var(--blue); }
.shipment-cost-list { display: grid; gap: 8px; }
.shipment-cost-card { border: 1px solid var(--line); border-radius: 11px; background: #fbfdff; overflow: hidden; }
.shipment-cost-card.shared { border-color: #9bc4ff; background: #f4f8ff; }
.shipment-cost-card > summary { display: grid; grid-template-columns: minmax(250px, 1fr) auto 18px; align-items: center; gap: 18px; padding: 13px 15px; cursor: pointer; list-style: none; font-size: 14px; line-height: 1.35; }
.shipment-cost-card > summary::-webkit-details-marker { display: none; }
.shipment-cost-card > summary::marker { content: ""; }
.shipment-cost-card > summary::after { content: "›"; color: var(--blue); font-size: 1.45rem; font-weight: 800; line-height: 1; transition: transform .15s ease; }
.shipment-cost-card[open] > summary::after { transform: rotate(90deg); }
.shipment-summary-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.shipment-summary-copy > strong { color: var(--text); font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.shipment-summary-facts { color: var(--muted); font-size: 14px; white-space: nowrap; }
.shipment-summary-facts i { padding: 0 3px; font-style: normal; color: #9aaac0; }
.shipment-summary-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.shipment-summary-meta strong { color: var(--text); font-size: inherit; }
.shipment-summary-meta .shared-badge { padding: 5px 9px; font-size: 12px; line-height: 1.2; }
.allocation-line { color: var(--muted); }
.shipment-cost-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.shipment-cost-body .allocation-line { margin: 11px 0; }
.allocation-details { margin: 8px 0 12px; }
.allocation-details > summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.shared-badge { padding: 5px 9px; border-radius: 999px; background: #dcecff; color: #075bc7 !important; font-size: 12px; font-weight: 800; }
.rate-badge { padding: 5px 9px; border-radius: 999px; background: #e8f7f0; color: #137348; font-size: 12px; }
.shipment-fields { margin-top: 15px; }
.shipment-fields label small { font-weight: 500; }
.shipment-groups-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.group-checkbox-list { display: grid; gap: 6px; max-height: 154px; overflow: auto; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.group-checkbox-list label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 500; }
.group-checkbox-list input { width: 16px; min-height: 16px; margin: 0; padding: 0; }
.cost-actions { display: flex; justify-content: flex-end; gap: 12px; }
.moscow-delivery-section { margin-bottom: 18px; }
.moscow-delivery-list { display: grid; gap: 10px; }
.moscow-delivery-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfe; }
.moscow-delivery-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; cursor: pointer; list-style: none; }
.moscow-delivery-card > summary::-webkit-details-marker { display: none; }
.moscow-delivery-card > summary span { display: grid; gap: 2px; }
.moscow-delivery-card > summary small { color: var(--muted); font-weight: 500; }
.moscow-delivery-card.create > summary { color: var(--blue); }
.moscow-delivery-form { display: grid; gap: 12px; padding: 14px 15px; border-top: 1px solid var(--line); background: white; }
.moscow-delivery-fields { display: grid; grid-template-columns: minmax(220px, 1fr) 180px; gap: 12px; }
.moscow-delivery-fields label, .moscow-member-search { display: grid; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.moscow-delivery-fields input, .moscow-member-search input { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font: inherit; }
.moscow-member-list { display: grid; max-height: 250px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.moscow-member-list > label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px 11px; border-bottom: 1px solid #edf1f5; cursor: pointer; }
.moscow-member-list > label:last-child { border-bottom: 0; }
.moscow-member-list > label.filtered-out { display: none !important; }
.moscow-member-list > label:has(input:checked) { background: #edf5ff; }
.moscow-member-list span { display: grid; min-width: 0; gap: 1px; }
.moscow-member-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.moscow-member-empty { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fff6e6; color: #8d5500; font-size: .86rem; }
.moscow-delivery-actions { display: flex; justify-content: flex-end; gap: 9px; }
.moscow-allocation-preview { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 15px 14px; }
.moscow-allocation-preview span { padding: 6px 8px; border-radius: 8px; background: #eaf3ff; color: #174f91; font-size: .82rem; }
.warning-alert { border-color: #efc36d; background: #fff7e6; color: #7a4800; }
.reconcile-grid { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 12px; }
.reconcile-grid > div { display: grid; gap: 5px; padding: 16px; border-radius: 12px; background: #f4f8fb; }
.reconcile-grid span { color: var(--muted); font-size: 13px; }
.reconcile-grid .bad { background: #fff0f1; color: #b52d3b; }
.cost-table td:nth-child(n+3), .cost-table th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.cost-table tfoot { background: #eef5fb; }
.version-list { display: grid; gap: 8px; margin-top: 12px; color: var(--muted); }
.group-create-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px; }
.catalog-sync-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 15px; padding: 11px 13px; border-radius: 10px; background: #eef6ff; color: #36536f; font-size: .86rem; }
.catalog-sync-status small { color: var(--muted); }
.catalog-sync-status.has-error { background: #fff1f2; color: #9e2f3a; }
.group-create-form input, .group-chip input, .group-search, .assignment-form select { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.group-chip-list { display: grid; gap: 8px; margin-top: 16px; }
.group-directory-details { margin-top: 14px; }
.group-directory-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7faff; color: var(--blue); font-weight: 800; cursor: pointer; }
.group-directory-details > summary span { padding: 3px 9px; border-radius: 999px; background: #dcecff; color: #075bc7; font-size: .78rem; }
.group-directory-details[open] > summary { border-color: #9bc4ff; }
.group-chip { display: grid; grid-template-columns: minmax(220px, 1fr) auto 38px; gap: 8px; }
.group-delete { border: 0; border-radius: 9px; background: #fff0f1; color: #a92736; font-size: 1.35rem; cursor: pointer; }
.delivery-analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.delivery-analysis-card { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfd; }
.delivery-analysis-card h3 { margin: 0 0 4px; }
.analytics-fallback-label { display: inline-flex; margin: 5px 0 8px; padding: 4px 8px; border-radius: 999px; background: #fff1cf; color: #815500; font-size: .72rem; font-weight: 800; }
.delivery-analysis-card > p { margin-bottom: 14px; color: var(--muted); }
.rate-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rate-stat span, .rate-range { color: var(--muted); }
.rate-stat strong { font-size: 1.35rem; }
.rate-range { display: flex; justify-content: space-between; gap: 12px; margin: 5px 0 12px; font-size: .87rem; }
.delivery-analysis-card details summary { color: var(--blue); font-weight: 700; cursor: pointer; }
.group-analytics-link { display: inline-flex; margin-top: 13px; color: var(--blue); font-size: .82rem; font-weight: 800; text-decoration: none; }
.group-analytics-link:hover { text-decoration: underline; }
.analysis-shipment-list { display: grid; gap: 7px; margin-top: 10px; }
.analysis-shipment-list span { display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 8px; background: #fff; }
.analysis-shipment-list small { color: var(--muted); }
.analysis-shipment-list b > small { display: block; margin-top: 2px; font-size: .68rem; font-weight: 500; }
.history-create-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.history-create-form > label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.history-create-form input, .history-create-form select { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.history-create-form fieldset { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.history-create-form legend { padding: 0 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.history-group-list { display: flex; flex-wrap: wrap; gap: 7px 14px; max-height: 145px; overflow: auto; }
.history-group-list label { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.history-create-form > button { justify-self: start; }
.history-list-details { margin-top: 18px; }
.history-list-details > summary { display: flex; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f7faff; color: var(--blue); font-weight: 800; cursor: pointer; }
.history-list-details > summary span { padding: 2px 8px; border-radius: 999px; background: #dcecff; }
.history-list-details table small { display: block; color: var(--muted); }
.analytics-detail-head { align-items: end; }
.analytics-group-switcher { display: grid; gap: 6px; min-width: min(360px, 100%); color: var(--muted); font-size: .78rem; font-weight: 800; }
.analytics-group-switcher select { min-height: 45px; padding: 8px 38px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: .95rem; }
.analytics-period-card { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 16px 20px; }
.analytics-periods { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-periods a { padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); font-weight: 750; text-decoration: none; }
.analytics-periods a.active { border-color: var(--blue); background: #eaf3ff; color: var(--blue-dark); }
.analytics-custom-period { display: flex; align-items: end; gap: 8px; }
.analytics-custom-period label { display: grid; gap: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.analytics-custom-period input { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.analytics-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.analytics-summary-grid article { display: grid; gap: 7px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.analytics-summary-grid span { color: var(--muted); font-size: .8rem; }
.analytics-summary-grid strong { color: var(--ink); font-size: 1.3rem; }
.analytics-chart-card { overflow: hidden; }
.delivery-chart { width: 100%; overflow-x: auto; }
.delivery-chart svg { display: block; width: 100%; min-width: 700px; height: auto; }
.chart-grid-line { stroke: #dce5ee; stroke-width: 1; }
.chart-axis-label, .chart-date-label { fill: #657890; font-size: 13px; }
.chart-rate-area { fill: none; stroke: #9fc8ff; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; opacity: .18; }
.chart-rate-line { fill: none; stroke: #1473e6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-rate-point { fill: white; stroke: #1473e6; stroke-width: 4; cursor: help; }
.group-search { width: min(360px, 100%); }
.group-assignment-controls { display: flex; align-items: end; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.group-assignment-controls .sort-control { min-width: 220px; }
.unassigned-filter { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 11px; border: 1px solid #efbf67; border-radius: 9px; background: #fff8e8; color: #7d5100; font-size: .8rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.unassigned-filter input { width: 17px; height: 17px; accent-color: #dc8d00; }
.unassigned-filter span { min-width: 23px; padding: 2px 6px; border-radius: 999px; background: #ffe3aa; text-align: center; }
.group-shipments-table td:first-child small { display: block; color: #137348; }
.group-shipments-table td:first-child small.shipment-awaiting { color: #9a5600; }
.group-shipments-table .shipment-unassigned-row td { background: #fff9ed; }
.group-shipments-table .shipment-unassigned-row td:first-child { box-shadow: inset 4px 0 #e8a225; }
.group-shipments-table .shipment-unassigned-row .assignment-picker > summary { border-color: #e8b653; background: #fffdf7; color: #8a5a00; font-weight: 750; }
.group-shipments-table tbody { position: relative; }
.group-shipments-table-wrap { max-height: 720px; overflow: auto; }
.group-shipments-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
.assignment-form { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 5px 8px; min-width: 390px; }
.assignment-form.is-auto .assignment-submit { display: none; }
.assignment-picker { position: relative; }
.assignment-picker > summary { min-height: 42px; padding: 10px 34px 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; list-style-position: outside; }
.assignment-picker > div { display: grid; gap: 7px; max-height: 230px; overflow: auto; margin-top: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.assignment-picker label { display: flex; align-items: center; gap: 8px; font-size: .84rem; }
.assignment-picker input { width: 16px; height: 16px; margin: 0; }
.assignment-source { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; }
.assignment-source.save-error { color: #b42336; }
@media (max-width: 760px) {
  .page-actions, .cost-actions { width: 100%; justify-content: stretch; }
  .page-actions a, .page-actions button, .cost-actions button { flex: 1; text-align: center; }
  .reconcile-grid { grid-template-columns: 1fr; }
  .shipment-cost-card header, .joint-documents a { flex-direction: column; }
  .shipment-cost-card > summary { grid-template-columns: 1fr 18px; gap: 10px; }
  .shipment-summary-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
  .shipment-summary-meta { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .shipment-cost-card > summary::after { grid-column: 2; grid-row: 1; }
  .group-create-form, .group-chip { grid-template-columns: 1fr; }
  .history-create-form, .arrived-history-fields { grid-template-columns: 1fr; }
  .group-assignment-controls { align-items: stretch; flex-direction: column; }
  .group-delete { width: 100%; }
  .assignment-form { min-width: 260px; }
}
.packing-code { margin: 0 0 2px 20px !important; color: #58708a !important; font-size: .68rem !important; font-weight: 750; line-height: 1.1; white-space: nowrap; }
.review-card { display: grid; grid-template-columns: minmax(360px, 1.15fr) minmax(340px, .85fr); gap: 22px; margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.review-image { max-height: 760px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #f6f8fb; }
.review-image img { display: block; width: 100%; height: auto; }
.review-form { display: grid; align-content: start; gap: 14px; }
.review-form label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.review-form input { min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-warning { color: #9a5600 !important; font-weight: 700; }
.received-history { display: grid; gap: 14px; margin: 22px 0 40px; }
.received-day { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.received-day > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; cursor: pointer; list-style: none; }
.received-day > summary::-webkit-details-marker { display: none; }
.received-day > summary::after { content: "›"; margin-left: 6px; color: var(--blue); font-size: 1.8rem; font-weight: 700; transform: rotate(90deg); transition: transform .15s ease; }
.received-day:not([open]) > summary::after { transform: rotate(0); }
.received-day-title { display: flex; align-items: baseline; gap: 12px; }
.received-day-title strong { font-size: 1.25rem; }
.received-day-title small, .received-day-cargo-count { color: var(--muted); font-size: .9rem; font-weight: 650; }
.received-day-cargo-count { margin-left: auto; }
.received-groups { display: grid; gap: 14px; padding: 0 20px 20px; border-top: 1px solid var(--line); }
.received-group { margin-top: 16px; padding: 18px; border: 1px solid #dfe8f1; border-radius: 13px; background: #f8fbfd; }
.received-group-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.received-group-head h2 { margin: 0 0 5px; font-size: 1.15rem; }
.received-group-head p { margin: 0; color: var(--muted); }
.received-group-head p strong { color: var(--ink); }
.received-copy { flex: 0 0 auto; }
.received-shipment-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.received-shipment-list span { padding: 8px 10px; border: 1px solid #d8e4ef; border-radius: 8px; background: #fff; color: var(--ink); }
.received-shipment-list small { color: var(--muted); font-size: inherit; }

@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px 0; }
  .brand-logo { width: 205px; height: 68px; }
  .topbar nav { order: 3; width: 100%; height: 46px; overflow-x: auto; }
  .topbar nav a { padding: 0 9px; }
  .shell { width: min(100% - 22px, 1240px); padding-top: 24px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .dashboard-head-actions { align-items: stretch; flex-direction: column; }
  .debt-summary { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .export-card { grid-template-columns: 1fr; }
  .export-card textarea { grid-column: 1; }
  .table-title { align-items: stretch; flex-direction: column; }
  .table-controls { align-items: stretch; flex-direction: column; }
  input[type="search"] { width: 100%; }
  .table-card { padding: 16px 12px; }
  .status-pill { white-space: normal; }
  .row-actions { min-width: 132px; }
  .document-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .document-badges { grid-column: 2 / -1; justify-content: flex-start; }
  .document-badges > :not(.document-receipt-toggle) { display: none; }
  .quick-draft-panel, .quick-draft-form { align-items: stretch; flex-direction: column; }
  .quick-draft-form input { width: 100%; }
  .inline-detail { padding: 14px 10px; }
  .modal-content { padding: 14px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .manual-match-form { grid-template-columns: 1fr; }
  .document-tags-card, .document-tags-form { grid-template-columns: 1fr; }
  .review-card, .review-grid { grid-template-columns: 1fr; }
  .received-day > summary { padding: 16px; }
  .received-day-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .received-groups { padding: 0 12px 12px; }
  .received-group { padding: 14px; }
  .moscow-delivery-fields { grid-template-columns: 1fr; }
  .moscow-delivery-actions { align-items: stretch; flex-direction: column-reverse; }
  .received-group-head { align-items: stretch; flex-direction: column; }
  .received-copy { width: 100%; }
  .analytics-period-card, .analytics-custom-period { align-items: stretch; flex-direction: column; }
  .analytics-summary-grid { grid-template-columns: 1fr 1fr; }
}

.packing-preview-modal { width: min(1180px, calc(100% - 28px)); }
.packing-preview-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 13px 15px; border-radius: 11px; background: #f2f7fb; }
.packing-preview-summary > div { display: grid; gap: 2px; }
.packing-preview-summary span { color: var(--muted); font-size: .84rem; }
.preview-price-mode { padding: 5px 9px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.preview-price-mode.is-final { background: #e3efff; color: #075cc9; }
.preview-price-mode.is-draft { background: #fff0d2; color: #8d5500; }
.preview-price-mode.is-source { background: #edf2f7; color: #51647a; }
.packing-preview-list { display: grid; gap: 10px; }
.packing-preview-item { display: grid; grid-template-columns: 204px minmax(220px, 1fr) minmax(130px, .35fr) minmax(175px, .42fr); align-items: center; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.packing-preview-images { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.packing-preview-images img, .packing-preview-placeholder { display: grid; place-items: center; width: 96px; height: 96px; border: 1px solid #e1e8ef; border-radius: 9px; background: #f5f7f9; object-fit: contain; }
.packing-preview-placeholder { color: #8997a7; font-size: .72rem; }
.packing-preview-images small { position: absolute; left: 5px; bottom: 5px; padding: 2px 5px; border-radius: 5px; background: rgba(16,44,80,.82); color: #fff; font-size: .62rem; }
.packing-preview-product { display: grid; gap: 4px; min-width: 0; }
.packing-preview-product > strong { line-height: 1.3; }
.packing-preview-product > span { color: var(--muted); font-size: .82rem; }
.packing-preview-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.packing-preview-tags span { padding: 3px 6px; border-radius: 6px; background: #edf3f8; color: #425d78; font-size: .69rem; }
.packing-preview-amounts { display: grid; gap: 6px; margin: 0; }
.packing-preview-amounts div { display: flex; justify-content: space-between; gap: 10px; }
.packing-preview-amounts dt { color: var(--muted); font-size: .75rem; }
.packing-preview-amounts dd { margin: 0; font-weight: 750; white-space: nowrap; }
.packing-preview-price { display: grid; justify-items: end; gap: 2px; text-align: right; }
.packing-preview-price > span { color: #8d5500; font-size: .7rem; font-weight: 800; }
.packing-preview-price.is-rub > span { color: #075cc9; }
.packing-preview-price strong { font-size: 1.15rem; white-space: nowrap; }
.packing-preview-price strong small { margin-left: 2px; color: var(--muted); font-size: .65rem; font-weight: 600; }
.packing-preview-price em { color: var(--muted); font-size: .76rem; font-style: normal; }
.packing-preview-price .price-missing { color: #9a3844; font-size: .9rem; }
.packing-preview-price .price-included { color: #137348; font-size: .9rem; white-space: normal; }
.table-note { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 500; white-space: nowrap; }
.packing-preview-total { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 12px; padding: 14px 16px; border-radius: 11px; background: #eaf3ff; color: #123b6c; }
.packing-preview-total.has-breakdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; background: transparent; padding: 0; }
.packing-preview-total > div { display: grid; gap: 4px; padding: 13px 14px; border-radius: 11px; background: #f2f7fb; }
.packing-preview-total > div.is-total { background: #eaf3ff; }
.packing-preview-total span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.packing-preview-total strong { font-size: 1.1rem; white-space: nowrap; }
.packing-preview-total .is-total strong { font-size: 1.25rem; }

@media (max-width: 760px) {
  .packing-preview-summary { align-items: flex-start; flex-direction: column; }
  .packing-preview-item { grid-template-columns: 1fr 1fr; }
  .packing-preview-images { grid-column: 1 / -1; justify-content: start; grid-template-columns: 96px 96px; }
  .packing-preview-product { grid-column: 1 / -1; }
  .packing-preview-price { justify-items: start; text-align: left; }
  .packing-preview-total, .packing-preview-total.has-breakdown { display: grid; grid-template-columns: 1fr; gap: 6px; }
}
/* Expected product arrivals and whole-shipment admin receipt. */
.line-rate-list { display:grid; gap:10px; }
.line-rate-list label { display:flex; gap:20px; align-items:center; justify-content:space-between; padding:10px; background:#f5f8fc; border-radius:8px; }
.line-rate-list small { display:block; margin-top:5px; color:#61748f; }
.line-rate-list input { width:180px; flex-shrink:0; }
.expected-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; }
.expected-filters label { display:grid; gap:6px; flex:1 1 170px; font-size:13px; }
.expected-filters label:first-child { flex:2 1 260px; }
.expected-filters input, .expected-filters select { width:100%; }
.expected-product-head { display:flex; align-items:center; gap:20px; }
.expected-images { display:flex; gap:8px; flex-shrink:0; }
.expected-images > div { width:88px; height:88px; border:1px solid #dce5ef; border-radius:10px; display:grid; place-items:center; background:#f6f8fb; overflow:hidden; }
.expected-images img { width:100%; height:100%; object-fit:contain; background:white; }
.expected-images span { font-size:12px; color:#7d8fa8; }
.expected-product-copy { flex:1; min-width:0; }
.expected-product-copy h2 { font-size:17px; overflow-wrap:anywhere; }
.expected-product-copy p { margin:5px 0; }
.expected-product-total { display:grid; gap:5px; max-width:240px; font-size:13px; }
.expected-product-total strong { font-size:21px; }
.expected-product-total small { color:#a36a09; }
.expected-tags { display:flex; flex-wrap:wrap; gap:5px; }
.expected-tags a { background:#edf4fd; padding:3px 7px; border-radius:6px; font-size:12px; }
.expected-supplies { margin-top:16px; border-top:1px solid #e2e9f2; padding-top:12px; }
.expected-supplies summary { cursor:pointer; font-weight:600; color:#1765ae; }
.expected-supply { display:grid; grid-template-columns:130px 220px 1fr 1.4fr; gap:16px; padding:14px 0; border-bottom:1px solid #edf1f5; align-items:start; font-size:13px; overflow-wrap:anywhere; }
.expected-supply small { display:block; color:#72839b; margin-top:5px; }
.expected-overdue { color:#b54726; }
.shipment-receipt-option { display:flex; align-items:start; gap:12px; padding:14px; background:#f3f6fa; border-radius:10px; margin:10px 0; }
.shipment-receipt-option input { width:16px; height:16px; flex-shrink:0; margin-top:3px; }
.shipment-receipt-option small { display:block; font-size:12px; margin-top:5px; color:#61748f; }
@media(max-width:800px) { .expected-product-head { flex-wrap:wrap; gap:12px; } .expected-product-total { max-width:none; } .expected-supply { grid-template-columns:1fr 1fr; } .expected-images > div { width:66px; height:66px; } }
