/* Update Quote row + modal — Tracking post-SI revisions */

.update-quote-row {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.update-quote-row-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.update-quote-row-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--navy-800, #1e293b);
    font-weight: 600;
}

.update-quote-row-copy i {
    color: #2563eb;
    font-size: 14px;
}

.btn-update-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: none;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-update-quote:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
    transform: translateY(-1px);
}

.btn-update-quote:active {
    transform: translateY(0);
}

.btn-update-quote:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

body.uq-modal-open {
    overflow: hidden !important;
}

html.embedded-mode body.uq-modal-open .update-quote-overlay,
body.embedded-mode.uq-modal-open .update-quote-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}

html.embedded-mode body.uq-modal-open,
body.embedded-mode.uq-modal-open {
    overflow: hidden !important;
}

.update-quote-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: uqFadeIn 0.2s ease;
}

@keyframes uqFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.update-quote-dialog {
    background: var(--bg-secondary, #fff);
    border-radius: 16px;
    width: min(1100px, 100%);
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.update-quote-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.update-quote-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--navy-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.update-quote-close {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.update-quote-close:hover {
    background: var(--gray-100);
    color: var(--navy-800);
}

.update-quote-body {
    overflow-y: auto;
    padding: 20px 22px 8px;
    flex: 1;
}

.uq-section {
    margin-bottom: 28px;
}

.uq-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--navy-700);
    margin-bottom: 12px;
}

.uq-section-title.initial {
    color: #6b7280;
}

.uq-section-title.final {
    color: #059669;
}

.uq-initial-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
}

.uq-container-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    background: white;
}

.uq-container-card.readonly {
    background: #fafafa;
}

.uq-container-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--navy-800);
}

.uq-charges-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.uq-charges-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    background: #f8fafc;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.uq-charges-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.uq-charges-table input,
.uq-charges-table select {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    font-size: 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
}

.uq-charges-table.readonly td {
    color: var(--navy-800);
}

.uq-charges-table .inr-cell {
    font-weight: 700;
    color: #1e3a8a;
    text-align: right;
    white-space: nowrap;
}

.uq-totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.uq-total-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 14px;
}

.uq-total-card.highlight {
    border-left: 4px solid #059669;
    background: #ecfdf5;
}

.uq-total-card label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.uq-total-card .amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy-900);
}

.uq-total-card.highlight .amount {
    color: #059669;
}

.uq-add-charge {
    display: block;
    width: 100%;
    padding: 8px;
    border: none;
    border-top: 1px dashed var(--border-light);
    background: white;
    color: var(--navy-600);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.uq-add-charge:hover {
    background: var(--gray-50);
}

.update-quote-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: #fafafa;
}

.update-quote-footer .btn.is-loading {
    pointer-events: none;
    opacity: 0.75;
}

@media (max-width: 768px) {
    .update-quote-dialog {
        max-height: 96vh;
    }

    .uq-charges-table {
        display: block;
        overflow-x: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .update-quote-overlay {
        animation: none;
    }
}
