/* HigiSys Disparo — design system (seção 17 da ARQUITETURA.md) */

/* 17.3 Fontes — servidas do próprio domínio (sem Google Fonts) */
@font-face { font-family: 'Open Sans Display';
  src: url('/assets/fonts/OpenSans-VariableFont_wdth_wght.ttf') format('truetype');
  font-weight: 300 800; font-stretch: 87.5%; font-display: swap; }
@font-face { font-family: 'Open Sans';
  src: url('/assets/fonts/OpenSans-VariableFont_wdth_wght.ttf') format('truetype');
  font-weight: 300 800; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: 'Open Sans';
  src: url('/assets/fonts/OpenSans-Italic-VariableFont_wdth_wght.ttf') format('truetype');
  font-weight: 300 800; font-stretch: 75% 125%; font-style: italic; font-display: swap; }

/* 17.2 Variáveis */
:root {
  --navy:    #012551;
  --navy-2:  #254469;
  --forest:  #0CB191;
  --forest-d:#0A9177;
  --gold:    #0060C3;
  --gold-d:  #0060C3;
  --ivory:   #F4F7F9;
  --ivory-d: #E3E6E8;
  --white:   #FAFBFC;

  --text-on-dark:     #EFEFEA;
  --text-muted-dark:  rgba(239,239,234,0.66);
  --text-on-light:    #101D2D;
  --text-muted-light: #515F74;
  --border-light:     #CDCFD1;
  --on-acao:      #1A1F24;
  --on-destaque:  #EFEFEA;
  --gold-on-navy: #5092D6;
  --ink: var(--navy);

  --ok: #2F6B3C;     --ok-bg: #DDEAD7;
  --warn: #9A5B23;   --warn-bg: #F2E3C8;
  --danger: #A8402F; --danger-bg: #F4DDD6;
  --link: var(--forest);

  --font-display: 'Open Sans Display', 'Open Sans', system-ui, sans-serif;
  --font-body:    'Open Sans', system-ui, sans-serif;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20,24,31,0.06);
  --shadow:    0 4px 16px rgba(20,24,31,0.08);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition: 0.18s var(--ease);
  --wa-bubble: #DCF8C6;
  --wa-bubble-text: #101D2D;
}

:root[data-theme="dark"] {
  --ivory:   #14161F;  --ivory-d: #232733;  --white: #1B1E2A;
  --ink:     #EDE7D6;
  --text-on-light: #E6E1D2;  --text-muted-light: #9A9484;
  --border-light:  #333849;
  --link:    #8FBE9A;
  --ok: #7FC489;    --ok-bg: rgba(47,107,60,0.24);
  --warn: #E3A85E;  --warn-bg: rgba(154,91,35,0.26);
  --danger: #E8897A;--danger-bg: rgba(168,64,47,0.26);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow:    0 6px 22px rgba(0,0,0,0.45);
  --wa-bubble: #005C4B;
  --wa-bubble-text: #EDE7D6;
}
:root[data-theme="dark"] body { background: var(--ivory); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.6;
  color: var(--text-on-light);
  background: var(--ivory);
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin: 0 0 12px; }
h2.aba-titulo, .aba h2 { font-size: 22px; }
a { color: var(--link); }

/* Layout principal */
main.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px; overflow-x: clip; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grade-2 { grid-template-columns: minmax(0, 1fr); } }

/* 16.1 Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: var(--text-on-dark);
  min-height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
}
.topbar .marca { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.topbar .marca img { max-height: 32px; max-width: 140px; object-fit: contain; }
.topbar .selo-disparo { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-on-navy); font-weight: 700; }
.topbar .abas { display: flex; gap: 4px; }
.topbar .aba-btn {
  background: transparent; border: 0; color: var(--text-muted-dark);
  font: 700 14px var(--font-body); padding: 10px 14px; border-radius: var(--radius);
  cursor: pointer; min-height: 44px; white-space: nowrap;
}
.topbar .aba-btn.active, .topbar .aba-btn:hover { color: var(--text-on-dark); background: rgba(255,255,255,0.08); }
.topbar .tools { display: flex; align-items: center; gap: 8px; }
.topbar .icon-btn {
  background: transparent; border: 1px solid rgba(239,239,234,0.25); color: var(--text-on-dark);
  border-radius: var(--radius); min-width: 44px; min-height: 44px; font-size: 17px; cursor: pointer;
}
.topbar .user-nome { font-size: 13px; color: var(--text-muted-dark); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .link-sair { color: var(--text-muted-dark); font-size: 13px; }

/* Faixa de aviso */
.faixa-aviso {
  background: var(--warn-bg); color: var(--warn);
  padding: 10px 16px; font-size: 14px; text-align: center;
}
.faixa-aviso a { color: inherit; font-weight: 700; }

/* Status WhatsApp */
.wa-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-on-dark); }
.wa-bolinha { width: 10px; height: 10px; border-radius: 50%; background: #888; flex: none; }
.wa-bolinha.on { background: #2ecc71; }
.wa-bolinha.off { background: #e74c3c; }

/* Abas */
.aba { display: none; }
.aba.active { display: block; }

/* Barra inferior mobile */
.barra-inferior { display: none; }
@media (max-width: 719px) {
  .topbar .abas { display: none; }
  .topbar .user-nome { display: none; }
  .barra-inferior {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--navy); color: var(--text-on-dark);
    padding: 4px 2px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(239,239,234,0.14);
  }
  .barra-inferior button {
    flex: 1 1 0; min-width: 0; background: transparent; border: 0; color: var(--text-muted-dark);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 64px; padding: 8px 2px; cursor: pointer; border-radius: var(--radius-sm);
  }
  .barra-inferior button span[aria-hidden="true"] { font-size: 26px; line-height: 1; }
  .barra-inferior button small { font: 700 12px var(--font-body); }
  .barra-inferior button.active { color: var(--text-on-dark); background: rgba(255,255,255,0.08); }
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* 17.5 Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--forest); color: var(--on-acao);
  font: 700 14px/1.3 var(--font-body);
  padding: 11px 18px; border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; min-height: 44px; transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--forest-d); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1.5px solid var(--border-light); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: rgba(127,127,127,0.08); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; min-height: 36px; }
.btn.grande { font-size: 15px; padding: 15px; }
@media (max-width: 719px) { .btn.grande { width: 100%; } }
.grupo-botoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cartão */
.card {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 20px; margin-bottom: 16px;
}
@media (max-width: 719px) { .card { padding: 16px; } }
.card h3.secao-num { font-size: 15px; margin-bottom: 10px; }
#aba-novo .card > h3 { font-size: 15px; margin: 18px 0 8px; }
#aba-novo .card > h3:first-of-type { margin-top: 4px; }
.card h3.secao-num .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: var(--text-on-dark); font-size: 13px; margin-right: 8px;
}

/* Campos */
label.rotulo, .rotulo { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted-light); margin: 12px 0 4px; }
input[type="text"], input[type="tel"], input[type="search"], input[type="date"],
input[type="number"], input[type="password"], select, textarea {
  width: 100%; max-width: 100%;
  padding: 11px 13px; font: 400 15px var(--font-body); color: var(--text-on-light);
  background: var(--white); border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}
@media (max-width: 719px) {
  input[type="text"], input[type="tel"], input[type="search"], input[type="date"],
  input[type="number"], input[type="password"], select, textarea { font-size: 16px; }
}
textarea { resize: vertical; }
.dica { font-size: 12.5px; color: var(--text-muted-light); margin: 4px 0 0; }
.check-linha { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check-linha input { width: 20px; height: 20px; accent-color: var(--forest); flex: none; }
.radio-linha { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; min-height: 44px; cursor: pointer; }
.radio-linha input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }

/* Etiqueta de categoria */
.cat-tag {
  display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: var(--radius-pill);
  background: var(--ivory-d); color: var(--text-muted-light); white-space: nowrap;
}

/* Selos de status */
.selo {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap;
}
.selo.agendada { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.selo.enviando { color: var(--warn); background: var(--warn-bg); }
.selo.enviando .ponto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; animation: hd-pulso 1.6s ease-in-out infinite; }
@keyframes hd-pulso { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.selo.concluida { color: var(--ok); background: var(--ok-bg); }
.selo.cancelada { color: var(--text-muted-light); background: var(--ivory-d); }
.selo.pausada { color: var(--danger); background: var(--danger-bg); }

/* Barra de progresso */
.progresso { height: 6px; border-radius: 3px; background: var(--ivory-d); overflow: hidden; margin: 8px 0; }
.progresso > span { display: block; height: 100%; background: linear-gradient(90deg, var(--forest), var(--gold)); border-radius: 3px; transition: width 0.4s var(--ease); }

/* Balão WhatsApp (prévia) */
.balao-wa {
  background: var(--wa-bubble); color: var(--wa-bubble-text);
  border-radius: 10px 10px 2px 10px; padding: 10px 12px;
  max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 14.5px; box-shadow: var(--shadow-sm); margin-top: 8px;
}
.balao-wa .hora { display: block; text-align: right; font-size: 11px; opacity: 0.6; margin-top: 4px; }

/* Tabelas desktop */
.table-wrap { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tabela th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted-light); padding: 8px 10px; border-bottom: 1px solid var(--border-light);
}
table.tabela td { padding: 10px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
table.tabela td.obs { color: var(--text-muted-light); font-size: 13px; }
td.acoes, .cartao-acoes { white-space: nowrap; }
td.acoes .btn, .cartao-acoes .btn { margin-left: 4px; }

/* Cartões de cliente (mobile) */
.cartoes-cliente { display: none; }
@media (max-width: 719px) {
  .tabela-clientes { display: none; }
  .cartoes-cliente { display: block; }
}
.cartao-cliente {
  background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start;
}
.cartao-cliente .info { flex: 1 1 minmax(0, 1fr); min-width: 0; }
.cartao-cliente .nome { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cartao-cliente .fone { font-size: 14px; }
.cartao-cliente .obs { font-size: 13px; color: var(--text-muted-light); }
.cartao-cliente .cartao-acoes { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* Modo privado */
body.hd-privado .hd-val { filter: blur(6px); user-select: none; }

/* Resumo vivo */
.resumo { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin: 12px 0; background: var(--ok-bg); color: var(--ok); }
.resumo.alerta { background: var(--warn-bg); color: var(--warn); }

/* Chips de variável */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip-var, .chips [data-chip] {
  font: 700 12.5px var(--font-body); padding: 6px 12px; min-height: 36px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-light);
  background: var(--ivory-d); color: var(--ink); cursor: pointer;
}

/* Listas de seleção (manual / grupos) */
.lista-selecao { border: 1px solid var(--border-light); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; margin-top: 8px; }
.lista-selecao .item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 48px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.lista-selecao .item:last-child { border-bottom: 0; }
.lista-selecao .item input { width: 20px; height: 20px; accent-color: var(--forest); flex: none; }
.lista-selecao .item .nm { font-weight: 600; flex: 1 1 minmax(0, 1fr); min-width: 0; overflow-wrap: anywhere; }
.lista-selecao .vazio { padding: 16px; color: var(--text-muted-light); font-size: 14px; }

/* Prévia IA */
.ia-previa-item { border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 10px; }
.ia-previa-item .cab { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--ivory-d); border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 13px; font-weight: 700; }
.ia-previa-item textarea { border: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* Cartões de campanha */
.campanha .meta { font-size: 13px; color: var(--text-muted-light); margin: 6px 0; }
.campanha .previa { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.campanha .motivo { color: var(--danger); font-size: 13px; margin: 6px 0; }
.campanha .contas { font-size: 13px; color: var(--text-muted-light); }

/* Detalhes: lista de envios */
.envio-linha { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.envio-linha:last-child { border-bottom: 0; }
.envio-linha .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.envio-linha .dot.enviada { background: #2ecc71; }
.envio-linha .dot.falha { background: #e74c3c; }
.envio-linha .dot.pendente { background: #95a5a6; }
.envio-linha .dot.enviando { background: #f1c40f; }
.envio-linha .quem { flex: 1 1 minmax(0, 1fr); min-width: 0; }
.envio-linha .erro { color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.filtro-envios { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.linhas-ignoradas { margin-top: 10px; }
.linhas-ignoradas pre { background: var(--ivory-d); border-radius: var(--radius-sm); padding: 10px; font-size: 12.5px; max-height: 160px; overflow: auto; }

/* Modal (vira bottom-sheet no celular) */
.modal-fundo {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(1,15,35,0.55); align-items: center; justify-content: center; padding: 16px;
}
.modal-fundo.aberto { display: flex; }
.modal-caixa {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  width: 100%; max-width: 560px; max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-caixa .modal-cab { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.modal-caixa .modal-cab h3 { margin: 0; flex: 1 1 auto; font-size: 18px; }
.modal-caixa .modal-corpo { padding: 16px 20px; overflow-y: auto; }
.modal-caixa .modal-rodape { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 0 20px 20px; }
.modal-fechar { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--text-muted-light); min-width: 44px; min-height: 44px; }
@media (max-width: 719px) {
  .modal-fundo { align-items: flex-end; padding: 0; }
  .modal-caixa { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 90dvh; }
}

/* Toast (acima da barra inferior no celular) */
#hd-toast {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 200;
  background: var(--navy); color: var(--text-on-dark);
  border-left: 4px solid var(--forest); border-radius: var(--radius);
  padding: 12px 18px; font-size: 14px; max-width: min(92vw, 520px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
#hd-toast.visivel { opacity: 1; transform: translateX(-50%) translateY(0); }
#hd-toast.erro { border-left-color: var(--danger); }
@media (max-width: 719px) { #hd-toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* Login */
body.pagina-login {
  background: radial-gradient(120% 90% at 50% 0%, var(--navy-2) 0%, var(--navy) 55%, #010f23 100%);
  color: var(--text-on-dark); min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.login-cartao {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(239,239,234,0.14);
  border-radius: 18px; padding: 28px 24px; width: 100%; max-width: 400px;
}
.login-cartao img.logo { max-height: 48px; max-width: 220px; display: block; margin: 0 auto 12px; }
.login-cartao h1 { color: var(--text-on-dark); text-align: center; font-size: 20px; }
.login-cartao label { color: var(--text-muted-dark); }
.login-cartao input { background: rgba(255,255,255,0.08); border-color: rgba(239,239,234,0.25); color: var(--text-on-dark); }
.login-cartao .btn { width: 100%; }
.login-cartao .esqueci { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-muted-dark); }
.rodape-site { text-align: center; font-size: 12.5px; color: var(--text-muted-light); margin-top: 24px; }
body.pagina-login .rodape-site { color: var(--text-muted-dark); }

/* Porta (escolha de empresa) */
.porta-cartao { max-width: 440px; margin: 8dvh auto; text-align: center; }
.slug-linha { display: flex; align-items: stretch; gap: 0; }
.slug-linha .prefixo {
  display: flex; align-items: center; padding: 0 10px; font-size: 14px;
  background: var(--ivory-d); border: 1.5px solid var(--border-light); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--text-muted-light); white-space: nowrap;
}
.slug-linha input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Splash */
#hd-splash {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(130% 90% at 50% 14%, #22406a 0%, #0a2247 48%, #061530 100%);
  color: #EFEFEA; text-align: center; padding: 24px;
  transition: opacity 0.45s ease;
}
#hd-splash.sumindo { opacity: 0; pointer-events: none; }
#hd-splash img { max-height: 64px; max-width: 240px; }
#hd-splash .slogan { font-size: 14px; opacity: 0.8; }
#hd-splash .barra { width: min(70vw, 280px); height: 5px; border-radius: 3px; background: rgba(255,255,255,0.15); overflow: hidden; }
#hd-splash .barra > span {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, #0CB191, #22c0b0, #0060C3);
  animation: hd-splash-barra 1.1s ease-in-out infinite alternate;
}
@keyframes hd-splash-barra { from { margin-left: -40%; } to { margin-left: 100%; } }
#hd-splash .carregando { font-size: 13px; opacity: 0.7; }

/* Miniatura de imagem */
.miniatura { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.miniatura img { max-width: 120px; max-height: 120px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }

.vazio { color: var(--text-muted-light); padding: 20px 0; text-align: center; }
.contador { font-size: 13px; color: var(--text-muted-light); }
.rodape-lista { font-size: 13px; color: var(--text-muted-light); margin-top: 8px; }
.erro-texto { color: var(--danger); font-size: 13.5px; }

/* Aliases do contrato de views/app.php (mesmo design system, outros nomes) */
.topo {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: var(--text-on-dark);
  min-height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; flex-wrap: wrap;
}
.topo-marca { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.topo-marca img { max-height: 32px; max-width: 140px; object-fit: contain; }
.topo-marca .selo { color: var(--gold-on-navy); border: 1px solid currentColor; background: transparent; }
nav.abas { display: flex; gap: 4px; flex-wrap: wrap; }
nav.abas button {
  background: transparent; border: 0; color: var(--text-muted-dark);
  font: 700 14px var(--font-body); padding: 10px 14px; border-radius: var(--radius);
  cursor: pointer; min-height: 44px; white-space: nowrap;
}
nav.abas button.active, nav.abas button:hover { color: var(--text-on-dark); background: rgba(255,255,255,0.08); }
.topo-lado { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topo-lado button {
  background: transparent; border: 1px solid rgba(239,239,234,0.25); color: var(--text-on-dark);
  border-radius: var(--radius); min-width: 44px; min-height: 44px; font-size: 17px; cursor: pointer;
}
.topo-lado .usuario-nome { font-size: 13px; color: var(--text-muted-dark); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-lado .sair { color: var(--text-muted-dark); font-size: 13px; }
.wa { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-on-dark); }
.wa i { width: 10px; height: 10px; border-radius: 50%; background: #888; flex: none; font-style: normal; }
.wa[data-estado="conectado"] i { background: #2ecc71; }
.wa[data-estado="desconectado"] i { background: #e74c3c; }
.wa em { font-style: normal; }
.faixa { background: var(--warn-bg); color: var(--warn); padding: 10px 16px; font-size: 14px; text-align: center; }
.faixa[hidden] { display: none; }
.aba-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.aba-topo h2 { margin: 0; }
.aba-topo .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.filtros { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
@media (max-width: 560px) { .filtros { grid-template-columns: minmax(0, 1fr); } }
.lista .cartoes { display: none; }
@media (max-width: 719px) {
  .lista .table-wrap { display: none; }
  .lista .cartoes { display: block; }
  nav.abas { display: none; }
  .topo-lado .usuario-nome { display: none; }
}
.check-lista { border: 1px solid var(--border-light); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; margin-top: 8px; background: var(--white); }
.check-lista .item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 48px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.check-lista .item:last-child { border-bottom: 0; }
.check-lista .item input { width: 20px; height: 20px; accent-color: var(--forest); flex: none; }
.check-lista .item .nm { font-weight: 600; flex: 1 1 minmax(0, 1fr); min-width: 0; overflow-wrap: anywhere; }
.check-lista .item .fone { font-size: 13px; color: var(--text-muted-light); }
.check-lista .vazio { padding: 16px; color: var(--text-muted-light); font-size: 14px; }
.balao {
  background: var(--wa-bubble); color: var(--wa-bubble-text);
  border-radius: 10px 10px 2px 10px; padding: 10px 12px;
  max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 14.5px; box-shadow: var(--shadow-sm); margin-top: 8px;
}
.balao[hidden] { display: none; }
.balao .hora { display: block; text-align: right; font-size: 11px; opacity: 0.6; margin-top: 4px; }
.aviso { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.aviso[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(1,15,35,0.55); }
.modal[hidden] { display: none; }
.modal-caixa {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  width: 100%; max-width: 560px; max-height: calc(100dvh - 40px); overflow-y: auto;
  padding: 20px; position: relative; color: var(--text-on-light);
}
@media (max-width: 719px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-caixa { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 90dvh; }
}
.modal-fechar { position: absolute; top: 8px; right: 8px; background: transparent; border: 0; font-size: 22px; cursor: pointer; color: var(--text-muted-light); min-width: 44px; min-height: 44px; }
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: 94vw;
}
@media (max-width: 719px) { #toasts { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
#toasts .toast {
  background: var(--navy); color: var(--text-on-dark);
  border-left: 4px solid var(--forest); border-radius: var(--radius);
  padding: 12px 18px; font-size: 14px; max-width: min(92vw, 520px);
  opacity: 0; transform: translateY(10px); transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow);
}
#toasts .toast.erro { border-left-color: var(--danger); }
#toasts .toast.visivel { opacity: 1; transform: none; }
.rodape-app { text-align: center; font-size: 12.5px; color: var(--text-muted-light); margin: 24px 0; padding: 0 16px; }
.passo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: var(--text-on-dark); font-size: 13px; margin-right: 8px;
}
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.seg label { position: relative; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.seg.seg-2 label { flex-basis: calc(50% - 4px); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; white-space: nowrap;
  padding: 10px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-light); background: transparent;
  color: var(--text-on-light); font-size: 14px; font-weight: 600;
}
.seg label:has(input:checked) span {
  background: var(--forest); border-color: var(--forest); color: var(--on-acao);
}
.seg label:has(input:focus-visible) span { outline: 2px solid var(--gold); outline-offset: 2px; }
.linha-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.hora-min { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.campanha-topo { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ia-lista .ia-previa-item { margin-bottom: 10px; }
#img-previa-box img { max-width: 160px; max-height: 160px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
html[data-privado="1"] .hd-val { filter: blur(6px); user-select: none; }
#hd-splash .splash-slogan { font-size: 14px; opacity: 0.8; margin: 0; }
#hd-splash .splash-barra { width: min(70vw, 280px); height: 5px; border-radius: 3px; background: rgba(255,255,255,0.15); overflow: hidden; }
#hd-splash .splash-barra > span {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, #0CB191, #22c0b0, #0060C3);
  animation: hd-splash-barra 1.1s ease-in-out infinite alternate;
}
#hd-splash .splash-carregando { font-size: 13px; opacity: 0.7; margin: 0; }
#hd-splash.some { opacity: 0; pointer-events: none; }

/* Mobile: correção geral de layout (375px) */
@media (max-width: 719px) {
  /* Topo compacto em 1 linha */
  .topo { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; min-height: 56px; }
  .topo-marca { gap: 8px; }
  .topo-marca img { max-width: 110px; }
  .topo-marca .selo { display: none; }
  .wa em { display: none; }
  .topo-lado { gap: 6px; }
  .topo-lado button { min-width: 40px; min-height: 40px; font-size: 15px; }
  .topo-lado .sair { font-size: 12px; }
  .aba h2 { font-size: 20px; }

  /* Pílulas do Novo disparo em 2 colunas */
  .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg.seg-2 label { flex-basis: auto; }
  .seg span { white-space: normal; padding: 9px 8px; font-size: 13.5px; }

  /* Botões de ação ocupam a largura toda */
  .aba-topo .acoes { width: 100%; }
  .aba-topo .acoes .btn { flex: 1 1 auto; }
  .linha-btns .btn { flex: 1 1 auto; }
  .campanha .grupo-botoes .btn { flex: 1 1 auto; }
  .modal-rodape .btn, .modal-caixa .modal-rodape .btn { flex: 1 1 auto; }

  /* Cartão de cliente: botões só-ícone, discretos no canto */
  .cartao-cliente { flex-wrap: nowrap; align-items: flex-start; }
  .cartao-cliente .cartao-acoes { flex-direction: column; width: auto; gap: 6px; }
  .cartao-cliente .cartao-acoes .btn {
    flex: none; min-height: 36px; min-width: 36px; padding: 6px 9px; font-size: 14px;
  }

  /* Campanha: título e selo sem espremer */
  .campanha-topo strong { flex: 1 1 minmax(0, 200px); min-width: 0; overflow-wrap: anywhere; }
}

/* 17.6 Rede de segurança (OBRIGATÓRIA — fica por último, não edita o resto) */
main.wrap { overflow-x: clip; }
:where(main.wrap) :where(div, section, form, aside, article, fieldset, label, li) { min-width: 0; }
:where(main.wrap) :where(img, video, canvas, iframe, svg) { max-width: 100%; }
:where(main.wrap) :where(input, select, textarea) { max-width: 100%; }
:where(main.wrap) :where(pre, code) { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  :where(main.wrap) :where(h1, h2, h3, p, td, th, span, a, strong, b) { overflow-wrap: anywhere; }
}
[data-hd-vaza] { outline: 2px dashed #E8897A !important; outline-offset: -2px; }
