/* ============================================================================
   ERP MYCAR BROKER — Estilo (design system do site: vermelho, preto, Inter)
   ============================================================================
   Cores principais:
     - Vermelho (ações/CTA):  #f43f27   | hover: #d93420  (repintura Fase 6:
       mesmo laranja usado em agendamentos.css/match.css/importar.css/
       integrador.css, --ag-laranja/--ag-laranja-hover)
     - Preto (sidebar):       #121212
     - Fundo geral:           #FEFEFE
     - Cards:                 branco, borda #E8E8E8, sombra leve
     - Texto secundário:      #444444
   Fonte: Inter (Google Fonts, importada no <head> do index.html)
   ========================================================================== */

:root {
  --vermelho: #f43f27;
  --vermelho-hover: #d93420;
  --preto-sidebar: #121212;
  --fundo: #FEFEFE;
  --borda: #E8E8E8;
  --texto: #1A1A1A;
  --texto-secundario: #444444;
  --texto-claro: #8A8A8A;
  --radius: 8px;
  --sombra: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --sombra-media: 0 8px 24px rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }

.escondido { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
}

a { color: var(--vermelho); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------- */
/* Botões                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn-primario {
  background: var(--vermelho);
  color: #fff;
}
.btn-primario:hover { background: var(--vermelho-hover); }
.btn-primario:disabled { background: #F0A493; cursor: not-allowed; }

.btn-secundario {
  background: #fff;
  color: var(--texto);
  border-color: var(--borda);
}
.btn-secundario:hover { background: #F6F6F6; }

.btn-perigo {
  background: #fff;
  color: var(--vermelho);
  border-color: var(--vermelho);
}
.btn-perigo:hover { background: #FDEDEA; }

.btn-bloco { width: 100%; }
.btn-pequeno { padding: 6px 12px; font-size: 13px; }

/* ---------------------------------------------------------------------- */
/* TELA DE LOGIN                                                          */
/* ---------------------------------------------------------------------- */

.tela-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F5F5;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 12px;
  box-shadow: var(--sombra-media);
  padding: 40px 36px;
}

.login-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 28px;
  font-weight: 800;
}
.login-logo .logo-mycar { color: #121212; }
.login-logo .logo-broker { color: var(--vermelho); font-weight: 600; }

.campo { margin-bottom: 18px; }
.campo label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--texto);
}
.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--texto);
  background: #fff;
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--vermelho);
  box-shadow: 0 0 0 3px rgba(244, 63, 39, 0.12);
}
.campo textarea { resize: vertical; min-height: 70px; }
.campo-ajuda { font-size: 12px; color: var(--texto-claro); margin-top: 4px; }

.campo-senha-wrap { position: relative; }
.campo-senha-wrap input { padding-right: 42px; }
.botao-mostrar-senha {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  color: var(--texto-claro);
  font-size: 16px;
  line-height: 1;
}

.login-link-secundario {
  display: block;
  text-align: right;
  font-size: 13px;
  margin-bottom: 24px;
  color: var(--texto-secundario);
}

.login-erro {
  background: #FDECEA;
  color: #B3261E;
  border: 1px solid #F5C6C0;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------------- */
/* LAYOUT PRINCIPAL (sidebar + conteúdo)                                  */
/* ---------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  min-width: 264px;
  background: var(--preto-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-topo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.sidebar-logo .logo-mycar { color: #fff; }
.sidebar-logo .logo-broker { color: #B7B7B7; font-weight: 600; font-size: 16px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: #C9C9C9;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-nav a.ativo { background: var(--vermelho); color: #fff; }

.badge-em-breve {
  background: rgba(255, 255, 255, 0.12);
  color: #D8D8D8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.sidebar-rodape {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--vermelho);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-usuario-info { flex: 1; min-width: 0; }
.sidebar-usuario-nome {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-usuario-papel {
  font-size: 11px;
  color: #9A9A9A;
  text-transform: capitalize;
}

.btn-sair {
  background: none;
  border: none;
  color: #9A9A9A;
  font-size: 18px;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.btn-sair:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.conteudo {
  flex: 1;
  padding: 32px 40px;
  min-width: 0;
}

.menu-mobile-topo {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Cabeçalho de módulo                                                     */
/* ---------------------------------------------------------------------- */

.modulo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.modulo-header h1 { font-size: 22px; }

/* ---------------------------------------------------------------------- */
/* Cards de resumo (Início)                                                */
/* ---------------------------------------------------------------------- */

.cards-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card-resumo {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-resumo-numero { font-size: 30px; font-weight: 800; color: var(--texto); }
.card-resumo-label { font-size: 13px; color: var(--texto-secundario); font-weight: 500; }

/* Card "Veículos vendidos" clicável (Fase 6 — atalho para o Relatório de
   Vendas). Mantém a mesma aparência do .card-resumo comum, só troca o cursor
   e destaca borda/ícone no hover pra indicar que é um link. */
.card-resumo-link { cursor: pointer; text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.card-resumo-link:hover { border-color: var(--vermelho); box-shadow: var(--sombra-media); text-decoration: none; }
.card-resumo-link .card-resumo-label { display: flex; align-items: center; gap: 5px; }
.card-resumo-link .card-resumo-label i { font-size: 13px; color: var(--vermelho); }

/* ---------------------------------------------------------------------- */
/* Filtros / busca                                                        */
/* ---------------------------------------------------------------------- */

.filtros {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filtros input[type="text"],
.filtros input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.filtros select {
  padding: 10px 14px;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.filtros input:focus, .filtros select:focus {
  outline: none;
  border-color: var(--vermelho);
}

/* ---------------------------------------------------------------------- */
/* Tabelas                                                                 */
/* ---------------------------------------------------------------------- */

.tabela-wrap {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  overflow-x: auto;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tabela thead th {
  text-align: left;
  background: #F7F7F7;
  color: var(--texto-secundario);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--borda);
  white-space: nowrap;
}

.tabela tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--borda);
  color: var(--texto);
  vertical-align: middle;
}
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr:hover { background: #FAFAFA; }

.tabela .celula-secundaria { color: var(--texto-secundario); }
.tabela .celula-vazia { text-align: center; color: var(--texto-claro); padding: 32px 16px; }

/* ---------------------------------------------------------------------- */
/* Badges (tags coloridas)                                                 */
/* ---------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-cliente     { background: #E6F4FF; color: #0B63B0; }
.badge-fornecedor  { background: #FFF1E0; color: #B5570A; }
.badge-parceiro    { background: #E9F9EE; color: #1C8A4B; }

.badge-admin       { background: #FDEAEA; color: #d93420; }
.badge-consultor   { background: #E9F0FF; color: #3355CC; }
.badge-captador    { background: #FFF7DA; color: #9A7B00; }
.badge-central     { background: #EFEAFE; color: #5B3FCC; }

.badge-ativo       { background: #E7F8EE; color: #1C8A4B; }
.badge-inativo     { background: #F3F3F3; color: #777777; }

/* ---------------------------------------------------------------------- */
/* Módulo "em breve" (placeholder de fases futuras)                        */
/* ---------------------------------------------------------------------- */

.em-breve {
  background: #fff;
  border: 1px dashed var(--borda);
  border-radius: 12px;
  padding: 64px 32px;
  text-align: center;
  color: var(--texto-secundario);
}
.em-breve-icone {
  font-size: 40px;
  margin-bottom: 16px;
}
.em-breve h2 { font-size: 20px; margin-bottom: 8px; color: var(--texto); }
.em-breve p { max-width: 420px; margin: 0 auto; line-height: 1.5; }

/* ---------------------------------------------------------------------- */
/* Modal                                                                   */
/* ---------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--sombra-media);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
}

.modal-cabecalho {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.modal-cabecalho h2 { font-size: 18px; }
.modal-fechar {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--texto-claro);
  padding: 2px 6px;
  border-radius: 6px;
}
.modal-fechar:hover { background: #F2F2F2; color: var(--texto); }

.modal-subtitulo {
  color: var(--texto-secundario);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.modal-rodape {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--borda);
}

.seletor-tipo {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.seletor-tipo label {
  flex: 1;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-secundario);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.seletor-tipo input { display: none; }
.seletor-tipo input:checked + span { color: var(--vermelho); }
.seletor-tipo label:has(input:checked) {
  border-color: var(--vermelho);
  background: #FDF1EF;
  color: var(--vermelho);
}

.linha-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------------------------------------------------------------------- */
/* Toasts (feedback de sucesso/erro)                                       */
/* ---------------------------------------------------------------------- */

#toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra-media);
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 4px solid var(--vermelho);
  animation: toast-entrar 0.2s ease;
}
.toast-sucesso { border-left-color: #1C8A4B; }
.toast-erro { border-left-color: #d93420; }

@keyframes toast-entrar {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Utilitários                                                             */
/* ---------------------------------------------------------------------- */

.texto-secundario { color: var(--texto-secundario); }
.texto-carregando { color: var(--texto-claro); padding: 24px; text-align: center; }
.acoes-tabela { display: flex; gap: 8px; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox-inline input { width: 16px; height: 16px; }

/* ---------------------------------------------------------------------- */
/* Responsivo — sidebar vira menu no topo em telas pequenas               */
/* ---------------------------------------------------------------------- */

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }
  .sidebar-topo { padding: 0; border: none; }
  .sidebar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--preto-sidebar);
    padding: 12px;
    flex-direction: column;
    box-shadow: var(--sombra-media);
    z-index: 500;
  }
  .sidebar-nav.aberta { display: flex; }
  .sidebar-rodape {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0;
    background: var(--preto-sidebar);
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .sidebar.menu-aberto .sidebar-rodape { display: flex; margin-top: 220px; }

  .menu-mobile-topo {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    padding: 6px;
  }

  .conteudo { padding: 20px; }
  .linha-2col { grid-template-columns: 1fr; }
}

/* ============================================================================
   MÓDULO VEÍCULOS (Fase 2)
   ============================================================================ */

/* ---------------------------------------------------------------------- */
/* Badges de status/plano/interesse do veículo                            */
/* ---------------------------------------------------------------------- */

.badge-status-pendente  { background: #F0F0F0; color: #666666; }
.badge-status-ativo     { background: #E7F8EE; color: #1C8A4B; }
.badge-status-inativo   { background: #FFF7DA; color: #9A7B00; }
.badge-status-vendido   { background: #FDEAEA; color: #d93420; }
.badge-status-reprovado { background: #2A2A2A; color: #fff; }

.badge-plano-basico  { background: #E6F4FF; color: #0B63B0; }
.badge-plano-padrao  { background: #FFF7DA; color: #9A7B00; }
.badge-plano-premium { background: #E9F9EE; color: #1C8A4B; }
.badge-plano-vazio   { background: #F3F3F3; color: #999999; }

.badge-interesse-venda        { background: #E9F9EE; color: #1C8A4B; }
.badge-interesse-troca_maior  { background: #EFEAFE; color: #5B3FCC; }
.badge-interesse-troca_menor  { background: #EFEAFE; color: #5B3FCC; }

/* ---------------------------------------------------------------------- */
/* Toggle "Mostrar no Site"                                                */
/* ---------------------------------------------------------------------- */

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #D6D6D6; border-radius: 20px; transition: background-color 0.15s ease;
}
.toggle-slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.toggle-switch input:checked + .toggle-slider { background: var(--vermelho); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Tabela de veículos (miniatura de foto, colunas específicas)             */
/* ---------------------------------------------------------------------- */

.tabela-foto-mini {
  width: 56px; height: 40px; border-radius: 6px; object-fit: cover;
  background: #F0F0F0; border: 1px solid var(--borda); display: block;
}
.tabela-veiculo-modelo { font-weight: 600; }
.tabela-veiculo-versao { font-size: 12px; color: var(--texto-claro); text-transform: uppercase; }
.acoes-tabela-veiculo { display: flex; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }

/* ---------------------------------------------------------------------- */
/* Modais largos (cadastro completo / detalhes do veículo)                */
/* ---------------------------------------------------------------------- */

.modal-largo { max-width: 880px; }
.modal-medio { max-width: 620px; }

/* ---------------------------------------------------------------------- */
/* Abas (Dados do veículo / Fotos / Opcionais / Precificação / Plano)      */
/* ---------------------------------------------------------------------- */

.abas-nav {
  display: flex; gap: 4px; border-bottom: 1px solid var(--borda);
  margin-bottom: 20px; flex-wrap: wrap; overflow-x: auto;
}
.abas-nav button {
  background: none; border: none; padding: 10px 16px; font-size: 13.5px;
  font-weight: 600; color: var(--texto-secundario); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
}
.abas-nav button.ativa { color: var(--vermelho); border-bottom-color: var(--vermelho); }
.aba-conteudo { display: none; }
.aba-conteudo.ativa { display: block; }

/* ---------------------------------------------------------------------- */
/* Seções e grade de dados (usadas na tela "Detalhes do Veículo")         */
/* ---------------------------------------------------------------------- */

.secao-detalhe { margin-bottom: 24px; }
.secao-detalhe h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--vermelho); margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.grade-detalhe { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; }
.item-detalhe-label { font-size: 12px; color: var(--texto-claro); margin-bottom: 2px; }
.item-detalhe-valor { font-size: 14px; color: var(--texto); font-weight: 500; }
.linha-com-ocultar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lista-simples { margin: 0; padding-left: 18px; }
.lista-simples li { margin-bottom: 4px; }
.detalhe-acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.detalhe-cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

.miniaturas-fotos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.miniaturas-fotos img {
  width: 96px; height: 72px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--borda); flex-shrink: 0;
}
.sem-fotos-aviso { color: var(--texto-claro); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------------------------------------------------------------------- */
/* Upload de fotos (etapa completa)                                        */
/* ---------------------------------------------------------------------- */

.upload-fotos-area {
  border: 1px dashed var(--borda); border-radius: var(--radius); padding: 20px;
  text-align: center; color: var(--texto-secundario); margin-bottom: 14px; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.upload-fotos-area:hover { border-color: var(--vermelho); background: #FDF5F3; }
.upload-fotos-area input[type="file"] { display: none; }

.linha-foto-url { display: flex; gap: 10px; margin-bottom: 14px; }
.linha-foto-url input { flex: 1; }

.grade-fotos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 6px;
}
.foto-card {
  position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--borda);
  aspect-ratio: 4 / 3; background: #F0F0F0; cursor: grab;
}
.foto-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-card .foto-remover {
  position: absolute; top: 4px; right: 4px; background: rgba(18, 18, 18, 0.65); color: #fff;
  border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 13px; line-height: 1;
}
.foto-card .foto-capa-tag {
  position: absolute; bottom: 4px; left: 4px; background: var(--vermelho); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; text-transform: uppercase;
}
.foto-card.arrastando { opacity: 0.4; }

/* ---------------------------------------------------------------------- */
/* Galeria (modal "Fotos e vídeos do veículo")                             */
/* ---------------------------------------------------------------------- */

.galeria-modal { max-width: 720px; padding: 0; overflow: hidden; }
.galeria-cabecalho { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 0; }
.galeria-imagem-wrap { position: relative; padding: 16px 20px 8px; }
.galeria-imagem-wrap img {
  width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; background: #111; display: block;
}
.galeria-seta {
  position: absolute; top: 50%; transform: translateY(-50%); background: #fff; border: 1px solid var(--borda);
  border-radius: 50%; width: 36px; height: 36px; font-size: 16px; box-shadow: var(--sombra-media);
}
.galeria-seta.esquerda { left: 32px; }
.galeria-seta.direita { right: 32px; }
.galeria-contador { text-align: center; font-size: 12px; color: var(--texto-claro); padding-bottom: 20px; }

/* ---------------------------------------------------------------------- */
/* Cartões de escolha (Cliente Novo × Buscar na Base, Planos)              */
/* ---------------------------------------------------------------------- */

.cartoes-escolha { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.cartao-escolha {
  flex: 1; min-width: 200px; border: 1px solid var(--borda); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease;
}
.cartao-escolha:hover { border-color: var(--vermelho); }
.cartao-escolha.selecionado { border-color: var(--vermelho); background: #FDF1EF; }
.cartao-escolha h4 { font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.cartao-escolha p { font-size: 12.5px; color: var(--texto-secundario); line-height: 1.4; margin: 0; }

.grade-planos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.plano-card {
  border: 1px solid var(--borda); border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.plano-card:hover { border-color: var(--vermelho); }
.plano-card.selecionado { border-color: var(--vermelho); background: #FDF1EF; }
.plano-card input { display: none; }
.plano-card .plano-nome { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.plano-card .plano-desc { font-size: 12px; color: var(--texto-secundario); }

/* ---------------------------------------------------------------------- */
/* Busca de cliente (proprietário / comprador) dentro de modal             */
/* ---------------------------------------------------------------------- */

.resultado-busca-cliente {
  border: 1px solid var(--borda); border-radius: var(--radius); max-height: 260px; overflow-y: auto; margin-top: 10px;
}
.resultado-busca-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--borda); cursor: pointer;
}
.resultado-busca-item:last-child { border-bottom: none; }
.resultado-busca-item:hover { background: #FAFAFA; }
.resultado-busca-nome { font-weight: 600; }
.resultado-busca-sub { font-size: 12px; color: var(--texto-claro); }
.cliente-selecionado-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--vermelho); background: #FDF1EF; border-radius: var(--radius);
  padding: 12px 14px; margin-top: 14px;
}
.busca-sem-resultado { text-align: center; color: var(--texto-claro); padding: 24px 12px; font-size: 13px; }

/* ---------------------------------------------------------------------- */
/* Contador de caracteres / links discretos                                */
/* ---------------------------------------------------------------------- */

.contador-caracteres { text-align: right; font-size: 11px; color: var(--texto-claro); margin-top: -12px; margin-bottom: 12px; }

.btn-link-discreto {
  background: none; border: none; color: var(--texto-claro); font-size: 12.5px; text-decoration: underline;
  padding: 4px 0;
}
.btn-link-discreto:hover { color: var(--texto-secundario); }

/* ---------------------------------------------------------------------- */
/* Impressão (tela de Detalhes do Veículo)                                 */
/* ---------------------------------------------------------------------- */

@media print {
  body * { visibility: hidden; }
  #area-impressao, #area-impressao * { visibility: visible; }
  .modal-overlay {
    position: absolute !important; inset: auto !important; background: none !important; padding: 0 !important;
  }
  .modal {
    position: absolute; left: 0; top: 0; width: 100%; max-width: 100% !important;
    max-height: none !important; overflow: visible !important; box-shadow: none !important;
  }
  .modal-rodape, .modal-fechar, .detalhe-acoes, #toasts, .sidebar, .no-imprimir { display: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Pequenos complementos do módulo Veículos (subtítulo de formulário,      */
/* foto principal dos Detalhes, lista de checkboxes empilhados)            */
/* ---------------------------------------------------------------------- */

.form-subtitulo {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--texto-secundario); font-weight: 700; margin: 18px 0 10px;
}
.form-subtitulo:first-child { margin-top: 0; }

.detalhe-foto-principal { margin-bottom: 10px; }
.detalhe-foto-principal img {
  width: 100%; max-height: 340px; object-fit: contain; background: #111; border-radius: 8px; display: block;
}
.foto-clicavel { cursor: pointer; }

.lista-checkboxes { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 860px) {
  .grade-detalhe { grid-template-columns: 1fr; }
  .modal-largo, .modal-medio { max-width: 96vw; }
  .cartoes-escolha { flex-direction: column; }
  .galeria-seta.esquerda { left: 10px; }
  .galeria-seta.direita { right: 10px; }
}
