/*
 * cockpit-extractor-review.css
 * ============================
 *
 * Plain language: styles for the side-by-side review-gate modal that
 * shows the rep's verbatim note on the left with highlighted spans
 * and the extracted fields on the right with confidence chips.
 *
 * Why this exists: Phase 3 / Agent 3A. Companion stylesheet to
 * static/cockpit-extractor-review.js. The visual language matches
 * the rest of the Laurent V2 commercial spine — restrained palette,
 * generous whitespace, monospaced numbers in confidence chips.
 *
 * Color tiers:
 *   green = high confidence (≥0.80)  → pre-accepted, calm
 *   amber = medium (0.55-0.80)        → reviewer attention
 *   red   = low (<0.55)               → reviewer must act
 *
 * Highlight palette (color-0 through color-5): six pastel shades the
 * source-pane spans cycle through so adjacent quotes are visually
 * distinct without screaming.
 */

/* ===== Modal shell ===== */

.extractor-review-root {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extractor-review-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 22, 0.55);
    backdrop-filter: blur(2px);
}

.extractor-review-modal {
    position: relative;
    width: min(1200px, 96vw);
    max-height: 90vh;
    background: #fbfaf7;
    color: #1f1d18;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.extractor-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 12px;
    border-bottom: 1px solid #ece9e3;
}

.extractor-review-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #2d2a23;
}

.extractor-review-close {
    appearance: none;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    color: #4a4639;
    cursor: pointer;
}
.extractor-review-close:hover { background: #efebe2; }

.extractor-review-helper {
    margin: 8px 24px 0;
    color: #6b6655;
    font-size: 13px;
    line-height: 1.45;
}
.extractor-review-helper.error { color: #b32a2a; }

/* ===== Body — two-pane layout ===== */

.extractor-review-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 18px 24px 24px;
    overflow: hidden;
    min-height: 0;
}

.extractor-review-source,
.extractor-review-fields {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #ece9e3;
    border-radius: 10px;
    overflow: hidden;
}

.extractor-review-source h3,
.extractor-review-fields h3 {
    margin: 0;
    padding: 12px 16px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #6b6655;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #ece9e3;
    background: #f7f5ee;
}

.extractor-review-source-text {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.65;
    color: #2d2a23;
    white-space: pre-wrap;
    word-break: break-word;
}

.extractor-review-trimmed-badge {
    margin-bottom: 14px;
    padding: 6px 10px;
    background: #f4ecd6;
    color: #6b5a1e;
    border-radius: 6px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 12px;
}

.extractor-review-source-body {
    color: inherit;
}

/* ===== Highlight color palette ===== */

mark.extractor-review-highlight {
    background-color: #fff4cf;
    color: inherit;
    padding: 1px 2px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: background-color 120ms ease, box-shadow 120ms ease;
}
mark.extractor-review-highlight.color-0 { background-color: #fff4cf; }
mark.extractor-review-highlight.color-1 { background-color: #d8eedf; }
mark.extractor-review-highlight.color-2 { background-color: #e3e0f7; }
mark.extractor-review-highlight.color-3 { background-color: #fadcd0; }
mark.extractor-review-highlight.color-4 { background-color: #d6ecf3; }
mark.extractor-review-highlight.color-5 { background-color: #f5d8e7; }

mark.extractor-review-highlight.hover {
    box-shadow: 0 0 0 2px #4a4639;
}

/* ===== Field cards ===== */

.extractor-review-fields-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.extractor-review-empty {
    padding: 24px 12px;
    text-align: center;
    color: #6b6655;
    font-size: 13px;
}

.extractor-review-field-card {
    border: 1px solid #ece9e3;
    border-radius: 8px;
    padding: 12px 14px 10px;
    background: #ffffff;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.extractor-review-field-card.tier-amber {
    border-color: #d9b96a;
    background: #fffbef;
}
.extractor-review-field-card.tier-red {
    border-color: #c97a6a;
    background: #fff1ec;
}
.extractor-review-field-card.financial {
    border-left: 4px solid #4a4639;
}
.extractor-review-field-card.decision-accepted {
    box-shadow: inset 4px 0 0 #3f7d57;
}
.extractor-review-field-card.decision-rejected {
    opacity: 0.65;
    text-decoration: line-through;
}

.extractor-review-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.extractor-review-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a23;
}

.extractor-review-confidence-chip {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.extractor-review-confidence-chip.tier-green {
    background: #dcefe1; color: #2f5d3e;
}
.extractor-review-confidence-chip.tier-amber {
    background: #fbeac6; color: #6b5a1e;
}
.extractor-review-confidence-chip.tier-red {
    background: #f5d4cb; color: #843b2c;
}

.extractor-review-field-value {
    margin: 4px 0 8px;
}
.extractor-review-field-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d6d3ca;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1f1d18;
    background: #fbfaf7;
}
.extractor-review-field-input:focus {
    outline: none;
    border-color: #4a4639;
    background: #ffffff;
}

.extractor-review-field-quote {
    margin: 6px 0 4px;
    padding: 6px 10px;
    border-left: 3px solid #d6d3ca;
    background: #faf7f0;
    color: #4a4639;
    font-family: ui-serif, Georgia, serif;
    font-size: 13px;
    line-height: 1.5;
}

.extractor-review-field-noquote {
    margin: 6px 0 4px;
    color: #8c8675;
    font-size: 12px;
    font-style: italic;
}

.extractor-review-financial-hint {
    margin: 4px 0 6px;
    font-size: 11px;
    color: #4a4639;
    background: #f0ede4;
    padding: 4px 8px;
    border-radius: 4px;
}

.extractor-review-field-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.extractor-review-field-actions button {
    appearance: none;
    border: 1px solid #d6d3ca;
    background: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #2d2a23;
}
.extractor-review-field-actions button:hover { background: #f7f5ee; }
.extractor-review-field-accept.active {
    background: #2f5d3e;
    border-color: #2f5d3e;
    color: #ffffff;
}
.extractor-review-field-reject.active {
    background: #843b2c;
    border-color: #843b2c;
    color: #ffffff;
}

/* ===== Footer ===== */

.extractor-review-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #ece9e3;
    background: #f7f5ee;
}
.extractor-review-spacer { flex: 1; }
.extractor-review-footer button {
    appearance: none;
    border: 1px solid #d6d3ca;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #2d2a23;
}
.extractor-review-footer button:hover { background: #efebe2; }
.extractor-review-footer .extractor-review-primary {
    background: #4a4639;
    border-color: #4a4639;
    color: #ffffff;
}
.extractor-review-footer .extractor-review-primary:hover {
    background: #2d2a23;
}
.extractor-review-footer .extractor-review-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.extractor-review-footer .extractor-review-reject-all {
    color: #843b2c;
    border-color: #d6c0bb;
}
.extractor-review-footer .extractor-review-reject-all:hover {
    background: #f9eee9;
}

/* ===== Body lock when modal is open ===== */
body.extractor-review-open { overflow: hidden; }

/* ===== Responsive: stack panes on narrow screens ===== */
@media (max-width: 900px) {
    .extractor-review-body {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}
