:root {
    font-family: Arial, sans-serif;
    color: #172c26;
    background: #f1f5f2;
    --muted: #566761;
    --line: #dde6e0;
    --green: #1c6146;
    --nav-bg: #102d25;
    --bank-head: #00b050;
    --bank-advance: #eef779;
    --cash-head: #ff0000;
    --cash-advance: #fd5649;
    --payment-fill: #83e28e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow: hidden; }
body { margin: 0; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid #2a8964; outline-offset: 3px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 10px clamp(12px, 2.6vw, 44px); background: var(--nav-bg); color: #e9f3ee; }
.brand { display: flex; flex: 0 0 auto; align-items: center; color: #fff; text-decoration: none; font-size: 1.32rem; font-weight: 700; letter-spacing: -.045em; }
.brand-accent { color: #a8dec1; }
.brand-icon { width: 34px; height: 34px; margin-right: 9px; border-radius: 9px; background: #b9e9cb; color: #174b38; display: grid; place-items: center; }
#menu { display: flex; gap: 5px; min-width: 0; overflow-x: auto; padding: 3px; }
.nav-link { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 8px 12px; min-height: 39px; border: 1px solid transparent; border-radius: 9px; color: #cbe0d6; text-decoration: none; font-size: .94rem; }
.nav-link:hover { background: #1a3b32; color: #fff; }
.account-actions { display: flex; flex: 0 0 auto; gap: 4px; margin-left: auto; }
.account-actions .nav-link { border-color: #376653; }
#account-support { position: relative; }
.support-unread-dot { position: absolute; inset: 3px 3px auto auto; width: 8px; height: 8px; border-radius: 50%; background: #f14d4d; box-shadow: 0 0 0 2px var(--nav-bg); }
.profile-toggle { max-width: min(225px, 42vw); }
#account-profile-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.profile-toggle .year-chevron { flex: 0 0 auto; }
.profile-menu { min-width: 156px; }
.profile-menu .order-year-choice:last-child { margin-top: 4px; border-top: 1px solid #d7e5dc; }
.account-guest { display: grid; align-content: center; justify-items: center; gap: 15px; padding: 20px; }
.workspace-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e3ceaa; border-radius: 8px; background: #fff5e3; padding: 7px 12px; margin-bottom: 8px; color: #644814; }
.workspace-banner.support-mode { border-color: #abcad8; background: #ecf6fa; color: #20495a; }
.workspace-banner button { min-height: 32px; padding: 5px 9px; }
.account-fields { display: grid; gap: 9px; }
#account-form > .account-fields, #password-form > .account-fields { margin-top: 12px; }
.account-fields label { display: grid; gap: 4px; }
.account-check, .account-fields .account-check { display: flex; align-items: center; gap: 7px; }
.account-check input { accent-color: var(--green); }
.account-fields input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid #cbdad0; border-radius: 6px; color: #173e31; }
.account-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.crm-dialog.accounts-panel { width: min(740px, calc(100vw - 24px)); }
.accounts-panel-heading, .account-row-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.accounts-list { display: grid; gap: 8px; overflow-y: auto; max-height: 55dvh; margin-top: 10px; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: start; gap: 8px; padding: 10px; border: 1px solid #d7e5dc; border-radius: 7px; overflow-wrap: anywhere; }
.account-row p { color: var(--muted); margin: 3px 0; }
.account-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
.account-row-actions button { min-height: 33px; padding: 5px 9px; }
.account-status { border-radius: 5px; padding: 4px 6px; color: #713e28; background: #f8e8dc; font-size: .82rem; }
.account-status[data-status="active"] { background: #e3f2e8; color: #206246; }
.account-success { color: #206246; }
.crm-dialog.support-dialog { display: flex; flex-direction: column; width: min(800px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 28px)); }
.support-dialog:not([open]) { display: none; }
.support-header, .support-thread-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.support-header h2, .support-thread-header h3 { margin: 0; }
.support-layout { display: grid; grid-template-columns: minmax(150px, 28%) minmax(0, 1fr); flex: 1; min-height: 0; margin-top: 12px; border: 1px solid #d7e5dc; border-radius: 8px; overflow: hidden; }
.support-sidebar { display: flex; flex-direction: column; min-height: 0; gap: 7px; padding: 9px; border-right: 1px solid #d7e5dc; background: #f4f8f5; }
.support-sidebar .primary-button { padding-inline: 6px; }
.support-list { overflow: auto; }
.support-chat-choice { display: grid; width: 100%; gap: 4px; padding: 8px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; text-align: left; overflow-wrap: anywhere; }
.support-chat-choice:hover, .support-chat-choice[aria-current] { border-color: #c5dace; background: #e7f2eb; }
.support-chat-unread::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-start: 6px; border-radius: 50%; background: #d93b3b; vertical-align: middle; }
.support-chat-meta, #support-thread-status { color: var(--muted); font-size: .82rem; }
.support-main { min-width: 0; min-height: 0; padding: 10px; }
.support-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; height: 100%; }
.support-thread-header h3 { font-size: 1.025rem; overflow-wrap: anywhere; }
.support-thread-header > div { min-width: 0; }
.support-messages { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 8px; background: #f3f7f4; border-radius: 6px; }
.support-message { align-self: flex-start; max-width: 88%; padding: 7px 10px; border: 1px solid #deebe2; border-radius: 9px; background: #fff; }
.support-message-own { align-self: flex-end; background: #e2f2e8; }
.support-message-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: .77rem; overflow-wrap: anywhere; }
.support-message-header time { color: var(--muted); }
.support-message p { margin-top: 3px; white-space: pre-wrap; }
.support-reply { display: flex; gap: 7px; align-items: end; }
.support-dialog textarea { min-width: 0; width: 100%; resize: vertical; max-height: 140px; padding: 7px 8px; border: 1px solid #cbdad0; border-radius: 6px; color: #173e31; }
#support-start-form > button { justify-self: start; }
@media (max-width: 620px) {
    .support-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, auto) minmax(0, 1fr); }
    .support-sidebar { max-height: 140px; border-right: 0; border-bottom: 1px solid #d7e5dc; }
    .support-sidebar .primary-button { align-self: start; min-height: 32px; padding-block: 5px; }
}
.nav-link[aria-current] { background: #23513f; border-color: #376653; color: #fff; font-weight: 700; }
button.nav-link { background: transparent; white-space: nowrap; }
.nav-link.year-toggle { border-color: #376653; }
.nav-link .year-label { font-size: .82rem; color: #bddbcc; }
.year-chevron { width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.order-years-menu { position: fixed; inset: auto; min-width: 132px; max-height: min(280px, 55dvh); overflow: auto; margin: 0; padding: 5px; border: 1px solid #c2d5c8; border-radius: 8px; color: #173e31; background: #fff; box-shadow: 0 8px 22px #173e3130; }
.order-year-choice { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 5px; background: transparent; color: inherit; text-align: left; }
.order-year-choice:hover, .order-year-choice[aria-current] { background: #e4f3e9; }
.call-years-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; }
.call-years-menu input { accent-color: #23513f; }
.call-years-menu label:hover { background: #e4f3e9; }
.call-import-year { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.call-import-year select { padding: 6px; border: 1px solid #cbdad0; border-radius: 6px; background: #fff; color: #173e31; }
#call-import-error { margin-top: 8px; color: #892d24; }
.nav-link:focus-visible, .brand:focus-visible { outline-color: #b9e9cb; }

.icon { position: relative; display: inline-block; width: 17px; height: 17px; flex: 0 0 auto; vertical-align: middle; }
.icon::before, .icon::after { content: ''; position: absolute; display: block; }
.icon-orders { border: 1.5px solid currentColor; border-radius: 3px; }
.icon-orders::before { inset: 4px 3px; border-block: 1.5px solid currentColor; }
.icon-contacts { border: 1.5px solid currentColor; border-radius: 3px; }
.icon-contacts::before { width: 4px; height: 4px; left: 3px; top: 3px; border-radius: 50%; background: currentColor; box-shadow: 0 5px 0 -.3px currentColor; }
.icon-contacts::after { border-top: 1.5px solid currentColor; width: 4px; top: 5px; right: 2px; }
.icon-managers::before { left: 5px; top: 0; width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-managers::after { left: 2px; bottom: 0; width: 12px; height: 6px; border: 1.5px solid currentColor; border-radius: 6px 6px 2px 2px; }
.icon-seeds::before { top: 2px; left: 3px; width: 10px; height: 12px; border: 1.5px solid currentColor; border-radius: 80% 15% 80% 25%; transform: rotate(14deg); }
.icon-seeds::after { width: 1.5px; height: 11px; left: 7px; top: 7px; background: currentColor; transform: rotate(36deg); }
.icon-deliveries::before { top: 3px; left: 0; width: 11px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px; }
.icon-deliveries::after { top: 7px; left: 11px; width: 4px; height: 5px; border: 1.5px solid currentColor; border-radius: 0 4px 1px 0; }
.icon-deliveries { background: radial-gradient(circle at 4px 14px, currentColor 1.6px, transparent 1.8px), radial-gradient(circle at 13px 14px, currentColor 1.6px, transparent 1.8px); }
.icon-search::before { top: 0; left: 0; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-search::after { width: 7px; height: 1.5px; top: 12px; left: 9px; transform: rotate(45deg); background: currentColor; }
.icon-plus::before { top: 8px; left: 2px; right: 2px; height: 1.5px; border-radius: 2px; background: currentColor; }
.icon-plus::after { left: 8px; top: 2px; bottom: 2px; width: 1.5px; border-radius: 2px; background: currentColor; }

.workspace { display: flex; flex-direction: column; padding: 20px clamp(12px, 2.6vw, 44px); min-width: 0; min-height: 0; }
h2, p { margin: 0; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; font-size: .92rem; font-weight: 700; white-space: nowrap; }
.primary-button { background: var(--green); color: #fff; }
.primary-button:not(:disabled):hover { background: #154d37; }
.secondary-button { background: #fff; border-color: #d3dfd7; color: #284239; }
.secondary-button:hover { background: #edf4ef; }
.ledger { display: flex; flex-direction: column; flex: 1; min-height: 0; border: 1px solid #d6e2d9; background: #fff; border-radius: 13px; box-shadow: 0 2px 5px #18352a08; overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; }
.toolbar-filters { display: none; }
.toolbar-filters:has(> :not([hidden])) { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.toolbar-filters:has(.call-filters:not([hidden])) {
    padding: 4px;
    border-radius: 10px;
    background: #e5efe9;
    box-shadow: inset 0 0 0 1px #cfdfd4;
}
.position-actions { display: flex; flex: 0 0 auto; gap: 6px; margin-left: auto; }
.order-excel-file { display: grid; gap: 6px; margin-top: 12px; }
.order-excel-file input { max-width: 100%; }
#order-excel-season { margin-bottom: 6px; font-weight: 700; }
.position-actions .primary-button, .position-actions .remove-button { width: max-content; min-height: 39px; padding: 7px 10px; }
.toolbar:has(.call-filters:not([hidden])) { flex-wrap: nowrap; justify-content: flex-start; gap: 7px; padding-inline: 12px; overflow-x: auto; }
.toolbar:has(.call-filters:not([hidden])) .search { flex: 1 1 220px; width: auto; min-width: 125px; max-width: 370px; }
.toolbar:has(.call-filters:not([hidden])) .position-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.call-filters .secondary-button, .toolbar:has(.call-filters:not([hidden])) .position-actions .secondary-button { min-height: 39px; padding: 7px 9px; font-size: .875rem; }
.call-filters, .call-status-buttons { display: flex; align-items: center; justify-content: center; gap: 4px; }
.call-filters { flex: 0 0 auto; justify-content: flex-start; }
.call-status-buttons { container-type: inline-size; flex-wrap: wrap; padding: 4px; }
.call-mark { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 26px; height: 28px; padding: 0 4px; border: 1px solid var(--mark-edge); border-radius: 5px; color: var(--mark-ink); background: var(--mark-base); font-size: .94rem; font-weight: 700; line-height: 1; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.call-mark[data-call-status='reached'] { --mark-base: #dbf2e5; --mark-on: #99d8ae; --mark-ink: #175633; --mark-edge: #78b994; }
.call-mark[data-call-status='unreached'] { --mark-base: #f9efd6; --mark-on: #ecd395; --mark-ink: #775613; --mark-edge: #c6a969; }
.call-mark[data-call-status='refused'] { --mark-base: #fce4e2; --mark-on: #f3aaa5; --mark-ink: #842a24; --mark-edge: #d58d86; }
.call-mark[data-call-status='callback'] { --mark-base: #e2f1fc; --mark-on: #a7d6f4; --mark-ink: #1e557d; --mark-edge: #79aecd; }
.call-mark[aria-pressed='true'] { background: var(--mark-on); box-shadow: inset 0 0 0 2px var(--mark-ink); transform: translateY(-1px); }
.call-mark:active, .call-today-filter:active { transform: scale(.9); }
.call-filters .call-mark[aria-pressed='false'] { background: color-mix(in srgb, var(--mark-base) 70%, #fff); border-color: color-mix(in srgb, var(--mark-edge) 65%, #fff); }
.call-filters .call-mark[data-call-status='callback'][aria-pressed='false'] { background: #fff; color: #536660; border-color: #cbdad0; }
.call-today-filter[aria-pressed='true'] { background: #d6ecfc; border-color: #387ca9; color: #194d73; box-shadow: inset 0 0 0 1px #387ca9; }
.call-filters .call-mark { min-width: 32px; height: 36px; }
.call-status-button:disabled, #close-call-season:disabled { cursor: default; }
.call-status-buttons .call-status-button { min-width: 0; width: 27px; width: clamp(26px, calc(25cqi - 4px), 44px); height: clamp(27px, 23cqi, 40px); padding: 0; font-size: clamp(.875rem, 14cqi, 1.15rem); }
.call-filter-pulse { animation: call-filter-pulse .24s ease-out; }
@keyframes call-filter-pulse { 45% { transform: scale(.86); } 78% { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .call-mark { transition: none; } .call-filter-pulse { animation: none; } }
.call-bell { position: relative; min-width: 42px; justify-content: center; }
.call-reminder-count { position: absolute; top: -6px; right: -5px; min-width: 17px; padding: 2px 4px; border-radius: 12px; background: #276c9c; color: #fff; font-size: .7rem; line-height: 1.1; text-align: center; }
.callback-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.callback-fields label { display: grid; gap: 4px; }
.callback-fields input { min-width: 118px; padding: 6px; border: 1px solid #cbdad0; border-radius: 6px; font: inherit; color: #173e31; }
.stock-fields { display: grid; gap: 10px; margin-top: 12px; }
.stock-fields label { display: grid; gap: 4px; }
.stock-fields input { width: 100%; padding: 8px; border: 1px solid #cbdad0; border-radius: 6px; font: inherit; color: #173e31; }
#stock-title + p:empty { display: none; }
.call-dialog-error { margin-top: 8px; color: #892d24; }
.call-reminder-list { display: grid; gap: 7px; max-height: min(350px, 60dvh); padding: 0; margin: 8px 0; overflow: auto; list-style: none; }
.call-reminder-list li { display: flex; align-items: baseline; gap: 10px; padding: 7px 9px; border-radius: 5px; background: #edf6fb; overflow-wrap: anywhere; }
.call-reminder-list time { flex: 0 0 auto; font-weight: 700; }
.remove-button { min-height: 39px; padding: 8px 13px; border: 1px solid #d4a8a3; border-radius: 8px; background: #fff4f2; color: #892d24; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.remove-button:not(:disabled):hover { background: #ffe2de; }
.crm-dialog { width: min(430px, calc(100vw - 28px)); padding: 21px; border: 1px solid #cbdad0; border-radius: 13px; background: #fff; color: #173e31; box-shadow: 0 12px 36px #102d2550; }
.crm-dialog::backdrop { background: #102d2573; }
.crm-dialog h2 { margin-bottom: 8px; font-size: 1.22rem; }
.crm-dialog p { line-height: 1.45; overflow-wrap: anywhere; }
#remove-error { margin-top: 8px; color: #892d24; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cell-color-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.color-control { display: flex; align-items: center; gap: 6px; position: relative; min-height: 39px; padding: 7px 9px; border: 1px solid #cbdad0; border-radius: 8px; background: #fff; color: #244438; font-size: .875rem; white-space: nowrap; }
.color-control:disabled { opacity: .5; cursor: default; }
.color-control:not(:disabled):hover, .color-control[aria-expanded='true'] { background: #edf4ef; }
.color-swatch { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #63746b; border-radius: 3px; background: var(--swatch, #fff); }
.color-swatch.color-letter { border: 0; border-bottom: 3px solid var(--swatch, #172c26); border-radius: 0; background: transparent; font-weight: 700; line-height: 1; }
.order-sort { display: flex; gap: 6px; flex: 0 0 auto; }
.order-sort select { width: min(9.6rem, 39vw); min-height: 39px; padding: 6px 8px; border: 1px solid #cbdad0; border-radius: 8px; color: #244438; background: #fff; font-size: .875rem; text-overflow: ellipsis; cursor: pointer; }
.toolbar-two-lines { display: inline-block; line-height: 1.08; text-align: center; }
.region-filter { position: relative; }
.region-filter select { height: 39px; }
.region-filter-caption { display: none; position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; color: #244438; font-size: .875rem; }
.region-filter:has(option[value=""]:checked) select { color: transparent; }
.region-filter select option, .region-filter select optgroup { color: #244438; }
.region-filter:has(option[value=""]:checked) select { appearance: none; }
.region-filter:has(option[value=""]:checked)::after { position: absolute; content: ""; right: 10px; top: 15px; width: 6px; height: 6px; border: solid #244438; border-width: 0 1px 1px 0; transform: rotate(45deg); pointer-events: none; }
.region-filter:has(option[value=""]:checked) .region-filter-caption { display: block; }
.toolbar:has(.call-filters:not([hidden])) .order-sort select { width: min(7.8rem, 39vw); }
#call-season-filter { min-height: 39px; padding: 6px 8px; font-size: .875rem; font-weight: 400; }
#call-season-filter.filter-active, #call-season-filter[aria-expanded='true'] { background: #e4f3e9; border-color: #78a98e; }
@media (max-width: 1440px) {
    .toolbar:has(.call-filters:not([hidden])) { gap: 5px; padding-inline: 8px; }
    .toolbar:has(.call-filters:not([hidden])) .cell-color-tools,
    .toolbar:has(.call-filters:not([hidden])) .position-actions { gap: 4px; }
    .toolbar-filters:has(.call-filters:not([hidden])) { gap: 4px; padding: 3px; }
    .toolbar:has(.call-filters:not([hidden])) :is(.color-control, .position-actions button, .call-today-filter) { padding-inline: 6px; font-size: .8rem; }
    .toolbar:has(.call-filters:not([hidden])) .order-sort select { width: 98px; font-size: .8rem; }
    #call-season-filter { font-size: .8rem; gap: 5px; }
    .toolbar:has(.call-filters:not([hidden])) .region-filter-caption { font-size: .8rem; }
    .call-filters .call-mark { min-width: 27px; }
    .toolbar:has(.call-filters:not([hidden])) .call-bell { min-width: 33px; }
}
.order-stats { display: grid; grid-template-columns: repeat(4, max-content); gap: 12px; margin: 0; color: var(--muted); }
#seed-stats { grid-template-columns: repeat(3, max-content); }
.order-stats > div { border-left: 1px solid #dce6de; padding-left: 10px; }
.order-stats dt { font-size: .77rem; line-height: 1.2; }
.order-stats dd { margin: 3px 0 0; color: #173e31; font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.color-palette { position: fixed; inset: auto; margin: 0; padding: 10px; border: 1px solid #626262; border-radius: 7px; color: #fff; background: #262626; box-shadow: 0 7px 22px #0005; }
.color-palette p { margin: 10px -10px 8px; padding: 9px 10px 0; border-top: 1px solid #555; font-size: .875rem; font-weight: 700; }
.palette-grid { display: grid; grid-template-columns: repeat(10, 17px); column-gap: 3px; }
.palette-color { width: 17px; height: 17px; padding: 0; border: 1px solid #a6a6a655; background: var(--sample); }
.palette-color:hover, .palette-color:focus-visible, .palette-color[aria-pressed='true'] { position: relative; z-index: 1; outline: 2px solid #fff; outline-offset: -2px; }
.search { display: flex; align-items: center; gap: 9px; min-width: 0; width: min(100%, 370px); height: 40px; padding: 0 11px; border: 1px solid #d8e3db; border-radius: 8px; background: #f8faf8; color: #526860; }
.search:focus-within { outline: 2px solid #2a8964; outline-offset: 1px; }
.search input { width: 100%; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #172c26; font-size: .9rem; }
.search input::placeholder { color: #526860; }
.table-scroll { flex: 1; min-height: 0; overflow: auto; border-block: 1px solid var(--line); }
.table-scroll:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: .875rem; }
.calls-table { min-width: var(--call-width, 540px); }
.calls-table .col-company { width: 156px; --call-left: var(--call-left-company); }
.calls-table td.col-company { background: #edf4ee; }
.calls-table .col-phone, .calls-table .col-manager, .calls-table .col-region { width: 112px; }
.calls-table .col-manager { --call-left: var(--call-left-manager); }
.calls-table .col-phone { --call-left: var(--call-left-phone); }
.calls-table .col-region { --call-left: var(--call-left-region); }
.calls-table .col-callStatus { width: 133px; --call-left: var(--call-left-callStatus); }
.calls-table .col-callbackAt { width: 106px; --call-left: var(--call-left-callbackAt); }
.callback-slot { display: block; padding: 4px; font-variant-numeric: tabular-nums; }
.callback-slot span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.callback-clock { font-size: .86em; }
.call-year-heading { background: #23513f; color: #fff; }
.call-current-heading { background: #173e31; }
.calls-table :is(.call-year-heading, th, td).closed-call-year {
    background-image: linear-gradient(#4ca86e20, #4ca86e20);
}
.season-status-mark { margin: 4px; }
.calls-table td.col-seasonStatus { padding: 4px; }
.call-year-start { border-left: 1px solid #000; }
.calls-table .call-line :is(.col-hybrid, .col-quantity, .col-price, .col-note) { background-color: #f7faf8; }
.orders-table { min-width: 1520px; }
.directory-table { min-width: 630px; }
.directory-table th:nth-child(1) { width: 25%; }
.directory-table th.seed-reorder, .seed-reorder { width: 36px; text-align: center; }
.directory-table:has(.seed-reorder) th.col-hybrid { width: 25%; }
.seed-handle { display: block; width: 100%; min-height: 33px; padding: 2px; border: 0; background: transparent; color: #49675b; font-size: 1.2rem; line-height: 1; cursor: grab; }
.seed-handle:active { cursor: grabbing; }
.seed-handle:focus-visible { outline-offset: -2px; }
.seed-dragging { opacity: .6; }
.seed-drop-before > td { box-shadow: inset 0 2px #2a8964 !important; }
.seed-drop-after > td { box-shadow: inset 0 -2px #2a8964 !important; }
thead { position: sticky; top: 0; z-index: 2; }
th, td { text-align: center; vertical-align: middle; padding: 10px 9px; }
.col-company { text-align: left; }
th { font-weight: 700; color: #2d4539; background: #e8f0eb; line-height: 1.25; border-bottom: 1px solid #000; }
th.resizable { position: relative; padding-inline-end: 12px; overflow-wrap: anywhere; }
.calls-table :is(.call-fixed, .call-current-heading) { position: sticky; left: var(--call-left, 0px); z-index: 1; }
.calls-table th:is(.call-fixed, .call-current-heading) { z-index: 3; }
.column-grip { position: absolute; inset: 0 0 0 auto; width: 10px; cursor: col-resize; touch-action: none; }
.column-grip:hover, .column-grip:focus-visible, .column-grip.dragging { background: #2a89644d; outline-offset: -2px; }
body.resizing-columns, body.resizing-columns * { cursor: col-resize !important; user-select: none; }
td { padding: 0; position: relative; vertical-align: middle; border-bottom: 1px solid #000; background: #fff; line-height: 1.35; overflow-wrap: anywhere; }
tbody tr:nth-child(even) td { background: #f6f9f7; }
tbody td:hover { cursor: text; }
tbody tr:not(.active-row) td:hover:not(.custom-cell-background) { box-shadow: inset 0 0 0 100px #287b5610; }
tbody tr.active-row > td:not(.custom-cell-background, .col-bankAdvance, .col-bankBalance, .col-bankPayment, .col-cashAdvance, .col-cashBalance, .col-cashPayment) { background-color: #e7f3fc; }
th:not(:last-child), td:not(:last-child) { border-right: 1px solid #000; }
.order-line td:last-child { border-right: 1px solid #000; }
.order-action { width: 50px; text-align: center; }
.add-order-line { width: 30px; height: 30px; margin: 3px; border: 1px solid #9bbca8; border-radius: 6px; background: #e9f4ec; color: #1c6146; font-size: 1.25rem; line-height: 1; }
.add-order-line:hover { background: #cfe8d7; }
td[data-calculation] { padding: 8px 9px; cursor: default; }
.order-line td.col-hybrid { box-shadow: inset 3px 0 #9bbca8; }
.orders-table tbody tr:has(+ tr.order-line) > :is(.col-hybrid, .col-quantity, .col-price, .col-weight) { border-bottom-color: #9ba39e; }
.orders-table .col-company { position: sticky; left: 0; z-index: 1; width: 150px; }
.orders-table td.col-company { background: #edf4ee; font-weight: 700; }
.orders-table .col-manager { width: 92px; }
.orders-table .col-note { width: 125px; }
.orders-table .col-phone { width: 105px; }
.orders-table .col-address { width: 104px; }
.orders-table .col-region { width: 106px; }
.orders-table .col-hybrid { width: 112px; }
.orders-table .col-quantity { width: 62px; }
.orders-table .col-price { width: 77px; }
.orders-table .col-weight { width: 70px; }
.col-note { white-space: pre-line; }
.col-phone { font-variant-numeric: tabular-nums; }
.col-quantity, .col-price, .col-weight, .payment-subhead,
td[class*='col-bank'], td[class*='col-cash'] { font-variant-numeric: tabular-nums; }
td.col-price, td[class*='col-bank'], td[class*='col-cash'] { white-space: nowrap; }
.payment-heading { color: #fff; text-align: center; letter-spacing: .005em; }
.payment-heading.bank { background: var(--bank-head); }
.payment-heading.cash { background: var(--cash-head); }
.payment-subhead { font-size: .875rem; text-align: center; }
.orders-table .col-bankAdvance { background: var(--bank-advance); color: #000; }
.orders-table .col-cashAdvance { background: var(--cash-advance); color: #000; }
.orders-table :is(.col-bankBalance, .col-cashBalance) { background: #fff; color: #000; }
.orders-table :is(.col-bankPayment, .col-cashPayment) { background: var(--payment-fill); color: #000; font-weight: 700; }
.cell-value { display: block; width: 100%; min-height: 34px; border: 0; padding: 8px 9px; background: transparent; color: inherit; font: inherit; text-align: inherit; white-space: inherit; overflow-wrap: inherit; cursor: text; }
.cell-value:focus-visible { outline-offset: -2px; }
td.active-cell { outline: 2px solid #2a8964; outline-offset: -2px; }
.custom-cell-text :is(.cell-input, .note-alert) { color: inherit; }
.custom-cell-background .cell-input { background: transparent; }
.cell-value { overflow: hidden; text-overflow: ellipsis; }
.col-initialStock, .col-soldStock, .col-remainingStock { font-variant-numeric: tabular-nums; }
td:is(.col-soldStock, .col-remainingStock) { padding: 8px 9px; font-weight: 700; cursor: default; }
td.stock-negative { color: #a02e25; }
.col-company .cell-value, .col-hybrid .cell-value, .col-name .cell-value { font-weight: 700; }
.cell-empty { color: transparent; }
.cell-empty:focus-visible, td:hover .cell-empty, .draft-row td:first-child .cell-empty { color: #566761; }
.draft-row td { background: #edf7ef; }
.draft-row td:first-child { font-weight: 700; }
.editing-cell { box-shadow: inset 0 0 0 2px #2a8964; }
.cell-input { display: block; width: calc(100% - 6px); min-width: 0; min-height: 30px; margin: 3px; padding: 4px 5px; color: #172c26; background: #fff; border: 0; border-radius: 2px; text-align: inherit; }
.cell-input:focus { outline: 0; }
.cell-input[aria-invalid='true'] { box-shadow: inset 0 0 0 2px #a02e25; }
.cell-input[readonly] { background: #f1f4f2; }
.cell-input[type='number'] { appearance: textfield; }
.cell-input[type='number']::-webkit-inner-spin-button, .cell-input[type='number']::-webkit-outer-spin-button { appearance: none; margin: 0; }
textarea.cell-input { resize: vertical; }
.cell-choices { position: fixed; inset: auto; margin: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 4px; border: 1px solid #c2d5c8; border-radius: 7px; background: #fff; color: #172c26; box-shadow: 0 8px 22px #173e3130; }
.cell-choice, .choice-message { display: block; width: 100%; padding: 8px 9px; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.35; text-align: left; }
.cell-choice { border: 0; border-radius: 4px; background: transparent; color: inherit; }
.cell-choice:hover, .cell-choice[aria-selected='true'] { background: #e4f3e9; }
.create-choice { color: #1b6548; font-weight: 700; }
.choice-message { color: var(--muted); }
.note-alert { color: #a02e25; }
.empty-state { padding: 42px 15px; color: var(--muted); text-align: center; }
.empty-state button { display: flex; margin: 15px auto 0; }
.ledger-footer { flex: 0 0 auto; overflow-x: auto; white-space: nowrap; padding: 9px 15px 10px; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.ledger-footer:focus-visible { outline-offset: -2px; }
.ledger-footer strong { color: #1c6146; }
.seed-name, .seed-balance { display: inline-block; padding: 2px 7px; border: 1px solid #aebbb1; border-radius: 4px; }
.seed-balance { min-width: 2.1em; text-align: center; }
.seed-separator { margin-inline: .45em; color: #808983; font-weight: 700; }
.ledger-footer .stock-negative { color: #a02e25; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.notification { position: fixed; right: 20px; bottom: 20px; padding: 12px 16px; border-radius: 8px; background: #173e31; color: #fff; box-shadow: 0 4px 14px #173e3140; font-size: .9rem; }

@media (max-width: 780px) {
    .topbar { flex-wrap: wrap; gap: 6px; }
    .brand-icon { width: 28px; height: 28px; }
    #menu { flex-basis: 100%; }
    .nav-link { gap: 6px; min-height: 36px; padding: 6px 8px; }
    .workspace { padding: 20px 12px; }
}

@media (max-width: 1420px) {
    .toolbar { flex-wrap: wrap; }
    .order-stats { order: 1; flex-basis: 100%; }
}

@media (max-width: 520px) {
    .toolbar { flex-wrap: wrap; padding-inline: 9px; gap: 7px; }
    .toolbar .search { width: 100%; }
    .order-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
    .toolbar .primary-button { padding-inline: 8px; font-size: .875rem; }
    .search input, .cell-input { font-size: 1rem; }
}

@media (max-height: 520px) {
    .workspace { padding-block: 8px; }
    .toolbar, .ledger-footer { padding-block: 6px; }
}
