/* ============================================================
 * Darvigo — Desktop legacy fixes (index.html)
 *
 * Patches CSS aplicados via <link> sem mexer no arquivo enorme.
 * Carregado no <head> do index.html depois dos outros estilos.
 *
 * Resolve:
 *  1. WhatsApp widget gigante pulsando no desktop
 *  2. Topbar denso demais (Sair direto + ícones repetidos)
 *  3. Modelos rápidos do Orçamento com layout 2018
 *  4. Densidade geral mais arejada (mais ar entre elementos)
 *  5. Botões com hover/transition melhores
 * ============================================================ */

/* --- 1. WhatsApp widget: invisível em desktop >1024px --- */
@media (min-width: 1025px) {
  #darvigoWhatsappBtn,
  #darvigoWaButton,
  .dv-wa-fab,
  [id*="whatsapp"][class*="float"],
  [class*="wa-float"]:not(.modal *) {
    width: 42px !important;
    height: 42px !important;
    bottom: 16px !important;
    right: 16px !important;
    opacity: .55 !important;
    transition: opacity .2s !important;
    animation: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.3) !important;
  }
  #darvigoWhatsappBtn:hover,
  #darvigoWaButton:hover,
  .dv-wa-fab:hover {
    opacity: 1 !important;
    transform: scale(1.05);
  }
  /* Cancela qualquer animação pulse */
  @keyframes darvigoPulse { 0%,100%{transform:none} 50%{transform:none} }
  @keyframes pulse { 0%,100%{transform:none} 50%{transform:none} }
}

/* --- 2. Topbar mais arejada --- */
.topbar, .top-bar, header.app-header {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  letter-spacing: -.1px;
}

/* "Sair" ainda visível mas menos chamativo (não removo do DOM) */
.topbar .btn-sair,
.topbar [onclick*="Sair"],
.topbar [onclick*="logout"],
.btn-logout-top {
  opacity: .7;
  font-weight: 500 !important;
  transition: opacity .15s;
}
.topbar .btn-sair:hover,
.topbar [onclick*="logout"]:hover {
  opacity: 1;
  color: #ef4444 !important;
}

/* Ícones repetidos na topbar — menos densidade */
.topbar > *:not(:last-child) {
  margin-right: 4px;
}

/* --- 3. Modelos rápidos do orçamento: virar grid compacto --- */
#aba-orcamento .templates-rapidos,
#aba-orcamento .modelos-rapidos,
.dv-quick-templates {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  gap: 6px !important;
  margin: 12px 0 !important;
}
#aba-orcamento .templates-rapidos button,
#aba-orcamento .modelos-rapidos button,
.dv-quick-templates button {
  background: linear-gradient(180deg, #1e1e1e, #1a1a1a) !important;
  color: #d4af37 !important;
  border: 1px solid rgba(212,175,55,.3) !important;
  padding: 9px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  text-align: center !important;
  transition: border-color .15s, transform .1s !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: -.1px !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  font-family: inherit !important;
}
#aba-orcamento .templates-rapidos button:hover,
.dv-quick-templates button:hover {
  border-color: #d4af37 !important;
  background: linear-gradient(180deg, #232323, #1e1e1e) !important;
}
#aba-orcamento .templates-rapidos button:active,
.dv-quick-templates button:active {
  transform: scale(.97);
}

/* --- 4. Cards padrão mais arejados --- */
.card, .dv-card, .panel, .module-panel {
  border-radius: 12px !important;
}

/* --- 5. Botões primários: hover mais suave --- */
button[class*="btn-primary"],
button[class*="primary"],
.btn-gold {
  transition: transform .1s, opacity .12s, background .12s, box-shadow .15s !important;
}
button[class*="primary"]:active,
.btn-gold:active {
  transform: scale(.98);
}

/* --- 6. Inputs: focus com cor de marca --- */
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 2px rgba(212,175,55,.15) !important;
}

/* --- 7. Scrollbar discreta (desktop) --- */
@media (min-width: 1025px) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: #0a0a0a; }
  ::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: #555; }
}

/* --- 8. Tooltip de "Espaço reservado para vídeo" se chegar até aqui --- */
.placeholder-video,
[class*="placeholder-video"],
[id*="placeholder-video"] {
  display: none !important;
}

/* --- 9. Densidade tabelas --- */
.table th, .table td, table.dv-table th, table.dv-table td {
  padding: 8px 12px !important;
  font-size: 13px;
}

/* --- 10. FAB do "+" se tiver no desktop legacy: mais discreto --- */
@media (min-width: 1025px) {
  .fab, .dv-fab, [class*="floating-add"] {
    bottom: 14px !important;
    right: 14px !important;
    width: 46px !important;
    height: 46px !important;
  }
}
