:root {
  --ink: #102f36;
  --muted: #557279;
  --paper: #f3f8f8;
  --card: #ffffff;
  --line: #d2e2e4;
  --deep: #063b4b;
  --sea: #007a87;
  --sea-bright: #26b8c5;
  --sea-soft: #dff3f5;
  --warning: #9b5b17;
  --danger: #a33a35;
  --shadow: 0 16px 42px rgba(6, 59, 75, .09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif; }
a { color: var(--sea); text-decoration: none; }
a:hover { color: var(--deep); }
.topbar { position: relative; z-index: 50; min-height: 76px; padding: 0 4vw; background: var(--deep); color: white; display: flex; align-items: center; gap: 38px; }
.brand { display: flex; align-items: center; gap: 11px; color: white; margin-right: auto; }
.brand:hover { color: white; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--sea-bright); }
.brand-mark img { width: 29px; height: 29px; display: block; }
.brand strong, td small { display: block; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav > a, .navigation-menu > summary { color: #d8eef0; padding: 10px 13px; border-radius: 9px; white-space: nowrap; }
.topnav > a:hover, .navigation-menu > summary:hover, .navigation-menu[open] > summary { color: white; background: rgba(255, 255, 255, .1); }
.navigation-menu { position: relative; }
.navigation-menu > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.navigation-menu > summary::-webkit-details-marker { display: none; }
.navigation-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .75; }
.navigation-menu[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.navigation-user-menu > summary { color: white; font-weight: 750; }
.navigation-user-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navigation-dropdown { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; min-width: 230px; padding: 7px; background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 18px 45px rgba(3, 39, 49, .2); }
.navigation-dropdown a, .navigation-dropdown button { width: 100%; display: block; padding: 10px 12px; border: 0; border-radius: 7px; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.navigation-dropdown a:hover, .navigation-dropdown button:hover { color: var(--deep); background: var(--sea-soft); }
.navigation-dropdown form { margin: 0; }
.notification-menu > summary { position: relative; padding: 9px 11px; }
.notification-menu > summary::after { display: none; }
.notification-bell { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-count { position: absolute; top: 1px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; color: white; background: #c04a40; border: 2px solid var(--deep); border-radius: 999px; font-size: 10px; font-weight: 850; line-height: 1; }
.notification-count.is-hidden { display: none; }
.notification-dropdown { width: min(390px, 90vw); padding: 12px; }
.notification-dropdown > strong { display: block; padding: 4px 8px 9px; }
.notification-dropdown-item { margin-bottom: 3px; border-left: 3px solid transparent; }
.notification-dropdown-item.is-unread { border-left-color: var(--sea); background: #f3fafb; font-weight: 750; }
.notification-dropdown-item span, .notification-dropdown-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.notification-dropdown-item small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.notification-dropdown-empty { display: block; padding: 18px 8px; color: var(--muted); text-align: center; }
.navigation-dropdown .notification-all-link { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: var(--sea); font-weight: 750; text-align: center; }
.page-shell { width: min(1440px, 92vw); margin: 0 auto; padding: 42px 0 80px; }
.page-heading h1 { margin: 4px 0 6px; font-size: clamp(29px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.nav-card { min-height: 142px; padding: 22px; color: var(--ink); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; transition: transform .15s, border-color .15s; }
.nav-card:hover { transform: translateY(-3px); border-color: #69afb7; }
.nav-card h3 { margin: 0 0 8px; font-size: 21px; }
.nav-card p { margin: 0; color: var(--muted); }
.dashboard-card { min-height: 142px; padding: 22px; display: flex; flex-direction: column; justify-content: center; }
.dashboard-card h3 { margin: 0 0 8px; font-size: 21px; }
.dashboard-card p { margin: 0; color: var(--muted); }
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-scope { width: min(380px, 100%); margin-left: auto; }
.dashboard-scope .form-control { width: 100%; }
.dashboard-module { min-width: 0; overflow: hidden; }
.dashboard-module-heading { display: block; min-height: 118px; padding: 22px; color: var(--ink); border-bottom: 1px solid var(--line); }
.dashboard-module-heading:hover { color: var(--sea); }
.dashboard-module-heading h2, .dashboard-products h2 { margin: 0 0 6px; font-size: 21px; }
.dashboard-module-heading p, .dashboard-products-heading p { margin: 0; color: var(--muted); }
.dashboard-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-metric { min-width: 0; min-height: 92px; padding: 16px 18px; color: var(--ink); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dashboard-metric:nth-child(even) { border-right: 0; }
.dashboard-metric:hover { color: var(--deep); background: var(--sea-soft); }
.dashboard-metric strong, .dashboard-metric span { display: block; }
.dashboard-metric strong { overflow: hidden; font-size: 23px; line-height: 1.15; text-overflow: ellipsis; }
.dashboard-metric span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.dashboard-metric-warning strong { color: var(--warning); }
.dashboard-focus-list > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.dashboard-focus-list > a:last-child { border-bottom: 0; }
.dashboard-focus-list > a:hover { background: var(--sea-soft); }
.dashboard-focus-list span, .dashboard-focus-list small { display: block; min-width: 0; }
.dashboard-focus-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.dashboard-focus-list b { flex: 0 0 auto; text-align: right; }
.dashboard-focus-list .dashboard-focus-warning b { color: var(--warning); }
.dashboard-products { margin-top: 18px; overflow: hidden; }
.dashboard-products-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; border-bottom: 1px solid var(--line); }
.dashboard-products .table-card { border: 0; border-radius: 0; box-shadow: none; }
.dashboard-filter-summary { margin: 0 0 18px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(29px, 4vw, 42px); }
.page-heading p { margin: 0; color: var(--muted); max-width: 760px; }
.breadcrumb-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .24em; }
.page-heading .breadcrumb-title { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.025em; }
.breadcrumb-parent { color: var(--sea); font-size: inherit; font-weight: 750; letter-spacing: -.02em; }
.breadcrumb-parent:hover { color: var(--deep); }
.breadcrumb-separator { color: #7a9297; font-size: inherit; font-weight: 600; }
.breadcrumb-current { color: var(--ink); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.page-actions form { display: flex; align-items: center; margin: 0; }
.equal-actions { display: grid; grid-template-columns: repeat(2, 180px); gap: 10px; }
.equal-actions .button { width: 180px; min-height: 46px; white-space: nowrap; }
.button { appearance: none; border: 0; border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.button-primary { background: var(--sea); color: white; }
.button-primary:hover { background: var(--deep); color: white; }
.button-secondary { background: white; color: var(--deep); border: 1px solid var(--line); }
.button-danger { background: var(--danger); color: white; }
.button-small { padding: 7px 10px; font-size: 13px; }
.button-wide { width: 100%; }
.link-button { padding: 0; border: 0; background: none; color: #91d2d8; font: inherit; cursor: pointer; }
.table-actions .link-button { color: var(--sea); }
.login-layout { min-height: calc(100vh - 160px); display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 8vw; }
.login-intro h1 { max-width: 780px; margin: 8px 0 15px; font-size: clamp(40px, 6vw, 78px); line-height: .98; letter-spacing: -.055em; }
.login-intro p { max-width: 600px; color: var(--muted); font-size: 18px; }
.login-page .page-shell { min-height: 100vh; min-height: 100svh; padding: 24px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.login-page .login-layout { width: min(520px, 100%); min-height: 0; display: block; padding: 0; }
.login-card, .form-card { padding: 30px; }
.login-card h2 { margin-top: 0; font-size: 26px; }
.field { display: block; margin-bottom: 18px; }
.field[hidden] { display: none; }
.field > label, .field > span { display: block; font-weight: 700; margin-bottom: 7px; }
.form-control { width: 100%; min-height: 44px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #abc8cd; border-radius: 9px; font: inherit; }
.form-control:focus { outline: 3px solid rgba(0, 122, 135, .16); border-color: var(--sea); }
.form-control:disabled { color: #6e8186; -webkit-text-fill-color: #6e8186; background: #e5ecee; border-color: #c5d3d6; cursor: not-allowed; opacity: 1; box-shadow: none; }
.date-picker { position: relative; width: 100%; }
.date-picker-display { padding-right: 52px; }
.date-picker-toggle { position: absolute; top: 0; right: 0; width: 48px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--deep); background: transparent; border: 0; border-radius: 0 9px 9px 0; cursor: pointer; }
.date-picker-toggle:hover { color: var(--sea); background: var(--sea-soft); }
.date-picker-toggle:focus-visible { outline: 3px solid rgba(0, 122, 135, .2); outline-offset: -3px; }
.date-picker-toggle:disabled { color: #83969a; background: transparent; cursor: not-allowed; }
.date-picker-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.date-picker-popover { position: fixed; inset: auto; z-index: 100; max-height: calc(100vh - 16px); margin: 0; padding: 18px; overflow: auto; color: var(--ink); background: white; border: 1px solid #abc8cd; border-radius: 14px; box-shadow: 0 24px 64px rgba(3, 39, 49, .24); }
.date-picker-popover::backdrop { background: transparent; }
.date-picker-popover[hidden] { display: none; }
.date-picker-heading { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: 8px; margin-bottom: 13px; }
.date-picker-month { text-align: center; font-size: 18px; font-weight: 800; }
.date-picker-nav { width: 46px; height: 42px; padding: 0; display: grid; place-items: center; color: var(--deep); background: white; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 28px; line-height: 1; cursor: pointer; }
.date-picker-nav:hover:not(:disabled) { color: white; background: var(--sea); border-color: var(--sea); }
.date-picker-nav:disabled { color: #a0afb2; background: #f3f6f6; cursor: not-allowed; }
.date-picker-weekdays, .date-picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.date-picker-weekdays { margin-bottom: 6px; }
.date-picker-weekdays span { padding: 5px 2px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.date-picker-day { min-width: 0; min-height: 46px; padding: 8px 3px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.date-picker-day:hover:not(:disabled) { color: var(--deep); background: var(--sea-soft); border-color: #9bcbd0; }
.date-picker-day-other { color: #819498; font-weight: 500; }
.date-picker-day-today { border-color: var(--sea); }
.date-picker-day-selected, .date-picker-day-selected:hover:not(:disabled) { color: white; background: var(--sea); border-color: var(--sea); }
.date-picker-day:disabled { color: #bdc8ca; background: transparent; cursor: not-allowed; }
.date-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.date-picker-footer button { min-height: 42px; padding: 8px 14px; color: var(--sea); background: transparent; border: 0; border-radius: 8px; font: inherit; font-weight: 800; cursor: pointer; }
.date-picker-footer button:hover:not(:disabled) { color: var(--deep); background: var(--sea-soft); }
.date-picker-footer button:disabled { color: #9cabad; cursor: not-allowed; }
.select-picker { position: relative; width: 100%; }
.select-picker-source { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.select-picker-toggle { padding-right: 44px; display: block; position: relative; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.select-picker-toggle::after { content: ""; position: absolute; top: 50%; right: 17px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.select-picker-toggle[aria-expanded="true"]::after { transform: translateY(-30%) rotate(225deg); }
.select-picker-toggle-placeholder { color: var(--muted); }
.select-picker-toggle:disabled { cursor: not-allowed; }
.select-picker-invalid .select-picker-toggle { border-color: var(--danger); }
.select-picker-popover { position: fixed; inset: auto; z-index: 101; max-height: min(480px, calc(100vh - 16px)); margin: 0; padding: 8px; overflow: hidden; color: var(--ink); background: white; border: 1px solid #abc8cd; border-radius: 13px; box-shadow: 0 24px 64px rgba(3, 39, 49, .24); }
.select-picker-popover::backdrop { background: transparent; }
.select-picker-popover[hidden] { display: none; }
.select-picker-search-wrap { position: relative; padding: 4px 4px 9px; }
.select-picker-search-wrap::before { content: ""; position: absolute; z-index: 1; top: 17px; left: 18px; width: 11px; height: 11px; border: 2px solid var(--muted); border-radius: 50%; pointer-events: none; }
.select-picker-search-wrap::after { content: ""; position: absolute; z-index: 1; top: 29px; left: 29px; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); transform-origin: left center; pointer-events: none; }
.select-picker-search { min-height: 42px; padding-left: 40px; }
.select-picker-options { max-height: 370px; overflow-y: auto; overscroll-behavior: contain; }
.select-picker-option { width: 100%; min-height: 46px; padding: 10px 42px 10px 13px; position: relative; display: block; color: var(--ink); background: transparent; border: 0; border-radius: 8px; text-align: left; font: inherit; cursor: pointer; }
.select-picker-lot .select-picker-option { min-height: 40px; padding: 7px 38px 7px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-picker-option:hover:not(:disabled), .select-picker-option:focus-visible { color: var(--deep); background: var(--sea-soft); outline: none; }
.select-picker-option-selected { color: var(--deep); background: #edf8f9; font-weight: 800; }
.select-picker-option-selected::after { content: "✓"; position: absolute; top: 50%; right: 15px; color: var(--sea); font-size: 18px; transform: translateY(-50%); }
.select-picker-option-placeholder { color: var(--muted); }
.select-picker-option:disabled { color: #a5b3b5; cursor: not-allowed; }
.select-picker-empty { padding: 22px 13px; color: var(--muted); text-align: center; }
.field-disabled > label { color: var(--muted); }
textarea.form-control { resize: vertical; }
.field-checkbox { display: grid; grid-template-columns: 24px 1fr; align-items: center; }
.field-checkbox label { grid-column: 2; grid-row: 1; margin: 0; }
.field-checkbox input { grid-column: 1; grid-row: 1; width: 18px; height: 18px; accent-color: var(--sea); }
.field-checkbox .help-text, .field-checkbox .field-error { grid-column: 2; }
.field-checkbox:has(> div) { display: block; }
.field-checkbox:has(> div) > label { margin-bottom: 9px; }
.field-checkbox > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field-checkbox > div > div label { min-height: 42px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.field-checkbox > div > div label:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); }
.field-checkbox > .route-input-choices { max-height: 360px; overflow-y: auto; grid-template-columns: 1fr; padding: 2px; }
.field-checkbox > [data-route-input-search] { width: 100%; height: auto; margin-bottom: 10px; }
.field-radio > div { display: flex; flex-wrap: wrap; gap: 9px; }
.field-radio > div > div { margin: 0; }
.field-radio > div label { min-height: 42px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.field-radio > div label:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); }
.field-radio input { width: 17px; height: 17px; margin: 0; accent-color: var(--sea); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.editor-window { width: min(680px, 100%); margin: 0 auto; }
.editor-window .form-grid-single { grid-template-columns: minmax(0, 1fr); }
.editor-window .field:last-child { margin-bottom: 0; }
.parameter-dialog { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 28px 90px rgba(3, 39, 49, .3); }
.parameter-dialog-wide { width: min(760px, calc(100vw - 32px)); }
.parameter-dialog::backdrop { background: rgba(4, 34, 43, .42); backdrop-filter: blur(2px); }
.parameter-dialog form { padding: 26px 28px 10px; }
.dialog-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; font-size: 25px; line-height: 1.2; word-break: keep-all; overflow-wrap: normal; hyphens: none; text-wrap: balance; }
.dialog-actions { justify-self: end; }
.dialog-actions.equal-actions { grid-template-columns: repeat(2, 150px); }
.dialog-actions.equal-actions .button { width: 150px; }
.parameter-dialog .form-grid-single { grid-template-columns: minmax(0, 1fr); }
.parameter-dialog .field:last-child { margin-bottom: 16px; }
.quick-task-dialog { width: min(1180px, calc(100vw - 32px)); }
.quick-task-dialog form { padding-bottom: 26px; }
.quick-task-heading { position: sticky; z-index: 3; top: 0; margin: -26px -28px 0; padding: 22px 28px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.quick-task-actions { display: grid; grid-template-columns: repeat(3, 172px); gap: 10px; }
.quick-task-actions .button { width: 172px; min-height: 46px; white-space: nowrap; }
.quick-task-section { padding: 22px 0 4px; border-bottom: 1px solid var(--line); }
.quick-task-section:last-child { border-bottom: 0; }
.quick-task-section > h3, .quick-task-subheading h3, .quick-task-subheading h4 { margin: 0; font-size: 19px; }
.quick-task-section > .form-control { display: flex; flex-wrap: wrap; width: auto; margin: 14px 0 18px; padding: 0; border: 0; gap: 9px; }
.quick-task-section > .form-control > div { margin: 0; }
.quick-task-section > .form-control label { min-height: 42px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.quick-task-section > .form-control label:has(input:checked) { border-color: var(--sea); background: var(--sea-soft); }
.quick-task-section > .form-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--sea); }
.quick-task-order-panel[hidden], .quick-task-formset-row[hidden] { display: none; }
.quick-task-main-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.quick-task-subheading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 4px 0 14px; }
.quick-task-formset { display: grid; gap: 10px; }
.quick-task-formset-row { padding: 14px; display: grid; align-items: end; gap: 10px; background: #f4f8f9; border: 1px solid var(--line); border-radius: 11px; }
.quick-task-formset-row .field { margin-bottom: 0; }
.quick-task-formset-row .field label { font-size: 12px; }
.quick-task-product-row { grid-template-columns: minmax(220px, 1.8fr) repeat(2, minmax(120px, .8fr)) minmax(155px, 1fr) auto; }
.quick-task-input-row { grid-template-columns: minmax(260px, 1fr) auto; }
.raw-receipt-line { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.raw-receipt-line .quick-task-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
.raw-receipt-line .field:has(input[type="checkbox"]) { padding-top: 3px; }
.raw-receipt-line .field:has(input[type="checkbox"]) > div { display: flex; flex-wrap: wrap; gap: 8px; }
.raw-receipt-line .field:has(input[type="checkbox"]) label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.raw-receipt-line input[type="checkbox"], .raw-test-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--sea); }
.raw-test-row { grid-template-columns: minmax(210px, 1.5fr) repeat(3, minmax(120px, .8fr)) minmax(155px, .8fr) auto; }
.document-card { max-width: 900px; margin: 0 auto; padding: 32px; }
.document-card h2 { margin-top: 0; }
.document-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.document-facts div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.document-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.document-facts dd { margin: 4px 0 0; font-weight: 700; }
.quick-task-row-actions { min-height: 44px; display: flex; align-items: center; }
.quick-task-row-error { grid-column: 1 / -1; margin: 0; }
.setting-history { padding: 17px 0 16px; border-top: 1px solid var(--line); }
.setting-history h3 { margin: 0 0 11px; font-size: 17px; }
.setting-history-list { display: grid; gap: 8px; }
.setting-history-item { padding: 10px 12px; background: #f4f8f9; border-radius: 9px; }
.setting-history-line { display: grid; grid-template-columns: 120px minmax(170px, 1fr) auto; align-items: baseline; gap: 12px; }
.setting-history-line time, .setting-history-line > span { color: var(--muted); font-size: 12px; }
.setting-history-line strong { font-size: 14px; }
.setting-history-item p { margin: 4px 0 0 132px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.version-history-list { display: grid; gap: 16px; }
.version-history-card { padding: 22px; }
.version-history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.version-history-heading h2, .version-history-heading p { margin: 0; }
.version-history-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.version-history-actions { display: flex; align-items: center; gap: 14px; }
.version-history-comment { margin: 16px 0 0; padding: 12px 14px; background: var(--sea-soft); border-radius: 9px; }
.version-diff { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.version-diff-row { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(180px, 1fr) auto minmax(180px, 1fr); gap: 12px; align-items: start; padding: 11px 13px; }
.version-diff-row + .version-diff-row { border-top: 1px solid var(--line); }
.version-diff-old { color: var(--muted); }
.version-diff-arrow { color: var(--sea); font-weight: 800; }
.version-diff-new { font-weight: 700; }
.page-actions .route-activation-form { align-items: flex-end; gap: 10px; max-width: 100%; }
.route-activation-form label { min-width: 260px; display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.route-activation-form .form-control { min-height: 44px; padding: 8px 11px; }
.help-text { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.field-error { color: var(--danger); display: block; margin-top: 5px; }
.form-errors, .message-error { background: #f8e5e1; color: var(--danger); padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; }
.messages { margin-bottom: 22px; }
.message { padding: 13px 16px; background: var(--sea-soft); border-left: 4px solid var(--sea); border-radius: 8px; }
.message-success { background: #dff1e8; border-color: #2e7d68; }
.table-card { overflow-x: auto; }
.stock-filter { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.stock-filter label { min-width: 0; display: grid; gap: 6px; font-weight: 700; }
.stock-filter .form-control { width: 100%; }
.stock-filter-actions { display: flex; gap: 8px; }
.counterparty-filter { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(190px, .8fr) minmax(190px, .8fr) auto; align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.counterparty-filter label { min-width: 0; display: grid; gap: 6px; font-weight: 700; }
.counterparty-filter .form-control { width: 100%; }
.compact-tag-row { margin-top: 0; }
.stock-operation-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 20px; margin-bottom: 20px; padding: 16px 18px; }
.stock-operation-summary span { color: var(--muted); }
.stock-movement-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 20px 22px; }
.stock-movement-heading h3, .stock-movement-heading p { margin: 0; }
.stock-movement-heading p { margin-top: 5px; color: var(--muted); }
.stock-movement-heading > div:last-child { text-align: right; }
.stock-movement-heading > div:last-child strong, .stock-movement-heading > div:last-child small { display: block; }
.table-section-row th { background: var(--sea-soft); color: var(--ink); font-size: 1rem; }
table { border-collapse: collapse; width: 100%; }
th { padding: 14px 18px; background: #e9f2f3; color: var(--muted); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 16px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
td small { color: var(--muted); margin-top: 3px; }
.table-actions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.table-actions form { display: flex; align-items: center; margin: 0; }
.empty-cell, .empty-state { color: var(--muted); text-align: center; padding: 40px; }
.status { display: inline-block; border-radius: 999px; padding: 5px 9px; background: #e9f0f1; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-success { background: #d9efed; color: #17655f; }
.status-warning { background: #fff0cb; color: #7f5700; }
.status-active { background: #d9efed; color: #17655f; }
.status-draft { background: #fff0cb; color: #7f5700; }
.status-archived, .status-muted { background: #e8edef; color: #66777b; }
.stock-state-cell { min-width: 190px; }
.stock-state-cell small { max-width: 260px; line-height: 1.35; }
.compact-card { padding: 16px 18px; margin-bottom: 16px; }
.compact-card p { margin: 5px 0 0; }
.inventory-table .form-control { min-width: 120px; width: 140px; }
.inventory-actions { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 18px; margin-top: 16px; padding: 18px; }
.inventory-actions .field { margin: 0; }
.inventory-actions .form-control { width: 100%; }
.timesheet-toolbar { width: min(620px, 100%); margin: 0 auto 14px; padding: 12px; display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: end; gap: 10px; }
.timesheet-month-form { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.timesheet-month-form label { font-weight: 750; }
.timesheet-month-arrow { min-height: 44px; display: grid; place-items: center; color: var(--deep); background: var(--sea-soft); border-radius: 9px; font-size: 29px; line-height: 1; }
.timesheet-month-arrow:hover { color: white; background: var(--sea); }
.timesheet-legend { margin: 0 0 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.timesheet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timesheet-plan-mark { width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 5px; }
.timesheet-plan-work { background: #e7f6f2; }
.timesheet-plan-rest { background: #f2f4f5; }
.timesheet-card { max-height: calc(100vh - 250px); overflow: auto; }
.timesheet-table { width: max-content; min-width: 100%; table-layout: fixed; }
.timesheet-table th, .timesheet-table td { height: 47px; padding: 4px; border: 1px solid var(--line); }
.timesheet-table thead th { position: sticky; z-index: 5; top: 0; text-align: center; }
.timesheet-table .timesheet-sticky-name { position: sticky; z-index: 3; left: 0; width: 220px; min-width: 220px; max-width: 220px; padding: 7px 10px; background: white; text-transform: none; letter-spacing: 0; }
.timesheet-table .timesheet-sticky-position { position: sticky; z-index: 3; left: 220px; width: 160px; min-width: 160px; max-width: 160px; padding: 7px 10px; background: white; text-transform: none; letter-spacing: 0; }
.timesheet-table thead .timesheet-sticky-name, .timesheet-table thead .timesheet-sticky-position { z-index: 7; background: #e9f2f3; text-transform: uppercase; letter-spacing: .08em; }
.timesheet-sticky-name span, .timesheet-sticky-position span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timesheet-day-heading { width: 48px; min-width: 48px; }
.timesheet-day-heading span, .timesheet-day-heading small { display: block; line-height: 1.15; }
.timesheet-day-heading small { margin-top: 3px; font-size: 9px; }
.timesheet-day-heading.is-weekend { color: #9b5b17; background: #fff4dc; }
.timesheet-day-heading.is-future { opacity: .58; }
.timesheet-total-heading, .timesheet-total { width: 74px; min-width: 74px; text-align: center; font-weight: 850; }
.timesheet-cell { position: relative; width: 48px; min-width: 48px; padding: 3px !important; background: white; }
.timesheet-cell.is-planned-work { background: #e7f6f2; }
.timesheet-cell.is-planned-rest { background: #f2f4f5; }
.timesheet-cell.is-outside-assignment { color: #9caeb1; background: #eef2f3; text-align: center; }
.timesheet-cell input { width: 40px; height: 38px; padding: 2px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: center; font: inherit; font-weight: 750; }
.timesheet-cell input:hover:not(:disabled) { border-color: #8abdc3; }
.timesheet-cell input:focus { position: relative; z-index: 2; outline: 3px solid rgba(0, 122, 135, .18); border-color: var(--sea); background: white; }
.timesheet-cell.has-fact input { color: var(--deep); background: white; border-color: #8abdc3; }
.timesheet-cell input:disabled { color: #829397; cursor: not-allowed; opacity: .7; }
.timesheet-cell.is-shift-closed { box-shadow: inset 0 -3px #64777b; }
.timesheet-cell.is-shift-ambiguous { box-shadow: inset 0 0 0 2px #b94a48; }
.timesheet-shift-marker { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; background: var(--sea); border-radius: 50%; }
.timesheet-shift-marker.is-closed, .timesheet-shift-mark.is-closed { background: #64777b; }
.timesheet-shift-mark { width: 9px; height: 9px; display: inline-block; background: var(--sea); border-radius: 50%; }
.timesheet-quick-values { position: fixed; z-index: 120; padding: 6px; display: flex; gap: 5px; color: var(--ink); background: white; border: 1px solid #abc8cd; border-radius: 12px; box-shadow: 0 18px 46px rgba(3, 39, 49, .24); }
.timesheet-quick-values[hidden] { display: none; }
.timesheet-quick-values button { min-width: 82px; min-height: 52px; padding: 6px 10px; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 6px; color: var(--ink); background: white; border: 1px solid transparent; border-radius: 8px; font: inherit; cursor: pointer; }
.timesheet-quick-values button:hover, .timesheet-quick-values button.is-selected { color: var(--deep); background: var(--sea-soft); border-color: #8abdc3; }
.timesheet-quick-values strong { font-size: 18px; }
.timesheet-quick-values span { color: var(--muted); font-size: 12px; }
.timesheet-organization-row th, .timesheet-organization-row td { color: var(--deep); background: var(--sea-soft); font-weight: 850; }
.timesheet-organization-row .timesheet-sticky-name, .timesheet-organization-row .timesheet-sticky-position { background: var(--sea-soft); }
.timesheet-table tfoot th, .timesheet-table tfoot td { position: sticky; z-index: 4; bottom: 0; color: white; background: var(--deep); font-weight: 850; }
.timesheet-table tfoot .timesheet-sticky-name, .timesheet-table tfoot .timesheet-sticky-position { z-index: 6; color: white; background: var(--deep); }
.timesheet-save-panel { margin-top: 16px; padding: 18px; display: grid; grid-template-columns: auto minmax(240px, 1fr) auto; align-items: center; gap: 12px; }
.timesheet-save-panel label { font-weight: 750; }
.timesheet-save-panel > small { grid-column: 1 / -1; }
.timesheet-history-card { margin-top: 16px; padding: 18px; }
.timesheet-history-card h2 { margin-top: 0; }
.permission-form { padding: 26px; }
.permission-matrix { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.permission-table th, .permission-table td { border-top: 1px solid var(--line); }
.permission-table thead th { border-top: 0; }
.permission-table .permission-section th { padding: 11px 18px; background: var(--sea-soft); color: var(--deep); font-size: 13px; letter-spacing: .02em; text-transform: none; }
.permission-object { width: 30%; min-width: 230px; color: var(--ink); background: #f7fafb; font-size: 14px; letter-spacing: 0; text-transform: none; }
.permission-options { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-option { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.permission-option:hover { border-color: #69afb7; background: #f1fafb; }
.permission-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--sea); }
.permission-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.permission-option-locked { color: #73868a; background: #f2f6f6; cursor: not-allowed; }
.permission-option-locked:hover { border-color: var(--line); background: #f2f6f6; }
.permission-option-locked input { opacity: .75; }
.role-permission-history { margin-top: 18px; }
.organization-editor-dialog { width: min(1120px, calc(100vw - 32px)); padding: 26px 28px; }
.organization-editor-dialog [hidden] { display: none !important; }
.organization-editor-heading { margin-bottom: 12px; }
.organization-requisites-form, .bank-account-activity-form { padding: 0 !important; }
.editor-tab-list { display: flex; gap: 4px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.editor-tab { margin-bottom: -1px; padding: 12px 17px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 800; cursor: pointer; }
.editor-tab:hover { color: var(--deep); }
.editor-tab.is-active { color: var(--sea); border-bottom-color: var(--sea); }
.organization-bank-heading { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.organization-bank-heading h3 { margin: 0; font-size: 20px; }
.organization-bank-heading p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.organization-bank-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.organization-bank-table .is-inactive { color: var(--muted); background: #f6f8f8; }
.bank-account-active-control { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.bank-account-active-control input { width: 18px; height: 18px; margin: 0; accent-color: var(--sea); }
.muted-text { color: var(--muted); }
.permission-history-changes { margin: 5px 0 0 132px; display: grid; gap: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.permission-history-changes strong { color: var(--ink); font-size: inherit; }
.permission-history-empty { margin: 0; color: var(--muted); font-size: 13px; }
.settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.filter-bar .form-control { width: min(460px, 100%); }
.filter-bar label { font-weight: 700; }
.employee-filter { padding: 16px 18px; }
.form-history-heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.form-history-heading h3 { margin: 0; }
.audit-filter { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(190px, .9fr) minmax(260px, 1.4fr) auto; align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.audit-filter label { display: grid; gap: 6px; font-weight: 700; }
.audit-filter .form-control { width: 100%; }
.audit-filter-actions { display: flex; gap: 8px; }
.audit-filter-actions .button { min-width: 92px; min-height: 44px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.pagination span { color: var(--muted); }
.big-number { font-size: 22px; font-weight: 800; }
code { padding: 2px 5px; border-radius: 5px; background: #e8f2f3; color: #285a63; }
.notice { padding: 15px 18px; margin-bottom: 18px; background: var(--sea-soft); border-radius: 12px; }
.timeline { border-left: 2px solid #a7ced3; margin-left: 23px; padding-left: 34px; display: grid; gap: 14px; }
.timeline-item { position: relative; padding: 20px 22px; display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 13px; }
.timeline-item::before { content: ""; position: absolute; left: -42px; top: 30px; width: 14px; height: 14px; border-radius: 50%; background: var(--sea); border: 5px solid var(--paper); }
.timeline-sequence { font-size: 25px; font-weight: 900; color: var(--sea); }
.timeline h2 { margin: 0 0 4px; }
.timeline p { margin: 0; color: var(--muted); }
.tag-row { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag-row span { padding: 4px 8px; border-radius: 6px; background: #e8f2f3; font-size: 12px; }
.tag-row .tag-critical { background: #f8e2d1; color: var(--warning); font-weight: 800; }
.timeline .instructions { margin-top: 12px; color: var(--ink); }
.inline-actions { display: flex; gap: 14px; margin-top: 13px; font-weight: 700; }
.inline-actions form { margin: 0; }
.route-operation-editor { margin-bottom: 28px; }
.route-operation-editor .production-route-heading p { margin: 4px 0 0; color: var(--muted); }
.route-order-status { min-height: 20px; margin: -7px 0 8px 59px; color: var(--muted); font-size: 13px; font-weight: 700; }
.route-order-status.is-error { color: var(--danger); }
.route-operation-card-editable { grid-template-columns: 28px 45px minmax(0, 1fr); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, opacity .15s ease; }
.route-operation-card-editable:hover, .route-operation-card-editable:focus-visible { border-color: #69afb7; box-shadow: 0 12px 28px rgba(0, 122, 135, .12); outline: none; }
.route-operation-card-editable.is-dragging { opacity: .38; transform: scale(.99); }
.route-operation-card-editable.is-saving { cursor: wait; }
.route-drag-handle { align-self: start; margin-top: 2px; color: #6c8c91; font-size: 25px; line-height: 1; cursor: grab; user-select: none; }
.route-operation-card-editable:active .route-drag-handle { cursor: grabbing; }
.archived-route-operations { margin: 18px 0 0 59px; padding: 0; overflow: hidden; box-shadow: none; }
.archived-route-operations > summary { padding: 15px 18px; color: var(--muted); font-weight: 800; cursor: pointer; }
.archived-route-operations > div { border-top: 1px solid var(--line); }
.archived-route-operation { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.archived-route-operation:last-child { border-bottom: 0; }
.archived-route-operation small { display: block; margin-top: 2px; color: var(--muted); }
.production-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; padding: 22px; margin-bottom: 28px; }
.production-summary div { min-width: 0; }
.production-summary small { display: block; margin-bottom: 3px; color: var(--muted); }
.production-summary strong { display: block; overflow-wrap: anywhere; }
.production-balance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; padding: 22px; }
.production-balance small { display: block; margin-bottom: 3px; color: var(--muted); }
.production-balance strong { display: block; font-size: 18px; }
.production-balance-warning { border-color: #d6a56e; }
.production-balance-danger { border-color: var(--danger); background: #fff8f7; }
.balance-danger { color: var(--danger); font-weight: 800; }
.production-data-section { margin-bottom: 28px; }
.pallet-form-dialog { width: min(1120px, calc(100vw - 32px)); }
.pallet-box-choice-list { max-height: min(54vh, 620px); overflow-y: auto; display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #f7fafb; }
.pallet-box-choice-list > div label { min-height: 48px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 9px; background: white; font-weight: 650; cursor: pointer; }
.pallet-box-choice-list > div label:hover { border-color: #8abdc3; background: var(--sea-soft); }
.pallet-box-choice-list input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--sea); }
.pallet-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pallet-print-sheet { max-width: 1120px; margin: 0 auto; padding: 28px; color: #111; background: white; }
.pallet-print-title { margin-bottom: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; font-size: 20px; }
.pallet-print-title strong { font-size: 28px; }
.pallet-print-requisites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; }
.pallet-print-requisites div { border-bottom: 1px solid #b8c7ca; padding-bottom: 8px; }
.pallet-print-requisites dt { margin-bottom: 3px; color: #52676c; font-size: 12px; text-transform: uppercase; }
.pallet-print-requisites dd { margin: 0; font-weight: 750; }
.pallet-print-table { margin-top: 28px; }
.pallet-print-signature { margin-top: 48px; display: grid; grid-template-columns: auto 1fr 180px; gap: 18px; align-items: end; }
.shift-report-list { display: grid; gap: 18px; }
.shift-report-task { padding: 0; overflow: hidden; }
.shift-report-task-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px 22px; }
.shift-report-task-heading h3 { margin: 0 0 4px; font-size: 21px; }
.shift-report-task-heading p { margin: 0 0 3px; color: var(--muted); }
.shift-report-task-heading small { color: var(--muted); }
.shift-report-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.shift-report-totals { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; }
.shift-report-totals > div { min-width: 120px; padding: 15px 16px; border-right: 1px solid var(--line); }
.shift-report-totals > div:last-child { border-right: 0; }
.shift-report-totals small, .shift-report-totals strong { display: block; }
.shift-report-totals small { color: var(--muted); }
.shift-report-totals strong { margin: 3px 0; }
.shift-report-balance { display: flex; flex-wrap: wrap; gap: 7px 18px; padding: 11px 22px; color: var(--muted); background: #f7fbfb; border-bottom: 1px solid var(--line); font-size: 13px; }
.shift-report-balance strong { color: var(--ink); }
.shift-report-source-facts { padding: 15px 22px 20px; }
.shift-report-source-facts > summary { color: var(--sea); font-weight: 800; cursor: pointer; }
.shift-report-source-facts h4 { margin: 22px 0 8px; }
.shift-report-source-facts .table-scroll { margin: 0 -22px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shift-report-source-facts table { min-width: 780px; }
.shift-report-empty { margin: 0; padding: 15px 22px 20px; border-top: 1px solid var(--line); color: var(--muted); }
.wip-list { display: grid; gap: 18px; }
.wip-card { padding: 22px; }
.wip-card-warning { border-color: #d6a56e; }
.wip-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wip-card-heading h2 { margin: 0; font-size: 22px; }
.wip-card-heading p { margin: 3px 0 0; color: var(--muted); }
.wip-summary { margin: 20px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: none; border-radius: 0; }
.wip-history { margin-top: 16px; }
.wip-history > summary { color: var(--sea); font-weight: 750; cursor: pointer; }
.wip-history .table-card { margin: 14px -22px -22px; border-top: 1px solid var(--line); }
.status-open { background: #fff0cb; color: #7f5700; }
.production-route-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 16px; }
.production-route-heading h2 { margin: 0; font-size: 24px; }
.production-route-heading p { margin: 3px 0 0; color: var(--muted); }
.production-work-context { position: sticky; z-index: 12; top: 10px; display: grid; grid-template-columns: .55fr .9fr 1.5fr 1.4fr; gap: 1px; margin: -6px 0 24px; overflow: hidden; border-color: #9bcbd0; box-shadow: 0 14px 36px rgba(6, 59, 75, .14); }
.production-work-context > div { min-width: 0; padding: 12px 16px; background: white; }
.production-work-context small, .production-work-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.production-work-context small { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.production-record-history { margin-top: 8px; }
.production-record-history summary { color: var(--sea); font-weight: 750; cursor: pointer; }
.production-record-history small { margin-top: 5px; }
.production-confirm-dialog { width: min(620px, calc(100vw - 28px)); padding: 0; color: var(--ink); background: white; border: 1px solid #91c3c8; border-radius: 18px; box-shadow: 0 28px 90px rgba(3, 39, 49, .35); }
.production-confirm-dialog::backdrop { background: rgba(3, 39, 49, .52); }
.production-confirm-content { padding: 28px; }
.production-confirm-context { display: block; color: var(--muted); font-weight: 750; }
.production-confirm-content h2 { margin: 5px 0 20px; font-size: 28px; }
.production-confirm-values { display: grid; gap: 10px; }
.production-confirm-values > div { padding: 18px 20px; background: var(--sea-soft); border: 1px solid #9bcbd0; border-radius: 13px; }
.production-confirm-values small { display: block; color: var(--muted); font-weight: 750; }
.production-confirm-values strong { display: block; margin-top: 2px; color: var(--deep); font-size: clamp(34px, 8vw, 54px); line-height: 1.05; }
.production-confirm-warning { display: grid; gap: 3px; margin-top: 14px; padding: 13px 15px; color: #7f5700; background: #fff0cb; border-radius: 10px; }
.production-confirm-warning span { font-size: 13px; }
.production-confirm-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 22px; }
.shift-material-source-facts { min-width: 280px; }
.shift-material-source-facts > summary { color: var(--sea); font-weight: 750; cursor: pointer; }
.shift-material-source-facts > div { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid var(--line); }
.shift-material-source-facts > div:first-of-type { margin-top: 8px; }
.shift-material-source-facts small { color: var(--muted); }
.production-operations { display: grid; gap: 12px; }
.production-operation { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; padding: 20px 22px; }
.production-operation-in_progress { border-color: var(--sea); box-shadow: 0 16px 42px rgba(0, 122, 135, .16); }
.production-operation-completed { box-shadow: none; background: #f8fbfb; }
.operation-sequence { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--sea-soft); color: var(--sea); font-size: 18px; font-weight: 850; }
.operation-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.operation-title-row h3 { margin: 0; font-size: 19px; }
.operation-title-row p { margin: 3px 0 0; color: var(--muted); }
.operation-body .instructions { margin: 12px 0 0; }
.operation-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); }
.operation-facts div { display: flex; gap: 7px; }
.operation-facts dt { color: var(--muted); }
.operation-facts dd { margin: 0; font-weight: 750; }
.operation-comment { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.operation-deviations { margin: 9px 0 0; color: #9b5314; font-size: 13px; font-weight: 700; }
.haccp-controls { display: grid; gap: 8px; margin-top: 12px; }
.haccp-control-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f4f8f9; }
.haccp-control-item small { display: block; margin-top: 3px; color: var(--muted); }
.operation-result-compliant { color: #17655f; }
.operation-result-deviation { color: #9b5314; }
.status-issued, .status-accepted { background: #e1edf5; color: #305c78; }
.status-in_progress { background: #fff0cb; color: #7f5700; }
.status-production_completed, .status-packaging_completed, .status-completed, .status-closed { background: #d9efed; color: #17655f; }
.status-waiting { background: #e8edef; color: #66777b; }
.status-error { background: #f8dddd; color: #8b2929; }
.status-unreviewed { background: #fff0cb; color: #7f5700; }
.status-investigating { background: #f8e2d1; color: #8c4a10; }
.status-resolved, .status-accepted { background: #d9efed; color: #17655f; }
.status-input_error { background: #e8edef; color: #66777b; }
.deviation-filter { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.deviation-filter label { display: grid; gap: 6px; min-width: 0; font-weight: 700; }
.deviation-filter .form-control { width: 100%; }
.deviation-filter-search { grid-column: span 2; }
.deviation-page-heading .page-actions { flex-wrap: wrap; }
.deviation-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 18px; margin-bottom: 28px; }
.deviation-card { padding: 22px; }
.deviation-card h2, .deviation-card h3 { margin-top: 0; }
.deviation-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.deviation-card-heading h2 { margin: 10px 0 0; }
.deviation-card-heading > strong { color: var(--muted); font-size: 13px; }
.deviation-lead { margin: 16px 0; padding: 13px 15px; background: #fff6e5; border-radius: 9px; color: #7f5700; font-weight: 700; }
.deviation-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; margin: 0; }
.deviation-facts div { padding-top: 12px; border-top: 1px solid var(--line); }
.deviation-facts dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.deviation-facts dd { margin: 4px 0 0; font-weight: 700; }
.deviation-original-comment { margin: 18px 0 0; color: var(--muted); }
.notification-filter-grid { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(230px, 1fr) minmax(280px, 1.5fr) auto; align-items: end; gap: 14px; padding: 18px; margin-bottom: 16px; }
.notification-filter-grid label { display: grid; gap: 6px; min-width: 0; font-weight: 700; }
.notification-filter-grid .form-control { width: 100%; }
.notification-filter-grid .filter-actions { display: flex; gap: 8px; }
.notification-table td:nth-child(3) small + small { margin-top: 7px; }
.notification-detail-card { padding: 24px; margin-bottom: 24px; }
.notification-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.notification-detail-heading h2 { margin: 5px 0 0; font-size: 25px; }
.notification-detail-heading small { color: var(--muted); }
.notification-detail-card > p { margin: 20px 0; font-size: 17px; }
.notification-detail-card .detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.notification-detail-card .detail-grid div { padding-top: 13px; border-top: 1px solid var(--line); }
.notification-detail-card .detail-grid dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.notification-detail-card .detail-grid dd { margin: 4px 0 0; font-weight: 700; }
.notification-source-state { padding: 20px 24px; margin-bottom: 24px; }
.notification-source-state h2 { margin-top: 0; }
.deviation-decision-card > strong { display: block; margin: 12px 0 6px; font-size: 20px; }
.deviation-decision-card > small, .recall-card small, .genealogy-grid small { display: block; color: var(--muted); }
.deviation-active-until { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.investigation-timeline { border-left: 2px solid #a7ced3; margin-left: 18px; padding-left: 30px; display: grid; gap: 12px; }
.investigation-item { position: relative; padding: 18px 20px; }
.investigation-item::before { content: ""; position: absolute; left: -38px; top: 23px; width: 12px; height: 12px; border: 4px solid var(--paper); border-radius: 50%; background: var(--sea); }
.investigation-item h3 { margin: 5px 0 8px; font-size: 17px; }
.investigation-item p { margin: 5px 0; }
.investigation-item small { color: var(--muted); }
.investigation-item-correction { border-color: #d6a56e; }
.investigation-item-resolution { border-color: #78b8a4; background: #f6fcf9; }
.recall-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #d6a56e; }
.recall-card p { margin: 7px 0; }
.genealogy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.genealogy-grid p { padding: 10px 0; margin: 0; border-top: 1px solid var(--line); }
.genealogy-grid p:first-of-type { border-top: 0; }
.error-page { max-width: 680px; margin: 80px auto; }
.transfer-request-row { grid-template-columns: minmax(22rem, 2fr) repeat(3, minmax(8rem, .7fr)) auto; }
.transfer-request-line + .transfer-request-line { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.transfer-execution-row { align-items: end; display: grid; gap: 16px; grid-template-columns: minmax(18rem, 2fr) repeat(3, minmax(9rem, 1fr)); padding: 16px; }
.text-danger { color: #a53a32; }

@media (max-width: 1000px) {
  .card-grid, .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-balance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deviation-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notification-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deviation-layout { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; padding-top: 40px; }
  .login-intro h1 { font-size: 48px; }
  .quick-task-heading { position: static; grid-template-columns: 1fr; }
  .quick-task-actions { justify-self: stretch; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-task-actions .button { width: 100%; }
  .quick-task-product-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raw-test-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-request-row, .transfer-execution-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-task-product-row .quick-task-row-actions { grid-column: 2; justify-content: flex-end; }
}
@media (max-width: 680px) {
  .page-shell { width: 94vw; padding-top: 24px; }
  .topbar { min-height: 76px; padding: 10px 3vw; gap: 10px; flex-wrap: nowrap; }
  .brand { flex: 0 0 auto; margin-right: 0; }
  .brand span:last-child { display: none; }
  .topnav { flex: 1 1 auto; min-width: 0; margin-left: auto; }
  .topnav > a, .navigation-menu > summary { padding: 9px 8px; }
  .topnav > a, .topnav > .navigation-menu:not(.navigation-user-menu) { flex: 0 0 auto; }
  .navigation-user-menu { flex: 1 1 auto; min-width: 0; max-width: 42vw; }
  .navigation-user-menu > summary { width: 100%; min-width: 0; max-width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-actions { align-self: flex-end; }
  .dialog-heading { grid-template-columns: minmax(0, 1fr); }
  .dialog-actions { justify-self: stretch; }
  .dialog-actions.equal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-actions.equal-actions .button { width: 100%; min-width: 0; }
  .equal-actions { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equal-actions .button { width: 100%; min-width: 0; }
  .setting-history-line { grid-template-columns: 1fr; gap: 2px; }
  .setting-history-item p { margin-left: 0; }
  .version-history-heading { flex-direction: column; }
  .version-diff-row { grid-template-columns: 1fr; gap: 4px; }
  .version-diff-arrow { transform: rotate(90deg); transform-origin: left center; }
  .route-activation-form { width: 100%; flex-wrap: wrap; }
  .route-activation-form label, .route-activation-form .button { width: 100%; min-width: 0; }
  .permission-history-changes { margin-left: 0; }
  .card-grid, .settings-grid, .role-grid, .form-grid { grid-template-columns: 1fr; }
  .dashboard-scope { width: 100%; margin-left: 0; }
  .field-checkbox > div { grid-template-columns: 1fr; }
  .audit-filter { grid-template-columns: 1fr; }
  .audit-filter-actions { justify-content: flex-end; }
  .production-summary { grid-template-columns: 1fr; }
  .shift-report-task-heading { flex-direction: column; }
  .shift-report-statuses { justify-content: flex-start; }
  .production-balance { grid-template-columns: 1fr; }
  .deviation-filter, .deviation-facts, .genealogy-grid { grid-template-columns: 1fr; }
  .notification-filter-grid, .notification-detail-card .detail-grid { grid-template-columns: 1fr; }
  .stock-filter, .counterparty-filter { grid-template-columns: 1fr; }
  .stock-filter-actions { justify-content: flex-end; }
  .stock-operation-summary { grid-template-columns: 1fr; }
  .stock-movement-heading { align-items: flex-start; flex-direction: column; }
  .stock-movement-heading > div:last-child { text-align: left; }
  .notification-filter-grid .filter-actions { justify-content: flex-end; }
  .notification-detail-heading { flex-direction: column; }
  .deviation-filter-search { grid-column: auto; }
  .recall-card { align-items: flex-start; flex-direction: column; }
  .production-operation { grid-template-columns: 42px minmax(0, 1fr); padding: 17px; gap: 10px; }
  .production-work-context { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-confirm-content { padding: 21px 17px; }
  .production-confirm-actions { grid-template-columns: 1fr; }
  .wip-card-heading { align-items: flex-start; flex-direction: column; }
  .operation-sequence { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
  .operation-title-row { gap: 10px; }
  .login-intro h1 { font-size: 39px; }
  .quick-task-actions { grid-template-columns: 1fr; }
  .quick-task-main-grid, .quick-task-product-row, .quick-task-input-row, .raw-receipt-line, .raw-test-row, .document-facts, .transfer-request-row, .transfer-execution-row { grid-template-columns: 1fr; }
  .quick-task-product-row .quick-task-row-actions { grid-column: 1; }
  .quick-task-row-actions { justify-content: flex-end; }
  .date-picker-popover { padding: 14px; }
  .date-picker-weekdays, .date-picker-days { gap: 4px; }
  .date-picker-day { min-height: 44px; }
  .select-picker-option { min-height: 48px; }
  .timesheet-save-panel { grid-template-columns: 1fr; }
  .timesheet-month-form { grid-template-columns: 1fr; gap: 4px; }
  .timesheet-toolbar { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .timesheet-quick-values button { min-width: 72px; padding: 6px 8px; }
  .organization-editor-dialog { padding: 20px 16px; }
  .timeline { margin-left: 11px; padding-left: 23px; }
  .timeline-item::before { left: -31px; }
  .route-operation-card-editable { grid-template-columns: 22px 32px minmax(0, 1fr); padding: 16px 14px; gap: 9px; }
  .route-drag-handle { font-size: 21px; }
  .timeline-sequence { font-size: 21px; }
  .route-order-status, .archived-route-operations { margin-left: 36px; }
  .editor-tab-list { overflow-x: auto; }
  .editor-tab { padding: 11px 12px; white-space: nowrap; }
  .organization-bank-heading { align-items: stretch; flex-direction: column; }
}

@media print {
  body { background: white; }
  .topbar, .messages, .pallet-print-actions { display: none !important; }
  .page-shell { width: 100%; max-width: none; padding: 0; }
  .pallet-print-sheet { max-width: none; padding: 0; }
  .pallet-print-table { box-shadow: none; }
  .pallet-print-table th, .pallet-print-table td { padding: 7px 8px; color: #111; border: 1px solid #777; }
}
