:root {
  --azul: #8a8a8a;
  --azul-esc: #146060;
  --azul-claro: #e6f4f4;
  --tinta: #1f2a37;
  --cinza: #6b7280;
  --linha: #e5e7eb;
  --fundo: #f4f7f9;
  --branco: #ffffff;
  --verde: #16a34a;
  --vermelho: #dc2626;
  --ambar: #d97706;
  --sombra: 0 6px 24px rgba(20, 40, 60, .08);
  --raio: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Tinos', Georgia, "Times New Roman", serif; color: var(--tinta); background: var(--fundo); }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--azul); font-weight: 700; }

/* ------------------------------- Botoes ------------------------------- */
.btn { border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 700; transition: .15s; }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-esc); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-ghost { background: transparent; color: var(--cinza); border: 1px solid var(--linha); }
.btn-ghost:hover { background: var(--fundo); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-danger { background: var(--vermelho); color: #fff; }
.btn-success { background: var(--verde); color: #fff; }

/* ------------------------------- Landing ------------------------------ */
.landing { min-height: 100vh; background: linear-gradient(135deg, var(--azul) 0%, var(--azul-esc) 100%); color: #fff; display: flex; flex-direction: column; }
.landing-top { display: flex; justify-content: space-between; align-items: center; padding: 22px 40px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; }
/* Brasao Dr. Reges Jr.: mesma proporcao do ERP (100:132) -- so a altura e fixada,
   travar largura e altura juntas distorceria o escudo. */
.brand-crest { display: block; height: 59px; width: auto; flex-shrink: 0; }
.brand-name strong { font-weight: 700; text-transform: uppercase; }
.sidebar-brand span { text-transform: uppercase; }
.landing-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 40px; }
.landing-hero h1 { font-size: 44px; line-height: 1.15; font-weight: 700; }
.landing-hero p { font-size: 18px; opacity: .9; }
.landing-rodape { text-align: center; padding: 24px 20px 28px; color: rgba(255,255,255,.85); font-size: 13.5px; line-height: 1.6; }
.landing-rodape p:first-child { font-weight: 400; }
.landing-rodape p.assinatura-yvetech { font-weight: 400; }
.landing-rodape .assinatura-yvetech a { color: #F3E5AB; text-decoration: none; font-weight: 700; }
.landing-rodape .assinatura-yvetech a:hover { text-decoration: underline; }

/* Marca do rodape: brasao acima, inscricao abaixo -- o mesmo desenho da home
   do site institucional. O nome sai em #F3E5AB, nao no --dourado do site: o
   fundo aqui e o gradiente teal, onde o dourado normal nao le (mesmo motivo
   da assinatura YveTech acima). Reaproveita `.brand-crest` -- e ela que ja
   carrega `width:auto` e o brilho dourado do tema, e o escudo e 100:132:
   travar as duas medidas o distorce. */
.landing-rodape .rodape-marca { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-bottom: 18px; }
.landing-rodape .rodape-marca .brand-crest { height: 72px; margin: 0 auto; }
.landing-rodape .rodape-marca-nome { font-weight: 700; font-size: 20px; letter-spacing: .5px; color: #F3E5AB; }

/* -------------------------------- Modal ------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 40, .55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); width: 100%; max-width: 560px; padding: 28px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal.modal-lg { max-width: 860px; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 26px; color: var(--cinza); line-height: 1; }
.login-card { max-width: 400px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head .brand-crest { height: 76px; margin: 0 auto 14px; padding: 12px 16px; background: #141414; border-radius: 14px; box-sizing: content-box; }
.login-head h2 { font-size: 22px; }
.login-head p { color: var(--cinza); font-size: 14px; margin-top: 4px; }

/* -------------------------------- Forms ------------------------------- */
form label { display: block; font-size: 13px; font-weight: 400; color: var(--tinta); margin-bottom: 14px; }
form input, form select, form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--linha); border-radius: 8px; font-family: inherit; background: #fff;
}
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--azul-claro); border-color: var(--azul); }
form textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .col-full { grid-column: 1 / -1; }
.form-erro { color: var(--vermelho); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* --------------------------------- App -------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 244px; background: #141414; color: #cfe3e6; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; font-weight: 700; font-size: 17px; color: #fff; }
.menu { display: flex; flex-direction: column; padding: 8px; gap: 2px; flex: 1; }
.menu-item { display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: none; color: #cfe3e6; padding: 12px 14px; border-radius: 8px; font-size: 14px; font-weight: 400; }
.menu-item:hover { background: rgba(255,255,255,.06); }
.menu-item.active { background: var(--azul); color: #fff; font-weight: 700; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-nome { font-size: 13.5px; color: #fff; font-weight: 400; }
.user-perfil { font-size: 11.5px; color: #9fc0c4; text-transform: capitalize; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; background: #fff; border-bottom: 1px solid var(--linha); }
.topbar h1 { font-size: 20px; }
.topbar-acoes { display: flex; gap: 10px; }
.view { padding: 24px 28px; overflow-x: auto; }

/* ------------------------------- Cards -------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 18px 20px; box-shadow: var(--sombra); }
.card .rotulo { font-size: 12.5px; color: var(--cinza); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card .valor { font-size: 26px; font-weight: 700; margin-top: 6px; }
.card .valor.verde { color: var(--verde); }
.card .valor.vermelho { color: var(--vermelho); }
.card .valor.ambar { color: var(--ambar); }

/* ------------------------------- Tabela ------------------------------- */
.painel { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.painel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--linha); flex-wrap: wrap; }
.painel-head h2 { font-size: 16px; }
.barra-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.barra-filtros input, .barra-filtros select { padding: 8px 10px; border: 1px solid var(--linha); border-radius: 8px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
th { background: #f8fafb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--cinza); }
tbody tr:hover { background: #f9fbfc; }
td .acoes { display: flex; gap: 6px; }
.vazio { text-align: center; color: var(--cinza); padding: 40px; }

/* ------------------------------- Badges ------------------------------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge.verde { background: #dcfce7; color: #166534; }
.badge.vermelho { background: #fee2e2; color: #991b1b; }
.badge.ambar { background: #fef3c7; color: #92400e; }
.badge.cinza { background: #eef2f5; color: #475569; }
.badge.azul { background: var(--azul-claro); color: var(--azul-esc); }

/* -------------------------------- Toast ------------------------------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--tinta); color: #fff; padding: 13px 18px; border-radius: 8px; font-size: 14px; box-shadow: var(--sombra); z-index: 80; max-width: 340px; }
.toast.ok { background: var(--verde); }
.toast.erro { background: var(--vermelho); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linha); margin-bottom: 16px; }
.tab { padding: 10px 16px; border: none; background: none; font-size: 14px; font-weight: 400; color: var(--cinza); border-bottom: 2px solid transparent; }
.tab.active { color: var(--azul); border-bottom-color: var(--azul); }
.mini-lista { display: flex; flex-direction: column; gap: 8px; }
.mini-item { border: 1px solid var(--linha); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; }
.mini-item .data { color: var(--cinza); font-size: 12px; }

@media (max-width: 820px) {
  .sidebar { width: 64px; }
  .sidebar-brand span:last-child, .menu-item span, .user-chip > div, .sidebar-foot .btn { display: none; }
  .menu-item { justify-content: center; }
  .landing-hero h1 { font-size: 30px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   CRM — componentes proprios (nao existem no ERP)
   ----------------------------------------------------------------------------
   Funil (kanban), historico de interacoes, snippets de mensagem, arquivos do
   lead, follow-ups/regua/resgate (listas de tarefa) e integracoes.
   O mapeamento de cor/vidro destas classes fica em liquid-glass-crm.css --
   aqui so a estrutura/layout, igual ao papel de style.css no ERP.
   ============================================================================ */

/* --------------------------------- Funil -------------------------------- */
.funil-board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.funil-coluna { flex: 0 0 260px; width: 260px; border-radius: var(--raio); border: 1px solid var(--linha); background: #fff; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.funil-coluna-head { padding: 12px 14px; border-bottom: 1px solid var(--linha); }
.funil-coluna-head h3 { font-size: 13px; line-height: 1.3; }
.funil-coluna-soma { font-size: 15px; font-weight: 700; margin-top: 4px; }
.funil-coluna-corpo { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.funil-coluna-corpo.drag-over { background: var(--azul-claro); }
.funil-cartao { border: 1px solid var(--linha); border-radius: 10px; padding: 10px 12px; background: #fff; cursor: grab; font-size: 13px; }
.funil-cartao:active { cursor: grabbing; }
.funil-cartao.dragging { opacity: .4; }
.funil-cartao .fc-nome { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.funil-cartao .fc-linha { color: var(--cinza); font-size: 12px; margin-bottom: 2px; }
.funil-cartao .fc-valor { font-weight: 700; margin-top: 6px; }
.funil-vazio { font-size: 12px; color: var(--cinza); text-align: center; padding: 14px 4px; }

/* --------------------------- Detalhe do lead ---------------------------- */
.lead-cabecalho { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.lead-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 18px; margin-bottom: 4px; }
.lead-info-grid .li-rotulo { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--cinza); }
.lead-info-grid .li-valor { font-size: 14px; margin-top: 2px; }

/* ------------------------------- Snippets ------------------------------- */
.snippet-item { border: 1px solid var(--linha); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.snippet-item .sn-rotulo { font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.snippet-item .sn-texto { color: var(--cinza); font-size: 12.5px; margin-bottom: 8px; white-space: pre-wrap; }
.snippet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------- Arquivos -------------------------------- */
.arquivo-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--linha); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.arquivo-item .ar-nome { font-weight: 700; }
.arquivo-item .ar-meta { color: var(--cinza); font-size: 11.5px; }
.arquivo-item .ar-acoes { display: flex; gap: 6px; flex-shrink: 0; }

/* ----------------------- Follow-ups / regua / resgate -------------------- */
.tarefa-item { display: flex; justify-content: space-between; gap: 14px; border: 1px solid var(--linha); border-radius: 10px; padding: 12px 16px; background: #fff; flex-wrap: wrap; }
.tarefa-info { flex: 1; min-width: 200px; }
.tarefa-info .ta-nome { font-weight: 700; font-size: 14.5px; }
.tarefa-info .ta-meta { color: var(--cinza); font-size: 12.5px; margin-top: 2px; }
.tarefa-info .ta-msg { font-size: 12.5px; margin-top: 8px; color: var(--tinta); background: var(--fundo); border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; }
.tarefa-acoes { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }

/* ------------------------------ Integracoes ------------------------------ */
.integracao-item { border: 1px solid var(--linha); border-radius: 10px; padding: 14px 16px; background: #fff; margin-bottom: 12px; }
.integracao-item .in-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.integracao-item .in-notas { font-size: 12px; color: var(--cinza); margin-bottom: 8px; white-space: pre-wrap; }
.integracao-item .in-campo { display: flex; gap: 8px; align-items: center; }
.integracao-item .in-campo input { margin-top: 0; }

@media (max-width: 640px) {
  .funil-coluna { flex: 0 0 220px; width: 220px; }
}
