:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #1d4ed8;
    --primary-soft: #eff6ff;
    --ok: #15803d;
    --bad: #b42318;
    --eval: #7e22ce;
    --warning-bg: #fff7ed;
    --warning-border: #fed7aa;
    --error-bg: #fef3f2;
    --error-border: #fecdca;
    --error-text: #b42318;
    --shadow: 0 18px 40px rgba(16, 24, 40, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, .10), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 14px rgba(16, 24, 40, .05);
}

.brand-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 13px 18px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

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

.brand-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: #344054;
}

.page-wrap {
    max-width: 1120px;
    margin: 18px auto;
    padding: 0 14px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 360px;
    gap: 16px;
    align-items: start;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.center-card {
    max-width: 760px;
    margin: 0 auto;
}

.card-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.document-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.soft-head {
    background: #fff;
}

.eyebrow {
    margin: 0 0 7px;
    font-size: 12px;
    line-height: 16px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary);
    font-weight: 800;
}

.card-head h1 {
    margin: 0 0 7px;
    font-size: 26px;
    line-height: 32px;
    color: #101828;
}

.decision-card {
    position: sticky;
    top: 18px;
}

.decision-card .card-head h1 {
    font-size: 23px;
    line-height: 29px;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 21px;
}

.card-body {
    padding: 18px 20px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

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

.summary-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fcfcfd;
}

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

.summary-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    margin-bottom: 5px;
}

.summary-item strong {
    display: block;
    font-size: 14px;
    line-height: 20px;
    color: var(--text);
    word-break: break-word;
}

.data-grid {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px 14px;
}

.data-grid dt {
    color: var(--muted);
    font-size: 13px;
}

.data-grid dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 20px 0 10px;
}

.section-heading h2,
.section-title {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 800;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 19px;
}

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

.attachments-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
}

.attachments-table th,
.attachments-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.attachments-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
}

.attachments-table tr:last-child td {
    border-bottom: 0;
}

.attachments-list {
    display: grid;
    gap: 8px;
}

.attachment-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}


.attachment-card.active {
    border-color: rgba(29, 78, 216, .35);
    background: #f8fbff;
}

.attachment-icon {
    min-width: 42px;
    height: 42px;
    padding: 0 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 900;
}

.attachment-info {
    min-width: 0;
}

.attachment-info strong {
    display: block;
    font-size: 14px;
    line-height: 20px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.link-button {
    border: 0;
    background: var(--primary);
    color: #ffffff;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.link-button:hover,
.action-button:hover,
.download-link:hover {
    filter: brightness(.97);
}

.link-button:disabled,
.action-button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.viewer {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.viewer.is-hidden {
    display: none;
}

.viewer-bar {
    padding: 10px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.viewer-bar strong {
    color: var(--text);
}

.viewer-content {
    min-height: 220px;
    padding: 12px;
}

.viewer-content iframe {
    width: 100%;
    min-height: 460px;
    border: 0;
    display: block;
    border-radius: 12px;
}

.viewer-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
}

.empty-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-linear-gradient(0deg, #f9fafb, #f9fafb 1px, #ffffff 1px, #ffffff 34px);
}

.empty-file-state {
    text-align: center;
    color: var(--muted);
    padding: 22px;
}

.empty-file-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f2f4f7;
    font-size: 28px;
    margin-bottom: 12px;
}

.empty-file-state strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 22px;
}

.empty-file-state p {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 19px;
}


.loading-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.loading-file-state {
    text-align: center;
    color: var(--muted);
    padding: 22px;
}

.loading-file-state strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 22px;
}

.loading-file-state p {
    margin: 5px 0 0;
    font-size: 13px;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.compact-file-state {
    padding: 18px 10px;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.file-actions .download-link {
    margin-top: 0;
    margin-right: 0;
}

.fake-title {
    width: 70%;
    height: 22px;
    background: #d1d5db;
    border-radius: 5px;
    margin-bottom: 22px;
}

.fake-line {
    height: 12px;
    background: #e5e7eb;
    border-radius: 5px;
    margin-bottom: 12px;
}

.w1 { width: 94%; }
.w2 { width: 82%; }
.w3 { width: 64%; }

.alert {
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 13px;
    line-height: 19px;
    margin-bottom: 16px;
}

.friendly-alert {
    font-size: 14px;
    line-height: 20px;
}

.alert-warning {
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: #9a3412;
}

.alert-error {
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
}

.field-label {
    display: block;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    min-height: 90px;
    margin: 0 0 12px;
    padding: 12px 13px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 20px;
}

textarea:focus {
    outline: 3px solid rgba(29, 78, 216, .13);
    border-color: var(--primary);
}

.actions {
    display: grid;
    gap: 9px;
}

.action-button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 10px 12px;
    color: #fff;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 10px 20px rgba(16, 24, 40, .08);
}

.action-button span {
    display: block;
    font-size: 16px;
    line-height: 21px;
    font-weight: 900;
}

.action-button small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 17px;
    font-weight: 600;
    opacity: .92;
}

.accept { background: var(--ok); }
.reject { background: var(--bad); }
.evaluation { background: var(--eval); }

.result-box {
    display: none;
    margin-top: 15px;
    padding: 13px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 20px;
}

.result-box.ok {
    display: block;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.result-box.error {
    display: block;
    border: 1px solid var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
}

.small-text,
.muted {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.user-help {
    border-top: 1px solid var(--border);
    padding-top: 13px;
}

.download-link {
    display: inline-block;
    margin-top: 10px;
    margin-right: 6px;
    padding: 9px 11px;
    border-radius: 10px;
    text-decoration: none;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}

.home-container {
    min-height: calc(100vh - 112px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-card {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 38px;
    box-shadow: var(--shadow);
    text-align: center;
}

.home-logo {
    width: 150px;
    height: auto;
    margin-bottom: 18px;
}

.home-brand {
    display: inline-block;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

.home-card h1 {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 36px;
    color: #101828;
}

.home-card p {
    margin: 0 0 18px;
    color: #475467;
    font-size: 15px;
    line-height: 23px;
}

.home-alert {
    margin: 22px 0;
    padding: 15px 16px;
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: #9a3412;
    border-radius: 14px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
}

.home-small {
    font-size: 12px !important;
    line-height: 18px !important;
    color: var(--muted) !important;
    margin-bottom: 0 !important;
}

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

    .decision-card {
        position: static;
    }
}

@media (max-width: 680px) {
    .brand-shell {
        padding: 11px 14px;
    }

    .brand-logo {
        width: 98px;
    }

    .brand-divider {
        height: 26px;
    }

    .brand-title {
        font-size: 14px;
    }

    .page-wrap {
        margin: 10px auto;
        padding: 0 8px;
    }

    .document-head {
        display: block;
    }

    .status-pill {
        margin-top: 14px;
    }

    .card-head,
    .card-body {
        padding: 14px;
    }

    .card-head h1 {
        font-size: 22px;
        line-height: 27px;
    }

    .subtitle,
    .section-heading p {
        font-size: 12px;
        line-height: 18px;
    }

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

    .summary-item.wide {
        grid-column: span 1;
    }

    .attachment-card {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 9px;
    }

    .attachment-card .link-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .viewer-content {
        min-height: 180px;
        padding: 10px;
    }

    .viewer-content iframe {
        min-height: 340px;
    }

    .file-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .download-link {
        width: 100%;
        text-align: center;
    }

    .home-card {
        padding: 28px 22px;
    }
}


.closed-decision-card {
    background: #ffffff;
}

.closed-state {
    text-align: center;
    padding: 28px 22px;
}

.closed-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #ecfdf3;
    color: #15803d;
    font-size: 30px;
    font-weight: 900;
}

.closed-state h1 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 28px;
}

.closed-state p {
    margin: 0 0 10px;
    color: #475467;
    font-size: 14px;
    line-height: 21px;
}

.closed-note {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.result-page {
    min-height: calc(100vh - 118px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.result-page .card {
    background: #ffffff;
}


.result-card-final {
    width: 100%;
    max-width: 620px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 10px 26px rgba(16, 24, 40, .06);
}

.result-card-final.success {
    border-color: #86efac;
}

.result-card-final.danger {
    border-color: #fca5a5;
}

.result-card-final.evaluation {
    border-color: #d8b4fe;
}

.result-icon-final {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid currentColor;
    background: #ffffff;
    font-size: 28px;
    font-weight: 900;
}

.result-card-final.success .result-icon-final {
    color: #15803d;
}

.result-card-final.danger .result-icon-final {
    color: #b42318;
}

.result-card-final.evaluation .result-icon-final {
    color: #7e22ce;
}

.result-card-final h1 {
    margin: 0 0 10px;
    font-size: 26px;
    line-height: 32px;
    color: #101828;
}

.result-card-final p {
    margin: 0;
    color: #475467;
    font-size: 15px;
    line-height: 23px;
}

.result-actions-final {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.primary-link,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
}

.primary-link {
    background: var(--primary);
    color: #ffffff;
}

.secondary-link {
    background: var(--primary-soft);
    color: var(--primary);
}

.result-note-final {
    margin-top: 20px !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    line-height: 18px !important;
}

@media (max-width: 680px) {
    .result-page {
        align-items: flex-start;
        padding-top: 10px;
    }

    .result-card-final {
        padding: 30px 20px;
    }

    .result-card-final h1 {
        font-size: 24px;
        line-height: 30px;
    }

    .result-actions-final {
        display: grid;
        grid-template-columns: 1fr;
    }

    .primary-link,
    .secondary-link {
        width: 100%;
    }
}

/* v12 - Productos cotizados */
.products-heading {
    align-items: center;
}

.items-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.quoted-items-list {
    display: grid;
    gap: 10px;
}

.quoted-item-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
}

.quoted-item-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.quoted-item-number {
    min-width: 42px;
    height: 34px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f2f4f7;
    color: #344054;
    font-size: 13px;
    font-weight: 900;
}

.quoted-item-info {
    min-width: 0;
}

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

.quoted-item-title strong {
    display: block;
    font-size: 14px;
    line-height: 20px;
    color: var(--text);
    word-break: break-word;
}

.quoted-item-code {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #b45309;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.quoted-item-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.quoted-item-grid > div {
    padding: 9px 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #eef2f7;
}

.quoted-item-grid span,
.quoted-item-total span,
.quote-totals-row span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}

.quoted-item-grid strong,
.quoted-item-total strong,
.quote-totals-row strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    line-height: 18px;
    margin-top: 3px;
}

.secondary-unit-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.quoted-item-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quoted-item-total strong {
    font-size: 16px;
    line-height: 22px;
    color: var(--primary);
    text-align: right;
}

.quote-totals-card {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: #fcfcfd;
}

.quote-totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #eef2f7;
}

.quote-totals-row:last-child {
    border-bottom: 0;
}

.quote-totals-row.discount strong {
    color: #b42318;
}

.quote-totals-row.grand-total {
    margin-top: 4px;
    padding-top: 11px;
    border-top: 1px solid var(--border);
    border-bottom: 0;
}

.quote-totals-row.grand-total span,
.quote-totals-row.grand-total strong {
    color: var(--text);
    font-size: 16px;
    line-height: 22px;
    font-weight: 900;
}

.totals-note {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

@media (max-width: 720px) {
    .products-heading {
        align-items: flex-start;
        gap: 8px;
    }

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

    .quoted-item-card {
        padding: 10px;
    }

    .quoted-item-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 430px) {
    .quoted-item-grid {
        grid-template-columns: 1fr;
    }

    .quoted-item-total {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .quoted-item-total strong {
        text-align: left;
    }
}

/* v13 - Vista compacta y productos en tabla */
body {
    background: #f5f7fb;
}

.brand-shell {
    padding: 9px 14px;
}

.brand-logo {
    width: 104px;
}

.brand-divider {
    height: 24px;
}

.brand-title {
    font-size: 14px;
}

.page-wrap {
    max-width: 1180px;
    margin: 10px auto;
    padding: 0 10px;
}

.layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 10px;
}

.card {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.card-head {
    padding: 12px 14px;
}

.card-body {
    padding: 12px 14px;
}

.document-head {
    gap: 10px;
}

.eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
    line-height: 14px;
}

.card-head h1 {
    margin-bottom: 3px;
    font-size: 21px;
    line-height: 26px;
}

.decision-card .card-head h1 {
    font-size: 20px;
    line-height: 25px;
}

.subtitle {
    font-size: 12px;
    line-height: 17px;
}

.status-pill {
    padding: 6px 9px;
    font-size: 12px;
}

.summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.summary-item {
    padding: 8px 9px;
    border-radius: 9px;
}

.summary-item.wide {
    grid-column: span 1;
}

.summary-item span {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 14px;
}

.summary-item strong {
    font-size: 13px;
    line-height: 17px;
}

.section-heading {
    margin: 13px 0 7px;
}

.section-heading h2,
.section-title {
    margin-bottom: 1px;
    font-size: 16px;
    line-height: 20px;
}

.section-heading p {
    font-size: 12px;
    line-height: 16px;
}

.items-count {
    padding: 4px 8px;
    font-size: 11px;
}

.items-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}

.quoted-items-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 16px;
}

.quoted-items-table th,
.quoted-items-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: middle;
}

.quoted-items-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475467;
    font-size: 11px;
    line-height: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.quoted-items-table tbody tr:last-child td {
    border-bottom: 0;
}

.quoted-items-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.quoted-items-table .numeric {
    text-align: right;
}

.quoted-items-table .nowrap {
    white-space: nowrap;
}

.quoted-items-table .col-item {
    width: 44px;
    text-align: center;
}

.quoted-items-table .col-description {
    min-width: 260px;
    max-width: 390px;
}

.item-description-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.item-description-cell strong {
    display: inline-block;
    color: var(--text);
    font-size: 12px;
    line-height: 16px;
    word-break: break-word;
}

.promo-badge {
    padding: 2px 6px;
    font-size: 10px;
    line-height: 13px;
}

.table-note {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 13px;
}

.total-cell {
    color: var(--primary);
    font-weight: 900;
}

.quote-totals-card.compact-totals {
    width: min(100%, 430px);
    margin: 8px 0 0 auto;
    padding: 8px 10px;
    border-radius: 10px;
}

.compact-totals .quote-totals-row {
    padding: 4px 0;
}

.compact-totals .quote-totals-row span,
.compact-totals .quote-totals-row strong {
    font-size: 12px;
    line-height: 16px;
}

.compact-totals .quote-totals-row.grand-total span,
.compact-totals .quote-totals-row.grand-total strong {
    font-size: 15px;
    line-height: 20px;
}

.compact-totals .totals-note {
    margin-top: 5px;
    font-size: 11px;
    line-height: 15px;
}

.attachments-list {
    gap: 6px;
}

.attachment-card {
    padding: 7px 8px;
    border-radius: 10px;
}

.attachment-icon {
    min-width: 36px;
    height: 34px;
    border-radius: 10px;
    font-size: 10px;
}

.attachment-info strong {
    font-size: 13px;
    line-height: 17px;
}

.attachment-info span {
    font-size: 11px;
    line-height: 15px;
}

.link-button {
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.viewer {
    margin-top: 8px;
    border-radius: 12px;
}

.viewer-bar {
    padding: 8px 10px;
    font-size: 12px;
}

.viewer-content {
    min-height: 170px;
    padding: 8px;
}

.viewer-content iframe {
    min-height: 390px;
    border-radius: 8px;
}

.viewer-content img {
    border-radius: 8px;
}

.field-label {
    margin-bottom: 5px;
    font-size: 12px;
}

textarea {
    min-height: 72px;
    margin-bottom: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 18px;
}

.actions {
    gap: 7px;
}

.action-button {
    border-radius: 11px;
    padding: 8px 10px;
}

.action-button span {
    font-size: 14px;
    line-height: 18px;
}

.action-button small {
    margin-top: 1px;
    font-size: 11px;
    line-height: 15px;
}

.closed-state {
    padding: 20px 16px;
}

.closed-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-size: 24px;
}

.closed-state h1 {
    font-size: 19px;
    line-height: 24px;
}

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

    .decision-card {
        position: static;
    }
}

@media (max-width: 720px) {
    .page-wrap {
        margin: 6px auto;
        padding: 0 6px;
    }

    .brand-shell {
        padding: 8px 10px;
    }

    .brand-logo {
        width: 92px;
    }

    .brand-title {
        font-size: 13px;
    }

    .card {
        border-radius: 10px;
    }

    .card-head,
    .card-body {
        padding: 10px;
    }

    .card-head h1 {
        font-size: 19px;
        line-height: 23px;
    }

    .document-head {
        display: grid;
        gap: 6px;
    }

    .status-pill {
        width: fit-content;
        margin-top: 0;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

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

    .summary-item {
        padding: 7px 8px;
    }

    .items-table-wrap {
        margin-left: -1px;
        margin-right: -1px;
        border-radius: 9px;
    }

    .quoted-items-table {
        min-width: 760px;
        font-size: 11px;
        line-height: 15px;
    }

    .quoted-items-table th,
    .quoted-items-table td {
        padding: 6px 7px;
    }

    .quoted-items-table .col-description {
        min-width: 220px;
        max-width: 300px;
    }

    .item-description-cell {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .quote-totals-card.compact-totals {
        width: 100%;
        margin-top: 7px;
    }

    .attachment-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .attachment-icon {
        display: none;
    }

    .attachment-info strong {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .attachment-card .link-button {
        grid-column: auto;
        width: auto;
    }

    .viewer-content iframe {
        min-height: 310px;
    }
}

@media (max-width: 430px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-item.wide {
        grid-column: span 1;
    }

    .section-heading {
        align-items: flex-start;
        gap: 5px;
    }

    .items-count {
        margin-top: 1px;
    }

    .quoted-items-table {
        min-width: 700px;
    }

    .quoted-items-table .col-description {
        min-width: 190px;
    }

    .attachment-card {
        grid-template-columns: 1fr;
    }

    .attachment-card .link-button {
        width: 100%;
    }
}
