/* Tela orçamentos: lista e Adicionar orçamento. Os blocos do formulário repetem as medidas da
   Nova venda (venda.css), presos a #quote-form, para não disputar arquivos com outras rodadas. */


#quote-form.saleform {
  --sf-line: #dfe2e6;
  --sf-input-line: #cfd4d9;
  --sf-head: #f7f7f7;
  --sf-disabled: #eaecef;
  --sf-addon: #fafafa;
  --sf-ink: #0f1b24;
  --sf-text: #4a5056;
  --sf-soft: #6e757c;
  --sf-th: #222529;
  --sf-req: #ec4335;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: 'Source Sans Pro', system-ui, sans-serif;
}

#quote-form .saleform-block {
  border: 1px solid var(--sf-line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

#quote-form .saleform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 73px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--sf-line);
  background: var(--sf-head);
}
#quote-form .saleform-head h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--sf-ink);
  font-size: 19.5px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: 0;
}
#quote-form .saleform-head h2 strong { font-weight: 600; }
#quote-form .saleform-head p { margin: 6px 0 0; color: var(--sf-soft); font-size: 11px; line-height: 14px; }
#quote-form .saleform-icon { width: 16px; height: 16px; flex: none; fill: currentColor; }
#quote-form .saleform-head h2 .saleform-icon { color: var(--sf-soft); margin-right: -3px; }
#quote-form .saleform-menu { display: inline-flex; color: var(--sf-soft); opacity: .8; background: transparent; border: 0; padding: 0; font: inherit; cursor: not-allowed; }
#quote-form .saleform-menu .saleform-icon { width: 18px; height: 18px; }

#quote-form .saleform-body { padding: 23px 20px 20px; }
#quote-form .saleform-block-table .saleform-body { padding: 0; }
#quote-form .saleform-body > .form-grid,
#quote-form .saleform-totals { column-gap: 30px; row-gap: 19px; }

#quote-form .field { gap: 0; }
#quote-form .field label {
  color: var(--sf-soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 19px;
}
#quote-form .field label.required::after { content: ' *'; color: var(--sf-req); }
#quote-form input:not([type="checkbox"]):not([type="radio"]),
#quote-form select,
#quote-form textarea {
  width: 100%;
  min-height: 37px;
  padding: 6px 12px;
  border: 1px solid var(--sf-input-line);
  border-radius: 3px;
  background: #fff;
  color: var(--sf-text);
  font: inherit;
  font-size: 16px;
  line-height: 23px;
  box-shadow: none;
}
#quote-form input:not([type="checkbox"]):not([type="radio"]), #quote-form select { height: 37px; }
#quote-form textarea { min-height: 86px; resize: vertical; }
#quote-form .button.saleform-add { font-size: 14px; }
#quote-form input::placeholder, #quote-form textarea::placeholder { color: var(--sf-soft); opacity: 1; }
#quote-form input:not([type="checkbox"]):not([type="radio"]):disabled, #quote-form select:disabled, #quote-form textarea:disabled {
  background: var(--sf-disabled);
  color: var(--sf-text);
  cursor: not-allowed;
  opacity: 1;
}
#quote-form .saleform-pending label { color: #8a9096; }
#quote-form .field:has(> .saleform-link) { position: relative; }
#quote-form .saleform-link { position: absolute; top: 2px; right: 0; color: #1f6fb2; font-size: 12px; line-height: 16px; text-decoration: none; }
#quote-form .saleform-link:hover { text-decoration: underline; }

#quote-form .saleform-group { display: flex; align-items: stretch; }
#quote-form .saleform-group > input, #quote-form .saleform-group > select { flex: 1; min-width: 0; }
#quote-form .saleform-group.has-prefix > input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
#quote-form .saleform-addon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 41px;
  padding: 0 10px;
  border: 1px solid var(--sf-input-line);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: var(--sf-addon);
  color: var(--sf-soft);
  font-size: 14px;
}
#quote-form .saleform-addon.is-after { border-right: 1px solid var(--sf-input-line); border-left: 0; border-radius: 0 3px 3px 0; }
#quote-form .saleform-group:has(.is-after) > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#quote-form .saleform-addon .saleform-icon { width: 18px; height: 18px; }

/* Tabela de produtos e serviços: cabeçalho de 45 px e linha de 63 px, como na referência. */
#quote-form .saleform-table-wrap { overflow-x: auto; }
#quote-form .saleform-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
#quote-form .saleform-table[hidden] { display: none; }
#quote-form .saleform-table th {
  height: 45px;
  padding: 8px 12px;
  border: 1px solid var(--sf-line);
  border-top: 0;
  background: var(--sf-head);
  color: var(--sf-th);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
#quote-form .saleform-table td { height: 63px; padding: 12px; border: 1px solid var(--sf-line); vertical-align: middle; }
#quote-form .saleform-table th:first-child, #quote-form .saleform-table td:first-child { border-left: 0; }
#quote-form .saleform-table th:last-child, #quote-form .saleform-table td:last-child { border-right: 0; }
#quote-form .saleform-table .col-item { width: 25.5%; }
#quote-form .saleform-table .col-details { width: 13%; }
#quote-form .saleform-table .col-qty { width: 10.4%; }
#quote-form .saleform-table .col-type { width: 11.8%; }
#quote-form .saleform-table .col-price { width: 10.4%; }
#quote-form .saleform-table .col-discount { width: 11.1%; }
#quote-form .saleform-table .col-subtotal { width: 10.4%; }
#quote-form .saleform-table .col-actions { width: 7.4%; text-align: center; }
#quote-form .saleform-table .saleform-addon { min-width: 34px; padding: 0 6px; font-size: 13px; }
#quote-form .saleform-req { color: var(--sf-req); }
#quote-form .saleform-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--sf-line);
  border-radius: 3px;
  background: #fff;
  color: var(--sf-soft);
  cursor: pointer;
}
#quote-form .saleform-icon-button.danger { color: #d9534f; }
#quote-form .saleform-icon-button:hover { background: #f4f5f6; }
#quote-form .saleform-empty { margin: 0; padding: 18px 20px 4px; color: var(--sf-soft); font-size: 14px; }
#quote-form .saleform-lines-foot { padding: 16px 16px 20px; }

#quote-form .button.saleform-add,
#quote-form .saleform-body > .form-grid .button.secondary {
  gap: 8px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--sf-ink);
  border-radius: 3px;
  background: #fff;
  color: var(--sf-ink);
  font-size: 14px;
  font-weight: 400;
}
#quote-form .button.saleform-add:disabled, #quote-form .saleform-body > .form-grid .button.secondary:disabled { border-color: var(--sf-input-line); color: #8a9096; cursor: not-allowed; }
#quote-form .button.saleform-add .saleform-icon { width: 14px; height: 14px; }

#quote-form .saleform-toggle { display: flex; }
#quote-form .saleform-toggle label { display: flex; margin: 0; cursor: pointer; }
#quote-form .saleform-toggle input { position: absolute; opacity: 0; pointer-events: none; }
#quote-form .saleform-toggle span {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--sf-input-line);
  border-left: 0;
  background: var(--sf-addon);
  color: var(--sf-soft);
  font-size: 14px;
}
#quote-form .saleform-toggle label:last-child span { border-radius: 0 3px 3px 0; }
#quote-form .saleform-toggle input:checked + span { background: var(--sf-ink); border-color: var(--sf-ink); color: #fff; }
#quote-form .saleform-toggle input:focus-visible + span { outline: 2px solid #1f6fb2; outline-offset: 1px; }
#quote-form .saleform-group:has(.saleform-toggle) > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
#quote-form .saleform-total-note { display: block; min-height: 16px; color: var(--sf-soft); font-size: 12px; }

#quote-form .saleform-payment { display: flex; flex-direction: column; gap: 14px; }
#quote-form .saleform-radios { display: flex; flex-wrap: wrap; gap: 16px; }
#quote-form .saleform-check, #quote-form .saleform-radio { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--sf-text); cursor: not-allowed; }
#quote-form .saleform-radio { min-width: 260px; padding: 12px 14px; border: 1px solid var(--sf-input-line); border-radius: 3px; background: #fff; }
#quote-form .saleform-check b, #quote-form .saleform-radio b { display: block; font-size: 14px; font-weight: 600; }
#quote-form .saleform-check small, #quote-form .saleform-radio small { display: block; color: var(--sf-soft); font-size: 12px; }
#quote-form .saleform-check input, #quote-form .saleform-radio input { margin-top: 3px; }
#quote-form .saleform-body > .form-grid > .span-3:has(.saleform-check) { display: flex; align-items: flex-end; padding-bottom: 6px; }

#quote-form .saleform-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 4px 0 24px; }
#quote-form .saleform-cancel { color: var(--sf-soft); font-size: 14px; text-decoration: none; }
#quote-form .saleform-cancel:hover { color: var(--sf-ink); text-decoration: underline; }
#quote-form .saleform-actions .button { min-height: 37px; padding: 7px 18px; border-radius: 3px; font-size: 15px; }

@media (max-width: 760px) {
  #quote-form .saleform-head { min-height: 0; }
  #quote-form .saleform-head h2 { flex-wrap: wrap; font-size: 18px; }
  #quote-form .saleform-body { padding: 16px; }
  #quote-form .saleform-radio { min-width: 0; flex: 1 1 100%; }
}

/* Faixa do orçamento aberto: número, situação, total e validade. */
#quote-form .quote-headbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px;
  border: 1px solid var(--sf-line);
  border-radius: 6px;
  background: #fff;
}
#quote-form .quote-headbar-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--sf-text); font-size: 14px; }
#quote-form .quote-headbar-info strong { color: var(--sf-ink); font-size: 16px; font-weight: 600; }
#quote-form .quote-headbar-note { margin: 0; color: var(--sf-soft); font-size: 13px; }
#quote-form .saleform-actions .button.secondary { margin-right: auto; }

.quote-status-open { background: #e8f1fb; color: #1f5f9e; }
.quote-status-approved { background: #e6f5ec; color: #1e7a45; }
.quote-status-rejected { background: #fdecec; color: #b42318; }

/* Lista vazia no desenho da referência: ícone redondo, título, texto, dois botões e três cartões. */
.quotes-page .quotes-actions { margin-bottom: 0; }
.quotes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 34px 26px;
  border: 1px solid #dfe2e6;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}
.quotes-empty-icon {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid #dfe2e6;
  border-radius: 50%;
  background: #f4f5f7;
  color: #0f1b24;
  font-size: 40px;
}
.quotes-empty h2 { margin: 9px 0 0; color: #0f1b24; font-size: 24px; font-weight: 600; }
.quotes-empty p { max-width: 500px; margin: 0; color: #4a5056; font-size: 15px; line-height: 22px; }
.quotes-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 18px; }
.quotes-empty-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.quotes-empty-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dfe2e6;
  border-radius: 6px;
  text-align: left;
}
.quotes-empty-card strong { display: block; color: #0f1b24; font-size: 15px; font-weight: 600; }
.quotes-empty-card small { display: block; margin-top: 2px; color: #6e757c; font-size: 11px; line-height: 21px; }
.quotes-empty-card-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 16px;
}
.quotes-empty-card-icon.violet { background: #efeafd; color: #6c3fd1; }
.quotes-empty-card-icon.blue { background: #e6f0fb; color: #1f6fc5; }
.quotes-empty-card-icon.green { background: #e3f6ec; color: #1e8a50; }

@media (max-width: 760px) {
  .quotes-empty { padding: 32px 16px 18px; }
  .quotes-empty-cards { grid-template-columns: 1fr; }
}

/* Segunda passada (2026-10-13): lista no padrão da referência e grade do formulário. Escopo: só Orçamentos. */
.quote-list .quote-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.quote-toolbar-left, .quote-toolbar-right { display: flex; align-items: center; gap: 4px; }
.quote-list .quote-toolbar .button { min-height: 37px; gap: 4px; }
.quote-list .quote-toolbar .button.secondary:disabled { color: #9aa1a7; }
.quote-caret::after { content: ''; display: inline-block; margin-left: 6px; border-top: 4px solid currentColor; border-right: 4px solid transparent; border-left: 4px solid transparent; vertical-align: middle; }
.quote-tool { display: inline-grid; place-items: center; width: 42px; height: 37px; padding: 0; border: 1px solid #d9dee2; border-radius: 4px; background: #fff; color: #0f1921; cursor: pointer; }
.quote-tool.is-dark { border-color: #0f1921; background: #0f1921; color: #fff; }
.quote-tool svg, .quote-icon { width: 16px; height: 16px; fill: currentColor; flex: none; }
.quote-month { height: 37px; padding: 0 30px 0 13px; border: 1px solid #0f1921; border-radius: 4px; background-color: #0f1921; color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
.quote-search { display: flex; flex-wrap: wrap; flex-basis: 100%; justify-content: flex-end; align-items: center; gap: 4px; }
.quote-search[hidden] { display: none; }
.quote-search input, .quote-search select { height: 37px; padding: 0 12px; border: 1px solid #cfd4d9; border-radius: 4px; font: inherit; }
.quote-search input { width: min(300px, 100%); }
.quotes-empty-icon svg { width: 44px; height: 44px; fill: currentColor; }
.quotes-empty-actions .button.secondary:disabled { opacity: 1; border-color: #0f1921; color: #0f1921; background: #fff; }
.quotes-empty-actions .quote-icon { width: 15px; height: 15px; }
.quotes-empty-card-icon svg { width: 16px; height: 16px; fill: currentColor; }
.quotes-empty-period { padding-top: 40px; }
/* Leva 6 (W2): a primeira linha usa 203/436/320/319 e as seguintes 320/319/320/319 (colunas e vãos em fr, sem gap). */
#quote-form .quote-data-grid { display: grid; grid-template-columns: 203fr 30fr 88fr 29fr 319fr 30fr 320fr 30fr 319fr; column-gap: 0 !important; row-gap: 19px; }
#quote-form .quote-data-grid > div { grid-column: auto !important; min-width: 0; }
#quote-form .quote-data-grid > div:nth-child(1) { grid-column: 1 / 2 !important; }
#quote-form .quote-data-grid > div:nth-child(2) { grid-column: 3 / 6 !important; }
#quote-form .quote-data-grid > div:nth-child(3) { grid-column: 7 / 8 !important; }
#quote-form .quote-data-grid > div:nth-child(4) { grid-column: 9 / 10 !important; }
#quote-form .quote-data-grid > div:nth-child(5), #quote-form .quote-data-grid > div:nth-child(9) { grid-column: 1 / 4 !important; }
#quote-form .quote-data-grid > div:nth-child(6), #quote-form .quote-data-grid > div:nth-child(10):not(.quote-intro-cell) { grid-column: 5 / 6 !important; }
#quote-form .quote-data-grid > div:nth-child(7) { grid-column: 7 / 8 !important; }
#quote-form .quote-data-grid > div:nth-child(8) { grid-column: 9 / 10 !important; }
#quote-form .quote-data-grid > .quote-intro-cell { grid-column: 1 / -1 !important; }
.quote-list .quote-toolbar .quote-tool { width: 42px; min-width: 42px; height: 37px; min-height: 37px; padding: 0; }
.quote-list .quote-toolbar .quote-month { width: auto; height: 37px; min-height: 37px; margin: 0; padding: 0 30px 0 13px; }

/* Orçamentos > Opções auxiliares (Campos extras, Mensagens): o estado vazio usa o mesmo desenho da lista. */
.quotes-page.fincfg-page .quotes-empty { margin-top: 0; }
.quotes-page.fincfg-page .quotes-empty-card-icon svg { width: 16px; height: 16px; fill: currentColor; }

/* Ícone do título das listas (o original traz um ícone antes do nome da tela). */
#page-title[data-route='quotes'][data-mode='list']::before { content: ''; display: inline-block; width: 24px; height: 24px; margin-right: 4px; vertical-align: -3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23262b2f'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z'/%3E%3C/svg%3E") center / contain no-repeat; }
#page-title[data-route='service-quotes'][data-mode='list']::before { content: ''; display: inline-block; width: 24px; height: 24px; margin-right: 4px; vertical-align: -3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23262b2f'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Lista Tipo desabilitada da linha: mantém as setas para cima e para baixo do original. */
#quote-form .saleform-table select:disabled {
  appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 6H1zM5 13 1 8h8z' fill='%23222529'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 9px 13px;
}

/* Leva 6 (W2): larguras das colunas da tabela de produtos medidas no original (352/187/148/170/149/160/149/93 px de 1408). */
#quote-form .saleform-table .col-item { width: 25%; }
#quote-form .saleform-table .col-details { width: 13.28%; }
#quote-form .saleform-table .col-qty { width: 10.51%; }
#quote-form .saleform-table .col-type { width: 12.07%; }
#quote-form .saleform-table .col-price { width: 10.58%; }
#quote-form .saleform-table .col-discount { width: 11.36%; }
#quote-form .saleform-table .col-subtotal { width: 10.58%; }
#quote-form .saleform-table .col-actions { width: 6.6%; }
/* Desconto da linha sem produto escolhido: um campo cinza só, com o placeholder R$ (o botão do tipo some). */
#quote-form .saleform-table .col-discount .saleform-group:has(> input:disabled) > .saleform-discount-type { display: none; }
#quote-form .saleform-table .col-discount .saleform-group:has(> input:disabled) > input { border-radius: 3px; width: 100%; }
#quote-form .saleform-table .col-discount input::placeholder { color: #9aa1a7; font-size: 12px; }
/* Botão Adicionar produto/serviço: 142 x 32 px no original. */
#quote-form .button.saleform-add { height: 32px; min-height: 32px; padding: 0 8px; gap: 6px; }
#quote-form .button.saleform-add .saleform-icon { width: 12px; height: 12px; }
#quote-form .saleform-table td input:not([type="hidden"]) { width: 100%; min-width: 0; box-sizing: border-box; }
