/* Precificação de Instalação — reaproveita o visual do catálogo (ecat-*) e acrescenta os componentes eip-*. */
body[data-es-panel-active="catalogo-instalacao"] .es-page-heading { display: none !important; }
body[data-es-panel-active="catalogo-instalacao"] .es-content { margin-top: -0.65rem; padding: 0; background: #eef2f8; border-radius: 1.35rem 1.35rem 0 0; overflow: hidden; }

.eip-shell [hidden] { display: none !important; }
.eip-shell.is-busy .eip-panel { opacity: .65; pointer-events: none; transition: opacity .12s ease; }
.eip-panel { outline: none; }
.eip-muted { color: #64748b; font-size: .82rem; }
.eip-small { font-size: .78rem !important; line-height: 1.4; }
.eip-hint { color: #64748b; font-size: .72rem; font-weight: 500; }
.eip-badges { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }

/* Botões: o app estiliza .btn por módulo; aqui seguem o padrão azul do Engage. */
.eip-shell .btn, .eip-modal-layer .btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.5rem; padding: .5rem 1rem; border: 1px solid #cbd5e1; border-radius: .7rem; background: #fff; color: #23406a; font: inherit; font-size: .86rem; font-weight: 700; line-height: 1.2; cursor: pointer; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
.eip-shell .btn:hover:not([disabled]), .eip-modal-layer .btn:hover:not([disabled]) { border-color: #93c5fd; background: #f1f6ff; color: #163257; }
.eip-shell .btn:focus-visible, .eip-modal-layer .btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.eip-shell .btn-primary, .eip-modal-layer .btn-primary { border-color: rgba(24, 73, 170, .9); background: linear-gradient(135deg, #1746a2 0%, #2563eb 55%, #1d4ed8 100%); color: #f8fbff; box-shadow: 0 8px 18px rgba(29, 78, 216, .22); }
.eip-shell .btn-primary:hover:not([disabled]), .eip-modal-layer .btn-primary:hover:not([disabled]) { border-color: rgba(24, 73, 170, .9); background: linear-gradient(135deg, #143d8f 0%, #1f57d6 55%, #1944be 100%); color: #fff; }
.eip-shell .btn.eip-btn-sm, .eip-modal-layer .btn.eip-btn-sm { min-height: 2rem; padding: .3rem .7rem; border-radius: .55rem; font-size: .78rem; }
.eip-shell .btn-danger, .eip-modal-layer .btn-danger { border: 1px solid #b91c1c; background: #b91c1c; color: #fff; }
.eip-shell .btn-danger:hover:not([disabled]), .eip-modal-layer .btn-danger:hover:not([disabled]) { border-color: #991b1b; background: #991b1b; color: #fff; }
.eip-shell .btn[disabled], .eip-modal-layer .btn[disabled] { opacity: .5; cursor: not-allowed; }
.eip-shell .eip-menu > summary.btn { min-width: 2.5rem; padding: .45rem .75rem; font-size: 1.15rem; }

/* Abas */
.eip-tabs { overflow-x: auto; }
.eip-tabs button { white-space: nowrap; }
.eip-tabs button:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; border-radius: .4rem; }

/* Barra de ações e estados vazios */
.eip-toolbar { align-items: center; justify-content: space-between; margin-top: 0; }
.eip-empty { display: grid; justify-items: start; gap: .35rem; }
.eip-actions { flex-wrap: wrap; justify-content: flex-start; }

/* Cartões de configuração */
.eip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.eip-card { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; }
.eip-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .14); }
.eip-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.eip-card > header strong { font-size: .98rem; overflow-wrap: anywhere; }
.eip-card p { margin: 0; }
.eip-card footer { margin-top: auto; }
.eip-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; margin: 0; }
.eip-mini dt { color: #64748b; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.eip-mini dd { margin: .1rem 0 0; font-size: .82rem; font-weight: 600; }

/* Resumo da configuração */
.eip-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.eip-summary-card { display: grid; gap: .2rem; padding: .8rem .9rem; border: 1px solid #e2e8f0; border-radius: .8rem; background: #f8fafc; }
.eip-summary-card span { color: #64748b; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.eip-summary-card strong { font-size: 1.05rem; }
.eip-summary-card small { color: #64748b; font-size: .72rem; }

/* Validação */
.eip-validation { margin-top: 1rem; padding: .85rem 1rem; border: 1px solid #bbf7d0; border-radius: .85rem; background: #f0fdf4; color: #166534; }
.eip-validation[data-tone="error"] { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.eip-validation h3, .eip-validation h4 { margin: 0 0 .4rem; font-size: .9rem; }
.eip-validation ul { margin: 0; padding-left: 1.1rem; font-size: .82rem; }

/* Regras */
.eip-rules-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.eip-rules-head h2 { margin: 0 0 .2rem; font-size: 1.2rem; }
.eip-rules-head p { margin: 0; }
.eip-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.eip-section-head h3 { margin: 0 0 .15rem; }
.eip-section-head p { margin: 0; }
.eip-table th, .eip-table td { padding: .55rem .8rem; }
.eip-table td .ecat-mono { margin-top: .15rem; }
.eip-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; }
.eip-inline-form label { display: grid; gap: .35rem; min-width: 14rem; color: #475569; font-size: .78rem; font-weight: 700; }
.eip-inline-form [data-ip-form-error] { flex-basis: 100%; margin: 0; }
.eip-inline-card { max-width: 60rem; }

/* Campos de formulário (selects/textarea seguem os inputs do catálogo) */
.eip-shell .ecat-form select, .eip-shell .ecat-form textarea, .eip-modal .ecat-form select, .eip-modal .ecat-form textarea, .eip-inline-form select, .eip-inline-form input {
  box-sizing: border-box; min-height: 2.55rem; padding: .62rem .75rem; border: 1px solid #cbd5e1; border-radius: .7rem; background: #fff; color: #172033; font: inherit; font-weight: 500;
}
.eip-shell .ecat-form textarea { min-height: 4.5rem; resize: vertical; }
.eip-shell .ecat-form input[readonly] { background: #f1f5f9; color: #64748b; }
.eip-shell .ecat-form label.eip-check, .eip-modal .ecat-form label.eip-check, .eip-check { display: flex; align-items: center; gap: .5rem; min-width: 0; color: #334155; font-size: .84rem; font-weight: 600; }
.eip-check input { width: 1rem; min-height: 1rem; margin: 0; }
.eip-fieldset { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: 0; padding: .6rem .85rem; border: 1px solid #e2e8f0; border-radius: .7rem; }
.eip-fieldset legend { padding: 0 .35rem; color: #475569; font-size: .76rem; font-weight: 700; }
.eip-note-field { display: grid; gap: .35rem; align-content: start; color: #475569; font-size: .78rem; font-weight: 700; }

/* Simulador */
.eip-result { display: grid; gap: 1rem; margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; }
.eip-total { display: grid; gap: .25rem; padding: 1.1rem 1.25rem; border-radius: .9rem; background: linear-gradient(135deg, #1d4ed8, #2563eb); color: #fff; }
.eip-total span { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.eip-total strong { font-size: 2.1rem; letter-spacing: -.02em; line-height: 1.1; }
.eip-total small { font-size: .76rem; opacity: .85; }
.eip-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; }
.eip-bucket { display: grid; gap: .15rem; padding: .65rem .8rem; border: 1px solid #e2e8f0; border-radius: .7rem; background: #f8fafc; }
.eip-bucket span { color: #64748b; font-size: .72rem; font-weight: 700; }
.eip-bucket strong { font-size: .95rem; }
.eip-bucket[data-zero="true"] { opacity: .55; }
.eip-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.eip-chips li { padding: .25rem .6rem; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .76rem; }
.eip-chips strong { color: #172033; }
.eip-warnings { margin: 0; padding: .7rem 1rem .7rem 1.9rem; border: 1px solid #fde68a; border-radius: .75rem; background: #fffbeb; color: #92400e; font-size: .82rem; }
.eip-memory { max-height: 28rem; }
.eip-memory .ecat-mono { white-space: normal; overflow-wrap: anywhere; }

/* Modal */
.eip-modal-layer { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 1rem; }
.eip-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15, 23, 42, .42); cursor: default; }
.eip-modal { position: relative; display: grid; gap: .8rem; width: min(34rem, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.25rem; border-radius: 1rem; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); box-sizing: border-box; }
.eip-modal.is-wide { width: min(52rem, 100%); }
.eip-modal > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.eip-modal h2 { margin: 0; font-size: 1.15rem; }
.eip-modal .eip-modal-form { max-width: none; padding: 0; border: 0; }
.eip-confirm { margin: 0; color: #334155; line-height: 1.5; }
.eip-history h3 { margin: 1rem 0 .5rem; font-size: .95rem; }
.eip-modal [hidden] { display: none !important; }

/* Assistente de configuração inicial */
.eip-wizard-header { align-items: flex-start; gap: 1rem; }
.eip-steps { display: flex; flex-wrap: wrap; gap: .4rem .6rem; margin: 0 0 1.1rem; padding: 0; list-style: none; counter-reset: none; }
.eip-steps li { display: flex; align-items: center; gap: .45rem; padding: .4rem .75rem .4rem .45rem; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #64748b; font-size: .8rem; font-weight: 600; }
.eip-steps li span { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 800; }
.eip-steps li[data-status="current"] { border-color: #2563eb; color: #1e3a8a; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.eip-steps li[data-status="current"] span { background: #2563eb; color: #fff; }
.eip-steps li[data-status="done"] { color: #166534; }
.eip-steps li[data-status="done"] span { background: #dcfce7; color: #166534; }
.eip-wizard { display: grid; gap: .9rem; max-width: 60rem; padding: 1.25rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; }
.eip-wizard h2 { margin: 0; font-size: 1.2rem; }
.eip-wizard h3 { margin: .4rem 0 0; font-size: .95rem; }
.eip-wizard > p, .eip-wizard-form > p { margin: 0; }
.eip-step-count { margin: 0; color: #2563eb; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.eip-wizard-form, .eip-wizard-form.ecat-form { display: grid; gap: .9rem; max-width: none; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.eip-wizard-nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .5rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.eip-wizard-nav .ecat-actions { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.eip-secondary-actions { margin: 0; justify-content: flex-start; }

/* Cartões de escolha (modelo e tipos) */
.eip-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .65rem; margin: 0; padding: 0; border: 0; }
.eip-choices.is-compact { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.eip-shell .ecat-form label.eip-choice, .eip-choice { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; padding: .85rem .9rem; border: 1px solid #cbd5e1; border-radius: .9rem; background: #fff; color: #172033; font-size: .88rem; font-weight: 600; cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.eip-shell .eip-choice input { width: 1.05rem; min-height: 1.05rem; margin: .15rem 0 0; padding: 0; accent-color: #2563eb; flex: none; }
.eip-choice span { display: grid; gap: .2rem; }
.eip-choice small { color: #64748b; font-size: .76rem; font-weight: 500; line-height: 1.35; }
.eip-choice:hover { border-color: #93c5fd; }
.eip-choice:has(input:checked) { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.eip-choice:has(input:focus-visible) { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Tabela de valor por módulo */
.eip-price-table tbody th[scope="row"] { background: transparent; color: #172033; font-size: .88rem; font-weight: 600; letter-spacing: normal; text-align: left; text-transform: none; }
.eip-price-table td { width: 16rem; }
.eip-money { display: flex; align-items: center; gap: .4rem; max-width: 12rem; }
.eip-money span { color: #64748b; font-size: .8rem; font-weight: 700; }
.eip-money input { box-sizing: border-box; width: 100%; min-height: 2.35rem; padding: .5rem .65rem; border: 1px solid #cbd5e1; border-radius: .6rem; font: inherit; text-align: right; }
.eip-money input:focus { outline: 2px solid #2563eb; outline-offset: 0; border-color: #2563eb; }
.eip-price-form [data-ip-form-error] { margin-top: .6rem; }
.eip-price-form > .ecat-actions { margin-top: .75rem; justify-content: flex-start; }

/* Seções expansíveis */
.eip-more { margin-top: 1rem; border: 1px solid #e2e8f0; border-radius: .9rem; background: #fff; }
.eip-more > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; padding: .8rem 1rem; color: #172033; font-size: .9rem; font-weight: 700; cursor: pointer; list-style: none; }
.eip-more > summary::-webkit-details-marker { display: none; }
.eip-more > summary::before { content: '▸'; color: #2563eb; transition: transform .12s ease; }
.eip-more[open] > summary::before { transform: rotate(90deg); }
.eip-more > summary small { color: #64748b; font-size: .76rem; font-weight: 500; }
.eip-more-body { padding: 0 1rem 1rem; }
.eip-more-body > .ecat-section:first-child, .eip-more-body > p + form + .ecat-section { margin-top: .5rem; }
.eip-modal .eip-more { margin-top: 0; }

/* Menu ⋮ */
.eip-menu { position: relative; }
.eip-menu > summary { list-style: none; min-width: 2.4rem; padding: .45rem .7rem; font-size: 1.1rem; line-height: 1; text-align: center; cursor: pointer; }
.eip-menu > summary::-webkit-details-marker { display: none; }
.eip-menu-list { position: absolute; z-index: 20; top: calc(100% + .35rem); left: 0; display: grid; min-width: 14rem; padding: .35rem; border: 1px solid #e2e8f0; border-radius: .8rem; background: #fff; box-shadow: 0 16px 40px rgba(15, 23, 42, .16); }
.eip-menu-list button { padding: .55rem .7rem; border: 0; border-radius: .55rem; background: transparent; color: #172033; font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.eip-menu-list button:hover:not([disabled]), .eip-menu-list button:focus-visible { background: #f1f5f9; outline: none; }
.eip-menu-list button[data-tone="danger"] { color: #b91c1c; }
.eip-menu-list button[disabled] { opacity: .5; cursor: not-allowed; }

/* Lista de tipos */
.eip-type-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.eip-type { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .9rem; border: 1px solid #e2e8f0; border-radius: .85rem; background: #fff; }
.eip-type strong { font-size: .92rem; }
.eip-type p { margin: .15rem 0 0; color: #64748b; font-size: .8rem; }
.eip-type.is-inactive { background: #f8fafc; }
.eip-type.is-inactive strong { color: #64748b; }
.eip-type-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem; }

/* Busca de endereço e mapa da base operacional */
.eip-geo { position: relative; display: grid; gap: .45rem; padding: .85rem; border: 1px solid #bfdbfe; border-radius: .9rem; background: #f8fbff; }
.eip-geo label { display: grid; gap: .35rem; color: #1e3a8a; font-size: .8rem; font-weight: 700; }
.eip-geo-suggest { display: grid; overflow: hidden; border: 1px solid #cbd5e1; border-radius: .7rem; background: #fff; box-shadow: 0 10px 28px rgba(15, 23, 42, .12); }
.eip-geo-suggest button { padding: .6rem .8rem; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; color: #172033; font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.eip-geo-suggest button:last-child { border-bottom: 0; }
.eip-geo-suggest button:hover, .eip-geo-suggest button:focus-visible { background: #eff6ff; outline: none; }
.eip-geo-status { margin: 0; color: #475569; font-size: .78rem; }
.eip-geo-status[data-tone="ok"] { color: #166534; }
.eip-geo-status[data-tone="warn"] { color: #92400e; }
.eip-geo-map { height: 15rem; border: 1px solid #cbd5e1; border-radius: .75rem; overflow: hidden; background: #e2e8f0; }

@media (max-width: 720px) {
  .ecat-shell.eip-shell { padding: 1rem; }
  .eip-rules-head, .eip-section-head, .eip-type, .eip-wizard-nav { flex-direction: column; align-items: stretch; }
  .eip-shell .ecat-form-grid, .eip-modal .ecat-form-grid { grid-template-columns: 1fr; }
  .eip-total strong { font-size: 1.7rem; }
  .eip-steps li { font-size: .74rem; }
  .eip-menu-list { left: auto; right: 0; }
}

/* ---- Consulta de preços vigentes, histórico e comparação (somente leitura) ---- */
.eip-seg { display: inline-flex; gap: 0; margin: 0 0 1rem; border: 1px solid #cbd5e1; border-radius: .7rem; overflow: hidden; background: #fff; }
.eip-seg button { appearance: none; border: 0; padding: .5rem .95rem; background: transparent; color: #475569; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.eip-seg button + button { border-left: 1px solid #cbd5e1; }
.eip-seg button.is-active { background: #2563eb; color: #fff; }
.eip-seg button:focus-visible { outline: 2px solid #1d4ed8; outline-offset: -2px; }
.eip-readonly { display: grid; gap: 1rem; }
.eip-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem 1.25rem; margin: 0; }
.eip-dl dt { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.eip-dl dd { margin: .2rem 0 0; font-size: .9rem; color: #0f172a; }
.eip-compare-form { align-items: flex-end; flex-wrap: wrap; }
.eip-compare-form label { display: grid; gap: .25rem; min-width: 14rem; font-size: .8rem; font-weight: 600; color: #475569; }
.eip-compare tr[data-change="added"] td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
.eip-compare tr[data-change="removed"] td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.eip-compare tr[data-change="changed"] td:first-child { box-shadow: inset 3px 0 0 #d97706; }
