:root {
    color-scheme: light;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #162033;
    background: #f3f6fb;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #f3f6fb;
}

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

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    color: #dce7f8;
    background:
        linear-gradient(180deg, #14213d 0%, #0d172b 100%);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 24px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    font-weight: 800;
    box-shadow: 0 10px 30px rgb(37 99 235 / 30%);
}

.brand strong,
.brand small,
.login-brand strong,
.login-brand small {
    display: block;
}

.brand strong {
    color: #fff;
}

.brand small {
    margin-top: 3px;
    color: #8fa5c9;
}

.navigation {
    display: grid;
    gap: 5px;
}

.navigation a {
    padding: 11px 13px;
    border-radius: 10px;
    color: #b9c8df;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.navigation a:hover {
    color: #fff;
    background: rgb(255 255 255 / 7%);
}

.navigation a.active {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 10px 25px rgb(37 99 235 / 25%);
}

.workspace {
    min-width: 0;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(12px);
}

.topbar strong,
.topbar small,
.metric-card span,
.metric-card strong,
.metric-card small {
    display: block;
}

.topbar strong {
    font-size: 1.05rem;
}

.topbar small {
    margin-top: 3px;
    color: #748198;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-menu form {
    margin: 0;
}

.link-button {
    padding: 8px 11px;
    border: 1px solid #d6dfec;
    border-radius: 9px;
    color: #334155;
    background: #fff;
    cursor: pointer;
}

.content {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.hero-card {
    padding: clamp(28px, 5vw, 54px);
    border: 1px solid #dfe7f2;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(
            circle at top right,
            rgb(96 165 250 / 32%),
            transparent 35%
        ),
        linear-gradient(135deg, #14213d, #1e3a66);
    box-shadow: 0 22px 55px rgb(15 23 42 / 12%);
}

.hero-card h1,
.page-header h1 {
    margin: 7px 0 12px;
    font-size: clamp(2rem, 5vw, 4rem);
}

.hero-card p:last-child {
    max-width: 720px;
    margin-bottom: 0;
    color: #c7d7ef;
    font-size: 1.08rem;
    line-height: 1.7;
}

.eyebrow {
    margin: 0;
    color: #60a5fa;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.metric-card,
.empty-state,
.login-card {
    border: 1px solid #dfe7f2;
    background: #fff;
    box-shadow: 0 14px 35px rgb(15 23 42 / 6%);
}

.metric-card {
    padding: 22px;
    border-radius: 17px;
}

.metric-card span {
    color: #64748b;
    font-size: 0.9rem;
}

.metric-card strong {
    margin: 10px 0 5px;
    font-size: 2rem;
}

.metric-card small {
    color: #94a3b8;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.empty-state {
    padding: 64px 28px;
    border-radius: 20px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    color: #2563eb;
    background: #eaf2ff;
    font-weight: 800;
}

.empty-state h2 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
    color: #718096;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgb(59 130 246 / 20%),
            transparent 35%
        ),
        #f3f6fb;
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    border-radius: 24px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-brand small,
.muted {
    color: #718096;
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.login-form label {
    margin-top: 8px;
    font-size: 0.88rem;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #ced8e6;
    border-radius: 10px;
    outline: none;
}

.login-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 14%);
}

.primary-button {
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: #2563eb;
    font-weight: 800;
    cursor: pointer;
}

.alert {
    margin: 18px 0;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    background: #fff1f2;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .navigation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        padding: 14px 18px;
    }

    .content {
        padding: 18px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard */
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dashboard-head h1 { margin: 6px 0 8px; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.04em; }
.dashboard-subtitle { margin: 0; color: #64748b; font-size: 1rem; }
.action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border-radius: 11px; color: #fff; background: #2563eb; box-shadow: 0 10px 24px rgb(37 99 235 / 22%); font-weight: 750; text-decoration: none; white-space: nowrap; }
.dashboard-metrics { margin-top: 0; }
.dashboard-metrics .metric-card { position: relative; overflow: hidden; }
.dashboard-metrics .metric-card::after { content: ""; position: absolute; inset: auto -24px -35px auto; width: 90px; height: 90px; border-radius: 50%; background: rgb(37 99 235 / 7%); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr); gap: 18px; margin-top: 18px; }
.dashboard-card { border: 1px solid #dfe7f2; border-radius: 18px; background: #fff; box-shadow: 0 14px 35px rgb(15 23 42 / 6%); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 22px 18px; border-bottom: 1px solid #edf1f6; }
.card-heading h2 { margin: 5px 0 0; font-size: 1.12rem; }
.card-heading a { color: #2563eb; font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.stage-list { display: grid; gap: 18px; padding: 22px; }
.stage-row { display: grid; gap: 8px; }
.stage-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #475569; font-size: 0.9rem; }
.stage-meta strong { color: #162033; }
.stage-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf2f7; }
.stage-track span { display: block; height: 100%; min-width: 8px; border-radius: inherit; }
.quick-card { min-width: 0; }
.quick-links { display: grid; gap: 10px; padding: 18px; }
.quick-links a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; border: 1px solid #e4eaf2; border-radius: 13px; color: #475569; background: #f8fafc; text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.quick-links a:hover { transform: translateY(-1px); border-color: #bfdbfe; background: #eff6ff; }
.quick-links strong { color: #162033; font-size: 1.15rem; }
.recent-card { margin-top: 18px; overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.dashboard-table { width: 100%; border-collapse: collapse; }
.dashboard-table th, .dashboard-table td { padding: 15px 22px; border-bottom: 1px solid #edf1f6; text-align: left; vertical-align: middle; }
.dashboard-table th { color: #64748b; background: #f8fafc; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.dashboard-table td { color: #475569; font-size: 0.9rem; }
.dashboard-table td:first-child { min-width: 300px; }
.dashboard-table td:first-child strong, .dashboard-table td:first-child span { display: block; }
.dashboard-table td:first-child strong { margin-bottom: 4px; color: #162033; }
.dashboard-table td:first-child span { color: #64748b; }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.dashboard-empty { padding: 24px; color: #94a3b8; text-align: center; }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .dashboard-head { align-items: stretch; flex-direction: column; } .action-button { width: 100%; } .dashboard-table th, .dashboard-table td { padding: 13px 15px; } }

/* Tender funnel */
.dashboard-page {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.funnel-pagehead {
    align-items: flex-end;
}

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

.dashboard-kpi {
    padding: 18px;
}

.dashboard-kpi span,
.dashboard-kpi small {
    display: block;
    color: #708089;
}

.dashboard-kpi strong {
    display: block;
    margin: 8px 0 5px;
    color: #122b32;
    font-size: clamp(22px, 2vw, 32px);
    line-height: 1;
}

.funnel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
}

.funnel-search {
    flex: 1 1 520px;
    max-width: 720px;
}

.funnel-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dce5e2;
    border-radius: 9px;
    padding: 9px 13px;
    color: #162b31;
    background: #fff;
    outline: none;
}

.funnel-search input:focus {
    border-color: #51a98c;
    box-shadow: 0 0 0 3px #e1f3ed;
}

.funnel-view-switch {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.funnel-board {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: 2px 2px 16px;
    overflow-x: auto;
    scrollbar-color: #abc7bd transparent;
}

.funnel-column {
    flex: 0 0 286px;
    min-width: 286px;
    border: 1px solid #dce6e2;
    border-top: 4px solid var(--stage-color);
    border-radius: 12px;
    background: #edf3f1;
    box-shadow: 0 8px 24px rgba(18, 43, 50, 0.06);
    overflow: hidden;
}

.funnel-column-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    min-height: 86px;
    padding: 14px;
    border-bottom: 1px solid #dce6e2;
    background: #fff;
}

.funnel-stage-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.funnel-stage-title i {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--stage-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 16%, white);
}

.funnel-stage-title h2 {
    margin: 0;
    overflow: hidden;
    color: #17343b;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.funnel-count {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    padding: 0 8px;
    color: #37534b;
    background: #e7f0ed;
    font-size: 12px;
    font-weight: 800;
}

.funnel-stage-total {
    grid-column: 1 / -1;
    color: #6b7d78;
    font-size: 12px;
    font-weight: 700;
}

.funnel-column-body {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 370px;
    max-height: calc(100vh - 390px);
    padding: 10px;
    overflow-y: auto;
}

.tender-card {
    padding: 13px;
    border: 1px solid #d9e3df;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(18, 43, 50, 0.05);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tender-card:hover {
    transform: translateY(-2px);
    border-color: #7fbea9;
    box-shadow: 0 8px 18px rgba(18, 43, 50, 0.1);
}

.tender-card[hidden] {
    display: none;
}

.tender-card-top,
.tender-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tender-card-top {
    color: #71827d;
    font-size: 10px;
}

.tender-number {
    overflow: hidden;
    color: #247b60;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tender-card h3 {
    margin: 10px 0 7px;
    color: #172f35;
    font-size: 13px;
    line-height: 1.38;
}

.tender-customer {
    margin: 0 0 12px;
    color: #6b7b77;
    font-size: 11px;
    line-height: 1.35;
}

.tender-card-bottom {
    padding-top: 10px;
    border-top: 1px solid #edf2f0;
}

.tender-card-bottom strong {
    color: #122b32;
    font-size: 13px;
}

.tender-owner {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border-radius: 50%;
    color: #fff;
    background: #178f67;
    font-size: 11px;
    font-weight: 800;
}

.tender-owner-empty {
    color: #7f918b;
    background: #e7eeeb;
}

.funnel-empty {
    display: grid;
    place-items: center;
    min-height: 96px;
    border: 1px dashed #bfcfca;
    border-radius: 9px;
    padding: 16px;
    color: #84948f;
    background: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-size: 11px;
    line-height: 1.45;
}

.funnel-column-filtered-empty {
    opacity: 0.55;
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .funnel-column-body {
        max-height: none;
    }
}

@media (max-width: 680px) {
    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .funnel-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .funnel-view-switch {
        width: 100%;
    }

    .funnel-view-switch > * {
        flex: 1;
        text-align: center;
    }

    .funnel-column {
        flex-basis: 270px;
        min-width: 270px;
    }
}

/* Tender funnel compatibility */
.content {
    min-width: 0;
    overflow-x: hidden;
}

.dashboard-page {
    width: 100%;
    max-width: none;
}

.funnel-pagehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border: 1px solid #dce6e2;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #edf8f4 100%);
    box-shadow: 0 8px 24px rgba(18, 43, 50, 0.06);
}

.funnel-pagehead h1 {
    margin: 0 0 7px;
}

.funnel-pagehead p {
    margin: 0;
    color: #687c76;
}

.card {
    border: 1px solid #dce6e2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(18, 43, 50, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid #cbd9d4;
    border-radius: 9px;
    padding: 9px 14px;
    color: #24443b;
    background: #fff;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    border-color: #6fb89f;
    background: #f1faf7;
}

.btn.primary {
    border-color: #178f67;
    color: #fff;
    background: #178f67;
}

.btn.primary:hover {
    border-color: #117651;
    background: #117651;
}

.btn.small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
}

.dashboard-kpi {
    min-height: 122px;
}

.funnel-toolbar {
    box-sizing: border-box;
    width: 100%;
}

.funnel-board {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 680px) {
    .funnel-pagehead {
        align-items: stretch;
        flex-direction: column;
    }

    .funnel-pagehead .btn {
        width: 100%;
    }
}

/* Tender create form */
.form-page {
    display: grid;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    gap: 18px;
}

.form-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.form-page-head h1 {
    margin: 4px 0 8px;
    color: #142b32;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

.form-page-head p:last-child {
    margin: 0;
    color: #71817d;
}

.form-page-head .eyebrow {
    margin: 0;
    color: #178f67;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.tender-form {
    padding: 24px;
}

.tender-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-field {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field label {
    color: #263f45;
    font-size: 13px;
    font-weight: 750;
}

.form-field label span {
    color: #c13c3c;
}

.form-field input,
.form-field select,
.form-field textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    border: 1px solid #cfdbd7;
    border-radius: 9px;
    padding: 10px 12px;
    color: #172f35;
    background: #fff;
    font: inherit;
    outline: none;
}

.form-field textarea {
    min-height: 92px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #3ca27f;
    box-shadow: 0 0 0 3px rgba(23, 143, 103, 0.12);
}

.form-field small {
    color: #788984;
    font-size: 11px;
}

.field-error,
.form-errors {
    color: #a82f2f;
    font-size: 12px;
}

.form-errors {
    margin-bottom: 18px;
    border: 1px solid #eccaca;
    border-radius: 9px;
    padding: 12px 14px;
    background: #fff4f4;
}

.form-errors ul,
.field-error ul {
    margin: 0;
    padding-left: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e4ebe8;
}

@media (max-width: 760px) {
    .form-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .tender-form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-wide {
        grid-column: auto;
    }

    .tender-form {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn,
    .form-page-head .btn {
        width: 100%;
    }
}

/* Tender detail */
.tender-card {
    cursor: pointer;
}

.tender-card:focus-visible {
    border-color: #178f67;
    box-shadow: 0 0 0 3px rgba(23, 143, 103, 0.18);
    outline: none;
}

.tender-detail-page {
    display: grid;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    gap: 18px;
}

.tender-detail-card {
    padding: 24px;
}

.tender-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border: 1px solid #e0e8e5;
    border-radius: 11px;
    overflow: hidden;
}

.detail-field {
    min-width: 0;
    padding: 17px 18px;
    border-right: 1px solid #e0e8e5;
    border-bottom: 1px solid #e0e8e5;
    background: #fff;
}

.detail-field:nth-child(even) {
    border-right: 0;
}

.detail-field-wide {
    grid-column: 1 / -1;
    border-right: 0;
}

.detail-field span {
    display: block;
    margin-bottom: 7px;
    color: #71827d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-field strong,
.detail-field p {
    margin: 0;
    color: #183238;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.detail-field a {
    color: #178f67;
}

@media (max-width: 720px) {
    .tender-detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-field,
    .detail-field:nth-child(even) {
        border-right: 0;
    }

    .detail-field-wide {
        grid-column: auto;
    }

    .tender-detail-card {
        padding: 16px;
    }
}

/* Funnel interaction fixes */
.navigation a.active {
    background: #178f67;
    box-shadow: 0 10px 25px rgba(23, 143, 103, 0.28);
}

.brand-mark {
    background: linear-gradient(135deg, #28a77a, #117653);
    box-shadow: 0 10px 30px rgba(23, 143, 103, 0.3);
}

.tender-card {
    cursor: default;
    user-select: none;
}

.tender-card.is-dragging {
    opacity: 0.48;
    transform: rotate(1deg) scale(0.98);
}

.funnel-column.is-drag-over {
    border-color: #178f67;
    box-shadow:
        0 0 0 3px rgba(23, 143, 103, 0.16),
        0 12px 28px rgba(18, 43, 50, 0.1);
}

.funnel-column.is-drag-over .funnel-column-body {
    background: rgba(23, 143, 103, 0.08);
}

/* Reliable tender links and restored brand */
.tender-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: default;
}

.tender-card-link:focus {
    outline: none;
}

.tender-card:has(.tender-card-link:focus-visible) {
    border-color: #178f67;
    box-shadow: 0 0 0 3px rgba(23, 143, 103, 0.18);
}

.brand {
    min-width: 0;
}

.brand-mark {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    background:
        radial-gradient(
            circle at 28% 22%,
            rgba(255, 255, 255, 0.28),
            transparent 35%
        ),
        linear-gradient(145deg, #2db486, #117653);
    box-shadow:
        0 10px 28px rgba(23, 143, 103, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-mark::before,
.brand-mark::after {
    position: absolute;
    content: "";
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.brand-mark::before {
    width: 32px;
    height: 32px;
    right: -17px;
    bottom: -17px;
}

.brand-mark::after {
    width: 21px;
    height: 21px;
    right: -12px;
    bottom: -12px;
}

.brand-mark-letter {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 4px;
    color: #91cdb8;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
}

/* СнабАналитика: серверный фирменный логотип */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: block;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 15px;
    background: transparent;
    box-shadow: none;
}

.brand-mark::before,
.brand-mark::after {
    display: none;
}

.brand-logo {
    display: block;
    width: 46px;
    height: 46px;
    border-radius: 15px;
}

.brand-copy {
    display: block;
    min-width: 0;
}

.brand-copy strong {
    display: block;
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    display: block;
    margin-top: 4px;
    color: #91cdb8;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
}

/* Окончательное исправление бренда и карточек */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 14px;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 9px 25px rgba(8, 122, 89, 0.34);
}

.brand-mark::before,
.brand-mark::after {
    display: none;
    content: none;
}

.brand-logo {
    display: block;
    width: 44px;
    height: 44px;
}

.brand-copy {
    display: block;
    min-width: 0;
}

.brand-copy strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.brand-copy small {
    display: block;
    margin-top: 4px;
    color: #8fcab6;
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
}

.tender-card {
    position: relative;
    cursor: default;
}

.tender-card-open {
    position: absolute;
    z-index: 3;
    inset: 0;
    border-radius: inherit;
    cursor: default;
}

.tender-card-open:focus-visible {
    outline: 3px solid rgba(23, 143, 103, 0.32);
    outline-offset: 2px;
}

.tender-drag-handle {
    position: absolute;
    z-index: 5;
    top: 31px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid #d5e2dd;
    border-radius: 7px;
    color: #678078;
    background: #fff;
    cursor: grab;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s ease, border-color .15s ease;
}

.tender-card:hover .tender-drag-handle,
.tender-drag-handle:focus-visible {
    opacity: 1;
}

.tender-drag-handle:active {
    cursor: grabbing;
}

.tender-card-top,
.tender-card h3,
.tender-customer,
.tender-card-bottom {
    position: relative;
    z-index: 1;
}

.tender-card.is-dragging .tender-card-open {
    pointer-events: none;
}

/* Полноэкранная карточка и серверная расчётная таблица */
.tender-workspace-page {
    width: 100%;
    max-width: none;
}

.tender-workspace-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.tender-workspace-head h1 {
    margin: 4px 0;
    color: #173339;
    font-size: clamp(25px, 3vw, 38px);
}

.tender-workspace-head p {
    margin: 0;
}

.tender-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-state {
    color: #64748b;
    font-size: 12px;
}

.save-state.saving {
    color: #b7791f;
}

.save-state.saved {
    color: #178f67;
}

.save-state.error {
    color: #c0392b;
}

.tender-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 14px;
    padding: 6px;
    border: 1px solid #dce7e3;
    border-radius: 12px;
    background: #fff;
}

.tender-tab {
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    color: #526762;
    background: transparent;
    cursor: pointer;
    font-weight: 750;
}

.tender-tab.active {
    color: #fff;
    background: #178f67;
}

.tender-panel {
    display: none;
}

.tender-panel.active {
    display: block;
}

.deal-economy,
.calculation-card {
    margin-bottom: 15px;
    border: 1px solid #dce7e3;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(20, 49, 56, 0.06);
}

.deal-economy {
    overflow: hidden;
}

.deal-economy-head,
.calculation-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e3ebe8;
}

.deal-economy h2,
.calculation-toolbar h2,
.tender-placeholder h2 {
    margin: 0;
    color: #173339;
    font-size: 18px;
}

.deal-economy p,
.calculation-toolbar p,
.tender-placeholder p {
    margin: 4px 0 0;
    color: #71827d;
    font-size: 12px;
}

.economy-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 12px;
    padding: 18px 20px;
}

.economy-inputs label {
    color: #526762;
    font-size: 11px;
    font-weight: 750;
}

.economy-inputs input,
.economy-inputs select {
    width: 100%;
    height: 39px;
    margin-top: 7px;
    padding: 0 10px;
    border: 1px solid #d4dfdc;
    border-radius: 8px;
    color: #173339;
    background: #fff;
}

.economy-results {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    border-top: 1px solid #e3ebe8;
    background: #f7faf9;
}

.economy-results div {
    padding: 15px 18px;
    border-right: 1px solid #e3ebe8;
}

.economy-results div:last-child {
    border-right: 0;
}

.economy-results span {
    display: block;
    margin-bottom: 6px;
    color: #71827d;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.economy-results strong {
    color: #173339;
    font-size: 17px;
}

.economy-result-profit strong {
    color: #178f67;
}

.calculation-table-wrap {
    width: 100%;
    max-height: calc(100vh - 340px);
    overflow: auto;
}

.calculation-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
}

.calculation-table th {
    position: sticky;
    z-index: 3;
    top: 0;
    min-width: 120px;
    padding: 10px 9px;
    border-right: 1px solid #d8e2df;
    border-bottom: 1px solid #cfdcd8;
    color: #48615a;
    background: #edf5f2;
    text-align: left;
    vertical-align: bottom;
}

.calculation-table th:first-child {
    left: 0;
    z-index: 5;
    min-width: 45px;
    text-align: center;
}

.calculation-table th:nth-child(2),
.calculation-table th:nth-child(3) {
    min-width: 230px;
}

.calculation-table td {
    min-width: 120px;
    padding: 5px;
    border-right: 1px solid #e3eae8;
    border-bottom: 1px solid #e3eae8;
    background: #fff;
    vertical-align: middle;
}

.calculation-table td:first-child {
    position: sticky;
    z-index: 2;
    left: 0;
    min-width: 45px;
    color: #71827d;
    background: #f8fbfa;
    text-align: center;
    font-weight: 800;
}

.calculation-table input,
.calculation-table select {
    width: 100%;
    height: 34px;
    min-width: 108px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #173339;
    background: transparent;
}

.calculation-table input:focus,
.calculation-table select:focus {
    border-color: #178f67;
    outline: 3px solid rgba(23, 143, 103, 0.12);
    background: #fff;
}

.calculation-table output {
    display: block;
    min-width: 108px;
    padding: 9px 7px;
    color: #29463f;
    background: #f6faf8;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.calculation-table .number-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.remove-row {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #ecd4d0;
    border-radius: 7px;
    color: #b7483b;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
}

.tender-placeholder {
    padding: 24px;
}

@media (max-width: 1250px) {
    .economy-inputs,
    .economy-results {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .economy-results div {
        border-bottom: 1px solid #e3ebe8;
    }
}

@media (max-width: 760px) {
    .tender-workspace-head,
    .deal-economy-head,
    .calculation-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .tender-head-actions,
    .tender-tabs {
        align-items: stretch;
        flex-direction: column;
    }

    .economy-inputs,
    .economy-results {
        grid-template-columns: 1fr;
    }
}

/* Улучшение навигации по широкой расчётной таблице */
.calculation-table th:nth-child(1),
.calculation-table td:nth-child(1) {
    position: sticky;
    left: 0;
}

.calculation-table th:nth-child(2),
.calculation-table td:nth-child(2) {
    position: sticky;
    left: 45px;
}

.calculation-table th:nth-child(3),
.calculation-table td:nth-child(3) {
    position: sticky;
    left: 275px;
}

.calculation-table th:nth-child(1),
.calculation-table th:nth-child(2),
.calculation-table th:nth-child(3) {
    z-index: 6;
    background: #e2f1eb;
}

.calculation-table td:nth-child(1),
.calculation-table td:nth-child(2),
.calculation-table td:nth-child(3) {
    z-index: 2;
    background: #fff;
}

.calculation-table tr:hover td {
    background: #f8fcfa;
}

.calculation-table tr:hover td:nth-child(1),
.calculation-table tr:hover td:nth-child(2),
.calculation-table tr:hover td:nth-child(3) {
    background: #edf8f4;
}

.calculation-table th:nth-child(15),
.calculation-table th:nth-child(17),
.calculation-table th:nth-child(18),
.calculation-table th:nth-child(21),
.calculation-table th:nth-child(22),
.calculation-table th:nth-child(23),
.calculation-table th:nth-child(24),
.calculation-table th:nth-child(25),
.calculation-table th:nth-child(26),
.calculation-table th:nth-child(27) {
    background: #dff3ea;
}

.calculation-table td:nth-child(15),
.calculation-table td:nth-child(17),
.calculation-table td:nth-child(18),
.calculation-table td:nth-child(21),
.calculation-table td:nth-child(22),
.calculation-table td:nth-child(23),
.calculation-table td:nth-child(24),
.calculation-table td:nth-child(25),
.calculation-table td:nth-child(26),
.calculation-table td:nth-child(27) {
    background: #f5fbf8;
}

.calculation-table th:nth-child(26),
.calculation-table th:nth-child(27) {
    color: #116d50;
    background: #ccebdd;
}

.calculation-table td:nth-child(26) output,
.calculation-table td:nth-child(27) output {
    color: #117151;
    background: #e8f7f0;
    font-weight: 800;
}

.calculation-table td:nth-child(2),
.calculation-table td:nth-child(3) {
    min-width: 230px;
}

.calculation-table td:nth-child(2) input,
.calculation-table td:nth-child(3) input {
    min-width: 215px;
}

.calculation-table-wrap {
    scrollbar-color: #8ba39b #edf2f0;
    scrollbar-width: auto;
}

.calculation-table-wrap::-webkit-scrollbar {
    width: 13px;
    height: 13px;
}

.calculation-table-wrap::-webkit-scrollbar-track {
    background: #edf2f0;
}

.calculation-table-wrap::-webkit-scrollbar-thumb {
    border: 3px solid #edf2f0;
    border-radius: 10px;
    background: #8ba39b;
}

.calculation-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #58766c;
}

/* Карточка конкурса: изолированная компоновка таблицы и экономики */
.tender-workspace-page .calculation-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tender-workspace-page .calculation-card {
    overflow: hidden;
}

.tender-workspace-page .calculation-table-wrap {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 280px);
    overflow: auto;
    overscroll-behavior: contain;
}

.tender-workspace-page .calculation-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.tender-workspace-page .calculation-table th {
    min-width: 132px;
    max-width: 180px;
    white-space: normal;
    line-height: 1.25;
}

.tender-workspace-page .calculation-table th:nth-child(1),
.tender-workspace-page .calculation-table td:nth-child(1) {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
}

.tender-workspace-page .calculation-table th:nth-child(2),
.tender-workspace-page .calculation-table td:nth-child(2),
.tender-workspace-page .calculation-table th:nth-child(3),
.tender-workspace-page .calculation-table td:nth-child(3) {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
}

.tender-workspace-page .calculation-table th:nth-child(1),
.tender-workspace-page .calculation-table td:nth-child(1) {
    position: sticky;
    left: 0;
}

.tender-workspace-page .calculation-table th:nth-child(2),
.tender-workspace-page .calculation-table td:nth-child(2) {
    position: sticky;
    left: 45px;
}

.tender-workspace-page .calculation-table th:nth-child(3),
.tender-workspace-page .calculation-table td:nth-child(3) {
    position: sticky;
    left: 275px;
}

.tender-workspace-page .calculation-table th:nth-child(-n+3) {
    z-index: 8;
    background: #e2f1eb;
}

.tender-workspace-page .calculation-table td:nth-child(-n+3) {
    z-index: 4;
    background: #fff;
}

.tender-workspace-page .calculation-table tr:hover td {
    background: #f8fcfa;
}

.tender-workspace-page .calculation-table tr:hover td:nth-child(-n+3) {
    background: #edf8f4;
}

.tender-workspace-page .calculation-table td {
    height: 45px;
}

.tender-workspace-page .calculation-table input,
.tender-workspace-page .calculation-table select {
    min-width: 118px;
}

.tender-workspace-page .calculation-table td:nth-child(2) input,
.tender-workspace-page .calculation-table td:nth-child(3) input {
    min-width: 215px;
}

.tender-workspace-page .calculation-table output {
    min-width: 118px;
}

.tender-workspace-page .calculation-table th:nth-child(n+21):nth-child(-n+30) {
    background: #dff3ea;
}

.tender-workspace-page .calculation-table td:nth-child(n+21):nth-child(-n+30) {
    background: #f5fbf8;
}

.tender-workspace-page .calculation-table th:nth-child(n+27):nth-child(-n+30) {
    color: #116d50;
    background: #ccebdd;
}

.tender-workspace-page .calculation-table td:nth-child(n+27):nth-child(-n+30) output {
    color: #117151;
    background: #e8f7f0;
    font-weight: 800;
}

.tender-workspace-page .row-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 122px;
}

.tender-workspace-page .row-actions .tax-select {
    min-width: 75px;
}

.tender-workspace-page .deal-economy {
    margin-top: 16px;
}

.tender-workspace-page .deal-economy-head > span {
    color: #71827d;
    font-size: 12px;
}

.tender-workspace-page .deal-economy-body {
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    align-items: stretch;
}

.tender-workspace-page .economy-inputs {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    border-right: 1px solid #e3ebe8;
}

.tender-workspace-page .economy-results {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    border-top: 0;
}

.tender-workspace-page .economy-results div {
    border-right: 1px solid #e3ebe8;
    border-bottom: 1px solid #e3ebe8;
}

.tender-workspace-page .economy-results div:nth-last-child(-n+2) {
    border-bottom: 0;
}

@media (max-width: 1250px) {
    .tender-workspace-page .deal-economy-body {
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .economy-inputs {
        border-right: 0;
        border-bottom: 1px solid #e3ebe8;
    }
}

@media (max-width: 760px) {
    .tender-workspace-page .calculation-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tender-workspace-page .economy-inputs,
    .tender-workspace-page .economy-results {
        grid-template-columns: 1fr;
    }
}

/* Кнопки Excel в расчётной таблице */
.tender-workspace-page .excel-action {
    white-space: nowrap;
    color: #176b4f;
    border-color: #a8c9bc;
    background: #f2faf6;
}

.tender-workspace-page .excel-action:hover {
    color: #0f563f;
    border-color: #79ad99;
    background: #e2f3eb;
}

.tender-workspace-page .excel-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* global-vat-table-controls */
.tender-workspace-page .table-control {
    display: grid;
    gap: 4px;
    min-width: 150px;
    color: #5f716c;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.tender-workspace-page .table-control-input {
    width: 100%;
    min-width: 130px;
    height: 36px;
    padding: 0 9px;
    border: 1px solid #cddbd6;
    border-radius: 7px;
    color: #173339;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
}

.tender-workspace-page .row-actions {
    min-width: 48px;
    justify-content: center;
}

@media (max-width: 900px) {
    .tender-workspace-page .table-control {
        width: 100%;
    }
}

/* Жёлтые и зелёные колонки расчётной таблицы */
.tender-workspace-page .calculation-table th.col-purchase {
    color: #5f4b00 !important;
    background: #f4d866 !important;
}

.tender-workspace-page .calculation-table td.col-purchase {
    background: #fff3b0 !important;
}

.tender-workspace-page .calculation-table td.col-purchase input,
.tender-workspace-page .calculation-table td.col-purchase output {
    color: #493b00 !important;
    border-color: #e1c34f !important;
    background: #fff8d6 !important;
}

.tender-workspace-page .calculation-table th.col-offer,
.tender-workspace-page .calculation-table th.col-result {
    color: #174a2d !important;
    background: #92d050 !important;
}

.tender-workspace-page .calculation-table td.col-offer,
.tender-workspace-page .calculation-table td.col-result {
    background: #dff2ca !important;
}

.tender-workspace-page .calculation-table td.col-offer input,
.tender-workspace-page .calculation-table td.col-offer output,
.tender-workspace-page .calculation-table td.col-result input,
.tender-workspace-page .calculation-table td.col-result output {
    color: #173f29 !important;
    border-color: #78b53d !important;
    background: #edf8e2 !important;
}

.tender-workspace-page .calculation-table tr:hover td.col-purchase {
    background: #ffec91 !important;
}

.tender-workspace-page .calculation-table tr:hover td.col-offer,
.tender-workspace-page .calculation-table tr:hover td.col-result {
    background: #cce9ae !important;
}

/* Кнопка удаления внутри колонки № */
.tender-workspace-page .calculation-table .row-number {
    min-width: 72px !important;
    width: 72px !important;
    max-width: 72px !important;
    padding: 4px !important;
}

.tender-workspace-page .row-number {
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tender-workspace-page td.row-number {
    display: table-cell;
    white-space: nowrap;
}

.tender-workspace-page .row-number-value {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    vertical-align: middle;
}

.tender-workspace-page .row-number .remove-row {
    display: inline-flex;
    width: 24px;
    height: 24px;
    margin-left: 3px;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 15px;
}

/* Принудительная заливка закупочных колонок */
.tender-workspace-page table.calculation-table th.col-purchase {
    color: #594700 !important;
    background-color: #f4d866 !important;
}

.tender-workspace-page table.calculation-table td.col-purchase {
    background-color: #fff0a6 !important;
}

.tender-workspace-page table.calculation-table td.col-purchase input,
.tender-workspace-page table.calculation-table td.col-purchase output {
    background-color: #fff7cf !important;
}

/* Принудительная заливка колонок предложения */
.tender-workspace-page table.calculation-table th.col-offer,
.tender-workspace-page table.calculation-table th.col-result {
    color: #174a2d !important;
    background-color: #92d050 !important;
}

.tender-workspace-page table.calculation-table td.col-offer,
.tender-workspace-page table.calculation-table td.col-result {
    background-color: #d8efbf !important;
}

.tender-workspace-page table.calculation-table td.col-offer input,
.tender-workspace-page table.calculation-table td.col-offer output,
.tender-workspace-page table.calculation-table td.col-result input,
.tender-workspace-page table.calculation-table td.col-result output {
    background-color: #eef8e3 !important;
}

/* four-green-delivery-columns */
.tender-workspace-page table.calculation-table th.col-result {
    min-width: 178px;
    color: #173f29 !important;
    background-color: #92d050 !important;
    border-color: #76b33d !important;
}

.tender-workspace-page table.calculation-table td.col-result {
    background-color: #d9efc4 !important;
    border-color: #b9da99 !important;
}

.tender-workspace-page table.calculation-table td.col-result output,
.tender-workspace-page table.calculation-table td.col-result input {
    width: 100%;
    color: #173f29 !important;
    background-color: #edf8e3 !important;
    border-color: #a4cf7c !important;
    font-weight: 800;
}

/* Перенос длинного текста и регулировка размеров таблицы */
.tender-workspace-page .calculation-table {
    table-layout: fixed;
}

.tender-workspace-page .calculation-table th {
    position: relative;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.tender-workspace-page .calculation-table td {
    position: relative;
    height: inherit;
    overflow: visible;
    white-space: normal;
    vertical-align: top;
}

.tender-workspace-page .calculation-table td input:not([type="checkbox"]),
.tender-workspace-page .calculation-table td select {
    width: 100%;
    min-height: 34px;
    height: 100%;
    box-sizing: border-box;
}

/*
Обычный input не умеет переносить текст на несколько строк.
Для отображения длинного текста разрешаем ему визуально
занимать всю высоту строки; после потери фокуса полный текст
остаётся доступен через растущую строку и браузерную прокрутку.
*/
.tender-workspace-page .calculation-table td input {
    text-overflow: clip;
}

.tender-workspace-page .calculation-table td {
    overflow-wrap: anywhere;
}

.tender-workspace-page .column-resizer {
    position: absolute;
    z-index: 20;
    top: 0;
    right: -4px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}

.tender-workspace-page .column-resizer:hover,
body.resizing-table .column-resizer {
    background: rgba(20, 117, 83, 0.28);
}

.tender-workspace-page .row-resizer {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: -4px;
    left: 0;
    height: 8px;
    cursor: row-resize;
    user-select: none;
    touch-action: none;
}

.tender-workspace-page .row-resizer:hover,
body.resizing-table .row-resizer {
    background: rgba(20, 117, 83, 0.28);
}

body.resizing-table {
    cursor: col-resize;
    user-select: none;
}

.tender-workspace-page .calculation-table td:nth-child(2),
.tender-workspace-page .calculation-table td:nth-child(3) {
    min-height: 48px;
}

/* Финансовые итоги непосредственно под расчётной таблицей */
.tender-workspace-page .calculation-financial-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(155px, 1fr));
    gap: 0;
    border-top: 1px solid #dce7e3;
    background: #f8fbfa;
}

.tender-workspace-page .calculation-financial-summary > div {
    min-width: 0;
    padding: 15px 17px;
    border-right: 1px solid #dce7e3;
}

.tender-workspace-page .calculation-financial-summary > div:last-child {
    border-right: 0;
}

.tender-workspace-page .calculation-financial-summary span,
.tender-workspace-page .calculation-financial-summary strong {
    display: block;
}

.tender-workspace-page .calculation-financial-summary span {
    margin-bottom: 7px;
    color: #6b7d78;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.tender-workspace-page .calculation-financial-summary strong {
    color: #17343b;
    font-size: clamp(16px, 1.4vw, 21px);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.tender-workspace-page .calculation-financial-summary
.financial-summary-profit {
    background: #e7f6ef;
}

.tender-workspace-page .calculation-financial-summary
.financial-summary-profit strong {
    color: #117151;
}

@media (max-width: 1100px) {
    .tender-workspace-page .calculation-financial-summary {
        grid-template-columns: repeat(2, minmax(155px, 1fr));
    }

    .tender-workspace-page .calculation-financial-summary > div {
        border-bottom: 1px solid #dce7e3;
    }

    .tender-workspace-page .calculation-financial-summary > div:nth-child(2n) {
        border-right: 0;
    }

    .tender-workspace-page .calculation-financial-summary > div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 620px) {
    .tender-workspace-page .calculation-financial-summary {
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .calculation-financial-summary > div {
        border-right: 0;
    }
}

/* table-header-center-and-name-wrap */
.tender-workspace-page .calculation-table thead th {
    height: 56px;
    padding: 8px 12px;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.25;
}

.tender-workspace-page .calculation-table textarea.calc-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #d5dfdc;
    border-radius: 6px;
    color: #18383a;
    background: #fff;
    font: inherit;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    resize: none;
}

.tender-workspace-page .calculation-table textarea.calc-input:focus {
    position: relative;
    z-index: 12;
    border-color: #168f6a;
    outline: 2px solid rgba(22, 143, 106, 0.14);
}

.tender-workspace-page .calculation-table td:has(textarea.calc-input) {
    height: auto;
    min-height: 48px;
    white-space: normal !important;
    vertical-align: top;
}

.tender-workspace-page .calculation-table tr.calculation-row {
    height: auto;
    min-height: 48px;
}

/* Многострочные наименования без отдельного прямоугольника */
.tender-workspace-page .calculation-table textarea.calc-input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 6px 7px !important;
    box-sizing: border-box !important;

    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;

    color: inherit !important;
    background: transparent !important;
    font: inherit !important;
    line-height: 1.35 !important;

    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    overflow: hidden !important;
    resize: none !important;
}

.tender-workspace-page .calculation-table textarea.calc-input:hover,
.tender-workspace-page .calculation-table textarea.calc-input:focus,
.tender-workspace-page .calculation-table textarea.calc-input:focus-visible {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.tender-workspace-page .calculation-table td:has(textarea.calc-input) {
    height: auto !important;
    min-height: 48px;
    padding: 2px !important;
    vertical-align: top !important;
    white-space: normal !important;
    overflow: visible !important;
}

.tender-workspace-page .calculation-table tr.calculation-row {
    height: auto;
    min-height: 48px;
}

/* row-coefficient-column */
.tender-workspace-page .calculation-table th.col-coefficient {
    min-width: 115px;
    color: #354846 !important;
    background: #e4eeea !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page .calculation-table td.col-coefficient {
    min-width: 115px;
    padding: 4px !important;
    background: #f2f7f5 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page .calculation-table
td.col-coefficient input.row-coefficient {
    width: 100% !important;
    min-width: 78px;
    text-align: center !important;
    font-weight: 800;
}

/* volume-weight-excel-colors */

/* Объём — оливково-бежевый, как в Excel */
.tender-workspace-page table.calculation-table th.col-volume {
    color: #171717 !important;
    background-color: #c8c095 !important;
    border-color: #8f896d !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page table.calculation-table td.col-volume {
    background-color: #d5cda5 !important;
    border-color: #a9a17e !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page table.calculation-table td.col-volume input,
.tender-workspace-page table.calculation-table td.col-volume output {
    color: #171717 !important;
    background-color: transparent !important;
    border-color: transparent !important;
    text-align: center !important;
}

/* Вес — светло-персиковый, как в Excel */
.tender-workspace-page table.calculation-table th.col-weight {
    color: #171717 !important;
    background-color: #f3c69e !important;
    border-color: #c2916b !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page table.calculation-table td.col-weight {
    background-color: #f7d3b1 !important;
    border-color: #d3a27b !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.tender-workspace-page table.calculation-table td.col-weight input,
.tender-workspace-page table.calculation-table td.col-weight output {
    color: #171717 !important;
    background-color: transparent !important;
    border-color: transparent !important;
    text-align: center !important;
}

/* Сохраняем цвета при наведении на строку */
.tender-workspace-page table.calculation-table
tr:hover td.col-volume {
    background-color: #d5cda5 !important;
}

.tender-workspace-page table.calculation-table
tr:hover td.col-weight {
    background-color: #f7d3b1 !important;
}

/* economy-screenshot-layout-v1 */
.tender-workspace-page .deal-economy {
    overflow: hidden;
    margin-top: 18px;
    border: 1px solid #dce5e2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(24, 58, 50, 0.05);
}

.tender-workspace-page .deal-economy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px 17px;
    border-bottom: 1px solid #e1e8e6;
    background: #fbfcfc;
}

.tender-workspace-page .deal-economy-head h2 {
    margin: 0;
    color: #172f35;
    font-size: 20px;
    line-height: 1.25;
}

.tender-workspace-page .deal-economy-head p {
    margin: 5px 0 0;
    color: #7a8985;
    font-size: 12px;
}

.tender-workspace-page .deal-economy-head > span {
    flex: 0 0 auto;
    margin-top: 4px;
    color: #8a9693;
    font-size: 11px;
}

.tender-workspace-page .deal-economy-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    align-items: stretch;
}

.tender-workspace-page .economy-entry-panel,
.tender-workspace-page .economy-result-panel {
    min-width: 0;
    padding: 18px 20px 20px;
}

.tender-workspace-page .economy-result-panel {
    border-left: 1px solid #dfe8e5;
    background: #fbfdfc;
}

.tender-workspace-page .economy-column-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
}

.tender-workspace-page .economy-column-heading strong,
.tender-workspace-page .economy-column-heading span {
    display: block;
}

.tender-workspace-page .economy-column-heading strong {
    color: #172f35;
    font-size: 14px;
    line-height: 1.3;
}

.tender-workspace-page .economy-column-heading span {
    margin-top: 4px;
    color: #8a9693;
    font-size: 11px;
}

.tender-workspace-page .economy-column-heading small {
    flex: 0 0 auto;
    color: #8a9693;
    font-size: 10px;
}

.tender-workspace-page .economy-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.tender-workspace-page .economy-input-card {
    padding: 12px;
    border: 1px solid #e0e7e5;
    border-radius: 12px;
    background: #fff;
}

.tender-workspace-page .economy-input-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #344a4d;
    font-size: 12px;
    line-height: 1.2;
}

.tender-workspace-page .economy-card-icon {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #2382a6;
    background: #eaf5fa;
    font-size: 13px;
    font-weight: 850;
}

.tender-workspace-page .economy-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.tender-workspace-page .economy-field-grid label {
    display: grid;
    min-width: 0;
    gap: 7px;
    color: #6e7d79;
    font-size: 10px;
    font-weight: 700;
}

.tender-workspace-page .economy-input-wrap {
    display: flex;
    min-width: 0;
    height: 42px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe6e4;
    border-radius: 10px;
    background: #fff;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.tender-workspace-page .economy-input-wrap:focus-within {
    border-color: #16966e;
    box-shadow: 0 0 0 3px rgba(22, 150, 110, 0.1);
}

.tender-workspace-page .economy-input-wrap input {
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0 8px 0 11px;
    border: 0 !important;
    outline: 0;
    color: #172f35;
    background: transparent !important;
    font-size: 13px;
    font-weight: 800;
}

.tender-workspace-page .economy-input-wrap b {
    flex: 0 0 auto;
    padding: 0 11px 0 3px;
    color: #8b9895;
    font-size: 10px;
    font-weight: 750;
}

.tender-workspace-page .economy-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.tender-workspace-page .economy-results > div {
    box-sizing: border-box;
}

.tender-workspace-page .economy-result-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 78px;
    padding: 13px 14px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(110deg, #144b50, #17625d);
}

.tender-workspace-page .economy-result-hero span,
.tender-workspace-page .economy-result-hero strong {
    display: block;
}

.tender-workspace-page .economy-result-hero span {
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 10px;
}

.tender-workspace-page .economy-hero-main strong {
    color: #28b67d;
    font-size: clamp(20px, 2vw, 27px);
    line-height: 1.1;
}

.tender-workspace-page .economy-hero-metric {
    min-width: 110px;
    padding: 10px 12px;
    border-radius: 9px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
}

.tender-workspace-page .economy-hero-metric strong {
    color: #fff;
    font-size: 18px;
}

.tender-workspace-page .economy-result-row,
.tender-workspace-page .economy-result-total,
.tender-workspace-page .economy-result-offer {
    display: flex;
    min-height: 39px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 11px;
    border: 1px solid #e1e8e6;
    border-radius: 9px;
    background: #fff;
}

.tender-workspace-page .economy-result-row span,
.tender-workspace-page .economy-result-total span,
.tender-workspace-page .economy-result-offer span {
    color: #778783;
    font-size: 10px;
}

.tender-workspace-page .economy-result-row strong,
.tender-workspace-page .economy-result-total strong,
.tender-workspace-page .economy-result-offer strong {
    flex: 0 0 auto;
    color: #172f35;
    font-size: 13px;
    text-align: right;
}

.tender-workspace-page .economy-result-total {
    border-color: #a8dcc9;
    background: #edf9f4;
}

.tender-workspace-page .economy-result-total span,
.tender-workspace-page .economy-result-total strong {
    color: #146b4c;
    font-weight: 850;
}

.tender-workspace-page .economy-result-offer {
    min-height: 46px;
    border: 2px solid #2383ba;
    background: #eef7fd;
}

.tender-workspace-page .economy-result-offer span,
.tender-workspace-page .economy-result-offer strong {
    color: #195f87;
    font-weight: 850;
}

.tender-workspace-page .economy-result-offer strong {
    font-size: 15px;
}

.tender-workspace-page .economy-result-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tender-workspace-page .economy-result-secondary > div {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid #e1e8e6;
    border-radius: 9px;
    background: #fff;
}

.tender-workspace-page .economy-result-secondary span,
.tender-workspace-page .economy-result-secondary strong {
    display: block;
}

.tender-workspace-page .economy-result-secondary span {
    margin-bottom: 5px;
    color: #7c8986;
    font-size: 9px;
}

.tender-workspace-page .economy-result-secondary strong {
    color: #243b40;
    font-size: 12px;
}

.tender-workspace-page .economy-result-note {
    margin: 0;
    padding: 10px 11px;
    border-radius: 8px;
    color: #71837d;
    background: #f1faf6;
    font-size: 9px;
    line-height: 1.45;
}

.tender-workspace-page .economy-results
strong.negative-value {
    color: #e05252 !important;
}

.tender-workspace-page .economy-results
strong.positive-value {
    color: #18a86f !important;
}

@media (max-width: 1050px) {
    .tender-workspace-page .deal-economy-body {
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .economy-result-panel {
        border-top: 1px solid #dfe8e5;
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .tender-workspace-page .deal-economy-head,
    .tender-workspace-page .economy-column-heading {
        display: grid;
    }

    .tender-workspace-page .economy-field-grid,
    .tender-workspace-page .economy-result-secondary {
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .economy-result-hero {
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .economy-hero-metric {
        text-align: left;
    }
}

/* economy-sale-total-v1 */
.tender-workspace-page .economy-result-sale-total {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 2px solid #397da0;
    border-radius: 11px;
    background: linear-gradient(
        110deg,
        #e9f4f8,
        #dceef5
    );
    box-shadow: 0 5px 13px rgba(36, 101, 132, 0.09);
}

.tender-workspace-page .economy-result-sale-total span {
    max-width: 65%;
    color: #315f72;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.35;
}

.tender-workspace-page .economy-result-sale-total strong {
    flex: 0 0 auto;
    color: #174e68;
    font-size: clamp(15px, 1.5vw, 20px);
    font-weight: 900;
    line-height: 1.15;
    text-align: right;
    white-space: nowrap;
}

.tender-workspace-page .economy-result-sale-total
strong.positive-value,
.tender-workspace-page .economy-result-sale-total
strong.negative-value {
    color: #174e68 !important;
}

@media (max-width: 560px) {
    .tender-workspace-page .economy-result-sale-total {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tender-workspace-page .economy-result-sale-total span {
        max-width: none;
    }

    .tender-workspace-page .economy-result-sale-total strong {
        text-align: left;
    }
}

/* economy-green-totals-v1 */

/*
 * Обе итоговые стоимости имеют одинаковую высоту
 * и зелёное оформление в палитре приложения.
 */
.tender-workspace-page .economy-result-sale-total {
    display: flex !important;
    min-height: 58px !important;
    height: 58px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;

    border: 1px solid #75c5a6 !important;
    border-radius: 10px !important;

    background: linear-gradient(
        110deg,
        #e6f7f0,
        #d8f1e7
    ) !important;

    box-shadow: 0 4px 11px rgba(22, 125, 89, 0.08) !important;
}

.tender-workspace-page
.economy-result-sale-total-no-vat {
    border-color: #a4d6c2 !important;
    background: #f0faf6 !important;
    box-shadow: none !important;
}

.tender-workspace-page .economy-result-sale-total span {
    display: block !important;
    max-width: 68% !important;
    color: #17694d !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    line-height: 1.3 !important;
    text-transform: uppercase;
}

.tender-workspace-page .economy-result-sale-total strong,
.tender-workspace-page .economy-result-sale-total
strong.positive-value,
.tender-workspace-page .economy-result-sale-total
strong.negative-value {
    flex: 0 0 auto !important;
    color: #116e4c !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/*
 * Остальные основные строки получают такую же высоту.
 * Hero-карточка прибыли остаётся визуально выразительной,
 * но по высоте совпадает с итоговыми строками.
 */
.tender-workspace-page .economy-result-hero,
.tender-workspace-page .economy-result-row,
.tender-workspace-page .economy-result-total,
.tender-workspace-page .economy-result-offer {
    min-height: 58px !important;
    height: 58px !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-result-hero {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.tender-workspace-page .economy-hero-metric {
    min-height: 42px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    box-sizing: border-box;
}

/* Вероятность победы после переноса занимает всю строку. */
.tender-workspace-page
.economy-result-secondary-single {
    grid-template-columns: 1fr !important;
}

.tender-workspace-page
.economy-result-secondary-single > div {
    display: flex;
    min-height: 58px;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.tender-workspace-page
.economy-result-secondary-single span {
    margin-bottom: 0 !important;
}

@media (max-width: 560px) {
    .tender-workspace-page .economy-result-sale-total,
    .tender-workspace-page .economy-result-hero,
    .tender-workspace-page .economy-result-row,
    .tender-workspace-page .economy-result-total,
    .tender-workspace-page .economy-result-offer,
    .tender-workspace-page
    .economy-result-secondary-single > div {
        height: auto !important;
        min-height: 58px !important;
    }

    .tender-workspace-page .economy-result-sale-total {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .tender-workspace-page .economy-result-sale-total span {
        max-width: none !important;
    }

    .tender-workspace-page .economy-result-sale-total strong {
        text-align: left !important;
    }
}

/* economy-height-profit-fix-v1 */

/*
 * Обе колонки экономики сделки имеют одинаковую высоту.
 * Правая панель и её содержимое растягиваются по высоте
 * левой панели.
 */
.tender-workspace-page .deal-economy-body {
    align-items: stretch !important;
}

.tender-workspace-page .economy-entry-panel,
.tender-workspace-page .economy-result-panel {
    display: flex !important;
    min-height: 100% !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-inputs,
.tender-workspace-page .economy-results {
    flex: 1 1 auto !important;
}

.tender-workspace-page .economy-results {
    display: grid !important;
    grid-template-rows:
        58px
        58px
        minmax(88px, auto)
        58px
        58px
        58px
        58px
        minmax(38px, auto) !important;
    align-content: stretch !important;
}

/*
 * Карточка прибыли получает достаточную высоту.
 * Ранее height: 58px обрезал крупное значение.
 */
.tender-workspace-page .economy-result-hero {
    min-height: 88px !important;
    height: auto !important;
    overflow: hidden !important;
    padding: 13px 16px !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-hero-main {
    min-width: 0 !important;
    align-self: center !important;
}

.tender-workspace-page .economy-hero-main span {
    margin-bottom: 7px !important;
}

.tender-workspace-page .economy-hero-main strong {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #25bd82 !important;
    font-size: clamp(19px, 2vw, 26px) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.tender-workspace-page .economy-hero-metric {
    min-width: 120px !important;
    min-height: 58px !important;
    height: auto !important;
    align-self: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/*
 * Вероятность победы выглядит как обычная полная строка:
 * та же ширина, высота, отступы и границы.
 */
.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single {
    display: block !important;
    width: 100% !important;
    height: 58px !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single > div {
    display: flex !important;
    width: 100% !important;
    min-height: 58px !important;
    height: 58px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    box-sizing: border-box !important;
    border: 1px solid #e1e8e6 !important;
    border-radius: 9px !important;
    background: #fff !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single span,
.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single strong {
    display: block !important;
    margin: 0 !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single span {
    color: #778783 !important;
    font-size: 10px !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single strong {
    color: #172f35 !important;
    font-size: 13px !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/*
 * Пояснение занимает нижнюю часть правой колонки.
 */
.tender-workspace-page .economy-result-note {
    display: flex !important;
    min-height: 38px !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

/*
 * На узких экранах фиксированная сетка отключается,
 * чтобы содержимое не обрезалось.
 */
@media (max-width: 1050px) {
    .tender-workspace-page .economy-entry-panel,
    .tender-workspace-page .economy-result-panel {
        min-height: 0 !important;
    }

    .tender-workspace-page .economy-results {
        grid-template-rows: none !important;
    }
}

@media (max-width: 560px) {
    .tender-workspace-page .economy-result-hero {
        min-height: 132px !important;
    }

    .tender-workspace-page .economy-hero-main strong {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single,
    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single > div {
        height: auto !important;
        min-height: 58px !important;
    }
}

/* compact-economy-panels-v1 */

/* Общий двухколоночный блок */
.tender-workspace-page .deal-economy-body {
    align-items: stretch !important;
}

/* Левая и правая части одинаковой высоты */
.tender-workspace-page .economy-entry-panel,
.tender-workspace-page .economy-result-panel {
    display: flex !important;
    min-height: 0 !important;
    height: auto !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

/* Компактные заголовки обеих частей */
.tender-workspace-page .economy-entry-panel > header,
.tender-workspace-page .economy-result-panel > header,
.tender-workspace-page .economy-panel-heading {
    min-height: 42px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    box-sizing: border-box !important;
}

/* Левая часть: компактная сетка параметров */
.tender-workspace-page .economy-inputs {
    display: grid !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    padding: 10px !important;
    align-content: stretch !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-input-card,
.tender-workspace-page .economy-input-group {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-input-card h4,
.tender-workspace-page .economy-input-group h4,
.tender-workspace-page .economy-input-card h3,
.tender-workspace-page .economy-input-group h3 {
    margin: 0 0 7px !important;
    line-height: 1.2 !important;
}

.tender-workspace-page .economy-field-grid,
.tender-workspace-page .economy-fields {
    gap: 7px 9px !important;
}

.tender-workspace-page .economy-inputs label {
    margin: 0 !important;
    line-height: 1.2 !important;
}

.tender-workspace-page .economy-inputs input,
.tender-workspace-page .economy-inputs select {
    min-height: 34px !important;
    height: 34px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    box-sizing: border-box !important;
}

/* Правая часть: плотный вертикальный набор строк */
.tender-workspace-page .economy-results {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

/* Две зелёные итоговые строки */
.tender-workspace-page .economy-result-sale-total {
    display: flex !important;
    flex: 0 0 48px !important;
    min-height: 48px !important;
    height: 48px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.tender-workspace-page .economy-result-sale-total span {
    max-width: 70% !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
}

.tender-workspace-page .economy-result-sale-total strong {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

/* Прибыль и эффективность */
.tender-workspace-page .economy-result-hero {
    display: grid !important;
    flex: 0 0 64px !important;
    min-height: 64px !important;
    height: 64px !important;
    grid-template-columns: minmax(0, 1fr) minmax(108px, 34%) !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.tender-workspace-page .economy-hero-main {
    display: flex !important;
    min-width: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.tender-workspace-page .economy-hero-main span {
    margin: 0 0 4px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
}

.tender-workspace-page .economy-hero-main strong {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(17px, 1.55vw, 22px) !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.tender-workspace-page .economy-hero-metric {
    display: flex !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-self: stretch !important;
    padding: 6px 8px !important;
    box-sizing: border-box !important;
}

.tender-workspace-page .economy-hero-metric span {
    margin: 0 0 3px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
}

.tender-workspace-page .economy-hero-metric strong {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
}

/* Обычные строки результатов */
.tender-workspace-page .economy-result-row,
.tender-workspace-page .economy-result-total,
.tender-workspace-page .economy-result-offer {
    display: flex !important;
    flex: 0 0 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.tender-workspace-page .economy-result-row span,
.tender-workspace-page .economy-result-total span,
.tender-workspace-page .economy-result-offer span {
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
}

.tender-workspace-page .economy-result-row strong,
.tender-workspace-page .economy-result-total strong,
.tender-workspace-page .economy-result-offer strong {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/* Вероятность победы: полный размер обычной строки */
.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single {
    display: block !important;
    flex: 0 0 44px !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    margin: 0 !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single > div {
    display: flex !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    border: 1px solid #e1e8e6 !important;
    border-radius: 8px !important;
    background: #fff !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single span {
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single strong {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/* Нижнее пояснение без лишней высоты */
.tender-workspace-page .economy-result-note {
    display: flex !important;
    flex: 1 1 30px !important;
    min-height: 30px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    box-sizing: border-box !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
}

/*
 * Обе панели занимают общую высоту строки CSS Grid.
 * Содержимое левой стороны распределяется равномерно.
 */
@media (min-width: 1051px) {
    .tender-workspace-page .economy-entry-panel,
    .tender-workspace-page .economy-result-panel {
        height: 100% !important;
    }

    .tender-workspace-page .economy-inputs {
        grid-auto-rows: minmax(0, 1fr) !important;
    }
}

/* На небольших экранах карточки растут по содержимому */
@media (max-width: 1050px) {
    .tender-workspace-page .deal-economy-body {
        align-items: start !important;
    }

    .tender-workspace-page .economy-entry-panel,
    .tender-workspace-page .economy-result-panel {
        height: auto !important;
    }
}

@media (max-width: 560px) {
    .tender-workspace-page .economy-result-sale-total,
    .tender-workspace-page .economy-result-hero,
    .tender-workspace-page .economy-result-row,
    .tender-workspace-page .economy-result-total,
    .tender-workspace-page .economy-result-offer,
    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single,
    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single > div {
        height: auto !important;
        min-height: 44px !important;
        flex-basis: auto !important;
    }

    .tender-workspace-page .economy-result-hero {
        grid-template-columns: 1fr !important;
    }

    .tender-workspace-page .economy-hero-main strong {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

/* economy-final-alignment-v2 */

/* Ещё более компактные интервалы справа */
.tender-workspace-page .economy-results {
    gap: 3px !important;
    padding: 7px 8px !important;
}

/* Две строки итоговой стоимости */
.tender-workspace-page .economy-result-sale-total {
    flex: 0 0 36px !important;
    width: 100% !important;
    min-height: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 4px 10px !important;
    box-sizing: border-box !important;
}

/* Карточка прибыли */
.tender-workspace-page .economy-result-hero {
    flex: 0 0 50px !important;
    width: 100% !important;
    min-height: 50px !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    align-items: stretch !important;
}

/*
 * Наименование и число прибыли центрируются
 * по вертикали в левой области карточки.
 */
.tender-workspace-page .economy-hero-main {
    display: flex !important;
    min-width: 0 !important;
    height: 100% !important;
    align-items: flex-start !important;
    justify-content: center !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.tender-workspace-page .economy-hero-main span {
    display: block !important;
    margin: 0 0 2px !important;
    line-height: 1 !important;
}

.tender-workspace-page .economy-hero-main strong {
    display: block !important;
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.tender-workspace-page .economy-hero-metric {
    display: flex !important;
    min-height: 38px !important;
    height: 38px !important;
    align-self: center !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 3px 7px !important;
    box-sizing: border-box !important;
}

/* Обычные строки */
.tender-workspace-page .economy-result-row,
.tender-workspace-page .economy-result-total,
.tender-workspace-page .economy-result-offer {
    flex: 0 0 32px !important;
    width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 3px 9px !important;
    box-sizing: border-box !important;
}

/*
 * Вероятность победы полностью повторяет размеры
 * строки «Все затраты по сделке».
 */
.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single {
    display: block !important;
    flex: 0 0 32px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single > div {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 3px 9px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single span,
.tender-workspace-page
.economy-result-secondary.economy-result-secondary-single strong {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Пояснение снизу */
.tender-workspace-page .economy-result-note {
    flex: 1 1 23px !important;
    min-height: 23px !important;
    margin: 0 !important;
    padding: 3px 7px !important;
}

/* Компактность левой части */
.tender-workspace-page .economy-inputs {
    gap: 5px !important;
    padding: 7px 8px !important;
}

.tender-workspace-page .economy-input-card,
.tender-workspace-page .economy-input-group {
    padding: 6px 8px !important;
}

.tender-workspace-page .economy-inputs input,
.tender-workspace-page .economy-inputs select {
    min-height: 29px !important;
    height: 29px !important;
}

/* Ровное отображение разрядов */
.tender-workspace-page .economy-results strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .tender-workspace-page .economy-result-sale-total,
    .tender-workspace-page .economy-result-hero,
    .tender-workspace-page .economy-result-row,
    .tender-workspace-page .economy-result-total,
    .tender-workspace-page .economy-result-offer,
    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single,
    .tender-workspace-page
    .economy-result-secondary.economy-result-secondary-single > div {
        height: auto !important;
        min-height: 32px !important;
        flex-basis: auto !important;
    }
}

/* economy-left-corrected-v3 */

@media (min-width: 1051px) {
    /*
     * Левая и правая панели занимают одну высоту.
     */
    .tender-workspace-page .deal-economy-body {
        align-items: stretch !important;
    }

    .tender-workspace-page .economy-entry-panel,
    .tender-workspace-page .economy-result-panel {
        height: 100% !important;
        min-height: 0 !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        box-sizing: border-box !important;
    }

    /*
     * Заголовок левой колонки имеет ту же высоту,
     * что и заголовок правой.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-column-heading,
    .tender-workspace-page .economy-result-panel
    .economy-column-heading {
        min-height: 34px !important;
        height: 34px !important;
        flex-basis: 34px !important;
        margin-bottom: 5px !important;
    }

    /*
     * Размеры заголовков карточек не уменьшаются.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-input-card h3 {
        min-height: 22px !important;
        margin: 0 0 4px !important;
        padding: 0 !important;
        font-size: 12px !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-card-icon {
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    /*
     * Подписи над полями сохраняют читаемый размер,
     * уменьшается только межстрочная высота.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-field-grid label {
        gap: 3px !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 1.05 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-field-grid label > span:first-child {
        display: flex !important;
        min-height: 18px !important;
        align-items: flex-end !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.05 !important;
    }

    /*
     * Карточки размещаются равномерно, без лишних
     * вертикальных промежутков.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-inputs {
        display: grid !important;
        grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-card {
        display: flex !important;
        min-height: 0 !important;
        height: auto !important;
        flex-direction: column !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-field-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        align-items: end !important;
    }

    /*
     * Уменьшается только высота поля ввода.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap {
        display: flex !important;
        min-height: 28px !important;
        height: 28px !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 7px !important;
        box-sizing: border-box !important;
    }

    /*
     * Число находится по вертикальному центру поля.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap input {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 26px !important;
        height: 26px !important;
        margin: 0 !important;
        padding: 0 5px 0 8px !important;
        border: 0 !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
        font-weight: 750 !important;
        line-height: 26px !important;
    }

    /*
     * ₽, %, дней также выравниваются точно
     * по вертикальному центру.
     */
    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap b {
        display: flex !important;
        height: 100% !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 8px 0 3px !important;
        font-size: 10px !important;
        font-weight: 750 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }
}
/* economy-left-corrected-v4 */
@media (min-width: 1051px) {
    .tender-workspace-page .deal-economy-body {
        align-items: stretch !important;
    }

    .tender-workspace-page .economy-entry-panel,
    .tender-workspace-page .economy-result-panel {
        min-height: 0 !important;
        height: 100% !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        box-sizing: border-box !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-column-heading,
    .tender-workspace-page .economy-result-panel
    .economy-column-heading {
        min-height: 34px !important;
        height: 34px !important;
        margin-bottom: 5px !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-inputs {
        display: grid !important;
        grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-card {
        display: flex !important;
        min-height: 0 !important;
        height: auto !important;
        flex-direction: column !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-card h3 {
        min-height: 22px !important;
        margin: 0 0 4px !important;
        padding: 0 !important;
        font-size: 12px !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-card-icon {
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-field-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        align-items: end !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-field-grid label {
        gap: 3px !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        line-height: 1.05 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-field-grid label > span:first-child {
        display: flex !important;
        min-height: 18px !important;
        align-items: flex-end !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.05 !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap {
        display: flex !important;
        min-height: 28px !important;
        height: 28px !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 7px !important;
        box-sizing: border-box !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap input {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 26px !important;
        height: 26px !important;
        margin: 0 !important;
        padding: 0 5px 0 8px !important;
        border: 0 !important;
        box-sizing: border-box !important;
        font-size: 12px !important;
        font-weight: 750 !important;
        line-height: 26px !important;
    }

    .tender-workspace-page .economy-entry-panel
    .economy-input-wrap b {
        display: flex !important;
        height: 100% !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 8px 0 3px !important;
        font-size: 10px !important;
        font-weight: 750 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }
}

/* tender-header-compact */
.tender-workspace-page .tender-workspace-head-compact {
    min-height: 0 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.tender-workspace-page
.tender-workspace-head-compact
.tender-head-actions {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.tender-workspace-page
.tender-workspace-head-compact
.save-state {
    margin: 0 !important;
}

@media (max-width: 700px) {
    .tender-workspace-page .tender-workspace-head-compact {
        justify-content: flex-start !important;
    }

    .tender-workspace-page
    .tender-workspace-head-compact
    .tender-head-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }
}


/* Вкладки независимых расчётов конкурса */
.calculation-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.calculation-tabs-list {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 2px;
}

.calculation-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    max-width: 240px;
    flex: 0 0 auto;
    padding: 8px 15px;
    border: 1px solid #d7e0eb;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease;
}

.calculation-tab:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.calculation-tab.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

.calculation-tab-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    background: #ffffff;
    color: #2563eb;
    cursor: pointer;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

.calculation-tab-add:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.calculation-tab-add:disabled {
    cursor: wait;
    opacity: 0.55;
}

.calculation-tab-current {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
}

.calculation-tab-current strong {
    color: #0f172a;
}

@media (max-width: 900px) {
    .calculation-tabs-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .calculation-tab-current {
        white-space: normal;
    }
}


/* Редактирование названий вкладок расчёта */
.calculation-tab-wrap {
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
    border-radius: 10px;
}

.calculation-tab-wrap .calculation-tab {
    max-width: 240px;
}

.calculation-tab-wrap:has(.calculation-tab-rename)
.calculation-tab {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calculation-tab-rename {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-height: 38px;
    flex: 0 0 34px;
    margin-left: -1px;
    border: 1px solid #d7e0eb;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.calculation-tab-rename:hover {
    position: relative;
    z-index: 1;
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.calculation-tab-wrap.active
.calculation-tab-rename {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
}

.calculation-tab-rename:disabled {
    cursor: wait;
    opacity: 0.55;
}


/* Меню действий пользовательских вкладок расчёта */
.calculation-tab-wrap {
    position: relative;
    overflow: visible;
}

.calculation-tab-actions {
    position: static;
    display: inline-flex;
    align-items: stretch;
}

.calculation-tab-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    min-height: 38px;
    margin-left: -1px;
    padding: 0 0 5px;
    border: 1px solid #d7e0eb;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.calculation-tab-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    min-width: 168px;
    padding: 6px;
    flex-direction: column;
    gap: 2px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.calculation-tab-menu[hidden] {
    display: none;
}

.calculation-tab-menu-item {
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.calculation-tab-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.calculation-tab-delete {
    color: #dc2626;
}

.calculation-tab-delete:hover {
    background: #fef2f2;
    color: #b91c1c;
}


/* Единая типографика меню вкладок расчёта */
.calculation-tab-menu,
.calculation-tab-menu button,
.calculation-tab-menu-item,
.calculation-tab-menu-note {
    font-family: inherit;
    font-style: normal;
    letter-spacing: normal;
}

.calculation-tab-menu-note {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    color: #334155;
    font: inherit;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    letter-spacing: normal;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

/* История конкурса и версии спецификации */
.tender-history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 18px;
    align-items: start;
}

.tender-history-card,
.specification-versions-card {
    padding: 22px;
}

.tender-history-heading h2,
.specification-versions-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
}

.tender-history-heading p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

.tender-history-list {
    margin-top: 22px;
}

.tender-history-event {
    position: relative;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 22px;
}

.tender-history-event:not(:last-child)::before {
    position: absolute;
    top: 15px;
    bottom: 0;
    left: 7px;
    width: 2px;
    background: #e2e8f0;
    content: "";
}

.tender-history-marker {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: 3px;
    border: 3px solid #dbeafe;
    border-radius: 50%;
    background: #2563eb;
}

.tender-history-event-body {
    min-width: 0;
}

.tender-history-event-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.tender-history-event-head strong {
    color: #0f172a;
    font-size: 15px;
}

.tender-history-event-head time {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 12px;
}

.tender-history-event-body > p {
    margin: 6px 0 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.tender-history-meta {
    display: flex;
    margin-top: 9px;
    flex-wrap: wrap;
    gap: 6px;
}

.tender-history-meta span {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.specification-version-list {
    display: grid;
    margin-top: 18px;
    gap: 10px;
}

.specification-version-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.specification-version-number {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}

.specification-version-item strong {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.specification-version-item p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.tender-history-empty {
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 900px) {
    .tender-history-layout {
        grid-template-columns: 1fr;
    }

    .tender-history-event-head {
        flex-direction: column;
        gap: 4px;
    }
}

/* Внутренние вкладки и CRM-лента истории */
.history-center {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.history-subtabs {
    display: flex;
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
    gap: 24px;
    border: 0;
    border-bottom: 1px solid #d9e1e8;
    border-radius: 0;
    background: transparent;
}

.history-subtab {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    padding: 0 2px 12px;
    border: 0;
    border-radius: 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #7a8794;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
}

.history-subtab::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
    content: "";
}

.history-subtab:hover {
    color: #263746;
}

.history-subtab.active {
    background: transparent;
    color: #1f2f3d;
    box-shadow: none;
}

.history-subtab.active::after {
    background: #159570;
}

.history-subtab-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #e2e7eb;
    color: #52616e;
    font-size: 11px;
    font-weight: 700;
}

.history-subtab.active .history-subtab-count {
    background: #d8f1e8;
    color: #08765a;
}

.history-subpanel[hidden] {
    display: none;
}

.history-surface {
    overflow: visible;
    padding: 0;
    border: 1px solid #dfe5ea;
    border-radius: 4px;
    background: #f1f3f5;
    box-shadow: none;
}

.history-section-header {
    display: flex;
    min-height: 72px;
    padding: 17px 22px;
    border-bottom: 1px solid #dfe5ea;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.history-section-header h2 {
    margin: 0;
    color: #253746;
    font-size: 18px;
    font-weight: 600;
}

.history-section-header p {
    margin: 5px 0 0;
    color: #8b969f;
    font-size: 12px;
    line-height: 1.4;
}

.history-timeline {
    position: relative;
    padding: 18px 22px 30px 84px;
    background: #f1f3f5;
}

.history-timeline::before {
    position: absolute;
    top: 20px;
    bottom: 28px;
    left: 43px;
    width: 2px;
    background: #cfd6dc;
    content: "";
}

.history-day {
    position: relative;
}

.history-day + .history-day {
    margin-top: 22px;
}

.history-day-label {
    position: relative;
    display: block;
    height: 30px;
    margin: 0 0 10px;
}

.history-day-label::before {
    position: absolute;
    top: 14px;
    right: 0;
    left: 0;
    height: 1px;
    background: #d9dfe4;
    content: "";
}

.history-day-label::after {
    display: none;
}

.history-day-label span {
    position: absolute;
    top: 0;
    left: -65px;
    z-index: 2;
    display: inline-flex;
    min-width: 90px;
    height: 29px;
    padding: 0 12px;
    border: 1px solid #cfd7de;
    border-radius: 15px;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #65727e;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.history-day-events {
    position: relative;
    display: grid;
    padding: 0;
    gap: 9px;
}

.history-day-events::before {
    display: none;
}

.history-event-card {
    position: relative;
    min-height: 66px;
    padding: 13px 16px 13px 18px;
    border: 1px solid #dfe4e8;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.history-event-card::before {
    position: absolute;
    top: 25px;
    left: -40px;
    width: 38px;
    height: 1px;
    background: #cfd6dc;
    content: "";
}

.history-event-marker {
    position: absolute;
    top: 17px;
    left: -50px;
    z-index: 3;
    width: 19px;
    height: 19px;
    border: 4px solid #f1f3f5;
    border-radius: 50%;
    background: #56b9df;
    box-shadow: 0 0 0 1px #aebbc5;
}

.history-event-card:nth-child(3n + 2)
.history-event-marker {
    background: #70bd72;
}

.history-event-card:nth-child(3n)
.history-event-marker {
    background: #edb04b;
}

.history-event-top {
    display: flex;
    gap: 16px;
    align-items: baseline;
    justify-content: space-between;
}

.history-event-top strong {
    color: #354654;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.history-event-top time {
    flex: 0 0 auto;
    color: #9aa4ac;
    font-size: 11px;
    font-weight: 400;
}

.history-event-description {
    margin: 5px 0 0;
    color: #66737e;
    font-size: 12px;
    line-height: 1.45;
}

.history-event-meta {
    display: flex;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.history-event-meta span {
    padding: 3px 7px;
    border: 0;
    border-radius: 2px;
    background: #edf0f2;
    color: #6f7b85;
    font-size: 10px;
    font-weight: 500;
}

.history-event-meta .history-version-tag {
    border: 0;
    background: #e5f3ed;
    color: #268065;
}

.specification-history-list {
    display: grid;
    padding: 18px 22px 28px;
    gap: 9px;
    background: #f1f3f5;
}

.specification-history-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 14px;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid #dfe4e8;
    border-radius: 3px;
    align-items: center;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.specification-history-version {
    display: flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e4f2ed;
    color: #168064;
}

.specification-history-version span {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.specification-history-version strong {
    margin-top: 0;
    font-size: 17px;
    font-weight: 700;
}

.specification-history-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
}

.specification-history-top strong {
    color: #354654;
    font-size: 13px;
    font-weight: 600;
}

.specification-history-top p {
    margin: 4px 0 0;
    color: #8b969f;
    font-size: 11px;
}

.specification-history-status {
    padding: 3px 7px;
    border-radius: 2px;
    background: #e5f3ed;
    color: #268065;
    font-size: 10px;
    font-weight: 600;
}

.specification-history-meta {
    display: flex;
    margin-top: 7px;
    flex-wrap: wrap;
    gap: 7px;
}

.specification-history-meta span {
    color: #7b8791;
    font-size: 11px;
}

.specification-history-meta span + span::before {
    margin-right: 7px;
    color: #b8c0c7;
    content: "•";
}

.specification-history-actions {
    display: flex;
    justify-content: flex-end;
}

.specification-download-button {
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 3px;
    font-size: 11px;
}

.specification-download-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.history-empty-state {
    padding: 50px 24px;
    color: #8b969f;
    text-align: center;
}

.history-empty-icon {
    display: flex;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border: 1px solid #d8dfe4;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #7d8a94;
    font-size: 19px;
}

.history-empty-state strong {
    display: block;
    color: #52616e;
    font-size: 13px;
    font-weight: 600;
}

.history-empty-state p {
    margin: 5px auto 0;
    max-width: 420px;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .history-subtabs {
        gap: 16px;
    }

    .history-subtab {
        flex: initial;
        padding-right: 2px;
        padding-left: 2px;
    }

    .history-section-header {
        padding-right: 16px;
        padding-left: 16px;
    }

    .history-timeline {
        padding-right: 12px;
        padding-left: 58px;
    }

    .history-timeline::before {
        left: 28px;
    }

    .history-day-label span {
        left: -49px;
        min-width: 76px;
        padding: 0 8px;
        font-size: 10px;
    }

    .history-event-card::before {
        left: -26px;
        width: 24px;
    }

    .history-event-marker {
        left: -36px;
    }

    .history-event-top {
        flex-direction: column;
        gap: 3px;
    }

    .specification-history-list {
        padding-right: 12px;
        padding-left: 12px;
    }

    .specification-history-card {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .specification-history-version {
        width: 42px;
        height: 42px;
    }

    .specification-history-actions {
        grid-column: 1 / -1;
    }

    .specification-history-actions .btn {
        width: 100%;
    }

    .specification-history-top {
        flex-direction: column;
        gap: 5px;
    }
}

/* Компактные действия внутри верхней пагинации */
.tender-workspace-page
#calculationPagination
.calculation-pagination-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    white-space: nowrap;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .table-control {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    margin: 0;
    font-size: 10px;
    line-height: 1;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .table-control-input {
    width: 82px;
    min-width: 82px;
    height: 28px;
    min-height: 28px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .excel-menu-toggle {
    height: 28px;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 6px;
    font-size: 11px;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions #saveCalculation {
    width: 32px !important;
    min-width: 32px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions
.save-calculation-icon {
    width: 15px;
    height: 15px;
}

/* Финальное выравнивание верхней панели в одну строку */
.tender-workspace-page .calculation-card > .calculation-toolbar {
    display: none !important;
}

.tender-workspace-page #calculationPagination {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 42px !important;
    height: auto !important;
    padding: 5px 14px !important;
    gap: 5px !important;
    overflow: visible !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    gap: 5px !important;
    margin-left: auto !important;
    width: auto !important;
    min-width: 0 !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .table-control {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .table-control > span {
    display: inline !important;
    width: auto !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .table-control-input {
    display: inline-block !important;
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 2px 5px !important;
    font-size: 11px !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .excel-menu {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions .excel-menu-toggle {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 66px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 8px !important;
}

.tender-workspace-page
#calculationPagination
.calculation-pagination-actions #saveCalculation {
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
}

/* На узких экранах разрешаем горизонтальную прокрутку вместо переноса */
@media (max-width: 1450px) {
    .tender-workspace-page #calculationPagination {
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    .tender-workspace-page
    #calculationPagination
    .calculation-pagination-actions {
        margin-left: 6px !important;
    }
}

/* Compact contest funnel on large screens */
@media (min-width: 1280px) {
    .content:has(.dashboard-page) {
        width: 100%;
        max-width: none;
        padding: 18px 20px;
    }

    .dashboard-page {
        gap: 12px;
    }

    .funnel-pagehead {
        gap: 18px;
        padding: 16px 18px;
        border-radius: 12px;
    }

    .funnel-pagehead h1 {
        margin-bottom: 4px;
        font-size: 26px;
        line-height: 1.15;
    }

    .funnel-pagehead p {
        font-size: 13px;
    }

    .dashboard-kpis {
        gap: 10px;
    }

    .dashboard-kpi {
        min-height: 96px;
        padding: 14px 16px;
    }

    .dashboard-kpi span,
    .dashboard-kpi small {
        font-size: 12px;
    }

    .dashboard-kpi strong {
        margin: 6px 0 3px;
        font-size: 24px;
    }

    .funnel-toolbar {
        gap: 10px;
        padding: 9px;
    }

    .funnel-search input {
        min-height: 36px;
        padding: 7px 11px;
        font-size: 13px;
    }

    .funnel-board {
        gap: 10px;
        padding-bottom: 10px;
    }

    .funnel-column {
        flex-basis: 242px;
        min-width: 242px;
        border-radius: 10px;
    }

    .funnel-column-head {
        min-height: 70px;
        padding: 10px;
    }

    .funnel-column-body {
        gap: 8px;
        min-height: 310px;
        max-height: calc(100vh - 330px);
        padding: 8px;
    }

    .tender-card {
        padding: 10px;
    }
}

/* Extra compact contest funnel */
@media (min-width: 1280px) {
    .content:has(.dashboard-page) {
        padding: 12px 14px;
    }

    .dashboard-page {
        gap: 9px;
    }

    .funnel-pagehead {
        gap: 14px;
        padding: 12px 14px;
    }

    .funnel-pagehead h1 {
        margin-bottom: 2px;
        font-size: 22px;
    }

    .funnel-pagehead p {
        font-size: 11px;
    }

    .dashboard-kpis {
        gap: 8px;
    }

    .dashboard-kpi {
        min-height: 78px;
        padding: 10px 13px;
    }

    .dashboard-kpi span,
    .dashboard-kpi small {
        font-size: 10px;
    }

    .dashboard-kpi strong {
        margin: 4px 0 2px;
        font-size: 20px;
    }

    .funnel-toolbar {
        gap: 8px;
        padding: 7px;
    }

    .funnel-search input {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 11px;
    }

    .funnel-toolbar .btn {
        min-height: 32px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .funnel-pagehead .btn {
        min-height: 34px;
        padding: 7px 11px;
        font-size: 12px;
    }

    .funnel-board {
        gap: 7px;
        padding-bottom: 8px;
    }

    .funnel-column {
        flex-basis: 214px;
        min-width: 214px;
    }

    .funnel-column-head {
        min-height: 60px;
        gap: 4px 7px;
        padding: 8px;
    }

    .funnel-stage-title {
        gap: 6px;
    }

    .funnel-stage-title h2 {
        font-size: 12px;
    }

    .funnel-count {
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        font-size: 10px;
    }

    .funnel-stage-total {
        font-size: 10px;
    }

    .funnel-column-body {
        gap: 6px;
        min-height: 270px;
        max-height: calc(100vh - 285px);
        padding: 6px;
    }

    .tender-card {
        padding: 8px;
    }

    .tender-card h3 {
        margin: 7px 0 5px;
        font-size: 11px;
    }

    .tender-customer,
    .tender-card-top,
    .funnel-empty {
        font-size: 9px;
    }

    .tender-card-bottom strong {
        font-size: 11px;
    }

    .tender-owner {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
        font-size: 9px;
    }
}

/* Нижние действия воронки во время перетаскивания */
.funnel-drop-actions {
    position: fixed;
    z-index: 1200;
    right: 24px;
    bottom: 24px;
    left: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(24px);
    transition:
        opacity 160ms ease,
        transform 160ms ease,
        visibility 160ms ease;
}

.funnel-drop-actions.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.funnel-drop-action {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 18px 24px;
    color: #ffffff;
    border: 2px dashed rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(12px);
    cursor: grabbing;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        border-color 140ms ease,
        filter 140ms ease;
}

.funnel-drop-action-archive {
    background: rgba(71, 85, 105, 0.95);
}

.funnel-drop-action-won {
    background: rgba(22, 163, 74, 0.95);
}

.funnel-drop-action.is-drag-over {
    transform: translateY(-6px) scale(1.015);
    border-color: #ffffff;
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.38);
    filter: brightness(1.08);
}

.funnel-drop-action-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 26px;
    font-weight: 800;
}

.funnel-drop-action strong,
.funnel-drop-action small {
    display: block;
}

.funnel-drop-action strong {
    font-size: 18px;
    line-height: 1.25;
}

.funnel-drop-action small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

@media (max-width: 760px) {
    .funnel-drop-actions {
        right: 12px;
        bottom: 12px;
        left: 12px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .funnel-drop-action {
        min-height: 70px;
        padding: 12px 16px;
    }

    .funnel-drop-action-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 22px;
    }
}

/* Управление окном формы создания конкурса */
.tender-create-window-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin-left: 18px;
}

.tender-create-window-button {
    width: 38px;
    min-width: 38px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    color: #334155;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.tender-create-window-button:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.tender-create-close-button:hover {
    color: #ffffff;
    border-color: #dc2626;
    background: #dc2626;
}

.tender-create-window-maximized {
    position: fixed;
    z-index: 1500;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    margin: 0;
    padding: 20px 24px 32px;
    overflow: auto;
    background: #f4f7fb;
}

.tender-create-window-maximized .form-page-head {
    position: sticky;
    z-index: 3;
    top: -20px;
    padding-top: 20px;
    padding-bottom: 14px;
    background: #f4f7fb;
}

body.tender-create-maximized-lock {
    overflow: hidden;
}

@media (max-width: 760px) {
    .tender-create-window .form-page-head {
        align-items: flex-start;
        gap: 12px;
    }

    .tender-create-window-actions {
        gap: 4px;
        margin-left: 8px;
    }

    .tender-create-window-button {
        width: 34px;
        min-width: 34px;
        height: 32px;
        min-height: 32px;
    }

    .tender-create-window-maximized {
        padding: 12px;
    }
}


/* Положение кнопок окна у верхней границы рабочей области */
.tender-create-window {
    position: relative;
}

.tender-create-window .tender-create-window-actions {
    position: absolute;
    z-index: 20;
    top: -1px;
    right: 0;
    margin: 0;
    transform: translateY(-100%);
}

.tender-create-window-maximized
.tender-create-window-actions {
    position: fixed;
    top: 12px;
    right: 18px;
    transform: none;
}

@media (max-width: 760px) {
    .tender-create-window .tender-create-window-actions {
        right: 0;
    }
}

/* Прозрачные кнопки управления окном создания конкурса */
.tender-create-window .tender-create-window-button {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.tender-create-window .tender-create-window-button:hover,
.tender-create-window .tender-create-window-button:focus-visible {
    color: #0f172a;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.tender-create-window .tender-create-close-button:hover,
.tender-create-window .tender-create-close-button:focus-visible {
    color: #dc2626 !important;
    background: transparent !important;
    border-color: transparent !important;
}

/*
 * Исправление развёрнутого режима формы конкурса:
 * не перекрываем шапку и сохраняем кнопки на прежнем месте.
 */
.tender-create-window.tender-create-window-maximized {
    position: relative !important;
    z-index: auto !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
}

.tender-create-window-maximized .form-page-head {
    position: static !important;
    top: auto !important;
    padding-top: 0 !important;
    padding-bottom: 10px !important;
    background: transparent !important;
}

.tender-create-window-maximized
.tender-create-window-actions {
    position: absolute !important;
    z-index: 20 !important;
    top: -1px !important;
    right: 0 !important;
    margin: 0 !important;
    transform: translateY(-100%) !important;
}

/* В развёрнутом режиме уплотняем форму */
.tender-create-window-maximized {
    font-size: 13px;
}

.tender-create-window-maximized .eyebrow {
    margin-bottom: 2px;
}

.tender-create-window-maximized .form-page-head h1 {
    margin: 0;
    font-size: clamp(30px, 3vw, 46px);
    line-height: 1;
}

.tender-create-window-maximized
.form-page-head p {
    margin: 5px 0 0;
    line-height: 1.25;
}

.tender-create-window-maximized
.tender-form {
    padding: 20px 28px !important;
}

.tender-create-window-maximized
.form-grid {
    gap: 10px 22px !important;
}

.tender-create-window-maximized
.form-field {
    gap: 4px !important;
}

.tender-create-window-maximized
.form-field label {
    margin: 0 !important;
    line-height: 1.15 !important;
}

.tender-create-window-maximized
.form-field input,
.tender-create-window-maximized
.form-field select {
    min-height: 42px !important;
    height: 42px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}

.tender-create-window-maximized
.form-field textarea {
    min-height: 70px !important;
    height: 70px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.tender-create-window-maximized
.form-actions {
    margin-top: 12px !important;
}

body.tender-create-maximized-lock {
    overflow: auto !important;
}

/* Исправление меню Excel: три пункта поверх панели расчёта */
.tender-workspace-page
#calculationPagination
.excel-menu {
    position: relative !important;
    z-index: 10000 !important;
    overflow: visible !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu > summary {
    list-style: none !important;
    cursor: pointer !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu > summary::-webkit-details-marker {
    display: none !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu-list {
    position: absolute !important;
    right: 0 !important;
    bottom: calc(100% + 7px) !important;
    left: auto !important;
    z-index: 2147482000 !important;

    display: none !important;
    box-sizing: border-box !important;
    width: max-content !important;
    min-width: 190px !important;
    margin: 0 !important;
    padding: 6px !important;

    overflow: visible !important;
    border: 1px solid #d7e0e7 !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.2) !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu[open]
> .excel-menu-list {
    display: block !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu-item {
    display: flex !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 176px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 7px 11px !important;

    align-items: center !important;
    justify-content: flex-start !important;

    border: 0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #253746 !important;
    cursor: pointer !important;

    font: inherit !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu-item + .excel-menu-item {
    margin-top: 2px !important;
}

.tender-workspace-page
#calculationPagination
.excel-menu-item:hover,
.tender-workspace-page
#calculationPagination
.excel-menu-item:focus {
    background: #edf8f4 !important;
    color: #08765a !important;
    outline: none !important;
}

/*
 * Панель не должна обрезать меню.
 * Если элементы не помещаются, прокручивается вся страница,
 * а не внутренняя полоса управления.
 */
@media (max-width: 1450px) {
    .tender-workspace-page
    #calculationPagination {
        overflow: visible !important;
    }
}

/*
 * Убираем кратковременное появление горизонтальной прокрутки
 * при открытии Excel-меню. До переноса в body список скрыт.
 */
.tender-workspace-page
#calculationPagination
.excel-menu[open]
> .excel-menu-list:not(.excel-menu-list-portal) {
    display: none !important;
}

body > .excel-menu-list.excel-menu-list-portal {
    display: block !important;
}

/* Меню многоточия вкладки, перенесённое в body */
body > .calculation-tab-menu.calculation-tab-menu-portal {
    position: fixed !important;
    z-index: 2147483000 !important;
    display: flex !important;
    box-sizing: border-box !important;
    width: max-content !important;
    min-width: 215px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 16px) !important;
    margin: 0 !important;
    padding: 3px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    flex-direction: column !important;
    gap: 1px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    opacity: 1 !important;
    box-shadow:
        0 12px 28px rgba(15, 23, 42, .20),
        0 3px 8px rgba(15, 23, 42, .10) !important;
    pointer-events: auto !important;
}

body > .calculation-tab-menu.calculation-tab-menu-portal[hidden] {
    display: none !important;
}

body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-menu-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 207px !important;
    min-height: 27px !important;
    height: 27px !important;
    margin: 0 !important;
    padding: 3px 10px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #334155 !important;
    cursor: pointer !important;
    font: inherit !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    text-align: left !important;
    white-space: nowrap !important;
}

body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-menu-item:hover,
body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-menu-item:focus {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    outline: none !important;
}

body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-delete {
    color: #c62828 !important;
}

body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-delete:hover,
body > .calculation-tab-menu.calculation-tab-menu-portal
> .calculation-tab-delete:focus {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

/* Портальное меню находится непосредственно в body */
html body > .calculation-tab-menu.calculation-tab-menu-portal {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
}

/* User profile and account menu */
.user-menu-dropdown {
    position: relative;
}

.user-menu-dropdown > summary {
    list-style: none;
}

.user-menu-dropdown > summary::-webkit-details-marker {
    display: none;
}

.user-menu-trigger {
    display: flex;
    min-width: 220px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid #dce5e2;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.profile-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #28a77a, #117653);
    font-size: 14px;
    font-weight: 850;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-copy {
    min-width: 0;
    flex: 1;
}

.user-menu-copy strong,
.user-menu-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-copy strong {
    color: #172f35;
    font-size: 13px;
}

.user-menu-copy small {
    margin-top: 2px;
    font-size: 10px;
}

.user-menu-panel {
    position: absolute;
    z-index: 2000;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: 230px;
    padding: 6px;
    border: 1px solid #dce5e2;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .18);
}

.user-menu-panel a,
.user-menu-panel button {
    display: block;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 7px;
    color: #334155;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
    color: #08765a;
    background: #edf8f4;
}

.profile-page {
    display: grid;
    max-width: 920px;
    margin: 0 auto;
    gap: 18px;
}

.profile-heading h1 {
    margin: 5px 0 7px;
    color: #172f35;
    font-size: clamp(28px, 4vw, 42px);
}

.profile-heading p:last-child {
    margin: 0;
    color: #71817d;
}

.profile-card {
    overflow: hidden;
    border: 1px solid #dce6e2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(18, 43, 50, .07);
}

.profile-photo-section {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 22px;
    padding: 24px;
    border-bottom: 1px solid #e3ebe8;
    align-items: center;
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    font-size: 32px;
}

.profile-photo-section label {
    display: block;
    margin-bottom: 8px;
    color: #263f45;
    font-size: 13px;
    font-weight: 750;
}

.profile-photo-section small,
.profile-field small {
    display: block;
    margin-top: 6px;
    color: #788984;
    font-size: 11px;
}

.profile-remove-avatar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-weight: 600 !important;
}

.profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 24px;
}

.profile-field {
    display: grid;
    align-content: start;
    gap: 7px;
}

.profile-field label {
    color: #263f45;
    font-size: 13px;
    font-weight: 750;
}

.profile-input {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cfdbd7;
    border-radius: 9px;
    color: #172f35;
    background: #fff;
    outline: none;
}

.profile-input:focus {
    border-color: #3ca27f;
    box-shadow: 0 0 0 3px rgba(23, 143, 103, .12);
}

.profile-input:disabled {
    color: #71817d;
    background: #f3f6f5;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    padding: 18px 24px;
    border-top: 1px solid #e3ebe8;
    background: #fbfcfc;
}

@media (max-width: 720px) {
    .user-menu-trigger {
        min-width: 0;
    }

    .user-menu-copy {
        display: none;
    }

    .profile-photo-section,
    .profile-fields {
        grid-template-columns: 1fr;
    }
}

