:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --border: #e1e4e8;
    --border-strong: #cfd5dc;
    --text: #20242a;
    --muted: #6f7782;
    --blue: #2864b7;
    --blue-dark: #202248;
    --green: #287443;
    --green-bg: #e7f5eb;
    --red: #bd3d3d;
    --red-bg: #fff2f2;
    --amber: #9b5c00;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.35;
}

button,
input,
select,
textarea {
    font: inherit;
}

header {
    height: 58px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
    text-decoration: none;
}

.user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 26px 24px 40px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: 27px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 14px;
    font-size: 18px;
    line-height: 1.2;
}

a {
    color: #275dad;
}

.muted {
    color: var(--muted);
}

.tiny {
    margin-top: 3px;
    font-size: 11px;
}

.small-text {
    font-size: 12px;
    line-height: 1.55;
}

.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.page-title-row {
    margin-bottom: 18px;
}

.card,
.empty,
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card {
    padding: 17px;
    margin-bottom: 18px;
}

.empty,
.login-box {
    padding: 30px;
}

/* Controls */
.button {
    appearance: none;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
}

.button:hover {
    filter: brightness(.96);
    text-decoration: none;
}.button.secondary {
    background: #fff;
    border-color: #c8cfd7;
    color: #4f5965;
}

.button.danger {
    background: var(--red);
    border-color: var(--red);
}

.button.small {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
}

.actions {
    margin-top: 16px;
}

.actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.actions-inline form,
.row-actions form {
    margin: 0;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.row-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
}

.row-action-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Form page header */

.form-page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}.form-page-header .nav-back {
    order: -1;
}

.form-page-heading {
    display: grid;
    gap: 5px;
}

.form-page-header h1 {
    margin: 0;
}

.form-page-context {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Fields */
label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: #3974bc;
    box-shadow: 0 0 0 2px rgba(57, 116, 188, .10);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
}

.grid .wide {
    grid-column: span 2;
}

.item-grid {
    display: grid;
    gap: 12px;
}

.item-grid-row {
    display: grid;
    gap: 10px;
    align-items: start;
}

.item-grid-row-main {
    grid-template-columns:
        120px
        minmax(280px, 1fr)
        minmax(180px, 240px);
}

.item-grid-row-pricing {
    grid-template-columns:
        110px
        110px
        minmax(170px, 1fr)
        minmax(190px, 1fr)
        130px;
}

.field-help {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.35;
}

/* Tables */
.table-scroll {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    padding: 9px 8px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e8eaed;
}

th {
    color: #69717c;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .01em;
}

td {
    font-size: 12.5px;
}

tbody tr:last-child > td {
    border-bottom: 0;
}

.actions-col,
.actions-cell {
    width: 1%;
    white-space: nowrap;
}

.actions-cell {
    text-align: right;
}

/* Badges */
.badge,
.proposal-badge,
.fx-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 650;
    line-height: 1;
}

.badge {
    padding: 4px 8px;
    background: #e7e8ea;
    font-size: 10.5px;
}

.badge.green {
    background: #dff3e5;
    color: #17692f;
}

.badge.red {
    background: #fde3e3;
    color: #a52424;
}

/* Main list */
.proposal-parent td {
    background: #fff;
}

.proposal-parent .parent-number {
    font-size: 14px;
    font-weight: 700;
}

.proposal-child td {
    background: #f4f8ff;
}

.proposal-child td:first-child {
    border-left: 3px solid #4f82c7;
}

.proposal-child:hover td {
    background: #edf5ff;
}

.child-number-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 8px;
}

.child-branch {
    color: #4f82c7;
    font-size: 17px;
    line-height: 18px;
    font-weight: 700;
}

.child-number {
    font-weight: 650;
}

.child-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: #6e7885;
    font-size: 10px;
}

.badge.child-badge {
    background: #dceafd;
    color: #285f9e;
}

.proposal-list-toolbar {
    margin: 4px 0 12px;
}

.proposal-search-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.proposal-state-tabs {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: #eef1f5;
    border-radius: 8px;
}

.proposal-state-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    background: transparent;
    color: #656d78;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.proposal-state-tab span {
    margin-left: 5px;
    opacity: .65;
}

.proposal-state-tab.active {
    background: #fff;
    color: #202248;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}

.proposal-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.proposal-search input[type="search"] {
    width: 320px;
    min-height: 34px;
}

.proposal-empty {
    padding: 22px 10px;
    text-align: center;
    color: #777f89;
}

/* FX informer */
.fx-informer {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.fx-informer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.fx-informer-title {
    color: #22253d;
    font-size: 15px;
    font-weight: 700;
}

.fx-informer-date {
    margin-top: 2px;
    color: #7a828c;
    font-size: 10.5px;
}

.fx-status-badge {
    padding: 5px 9px;
    font-size: 10px;
}

.fx-status-badge.current {
    background: var(--green-bg);
    color: var(--green);
}

.fx-status-badge.stale {
    background: #fff1d8;
    color: #9b6200;
}

.fx-rate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fx-rate-card {
    padding: 11px 12px;
    background: #f7f8fb;
    border: 1px solid #e5e8ed;
    border-radius: 7px;
}

.fx-rate-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.fx-currency {
    color: #4a5260;
    font-size: 12px;
    font-weight: 700;
}

.fx-rate-value {
    color: #202248;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

.fx-rate-change {
    margin-top: 5px;
    font-size: 10.5px;
    font-weight: 600;
}

.fx-rate-change.up { color: #a65c00; }
.fx-rate-change.down { color: #2768a8; }
.fx-rate-change.same { color: #7b838d; }

.fx-effective-date {
    margin-top: 4px;
    color: #8a919a;
    font-size: 10px;
}

.fx-informer-footer {
    margin-top: 8px;
    color: #9298a0;
    font-size: 10px;
    text-align: right;
}

.fx-no-data {
    padding: 12px;
    background: #fff2e1;
    border-radius: 6px;
    color: #9a6200;
}

/* Proposal header */

.proposal-header {
    margin-bottom: 18px;
}


/* ---------- toolbar ---------- */

.proposal-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}

.proposal-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    min-width: 0;
}


/* =========================================================
   Вертикально выезжающие кнопки
   ========================================================= */

.toolbar-flyout {
    position: relative;

    display: inline-flex;
    align-items: center;
}.toolbar-flyout-panel {
    position: absolute;

    top: calc(100% + 7px);
    right: 0;

    z-index: 100;

    width: 220px;

    display: flex;
    flex-direction: column;

    gap: 6px;

    padding: 0;

    border: 0;
    border-radius: 0;

    background: transparent;

    box-shadow: none;

    visibility: hidden;

    pointer-events: none;

    transition:
        visibility 0s linear .10s;
}

.toolbar-flyout-panel form {
    display: block;

    width: 100%;

    margin: 0;
}.toolbar-flyout-panel .button,
.toolbar-flyout-panel .toolbar-menu-action {
    width: 100%;

    justify-content: flex-start;

    text-align: left;
}.toolbar-flyout.is-open .toolbar-flyout-panel {
    visibility: visible;

    pointer-events: auto;

    transition-delay: 0s;
}


/* ---------- document identity ---------- */

.proposal-identity {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

.proposal-name {
    margin-top: 5px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.proposal-identity-main {
    min-width: 0;
}

.proposal-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.proposal-title-line h1 {
    margin: 0;
}

.proposal-title-badges {
    display: inline-flex;
    align-items: center;

    gap: 5px;
}

.proposal-badge {
    padding: 4px 7px;

    font-size: 9.5px;
}

.proposal-badge.current {
    background: #dff3e5;
    color: #287443;
}

.proposal-badge.archive {
    background: #e6e9ed;
    color: #5e6670;
}

.proposal-badge.child {
    background: #dfebfb;
    color: #2865a7;
}

.proposal-customer {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
}

.proposal-document-meta {
    order: -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    align-self: flex-start;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.proposal-document-meta a {
    color: #356cad;

    font-weight: 600;

    text-decoration: none;
}

.proposal-document-meta a:hover {
    text-decoration: underline;
}

.meta-dot {
    color: #b1b7be;
}


@media (max-width: 900px) {

    .proposal-toolbar-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .proposal-toolbar-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

}

/* Summary */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.summary {
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.summary span,
.summary small {
    display: block;
    color: #6c737c;
}

.summary span {
    font-size: 12px;
}

.summary strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    line-height: 1.1;
}

.summary small {
    margin-top: 3px;
    font-size: 10px;
}

.summary.danger {
    border-color: #d84747;
    background: #fff3f3;
}

.price-guidance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid;
    border-radius: var(--radius);
}

.price-guidance > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-guidance span {
    color: #68717c;
    font-size: 12px;
}

.price-guidance strong {
    font-size: 19px;
}

.price-ok {
    background: #f0faf3;
    border-color: #9dd8ab;
}

.price-warning {
    background: var(--red-bg);
    border-color: #e39b9b;
}

/* Proposal positions */
.positions-card {
    padding-bottom: 12px;
}

.items-table {
    /*
     * Заголовок всегда одна ровная строка.
     *
     * Геометрия финансовой части не зависит
     * от артикула, наименования или производителя.
     *
     * Если экран уже таблицы — работает существующий
     * .table-scroll. Шапку ради viewport не ломаем.
     */
    min-width: 1292px;
    table-layout: fixed;
}

.items-table col.items-col-article {
    width: 74px;
}

.items-table col.items-col-name {
    width: 205px;
}

.items-table col.items-col-manufacturer {
    width: 125px;
}

.items-table col.items-col-qty {
    width: 64px;
}

.items-table col.items-col-money {
    width: 116px;
}

.items-table col.items-col-vat {
    width: 64px;
}

.items-table col.items-col-margin-pct {
    width: 88px;
}

.items-table col.items-col-actions {
    width: 92px;
}

.items-table th,
.items-table td {
    background: #fff;
}

.items-table th {
    /*
     * Ни одного переноса в шапке.
     */
    vertical-align: middle;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.items-table td {
    vertical-align: top;
}

.items-table th:nth-child(1),
.items-table td:nth-child(1),
.items-table th:nth-child(3),
.items-table td:nth-child(3) {
    overflow-wrap: anywhere;
    word-break: normal;
}

.items-table .item-name {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.items-table .actions-col,
.items-table .actions-cell {
    width: 92px;
}

.items-table .actions-cell {
    vertical-align: middle;
}

.items-table .numeric-col,
.items-table .numeric-cell {
    text-align: right;
}

.items-table .qty-col,
.items-table .qty-cell,
.items-table .vat-col,
.items-table .vat-cell {
    text-align: center;
}

.items-table .numeric-cell,
.items-table .qty-cell,
.items-table .vat-cell {
    white-space: nowrap;
}

.margin-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.margin-indicator.negative {
    border-color: #f0b8b8;
    background: #fff1f1;
    color: #b42318;
}

.margin-indicator.below {
    border-color: #e8cf98;
    background: #fff8e6;
    color: #9a6700;
}

.margin-indicator.ok {
    border-color: #a9d9b6;
    background: #eefaf1;
    color: #20733a;
}.qty-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    white-space: nowrap;
}

/* Add item */
.add-item-card {
    padding: 0;
    overflow: hidden;
}

.add-item-toggle {
    appearance: none;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 17px;
    border: 0;
    background: #fff;
    color: #2865ad;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.add-item-toggle:hover {
    background: #fafbfc;
}

.add-item-content {
    padding: 0 17px 17px;
    border-top: 1px solid #eef0f2;
}

.add-item-content h2 {
    margin: 16px 0 14px;
}

.add-item-card.collapsed .add-item-content {
    display: none;
}

/* Child / allocation */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-title-row h2 {
    margin-bottom: 0;
}

.children-card .section-title-row,
.parent-available-card .section-title-row {
    margin-bottom: 10px;
}

.overrun-summary {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid #e8aaaa;
    border-radius: 6px;
    background: #fff2f2;
    font-size: 11.5px;
    line-height: 1.6;
}

.parent-available-card {
    border-left: 3px solid #2864b7;
}

.balance-zero {
    color: #767d86;
}

.balance-negative,
.child-overrun-warning {
    color: #b32626;
    font-weight: 700;
}

.parent-add-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.parent-add-qty {
    width: 92px;
    min-width: 92px;
}

.parent-add-warning {
    display: none;
    max-width: 180px;
    margin-top: 4px;
    color: #b32626;
    font-size: 10px;
    font-weight: 700;
}

.qty-input { min-width: 90px; }
.child-qty { min-width: 105px; }
.child-header { margin-bottom: 18px; }
.child-items-table th { white-space: nowrap; }

/* Cost structure */
.proposal-parameters-card {
    padding: 9px 12px;
    background: #f8f9fb;
    color: #626b76;
    font-size: 10.5px;
    line-height: 1.55;
}

.proposal-parameters-card b {
    color: #343a42;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.calc-grid > div {
    padding: 10px;
    background: #f7f8fa;
    border: 1px solid #edf0f3;
    border-radius: 6px;
}

.calc-grid span,
.calc-grid b,
.calc-grid small {
    display: block;
}

.calc-grid span {
    margin-bottom: 4px;
    color: #747d88;
    font-size: 10.5px;
}

.calc-grid b {
    color: #252a31;
    font-size: 12.5px;
}

.calc-grid small {
    margin-top: 3px;
    color: #717983;
    font-size: 9.5px;
}

/* PDF history */
.pdf-history-header {
    margin-bottom: 8px;
}

.pdf-history-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-history-toggle {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2865ad;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
}

.pdf-history-toggle:hover {
    text-decoration: underline;
}

.pdf-extra-row {
    display: none;
}

.pdf-history-card.expanded .pdf-extra-row {
    display: table-row;
}

.pdf-number {
    display: inline-block;
    margin-right: 7px;
    font-weight: 600;
}

.pdf-variant {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 650;
    line-height: 1;
}

.pdf-variant.plain {
    background: #edf0f3;
    color: #626b75;
}

.pdf-variant.signed {
    background: #e6e4f3;
    color: #42416d;
}

/* Proposal create/edit form */
.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.proposal-form-section {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.proposal-form-section-head {
    padding: 12px 15px 10px;
    background: #f7f8fa;
    border-bottom: 1px solid #e8ebef;
}

.proposal-form-section-head h2 {
    margin: 0;
    font-size: 15px;
}

.proposal-form-section-subtitle {
    margin-top: 2px;
    color: #7c8590;
    font-size: 9.5px;
}

.proposal-form-section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px 12px;
    padding: 14px 15px 15px;
}

.proposal-form-section-grid .span-2 {
    grid-column: span 2;
}

.proposal-form-section-grid .span-3 {
    grid-column: 1 / -1;
}

.proposal-form-section label {
    margin: 0;
    font-size: 11px;
}

.proposal-form-section input,
.proposal-form-section select,
.proposal-form-section textarea {
    min-height: 35px;
    padding: 6px 9px;
    font-size: 12px;
}

.proposal-form-section label > small,
#official_fx_rate_info,
.fx-rate-difference {
    display: block;
    margin-top: 4px;
    font-size: 9.5px;
    line-height: 1.35;
}

#official_fx_rate_info {
    color: #7e8791;
}

#official_fx_rate[readonly] {
    background: #f2f4f6;
    color: #606974;
    border-color: #d7dce2;
}

.fx-rate-difference {
    min-height: 13px;
}

.fx-rate-difference.higher { color: #a05c00; }
.fx-rate-difference.lower { color: #2867a5; }
.fx-rate-difference.equal { color: #397747; }

.proposal-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 1px;
}

/* Responsive */
@media (max-width: 1050px) {
    main {
        padding: 22px 18px 34px;
    }

    .title-row {
        flex-direction: column;
    }

    .proposal-toolbar {
        justify-content: flex-start;
    }

    .summary-grid,
    .calc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .item-grid-row-main,
    .item-grid-row-pricing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {


    .proposal-search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .proposal-state-tabs {
        align-self: flex-start;
    }

    .proposal-search {
        width: 100%;
    }

    .proposal-search input[type="search"] {
        flex: 1;
        width: auto;
    }

    .fx-rate-grid,
    .proposal-form-section-grid {
        grid-template-columns: 1fr;
    }

    .proposal-form-section-grid .span-2,
    .proposal-form-section-grid .span-3 {
        grid-column: auto;
    }

    .price-guidance {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    header {
        padding: 0 16px;
    }

    main {
        padding: 18px 12px 28px;
    }

    h1 {
        font-size: 23px;
    }

    .summary-grid,
    .calc-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 14px;
    }

    .item-grid-row-main,
    .item-grid-row-pricing {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   USER ADMINISTRATION
   ========================================================= */

.admin-users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}

.admin-users-title {
    margin-bottom: 18px;
}

.admin-users-title h1 {
    margin: 0 0 3px;
}

.admin-users-counter {
    height: 34px;

    display: inline-flex;
    align-items: center;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface);

    color: var(--muted);

    font-size: 12px;

    white-space: nowrap;
}

.admin-users-counter strong {
    margin: 0 3px;

    color: var(--text);
}

.admin-users-card {
    padding: 0;
    overflow: hidden;
}

.admin-users-info {
    padding: 13px 17px;

    border-bottom: 1px solid var(--border);

    background: var(--surface-soft);

    color: var(--muted);

    font-size: 11.5px;
    line-height: 1.5;
}

.admin-users-table th:first-child,
.admin-users-table td:first-child {
    padding-left: 17px;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
    padding-right: 17px;
}

.admin-user-name {
    display: flex;
    align-items: center;

    gap: 7px;

    font-weight: 600;
}

.admin-badge {
    background: #e7effb;
    color: #285f9f;
}

.access-disabled {
    background: #eceff2;
    color: #66707b;
}

.admin-user-disabled td {
    background: #fafbfc;
    color: #77808b;
}

.admin-access-form {
    display: inline-flex;
    margin: 0;
}

.admin-self-label {
    font-size: 10.5px;
    white-space: nowrap;
}



/* =========================================================
   Calculation guide
   ========================================================= */

.calculation-guide {
    display: grid;
    gap: 18px;
}

.calculation-guide .card {
    margin-bottom: 0;
}

.calculation-guide-intro {
    background: #f9fbff;
    border-color: #ccd9eb;
}

.calculation-guide-intro p:last-child {
    margin-bottom: 0;
}

.calculation-guide-index {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calculation-guide-index a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: #4c5663;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.calculation-guide-index a:hover {
    border-color: #aeb8c4;
    color: var(--blue);
}

.calculation-guide-section {
    scroll-margin-top: 76px;
}

.calculation-guide-section > h2 {
    margin-bottom: 16px;
    color: var(--blue-dark);
}

.calculation-definition-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.calculation-definition {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.calculation-definition + .calculation-definition {
    margin-top: 12px;
}

.calculation-definition-grid
.calculation-definition
+ .calculation-definition {
    margin-top: 0;
}

.calculation-definition h3 {
    margin-bottom: 9px;
    font-size: 14px;
}

.calculation-definition p:last-child {
    margin-bottom: 0;
}

.calculation-formula {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 3px solid #7997bf;
    border-radius: 5px;
    background: #f3f6fa;
    color: #283442;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.5;
}

.calculation-formula-main {
    border-left-color: var(--blue);
    background: #edf4fd;
    font-size: 13px;
}

.calculation-allocation-table-wrap {
    margin: 14px 0;
    overflow-x: auto;
}

.calculation-allocation-table {
    min-width: 620px;
}

.calculation-allocation-table td:first-child {
    width: 220px;
    font-weight: 650;
}

.calculation-guide-note {
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid #e1c98e;
    border-radius: 7px;
    background: #fff9e9;
    color: #65511f;
}

.calculation-guide-note strong {
    display: block;
    margin-bottom: 5px;
}

.calculation-guide-note p {
    margin: 0;
}

.calculation-status-list {
    display: grid;
    gap: 10px;
}

.calculation-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 34px;
}

.calculation-status-row
.margin-indicator {
    flex: 0 0 auto;
}

.calculation-guide-footer {
    padding: 2px 4px 8px;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

.calculation-guide-nav-link {
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 760px) {

    .calculation-definition-grid {
        grid-template-columns: 1fr;
    }

    .calculation-status-row {
        align-items: flex-start;
    }

}


/* DiasMedic child proposal hierarchy */

.proposal-list-table {
    table-layout: auto;
}

.proposal-list-table th:first-child,
.proposal-list-table td:first-child {
    width: 210px;
    min-width: 210px;
}

.proposal-list-table .parent-number,
.proposal-list-table .child-number {
    white-space: nowrap;
}

.proposal-list-table .proposal-status-cell {
    white-space: nowrap;
}

.proposal-list-table .proposal-status-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.proposal-list-table .proposal-status-stack .badge + .badge {
    margin-top: 4px;
}

.proposal-list-table .proposal-status-stack .child-badge {
    align-self: flex-end;
}

.children-proposals-table {
    table-layout: auto;
    width: 100%;
}

/* № КП — только необходимая ширина */
.children-proposals-table th:nth-child(1),
.children-proposals-table td:nth-child(1) {
    width: 1%;
    white-space: nowrap;
}

/* Наименование — ограниченная колонка, длинный текст переносится */
.children-proposals-table th:nth-child(2),
.children-proposals-table td:nth-child(2) {
    width: 18%;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Дата — только необходимая ширина */
.children-proposals-table th:nth-child(3),
.children-proposals-table td:nth-child(3) {
    width: 1%;
    white-space: nowrap;
}

/* Заказчик получает всё оставшееся пространство */
.children-proposals-table th:nth-child(4),
.children-proposals-table td:nth-child(4) {
    width: auto;
}

/* Состояние — только ширина плашки */
.children-proposals-table th:nth-child(5),
.children-proposals-table td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
}


/* DiasMedic version footer */

.app-version-footer {
    margin: 28px 0 12px;
    text-align: center;
    font-size: 12px;
    line-height: 1;
    color: #9aa0a6;
    user-select: none;
}


/* Import header */

.import-header-card {
    display: grid;
    gap: 17px;
}

.import-title-row {
    align-items: flex-start;
}

.import-title-row h1 {
    margin: 0 0 6px;
}

.import-proposal-context {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    color: #626b76;
    font-size: 11.5px;
}

.import-proposal-context strong,
.import-proposal-context b {
    color: #343a42;
}


/* File upload */

.import-upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.import-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.import-file-button {
    cursor: pointer;
}

.import-file-name {
    color: #626b76;
    font-size: 11.5px;
    overflow-wrap: anywhere;
}

.import-format-help {
    margin-top: -8px;
}


/* Import errors */

.import-error-summary {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid #e8aaaa;
    border-left: 3px solid #df5252;
    border-radius: 6px;
    background: #fff2f2;
    color: #b32626;
    font-size: 11.5px;
    line-height: 1.5;
}

.import-error-summary strong {
    display: block;
    margin-bottom: 2px;
}


/* Recognition summary */

.import-summary-card {
    padding-top: 12px;
    padding-bottom: 12px;
}

.import-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 18px;
    color: #626b76;
    font-size: 11.5px;
}

.import-summary-line strong {
    color: #343a42;
}

.import-summary-errors,
.import-summary-errors strong {
    color: #b32626;
}

.import-summary-source {
    margin-left: auto;
}

.import-recognition {
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #eef0f2;
}

.import-recognition summary {
    color: #2865ad;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.import-recognition-section {
    margin-top: 12px;
    color: #626b76;
    font-size: 11px;
    line-height: 1.5;
}

.import-recognition-section > strong {
    color: #343a42;
}

.import-mapping-list {
    display: grid;
    gap: 3px;
    width: fit-content;
    max-width: 100%;
    margin-top: 6px;
}

.import-mapping-row {
    display: grid;
    grid-template-columns:
        minmax(0, max-content)
        auto
        max-content;
    gap: 8px;
    align-items: baseline;
    max-width: 100%;
}

.import-mapping-row > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.import-mapping-arrow {
    color: #9aa0a6;
}


/* Import positions */

.import-items-title {
    align-items: flex-start;
    margin-bottom: 10px;
}

.import-items-title h2 {
    margin-bottom: 4px;
}

.import-selection-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.import-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.import-table {
    width: 100%;
    min-width: 1030px;
    table-layout: fixed;
    border-collapse: collapse;
}

.import-table th,
.import-table td {
    padding: 7px 5px;
    border-bottom: 1px solid #eef0f2;
    vertical-align: top;
}

.import-table th {
    color: #626b76;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.import-col-select {
    width: 3.5%;
}

.import-col-article {
    width: 9%;
}

.import-col-name {
    width: 28%;
}

.import-col-manufacturer {
    width: 13%;
}

.import-col-quantity {
    width: 7.5%;
}

.import-col-unit {
    width: 6%;
}

.import-col-purchase {
    width: 11%;
}

.import-col-sale {
    width: 11%;
}

.import-col-vat {
    width: 11%;
}

.import-select-cell {
    text-align: center;
}

.import-select-cell input[type="checkbox"] {
    width: auto;
    margin-top: 8px;
}

.import-field {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.import-source-meta {
    display: block;
    margin-top: 3px;
    color: #8a919b;
    font-size: 9.5px;
    line-height: 1.25;
}.import-row.has-errors {
    background: transparent;
}

.import-row.has-errors > td:first-child {
    border-left: 3px solid #df5252;
}

.import-field.is-invalid {
    border-color: #df5252;
    background: #fff2f2;
    box-shadow: 0 0 0 1px #df5252;
}

.import-field-error {
    display: block;
    margin-top: 4px;
    color: #b32626;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}.import-general-error-row td {
    padding-top: 0;
}

.import-row.is-unselected {
    opacity: 0.46;
}

.import-row.is-unselected .import-field {
    background: #f7f8fa;
}


/* Commit */

.import-commit-actions {
    justify-content: flex-end;
    margin-top: 16px;
}


@media (max-width: 900px) {

    .import-title-row,
    .import-items-title {
        align-items: stretch;
    }

    .import-summary-source {
        width: 100%;
        margin-left: 0;
    }

}

/* =========================================================
   Interaction hierarchy
   ========================================================= */

.button.secondary:hover {
    background: #f5f6f7;
    border-color: #aeb8c3;
    color: #2865ad;
    filter: none;
}


/* Navigation */

.nav-back,
.action-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: #2865ad;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.nav-back:hover,
.action-link:hover {
    text-decoration: underline;
}


/* Quiet actions */

.toolbar-action,
.toolbar-menu-action,
.utility-action {
    appearance: none;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}.toolbar-action {
    appearance: none;

    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 11px;

    border: 1px solid #c8cfd7;
    border-radius: 7px;

    background: #fff;
    color: #4f5965;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;
}.toolbar-action:hover {
    border-color: #aeb8c3;
    background: #f5f6f7;
    color: #343a42;
}.toolbar-menu-action {
    appearance: none;

    min-height: 34px;

    display: flex;
    align-items: center;

    width: 100%;

    padding: 0 11px;

    border: 1px solid #c8cfd7;
    border-radius: 7px;

    background: #fff;

    color: #4f5965;

    box-shadow:
        0 3px 10px rgba(32, 34, 72, .08);

    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;

    text-align: left;
    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;
}.toolbar-menu-action:hover {
    border-color: #aeb8c3;

    background: #f5f6f7;

    color: #343a42;

    box-shadow:
        0 4px 12px rgba(32, 34, 72, .10);
}

.utility-action {
    display: inline-flex;
    align-items: center;
    padding: 3px 4px;
    color: #68717c;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.utility-action:hover {
    color: #2865ad;
}


/* Keyboard focus */

.button:focus-visible,
.nav-back:focus-visible,
.action-link:focus-visible,
.toolbar-action:focus-visible,
.toolbar-menu-action:focus-visible,
.utility-action:focus-visible,
.add-item-toggle:focus-visible,
.pdf-history-toggle:focus-visible,
.row-action-icon:focus-visible,
.add-method-tab:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}


/* Quiet row actions */

.row-action-icon {
    appearance: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #747d87;
    text-decoration: none;
    cursor: pointer;
}

.row-action-edit:hover {
    background: #f3f5f7;
    color: #2865ad;
}

.row-action-delete {
    color: #b32626;
}

.row-action-delete:hover {
    background: #fff2f2;
    color: #a62f2f;
}


/* Add-position modes */

.add-item-heading {
    padding-top: 15px;
}

.add-item-heading h2 {
    margin: 0 0 8px;
}

.add-method-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eef0f2;
}

.add-method-tab {
    position: relative;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    color: #747d87;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.add-method-tab:hover {
    color: #2865ad;
    text-decoration: none;
}

.add-method-tab.active {
    color: #343a42;
}

.add-method-tab.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: #2865ad;
}


/* Import: completed upload step */

.import-current-file {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-top: 2px;
}

.import-current-file > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 10px;
}

.import-current-file strong {
    color: #343a42;
    font-size: 12px;
}

.import-current-file span {
    color: #7a828c;
    font-size: 11px;
}


/* DiasMedic import mapper */

.import-mapper-card {
    padding: 17px;
}

.import-mapper-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 15px;
}

.import-mapper-header h2 {
    margin: 0 0 5px;
}

.import-mapper-source-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 14px;
    color: #7a828c;
    font-size: 11px;
    white-space: nowrap;
}

.import-mapper-source-meta strong {
    color: #4f5965;
    font-weight: 600;
}

.import-mapper-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e8ec;
    border-radius: 7px;
}

.import-mapper-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
}

.import-mapper-table th,
.import-mapper-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef0f2;
    vertical-align: top;
    text-align: left;
}

.import-mapper-table th {
    background: #f7f8f9;
    color: #68717c;
    font-size: 10.5px;
    font-weight: 700;
}

.import-mapper-table th:nth-child(1) {
    width: 29%;
}

.import-mapper-table th:nth-child(2) {
    width: 41%;
}

.import-mapper-table th:nth-child(3) {
    width: 30%;
}

.import-mapper-table tbody tr:last-child td {
    border-bottom: 0;
}

.import-mapper-source {
    color: #343a42;
    font-size: 11.5px;
}

.import-mapper-source strong {
    display: block;
    font-weight: 600;
}

.import-mapper-learned {
    display: inline-block;
    margin-top: 4px;
    color: #7a828c;
    font-size: 10px;
    font-weight: 500;
}

.import-mapper-samples {
    color: #68717c;
    font-size: 10.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.import-mapper-select {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid #c8cfd7;
    border-radius: 6px;
    background: #fff;
    color: #343a42;
    font: inherit;
    font-size: 11.5px;
}

.import-mapper-select:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.import-mapper-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 15px;
}

.import-remember-mapping {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #5f6873;
    font-size: 11px;
    cursor: pointer;
}

.import-remember-mapping input {
    margin: 0;
}


@media (max-width: 760px) {

    .import-mapper-header,
    .import-mapper-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .import-mapper-source-meta {
        justify-content: flex-start;
    }

    .import-mapper-footer .button {
        align-self: flex-start;
    }
}


/* DiasMedic UI correction: object toolbar + quantity warning */

.toolbar-flyout-toggle::after {
    content: "▾";
    display: inline-block;
    margin-left: 7px;
    color: #747d87;
    font-size: 10px;
    line-height: 1;
    transform: translateY(-1px);
    transition: transform .14s ease;
}

.toolbar-flyout.is-open > .toolbar-flyout-toggle {
    border-color: #aeb8c3;
    background: #f3f5f7;
    color: #343a42;
}

.toolbar-flyout.is-open > .toolbar-flyout-toggle::after {
    transform:
        translateY(0)
        rotate(180deg);
}

.quantity-allocation {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    margin: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #68717c;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none;

    cursor: help;
}

.quantity-allocation:hover {
    background: #f3f5f7;
    color: #2865ad;
}

.quantity-allocation:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.items-table .actions-col,
.items-table .actions-cell {
    width: 68px;
    min-width: 68px;

    padding-left: 4px;
    padding-right: 4px;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 2px;

    white-space: nowrap;
}

.row-action-icon {
    width: 28px;
    height: 28px;
}

.items-table .qty-col,
.items-table .qty-cell {
    width: 88px;
    min-width: 88px;
}

.quantity-allocation.is-overrun {
    color: #b42318;
}

.quantity-allocation.is-overrun:hover {
    background: #fff1f1;
    color: #961c13;
}

.quantity-allocation.is-overrun:focus-visible {
    outline-color: #b42318;
}


/* DiasMedic floating flyout button cascade */

/*
 * Animate the direct children rather than the panel itself.
 * A child may be either a form or a direct link.
 */

.toolbar-flyout-panel > * {
    opacity: 0;

    transform: translateY(-6px);

    transition:
        opacity .10s ease,
        transform .10s ease;

    transition-delay: 0s;
}


/*
 * Opening is deliberately slower and sequential.
 */

.toolbar-flyout.is-open
.toolbar-flyout-panel > * {
    opacity: 1;

    transform: translateY(0);

    transition-duration:
        .14s,
        .16s;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel > :nth-child(1) {
    transition-delay: 0ms;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel > :nth-child(2) {
    transition-delay: 55ms;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel > :nth-child(3) {
    transition-delay: 110ms;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel > :nth-child(4) {
    transition-delay: 165ms;
}


/*
 * The form itself must not create another visual layer.
 */

.toolbar-flyout-panel > form {
    width: 100%;

    margin: 0;

    background: transparent;
}


/*
 * Respect reduced-motion preference.
 */

@media (prefers-reduced-motion: reduce) {
    .toolbar-flyout-panel,
    .toolbar-flyout-panel > * {
        transition: none;
    }
}




/* DiasMedic beta1 final flyout polish */


/*
 * Panel width itself is synchronized by proposal-ui.js:
 *
 * Documents:
 *   left edge = left edge of "Изменить"
 *   right edge = right edge of "Документы"
 *
 * More:
 *   left edge = left edge of "Документы"
 *   right edge = right edge of "Ещё"
 *
 * Button height and internal padding are intentionally unchanged.
 */


/*
 * Keep the invisible geometric panel alive until the complete
 * reverse closing cascade has finished.
 */

.toolbar-flyout-panel {
    transition:
        visibility 0s linear 230ms;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel {
    transition-delay: 0s;
}


/*
 * CLOSED STATE
 *
 * Reverse cascade:
 *
 * Documents: 3 -> 2 -> 1
 * More:      2 -> 1
 *
 * Movement itself remains the same upward -6px movement already
 * used by the existing flyout animation.
 */

.toolbar-flyout-panel.documents-menu
> :nth-child(1) {
    transition-delay: 110ms;
}

.toolbar-flyout-panel.documents-menu
> :nth-child(2) {
    transition-delay: 55ms;
}

.toolbar-flyout-panel.documents-menu
> :nth-child(3) {
    transition-delay: 0ms;
}


.toolbar-flyout-panel.more-menu
> :nth-child(1) {
    transition-delay: 55ms;
}

.toolbar-flyout-panel.more-menu
> :nth-child(2) {
    transition-delay: 0ms;
}


/*
 * OPEN STATE
 *
 * Forward cascade:
 *
 * Documents: 1 -> 2 -> 3
 * More:      1 -> 2
 */

.toolbar-flyout.is-open
.toolbar-flyout-panel.documents-menu
> :nth-child(1) {
    transition-delay: 0ms;
}

.toolbar-flyout.is-open
.toolbar-flyout-panel.documents-menu
> :nth-child(2) {
    transition-delay: 55ms;
}

.toolbar-flyout.is-open
.toolbar-flyout-panel.documents-menu
> :nth-child(3) {
    transition-delay: 110ms;
}


.toolbar-flyout.is-open
.toolbar-flyout-panel.more-menu
> :nth-child(1) {
    transition-delay: 0ms;
}

.toolbar-flyout.is-open
.toolbar-flyout-panel.more-menu
> :nth-child(2) {
    transition-delay: 55ms;
}


/*
 * Make edit/delete glyphs easier to see WITHOUT changing:
 *
 * - .row-action-icon outer box;
 * - row height;
 * - actions column width;
 * - table width.
 */

.row-action-icon svg {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;
}


@media (prefers-reduced-motion: reduce) {
    .toolbar-flyout-panel.documents-menu > *,
    .toolbar-flyout-panel.more-menu > * {
        transition-delay: 0s;
    }
}



/* Proposal list — amount column */
.proposal-list-table .proposal-amount-heading,
.proposal-list-table .proposal-amount-cell {
    text-align: left;
    white-space: nowrap;
}

.proposal-list-table .proposal-amount-cell {
    font-variant-numeric: tabular-nums;
}


/* Proposal list — currency column */
.proposal-list-table .proposal-currency-heading,
.proposal-list-table .proposal-currency-cell {
    text-align: center;
    white-space: nowrap;
}


/* Proposal search — Spotlight field */
.proposal-search .proposal-search-field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.proposal-search .proposal-search-field input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding-left: 42px;
}

.proposal-search .proposal-search-help {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 12px;

    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;

    border: 0;
    text-decoration: none;

    color: #737d89;
    background: transparent;

    transform: translateY(-50%);

    display: grid;
    place-items: center;

    cursor: help;
}

.proposal-search .proposal-search-help::after {
    display: none;
}

.proposal-search .proposal-search-help svg {
    display: block;
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.proposal-search .proposal-search-help:hover,
.proposal-search .proposal-search-help:focus-visible {
    color: #343b45;
    outline: none;
}


/* Main positions table — unified header alignment */
.positions-table-head th {
    text-align: center !important;
}
