:root { font: 13px/1.45 Arial, sans-serif; color: #303030; background: #f4f6f9; --red: #b40000; --border: #c5c5c5; --subtle: #f8f8f8; --selected: #fbeded; --taskbar-height: 56px; --desktop-launcher-height: 81px; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; min-height: 36px; background: white; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button[aria-pressed="true"] { color: #801818; border-color: #d6abab; background: #fbeded; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 24px; min-height: 58px; background: white; border-bottom: 1px solid var(--border); }
header img { width: 48px; height: 38px; object-fit: contain; }
header img, .login img { filter: brightness(1.05); mix-blend-mode: multiply; }
.flutter-header { height: 62px; min-height: 62px; flex-wrap: nowrap; gap: 8px; padding: 0 28px 0 18px; }
.brand { flex: 0 0 64px; height: 42px; display: flex; align-items: center; gap: 0; cursor: default; overflow: hidden; }
.brand img { width: 58px; height: 40px; flex: 0 0 58px; object-fit: contain; }
.site-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 68px; min-height: 36px; padding: 5px 8px; color: #303030; border: 1px solid var(--border); border-radius: 7px; background: white; font-weight: 600; text-decoration: none; }
.site-link:hover { border-color: #9da5b0; background: #f7f8fa; text-decoration: none; }
.login-download:hover { text-decoration: underline; }
.login-download { color: #801818; text-align: center; }
.header-navigation { position: relative; z-index: 10; display: flex; flex: 1 1 auto; align-items: center; gap: 4px; min-width: 0; overflow: visible; }
.header-navigation > .responsive-nav-menu { display: flex; flex: 1 1 auto; min-width: 0; }
.responsive-nav-menu > .header-navigation-items { display: flex; flex: 1 1 auto; align-items: center; gap: 4px; min-width: 0; }
.responsive-nav-menu > .responsive-nav-summary { display: none; }
.header-navigation::-webkit-scrollbar { display: none; }
.header-navigation details { position: relative; z-index: 0; flex: 0 0 auto; }
.header-navigation details[open] { z-index: 30; }
.header-navigation summary { list-style: none; display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; color: #303030; font-weight: 700; white-space: nowrap; }
.header-navigation .header-menu-single { display: flex; align-items: center; gap: 5px; height: 38px; min-height: 38px; padding: 0 9px; border-color: transparent; border-radius: 7px; background: transparent; color: #303030; font-weight: 700; white-space: nowrap; }
.header-navigation .header-menu-single[aria-pressed="true"] { color: var(--red); border-color: #d6abab; background: var(--selected); }
.header-navigation .header-menu-single:hover:not(:disabled):not([aria-pressed="true"]) { border-color: #e1e5ec; background: #f7f8fa; }
.header-menu-entry { display: flex; align-items: center; gap: 3px; min-width: 0; }
.header-menu-entry-single { flex: 0 0 auto; height: 38px; }
.header-menu-pin { display: inline-grid; flex: 0 0 28px; place-items: center; width: 28px; min-width: 28px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; border-radius: 6px; background: transparent; color: #778395; font: 18px/1 Arial, sans-serif; }
.header-menu-pin:hover { border-color: #e1e5ec; background: #f7f8fa; color: #a80000; }
.header-menu-pin[aria-pressed="true"] { color: #a80000; border-color: #e6caca; background: #fff4f4; }
.header-navigation .menu-items .header-menu-entry { min-height: 38px; padding: 2px 3px; }
.header-navigation .menu-items .header-menu-choice { flex: 1 1 auto; min-width: 0; height: 32px; min-height: 32px; padding: 4px 8px; border-color: transparent; border-radius: 6px; background: transparent; text-align: left; white-space: nowrap; }
.header-navigation .menu-items .header-menu-choice:hover { background: #f7f8fa; }
.header-navigation .menu-items .header-menu-choice[aria-pressed="true"] { color: var(--red); background: var(--selected); }
.header-navigation summary::-webkit-details-marker { display: none; }
.header-navigation summary i { font-style: normal; font-size: 15px; line-height: 1; }
.header-nav-icon { display: inline-grid; place-items: center; width: 18px; font-family: "Segoe UI Emoji", sans-serif; font-size: 15px; line-height: 1; }
.header-navigation details[open] .header-nav-icon { color: var(--red); }
.header-navigation details[open] summary, .header-navigation details:has(.header-menu-choice[aria-pressed="true"]) summary { color: var(--red); border-color: #d6abab; background: var(--selected); }
.header-navigation .menu-items { top: 37px; z-index: 40; min-width: 215px; border-radius: 9px; box-shadow: 0 8px 20px #1018282b; }
.header-navigation .menu-items button { height: 42px; min-height: 42px; font-weight: 600; }
.header-directions { flex-wrap: nowrap; gap: 3px; }
.header-directions button { min-height: 36px; padding: 5px 8px; font-size: 12px; white-space: nowrap; border: 1px solid var(--border); border-radius: 7px; background: white; }
.header-directions button[aria-pressed="true"] { color: #801818; border-color: #d6abab; background: var(--selected); box-shadow: inset 0 -2px var(--red); font-weight: 700; }
.header-directions button:hover:not(:disabled):not([aria-pressed="true"]) { border-color: #9da5b0; background: #f7f8fa; }
.workspace { display: grid; flex: 0 0 182px; gap: 1px; color: #686868; font-size: 10px; line-height: 1; }
.workspace select { height: 32px; min-height: 32px; padding: 3px 8px; color: #303030; font-size: 12px; }
.header-icon { flex: 0 0 36px; min-height: 36px; padding: 0; border-color: transparent; background: transparent; font-size: 19px; }
.profile-action { flex: 0 0 auto; min-height: 36px; padding: 5px 9px; border-color: transparent; background: transparent; font-weight: 600; white-space: nowrap; }
.connection-state { flex: 0 0 auto; width: 16px; color: #258c4a; font-size: 16px; text-align: center; cursor: help; }
.connection-state[data-state="offline"] { color: #b45d22; }
.outbox-panel { margin-bottom: 12px; }
.outbox-panel summary { padding: 10px 12px; cursor: pointer; font-weight: 600; }
.outbox-panel > button { margin: 8px 12px; }
.staged-batch-grid { min-width: 880px; }
.section { font-weight: 700; }
.directions, .toolbar, .workspace { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.workspace { margin-left: auto; }
.top-menu { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 14px; background: white; border-bottom: 1px solid var(--border); }
.top-menu details { position: relative; }
.top-menu summary { cursor: pointer; padding: 6px 10px; border-radius: 5px; }
.top-menu details[open] summary { color: #801818; background: #fbeded; }
.menu-items { position: absolute; inset-inline-start: 0; z-index: 2; min-width: 195px; padding: 4px; display: grid; background: white; border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 4px 12px #0002; }
.menu-items button { border: 0; text-align: left; white-space: nowrap; }
.menu-items button:hover { background: #fbeded; }
.column-sort { border: 0; padding: 0; background: transparent; font-weight: 600; }
.desktop { padding: 24px 28px 42px; max-width: none; margin: 0 auto; }
.desktop.desktop-with-taskbar { padding-bottom: calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px) + 18px); }
.desktop:has(.desktop-home) { min-height: calc(100dvh - var(--taskbar-height)); padding: 0; background: #eef1f5; }
html:has(.window-taskbar) { scroll-padding-bottom: calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px) + 8px); }
.window { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.window-title { padding: 9px 12px; border-bottom: 1px solid var(--border); background: #f1f1f1; }
.toolbar, .hint, .error { margin: 0; padding: 10px 12px; }
.toolbar label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.receipt-register-toolbar :is(input, button) { min-height: 32px; height: 32px; padding-block: 4px; }
.error { color: #8f2944; background: #fff0f4; }
.realtime-notice { margin: 0 0 10px; padding: 9px 12px; color: #6d5217; border: 1px solid #e1cf91; border-radius: 8px; background: #fff9df; }
.receipt-comparison { margin-top: 12px; }
.receipt-comparison-MATCH { color: #16794c; }
.receipt-comparison-UNDER { color: #8a5800; }
.receipt-comparison-OVER, .receipt-comparison-EXTRA { color: #b42318; }
.dispatch-comment { white-space: pre-wrap; overflow-wrap: anywhere; }
.shipment-comment-field { display: block; width: 100%; height: 36px; min-height: 36px; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: #f0f0f0; color: #303030; font: inherit; }
.receipt-comment-field:not(:disabled) { background: #fff; }
.shipment-comment-field::placeholder { color: #606060; opacity: 1; }
.comment-placeholder-field { width: 100%; }
.comment-placeholder-field::placeholder { color: #606060; opacity: 1; }
.payroll-calendar table { min-width: 420px; table-layout: fixed; }
.payroll-calendar td { padding: 0; text-align: center; }
.payroll-calendar td button { display: grid; place-content: center; gap: 2px; width: 100%; min-height: 44px; padding: 4px; border: 0; background: transparent; }
.payroll-calendar td[data-attendance="present"] { background: #e6f6e9; }
.payroll-calendar td[data-attendance="absent"] { background: #feeae8; }
.payroll-calendar td.selected { box-shadow: inset 0 0 0 2px #50678a; }
.payroll-calendar small { font-size: 10px; }
.payroll-progress { height: 3px; margin: 0 0 6px; }
.payroll-progress.is-loading { background: #cbdcee; }
.payroll-employee-layout { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); align-items: start; gap: 8px; }
.payroll-employee-count { margin-inline-end: auto; }
.payroll-employee-card .detail-body { min-width: 0; }
.payroll-card-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 8px; margin: 0; }
.payroll-card-fields > div, .payroll-totals dl > div { min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.payroll-card-fields dt, .payroll-totals dt { font-size: 11px; color: #59677a; }
.payroll-card-fields dd, .payroll-totals dd { margin: 2px 0 0; font-weight: 600; }
.payroll-card-fields dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-employee-card .payroll-card-actions { padding-inline: 0; }
.payroll-empty-card { display: grid; place-items: center; min-height: 96px; margin: 0; color: #59677a; }
.payroll-attendance { margin-top: 8px; }
.payroll-attendance-heading, .payroll-calendar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.payroll-calendar-controls { margin-inline-start: auto; }
.payroll-calendar-key { display: flex; gap: 12px; padding: 6px 10px 0; }
.payroll-calendar-key [data-attendance]::before { display: inline-block; width: 9px; height: 9px; margin-inline-end: 4px; border-radius: 50%; content: ""; }
.payroll-calendar-key [data-attendance="present"]::before { background: #49a86a; }
.payroll-calendar-key [data-attendance="absent"]::before { background: #c64a47; }
.payroll-calendar .payroll-offday:not([data-attendance="present"]):not([data-attendance="absent"]), .payroll-calendar .payroll-blank-day { background: #f3f5f8; }
.application .payroll-workspace .payroll-calendar tbody td { height: 59px !important; min-height: 59px !important; max-height: none !important; }
.application .payroll-workspace .payroll-calendar td button { height: 58px !important; min-height: 58px !important; max-height: none !important; }
.payroll-day-note { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payroll-totals dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 6px; margin: 8px 0 0; text-align: right; }
.payroll-totals dl > .payroll-payable { background: var(--selected); color: var(--red); }
.payroll-payment-history { margin-top: 8px; }
.payroll-action-dialog { width: min(740px, 100%); }
.payroll-action-dialog .receipt-fields.reference-fields { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
@media (max-width: 1050px) { .payroll-employee-layout { grid-template-columns: minmax(0, 1fr); } }
.payroll-print-sheet { display: none; }
.reconciliation-entries { min-width: 880px; }
.reconciliation-preview { margin-top: 12px; }
.reconciliation-print-frame { display: block; width: 100%; height: min(68vh, 860px); border: 0; background: white; }
.workbook-grid tbody tr.reconciliation-opening > td { background: #f1f4f7; font-weight: 700; }
.workbook-grid tbody tr.reconciliation-month > td { background: #ffedd5; font-weight: 700; }
.workbook-grid tbody tr.reconciliation-details-row > td { padding: 8px 16px; background: #f7f9fb; white-space: normal; }
.reconciliation-details-row table { min-width: 0; }
@media print {
  body.print-payroll .application, body.print-payroll .application * { visibility: hidden; }
  body.print-payroll .payroll-print-sheet { display: block; position: absolute; inset: 0; padding: 12px; background: white; }
  body.print-payroll .payroll-print-sheet, body.print-payroll .payroll-print-sheet * { visibility: visible !important; }
  body.print-payroll .payroll-print-sheet table { min-width: 0; }
}
.pagination { justify-content: flex-end; }
@media (max-width: 680px) {
    .menu-items { position: static; }
}
.table-wrap { overflow: auto; border: 1px solid #b9bec5; border-radius: 5px; background: white; }
.facility-grid { max-height: min(62vh, 540px); }
.facility-grid td:first-child { white-space: nowrap; }
/* One spreadsheet grid for every register and document line table. */
table { width: auto; border-collapse: collapse; border-spacing: 0; background: white; }
th, td { text-align: left; height: 36px; padding: 6px 8px; border: 1px solid #c9cdd2; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: linear-gradient(#f7f8fa, #e9ecf0); color: #343a40; white-space: nowrap; font-size: 12px; font-weight: 700; box-shadow: inset 0 -1px #aeb4bb; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.document-link { padding: 0; border: none; background: transparent; color: #801818; text-decoration: underline; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; padding: 0 12px; }
.facts dd { margin: 0; }
.receipt-editor fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.receipt-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; background: #f8f8f8; border-bottom: 1px solid var(--border); }
.receipt-fields label { display: grid; gap: 4px; }
.receipt-lines input { width: 105px; }
.receipt-lines select { min-width: 155px; }
.receipt-lines input[readonly], .receipt-fields input[readonly] { background: #f1f1f1; }
.receipt-orders { background: #f8f8f8; border-block: 1px solid var(--border); }
.invoice-lines input:not([type="checkbox"]) { width: 95px; }
.invoice-lines td:nth-child(2) input { width: min(280px, 45vw); }
.invoice-lines td:nth-child(2) button { display: inline-block; margin: 3px 4px 0 0; }
.dialog-shade { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; background: #1f222879; padding: 12px; }
.order-credit-dialog { width: min(100%, 560px); max-height: calc(100dvh - 24px); overflow: auto; }
.dialog-shade .dialog { width: min(740px, 100%); max-height: calc(100dvh - 24px); overflow: auto; background: white; border: 1px solid var(--border); border-radius: 8px; }
.dialog-shade .card-import-dialog { width: min(1000px, 100%); }
.dialog-shade .shipment-print-dialog { width: min(480px, 100%); padding: 12px; }
.shipment-print-dialog .panel-heading { margin: -12px -12px 12px; }
.receipt-fields.reference-fields.shipment-print-fields { grid-template-columns: minmax(0, 1fr) 110px; }
.shipment-print-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.shipment-print-advanced { margin-top: 10px; color: var(--muted); font-size: 12px; }
.shipment-print-advanced summary { cursor: pointer; width: fit-content; }
.shipment-reprint-option { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.shipment-reprint-option input { margin: 0; }
.postcode-dialog { width: min(540px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.postcode-dialog::backdrop { background: #1f222879; }
.postcode-header { justify-content: space-between; }
.postcode-dialog iframe { display: block; width: 100%; height: min(490px, calc(100dvh - 96px)); min-height: 240px; border: 0; }
.card-import-dialog > .table-wrap { margin: 8px 12px; }
.dashboard-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; margin-bottom: 10px; }
.dashboard-workspace > div > .table-wrap { margin-bottom: 10px; }
.desktop-home {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: calc(100dvh - var(--taskbar-height));
  overflow: hidden;
  padding: 20px 24px;
  background: #eef1f5;
}
.desktop-home-watermark {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(520px, 48vw);
  height: min(360px, 42vh);
  object-fit: contain;
  opacity: .075;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}
.desktop-home-heading { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 10px; color: #3f4a59; font-size: 14px; font-weight: 700; }
.desktop-home-heading small { color: #738093; font-size: 12px; font-weight: 400; }
.desktop-home-launchers { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 124px); grid-auto-rows: 120px; align-items: stretch; justify-items: stretch; gap: 10px; width: max-content; max-width: 100%; margin-top: 22px; }
.desktop-launcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #29384c;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, transform .14s ease;
}
.desktop-launcher:hover, .desktop-launcher-folder[open] > .desktop-launcher { border-color: #cbd5e1; background: #ffffff45; box-shadow: none; transform: translateY(-1px); }
.desktop-launcher:focus-visible { outline: 2px solid #9ba9bb; outline-offset: 1px; }
.desktop-launcher-icon { display: grid; place-items: center; width: 60px; height: 60px; border: 1px solid #d8dee7; border-radius: 17px; background: linear-gradient(145deg, #fff, #f4f6f9); color: #a80000; box-shadow: 0 4px 10px #28364b1c, inset 0 1px #fff; }
.desktop-launcher-icon svg { width: 35px; height: 35px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.desktop-icon-receipts { color: #b40000; border-color: #efc9c9; background: linear-gradient(145deg, #fff, #fff0f0); }
.desktop-icon-shipments { color: #2465a8; border-color: #c7d9ee; background: linear-gradient(145deg, #fff, #eef5ff); }
.desktop-icon-stock { color: #32815a; border-color: #c8e2d1; background: linear-gradient(145deg, #fff, #eef8f1); }
.desktop-launcher-report { color: #6856a6; border-color: #d6cfeb; background: linear-gradient(145deg, #fff, #f3f0ff); }
.desktop-launcher-folder { position: relative; display: block; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; }
.desktop-launcher-folder > .desktop-launcher { display: flex; width: 100%; height: 100%; min-height: 0; margin: 0; box-sizing: border-box; list-style: none; }
.desktop-launcher-folder > summary::-webkit-details-marker { display: none; }
.desktop-report-menu { position: absolute; z-index: 8; top: 4px; left: 108px; display: grid; gap: 2px; width: max-content; min-width: 220px; max-width: min(340px, calc(100vw - 130px)); max-height: min(60vh, 460px); overflow: auto; padding: 6px; border: 1px solid #cbd3de; border-radius: 9px; background: #fff; box-shadow: 0 8px 22px #1a2a4030; }
.desktop-report-menu button { min-height: 34px; padding: 6px 9px; border-color: transparent; border-radius: 6px; text-align: left; }
.desktop-report-menu button:hover { background: var(--selected); color: var(--red); }
.desktop-report-menu .desktop-report-unpin { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.desktop-quick-launchers { position: sticky; top: 0; z-index: 7; display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; min-height: 54px; margin: 0; padding: 5px 12px; overflow-x: auto; overscroll-behavior-x: contain; border-bottom: 1px solid #d5dbe4; background: #eef1f5f2; scrollbar-width: thin; }
.desktop-quick-context { flex: 0 0 auto; margin-right: 3px; padding-right: 10px; border-right: 1px solid #ccd3de; color: #344154; font-size: 13px; font-weight: 700; white-space: nowrap; }
.desktop-quick-launcher { position: relative; display: inline-flex; flex: 0 0 88px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 88px; min-width: 88px; min-height: 70px; height: 70px; padding: 3px 5px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #29384c; font: inherit; font-size: 10px; font-weight: 650; text-align: center; text-decoration: none; white-space: normal; cursor: pointer; }
.desktop-quick-launcher:hover, .desktop-quick-launcher:focus-visible, .desktop-quick-report-folder[open] > .desktop-quick-launcher { border-color: #cbd5e1; background: #ffffff62; }
.desktop-quick-launcher-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border: 1px solid #d8dee7; border-radius: 11px; background: linear-gradient(145deg, #fff, #f4f6f9); color: #a80000; box-shadow: 0 2px 5px #28364b1c, inset 0 1px #fff; }
.desktop-quick-launcher-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.desktop-quick-launcher-icon.desktop-icon-receipts { color: #b40000; border-color: #efc9c9; background: linear-gradient(145deg, #fff, #fff0f0); }
.desktop-quick-launcher-icon.desktop-icon-shipments { color: #2465a8; border-color: #c7d9ee; background: linear-gradient(145deg, #fff, #eef5ff); }
.desktop-quick-launcher-icon.desktop-icon-stock { color: #32815a; border-color: #c8e2d1; background: linear-gradient(145deg, #fff, #eef8f1); }
.desktop-quick-launcher-icon.desktop-launcher-report { color: #6856a6; border-color: #d6cfeb; background: linear-gradient(145deg, #fff, #f3f0ff); }
.desktop-quick-launcher-icon.desktop-icon-payments { color: #9a4e1c; border-color: #e6d1bc; background: linear-gradient(145deg, #fff, #fff4e8); }
.desktop-quick-launcher-icon.desktop-icon-expenses { color: #7553a2; border-color: #d8cceb; background: linear-gradient(145deg, #fff, #f4efff); }
.desktop-quick-report-folder { position: relative; flex: 0 0 auto; }
.desktop-quick-report-folder > summary { list-style: none; }
.desktop-quick-report-folder > summary::-webkit-details-marker { display: none; }
.desktop-quick-report-folder .desktop-report-menu { top: calc(100% + 4px); left: 0; }
.desktop-home-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 300px; padding: 24px; }
.desktop-home-picker h1 { flex: 0 0 100%; margin: 0 0 8px; color: #3f4a59; font-size: 20px; }
.desktop-home-picker > button { min-width: 180px; min-height: 48px; border-color: #cbd3de; background: #ffffffd9; font-weight: 600; }
.desktop-empty-workspace { align-content: start; }
.desktop-empty-workspace > .facility-workspace { flex: 1 0 100%; min-width: 0; }
.desktop-home-picker > button:hover { border-color: #d99191; background: #fff7f7; color: var(--red); }
@media (max-width: 700px) {
  .desktop:has(.desktop-home) { min-height: calc(100dvh - 125px); }
  .desktop-home { min-height: calc(100dvh - 125px); padding: 16px; }
  .desktop-home-watermark { width: min(360px, 70vw); height: min(250px, 34vh); }
  .desktop-home-launchers { grid-template-columns: repeat(2, minmax(112px, 124px)); grid-auto-rows: 116px; gap: 8px; margin-top: 14px; }
  .desktop-report-menu { top: 0; left: 98px; }
}
.report-workspace tfoot th { position: static; background: #edf1f7; }
.financial-monthly {
  --financial-header: #0b4f80;
  --financial-subheader: #12689e;
  --financial-group-width: clamp(160px, 13vw, 255px);
  --financial-code-width: 64px;
  --financial-label-width: clamp(210px, 21vw, 460px);
  container: financial-report / inline-size;
  min-width: 0;
}
.financial-monthly > .panel-heading { min-height: 36px; padding-block: 6px; align-items: baseline; flex-wrap: wrap; }
.financial-monthly-grid { max-block-size: 68dvh; scrollbar-gutter: stable; }
.application .financial-monthly .financial-monthly-grid > table {
  --financial-fixed-width: calc(var(--financial-group-width) + var(--financial-code-width) + var(--financial-label-width));
  width: calc(var(--financial-fixed-width) + 115px * var(--financial-amount-columns));
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.financial-monthly-grid col.financial-group { width: var(--financial-group-width); }
.financial-monthly-grid col.financial-code { width: var(--financial-code-width); }
.financial-monthly-grid col.financial-label { width: var(--financial-label-width); }
.financial-monthly-grid col.financial-amount { width: 115px; }
.application .financial-monthly-grid :is(th, td) { border-width: 0 1px 1px 0; }
.application .financial-monthly-grid thead th {
  background: var(--financial-header);
  color: #fff;
  border-color: #4a7aa1;
  box-shadow: none;
}
.application .financial-monthly-grid thead th { position: sticky; top: 0; z-index: 2; height: 42px !important; }
.application .financial-monthly-grid thead tr:nth-child(2) th {
  top: 42px;
  height: 30px !important;
  background: var(--financial-subheader);
}
.financial-monthly-grid thead small { display: block; font-size: 10px; font-weight: 500; }
.application .financial-monthly-grid > table > tbody > tr { --sheet-row: #fff; }
.application .financial-monthly-grid > table > tbody > tr:is(:hover, :focus-within) { --sheet-row: #f4f8fc; }
.financial-monthly-grid tbody[data-section="cost"] { --section: #d2ebf8; --section-total: #e3f2fb; }
.financial-monthly-grid tbody[data-section="sales"] { --section: #c9f4da; --section-total: #ddf8e8; }
.financial-monthly-grid tbody[data-section="margin"] { --section: #fff0bb; --section-total: #fff1b6; }
.financial-monthly-grid tbody[data-section="purchase"] { --section: #ffcecf; --section-total: #ffd2d3; }
.financial-monthly-grid tbody[data-section="cash"] { --section: #e0dbfb; --section-total: #e5e1fa; }
.financial-monthly-grid tbody[data-section="receivable"] { --section: #d5ecf9; --section-total: #d5ecf9; }
.financial-monthly-grid tbody[data-section="payable"] { --section: #d7eef3; --section-total: #d7eef3; }
.financial-monthly-grid tbody[data-section="expense"] { --section: #e5e1fa; --section-total: #e9e5fb; }
.financial-monthly-grid tbody[data-section="stock"] { --section: #d7f1e4; --section-total: #e4f7ec; }
.application .financial-monthly-grid > table > tbody > .financial-total { --sheet-row: var(--section-total, #e3f2fb); font-weight: 700; }
.application .financial-monthly-grid .financial-frozen-group { text-align: center; white-space: normal; overflow-wrap: anywhere; }
.application .financial-monthly-grid tbody .financial-frozen-group { background: var(--section, #d2ebf8); color: #001d48; font-weight: 800; }
.financial-monthly-grid .financial-frozen-code { text-align: center; }
.financial-monthly-grid tbody .financial-frozen-label { text-align: left; }
.financial-monthly-grid .numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.application .financial-monthly-grid .financial-period-start { border-left: 1px solid #a5bacd; }
.financial-monthly-grid .financial-delta { color: #546373; font-weight: 600; }
.financial-monthly-grid .financial-delta[data-sign="positive"] { color: #087a43; }
.financial-monthly-grid .financial-delta[data-sign="negative"] { color: #a40000; }
.application .financial-monthly-grid .document-link { padding-inline: 0; color: #17324b; font-weight: inherit; }
.financial-monthly-grid .document-link:not(:hover):not(:focus-visible) { text-decoration: none; }
.financial-monthly-grid .financial-override { background: #fff1ca; }
@container financial-report (min-width: 1180px) {
  .application .financial-monthly-grid :is(.financial-frozen-group, .financial-frozen-code, .financial-frozen-label) { position: sticky; z-index: 1; }
  .application .financial-monthly-grid thead :is(.financial-frozen-group, .financial-frozen-code, .financial-frozen-label) { z-index: 3; }
  .financial-monthly-grid .financial-frozen-group { left: 0; }
  .financial-monthly-grid .financial-frozen-code { left: var(--financial-group-width); }
  .financial-monthly-grid .financial-frozen-label { left: calc(var(--financial-group-width) + var(--financial-code-width)); }
}
.dialog-shade:has(> .financial-detail) {
  grid-template-rows: minmax(0, 1fr);
  padding-block: calc(var(--desktop-launcher-height) + 24px + env(safe-area-inset-top, 0px))
    calc(var(--taskbar-height) + 12px + env(safe-area-inset-bottom, 0px));
}
.dialog-shade > .financial-detail {
  width: min(1000px, 100%);
  max-block-size: 100%;
}
.financial-detail:has(> .table-wrap) {
  display: flex;
  flex-direction: column;
}
.financial-detail > :not(.table-wrap) { flex: 0 0 auto; }
.financial-detail > .panel-heading { position: sticky; top: 0; z-index: 4; }
.financial-detail .table-wrap { margin: 8px 12px; }
.dialog-shade .financial-detail > .table-wrap { min-block-size: 64px; max-inline-size: calc(100% - 24px); overscroll-behavior: contain; }
.financial-charts { margin-block: 12px; padding: 10px 12px; }
.financial-charts summary { cursor: pointer; font-weight: 700; }
.financial-chart-key, .financial-bars { display: flex; gap: 12px; flex-wrap: wrap; }
.financial-chart-key i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; }
.financial-bar-period { display: grid; min-width: 108px; flex: 1; text-align: center; }
.financial-bars-area { display: flex; align-items: end; gap: 4px; height: 116px; border-bottom: 1px solid var(--border); }
.financial-bars-area button { flex: 1; min-height: 0; border: 0; border-radius: 3px 3px 0 0; padding: 0; }
table caption { text-align: left; padding: 8px; font-weight: 600; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { display: grid; gap: 12px; width: min(100%, 360px); background: white; border: 1px solid var(--border); border-radius: 10px; padding: 24px; }
.login img { width: 105px; max-height: 80px; object-fit: contain; justify-self: center; }
.login h1 { margin: 0; text-align: center; font-size: 20px; }
.login label { display: grid; gap: 4px; }
.login .remember-password { display: flex; align-items: center; gap: 8px; }
.remember-password input { margin: 0; accent-color: var(--red); }
.password-hint { color: #686868; }
.primary { color: var(--red); background: var(--selected); border-color: #d6abab; font-weight: 700; }

/* The workshop toggle is an addition to the Flutter shell, therefore it must
   stay compact and horizontal without changing the 62px header rhythm. */
.flutter-header .header-directions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 2px; margin-right: 8px; }
.flutter-header .header-directions button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; height: 36px; padding: 4px 7px; white-space: nowrap; }
.direction-icon { display: inline-grid; place-items: center; width: 16px; font-size: 13px; line-height: 1; }

/* Document workspace: direct geometry of the Flutter DocumentWorkspace reference. */
.receipt-workspace { display: grid; gap: 12px; }
.document-toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; min-height: 36px; }
.back-action { width: 36px; padding: 0; font-size: 20px; line-height: 1; }
.document-badge { height: 36px; padding: 0 11px; display: flex; align-items: center; gap: 6px; border: 1px solid #d6abab; border-radius: 9px; color: var(--red); background: var(--selected); font-weight: 800; }
.document-badge span { font-size: 16px; }
.compact-control { display: grid; gap: 2px; min-width: 150px; color: #686868; font-size: 11px; }
.document-toolbar .compact-control { gap: 0; }
.compact-control select { height: 36px; min-height: 36px; padding-block: 3px; color: #303030; }
.soft-action { height: 36px; min-height: 36px; color: var(--red); background: var(--selected); border-color: #d6abab; }
.receipt-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; align-items: start; }
.receipt-split > :only-child { grid-column: 1 / -1; }
.receipt-empty-state { min-height: 132px; }
.receipt-empty-state .empty-grid-row td { height: 48px !important; color: #777; text-align: center; background: #fafbfc; }
.reference-panel { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: white; box-shadow: 0 1px 2px #00000008; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 54px; padding: 8px 12px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.panel-heading strong { display: block; font-size: 13px; font-weight: 800; }
.panel-heading small { display: block; margin-top: 2px; color: #686868; font-size: 11px; }
.line-items-panel > .panel-heading > .line-count { flex: 0 0 auto; margin: 0; text-align: right; }
.line-items-heading-actions { display: flex; align-items: center; gap: 8px; }
.line-items-heading-actions .line-count { margin: 0; }
.line-add-icon { display: inline-grid !important; place-items: center; width: 22px !important; min-width: 22px !important; max-width: 22px !important; height: 22px !important; min-height: 22px !important; max-height: 22px !important; padding: 0 !important; border: 1px solid #e5b5b5; border-radius: 5px; background: #fff; color: #a80000; font: 17px/1 Arial, sans-serif; }
.line-add-icon:hover:not(:disabled) { background: #fff0f0; border-color: #d98989; }
.line-add-icon:disabled { opacity: .45; }
.partner-registry-panel { width: max-content; max-width: 100%; }
.partner-registry-panel > .panel-heading { min-height: 42px; }
.panel-subtitle { display: block; margin-top: 2px; color: #686868; font-size: 11px; }
.partner-registry-toolbar { align-items: end; gap: 7px; padding: 8px; border-bottom: 1px solid var(--border); }
.partner-registry-toolbar > label:first-child { min-width: 0; }
.partner-type-switch { display: flex; align-items: center; gap: 3px; }
.partner-type-switch button { min-height: 32px; padding: 4px 9px; white-space: nowrap; }
.partner-type-switch button.active { color: var(--red); border-color: #d6abab; background: var(--selected); font-weight: 700; }
.partner-toolbar-actions { margin-left: auto; }
.partner-registry-panel > .table-wrap { width: max-content; max-width: 100%; max-height: calc(100dvh - 320px); overflow: auto; }
.partner-registry-panel > .table-wrap table { min-width: max-content; }
.partner-registry-panel > .table-wrap th, .partner-registry-panel > .table-wrap td { height: 36px; padding: 4px 8px; }
.partner-registry-panel .partner-registry-text { overflow: hidden; text-overflow: ellipsis; }
.partner-registry-panel > .table-wrap tbody tr { cursor: default; }
.partner-registry-panel > .table-wrap tbody tr.selected-row { background: #e5effa; }
.partner-registry-panel > .table-wrap tbody tr:hover { background: #f2f6fc; }
.partner-registry-panel > .table-wrap tbody tr.selected-row:hover { background: #d9e8f8; }
.partner-registry-panel > .pagination { justify-content: space-between; min-height: 40px; padding: 5px 10px; }
.partner-dialog { width: min(920px, 100%) !important; }
.partner-address-field { position: relative; min-width: 0; }
.partner-address-field label { display: grid; gap: 4px; }
.partner-address-field input { padding-inline-end: 26px; }
.postcode-search-inline { position: absolute; inset-inline-end: 2px; bottom: 1px; }
.postcode-search-icon {
  --control-height: 22px;
  display: grid; place-items: center; width: 23px; padding-inline: 0;
  border: 0; background: transparent; color: #45586e;
}
.postcode-search-icon:hover:not(:disabled) { background: #e7eef7; }
.postcode-search-icon svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.category-registry-panel { width: max-content; max-width: 100%; }
.category-registry-panel > .panel-heading { min-height: 42px; }
.category-registry-toolbar { align-items: end; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); }
.category-registry-toolbar > form { align-items: end; gap: 6px; }
.category-registry-toolbar > form label { width: min(28vw, 260px); }
.category-registry-panel > .table-wrap { width: max-content; max-width: 100%; max-height: calc(100dvh - 310px); overflow: auto; }
.category-registry-panel > .table-wrap table { min-width: max-content; }
.category-registry-panel > .table-wrap th, .category-registry-panel > .table-wrap td { height: 36px; padding: 4px 8px; }
.category-dialog { width: min(760px, 100%) !important; }
.facility-registry-panel { width: max-content; max-width: 100%; }
.facility-registry-panel > .panel-heading { min-height: 42px; }
.facility-panel-title { display: flex; align-items: center; gap: 8px; }
.facility-panel-title .back-action { width: 28px; height: 28px; min-height: 28px; font-size: 17px; }
.facility-registry-toolbar { align-items: end; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); }
.facility-registry-toolbar > form { align-items: end; gap: 6px; }
.facility-registry-toolbar > form label { width: min(28vw, 300px); }
.facility-registry-panel > .table-wrap { width: max-content; max-width: 100%; max-height: calc(100dvh - 310px); overflow: auto; }
.facility-registry-panel > .table-wrap table { min-width: max-content; }
.facility-registry-panel > .table-wrap th, .facility-registry-panel > .table-wrap td { height: 36px; padding: 4px 8px; }
.facility-registry-panel > .table-wrap tr.selected-row { background: #e5effa; }
.facility-dialog { width: min(920px, 100%) !important; }
.compact-primary { min-height: 30px; height: 30px; padding: 4px 9px; font-size: 12px; }
.panel-filter { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); }
.panel-filter input { flex: 1; min-width: 0; }
.panel-filter button { width: 36px; padding: 0; }
.journal-table { min-height: 0; max-height: 278px; overflow: auto; }
.journal-table table { min-width: 660px; }
.journal-table th, .journal-table td { height: 36px; padding: 6px 8px; font-size: 12px; }
.journal-table th { position: sticky; top: 0; z-index: 1; font-size: 11px; font-weight: 700; }
.journal-table tbody tr:hover { background: var(--selected); }
.workspace-page-heading { display: flex; justify-content: space-between; align-items: start; min-height: 0; margin: 0 0 14px; padding: 0; border: 0; background: transparent; }
.workspace-page-heading h1 { margin: 0; color: #202124; font-size: 24px; line-height: 1.2; font-weight: 800; }
.workspace-page-heading p { margin: 4px 0 0; color: #686868; font-size: 13px; }
.stock-balance-toolbar { align-items: end; gap: 8px; margin-bottom: 12px; }
.stock-balance-toolbar input[type="search"] { width: min(48vw, 200px); }
.stock-balance-topbar { display: flex; align-items: end; gap: 16px; margin-bottom: 12px; }
.stock-balance-topbar > .workspace-page-heading { flex: 0 0 auto; margin: 0; }
.stock-workspace-modes { display: flex; flex: 0 0 auto; gap: 6px; }
.stock-workspace-modes button[aria-pressed="true"] { border-color: var(--brand, #b5232c); color: var(--brand, #b5232c); font-weight: 700; }
.stock-sales-toolbar { align-items: end; flex-wrap: nowrap; gap: 6px; margin: 0; padding: 0; }
.stock-sales-toolbar input[type="search"] { width: 150px; }
.stock-sales-toolbar select { max-width: 150px; }
.stock-balance-topbar.has-sales-controls { flex-wrap: nowrap; gap: 8px 12px; overflow-x: auto; }
.stock-sales-controls { flex: 0 0 auto; }
.stock-balance-topbar.has-sales-controls > .stock-balance-toolbar { flex: 1 0 auto; }
.has-sales-controls .stock-balance-toolbar input[type="search"] { width: 144px; }
.stock-balance-table tr[tabindex="0"] { cursor: pointer; }
.stock-balance-topbar > .stock-balance-toolbar { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; margin: 0; padding: 0; }
@media (max-width: 1050px) {
  .stock-balance-topbar { align-items: flex-start; flex-wrap: wrap; gap: 4px 16px; }
  .stock-balance-topbar > .stock-balance-toolbar { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; }
  .stock-balance-topbar.has-sales-controls { flex-wrap: wrap; overflow-x: visible; }
  .stock-sales-controls { flex-basis: 100%; min-width: 0; }
  .stock-sales-toolbar { flex-wrap: wrap; }
  .stock-balance-topbar.has-sales-controls > .stock-balance-toolbar { flex: 1 1 100%; }
}
.stock-balance-panel { width: 100%; max-width: 100%; }
.stock-balance-panel > .panel-heading { align-items: start; flex-wrap: wrap; flex-shrink: 0; padding-block-end: 10px; }
.stock-balance-metrics { display: flex; gap: 7px; flex-wrap: wrap; }
.stock-balance-metrics > span { display: grid; gap: 2px; min-width: 106px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.stock-balance-metrics small { color: #686868; font-size: 10px; }
.stock-balance-metrics b { font-size: 12px; font-weight: 700; }
.stock-warning-metric { border-color: #e4b3a4 !important; background: #fff3ee !important; color: #8f301b; }
.stock-balance-table-wrap { max-width: 100%; overflow: auto; }
.stock-balance-table { min-width: max-content; }
.stock-balance-table th, .stock-balance-table td { height: 36px; padding: 4px 8px; white-space: nowrap; }
.stock-balance-table td { overflow: hidden; text-overflow: ellipsis; }
.stock-balance-table .stock-product-row.is-expandable { cursor: pointer; }
.stock-balance-table .stock-product-row:hover, .stock-balance-table .stock-lot-row:hover { background: var(--selected); }
.stock-balance-table .stock-lot-row td:nth-child(2) { padding-left: 24px; color: #505050; }
.stock-row-caret { display: inline-block; width: 16px; color: var(--red); }
.stock-empty { height: 42px !important; color: #686868; text-align: center; }
.customer-orders-register { width: auto; max-width: 100%; }
.customer-orders-register .journal-table { max-height: min(60vh, 620px); overflow: auto; }
.customer-orders-toolbar { align-items: end; flex-wrap: wrap; }
.customer-order-statuses { gap: 6px; flex-wrap: wrap; }
.customer-order-statuses button[aria-pressed="true"] { color: var(--primary); border-color: var(--primary); background: var(--selected); font-weight: 700; }
.status-chip { display: inline-block; white-space: nowrap; }
.application table tbody [data-document-status="DRAFT"] { color: #a61922; }
.application table tbody [data-document-status="POSTED"] { color: #17623a; }
.compact-hint { padding: 8px; font-size: 12px; }
.journal-pager { display: flex; justify-content: flex-end; align-items: center; gap: 7px; min-height: 43px; padding: 5px 8px; border-top: 1px solid var(--border); font-size: 12px; }
.journal-pager button { width: 30px; height: 30px; min-height: 30px; padding: 0; font-size: 19px; }
.order-actions-cell { min-width: 112px; white-space: nowrap; }
.row-icon-actions { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; }
.icon-action { display: inline-grid; place-items: center; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 5px; border-radius: 6px; color: #414852; }
.icon-action svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-action:hover { color: #171a1f; background: #edf1f5; }
.icon-action.primary:hover { color: #801818; background: #f5e5e5; }
.detail-body { padding: 12px 8px; }
.receipt-fields.reference-fields { display: grid; grid-template-columns: 150px 1fr 1fr 1fr; gap: 10px 8px; padding: 0; background: transparent; border: 0; }
.receipt-fields.reference-fields label { min-width: 0; font-size: 12px; color: #606060; }
.receipt-fields.reference-fields input, .receipt-fields.reference-fields select { width: 100%; height: 36px; min-height: 36px; color: #303030; }
.inline-tools { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e1e1e1; }
.scan-field { display: grid; gap: 3px; font-size: 12px; color: #606060; }
.scan-field input { width: 210px; }
.receipt-tools.inline-tools { flex-wrap: nowrap; gap: 6px; }
.receipt-main-fields .receipt-order-field { align-self: stretch; }
.receipt-order-input-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.receipt-order-input-row .partner-picker-trigger { flex: 1 1 auto; height: 36px; min-height: 36px; }
.receipt-order-input-row .text-action { flex: 0 0 auto; width: 24px; height: 24px; min-height: 24px; padding: 0; }
.receipt-main-fields .receipt-attachment-field { display: grid; min-width: 0; align-self: stretch; }
.receipt-main-fields .receipt-attachment-field input[type="file"] { width: 100%; min-width: 0; height: 36px; min-height: 36px; padding: 4px 6px; }
.receipt-tools .scan-field { flex: 1 1 100px; min-width: 90px; }
.receipt-tools .scan-field input { width: 100%; min-width: 90px; }
.receipt-tools > button { flex: 0 0 auto; padding-inline: 8px; white-space: nowrap; }
.receipt-tools .order-link { min-width: 0; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-link { padding: 7px 0; color: #801818; font-weight: 600; }
.text-action { border: 0; padding-inline: 2px; color: #801818; text-decoration: underline; background: transparent; }
.line-items-panel { margin-top: 12px; }
.line-items-panel .table-wrap { overflow: auto; }
.trace-table.journal-table { min-height: 0; }
.receipt-lines { min-width: 920px; }
.receipt-lines th, .receipt-lines td { height: 36px; padding: 4px 8px; font-size: 12px; }
.receipt-lines td { padding: 2px; }
.receipt-lines input, .receipt-lines select { width: 100%; min-height: 31px; height: 31px; padding: 3px 6px; border: 0; border-radius: 0; outline-offset: -2px; background: transparent; }
.receipt-lines input:focus, .receipt-lines select:focus { outline: 2px solid #2f7dd1; background: #fffde9; }
.receipt-lines select { min-width: 185px; }
.line-footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 8px; border-top: 1px solid var(--border); background: var(--subtle); }
.document-financial-lines { min-width: max-content; }
.document-financial-lines th, .document-financial-lines td { white-space: nowrap; }
.document-financial-lines td select, .document-financial-lines td input { min-width: 74px; max-width: 150px; }
.document-financial-lines td:nth-child(3) select { min-width: 180px; }
.document-totals, .document-debt-totals { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); }
.document-totals { background: var(--subtle); }
.document-totals > strong { display: flex; align-items: center; margin-right: 2px; font-size: 12px; }
.document-totals span, .document-debt-totals span { display: flex; flex: 1 1 112px; min-width: 105px; min-height: 48px; flex-direction: column; justify-content: space-between; gap: 5px; padding: 6px 9px; border: 1px solid #d7dbe1; border-radius: 3px; background: #fff; color: #737373; font-size: 10px; line-height: 1.25; white-space: normal; }
.document-totals b, .document-debt-totals b { color: #30343a; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.document-debt-totals { background: white; }
.document-totals .document-current-debt { border-color: #e5b5b5; background: #fff7f7; }
.shipment-lot-row { color: #64748b; white-space: nowrap; }
.line-footer label { display: flex; gap: 6px; align-items: center; }
.quick-order-product-panel { position: relative; z-index: auto; margin-top: 10px; overflow: visible; }
.quick-order-product-panel:focus-within { z-index: 15; }
.receipt-details:has(.quick-order-product-panel) { overflow: visible; }
.supplier-order-editor .receipt-split > .reference-panel:has(.quick-order-product-panel) { position: relative; overflow: visible; }
.receipt-editor.supplier-order-editor { display: grid; align-content: start; gap: 12px; }
.receipt-editor.supplier-order-editor > fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.receipt-details:has(.quick-product-search:focus) { position: relative; z-index: 14; }
.quick-order-product-fields { display: grid; grid-template-columns: minmax(220px, 520px) 92px 112px 142px auto; justify-content: start; gap: 8px; align-items: end; padding: 8px; }
.quick-order-product-fields label { display: grid; gap: 3px; min-width: 0; color: #606060; font-size: 11px; }
.supplier-order-product-fields { grid-template-columns: minmax(150px, 520px) 112px 142px auto; }
.quick-order-product-fields input { width: 100%; height: 36px; min-height: 36px; }
.quick-order-product-fields select { width: 100%; height: 36px; min-height: 36px; }
.quick-order-product-fields > button { white-space: nowrap; }
.return-quick-product-fields { grid-template-columns: minmax(220px, 520px) auto auto; }
.return-negative-input { display: inline-flex; align-items: center; gap: 4px; min-width: 92px; }
.return-negative-input > span { color: #b40000; font-weight: 700; }
.return-negative-input input { min-width: 68px; }
.return-negative-value { color: #b40000; }
/* Один журнал окна: приёмки/отгрузки и возвраты в одной таблице. */
.journal-kind { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 18px; background: #eef3f8; color: #2c4a6b; }
.journal-kind[data-kind="return"] { background: #fbeaea; color: #b40000; }
.quick-order-product-panel > .error { margin: 0 8px 8px; }
.shipment-quick-product-fields { grid-template-columns: minmax(220px, 520px) 92px 112px 142px auto; }
.quick-order-product-panel > .compact-hint { margin: 0 8px 8px; }
.finance-workspace > .finance-toolbar { align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.finance-toolbar > input[type="date"] { width: 130px; }
.finance-toolbar > label { flex-wrap: nowrap; color: #606060; font-size: 11px; }
.finance-toolbar > label select { width: 155px; }
.finance-toolbar > input[type="search"] { flex: 1 1 210px; min-width: 0; max-width: 360px; }
.finance-date-message { margin: -8px 12px 12px; color: #8f2944; font-size: 12px; }
.finance-editor-panel { min-width: 0; }
.finance-editor-panel > .panel-heading { min-height: 54px; }
.finance-editor-actions { display: flex; align-items: center; gap: 6px; }
.finance-empty-editor { display: grid; gap: 6px; min-height: 96px; align-content: center; padding: 12px; color: #59677a; font-size: 12px; }
.finance-empty-editor strong { color: #303b4b; font-size: 13px; }
.finance-workspace fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.finance-journal-navigation { display: flex; gap: 6px; }
.finance-workspace .detail-body > label:has(textarea) { display: grid; width: 100%; gap: 3px; }
.finance-workspace .detail-body textarea { width: 100%; height: 36px; min-height: 36px; resize: vertical; }
.finance-editor-panel .finance-editor-form { padding: 12px; }
.finance-editor-form > fieldset { display: grid; gap: 10px; }
.finance-editor-form .comment-placeholder-field { display: block; padding: 6px 8px; }
.finance-editor-form > .form-actions { flex-wrap: wrap; padding: 12px 0 0; }
.finance-editor-form .finance-main-fields { grid-template-columns: 150px repeat(3, minmax(0, 1fr)); align-items: start; }
.finance-editor-form .finance-invoice-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.expense-invoice-field { min-width: 0; }
.expense-invoice-file { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; overflow-wrap: anywhere; }
.expense-accounting-fields > summary { width: fit-content; font-size: 12px; cursor: pointer; }
.expense-accounting-fields[open] > summary { margin-bottom: 8px; }
@media (max-width: 760px) {
  .finance-editor-form :is(.finance-main-fields, .finance-invoice-fields) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .finance-editor-form :is(.finance-main-fields, .finance-invoice-fields) { grid-template-columns: minmax(0, 1fr); }
}
.quick-product-search { position: relative; }
.quick-product-suggestions { position: absolute; z-index: 80; top: calc(100% + 4px); left: 0; width: max-content; max-width: calc(100vw - 40px); max-height: 300px; overflow: auto; border: 1px solid #aeb8c5; border-radius: 4px; background: #fff; box-shadow: 0 8px 20px #172a4526; }
.quick-product-table { width: max-content; min-width: 790px; border-collapse: collapse; table-layout: fixed; color: #253246; font-size: 12px; }
.quick-product-table th, .quick-product-table td { height: 28px; padding: 4px 7px; border: 1px solid #c5ccd5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.quick-product-table th { position: sticky; top: 0; z-index: 1; background: #e8edf3; color: #273548; font-weight: 650; text-align: left; }
.quick-product-table th:nth-child(1) { width: 90px; }
.quick-product-table th:nth-child(2) { width: 190px; }
.quick-product-table th:nth-child(3) { width: 100px; }
.quick-product-table th:nth-child(n+4) { width: 105px; text-align: right; }
.quick-product-table th:nth-child(6) { width: 135px; }
.quick-product-table tbody tr[role="option"] { cursor: pointer; }
.quick-product-table tbody tr[role="option"]:nth-child(even) { background: #f3f6fa; }
.quick-product-table tbody tr[role="option"]:hover, .quick-product-table tbody tr[role="option"]:focus-visible { background: #dce9f8; outline: 2px solid #6b91be; outline-offset: -2px; }
.quick-product-table td.quick-product-empty { padding: 10px; color: #748196; text-align: center; }
@media (max-width: 900px) {
  .quick-order-product-fields, .shipment-quick-product-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .quick-order-product-fields > :is(label:first-child, button) { grid-column: 1 / -1; }
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 8px 2px; }
.form-actions.document-action-bar { padding-top: 16px; }
.shipment-actions { align-items: center; flex-wrap: wrap; }
.shipment-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.shipment-actions button > svg { display: block; flex: 0 0 15px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shipment-picker-actions { align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.receipt-orders { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: white; }
.supplier-order-picker-shade { z-index: 100; }
.supplier-order-picker-dialog { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(80px, 1fr) auto; width: min(760px, 100%); max-height: min(78dvh, 720px); margin: 0; }
/* Only the table scrolls sideways; the title, search and paging stay in place. */
.dialog-shade .supplier-order-picker-dialog { overflow: hidden; }
.supplier-order-picker-dialog > * { min-width: 0; }
.supplier-order-picker-dialog > .toolbar { padding: 10px 12px; }
.supplier-order-picker-dialog > .table-wrap { min-height: 80px; overflow: auto; }
.supplier-order-picker-dialog > .pagination { margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); }
.supplier-order-picker-dialog tbody tr[title*="Дважды"] { cursor: pointer; }
.supplier-order-picker-dialog tbody tr.disabled-row { cursor: not-allowed; opacity: .55; }
.dialog .table-wrap tbody tr[title*="Дважды"] { cursor: pointer; }
.product-picker-shade { z-index: 110; }
.receipt-line-product-dialog { display: grid; grid-template-rows: auto auto minmax(120px, 1fr); width: min(900px, calc(100vw - 32px)); max-height: min(78dvh, 720px); overflow: hidden; }
.receipt-line-product-filter { padding: 10px 12px; }
.receipt-line-product-filter input { width: 100%; min-width: 0; }
.receipt-line-product-table { min-height: 120px; max-height: min(62dvh, 560px); overflow: auto; margin: 0 8px 8px; }
.receipt-line-product-table table { min-width: 760px; }
.receipt-line-product-table tbody tr { cursor: pointer; }
.receipt-line-product-picker { display: block; min-height: 18px; cursor: pointer; }
.receipt-line-product-picker:hover { color: #a80000; text-decoration: underline; }
@media (max-width: 1080px) { .receipt-split { grid-template-columns: 1fr; } .receipt-fields.reference-fields { grid-template-columns: 150px 1fr 1fr; } }
@media (max-width: 1100px) { .brand { flex-basis: 65px; } .brand strong, .site-link span { display: none; } .site-link { width: 36px; } .workspace { flex-basis: 150px; } .header-directions button { padding-inline: 5px; } }
@media (max-width: 650px) { .desktop { padding: 12px; } header { padding: 7px 12px; } .flutter-header { height: auto; min-height: 62px; flex-wrap: wrap; } .header-navigation { order: 3; flex-basis: 100%; } .receipt-fields.reference-fields { grid-template-columns: 1fr; } .document-toolbar { align-items: center; } .compact-control { flex: 1; } .receipt-split { grid-template-columns: minmax(0,1fr); } .quick-order-product-fields { grid-template-columns: 1fr 1fr; } .quick-order-product-name { grid-column: 1 / -1; } .quick-order-product-fields > button { grid-column: 1 / -1; } }

/* Responsive working surfaces. Desktop keeps the Flutter-like compact density;
   tablet and phone never squeeze controls or hide document data. */
@media (max-width: 1180px) {
  .flutter-header { padding-inline: 14px; gap: 5px; }
  .brand { flex-basis: 64px; }
  .brand strong, .site-link span { display: none; }
  .site-link { width: 34px; min-width: 34px; padding-inline: 4px; }
  .header-navigation summary, .header-navigation .header-menu-single { padding-inline: 7px; }
  .header-directions button { padding-inline: 6px; }
  .desktop { padding: 18px 20px 32px; }
  .receipt-split { grid-template-columns: minmax(340px, 5fr) minmax(450px, 7fr); }
  .receipt-fields.reference-fields { grid-template-columns: 145px 1fr 1fr; }
  .receipt-fields.reference-fields label:first-child { grid-column: 1; }
}

@media (min-width: 1181px) and (max-width: 1380px) {
  .flutter-header { gap: 3px; padding-inline: 12px; }
  .brand { flex-basis: 160px; gap: 6px; }
  .site-link { width: 42px; min-width: 42px; padding-inline: 4px; }
  .header-navigation { gap: 1px; }
  .header-navigation summary, .header-navigation .header-menu-single { gap: 3px; padding-inline: 4px; font-size: 12px; }
  .header-navigation summary i { font-size: 13px; }
  .header-nav-icon { width: 16px; font-size: 13px; }
  .header-directions { gap: 1px; }
  .header-directions button { padding-inline: 4px; font-size: 11px; }
  .profile-action { padding-inline: 6px; font-size: 12px; }
}

@media (max-width: 900px) {
  .flutter-header { height: auto; min-height: 62px; flex-wrap: wrap; padding-block: 6px; }
  .brand { order: 1; }
  .site-link { order: 2; }
  .header-directions { order: 4; margin-left: auto; }
  .profile-action, .header-icon { order: 5; }
  .header-navigation { order: 3; flex: 1 0 100%; height: auto; min-height: 40px; flex-wrap: wrap; row-gap: 2px; overflow: visible; }
  .header-navigation details:first-child { margin-left: 0; }
  .desktop { padding: 16px; }
  .receipt-split { grid-template-columns: 1fr; }
  .receipt-journal { order: 2; }
  .receipt-details { order: 1; }
  .journal-table { max-height: 240px; }
  .receipt-fields.reference-fields { grid-template-columns: 150px 1fr 1fr; }
}

@media (max-width: 640px) {
  body { min-width: 320px; }
  button, input, select { min-height: 40px; }
  .flutter-header { padding: 5px 10px 0; gap: 4px; }
  .brand { flex-basis: 54px; height: 38px; }
  .brand img { width: 52px; height: 36px; flex-basis: 52px; }
  .site-link { display: none; }
  .header-directions { margin-left: auto; gap: 1px; }
  .flutter-header .header-directions button { min-height: 34px; height: 34px; padding-inline: 5px; font-size: 11px; }
  .profile-action { min-height: 34px; padding-inline: 5px; font-size: 0; }
  .profile-action::before { content: '◉'; font-size: 17px; }
  .header-icon { display: none; }
  .connection-state { width: 14px; font-size: 14px; }
  .header-navigation { height: auto; min-height: 43px; margin-inline: -10px; padding-inline: 10px; border-top: 1px solid #eceff3; }
  .header-navigation summary, .header-navigation .header-menu-single { height: 34px; min-height: 34px; padding: 0 8px; font-size: 12px; }
  .header-navigation summary i { font-size: 13px; }
  .header-navigation .menu-items { position: fixed; inset: auto 10px 10px 10px; min-width: 0; max-height: 58dvh; overflow: auto; z-index: 20; }
  .desktop { padding: 12px; }
  .window-title { padding: 8px 4px; font-size: 13px; background: transparent; border: 0; }
  .toolbar { padding: 8px 0; }
  .document-toolbar { gap: 6px; align-items: end; }
  .document-badge { padding-inline: 9px; }
  .compact-control { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .compact-control select { width: 100%; }
  .back-action, .soft-action { min-height: 36px; }
  .receipt-split { gap: 10px; }
  .panel-heading { min-height: 50px; padding-inline: 10px; }
  .detail-body { padding: 10px; }
  .receipt-fields.reference-fields { grid-template-columns: 1fr; gap: 9px; }
  .receipt-fields.reference-fields label:first-child { grid-column: auto; }
  .receipt-fields.reference-fields input, .receipt-fields.reference-fields select { height: 40px; min-height: 40px; }
  .inline-tools { align-items: stretch; gap: 7px; }
  .scan-field { flex: 1 0 100%; }
  .scan-field input { width: 100%; min-height: 40px; }
  .inline-tools > button { flex: 1 1 auto; }
  .receipt-tools.inline-tools { flex-wrap: wrap; }
  .receipt-tools .scan-field { flex: 1 0 100%; }
  .receipt-tools .scan-field input { width: 100%; }
  .receipt-tools > button { flex: 1 1 auto; }
  .journal-table { min-height: 0; max-height: 260px; }
  .journal-table table { min-width: 600px; }
  .journal-pager { justify-content: center; }
  .receipt-orders { margin-top: 10px; }
  .receipt-orders .toolbar { display: grid; gap: 8px; }
  .receipt-orders .toolbar label { display: grid; gap: 4px; }
  .line-items-panel { margin-top: 10px; }
  .line-items-panel .panel-heading { min-height: 48px; }
  .receipt-lines { min-width: 920px; }
  .receipt-lines th, .receipt-lines td { height: 42px; }
  .receipt-lines input, .receipt-lines select { height: 34px; min-height: 34px; }
  .line-footer { align-items: stretch; padding: 8px; }
  .line-footer > button { flex: 0 0 auto; }
  .line-footer label { flex: 1 0 100%; display: grid; grid-template-columns: auto 1fr; }
  .line-footer input[type='file'] { min-width: 0; width: 100%; }
  .form-actions { position: sticky; bottom: 0; z-index: 3; justify-content: stretch; padding: 10px 8px; background: white; border-top: 1px solid var(--border); }
  .form-actions button { flex: 1 1 0; }
  .facts { grid-template-columns: 1fr; gap: 1px; padding: 0; }
}

@media (max-width: 390px) {
  .flutter-header .header-directions button { max-width: 82px; overflow: hidden; text-overflow: ellipsis; }
  .document-badge { font-size: 12px; }
  .compact-control { min-width: 100%; flex-basis: 100%; }
  .compact-primary { padding-inline: 7px; }
}

.window-taskbar {
  position: fixed; z-index: 10; inset: auto 0 0; min-height: var(--taskbar-height);
  padding: 4px max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
  border-top: 1px solid #cbd3de; background: #e8edf6ed; box-shadow: 0 -2px 12px #1a2a4010; backdrop-filter: blur(14px);
}
.window-taskbar-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #a4afbe transparent; }
.window-taskbar-with-tools { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; }
.start-menu-button { grid-column: 1; display: grid; place-items: center; width: 46px; height: 44px; min-height: 44px; margin-left: 4px; padding: 4px; border-color: transparent; border-radius: 8px; background: transparent; }
.start-menu-button img { display: block; width: 36px; height: 32px; object-fit: contain; }
.start-menu-button:hover, .start-menu-button[aria-expanded="true"] { border-color: #cbd3de; background: #ffffffbd; box-shadow: 0 1px 4px #1a2a4014; }
.start-menu-panel { position: fixed; z-index: 80; inset: auto auto calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px) + 8px) max(8px, env(safe-area-inset-left, 0px)); width: min(820px, calc(100vw - 16px)); max-height: min(72dvh, 680px); overflow: auto; padding: 16px; border: 1px solid #cbd3de; border-radius: 12px; background: #f7f8fbf5; color: #253247; box-shadow: 0 14px 36px #14243a36; backdrop-filter: blur(18px); }
.start-menu-topbar { display: flex; align-items: center; gap: 16px; padding: 0 4px 12px; border-bottom: 1px solid #dce2eb; }
.start-menu-heading { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 15px; text-align: left; }
.start-menu-heading img { width: 38px; height: 32px; object-fit: contain; }
.start-menu-search { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 0 10px; border: 1px solid #cbd3de; border-radius: 8px; background: #fff; color: #758196; }
.start-menu-search > span { font-size: 20px; line-height: 1; }
.start-menu-search input { flex: 1 1 auto; min-width: 0; height: 38px; min-height: 38px; padding: 6px 0; border: 0; outline: 0; background: transparent; color: #253247; }
.start-menu-search:focus-within { border-color: #aab6c7; box-shadow: 0 0 0 2px #dce5f1; }
@media (max-width: 480px) { .start-menu-topbar { align-items: stretch; flex-direction: column; gap: 8px; } }
.start-menu-no-results { margin: 12px 2px 2px; padding: 12px; color: #69778b; }
.start-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; padding-top: 12px; }
.start-menu-section { min-width: 0; padding: 8px; border: 1px solid #e1e5ec; border-radius: 9px; background: #ffffffb8; }
.start-menu-section-title { display: flex; align-items: center; gap: 3px; }
.start-menu-section-title > :not(.start-menu-pin) { flex: 1 1 auto; min-width: 0; }
.start-menu-section h2 { margin: 0 0 5px; border-bottom: 1px solid #edf0f4; }
.start-menu-section-heading { display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 4px 6px; color: #35445a; font-size: 12px; font-weight: 700; }
.start-menu-section-toggle { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 28px; padding: 0 4px 6px; border: 0; border-radius: 0; background: transparent; color: #35445a; text-align: left; font-size: 12px; font-weight: 700; }
.start-menu-section-toggle:hover { background: #edf1f7; }
.start-menu-section-chevron { margin-left: auto; color: #748198; font: 16px/1 Arial, sans-serif; }
.start-menu-items { display: grid; gap: 2px; }
.start-menu-entry { display: flex; align-items: center; min-width: 0; border-radius: 6px; }
.start-menu-open { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; min-height: 34px; padding: 4px 6px; border-color: transparent; background: transparent; text-align: left; font-size: 12px; }
.start-menu-open:hover { background: #edf1f7; }
.start-menu-open[aria-pressed="true"] { color: #801818; border-color: #e4c3c3; background: #fbeded; }
.start-menu-icon { display: inline-grid; flex: 0 0 20px; place-items: center; font-family: "Segoe UI Emoji", sans-serif; font-size: 15px; }
.start-menu-pin { flex: 0 0 28px; width: 28px; min-width: 28px; min-height: 30px; padding: 0; border-color: transparent; background: transparent; color: #778395; font: 17px/1 Arial, sans-serif; }
.start-menu-pin:hover, .start-menu-pin[aria-pressed="true"] { color: #a80000; background: #fff4f4; }
.window-taskbar-with-tools .window-taskbar-scroll { grid-column: 2; }
.window-taskbar-tools { grid-column: 3; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.taskbar-system-tray { display: flex; align-items: center; gap: 4px; padding-right: 7px; border-right: 1px solid #cbd3de; }
.taskbar-site { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 38px; height: 36px; padding: 4px 7px; border: 1px solid transparent; border-radius: 7px; color: #303030; text-decoration: none; font-weight: 600; }
.taskbar-site:hover { border-color: #cbd3de; background: #fff; text-decoration: none; }
.taskbar-directions { flex-wrap: nowrap; gap: 3px; }
.taskbar-directions button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; height: 36px; padding: 4px 8px; border-radius: 7px; font-size: 12px; white-space: nowrap; }
.taskbar-directions button[aria-pressed="true"] { color: #801818; border-color: #d6abab; background: var(--selected); box-shadow: inset 0 -2px var(--red); font-weight: 700; }
.taskbar-lock, .taskbar-logout { display: inline-grid; place-items: center; min-width: 36px; height: 36px; min-height: 36px; padding: 4px 8px; border-color: transparent; background: transparent; color: #39475b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.taskbar-lock { font-size: 18px; }
.taskbar-lock:hover, .taskbar-logout:hover { border-color: #cbd3de; background: #fff; }
.taskbar-connection { width: 22px; height: 30px; min-height: 30px; padding: 0; border: 0; background: transparent; }
.taskbar-connection:hover { border: 0; background: transparent; }
.window-taskbar-version { padding: 5px 7px; color: #59677a; border: 1px solid #cbd3de; border-radius: 7px; background: #ffffff9c; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.window-taskbar-update { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 4px 9px; color: #801818; border-color: #d6abab; background: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.window-taskbar-update:hover:not(:disabled) { background: var(--selected); }
.window-taskbar-update:disabled { color: #687589; border-color: #cbd3de; background: #ffffff9c; }
.window-taskbar-settings { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border-color: transparent; background: transparent; color: #455971; }
.window-taskbar-settings span { font: 24px/1 "Segoe UI Symbol", Arial, sans-serif; }
.window-taskbar-settings:hover, .window-taskbar-settings:has(+ :popover-open) { background: #fff; border-color: #cbd3de; color: #801818; }
.taskbar-settings-menu {
  --control-height: 34px;
  --settings-menu-accent: #1761a0;
  position: fixed;
  inset: auto max(8px, env(safe-area-inset-right, 0px)) calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px) + 8px) auto;
  margin: 0;
  padding: 0;
  width: min(535px, calc(100vw - 16px));
  max-height: min(72dvh, 620px, calc(100dvh - var(--taskbar-height) - 24px - env(safe-area-inset-bottom, 0px)));
  overflow: auto;
  border: 1px solid #cbd6e3;
  border-radius: 12px;
  background: #f4f7fb;
  color: #233347;
  box-shadow: 0 12px 34px #1a2a4035;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.taskbar-settings-header {
  position: sticky; top: 0; z-index: 1; padding: 15px 16px 12px;
  border-bottom: 1px solid #dce4ee; background: #f4f7fb;
}
.taskbar-settings-header h2 { margin: 0 0 10px; font-size: 17px; font-weight: 650; }
.taskbar-settings-search { position: relative; display: block; }
.taskbar-settings-search svg, .taskbar-settings-links svg {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.taskbar-settings-search svg { position: absolute; top: 50%; left: 10px; translate: 0 -50%; pointer-events: none; color: #4b617d; }
.taskbar-settings-search input[type="search"] {
  width: 100%; padding-inline: 36px 8px; border: 1px solid #cbd6e3; border-radius: 7px; background: #fff;
}
.taskbar-settings-menu nav { padding: 5px 10px 12px; }
.taskbar-settings-section { padding: 7px 5px; }
.taskbar-settings-section + .taskbar-settings-section { border-top: 1px solid #dce4ee; }
.taskbar-settings-section h3 { margin: 0 8px 5px; font-size: 12px; font-weight: 650; color: #465b75; }
.taskbar-settings-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 5px; }
.taskbar-settings-links button {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding-inline: 8px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: #233347;
  font: inherit; text-align: start;
}
.taskbar-settings-links button:hover { background: #e9eff7; }
.taskbar-settings-links button[aria-pressed="true"] { background: #e2edfa; border-color: #d4e3f5; color: #174f84; font-weight: 650; }
.taskbar-settings-links svg { color: #3b6590; }
.taskbar-settings-menu :focus-visible { outline: 2px solid var(--settings-menu-accent); outline-offset: 1px; }
.taskbar-settings-empty { margin: 8px; }
@media (max-width: 490px) { .taskbar-settings-links { grid-template-columns: 1fr; } }
.window-content:has(> .settings-workspace) { container: settings-window / inline-size; }
.settings-workspace {
  --settings-accent: #1761a0;
  --settings-border: #dce2ea;
  display: grid;
  grid-template-columns: minmax(212px, 244px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 46px);
  min-height: 540px;
  padding: 22px clamp(18px, 2.3vw, 38px) 32px;
  background: #f3f6fa;
  border: 1px solid var(--settings-border);
  border-radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #202a38;
}
.settings-sidebar { --control-height: 34px; position: sticky; top: 0; min-width: 0; }
.settings-sidebar h2 { margin: 0 0 14px; font-size: 20px; font-weight: 650; }
.settings-search { position: relative; margin-bottom: 12px; }
.settings-search svg, .settings-section-link svg {
  width: 19px;
  height: 19px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; pointer-events: none; color: #465a72; }
.settings-search input[type="search"] {
  width: 100%; min-height: 36px; padding: 6px 8px 6px 36px;
  border: 1px solid var(--settings-border); border-radius: 7px; background: #fff;
}
.settings-sidebar nav { --control-height: 38px; display: grid; gap: 3px; }
.settings-sidebar .settings-section-link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px;
  padding: 6px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: #24374c; text-align: start;
}
.settings-sidebar .settings-section-link:hover { background: #e8eef6; }
.settings-sidebar .settings-section-link[aria-current="page"] {
  background: #e3edf9; color: #174f84; border-color: #d5e3f4; font-weight: 650;
}
.settings-sidebar .settings-section-link[aria-current="page"]::before {
  position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 2px;
  background: var(--settings-accent); content: "";
}
.settings-workspace :focus-visible { outline: 2px solid var(--settings-accent); outline-offset: 2px; }
.settings-content { container: settings-content / inline-size; min-width: 0; max-width: 1240px; }
.settings-page-heading { --control-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.settings-page-heading h2 { margin: 0; font-size: clamp(24px, 2vw, 32px); font-weight: 650; line-height: 1.2; }
.settings-page-heading > button { min-height: 32px; flex: none; }
.settings-feedback { margin: 0 0 10px; }
.settings-form { --control-height: 32px; }
.settings-form > fieldset { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-card { padding: 16px 18px; border: 1px solid var(--settings-border); border-radius: 8px; background: #fff; }
.settings-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.settings-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px 16px; }
.settings-field-grid .settings-wide-field { grid-column: span 2; }
.settings-field-grid label, .settings-logo label { display: grid; align-content: start; gap: 4px; min-width: 0; }
.settings-field-grid :is(input:not([type="checkbox"]), select), .settings-logo input { min-height: 32px; width: 100%; min-width: 0; font-family: inherit; }
.settings-field-grid .settings-checkbox { display: flex; align-items: center; gap: 8px; }
.settings-logo { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.settings-logo img { max-height: 64px; object-fit: contain; }
.settings-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; margin: 0; }
.settings-field-grid + .settings-facts { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--settings-border); }
.settings-facts dt { color: #435775; font-size: 12px; }
.settings-facts dd { margin: 2px 0 0; font-weight: 600; }
.settings-form-actions { padding: 10px 0 0; }
@container settings-content (min-width: 750px) {
  .settings-field-grid:has(.settings-wide-field) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container settings-content (max-width: 749px) {
  .settings-field-grid .settings-wide-field { grid-column: auto; }
}
@container settings-window (max-width: 760px) {
  .settings-workspace { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 18px; }
  .settings-sidebar { position: static; }
  .settings-sidebar nav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); }
}
.window-taskbar-track { display: flex; justify-content: center; align-items: center; gap: 6px; width: max-content; min-width: 100%; padding: 1px 6px 5px; }
.window-taskbar-item { position: relative; display: flex; align-items: center; flex: none; border-radius: 8px; }
.window-taskbar-item:hover { background: #ffffff91; }
.window-taskbar-item[data-active="true"] { background: #fff; box-shadow: inset 0 0 0 1px #cbd3de; }
.window-taskbar-item::after {
  content: ""; position: absolute; pointer-events: none; bottom: 2px; left: 50%; translate: -50% 0;
  width: 5px; height: 3px; border-radius: 3px; background: #73849a;
}
.window-taskbar-item[data-active="true"]::after { width: 23px; background: var(--red); }
.window-taskbar-item[data-minimized="true"]::after { background: #a5adb8; }
.window-taskbar-item button { border: 0; min-height: 40px; background: transparent; }
.window-taskbar-item button:focus-visible { outline-offset: -2px; }
.window-taskbar-open { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: min(220px, 58vw); padding: 4px 7px 7px 9px; }
.window-taskbar-open[aria-pressed="true"] { background: transparent; color: #661522; }
.window-taskbar-icon { display: block; flex: 0 0 20px; width: 20px; height: 20px; color: currentColor; }
.window-taskbar-icon path { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.window-taskbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-taskbar-close { width: 31px; padding: 3px 0 6px; color: #546071; }
.window-taskbar-close:hover { background: #f7dfe1; color: #8f1d25; }
.window-taskbar-item[data-minimized="true"] .window-taskbar-open { color: #505e70; }
.window-taskbar .window-dirty { margin-inline-start: 0; }

/* Centered, draggable app icons with their names, like a compact desktop dock. */
.desktop-quick-launchers { justify-content: center !important; background: transparent !important; border-bottom-color: transparent !important; }
.desktop-quick-context { position: absolute !important; left: 12px; margin: 0 !important; padding-right: 0 !important; border: 0 !important; }
.desktop-quick-launcher { flex: 0 0 82px !important; width: 82px !important; min-width: 82px !important; height: 70px !important; min-height: 70px !important; padding: 2px 3px !important; gap: 2px !important; border-color: transparent !important; border-radius: 8px !important; background: transparent !important; flex-direction: column !important; cursor: grab; }
.desktop-quick-launcher:active { cursor: grabbing; }
.desktop-quick-launcher:hover, .desktop-quick-launcher:focus-visible, .desktop-quick-report-folder[open] > .desktop-quick-launcher { border-color: transparent !important; background: transparent !important; }
.desktop-quick-launcher > span:last-child { display: block !important; max-width: 100%; font-size: 10px; line-height: 1.1; text-align: center; }
.desktop-quick-launcher.is-dragging { opacity: .45; }
.desktop-quick-launcher-icon, .desktop-quick-launcher-icon.desktop-icon-receipts, .desktop-quick-launcher-icon.desktop-icon-shipments,
.desktop-quick-launcher-icon.desktop-icon-stock, .desktop-quick-launcher-icon.desktop-launcher-report,
.desktop-quick-launcher-icon.desktop-icon-payments, .desktop-quick-launcher-icon.desktop-icon-expenses {
  flex: 0 0 32px !important; width: 32px !important; height: 32px !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
}
.desktop-quick-launcher-icon svg { width: 27px !important; height: 27px !important; }
@media (max-width: 900px) {
  .desktop-quick-launchers { justify-content: flex-start !important; min-height: 76px !important; height: 76px !important; flex-basis: 76px !important; }
  .desktop-quick-context { position: static !important; margin-right: 4px !important; }
  .desktop-quick-launcher { flex: 0 0 74px !important; width: 74px !important; min-width: 74px !important; height: 68px !important; min-height: 68px !important; }
}
/* Soft macOS-style dock surface behind the centered shortcuts. */
.desktop-quick-launchers {
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  min-height: 76px !important;
  height: 76px !important;
  margin: 8px auto 10px !important;
  padding: 3px 12px !important;
  gap: 3px !important;
  overflow-x: auto;
  border: 1px solid #dce2eb !important;
  border-radius: 19px !important;
  background: linear-gradient(180deg, #ffffffd9 0%, #f5f7fbe8 100%) !important;
  box-shadow: 0 5px 18px #28364b12, inset 0 1px #ffffff;
  backdrop-filter: blur(12px);
}
.desktop-quick-context { position: static !important; margin: 0 8px 0 0 !important; padding: 3px 10px 3px 2px !important; border-right: 1px solid #d7dee8 !important; }
.desktop-quick-launcher:hover, .desktop-quick-launcher:focus-visible, .desktop-quick-report-folder[open] > .desktop-quick-launcher {
  border-color: transparent !important;
  border-radius: 12px !important;
  background: #e8edf588 !important;
}
@media (max-width: 900px) {
  .desktop-quick-launchers { margin: 8px auto 10px !important; }
  .desktop-quick-context { margin-right: 4px !important; }
}
.window-dirty { margin-inline-start: 7px; color: #9b5700; font-size: 10px; vertical-align: 1px; }
.connection-button { min-width: 24px; min-height: 34px; padding: 0 4px; border: 0; background: transparent; cursor: pointer; }
.connection-button[aria-expanded="true"] { background: #edf1f4; }
.realtime-diagnostics { margin-bottom: 12px; max-width: 760px; }
.realtime-diagnostics .panel-heading { flex-wrap: wrap; }
.realtime-diagnostics .panel-heading strong { margin-inline-end: auto; }
.realtime-diagnostics col:first-child { width: 240px; }
.realtime-diagnostics col:last-child { width: 200px; }
.local-draft-toolbar { justify-content: flex-end; padding-block: 3px; }
.local-draft-toolbar button { min-height: 30px; }
.local-draft-toolbar [role="status"] { color: #2e6543; }
td.sheet-resize-header { position: relative; }
.sheet-resize-header::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: 12px;
  cursor: col-resize;
  background: linear-gradient(to right, var(--column-grip-color, #78899a) 1px, transparent 1px 4px,
    var(--column-grip-color, #78899a) 4px) center / 5px 14px no-repeat;
}
.sheet-resize-header:hover::after { --column-grip-color: #425d78; }
.financial-monthly-grid .sheet-resize-header { --column-grip-color: #bad8ec; }
.financial-monthly-grid .sheet-resize-header:hover::after { --column-grip-color: #fff; }
.workbook-grid :is(input, select, textarea) { max-width: 100%; }
.sheet-pinned > thead > tr > :first-child { left: 0; z-index: 3; }
.sheet-pinned > tbody > tr > :first-child { position: sticky; left: 0; z-index: 2; background: white; box-shadow: 1px 0 #aeb4bb; }
.sheet-pinned > tbody > tr:nth-child(even) > :first-child { background: #edf3fa; }
.sheet-pinned > tbody > tr > [data-sheet-selected]:first-child { background: #e7f3ea; }
.application .workbook-grid tbody > tr > td :is(input:not([type="checkbox"]):not([type="radio"]), textarea) { cursor: text; }
.application .workbook-grid tbody > tr > td select { cursor: pointer; }
.product-history-heading { justify-content: flex-start; }
.product-history-scroll { max-block-size: 65dvh; overflow: auto; scrollbar-gutter: stable; }
.window-frame[data-placement="maximized"] > .window-content:has(.product-history-scroll) {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}
.product-history-table { min-width: 850px; table-layout: fixed; }
.history-row-number-column { width: 4%; }
.history-date-column { width: 9%; }
.history-operation-column { width: 13%; }
.history-document-column { width: 8%; }
.history-party-column { width: 16%; }
.history-route-column { width: 15%; }
.history-lot-column { width: 11%; }
.history-quantity-column { width: 8%; }
.product-history-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
.product-history-table tbody .history-row-number { text-align: center; }
.product-history-table .history-incoming { color: #236442; }
.product-history-table .history-outgoing { color: #8a3333; }
.product-history-table .history-balance { font-weight: 700; background: #eef3f8; }
.product-history-table tfoot th { position: static; text-align: left; }
.product-history-table tfoot td { background: #f5f7fa; font-weight: 700; }
.product-history-table .history-empty { padding-inline: 10px; }
.product-history-summary { margin-top: 10px; border: 1px solid var(--border); border-radius: 6px; background: #f6f7f8; }
.product-history-summary summary { padding: 8px 10px; cursor: pointer; font-weight: 600; }
.product-history-summary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 6px; margin: 0; padding: 0 8px 8px; }
.product-history-summary dl > div { border: 1px solid var(--border); border-radius: 4px; background: #fff; padding: 6px 8px; }
.product-history-summary dt { font-size: 11px; }
.product-history-summary dd { margin: 3px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.product-page-heading { display: flex; align-items: center; min-height: 38px; margin: 0 0 12px; }
.product-page-heading h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.product-catalog-panel { margin-bottom: 12px; }
.product-catalog-heading { justify-content: space-between; gap: 12px; }
.product-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.product-object-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.product-object-filter strong { font-size: 12px; }
.product-object-filter button { min-height: 30px; height: 30px; padding: 3px 10px; }
.product-object-filter button.selected { color: var(--red); border-color: #d6abab; background: var(--selected); font-weight: 700; }
.product-filter-toolbar { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.product-filter-toolbar label { display: grid; gap: 3px; font-size: 11px; color: #606060; }
.product-filter-toolbar .product-search { display: flex; align-items: end; gap: 6px; }
.product-filter-toolbar .product-search label { min-width: min(255px, 35vw); }
.product-filter-toolbar .product-search input { width: 100%; }
.product-form-dialog { width: min(1000px, 100%); }
.product-label-dialog { width: min(1100px, 100%); }
.product-archive-dialog { width: min(560px, 100%); }
.desktop-stage { position: relative; min-width: 0; height: max(420px, calc(100dvh - 150px - var(--taskbar-height))); max-height: calc(100dvh - 110px - var(--taskbar-height)); overflow: hidden; }
.desktop-stage:not([data-placement="maximized"]) { background: #e9edf2; }
.desktop-stage { flex: 1 1 auto; min-height: 0; }
@media (min-width: 901px) {
  .desktop:has(.desktop-quick-launchers) { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; padding: 12px 16px calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px) + 8px); }
  .desktop-workspace { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; overflow: hidden; }
  .desktop-quick-launchers { position: relative; top: auto; order: 0; flex: 0 0 76px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px; width: 100%; height: 76px; min-height: 0; padding: 3px 10px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-left: 0; border-bottom: 1px solid #d5dbe4; background: #e8edf6ed; }
  .desktop-quick-context { margin: 0 4px 0 0; padding: 3px 10px 3px 1px; border-right: 1px solid #ccd3de; border-bottom: 0; font-size: 12px; text-align: left; white-space: nowrap; }
  .desktop-quick-launcher { flex: 0 0 88px; flex-direction: column; justify-content: center; gap: 2px; width: 88px; min-width: 88px; min-height: 70px; height: 70px; padding: 3px; font-size: 10px; text-align: center; white-space: normal; }
  .desktop-quick-launcher > span:last-child { flex: 0 0 auto; min-width: 0; text-align: center; line-height: 1.15; }
  .desktop-quick-launcher-icon { flex: 0 0 36px; width: 36px; height: 36px; }
  .desktop-quick-report-folder { flex: 0 0 auto; width: auto; }
  .desktop-quick-report-folder .desktop-report-menu { top: calc(100% + 4px); right: auto; left: 0; }
  .desktop-stage { order: 1; flex: 1 1 auto; width: 100%; height: auto; max-height: none; }
  .desktop-home { height: 100%; min-height: 0; }
}
.window-frame { min-width: 0; isolation: isolate; }
.window-frame .window-title { padding: 3px 5px 3px 12px; min-height: 35px; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.window-caption { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; min-height: 29px; cursor: grab; touch-action: none; user-select: none; }
.window-caption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-actions { display: flex; flex: 0 0 auto; align-items: center; }
.window-actions button { min-height: 29px; min-width: 30px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; }
.window-actions button:hover { background: #e1e5ea; }
.window-actions button:last-child:hover { background: #f1d6d6; color: #9b1a1a; }
.window-frame:not([data-placement="maximized"]) { position: absolute; display: flex; flex-direction: column; border: 1px solid #c0c7cf; background: #f7f8fa; border-radius: 6px; box-shadow: 0 3px 12px #010c211a; overflow: hidden; }
.window-frame[data-placement="maximized"] { position: absolute; inset: 0; display: flex; flex-direction: column; width: auto; height: auto; max-width: 100%; max-height: 100%; overflow: hidden; }
.window-frame[data-placement="left"], .window-snap-preview[data-placement="left"] { inset: 0 calc(50% + 2px) 0 0; }
.window-frame[data-placement="right"], .window-snap-preview[data-placement="right"] { inset: 0 0 0 calc(50% + 2px); }
.window-frame[data-placement="floating"] {
  width: min(var(--window-width, 78%), 100%);
  height: min(var(--window-height, 82%), 100%);
  min-width: min(max(360px, 78%), 100%);
  min-height: min(max(220px, 82%), 100%);
  left: min(var(--window-x, 11%), calc(100% - min(var(--window-width, 78%), 100%)));
  top: min(var(--window-y, 9%), calc(100% - min(var(--window-height, 82%), 100%)));
}
.window-frame:not([data-placement="maximized"]) > .window-content, .window-preview { min-height: 0; overflow: auto; flex: 1 1 auto; }
.window-frame > .window-content { padding: 12px; }
.window-inactive .window-title, .window-snap-assist .window-title { background: #e3e7eb; }
.window-preview { padding: 8px; }
.window-preview button { margin: 3px; }
.window-active { z-index: 1; }
.window-snap-preview { position: absolute; inset: 0; border: 2px solid #7296c9; background: #a8c7ef57; z-index: 4; pointer-events: none; }
.window-resize { position: absolute; right: 2px; bottom: 2px; min-height: 26px; min-width: 26px; padding: 0; cursor: nwse-resize; touch-action: none; }
@media (max-width: 900px) {
  .desktop:has(.desktop-quick-launchers) { display: block; height: auto; min-height: calc(100dvh - 62px); overflow: visible; padding: 12px; }
  .desktop-workspace { display: block; height: auto; min-height: 0; overflow: visible; }
  .desktop-quick-launchers { position: sticky; top: 0; order: 0; flex-basis: 76px; width: auto; height: 76px; min-height: 0; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; border-right: 0; border-left: 0; border-bottom: 1px solid #d5dbe4; }
  .desktop-quick-context { margin-right: 3px; padding: 3px 8px 3px 1px; border-right: 1px solid #ccd3de; border-bottom: 0; text-align: left; white-space: nowrap; }
  .desktop-quick-launcher { flex: 0 0 80px; flex-direction: column; justify-content: center; gap: 2px; width: 80px; min-width: 80px; min-height: 70px; height: 70px; padding: 3px; font-size: 10px; text-align: center; white-space: normal; }
  .desktop-quick-launcher > span:last-child { flex: 0 0 auto; text-align: center; line-height: 1.15; }
  .desktop-quick-launcher-icon { flex: 0 0 36px; width: 36px; height: 36px; }
  .desktop-quick-report-folder { width: auto; }
  .desktop-stage { width: 100%; }
  .start-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .window-taskbar-tools { gap: 3px; }
  .taskbar-system-tray { gap: 2px; padding-right: 4px; }
  .taskbar-site { width: 34px; min-width: 34px; padding-inline: 4px; }
  .taskbar-site span { display: none; }
  .window-taskbar-update { width: 36px; min-width: 36px; padding: 4px; }
  .window-taskbar-update > span:last-child { display: none; }
  .window-taskbar-item button { min-height: 44px; }
  .window-taskbar-close { width: 40px; }
  .window-taskbar-scroll { scrollbar-width: none; }
  .desktop-stage { height: auto; max-height: none; overflow: visible; background: transparent; }
  .desktop-stage .window-active:not([data-placement="maximized"]) { position: static; width: 100%; height: auto; box-shadow: none; overflow: visible; }
  .desktop-stage .window-active[data-placement="maximized"] { position: static; width: 100%; height: auto; max-width: none; max-height: none; overflow: visible; }
  .desktop-stage .window-active:not([data-placement="maximized"]) > .window-content { overflow: visible; }
  .window-snap-preview, .desktop-stage .window-snap-assist, .window-wide-control, .window-resize { display: none; }
  .window-caption { cursor: default; touch-action: auto; }
  .window-actions button { min-height: 40px; min-width: 40px; }
}
@media (max-width: 520px) {
  .start-menu-grid { grid-template-columns: 1fr; }
  .start-menu-panel { inset-inline: 8px; width: auto; padding: 12px; }
  .window-taskbar-with-tools { grid-template-columns: 54px minmax(0, 1fr) auto; }
  .taskbar-direction-label { display: none; }
  .taskbar-directions button { min-width: 32px; width: 32px; padding-inline: 3px; justify-content: center; }
  .taskbar-logout { width: 34px; min-width: 34px; padding: 0; overflow: hidden; font-size: 0; }
  .taskbar-logout::before { content: "⏻"; font-size: 18px; }
  .window-taskbar-version { display: none; }
  .window-taskbar-settings { width: 36px; min-height: 40px; }
}
@media print {
  .window-taskbar { display: none !important; }
  .desktop.desktop-with-taskbar { padding-bottom: 0; }
  .desktop-stage { height: auto !important; }
  .desktop-stage .window-active { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; }
  .desktop-stage .window-active > .window-content { overflow: visible !important; }
  .window-inactive, .window-snap-assist, .window-snap-preview, .window-resize { display: none !important; }
}

/* Shared compact sizing, calibrated against the receipt register page. */
button,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 32px;
  min-height: 32px;
  padding-block: 4px;
}
.header-navigation summary,
.header-navigation .header-menu-single,
.header-directions button,
.flutter-header .header-directions button,
.site-link,
.profile-action,
.header-icon,
.connection-button,
.window-taskbar-item button,
.window-taskbar-update,
.window-taskbar-settings,
.taskbar-settings-links button,
.window-actions button,
.window-resize,
.back-action,
.soft-action,
.compact-primary,
.compact-control select,
.receipt-fields.reference-fields input,
.receipt-fields.reference-fields select,
.journal-pager button,
.local-draft-toolbar button {
  height: 32px;
  min-height: 32px;
}
.header-navigation .menu-items button { height: 32px; min-height: 32px; }
.document-badge { height: 32px; min-height: 32px; }
.receipt-lines input, .receipt-lines select { height: 32px; min-height: 32px; }
input[type="file"] { height: 32px; min-height: 32px; padding-block: 2px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; }
.journal-table th, .receipt-lines th { height: 36px; padding-block: 4px; }
.journal-table td, .receipt-lines td { height: 32px; padding-block: 2px; }
.receipt-lines > tbody > tr > td { height: 32px; padding-block: 0; }
.receipt-lines > tbody > tr > td :is(input, select, button) { height: 28px; min-height: 28px; padding-block: 2px; }
.facts dt, .facts dd { display: flex; align-items: center; min-height: 32px; }
.hint, .error, .realtime-notice, .compact-hint, .status-chip, .window-taskbar-version {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding-block: 5px;
}
th, td { height: 32px; padding-block: 2px; }
thead th { height: 36px; padding-block: 4px; }
.workbook-grid > tbody td, .workbook-grid > tbody th { height: 36px; padding-block: 2px; }
.payroll-calendar td button { min-height: 32px; }
.financial-bars-area button { height: auto; min-height: 0; }
.window-resize { min-width: 26px; height: 26px; min-height: 26px; }
.window-content table thead th { height: 36px; padding-block: 4px; }
.window-content table tbody td, .window-content table tbody th { height: 36px; padding-block: 2px; }
.window-content table tbody :is(input, select, button) { height: 28px; min-height: 28px; padding-block: 2px; }

/* Final application-wide sizing: keep every document header on the receipt rhythm. */
.application button:not(.financial-bars-area button):not(.window-resize):not(.desktop-launcher),
.application input:not([type="checkbox"]):not([type="radio"]),
.application select {
  height: 32px !important;
  min-height: 32px !important;
  padding-block: 4px !important;
}
.application input[type="checkbox"], .application input[type="radio"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 0 !important;
  padding: 0 !important;
}
.application table thead th {
  height: 36px !important;
  padding-block: 4px !important;
  line-height: 18px !important;
}
.application .window-content table thead th button.column-sort {
  display: inline-flex;
  align-items: center;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  line-height: 18px !important;
  vertical-align: middle;
}
.application table tbody td, .application table tbody th {
  height: 36px !important;
  padding-block: 2px !important;
}
.application table :is(th, td).workbook-row-number {
  width: 56px;
  min-width: 48px;
  max-width: 96px;
  padding-inline: 4px !important;
  text-align: center !important;
  color: #586473;
  font-variant-numeric: tabular-nums;
}
.application .table-wrap > table {
  width: max-content;
  margin-inline-end: auto;
}
@media screen {
  .application :is(.table-wrap, .journal-table):has(> table) {
    inline-size: max-content;
    max-inline-size: 100%;
    justify-self: start;
    margin-inline-end: auto;
  }
}
.application .table-wrap > table :is(thead th, tbody td, tbody th) {
  white-space: nowrap;
}
.application table tbody .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 0;
}
.application table tbody :is(button, input:not([type="checkbox"]):not([type="radio"]), select) {
  height: 32px !important;
  min-height: 32px !important;
  padding-block: 2px !important;
}
.application .financial-bars-area button { height: auto !important; min-height: 0 !important; padding: 0 !important; }
.application .window-resize { height: 26px !important; min-height: 26px !important; }

/* Tablet and narrow desktop use a compact menu trigger instead of shrinking
   every section label until the navigation is difficult to read. */
@media (max-width: 1450px) {
  .flutter-header {
    height: auto;
    min-height: 62px;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 6px 14px;
  }
  .flutter-header > .header-navigation {
    order: 1;
    flex: 1 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    display: block;
    height: auto;
    min-height: 36px;
    overflow: visible;
  }
  .header-navigation > .responsive-nav-menu { display: block; position: relative; z-index: 40; }
  .responsive-nav-menu > .responsive-nav-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: #303030;
    font-weight: 700;
    cursor: pointer;
  }
  .responsive-nav-menu[data-open="true"] > .responsive-nav-summary { border-color: #d6abab; color: var(--red); background: var(--selected); }
  .responsive-nav-menu > .header-navigation-items { display: none; }
  .responsive-nav-menu[data-open="true"] > .header-navigation-items {
    position: absolute;
    top: 42px;
    left: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    align-items: start;
    gap: 4px;
    width: min(880px, calc(100vw - 28px));
    max-height: calc(100dvh - 150px);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 26px #1018282b;
  }
  .header-navigation-items > .header-menu-entry,
  .header-navigation-items > details > summary {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid #e1e5ec;
    border-radius: 7px;
    background: #fff;
    text-align: left;
    white-space: nowrap;
  }
  .header-navigation-items > .header-menu-entry:hover,
  .header-navigation-items > details > summary:hover { background: #f7f8fa; }
  .header-navigation-items > .header-menu-entry-single:has(.header-menu-single[aria-pressed="true"]),
  .header-navigation-items > details:has(.header-menu-choice[aria-pressed="true"]) > summary { color: var(--red); border-color: #d6abab; background: var(--selected); }
  .header-navigation-items > .header-menu-entry > .header-menu-single,
  .header-navigation-items > .header-menu-entry > .header-menu-choice { flex: 1 1 auto; height: 36px; min-height: 36px; padding: 0 8px; border: 0; background: transparent; text-align: left; }
  .header-navigation-items > .header-menu-entry > .header-menu-pin { flex: 0 0 30px; width: 30px; min-width: 30px; }
  .header-navigation-items > details > .menu-items { top: 37px; }
}

@media (max-width: 900px) {
  .flutter-header > .header-navigation {
    order: 3;
    flex-basis: 100%;
    min-width: 100%;
  }
  .flutter-header > .header-directions { margin-left: auto; }
}

/* Ubuntu-style application bar: a slim full-width strip with centered shortcuts. */
.desktop-quick-launchers {
  position: sticky !important;
  top: 0 !important;
  z-index: 7;
  display: flex;
  flex: 0 0 64px !important;
  align-items: center;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  height: 64px !important;
  min-height: 64px !important;
  margin: 0 !important;
  padding: 3px 116px !important;
  gap: 5px !important;
  overflow-x: auto;
  border: 0 !important;
  border-bottom: 1px solid #d8dee8 !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #f6f7f9 0%, #edf0f4 100%) !important;
  box-shadow: inset 0 1px #fff, 0 2px 5px #27364a0b;
  backdrop-filter: none;
}
.desktop-quick-context {
  position: absolute !important;
  left: 20px;
  margin: 0 !important;
  padding: 3px 0 !important;
  border: 0 !important;
  color: #344154;
}
.desktop-quick-launcher {
  flex: 0 0 78px !important;
  width: 78px !important;
  min-width: 78px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 2px 3px 4px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  cursor: grab;
}
.desktop-quick-launcher:hover,
.desktop-quick-launcher:focus-visible,
.desktop-quick-report-folder[open] > .desktop-quick-launcher {
  border-color: transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
}
.desktop-quick-launcher.is-active {
  color: #a40000 !important;
  background: transparent !important;
  box-shadow: inset 0 -2px #b40000;
}
.desktop-quick-launcher-icon svg { width: 26px !important; height: 26px !important; }
@media (max-width: 900px) {
  .desktop-quick-launchers {
    justify-content: flex-start !important;
    padding: 3px 8px !important;
  }
  .desktop-quick-context { position: static !important; margin-right: 4px !important; }
  .desktop-quick-launcher { flex-basis: 72px !important; width: 72px !important; min-width: 72px !important; }
}
.desktop-quick-launcher.is-active {
  padding-bottom: 4px !important;
  box-shadow: none !important;
}
.desktop-quick-launcher.is-active > span:last-child {
  width: fit-content;
  margin-inline: auto;
  padding: 0 2px 2px;
  border-bottom: 3px solid #b40000;
  border-radius: 1px;
}

/* Give document controls room and keep journal tables compact and readable. */
.document-toolbar { column-gap: 12px; row-gap: 8px; }
.panel-filter { gap: 8px; }
.journal-pager { gap: 8px; }
.journal-pager button {
  width: auto !important;
  min-width: 30px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}
.receipt-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
}
.receipt-workspace > .document-toolbar,
.receipt-workspace > .receipt-split { width: 100%; margin: 0; }
.receipt-workspace > .line-items-panel { margin-top: 0; }
.receipt-editor.receipt-workspace > fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.receipt-editor.receipt-workspace > fieldset > .line-items-panel { margin-top: 0; }
.document-operation-workspace > .operation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.document-operation-workspace > .operation-form > fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.document-operation-workspace > .operation-form > fieldset > .line-items-panel { margin-top: 0; }
.window-content:has(.receipt-workspace) { padding: 18px 24px 36px; }
.receipt-workspace .panel-heading { min-height: 0; padding: 8px 12px; }
.document-operation-workspace .receipt-details > .panel-heading { min-height: 36px; }
.document-operation-workspace .receipt-details > .panel-heading > .status-chip {
  min-height: 0;
  padding-block: 0;
  line-height: 18px;
}
.window-content:has(> :is(.dispatch-workspace, .receiving-workspace)) { scrollbar-gutter: stable; }
:is(.dispatch-workspace, .receiving-workspace) > .document-toolbar > .document-badge { min-inline-size: 166px; }
:is(.dispatch-workspace, .receiving-workspace) .receipt-split > .receipt-journal {
  display: flex;
  flex-direction: column;
  block-size: 376px;
}
:is(.dispatch-workspace, .receiving-workspace) .receipt-split > .receipt-details { min-block-size: 320px; }
:is(.dispatch-workspace, .receiving-workspace) .panel-heading { position: relative; }
.operation-loading {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--red), transparent) left / 35% 100% no-repeat;
  animation: operation-loading-slide 1.2s ease-in-out infinite alternate;
}
.operation-loading > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
@keyframes operation-loading-slide { to { background-position: right; } }
@media (prefers-reduced-motion: reduce) {
  .operation-loading { animation: none; background-size: 100% 100%; }
}
:is(.dispatch-workspace, .receiving-workspace) .receipt-details .receipt-fields > :is(label, .partner-picker-field) {
  display: grid;
  align-content: start;
  gap: 4px;
  line-height: 17px;
}
.document-operation-workspace .receipt-details fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.document-operation-workspace .receipt-split { align-items: start; }
.document-operation-workspace .receipt-split > .receipt-journal,
.document-operation-workspace .receipt-split > .receipt-details { align-self: start; margin-block-start: 0; }
.document-operation-workspace .return-secondary-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; }
.document-operation-workspace .return-secondary-fields > .return-reason { grid-column: span 3; }
.document-operation-workspace .return-secondary-fields > .return-reason:only-child { grid-column: 1 / -1; }
.application .journal-table { height: 279px; min-height: 279px; max-height: 279px; }
.application :is(.dispatch-workspace, .receiving-workspace) .receipt-journal > .journal-table {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}
/* The journal is a fixed-height column: its heading must keep its own height
   and let only the table shrink, or the table covers the subtitle. */
.journal-heading { flex-wrap: wrap; flex-shrink: 0; }
.journal-heading > div:first-child { flex: 0 1 auto; min-width: max-content; }
.journal-heading .panel-filter-inline {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 440px;
  gap: 6px;
  padding: 0;
  border: 0;
}
.journal-heading .panel-filter-inline input { min-width: 0; width: 100%; }
.journal-heading .panel-filter-inline button { flex: 0 0 36px; }
.journal-empty-row > td { color: transparent; }
.journal-empty-message { color: #686868 !important; text-align: left; }
.journal-table tbody tr.document-row { cursor: pointer; }
@media (max-width: 1080px) {
  .receipt-workspace .receipt-split { grid-template-columns: minmax(0, 1fr); }
  .receipt-workspace .receipt-journal,
  .receipt-workspace .receipt-details { order: 0; }
  .receipt-workspace .receipt-fields.reference-fields {
    grid-template-columns: 150px repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .document-operation-workspace .return-secondary-fields { grid-template-columns: minmax(0, 1fr); }
  .document-operation-workspace .return-secondary-fields > .return-reason { grid-column: auto; }
}
@media (max-width: 650px) {
  .receipt-workspace .receipt-fields.reference-fields { grid-template-columns: minmax(0, 1fr); }
}

/* One compact vertical rhythm across all working tables and form controls. */
:root {
  --control-height: 24px;
  --table-row-height: 24px;
}
.application table :is(th, td) {
  height: var(--table-row-height) !important;
  padding-block: 0 !important;
  line-height: 17px !important;
}
.application table thead > tr > th,
.application table .empty-grid-row > td {
  height: var(--table-row-height) !important;
  padding-block: 0 !important;
  line-height: 17px !important;
}
.application table :is(th, td) :is(button, input:not([type="checkbox"]):not([type="radio"]), select) {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  max-height: var(--control-height) !important;
  padding-block: 1px !important;
  line-height: 17px !important;
  font-size: 11px !important;
}
.application :is(button, input:not([type="checkbox"]):not([type="radio"]), select):not(.desktop-quick-launcher):not(.desktop-launcher):not(.window-resize):not(.window-taskbar-settings):not(.financial-bars-area button) {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  max-height: var(--control-height) !important;
  padding-block: 1px !important;
  line-height: 17px !important;
  font-size: 12px;
}
.application table :is(th, td) { padding-inline: 6px !important; }
.application table thead th { font-size: 11px !important; }
.application .document-badge {
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  padding-block: 0 !important;
  padding-inline: 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 22px !important;
}
.application .document-badge > span { font-size: 12px; line-height: 1; }

.partner-picker-field { display: grid; gap: 3px; min-width: 0; }
.partner-picker-label { color: #606a78; font-size: 12px; }
.partner-picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; text-align: left; }
.partner-picker-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partner-picker-trigger svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.partner-picker-shade { z-index: 40; }
.dialog-shade .partner-picker-dialog { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: min(960px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 24px)); overflow: hidden; }
.partner-picker-dialog .panel-heading { display: flex; align-items: center; justify-content: space-between; }
.partner-picker-dialog .panel-filter { display: flex; align-items: center; gap: 8px; }
.partner-picker-dialog .panel-filter { padding: 10px 12px; }
.partner-picker-dialog .panel-filter input { flex: 1; min-width: 0; height: 38px; padding-inline: 12px; }
.partner-picker-table-wrap { min-height: 0; overflow: auto; margin: 6px; }
.partner-picker-table-wrap tbody tr { cursor: pointer; user-select: none; }
.partner-picker-table-wrap table { min-width: 920px; }
.partner-picker-table-wrap th, .partner-picker-table-wrap td { height: 40px; padding: 8px 12px; white-space: nowrap; }
.partner-picker-table-wrap th:nth-child(1), .partner-picker-table-wrap td:nth-child(1) { width: 52px; text-align: center; }
.partner-picker-table-wrap th:nth-child(2), .partner-picker-table-wrap td:nth-child(2) { width: 110px; }
.partner-picker-table-wrap th:nth-child(3), .partner-picker-table-wrap td:nth-child(3),
.partner-picker-table-wrap th:nth-child(4), .partner-picker-table-wrap td:nth-child(4) { min-width: 190px; }
.partner-picker-table-wrap th:nth-child(5), .partner-picker-table-wrap td:nth-child(5) { min-width: 190px; }
.partner-picker-table-wrap .partner-debt-cell { font-weight: 700; }
.partner-picker-table-wrap .partner-debt-ok { background: #fff !important; color: #171717 !important; }
.partner-picker-table-wrap .partner-debt-week { background: #ffdf4d !important; color: #171717 !important; }
.partner-picker-table-wrap .partner-debt-partial { background: #ff9b42 !important; color: #c40000 !important; }
.partner-picker-table-wrap .partner-debt-unpaid { background: #e53935 !important; color: #111 !important; }

/* Compact document line grids; keep headers readable and rows consistent. */
.application .line-items-panel > .table-wrap > table tbody > tr > td {
  height: 24px !important;
  min-height: 24px !important;
  padding-block: 0 !important;
  line-height: 18px !important;
}
.application .line-items-panel > .table-wrap > table tbody > tr > td :is(input, select, button) {
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding-block: 0 !important;
  line-height: 18px !important;
}

.application table tbody .status-chip {
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding-block: 0 !important;
  line-height: 16px !important;
}
.application .receipt-details .shipment-actions {
  padding: 10px 8px 6px !important;
}
.application .receipt-details .receipt-document-actions {
  justify-content: flex-end;
  padding: 10px 8px 6px !important;
}
.receiving-workspace .receipt-document-actions > button { font-weight: 600; }
.receiving-workspace .receipt-related-actions { flex-wrap: wrap; padding: 0; margin-inline-start: auto; }
.application :is(.receipt-details, .finance-editor-panel) .shipment-actions button:disabled {
  opacity: 1 !important;
  color: #707986 !important;
  border-color: #c7ced7 !important;
  background: #f5f7f9 !important;
}
.application :is(.receipt-details, .finance-editor-panel) .shipment-actions button.primary:disabled {
  color: #9b5555 !important;
  border-color: #dfb8b8 !important;
  background: #fbf0f0 !important;
}

/* One exact body-row height across every application table, including editable grids. */
.application :is(table, .workbook-grid, .payroll-calendar, .financial-monthly-grid) tbody > tr > :is(td, th) {
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding-block: 0 !important;
  line-height: 17px !important;
}
.application :is(table, .workbook-grid, .payroll-calendar, .financial-monthly-grid) tbody > tr > :is(td, th) :is(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding-block: 0 !important;
  line-height: 17px !important;
}
.application .line-items-panel .line-remove-icon {
  display: inline-grid !important;
  place-items: center;
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding: 0 !important;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #687385;
}
.application .line-items-panel .line-remove-icon:hover:not(:disabled) {
  border-color: #efcaca;
  background: #fff0f0;
  color: #b40000;
}
.application .line-items-panel .line-remove-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.application .line-items-panel .line-remove-icon:disabled { opacity: .4; }
.application .line-items-panel table thead th,
.application .receipt-journal table thead th,
.application .journal-table table thead th,
.application .finance-workspace table thead th { text-align: center !important; }

/* Keep column names centered consistently across every application table. */
.application table thead th { text-align: center !important; }
.application table tbody td.unit-cell { text-align: right !important; }


.application table {
  --sheet-grid-line: #c3ccd7;
  --sheet-band: #e9f1fa;
  --sheet-active-row: #d9e9f8;
  border-collapse: collapse;
  background: #fff;
}
.application table > :where(thead, tbody, tfoot) > tr > :is(th, td) {
  border-color: var(--sheet-grid-line);
}
.application table > thead > tr > :is(th, td) {
  background: linear-gradient(#f8f9fb, #e7ebf2);
  color: #343e4a;
  box-shadow: inset 0 -1px #aeb8c4;
}
.application table > tbody > tr { --sheet-row: #fff; }
.application table > tbody > tr:nth-child(even) { --sheet-row: var(--sheet-band); }
.application table > tbody > tr:is(:hover, :focus-within, .selected, .selected-row) {
  --sheet-row: var(--sheet-active-row);
}
.application table > :where(tbody) > :where(tr) > :where(td, th) { background: var(--sheet-row); font-size: 12px; }
.application table > :where(tbody, tfoot) > tr > :where(th) { position: static; }
.application table > :where(tfoot) > :where(tr) > :where(td, th) { background: #edf2f8; }
.application .sheet-numbered > tbody > tr > :first-child {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.application .sheet-resize-header { padding-inline-end: 15px !important; }
@media screen {
  .application .sheet-resizable > :where(thead, tbody) > tr > :is(td, th):not(:has(input, select, textarea)) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.application .workbook-grid > tbody > tr > [data-sheet-selected] {
  outline: 1px solid #668cb0;
  outline-offset: -1px;
}

.application table { --sheet-active-row: #ccebdc; }
.application table > tbody > tr:hover { --sheet-row: #d9e9f8; }
.application table > tbody > tr:is(.selected, .selected-row, [aria-selected="true"], :focus-within, :has(> [data-sheet-selected])) {
  --sheet-row: var(--sheet-active-row);
}
.application .sheet-pinned > tbody > tr > :first-child { background: var(--sheet-row); }
.application .workbook-grid > tbody > tr > [data-sheet-selected] { outline-color: #4f8167; }

/* Route every visible inline error and warning through one blocking message dialog. */
.popup-alert-source { display: none !important; }
.global-alert-overlay {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(25 31 40 / 42%);
}
.global-alert-dialog {
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid #c7cdd5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 56px rgb(20 29 42 / 28%);
}
.global-alert-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #d8dde4;
  color: #182130;
}
.global-alert-dialog-warning .global-alert-heading { color: #77520a; background: #fff7e4; }
.global-alert-message { margin: 0; padding: 20px 16px; color: #273243; white-space: pre-wrap; }
.global-alert-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 16px 14px; }
.global-alert-counter { margin-right: auto; color: #647084; font-size: 12px; }
.global-alert-close { min-width: 30px; width: 30px; height: 30px; padding: 0; font-size: 18px; line-height: 1; }
@media (max-width: 600px) {
  .global-alert-overlay { padding: 12px; }
  .global-alert-message { padding: 16px 12px; }
}

@media (max-width: 900px) {
  .start-menu-panel {
    position: absolute;
    inset: auto max(8px, env(safe-area-inset-right)) calc(100% + 6px) max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - var(--taskbar-height) - env(safe-area-inset-bottom) - max(16px, env(safe-area-inset-top) + 12px));
    padding: 0 12px 12px;
    background: #f7f8fb;
    overscroll-behavior: contain;
  }
  .start-menu-topbar {
    position: sticky;
    z-index: 1;
    top: 0;
    padding: 8px 0;
    background: #f7f8fb;
  }
  .start-menu-panel :is(button, input), .start-menu-button { --control-height: 44px; }
  .application .start-menu-panel :is(.start-menu-open, .start-menu-section-toggle) {
    height: auto !important;
    max-height: none !important;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .start-menu-pin { flex-basis: 44px; width: 44px; min-width: 44px; }
}

@media (max-width: 640px) {
  .start-menu-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .start-menu-topbar { align-items: stretch; flex-direction: column; gap: 4px; }
  .application .start-menu-search input { font-size: 16px; }
  .application:has(.window-taskbar-item) { --taskbar-height: 104px; }
  .window-taskbar-with-tools {
    grid-template-columns: 48px minmax(0, 1fr);
    padding-inline: max(4px, env(safe-area-inset-left)) max(4px, env(safe-area-inset-right));
  }
  .start-menu-button { grid-row: 2; margin-left: 0; width: 44px; }
  .window-taskbar-with-tools .window-taskbar-scroll { grid-area: 1 / 1 / 2 / -1; }
  .window-taskbar-scroll:not(:has(.window-taskbar-item)) { display: none; }
  .window-taskbar-track { justify-content: flex-start; }
  .window-taskbar-tools { grid-area: 2 / 2; min-width: 0; }
  .taskbar-system-tray { gap: 1px; }
  .window-taskbar-tools button, .window-taskbar-item button, .window-actions button { --control-height: 44px; }
  .taskbar-site { height: 44px; }
  .taskbar-direction-label, .window-taskbar-version { display: none; }
  .taskbar-directions button { width: 32px; justify-content: center; padding-inline: 0; }
  .application .desktop.desktop-with-taskbar {
    padding: max(8px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right))
      calc(var(--taskbar-height) + env(safe-area-inset-bottom) + 12px) max(6px, env(safe-area-inset-left));
  }
  .desktop-stage .window-active > .window-content { min-width: 0; padding: 8px; }
  .window-content :is(.reference-panel, .receipt-journal, .receipt-details, .table-wrap, fieldset) { min-width: 0; }
  .window-content .table-wrap { max-width: 100%; }
  .window-content :is(.receipt-fields, .toolbar, .form-actions, .detail-body) :is(button, input, select):not(table *) { --control-height: 44px; }
  .application .window-content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(table *) { font-size: 16px; }
  .window-content .receipt-fields.reference-fields { grid-template-columns: minmax(0, 1fr); }
  .window-content :is(.dispatch-workspace, .receiving-workspace) .receipt-split > .receipt-journal { block-size: 240px; }
  .window-content .form-actions { position: static; flex-wrap: wrap; gap: 6px; }
  .window-content .form-actions button { flex: 0 1 auto; min-width: 44px; }
}

@media (max-width: 360px) {
  .taskbar-site { min-width: 28px; width: 28px; }
  .taskbar-connection { width: 16px; }
  .taskbar-lock { min-width: 30px; padding-inline: 3px; }
}

@media (min-width: 901px) {
.window-frame[data-placement="maximized"] > .window-content {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow: auto;
}
.window-frame[data-placement="maximized"] > .window-content:not(:has(> .financial-monthly)):has(> .table-wrap, > :is(div, section) > .table-wrap, > :is(div, section) > .reference-panel > .table-wrap),
.window-frame[data-placement="maximized"] > .window-content > :is(div, section):not(.financial-monthly):has(> .table-wrap, > .reference-panel > .table-wrap),
.window-frame[data-placement="maximized"] > .window-content > :is(div, section):not(.financial-monthly) > .reference-panel:has(> .table-wrap) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-block-size: 0;
  min-inline-size: 0;
  inline-size: 100%;
}
.window-frame[data-placement="maximized"] > .window-content :is(.partner-registry-panel, .category-registry-panel, .facility-registry-panel) > .table-wrap,
.window-frame[data-placement="maximized"] > .window-content > .table-wrap,
.window-frame[data-placement="maximized"] > .window-content > :is(div, section):not(.financial-monthly) > .table-wrap,
.window-frame[data-placement="maximized"] > .window-content > :is(div, section):not(.financial-monthly) > .reference-panel > .table-wrap {
  flex: 1 1 auto;
  block-size: auto;
  min-block-size: min(6rem, 25dvh);
  max-block-size: none;
}
/* Document form (receipt, shipment, return mode): journal and form above may
   not squeeze "Товары документа" or the "Возвраты по …" panels to zero
   height; the window scrolls instead. */
.window-frame[data-placement="maximized"] > .window-content > div.receipt-workspace > section.reference-panel:has(> .table-wrap) {
  flex-shrink: 0;
}
.window-frame[data-placement="maximized"] > .window-content > .receipt-workspace > .line-items-panel.reference-panel:has(> .table-wrap) {
  min-block-size: min(14rem, 45dvh);
}
.window-frame:not([data-placement="maximized"]) > .window-content:has(> .stock-balance-workspace > .stock-balance-panel > .stock-balance-table-wrap),
.window-frame:not([data-placement="maximized"]) .stock-balance-workspace:has(> .stock-balance-panel > .stock-balance-table-wrap),
.window-frame:not([data-placement="maximized"]) .stock-balance-panel:has(> .stock-balance-table-wrap) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-block-size: 0;
}
.window-frame:not([data-placement="maximized"]) .stock-balance-table-wrap {
  flex: 1 1 auto;
  min-block-size: min(6rem, 25dvh);
}
}

.application { cursor: default; }
.application :where(a[href], summary, select, input[type="checkbox"], input[type="radio"], input[type="file"]) { cursor: pointer; }
.application :where(textarea, input:not([type]), input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], input[type="tel"], input[type="url"], [contenteditable="true"], [contenteditable="plaintext-only"]) { cursor: text; }
.application :where(input, select, textarea):is([readonly], :disabled),
.application .workbook-grid tbody > tr > td :is(input, textarea):is([readonly], :disabled) { cursor: default; }

:root { --control-height: 27px; --table-row-height: 28px; --table-control-height: 23px; }
.application .line-items-panel > .table-wrap > table tbody > tr > td,
.application :is(table, .workbook-grid, .payroll-calendar, .financial-monthly-grid) tbody > tr > :is(td, th) {
  height: var(--table-row-height) !important;
  min-height: var(--table-row-height) !important;
  max-height: none !important;
}
.application .line-items-panel > .table-wrap > table tbody > tr > td :is(input, select, button),
.application :is(table, .workbook-grid, .payroll-calendar, .financial-monthly-grid) tbody > tr > :is(td, th) :is(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.application .line-items-panel .line-remove-icon,
.application table tbody .status-chip {
  height: var(--table-control-height) !important;
  min-height: var(--table-control-height) !important;
  max-height: var(--table-control-height) !important;
}
.application :is(input[type="checkbox"], input[type="radio"]) { inline-size: 18px; block-size: 18px; }
.application textarea:not(table textarea) { min-block-size: 40px; }
.application :is(.facts dt, .facts dd, .window-taskbar-version) { min-block-size: 35px; }
.application :is(.document-totals, .document-debt-totals) > span { min-block-size: 52px; }
.application .stock-balance-metrics > span { padding-block: 7px; }
.application .desktop-quick-launcher { height: 73px !important; min-height: 73px !important; }
.application .desktop-quick-launchers { height: var(--desktop-launcher-height) !important; min-height: var(--desktop-launcher-height) !important; }

/* Let the primary sheet use the height of the current window. */
@media screen and (min-width: 901px) {
  .window-frame > .window-content:has(> .customer-orders-register, > .reference-panel:only-of-type > .table-wrap) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-block-size: 0;
  }
  .window-frame > .window-content > :is(.customer-orders-register, .reference-panel:only-of-type):has(> .table-wrap) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-block-size: 0;
  }
  .window-frame > .window-content > :is(.customer-orders-register, .reference-panel:only-of-type) > .table-wrap {
    flex: 1 1 0;
    block-size: auto;
    min-block-size: 0;
    max-block-size: none;
  }
}

.application table > tbody.workbook-filler { pointer-events: none; }
.application table > tbody.workbook-filler > tr { --sheet-row: #fff; }
.application table > tbody.workbook-filler > tr.workbook-filler-band { --sheet-row: var(--sheet-band); }
@media print {
  .application table > tbody.workbook-filler { display: none; }
}

/* Collection priorities in the receivables register. */
.application table[aria-label="Реестр дебиторской задолженности"] tr[data-receivable-priority="0"] { --sheet-row: #fbe3e2; }
.application table[aria-label="Реестр дебиторской задолженности"] tr[data-receivable-priority="1"] { --sheet-row: #ffebd8; }
.application table[aria-label="Реестр дебиторской задолженности"] tr[data-receivable-priority="2"] { --sheet-row: #fff4cc; }
.application .window-taskbar-settings { min-height: 35px; }
@media (max-width: 900px) { .application .desktop-quick-launchers { flex-basis: var(--desktop-launcher-height) !important; } }
@media (max-width: 520px) { .application .window-taskbar-settings { min-height: 43px; } }
.application .postcode-search-icon { --control-height: 25px; }
.application .row-icon-actions { min-block-size: 35px; }

/* Window registers fill their panel (see workbook-grid.mjs: .sheet-fill).
   Column widths saved by the user remain the minimum; the table stretches
   to the panel width, and the window's main list is sized to the window's
   bottom edge by script, following the window and screen size. */
.application .window-content .table-wrap.sheet-fill {
  inline-size: auto;
  width: auto;
  max-inline-size: 100%;
  justify-self: stretch;
  align-self: stretch;
  margin-inline-end: 0;
}
.application .window-content .reference-panel:has(> .table-wrap.sheet-fill) { min-inline-size: 0; }

/* Confirmation pop-ups: heading, text and buttons share the same side inset. */
.dialog-shade .confirm-dialog { width: min(480px, 100%); }
.dialog-shade .confirm-dialog > .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.dialog-shade .confirm-dialog > .confirm-body { display: grid; gap: 12px; padding: 16px; text-align: start; }
.dialog-shade .confirm-body :is(p, dl, dd) { margin: 0; }
.dialog-shade .confirm-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.dialog-shade .confirm-body dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.dialog-shade .confirm-body label { display: grid; gap: 4px; }
.dialog-shade .confirm-body input { width: 100%; }
.dialog-shade .confirm-dialog > .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* Row-selection column: the header and row checkboxes share one centre line. */
.application table :is(thead th, tbody td).select-column {
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
}
.application table .select-column > input[type="checkbox"] {
  display: block;
  inline-size: 16px;
  block-size: 16px;
  min-block-size: 0;
  margin: 0 auto !important;
  padding: 0;
}

/* Админка сайта на экране «Склад» и фото в карточке товара */
.stock-site-toolbar { align-items: end; gap: 10px; margin: 0 0 8px; }
.stock-site-table th.stock-site-publish, .stock-site-table td.stock-site-publish { width: 92px; text-align: center; }
.stock-site-table td.stock-site-publish input { width: 18px; height: 18px; cursor: pointer; }
.stock-site-table td.stock-site-publish input:disabled { cursor: default; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.product-photo-field { display: grid; gap: 6px; margin: 10px 0; }
.product-photo-label { font-size: .9em; color: var(--muted, #555); }
.product-photo-body { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.product-photo-preview { width: 160px; height: 120px; border: 1px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafafa; }
.product-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.product-photo-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.product-photo-upload { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: white; cursor: pointer; }
.product-photo-upload:focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
fieldset:disabled .product-photo-upload { opacity: .55; cursor: default; }

/* Page buttons are replaced by scrolling (workbook-grid.mjs: data-scroll-next). */
.application :is([data-scroll-next], .scroll-pager-hidden) { display: none !important; }

/* Date columns sort on a header click (workbook-grid.mjs): ↑ oldest first, ↓ newest first. */
.application table thead th[data-date-sortable] { cursor: pointer; }
.application table thead th[data-date-sort="asc"]::after { content: " ↑"; }
.application table thead th[data-date-sort="desc"]::after { content: " ↓"; }
