: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);
}

html[data-app-theme="dark"] {
    --bg: #0f172a;
    --card: #111827;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --border: #334155;
    --primary: #60a5fa;
    --primary-soft: #0b2547;
    --ok: #22c55e;
    --bad: #f87171;
    --eval: #c084fc;
    --warning-bg: #27190b;
    --warning-border: #92400e;
    --error-bg: #2b1212;
    --error-border: #7f1d1d;
    --error-text: #fecaca;
    --shadow: 0 18px 40px rgba(0, 0, 0, .32);
}

* {
    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);
}

html[data-app-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, .13), transparent 34%),
        linear-gradient(180deg, #020617 0%, var(--bg) 100%);
}

.topbar {
    background: var(--card);
    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;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.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: var(--text);
}

.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: var(--text);
    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: var(--text);
    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%;
    }
}

/* DevExtreme JS 25.1 - Productos cotizados */
.devextreme-grid {
    width: 100%;
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
}







.app-product-description-cell {
    min-width: 0;
}

.app-product-description-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 17px;
}

.app-product-description-main strong {
    font-size: 12px;
    color: #111827;
}








.is-hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .devextreme-grid {
        margin-left: -4px;
        margin-right: -4px;
    }

    
}

/* v17 - DevExtreme JS para la ficha "Su respuesta" */
.app-response-textarea {
    margin-bottom: 9px;
}



.app-decision-actions {
    display: grid;
    gap: 7px;
}



.app-decision-button-content {
    width: 100%;
    display: grid;
    gap: 1px;
    text-align: left;
    line-height: 1.15;
}

.app-decision-button-content span {
    font-weight: 900;
    font-size: 14px;
}

.app-decision-button-content small {
    font-weight: 600;
    font-size: 11px;
    opacity: .92;
}









@media (max-width: 680px) {
    

    .app-decision-button-content span {
        font-size: 13px;
    }

    .app-decision-button-content small {
        font-size: 10.5px;
    }
}

/* v18 - Ajuste best-fit DevExtreme DataGrid */








.app-product-description-cell {
    max-width: 100%;
}

.app-product-description-main {
    flex-wrap: nowrap;
    min-width: 0;
}

.app-product-description-main strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-product-code-inline {
    display: none;
}





@media (max-width: 760px) {
    

    .app-product-code-inline {
        display: block;
    }

    .app-product-description-main strong {
        max-width: calc(100vw - 190px);
    }

    
}

/* v19 - Adjuntos y visor con DevExtreme JS */
.attachments-dx-list {
    margin-top: 0;
}

.attachments-dx-list.is-hidden,
.viewer-toolbar-dx.is-hidden {
    display: none;
}









.app-attachment-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.app-attachment-ext {
    min-width: 36px;
    height: 34px;
    padding: 0 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .02em;
}

.app-attachment-body {
    min-width: 0;
}

.app-attachment-body strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    line-height: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-attachment-body span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-attachment-action {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}



.viewer-bar {
    align-items: center;
}

.viewer-title {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.viewer-title strong,
.viewer-title span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-toolbar-dx {
    flex: 0 0 auto;
}











@media (max-width: 680px) {
    .viewer-bar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    

    

    

    .app-attachment-item {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 7px;
    }

    .app-attachment-action {
        font-size: 11px;
    }
}


/* v20 - Visor de adjuntos: toolbar en flujo normal, sin superposición */
.viewer {
    overflow: hidden;
}

.viewer-bar {
    position: relative;
    z-index: 1;
}

.viewer-toolbar-dx {
    display: block;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 1;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.viewer-toolbar-dx.is-hidden {
    display: none !important;
}









.viewer-content {
    position: relative;
    z-index: 0;
}

@media (max-width: 680px) {
    .viewer-toolbar-dx {
        padding: 6px;
    }

    

    
}

/* v20 - Diseño recto: eliminar bordes redondos del proyecto y controles DevExtreme */



/* v21 - Botones de respuesta sobrios: borde de color, fondo claro y texto negro */
.action-button.accept,
.action-button.reject,
.action-button.evaluation {
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.action-button.accept { border: 1px solid var(--ok) !important; }
.action-button.reject { border: 1px solid var(--bad) !important; }
.action-button.evaluation { border: 1px solid var(--eval) !important; }

.action-button.accept span,
.action-button.reject span,
.action-button.evaluation span {
    color: #111827 !important;
}

.action-button.accept small,
.action-button.reject small,
.action-button.evaluation small {
    color: #4b5563 !important;
}











.app-decision-button .app-decision-button-content small {
    color: #4b5563 !important;
    opacity: 1 !important;
}




/* v22 - Iconos en botones de Su respuesta */
.action-button-head,
.app-decision-button-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-icon,
.app-decision-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.action-icon.accept,
.app-decision-icon.accept {
    color: var(--ok) !important;
}

.action-icon.reject,
.app-decision-icon.reject {
    color: var(--bad) !important;
}

.action-icon.evaluation,
.app-decision-icon.evaluation {
    color: var(--eval) !important;
}

.app-decision-button-content {
    width: 100%;
}

.app-decision-button-head + small,
.action-button-head + small {
    display: block;
    margin-top: 2px;
}

/* v23 - Modo claro/oscuro con selector en encabezado */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.theme-toggle-icon {
    color: var(--primary);
    font-size: 16px;
    line-height: 1;
}

html[data-app-theme="dark"] .card-head,
html[data-app-theme="dark"] .soft-head {
    background: #111827 !important;
}

html[data-app-theme="dark"] .summary-item,
html[data-app-theme="dark"] .quote-totals-card,
html[data-app-theme="dark"] .attachment-card,
html[data-app-theme="dark"] .viewer-panel,
html[data-app-theme="dark"] .viewer-content,
html[data-app-theme="dark"] .closed-decision-card,
html[data-app-theme="dark"] .center-card,
html[data-app-theme="dark"] .home-card {
    background: var(--card) !important;
    color: var(--text) !important;
}





html[data-app-theme="dark"] .app-decision-button .app-decision-button-content small,
html[data-app-theme="dark"] .action-button.accept small,
html[data-app-theme="dark"] .action-button.reject small,
html[data-app-theme="dark"] .action-button.evaluation small,
html[data-app-theme="dark"] .subtitle,
html[data-app-theme="dark"] .table-note,
html[data-app-theme="dark"] .closed-note {
    color: var(--muted) !important;
}

html[data-app-theme="dark"] .brand-logo {
    filter: brightness(1.05);
}

@media (max-width: 640px) {
    .brand-shell {
        padding: 10px 12px;
    }

    .brand-link {
        gap: 9px;
        min-width: 0;
    }

    .brand-logo {
        width: 96px;
    }

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

    .theme-toggle {
        padding: 7px 8px;
        min-width: 38px;
    }

    .theme-toggle-text {
        display: none;
    }
}


/* v24 - Estilos propios sin reglas sobre clases internas DevExtreme */
.app-response-textarea {
    margin-bottom: 10px;
}

.app-decision-actions {
    display: grid;
    gap: 8px;
}

.app-decision-button-content {
    width: 100%;
}

.app-decision-button-head,
.action-button-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.app-decision-icon,
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.app-decision-icon.accept,
.action-icon.accept {
    color: var(--ok);
}

.app-decision-icon.reject,
.action-icon.reject {
    color: var(--bad);
}

.app-decision-icon.evaluation,
.action-icon.evaluation {
    color: var(--eval);
}

.app-decision-button-head + small,
.action-button-head + small {
    display: block;
    margin-top: 2px;
}

.app-product-description-cell {
    max-width: 100%;
}

.app-product-description-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.app-product-description-main strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-product-code-inline {
    display: none;
}

.app-attachment-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.app-attachment-ext {
    min-width: 36px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .02em;
}

.app-attachment-body {
    min-width: 0;
}

.app-attachment-body strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    line-height: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-attachment-body span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-attachment-action {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.viewer-toolbar-dx {
    display: block;
    width: 100%;
    clear: both;
    position: relative;
    z-index: 1;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.viewer-toolbar-dx.is-hidden {
    display: none !important;
}

.viewer-content {
    position: relative;
    z-index: 0;
}

html[data-app-theme="dark"] .card-head,
html[data-app-theme="dark"] .soft-head {
    background: var(--card);
}

html[data-app-theme="dark"] .summary-item,
html[data-app-theme="dark"] .quote-totals-card,
html[data-app-theme="dark"] .attachment-card,
html[data-app-theme="dark"] .viewer-panel,
html[data-app-theme="dark"] .viewer-content,
html[data-app-theme="dark"] .closed-decision-card,
html[data-app-theme="dark"] .center-card,
html[data-app-theme="dark"] .home-card {
    background: var(--card);
    color: var(--text);
}

html[data-app-theme="dark"] .action-button.accept,
html[data-app-theme="dark"] .action-button.reject,
html[data-app-theme="dark"] .action-button.evaluation {
    background: var(--card);
    color: var(--text);
}

html[data-app-theme="dark"] .action-button.accept span,
html[data-app-theme="dark"] .action-button.reject span,
html[data-app-theme="dark"] .action-button.evaluation span {
    color: var(--text);
}

html[data-app-theme="dark"] .action-button.accept small,
html[data-app-theme="dark"] .action-button.reject small,
html[data-app-theme="dark"] .action-button.evaluation small,
html[data-app-theme="dark"] .subtitle,
html[data-app-theme="dark"] .table-note,
html[data-app-theme="dark"] .closed-note {
    color: var(--muted);
}

@media (max-width: 760px) {
    .app-product-code-inline {
        display: block;
    }

    .app-product-description-main strong {
        max-width: calc(100vw - 190px);
    }
}

@media (max-width: 680px) {
    .app-attachment-item {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 7px;
    }

    .app-attachment-action {
        font-size: 11px;
    }

    .viewer-toolbar-dx {
        padding: 6px;
    }
}

@media (max-width: 640px) {
    .brand-shell {
        padding: 10px 12px;
    }

    .brand-link {
        gap: 9px;
        min-width: 0;
    }

    .brand-logo {
        width: 96px;
    }

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

    .theme-toggle {
        padding: 7px 8px;
        min-width: 38px;
    }

    .theme-toggle-text {
        display: none;
    }
}


/* v24 - Pantalla final con acciones DevExtreme sin tocar clases internas */
.result-actions-dx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.result-actions-dx.is-hidden {
    display: none !important;
}


/* v25 - Botones propios de respuesta, independientes del tema DevExtreme */
.native-actions {
    display: grid;
    gap: 8px;
}

.action-button {
    width: 100%;
    min-height: 58px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    background: var(--card) !important;
    color: var(--text) !important;
    border-width: 1px !important;
    border-style: solid !important;
    box-shadow: none !important;
    text-align: left;
    line-height: 1.2;
    overflow: visible;
}

.action-button.accept {
    border-color: var(--ok) !important;
}

.action-button.reject {
    border-color: var(--bad) !important;
}

.action-button.evaluation {
    border-color: var(--eval) !important;
}

.action-button:hover {
    background: var(--primary-soft) !important;
}

.action-button-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 20px;
}

.action-button-head span:last-child {
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 800;
    line-height: 18px;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    font-size: 16px;
    font-weight: 900;
    line-height: 18px;
}

.action-icon.accept {
    color: var(--ok) !important;
}

.action-icon.reject {
    color: var(--bad) !important;
}

.action-icon.evaluation {
    color: var(--eval) !important;
}

.action-button small {
    color: var(--muted) !important;
    font-size: 11.5px;
    line-height: 15px;
    font-weight: 600;
    margin-left: 26px;
}

.action-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}


/* v26 - Recto total en UI propia, sin tocar clases internas DevExtreme */
.topbar,
.brand-shell,
.brand-link,
.brand-logo,
.brand-divider,
.theme-toggle,
.page-wrap,
.layout,
.card,
.main-card,
.decision-card,
.closed-decision-card,
.center-card,
.home-card,
.result-card-final,
.card-head,
.card-body,
.summary-grid,
.summary-item,
.status-pill,
.items-count,
.section-heading,
.products-heading,
.compact-heading,
.quoted-items-table,
.items-table-wrap,
.quote-totals-card,
.quote-totals-row,
.attachments-list,
.attachment-card,
.attachment-icon,
.attachment-info,
.link-button,
.viewer-panel,
.viewer,
.viewer-bar,
.viewer-toolbar-dx,
.viewer-content,
.file-actions,
.download-link,
.primary-link,
.secondary-link,
.result-actions-final,
.result-actions-dx,
.result-box,
.notice,
.home-alert,
.closed-icon,
.closed-note,
.result-icon-final,
.action-button,
.action-button-head,
.action-icon,
.native-observacion,
.field-label,
.promo-badge,
.table-note,
.totals-note,
.loading-file-state,
.empty-file-state,
.empty-file-icon,
.spinner {
    border-radius: 0 !important;
}

/* v26 - Contador de ítems visible en modo claro/oscuro */
.items-count {
    border: 1px solid var(--primary) !important;
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    font-weight: 800;
}

html[data-app-theme="dark"] .items-count {
    border-color: var(--primary) !important;
    background: #0b2547 !important;
    color: #bfdbfe !important;
}

/* v26 - Botones propios: fondo tipo hover permanente, borde de acción y fuente legible */
.action-button.accept,
.action-button.reject,
.action-button.evaluation {
    background: var(--primary-soft) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.action-button.accept:hover,
.action-button.reject:hover,
.action-button.evaluation:hover {
    background: var(--primary-soft) !important;
}

.action-button.accept {
    border-color: var(--ok) !important;
}

.action-button.reject {
    border-color: var(--bad) !important;
}

.action-button.evaluation {
    border-color: var(--eval) !important;
}

.action-button-head span:last-child,
.action-button.accept span,
.action-button.reject span,
.action-button.evaluation span {
    color: var(--text) !important;
}

.action-button.accept small,
.action-button.reject small,
.action-button.evaluation small {
    color: var(--muted) !important;
}

html[data-app-theme="dark"] .action-button.accept,
html[data-app-theme="dark"] .action-button.reject,
html[data-app-theme="dark"] .action-button.evaluation {
    background: #0b2547 !important;
    color: var(--text) !important;
}

html[data-app-theme="dark"] .action-button.accept:hover,
html[data-app-theme="dark"] .action-button.reject:hover,
html[data-app-theme="dark"] .action-button.evaluation:hover {
    background: #0b2547 !important;
}

html[data-app-theme="dark"] .action-button-head span:last-child,
html[data-app-theme="dark"] .action-button.accept span,
html[data-app-theme="dark"] .action-button.reject span,
html[data-app-theme="dark"] .action-button.evaluation span {
    color: var(--text) !important;
}

html[data-app-theme="dark"] .action-button.accept small,
html[data-app-theme="dark"] .action-button.reject small,
html[data-app-theme="dark"] .action-button.evaluation small {
    color: var(--muted) !important;
}

/* v26 - Campos propios legibles en modo oscuro */
html[data-app-theme="dark"] .native-observacion,
html[data-app-theme="dark"] textarea,
html[data-app-theme="dark"] input {
    background: #0f172a;
    color: var(--text);
    border-color: var(--border);
}

html[data-app-theme="dark"] .native-observacion::placeholder {
    color: #94a3b8;
}


/* v27 - Botones propios del mensaje de resultado, visibles en modo oscuro */
.result-actions-final {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.result-action-link,
.primary-link.result-action-link,
.secondary-link.result-action-link {
    min-height: 36px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--primary) !important;
    background: var(--primary-soft) !important;
    color: var(--text) !important;
    text-decoration: none !important;
    font-weight: 800;
    line-height: 18px;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.result-action-link:hover,
.primary-link.result-action-link:hover,
.secondary-link.result-action-link:hover {
    background: var(--primary-soft) !important;
    color: var(--text) !important;
    text-decoration: none !important;
}

.result-action-icon {
    color: var(--primary) !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

html[data-app-theme="dark"] .result-action-link,
html[data-app-theme="dark"] .primary-link.result-action-link,
html[data-app-theme="dark"] .secondary-link.result-action-link {
    border-color: var(--primary) !important;
    background: #0b2547 !important;
    color: var(--text) !important;
}

html[data-app-theme="dark"] .result-action-link:hover,
html[data-app-theme="dark"] .primary-link.result-action-link:hover,
html[data-app-theme="dark"] .secondary-link.result-action-link:hover {
    background: #0b2547 !important;
    color: var(--text) !important;
}

html[data-app-theme="dark"] .result-action-icon {
    color: #bfdbfe !important;
}
