:root {
    --violet: #592d82;
    --violet-dark: #40205f;
    --green: #2f855a;
    --red: #b83232;
    --orange: #f58534;
    --bg: #f4f5f7;
    --text: #24252a;
    --muted: #666b76;
    --border: #dfe2e7;
    --white: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); line-height: 1.5; }
.container { width: min(920px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: var(--violet); color: var(--white); box-shadow: 0 2px 8px rgba(0,0,0,.16); }
.topbar__content { padding: 18px 0; }
.brand { display: block; font-size: 1.1rem; font-weight: 700; }
.brand-subtitle { display: block; font-size: .86rem; opacity: .86; }
.main-content { padding: 34px 0 50px; }
.page-heading { margin-bottom: 20px; }
h1 { margin: 0 0 8px; font-size: clamp(1.55rem, 3vw, 2rem); }
p { margin-top: 0; }
.page-heading p, .decision-card > p { color: var(--muted); }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 26px; box-shadow: 0 4px 16px rgba(40, 45, 55, .06); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field--full { grid-column: 1 / -1; }
label { font-weight: 700; margin-bottom: 7px; }
label span { color: var(--red); }
input, select, textarea { width: 100%; border: 1px solid #bfc5ce; border-radius: 6px; padding: 11px 12px; font: inherit; color: var(--text); background: var(--white); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(89,45,130,.15); border-color: var(--violet); }
.field-help { align-self: flex-end; margin-top: 4px; color: var(--muted); font-size: .8rem; }
.field-error { color: var(--red); margin-top: 5px; font-size: .86rem; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .1s ease, opacity .1s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button--primary { color: var(--white); background: var(--violet); }
.button--primary:hover { background: var(--violet-dark); }
.button--secondary { color: var(--violet); background: #eee8f3; }
.button--approve { color: var(--white); background: var(--green); }
.button--reject { color: var(--white); background: var(--red); }
.alert { display: grid; gap: 3px; margin-bottom: 18px; border-radius: 8px; padding: 14px 16px; border: 1px solid; }
.alert--success { background: #edf8f1; border-color: #9bcbb0; }
.alert--warning { background: #fff7e7; border-color: #e6bd67; }
.alert--info { background: #eef4ff; border-color: #9bb5e5; }
.status-card { max-width: 650px; margin: 30px auto; text-align: center; }
.status-card p { color: var(--muted); }
.protocol { display: block; padding: 11px; background: #f2eff5; border-radius: 6px; color: var(--text) !important; }
.status-icon { width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; background: #dce3ea; }
.status-icon--success { background: #bfe2cc; }
.status-icon--warning { background: #f7dca2; }
.status-icon--error { background: #efb1b1; }
.decision-card { max-width: 760px; margin: 0 auto; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--violet); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.summary-list { margin: 24px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.summary-list div { display: grid; grid-template-columns: 165px 1fr; border-bottom: 1px solid var(--border); }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt, .summary-list dd { margin: 0; padding: 11px 13px; }
.summary-list dt { font-weight: 700; background: #f6f3f8; }
.summary-list dd { overflow-wrap: anywhere; }
.decision-form { display: grid; gap: 18px; }
.decision-actions { display: flex; justify-content: flex-end; }
.footer { color: var(--muted); font-size: .82rem; padding: 18px 0 28px; text-align: center; }

@media (max-width: 680px) {
    .form-grid { grid-template-columns: 1fr; }
    .field--full { grid-column: auto; }
    .card { padding: 20px; }
    .summary-list div { grid-template-columns: 1fr; }
    .summary-list dt { padding-bottom: 4px; }
    .summary-list dd { padding-top: 4px; }
    .form-actions, .decision-actions { justify-content: stretch; }
    .button { width: 100%; }
}

.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.optional-label { color: var(--muted); font-weight: 400; }
.field-help--left { align-self: flex-start; }
.file-summary { margin-top: 8px; }
.selected-files { display: grid; gap: 6px; margin: 0 0 7px; padding: 0; list-style: none; }
.selected-files li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fafafa; }
.selected-files li span { min-width: 0; overflow-wrap: anywhere; }
.selected-files li small { flex: 0 0 auto; color: var(--muted); }
.selected-files__total { display: block; color: var(--muted); font-size: .84rem; }
.attachment-list { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.attachment-list li { padding-left: 2px; }
.attachment-list li span { margin-left: 7px; color: var(--muted); font-size: .82rem; }
.button--whatsapp { width: fit-content; margin-top: 10px; color: #fff; background: #237a48; }
.button--whatsapp:hover { background: #195f37; }
.whatsapp-help { display: block; color: var(--muted); font-size: .82rem; }
.alert .button--whatsapp { justify-self: start; }

/* Fluxo de duas aprovações */
.workflow-section { margin-bottom: 22px; }
.workflow-section h2, .workflow-history h2 { margin-top: 0; font-size: 1.25rem; }
.workflow-form { display: grid; gap: 22px; }
.workflow-quotations { display: grid; gap: 14px; }
.section-title-row { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.section-title-row h2 { margin-bottom: 2px; }
.section-title-row p { color: var(--muted); margin-bottom: 0; }
.quotation-editor { padding: 0; overflow: hidden; }
.quotation-editor summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; font-weight: 700; list-style: none; background: #faf8fc; }
.quotation-editor summary::-webkit-details-marker { display: none; }
.quotation-editor[open] summary { border-bottom: 1px solid var(--border); }
.quotation-editor__body { padding: 22px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: .75rem; font-weight: 700; background: #eee8f3; color: var(--violet); }
.badge--recommended { background: #e5f5eb; color: #246b48; }
.recommended-choice { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #a9cfb8; border-radius: 7px; background: #f1faf4; }
.recommended-choice input, .quotation-choice input { width: auto; }
.total-preview { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 7px; background: #f6f3f8; }
.total-preview strong { color: var(--violet); font-size: 1.1rem; }
.existing-files { margin-top: 12px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: #fafafa; }
.file-remove-option { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.file-remove-option input { width: auto; }
.sticky-actions { position: sticky; bottom: 10px; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.note-box { padding: 14px; border-left: 4px solid var(--violet); border-radius: 5px; background: #f6f3f8; }
.note-box + .note-box { margin-top: 12px; }
.note-box--warning { border-left-color: #d69e2e; background: #fff8e6; }
.quotation-comparison { display: grid; gap: 17px; }
.quotation-option { border: 1px solid var(--border); border-radius: 10px; background: var(--white); overflow: hidden; box-shadow: 0 3px 12px rgba(40,45,55,.05); }
.quotation-option--recommended { border: 2px solid #70ad89; }
.quotation-option__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; background: #faf8fc; border-bottom: 1px solid var(--border); }
.quotation-option__heading h3 { margin: 0; }
.quotation-choice { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.05rem; }
.compact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.compact-list div { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.compact-list div:nth-child(odd) { border-right: 1px solid var(--border); }
.compact-list dt { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.compact-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.quotation-files { padding: 13px 16px; background: #fafafa; }
.final-decision-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.workflow-history { margin-top: 26px; }
.timeline { margin: 0; padding-left: 22px; }
.timeline li { padding: 0 0 18px 8px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li > span { display: block; color: var(--muted); font-size: .82rem; }
.timeline li p { margin: 5px 0 0; }
.selected-quotation-card { border-left: 5px solid var(--green); }
.saved-file-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; align-items: center; }
.saved-file-row > span { color: var(--muted); font-size: .82rem; }
.saved-file-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.saved-file-row input { width: auto; }

@media (max-width: 760px) {
    .compact-list { grid-template-columns: 1fr; }
    .compact-list div:nth-child(odd) { border-right: 0; }
    .final-decision-actions { grid-template-columns: 1fr; }
    .sticky-actions { position: static; flex-direction: column; }
    .sticky-actions .button { width: 100%; }
    .saved-file-row { grid-template-columns: 1fr; gap: 4px; }
}
.quotation-editor__controls { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 18px; }
.quotation-editor__controls .recommended-choice { margin-bottom: 0; flex: 1; }
.remove-quotation-choice { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px solid #e2b2b2; border-radius: 7px; background: #fff4f4; color: var(--red); }
.remove-quotation-choice input { width: auto; }
@media (max-width: 680px) { .quotation-editor__controls { flex-direction: column; } }

/* Consulta permanente em modo somente leitura */
.status-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.consultation-heading { margin-bottom: 16px; }
.consultation-notice { margin-bottom: 22px; }
.consultation-status .summary-list { margin-bottom: 0; }
.status-pill { display: inline-flex; align-items: center; max-width: 320px; padding: 7px 12px; border-radius: 999px; background: #eee8f3; color: var(--violet); font-size: .86rem; font-weight: 700; text-align: center; }
.consultation-section-title { margin-bottom: 14px; }
.consultation-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.empty-state { margin: 0; color: var(--muted); }
.quotation-badges { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.badge--selected { background: #e8f0ff; color: #284f93; }

@media (max-width: 680px) {
    .status-actions, .consultation-actions { flex-direction: column; }
    .status-actions .button, .consultation-actions .button { width: 100%; }
    .consultation-status .section-title-row { align-items: flex-start; flex-direction: column; }
    .quotation-badges { justify-content: flex-start; }
}
