@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #1F283D;
  --navy-2: #2A333D;
  --teal: #2EC9D3;
  --teal-light: #44DCE4;
  --teal-50: #EAFBFC;
  --teal-100: #D5F5F7;
  --whatsapp: #2EC047;
  --whatsapp-dark: #1C9230;
  --ink: #1F283D;
  --muted: #7A7A7A;
  --muted-2: #54595F;
  --line: #e7e9ec;
  --amber: #FFBA1E;
  --red: #E0393E;
  --red-bg: #FCEAEA;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --shadow-sm: 0 2px 10px rgba(31,40,61,.06);
  --shadow-md: 0 18px 44px rgba(31,40,61,.12);
  --sans: 'Poppins', -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
img { max-width: 100%; }
body {
  font-family: var(--sans);
  margin: 0;
  background: #F3F5F7;
  color: var(--ink);
  font-size: 13.5px;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- topo com logo ---------- */
.topo-hostlax {
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.topo-hostlax img.logo,
.login-box img.logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  display: block;
}
.topo-hostlax .topo-acoes { display: flex; align-items: center; gap: 18px; font-size: 12.5px; font-weight: 500; }
.topo-hostlax .topo-acoes a { color: #cfe9ec; }
.topo-hostlax .topo-acoes a:hover { color: var(--teal-light); }

.pagina {
  max-width: 1600px;
  width: 94%;
  margin: 28px auto;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--teal);
  overflow: hidden;
}

.stat-cards {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 150px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.stat-card .stat-valor { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
}
.card-header .fechar {
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
}
.card-header .fechar:hover { color: var(--red); }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--teal-50);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) var(--teal-50);
}
.tabs::-webkit-scrollbar { height: 7px; }
.tabs::-webkit-scrollbar-track { background: var(--teal-50); }
.tabs::-webkit-scrollbar-thumb { background: var(--teal); border-radius: var(--pill); }
.tabs button {
  border: none;
  background: transparent;
  padding: 13px 20px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-2);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hlx-tab-icon { width: 15px; height: 15px; flex-shrink: 0; }
.linha label .hlx-tab-icon { width: 13px; height: 13px; margin-right: 2px; vertical-align: -2px; }
.tabs button:hover { color: var(--navy); }
.tabs button.ativa {
  background: var(--white);
  font-weight: 700;
  color: var(--navy);
  border-bottom: 3px solid var(--teal);
}

.tab-conteudo {
  padding: 20px 22px;
  background: var(--white);
}

.linha {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.linha label { font-weight: 600; margin-right: 2px; color: var(--muted-2); font-size: 12.5px; }

input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-100);
}

button, .btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  transition: transform .05s ease, box-shadow .15s ease;
}
button:hover { box-shadow: var(--shadow-sm); }
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn-primario { background: var(--teal); border-color: var(--teal); color: var(--navy); font-weight: 700; }
.btn-primario:hover { background: var(--teal-light); }
.btn-perigo { background: var(--white); border-color: var(--red); color: var(--red); }
.btn-perigo:hover { background: var(--red-bg); }
.btn-sucesso { background: var(--white); border-color: var(--whatsapp); color: var(--whatsapp-dark); }
.btn-sucesso:hover { background: #EAFBEE; }
.btn-ativo { background: var(--whatsapp); border-color: var(--whatsapp); color: var(--white); }
.btn-inativo { background: var(--red); border-color: var(--red); color: var(--white); }

/* ---------- toasts (mensagens no canto, sem popup nativo) ---------- */
.hlx-toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.hlx-toast { background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-size: 13px; max-width: 340px; animation: hlx-toast-in .18s ease-out; }
.hlx-toast a { color: var(--teal-light); }
.hlx-toast-ok { background: var(--whatsapp-dark); }
.hlx-toast-erro { background: var(--red); }
@keyframes hlx-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- modal de confirmacao (substitui confirm()/alert() nativos) ---------- */
.hlx-modal-overlay { position: fixed; inset: 0; background: rgba(31,40,61,.45); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.hlx-modal { background: var(--white); border-radius: var(--radius); padding: 24px; max-width: 380px; box-shadow: var(--shadow-md); }
.hlx-modal p { margin: 0 0 18px; font-size: 14px; color: var(--ink); line-height: 1.5; }
.hlx-modal-acoes { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- modal de detalhes da empresa (maior, com grade de campos) ---------- */
.hlx-modal-grande { max-width: 640px; width: 90vw; max-height: 85vh; overflow-y: auto; }
.hlx-detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.hlx-detalhe-campo { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink); word-break: break-word; }
.hlx-detalhe-rotulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* ---------- busca de clientes WHMCS ---------- */
.hlx-busca-whmcs { position: relative; margin-bottom: 14px; }
.hlx-busca-whmcs input { width: 320px; }
.hlx-busca-resultados { position: absolute; top: 100%; left: 0; margin-top: 4px; width: 420px; max-height: 320px; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); z-index: 50; display: none; }
.hlx-busca-resultados.aberta { display: block; }
.hlx-busca-item { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hlx-busca-item:last-child { border-bottom: none; }
.hlx-busca-item strong { display: block; color: var(--ink); }
.hlx-busca-item span { color: var(--muted); font-size: 12px; }
.hlx-busca-item a { float: right; }
.hlx-busca-vazio { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

.secao {
  background: #FAFBFC;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.secao h4 { margin: 0 0 10px; font-size: 13px; color: var(--navy); font-weight: 700; }

.aviso { color: var(--muted); font-size: 12px; }
.msg-ok { color: var(--whatsapp-dark); font-weight: 600; }
.msg-erro { color: var(--red); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--white); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #FAFBFC; position: sticky; top: 0; color: var(--muted-2); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
tbody tr:hover { background: var(--teal-50); }
.tabela-wrap { overflow: auto; max-height: 55vh; border: 1px solid var(--line); border-radius: var(--radius); }

.badge { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: 11px; font-weight: 700; }
.badge-tem { background: var(--teal-50); color: #0E8790; }
.badge-pendente { background: #FFF6E0; color: #97730A; }
.badge-enviado { background: var(--teal-50); color: #0E8790; }
.badge-invalido { background: var(--red-bg); color: var(--red); }
.badge-bloqueado { background: #EEE; color: var(--muted); }
.badge-cliente { background: #E8F8EC; color: var(--whatsapp-dark); }
.badge-sem { background: var(--red-bg); color: var(--red); }
.badge-fora { background: #FFF6E0; color: #97730A; }
.badge-ruim { background: #FFF6E0; color: #97730A; }
.badge-none { background: #EEE; color: var(--muted); }

.rodape {
  display: flex;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.paginacao { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted-2); }

.login-box {
  max-width: 360px;
  margin: 100px auto;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
}
.login-box h1 { font-size: 18px; margin: 0 0 20px; color: var(--navy); font-weight: 700; }
.login-box .linha { flex-direction: column; align-items: stretch; gap: 14px; }
.login-box input { width: 100%; padding: 10px 12px; }
.login-box button { width: 100%; padding: 11px; margin-top: 4px; }
