body {
    font-size: 14px;
}

.card {
    border-radius: 16px;
}

.table td, .table th {
    vertical-align: middle;
}

.rfq-quote-matrix {
    min-width: 1100px;
}

.rfq-quote-line-col {
    left: 0;
    min-width: 260px;
    position: sticky;
    width: 260px;
    z-index: 2;
}

.rfq-quote-matrix thead .rfq-quote-line-col {
    z-index: 3;
}

.rfq-quote-supplier-col {
    min-width: 250px;
    width: 250px;
}

.rfq-quote-sections {
    display: grid;
    gap: 14px;
}

.rfq-quote-line-section {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
}

.rfq-quote-line-section--selected {
    border-color: var(--bs-success);
}

.rfq-quote-line-section--selected .rfq-quote-line-header {
    background: var(--bs-success-bg-subtle);
}

.rfq-quote-line-header {
    align-items: flex-start;
    background: #f8f9fa;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 16px;
}

.rfq-quote-selected-summary {
    color: var(--bs-secondary-color);
    flex: 0 0 auto;
    font-size: 13px;
    max-width: 320px;
    text-align: right;
}

.rfq-quote-card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    padding: 14px 16px 16px;
}

.rfq-quote-card {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.rfq-quote-card-head {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.rfq-quote-supplier-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rfq-quote-role-badge {
    flex: 0 0 auto;
}

.rfq-quote-new-badge {
    font-size: 10px;
    letter-spacing: 0.01em;
}

.rfq-quote-meta-row {
    align-items: center;
    color: var(--bs-secondary-color);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 6px;
}

.rfq-quote-meta-row > span + span::before {
    color: var(--bs-secondary-color);
    content: "·";
    margin-right: 6px;
}

.rfq-quote-meta-status--ok {
    color: var(--bs-success);
}

.rfq-quote-meta-status--danger {
    color: var(--bs-danger);
    font-weight: 600;
}

.rfq-quote-meta-status--history {
    color: var(--bs-secondary-color);
}

.rfq-quote-card--selected {
    background: var(--bs-success-bg-subtle);
    border-color: var(--bs-success);
}

.rfq-quote-card--attention {
    background: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning);
}

.rfq-quote-card--new {
    background: #e7f8ff;
    border-color: #0dcaf0;
    box-shadow: inset 0 0 0 1px rgba(13, 202, 240, 0.2);
}

@media (max-width: 768px) {
    .rfq-quote-line-header {
        display: block;
    }

    .rfq-quote-selected-summary {
        margin-top: 8px;
        max-width: none;
        text-align: left;
    }
}

.table > tbody > tr.rfq-row-offer-created > * {
    background-color: #dbeafe;
}

.table > tbody > tr.rfq-row-offer-created > *:first-child {
    box-shadow: inset 4px 0 0 #2563eb;
}

.table > tbody > tr.rfq-row-new-prices > * {
    background-color: #ffb86b;
}

.table > tbody > tr.rfq-row-new-prices > *:first-child {
    box-shadow: inset 4px 0 0 #ea580c;
}

.table > tbody > tr.rfq-row-has-answers > * {
    background-color: #fff3cd;
}

.table > tbody > tr.rfq-row-has-answers > *:first-child {
    box-shadow: inset 4px 0 0 #ffc107;
}

.table > tbody > tr.rfq-row-ready-offer > * {
    background-color: #d1e7dd;
}

.table > tbody > tr.rfq-row-ready-offer > *:first-child {
    box-shadow: inset 4px 0 0 #198754;
}

.table > tbody > tr.rfq-row-invoice > * {
    background-color: #d1e7dd;
}

.table > tbody > tr.rfq-row-invoice > *:first-child {
    box-shadow: inset 4px 0 0 #198754;
}

.table > tbody > tr.rfq-row-in-work > * {
    background-color: #cff4fc;
}

.table > tbody > tr.rfq-row-in-work > *:first-child {
    box-shadow: inset 4px 0 0 #0dcaf0;
}

.table > tbody > tr.rfq-row-overdue > * {
    background-color: #f8d7da;
}

.table > tbody > tr.rfq-row-overdue > *:first-child {
    box-shadow: inset 4px 0 0 #dc3545;
}

.rfq-color-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.rfq-color-legend__item {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}

.rfq-color-legend__swatch {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    display: inline-block;
    height: 14px;
    width: 24px;
}

.rfq-color-legend__swatch--plain {
    background: #fff;
}

.rfq-color-legend__swatch--warning {
    background: var(--bs-warning-bg-subtle, #fff3cd);
}

.rfq-color-legend__swatch--success {
    background: var(--bs-success-bg-subtle, #d1e7dd);
}

.rfq-color-legend__swatch--danger {
    background: var(--bs-danger-bg-subtle, #f8d7da);
}

.rfq-color-legend__swatch--info {
    background: var(--bs-info-bg-subtle, #cff4fc);
}

.rfq-color-legend__swatch--offer {
    background: #dbeafe;
}

.rfq-color-legend__swatch--new-prices {
    background: #ffb86b;
}

.priority-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.priority-filter-chip {
    align-items: center;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    color: var(--bs-body-color);
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
    line-height: 1.2;
    min-height: 32px;
    padding: 6px 10px;
}

.priority-filter-chip.is-active {
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.22);
    font-weight: 600;
}

.priority-filter-chip--info {
    background: var(--bs-info-bg-subtle, #cff4fc);
    border-color: var(--bs-info-border-subtle, #9eeaf9);
}

.priority-filter-chip--warning {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    border-color: var(--bs-warning-border-subtle, #ffecb5);
}

.priority-filter-chip--danger {
    background: var(--bs-danger-bg-subtle, #f8d7da);
    border-color: var(--bs-danger-border-subtle, #f1aeb5);
}

.priority-filter-chip--success {
    background: var(--bs-success-bg-subtle, #d1e7dd);
    border-color: var(--bs-success-border-subtle, #a3cfbb);
}

.priority-filter-chip--rework {
    background: #fff0dd;
    border-color: #ffb86b;
}

.rfq-dashboard-sales-comment,
.rfq-line-sales-comment {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    border: 1px solid var(--bs-warning-border-subtle, #ffecb5);
    border-radius: 8px;
    color: var(--bs-body-color);
    font-size: 13px;
    line-height: 1.35;
    padding: 8px 10px;
}

.rfq-line-sales-comment {
    display: inline-block;
    max-width: 100%;
}

.anchor-section,
[id^="bucket-"],
[id^="line-"] {
    scroll-margin-top: 90px;
}

.help-layout {
    align-items: flex-start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.help-entry-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.help-entry-card {
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
    border: 1px solid #d6e7ff;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 190px;
    padding: 20px;
}

.help-entry-card__title {
    color: #102a43;
    font-size: 1.25rem;
    font-weight: 700;
}

.help-entry-card p {
    color: #52606d;
    flex: 1;
    margin: 0;
}

.help-toc {
    position: sticky;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    top: 82px;
}

.help-toc-details {
    display: block;
}

.help-toc-summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    margin-bottom: 8px;
}

.help-toc-summary::-webkit-details-marker {
    display: none;
}

.help-toc-group {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 14px 0 4px;
}

.help-toc-group:first-child {
    margin-top: 0;
}

.help-toc .nav-link {
    border-radius: 8px;
    color: var(--bs-body-color);
    line-height: 1.25;
}

.help-toc .nav-link:hover,
.help-toc .nav-link.is-active {
    background: var(--bs-light);
    color: var(--bs-primary);
}

.help-toc .nav-link.is-active {
    box-shadow: inset 3px 0 0 var(--bs-primary);
    font-weight: 700;
}

.help-toc-link--level-1 {
    font-size: 0.98rem;
    margin-top: 2px;
}

.help-toc-link--level-2 {
    font-size: 0.9rem;
}

.help-role-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.help-content {
    scroll-margin-top: 90px;
}

.help-content h1 {
    color: #102a43;
    font-size: clamp(2rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.help-content h2,
.help-content h3,
.help-content h4 {
    scroll-margin-top: 96px;
}

.help-content h2 {
    border-top: 1px solid var(--bs-border-color);
    color: #172b4d;
    font-size: clamp(1.5rem, 2.2vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.01em;
    margin-top: 34px;
    padding-top: 28px;
}

.help-content h2:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.help-content h3 {
    color: #44546a;
    font-size: 1.08rem;
    font-weight: 650;
    margin-bottom: 8px;
    margin-top: 18px;
}

.help-content p,
.help-content li {
    line-height: 1.55;
}

@media (max-width: 991.98px) {
    .help-entry-grid {
        grid-template-columns: 1fr;
    }

    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-toc {
        max-height: min(55vh, 420px);
        overflow-y: auto;
        position: static;
    }

    .help-toc-details:not([open]) {
        max-height: 46px;
        overflow: hidden;
    }
}
