/* ================================================================
   PRECIFIKA — MODO DE VISUALIZAÇÃO E CONTROLE DE REVISÕES
   css/estimate-view.css — v1.0 — Agosto 2026

   Estilos para:
     • #page-estimate-view  — tela de visualização somente leitura
     • .ev-topbar           — barra superior da visualização
     • .ev-mode-badge       — badge MODO DE VISUALIZAÇÃO / EDITANDO / NOVA REVISÃO
     • .ev-rev-badge        — badge da revisão (Atual / Histórico)
     • .ev-proposal-*       — cabeçalho e grid de informações da proposta
     • .ev-stage-block      — bloco de etapa
     • .ev-items-table      — tabela de itens/serviços
     • .ev-totals-block     — bloco de totais
     • #ev-edit-choice-modal — modal de escolha de edição
     • #ev-history-modal    — modal de histórico de revisões
     • .ev-builder-badge    — badge injetado na topbar do builder
   ================================================================ */

/* ══════════════════════════════════════════════════════════════
   1. PÁGINA DE VISUALIZAÇÃO — LAYOUT BASE
   ══════════════════════════════════════════════════════════════ */

#page-estimate-view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: #f1f5f9;
}

#page-estimate-view.active {
  display: flex;
}

/* ── Topbar da visualização ─────────────────────────────────── */
.ev-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: #ffffff;
  border-bottom: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  flex-wrap: wrap;
}

.ev-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ev-topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ev-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ev-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 15px;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}

.ev-back-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #cbd5e1;
}

.ev-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ev-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}

.ev-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════
   2. BADGES DE MODO
   ══════════════════════════════════════════════════════════════ */

/* Badge principal — MODO DE VISUALIZAÇÃO */
.ev-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}

/* view — azul */
.ev-mode-badge--view {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1.5px solid #bfdbfe;
}

/* edit — laranja */
.ev-mode-badge--edit {
  background: #fff7ed;
  color: #c2410c;
  border: 1.5px solid #fed7aa;
}

/* new — verde */
.ev-mode-badge--new {
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #bbf7d0;
}

/* Badge de revisão — "Revisão 03 — Atual" / "Revisão 02 — Histórico" */
.ev-rev-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.ev-rev-badge--current {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.ev-rev-badge--history {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Badge injetado na topbar do builder (#as-status area) */
.ev-builder-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: 8px;
  vertical-align: middle;
}

.ev-builder-badge--edit {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.ev-builder-badge--new {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ══════════════════════════════════════════════════════════════
   3. ÁREA DE CONTEÚDO DA VISUALIZAÇÃO
   ══════════════════════════════════════════════════════════════ */

.ev-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Loading state ─────────────────────────────────────────── */
.ev-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  color: #64748b;
}

.ev-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: ev-spin .7s linear infinite;
}

@keyframes ev-spin { to { transform: rotate(360deg); } }

.ev-loading p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   4. CABEÇALHO DA PROPOSTA
   ══════════════════════════════════════════════════════════════ */

.ev-proposal-header {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ev-proposal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 8px;
}

.ev-proposal-code {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.ev-proposal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* Cores por status — mapeadas para as variáveis existentes */
.ev-status-rascunho   { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.ev-status-enviado    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ev-status-aprovado   { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ev-status-not_approved { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.ev-proposal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
}

.ev-info-cell {
  padding: 12px 20px;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.ev-info-cell:last-child {
  border-right: none;
}

.ev-info-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 3px;
}

.ev-info-value {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  word-break: break-word;
}

.ev-info-value--muted {
  color: #64748b;
  font-weight: 400;
}

/* ── Seção de texto longo (observações, condições) ─────────── */
.ev-text-section {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ev-text-section-header {
  padding: 11px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.ev-text-section-body {
  padding: 14px 18px;
  font-size: 13px;
  color: #374151;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ══════════════════════════════════════════════════════════════
   5. ETAPAS E ITENS
   ══════════════════════════════════════════════════════════════ */

.ev-stages-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ev-stages-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 0;
}

.ev-stage-block {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ev-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 6px;
}

.ev-stage-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ev-stage-subtotal {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
}

/* ── Tabela de itens ─────────────────────────────────────────── */
.ev-items-table-wrap {
  overflow-x: auto;
}

.ev-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ev-items-table thead tr {
  background: #f1f5f9;
}

.ev-items-table th {
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}

.ev-items-table th.text-right,
.ev-items-table td.text-right {
  text-align: right;
}

.ev-items-table th.text-center,
.ev-items-table td.text-center {
  text-align: center;
}

.ev-items-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}

.ev-items-table tbody tr:last-child {
  border-bottom: none;
}

.ev-items-table tbody tr:hover {
  background: #f8fafc;
}

.ev-items-table td {
  padding: 9px 12px;
  color: #374151;
  vertical-align: top;
}

.ev-item-name {
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 2px;
}

.ev-item-desc {
  font-size: 11px;
  color: #64748b;
  margin: 0;
  white-space: pre-wrap;
}

.ev-item-location {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

/* Sem itens */
.ev-no-items {
  padding: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-style: italic;
}

/* ── Itens sem agrupamento ──────────────────────────────────── */
.ev-items-block {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ev-items-block-header {
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ══════════════════════════════════════════════════════════════
   6. BLOCO DE TOTAIS
   ══════════════════════════════════════════════════════════════ */

.ev-totals-block {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ev-totals-header {
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.ev-totals-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #374151;
}

.ev-totals-row--discount {
  color: #dc2626;
}

.ev-totals-row--divider {
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
  padding-top: 12px;
}

.ev-totals-row--total {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}

.ev-totals-label {
  font-weight: 500;
}

.ev-totals-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   7. BANNERS DE AVISO (orçamento aprovado com obra ativa)
   ══════════════════════════════════════════════════════════════ */

.ev-approved-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.ev-approved-banner i {
  flex-shrink: 0;
  font-size: 16px;
  color: #f97316;
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════════
   8. MODAL DE ESCOLHA DE EDIÇÃO (#ev-edit-choice-modal)
   ══════════════════════════════════════════════════════════════ */

/* ev-edit-choice-modal é tanto o overlay quanto o container *
   JS controla com style.display = 'flex' / 'none'           */
#ev-edit-choice-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 3000;
  display: flex;     /* padrão: none (via style inline no HTML) */
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ev-choice-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}

.ev-choice-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.ev-choice-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px;
}

.ev-choice-subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.ev-choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 22px;
}

.ev-choice-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  background: #f8fafc;
  text-align: left;
}

.ev-choice-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.ev-choice-card:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.ev-choice-card--current:hover,
.ev-choice-card--current.focused {
  border-color: #f97316;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(249,115,22,.1);
}

.ev-choice-card--new:hover,
.ev-choice-card--new.focused {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}

.ev-choice-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.ev-choice-card--current .ev-choice-card-icon {
  background: #fff7ed;
  color: #f97316;
}

.ev-choice-card--new .ev-choice-card-icon {
  background: #f0fdf4;
  color: #22c55e;
}

.ev-choice-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}

.ev-choice-card-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
  line-height: 1.5;
}

.ev-choice-card-meta {
  font-size: 11px;
  color: #94a3b8;
  padding: 6px 10px;
  background: rgba(0,0,0,.04);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.ev-choice-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
  margin-top: auto;
}

.ev-choice-card-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ev-choice-card--current .ev-choice-card-btn {
  background: #f97316;
  color: #ffffff;
}

.ev-choice-card--current .ev-choice-card-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ev-choice-card--new .ev-choice-card-btn {
  background: #22c55e;
  color: #ffffff;
}

.ev-choice-card--new .ev-choice-card-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ev-choice-footer {
  padding: 0 22px 18px;
  display: flex;
  justify-content: center;
}

.ev-choice-cancel-btn {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ev-choice-cancel-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ══════════════════════════════════════════════════════════════
   9. MODAL DE HISTÓRICO DE REVISÕES (#ev-history-modal)
   ══════════════════════════════════════════════════════════════ */

/* ev-history-modal é tanto o overlay quanto o container *
   JS controla com style.display = 'flex' / 'none'          */
#ev-history-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 3000;
  display: flex;     /* padrão: none (via style inline no HTML) */
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ev-history-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ev-history-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.ev-history-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.ev-history-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.ev-history-close-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.ev-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Item do histórico */
.ev-hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}

.ev-hist-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.ev-hist-item--current {
  border-color: #22c55e;
  background: #f0fdf4;
}

.ev-hist-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.ev-hist-item--current .ev-hist-item-icon {
  background: #dcfce7;
  color: #16a34a;
}

.ev-hist-item:not(.ev-hist-item--current) .ev-hist-item-icon {
  background: #f1f5f9;
  color: #64748b;
}

.ev-hist-item-body {
  flex: 1;
  min-width: 0;
}

.ev-hist-item-code {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px;
}

.ev-hist-item-meta {
  font-size: 11px;
  color: #64748b;
  margin: 0;
}

.ev-hist-current-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.ev-hist-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ev-hist-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: background .15s, filter .15s;
  white-space: nowrap;
}

.ev-hist-view-btn:hover {
  background: #dbeafe;
  filter: brightness(.96);
}

/* Empty state */
.ev-history-empty {
  padding: 30px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════
   10. BOTÕES DE AÇÃO NA TOPBAR DA VISUALIZAÇÃO
   ══════════════════════════════════════════════════════════════ */

.ev-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: filter .15s, opacity .15s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1;
}

.ev-action-btn:hover {
  filter: brightness(.96);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.ev-action-btn--edit {
  background: #f97316;
  color: #ffffff;
  border-color: #ea580c;
}

.ev-action-btn--pdf {
  background: #f8fafc;
  color: #374151;
  border-color: #e2e8f0;
}

.ev-action-btn--clone {
  background: #f8fafc;
  color: #374151;
  border-color: #e2e8f0;
}

.ev-action-btn--history {
  background: #f8fafc;
  color: #374151;
  border-color: #e2e8f0;
}

.ev-action-btn--history.has-revisions {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}

/* ══════════════════════════════════════════════════════════════
   11. RESPONSIVIDADE MOBILE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ev-topbar {
    padding: 10px 14px;
    gap: 8px;
  }

  .ev-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    order: 3;
  }

  .ev-action-btn span {
    display: none; /* só ícone em telas pequenas */
  }

  .ev-action-btn {
    padding: 8px 10px;
    min-width: 36px;
    justify-content: center;
  }

  /* Exceto "Editar orçamento" — esse mantém texto */
  .ev-action-btn--edit span {
    display: inline;
  }

  .ev-content {
    padding: 14px 12px 50px;
    gap: 14px;
  }

  .ev-proposal-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ev-choice-options {
    grid-template-columns: 1fr;
  }

  .ev-items-table th,
  .ev-items-table td {
    padding: 7px 10px;
    font-size: 12px;
  }

  /* Oculta coluna de localização em telas pequenas */
  .ev-col-location { display: none; }

  .ev-totals-body {
    padding: 12px 14px;
  }

  .ev-totals-row--total {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .ev-title {
    font-size: 13px;
  }

  .ev-mode-badge {
    font-size: 10px;
    padding: 3px 7px;
  }

  .ev-proposal-code {
    font-size: 15px;
  }

  .ev-proposal-info-grid {
    grid-template-columns: 1fr;
  }

  #ev-edit-choice-modal,
  #ev-history-modal {
    border-radius: 12px;
  }
}

/* ══════════════════════════════════════════════════════════════
   12. UTILITÁRIOS
   ══════════════════════════════════════════════════════════════ */

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

.ev-divider {
  border: none;
  border-top: 1.5px solid #e2e8f0;
  margin: 4px 0;
}

/* Tag de anexos */
.ev-attachment-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  text-decoration: none;
  transition: background .15s;
}

.ev-attachment-tag:hover {
  background: #dbeafe;
}

/* Grid de anexos */
.ev-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
}
