/* GrupoCRM — acabamento visual (só aspeto, não mexe em dados nem funções).
   Servido pelo nginx em /_efeitos/efeitos.css e ligado ao CRM sem tocar no código da app.
   Para desligar: repor a cópia de segurança da configuração do nginx (ver /var/www/crm-efeitos/LEIA-ME.txt). */

:root{
  --fx-sombra: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.06);
  --fx-sombra-forte: 0 2px 4px rgba(15,23,42,.05), 0 12px 28px rgba(29,78,216,.13);
  --fx-borda: rgba(203,213,225,.75);
  --fx-curva: cubic-bezier(.2,.8,.2,1);
}

/* Fundo: cinzento suave com um toque do azul do GrupoCRM */
body{
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 100% -10%, rgba(29,78,216,.09), rgba(29,78,216,0) 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(14,165,233,.07), rgba(14,165,233,0) 60%),
    linear-gradient(180deg, #f5f7fb 0%, #eef2f8 100%);
  background-attachment: fixed;
}

/* Menu lateral: azul-noite em degradê e item ativo com brilho */
.sidebar{
  background: linear-gradient(180deg, #0f172a 0%, #111c3a 60%, #172554 100%);
  box-shadow: 4px 0 24px rgba(15,23,42,.10);
}
.nav a{ transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.nav a.active{
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 16px rgba(29,78,216,.35), inset 0 1px 0 rgba(255,255,255,.15);
}

/* Cartões, indicadores e tabelas: cantos mais suaves e sombra em camadas */
.card, .kpi{
  background-color: rgba(255,255,255,.92);
  border-color: var(--fx-borda);
  border-radius: 12px;
  box-shadow: var(--fx-sombra);
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s var(--fx-curva);
}
.kpi:hover{
  transform: translateY(-2px);
  box-shadow: var(--fx-sombra-forte);
  border-color: rgba(147,180,245,.9);
}
.kpi .v{ letter-spacing: -.01em; }

table.list{
  border-color: var(--fx-borda);
  border-radius: 12px;
  box-shadow: var(--fx-sombra);
}
table.list th{ background: linear-gradient(180deg, #f8fafc, #f2f5fa); }
table.list tbody tr{ transition: background-color .15s ease; }
table.list tbody tr:hover{ background: #f1f5ff; }

/* Cartões do kanban: sombra ao passar o rato (sem mexer no arrastar) */
.kcard{ transition: box-shadow .2s ease, border-color .2s ease; }
.kcard:hover{ box-shadow: 0 6px 16px rgba(15,23,42,.10); border-color: rgba(147,180,245,.9); }
.kcard.dragging{ box-shadow: none; }

/* Botões */
.btn{ transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease; }
.btn:active:not(:disabled){ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 1px 2px rgba(29,78,216,.25), 0 4px 12px rgba(29,78,216,.20), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn.primary:hover{
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  box-shadow: 0 2px 4px rgba(29,78,216,.25), 0 8px 18px rgba(29,78,216,.26);
}

/* Campos: anel azul suave quando se escreve */
input, select, textarea{ transition: border-color .18s ease, box-shadow .18s ease; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):focus,
select:focus, textarea:focus{
  border-color: #93b4f5;
  box-shadow: 0 0 0 3px rgba(29,78,216,.14);
  outline: none;
}

/* Janelas: fundo desfocado e sombra mais profunda */
.modal-bg{ backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal{ box-shadow: 0 24px 64px rgba(15,23,42,.28); }

/* Página de entrada: cartão em vidro sobre o degradê */
.login .card{
  background-color: rgba(255,255,255,.90);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: rgba(255,255,255,.6);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2,6,23,.35);
}

/* Animações de entrada (ligadas pelo efeitos.js só ao mudar de página) */
@keyframes fx-subir{ from{ opacity: 0; transform: translateY(12px); } to{ opacity: 1; transform: none; } }
@keyframes fx-aparecer{ from{ opacity: 0; } to{ opacity: 1; } }
@keyframes fx-janela{ from{ opacity: 0; transform: translateY(10px) scale(.98); } to{ opacity: 1; transform: none; } }

body.fx-entrar #page > *{ animation: fx-subir .5s var(--fx-curva) both; }
body.fx-entrar #page > *:nth-child(2){ animation-delay: .06s; }
body.fx-entrar #page > *:nth-child(3){ animation-delay: .12s; }
body.fx-entrar #page > *:nth-child(4){ animation-delay: .18s; }
body.fx-entrar #page > *:nth-child(n+5){ animation-delay: .24s; }

body.fx-entrar #page .grid > *{ animation: fx-subir .55s var(--fx-curva) both; }
body.fx-entrar #page .grid > *:nth-child(2){ animation-delay: .07s; }
body.fx-entrar #page .grid > *:nth-child(3){ animation-delay: .14s; }
body.fx-entrar #page .grid > *:nth-child(4){ animation-delay: .21s; }
body.fx-entrar #page .grid > *:nth-child(n+5){ animation-delay: .28s; }

body.fx-entrar #page table.list tbody tr{ animation: fx-aparecer .45s ease both; }
body.fx-entrar #page table.list tbody tr:nth-child(2){ animation-delay: .03s; }
body.fx-entrar #page table.list tbody tr:nth-child(3){ animation-delay: .06s; }
body.fx-entrar #page table.list tbody tr:nth-child(4){ animation-delay: .09s; }
body.fx-entrar #page table.list tbody tr:nth-child(5){ animation-delay: .12s; }
body.fx-entrar #page table.list tbody tr:nth-child(6){ animation-delay: .15s; }
body.fx-entrar #page table.list tbody tr:nth-child(n+7){ animation-delay: .18s; }

body.fx-entrar #page .kcard{ animation: fx-subir .45s var(--fx-curva) both; }

.fx-abrir{ animation: fx-aparecer .2s ease both; }
.fx-abrir .modal{ animation: fx-janela .28s var(--fx-curva) both; }

/* Quem prefere menos movimento não vê animações */
@media (prefers-reduced-motion: reduce){
  body.fx-entrar #page *, .fx-abrir, .fx-abrir .modal{ animation: none !important; }
  .nav a, .card, .kpi, .kcard, .btn, table.list tbody tr, input, select, textarea{ transition: none !important; }
  .kpi:hover, .btn:active:not(:disabled){ transform: none !important; }
}

/* Impressão sem fundos */
@media print{
  body{ background: #fff !important; }
  .card, .kpi, table.list{ box-shadow: none !important; }
}
