/* DNSync — visual novo (25/11/2026): faixa temática, saudação, cartões, filtro em botões, barra e tabela.
   Tudo escopado em html.dnv (classe posta no <head>) para vencer as regras antigas sem !important,
   exceto onde as regras antigas já usam !important. */

html.dnv body{ --dnv-field:#f2f5fa; --dnv-line2:#d3dbe6; --dnv-ok:#1f8a55; --dnv-bad:#d0453b; --dnv-warn:#c2600a; --dnv-info:#2E77C9; --dnv-off:#6b7686;
  position:relative; z-index:0; }
html.dnv body.dark{ --dnv-field:#1b2433; --dnv-line2:#33415a; --dnv-ok:#5fd39b; --dnv-bad:#ff7a70; --dnv-warn:#f5a524; --dnv-info:#7fb6ff; --dnv-off:#9aa6b8; }

/* ---------- faixa temática ---------- */
#dnvBand{ position:absolute; left:0; right:0; top:0; height:300px; z-index:-1; pointer-events:none; overflow:hidden;
  background:linear-gradient(160deg,#0a111f 0%,#0f2141 60%,#123063 100%); }
#dnvBand svg{ position:absolute; inset:0; width:100%; height:100%; display:block; }
html:not(.dnv) #dnvBand{ display:none; }
html.dnv header{ background:transparent !important; box-shadow:none !important; }
html.dnv #vencHostMob{ background:transparent !important; }
html.dnv #vencHostMob.dnv-vazio{ display:none !important; }

/* ---------- saudação ---------- */
#dnvHello{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding:14px 18px 2px; box-sizing:border-box; color:#fff; font-family:Inter,'Segoe UI',system-ui,sans-serif; }
#dnvHello .dnv-tx{ display:flex; flex-direction:column; gap:3px; min-width:0; }
#dnvHello .dnv-k{ font-size:13px; font-weight:600; color:#8fc3f5; }
#dnvHello h1{ margin:0; font-size:24px; font-weight:800; color:#fff; letter-spacing:-.01em; line-height:1.15; }
#dnvHello .dnv-s{ font-size:13px; color:#a9b8cf; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#dnvHello .dnv-cta{ flex:none; display:flex; }
html.dnv #dnvHello #btnMassa{ height:46px; padding:0 20px; border-radius:12px; border:0; font-size:14px; font-weight:700; color:#fff;
  background:linear-gradient(180deg,#4aa0f0,#2E77C9); box-shadow:0 10px 26px rgba(58,143,224,.38); cursor:pointer; white-space:nowrap; }
html.dnv #dnvHello #btnMassa:hover{ filter:brightness(1.06); }

/* cartão "Primeiros passos" (onboard.js) alinhado às mesmas margens dos cartões */
html.dnv #dnobCard{ width:calc(100% - 36px); margin:14px auto 4px; }

/* ---------- cartões de resumo ---------- */
html.dnv .controls{ padding-top:14px; }
html.dnv .sum-cards{ gap:14px; }
html.dnv .sum-card{ border-radius:16px; padding:16px 18px; gap:14px; box-shadow:0 10px 30px rgba(13,20,36,.10); }
html.dnv body.dark .sum-card{ box-shadow:0 10px 30px rgba(0,0,0,.35); }
html.dnv .sum-card:not(.venc-ameno):not(.venc-urgente):not(.venc-critico){ background:var(--card,#fff); border:1px solid var(--linha,#e6ebf2); }
html.dnv .sum-card::before{ display:none; }
html.dnv .sum-card.on{ box-shadow:0 0 0 2px var(--sc,#2E77C9) inset, 0 10px 30px rgba(13,20,36,.10); border-color:transparent; }
html.dnv .sum-card .sum-ic{ width:44px; height:44px; border-radius:12px; display:flex; }
html.dnv .sum-card .sum-ic svg{ width:20px; height:20px; }
html.dnv .sum-card .sum-v{ font-size:26px; color:var(--ink,#0d1424); }
html.dnv .sum-card .sum-l{ font-size:13px; margin-top:4px; }

/* ---------- barra (busca + filtro em botões + ações) ---------- */
html.dnv .toolbar input#busca{ padding-left:38px; background-color:var(--dnv-field); border-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d9bb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:13px center; }
html.dnv .toolbar input#busca:focus{ border-color:var(--brand,#3A8FE0); }
html.dnv .toolbar #filtro{ display:none !important; }
#dnvSeg{ display:flex; gap:4px; padding:4px; border-radius:11px; background:var(--dnv-field); box-sizing:border-box; height:40px; align-items:stretch; }
#dnvSeg button{ border:0; background:transparent; color:var(--mut,#5f6b7c); font:600 13px Inter,'Segoe UI',system-ui,sans-serif; padding:0 12px; border-radius:8px; cursor:pointer; white-space:nowrap; display:flex; align-items:center; justify-content:center; gap:6px; min-height:0 !important; height:auto !important; }
#dnvSeg button b{ font-weight:800; font-variant-numeric:tabular-nums; }
#dnvSeg button.on{ background:var(--card,#fff); color:var(--ink,#0d1424); box-shadow:0 1px 3px rgba(13,20,36,.14); }
html.dnv body.dark #dnvSeg button.on{ box-shadow:0 1px 3px rgba(0,0,0,.4); }
html.dnv .toolbar .tbtn{ background:transparent; border:1px solid var(--dnv-line2); color:var(--txt,#2b3546); font-weight:600; border-radius:10px; }
html.dnv .toolbar .tbtn:hover{ background:var(--dnv-field); }
html.dnv #btnNovo.tbtn, html.dnv #btnAddLista.tbtn{ background:transparent; border-color:var(--dnv-line2); color:var(--txt,#2b3546); }
html.dnv body.dark #btnNovo.tbtn, html.dnv body.dark #btnAddLista.tbtn{ background:transparent; border-color:var(--dnv-line2); color:#d5deea; }
html.dnv .toolbar .tbtn-massa{ background:linear-gradient(180deg,#4aa0f0,#2E77C9); color:#fff; border:0; font-weight:700; box-shadow:0 6px 16px rgba(58,143,224,.30); }

/* computador: a barra vira um cartão (no celular volta a ser transparente, ver abaixo) */
html.dnv .toolbar{ background:var(--card,#fff); border:1px solid var(--linha,#e6ebf2); border-radius:14px; padding:10px; margin-top:14px; box-shadow:0 2px 10px rgba(13,20,36,.04); }
html.dnv .toolbar input#busca{ text-overflow:ellipsis; }
html.dnv .toolbar{ margin-bottom:0; }

/* ---------- tabela: situação + validade numa coluna ---------- */
html.dnv .dnv-hide{ display:none !important; }
/* situação: selo colorido + cadeado ao lado, validade centralizada embaixo (v2) */
html.dnv .st-cell{ display:inline-grid !important; grid-template-columns:auto auto; align-items:center; justify-content:center; column-gap:6px; row-gap:4px; width:auto !important; }
html.dnv .dnv-sw{ display:contents; }
html.dnv .st-cell .status{ grid-column:1; grid-row:1; }
html.dnv .st-cell .lockst{ grid-column:2; grid-row:1; width:24px; height:24px; border-radius:50%; justify-content:center; background:color-mix(in srgb,currentColor 11%,transparent); }
html.dnv .st-cell .lockst svg{ width:13px; height:13px; }
html.dnv .st-cell .dnv-val{ grid-column:1 / -1; grid-row:2; justify-self:center; }
html.dnv .dnv-val{ font-size:11.5px; font-weight:500; color:var(--mut,#5f6b7c); white-space:nowrap; font-variant-numeric:tabular-nums; letter-spacing:.01em; }
html.dnv .status.active, html.dnv .status.on, html.dnv .status.expired, html.dnv .status.trial, html.dnv .status.off{
  background:color-mix(in srgb,currentColor 12%,transparent) !important; border:1px solid color-mix(in srgb,currentColor 32%,transparent) !important; padding:3px 11px 3px 9px !important; border-radius:999px !important; box-shadow:none !important; min-width:0 !important;
  display:inline-flex !important; align-items:center; gap:6px; font-weight:700; font-size:12.5px; line-height:1.2; white-space:nowrap; }
html.dnv .status.active::before, html.dnv .status.on::before, html.dnv .status.expired::before, html.dnv .status.trial::before, html.dnv .status.off::before{
  content:"" !important; display:block !important; flex:none; width:7px; height:7px; border-radius:50%; background:currentColor; }
html.dnv .status.active, html.dnv .status.on{ color:var(--dnv-ok) !important; }
html.dnv .status.expired{ color:var(--dnv-bad) !important; }
html.dnv .status.trial{ color:var(--dnv-info) !important; }
html.dnv .status.off{ color:var(--dnv-off) !important; }
html.dnv .dn5-lchip .dnv-n{ font-weight:800; opacity:.75; margin-left:2px; }

/* ---------- celular ---------- */
/* mesma regra de celular do painel: (max-width:860px), (pointer:coarse) */
@media (max-width:860px), (pointer:coarse){
  #dnvHello{ padding:8px 12px 2px; }
  #dnvHello h1{ font-size:21px; }
  #dnvHello .dnv-cta{ display:none; }
  html.dnv body:not(.rolou) .controls{ background:transparent !important; box-shadow:none !important; }
  html.dnv .controls{ padding-top:12px; }
  html.dnv #dnobCard{ width:calc(100% - 24px); margin:12px auto 4px; }
  html.dnv .sum-cards{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; }
  html.dnv .sum-card{ padding:12px !important; gap:10px !important; border-radius:14px !important; flex-direction:row !important; align-items:center !important; }
  html.dnv .sum-card .sum-ic{ display:flex !important; width:36px !important; height:36px !important; border-radius:10px !important; }
  html.dnv .sum-card .sum-ic svg{ width:18px !important; height:18px !important; }
  html.dnv .sum-card .sum-v{ font-size:20px !important; }
  html.dnv .sum-card .sum-l{ font-size:12px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; letter-spacing:0 !important; }
  /* a página inteira rola (antes só a lista rolava numa janelinha); a barra gruda no topo e encolhe (body.rolou) */
  html.dnv, html.dnv body{ height:auto !important; }
  html.dnv body{ min-height:100%; overflow:visible; overflow-x:clip; }
  html.dnv #vencHostMob{ overflow-x:clip; }
  html.dnv #vencHostMob #vencChip.vip-chip{ overflow:hidden; }   /* o brilho do VIP aparecia como mancha fora do chip */   /* brilho do chip VIP passava da tela e criava rolagem lateral */
  html.dnv body.modal-open{ overflow:hidden; }
  html.dnv main{ overflow:visible !important; flex:none !important; }
  html.dnv body.rolou main{ min-height:100vh; }   /* evita pisca-pisca: com a barra encolhida a página continua comprida */
  html.dnv .toolbar{ gap:8px !important; background:transparent; border:0; padding:0; margin-top:12px; box-shadow:none; border-radius:0; margin-bottom:6px; }
  html.dnv .toolbar input#busca{ order:1 !important; flex:1 1 100% !important; }
  html.dnv #dnvSeg{ order:2; flex:1 1 100%; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); height:auto; min-height:50px; }
  html.dnv #dnvSeg button{ flex-direction:column; gap:1px; padding:6px 2px; font-size:11.5px; line-height:1.15; min-width:0; overflow:hidden; text-overflow:ellipsis; }
  html.dnv #dnvSeg button b{ font-size:15px; }
  html.dnv .toolbar #btnMassa{ order:3 !important; flex:1 1 100% !important; }
  html.dnv .toolbar #btnServidores{ order:4 !important; }
  html.dnv .toolbar #btnNovo{ order:5 !important; }
  html.dnv .toolbar #btnAddLista{ order:6 !important; }
  html.dnv .toolbar .mais-wrap{ order:7 !important; }
  html.dnv .toolbar #btnServidores, html.dnv .toolbar #btnNovo, html.dnv .toolbar #btnAddLista, html.dnv .toolbar .mais-wrap{
    flex:1 1 calc((100% - 24px) / 4) !important; max-width:calc((100% - 24px) / 4); min-width:0 !important; }
  html.dnv .toolbar #btnServidores, html.dnv .toolbar #btnNovo, html.dnv .toolbar #btnAddLista, html.dnv .toolbar #btnMais{
    padding:0 4px !important; font-size:12.5px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; justify-content:center; }
  html.dnv .toolbar #btnServidores svg{ display:none; }
  html.dnv .toolbar .mais-wrap #btnMais{ width:100%; }
  html.dnv main .acoes-wrap{ width:100%; justify-content:center; }   /* ícones do cartão centralizados de verdade (antes sobrava espaço só à direita) */
  @media (min-width:600px){ html.dnv .sum-cards{ grid-template-columns:repeat(4,minmax(0,1fr)) !important; } }   /* tablet: 4 cartões numa linha */
  /* barra grudada (rolou): busca + Servidores na 1ª linha, filtro compacto embaixo */
  html.dnv body.rolou .toolbar{ margin-top:0; margin-bottom:0 !important; }
  html.dnv body.rolou .toolbar input#busca{ flex:1 1 0 !important; min-width:0 !important; }
  html.dnv body.rolou .toolbar #btnServidores{ order:2 !important; flex:0 0 auto !important; max-width:none; padding:0 14px !important; }
  html.dnv body.rolou .toolbar #btnServidores svg{ display:inline-block; }
  html.dnv body.rolou #dnvSeg{ order:3; min-height:0; height:40px; }
  html.dnv body.rolou #dnvSeg button{ flex-direction:row; gap:5px; padding:0 2px; font-size:12px; }
  html.dnv body.rolou #dnvSeg button b{ font-size:13px; order:2; }
}

/* ---------- janelas internas (Servidores, Aparelho, Lista, Troca em massa...) no tema novo (v4) ---------- */
html.dnv .overlay .modal{ border-radius:20px; border:1px solid var(--linha,#e6ebf2); box-shadow:0 30px 80px rgba(8,15,30,.35), 0 2px 8px rgba(8,15,30,.08); }
html.dnv body.dark .overlay .modal{ border-color:#263247; box-shadow:0 30px 80px rgba(0,0,0,.6); }
/* ícone do título com a mesma identidade da faixa */
html.dnv .overlay .modal h2 .dn5-mh{ background:linear-gradient(150deg,#123063,#2E77C9) !important; color:#fff !important; border:0 !important; box-shadow:0 6px 14px rgba(46,119,201,.28); }
html.dnv .overlay .modal h2 .dn5-mh svg{ stroke:#fff; }
/* campos: fundo suave como a busca (a cor da borda fica a original, para não esconder aviso de erro) */
html.dnv .overlay .modal .campo input:not([type=checkbox]):not([type=radio]):not([type=color]),
html.dnv .overlay .modal .campo select, html.dnv .overlay .modal .campo textarea{ background-color:var(--dnv-field); border-radius:11px; }
html.dnv .overlay .modal .campo input:focus, html.dnv .overlay .modal .campo select:focus, html.dnv .overlay .modal .campo textarea:focus{
  background-color:var(--card,#fff); box-shadow:0 0 0 3px color-mix(in srgb,var(--brand,#3A8FE0) 22%,transparent); }
html.dnv body.dark .overlay .modal .campo input:focus, html.dnv body.dark .overlay .modal .campo select:focus{ background-color:#111826; }
html.dnv .overlay .modal .app-dd-btn{ background-color:var(--dnv-field); border-radius:11px; }
/* botões do rodapé: principal com o mesmo degradê do "Trocar DNS em massa" */
html.dnv .overlay .modal .btn-primario{ background:linear-gradient(180deg,#4aa0f0,#2E77C9); border:0; color:#fff; box-shadow:0 8px 20px rgba(58,143,224,.30); border-radius:12px; font-weight:700; }
html.dnv .overlay .modal .btn-primario:hover{ filter:brightness(1.06); }
html.dnv .overlay .modal .btn-primario:disabled{ filter:grayscale(.4); opacity:.6; box-shadow:none; }
html.dnv .overlay .modal .btn-sec{ background:transparent; border:1px solid var(--dnv-line2); color:var(--txt,#2b3546); border-radius:12px; font-weight:600; }
html.dnv body.dark .overlay .modal .btn-sec{ color:#d5deea; }
html.dnv .overlay .modal .btn-sec:hover{ background:var(--dnv-field); }
html.dnv .overlay .modal .ov-x{ border-radius:10px; }
/* "Nome do cliente (opcional)" na mesma linha, como nos outros campos */
html.dnv .overlay .modal .campo:has(> #alCliente){ display:grid; grid-template-columns:auto 1fr; column-gap:6px; align-items:baseline; }
html.dnv .overlay .modal .campo:has(> #alCliente) > :not(label):not(span){ grid-column:1 / -1; }
html.dnv .overlay .modal .campo:has(> #alCliente) > label + span{ font-size:11px; opacity:.7; }
/* avisos dentro das janelas que ficavam brancos/amarelos-claros no tema escuro (cores vinham fixas no HTML) */
html.dnv body.dark .overlay .modal small[style*="#eef2f7"]{ background:#1b2433 !important; color:#a9b8cf !important; border-color:#33415a !important; }
html.dnv body.dark .overlay .modal small[style*="#fff8e1"], html.dnv body.dark .overlay .modal p[style*="#fff6e5"]{ background:rgba(240,182,74,.10) !important; color:#f0c46a !important; border-color:rgba(240,182,74,.35) !important; }
html.dnv body.dark .overlay .modal small[style*="#eef2f7"] b{ color:#d5deea; }
@media (max-width:860px), (pointer:coarse){
  html.dnv .overlay .modal .modal-acoes > button.btn-sec, html.dnv .overlay .modal .modal-acoes > button.btn-primario{ flex:1 1 0; min-width:0; }   /* rodapé simétrico */
}

/* ativo vencendo em até 7 dias: selo âmbar como o cartão "Vencendo" */
html.dnv .status.dnv-vcd{ color:var(--dnv-warn) !important; }
html.dnv .dnv-val.dnv-vcd{ color:var(--dnv-warn); font-weight:600; }

/* selos de status com largura igual (medida pelo maior texto) e conteúdo centralizado */
html.dnv .st-cell .status{ min-width:var(--dnv-stw, 0) !important; justify-content:center; box-sizing:border-box; }
html.dnv .st-cell{ grid-template-columns:var(--dnv-stc, auto) auto; }
html.dnv .st-cell .status{ justify-self:center; }
html.dnv .st-cell .dnv-val{ grid-column:1 !important; justify-self:center; }
/* status com texto longo (aviso): quebra em até 2 linhas, centralizado */
html.dnv .st-cell .status.dnv-longo{ white-space:normal; max-width:190px; text-align:center; line-height:1.25; border-radius:12px !important; }
/* computador estreito (861–1180px): busca numa linha inteira, filtro e botões na de baixo, sem botão sobrando sozinho */
@media (min-width:861px) and (max-width:1180px) and (pointer:fine){
  html.dnv .toolbar{ flex-wrap:wrap; }
  html.dnv .toolbar input#busca{ flex:1 1 100% !important; }
  html.dnv #dnvSeg{ flex:1 1 auto; }
}

/* v8: selo menor e coluna simétrica — espaço vazio à esquerda do mesmo tamanho do cadeado, para o selo ficar no centro (alinhado ao título STATUS) */
html.dnv .st-cell{ grid-template-columns:22px var(--dnv-stc, auto) 22px !important; column-gap:6px !important; row-gap:3px !important; }
html.dnv .st-cell .status{ grid-column:2 !important; padding:2px 9px 2px 7px !important; font-size:12px !important; gap:5px !important; }
html.dnv .st-cell .status::before{ width:6px !important; height:6px !important; }
html.dnv .st-cell .lockst{ grid-column:3 !important; width:22px !important; height:22px !important; }
html.dnv .st-cell .lockst svg{ width:12px !important; height:12px !important; }
html.dnv .st-cell .dnv-val{ grid-column:2 !important; font-size:11px !important; }
@media (max-width:860px), (pointer:coarse){
  html.dnv .st-cell{ grid-template-columns:var(--dnv-stc, auto) 22px !important; }
  html.dnv .st-cell .status, html.dnv .st-cell .dnv-val{ grid-column:1 !important; }
  html.dnv .st-cell .lockst{ grid-column:2 !important; }
}

/* legenda de servidores (v9): faixa própria no topo da tabela, chips do mesmo tamanho e contagem num selinho */
html.dnv #dn5Leg{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; padding:12px 16px !important; margin:0 !important;
  background:var(--card2,#f6f8fb); border-bottom:1px solid var(--linha,#e6ebf2); border-radius:16px 16px 0 0; }
html.dnv body.dark #dn5Leg{ background:rgba(255,255,255,.02); }
html.dnv #dn5Leg .dn5-ltit{ display:inline-flex; align-items:center; gap:6px; height:28px; font-size:11px; font-weight:700; letter-spacing:.06em; opacity:1; color:var(--mut,#5f6b7c); margin-right:4px; }
html.dnv #dn5Leg .dn5-ltit::before{ content:""; width:14px; height:14px; flex:none; background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='8' rx='2'/%3E%3Crect x='2' y='13' width='20' height='8' rx='2'/%3E%3Cpath d='M6 7h.01M6 17h.01'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='8' rx='2'/%3E%3Crect x='2' y='13' width='20' height='8' rx='2'/%3E%3Cpath d='M6 7h.01M6 17h.01'/%3E%3C/svg%3E") center/contain no-repeat; }
html.dnv #dn5Leg .dn5-lchip{ height:28px; box-sizing:border-box; padding:0 5px 0 11px; gap:7px; font-size:12px; font-weight:700; letter-spacing:.02em; transition:transform .12s, box-shadow .12s; }
html.dnv #dn5Leg .dn5-lchip:hover{ transform:translateY(-1px); box-shadow:0 3px 10px rgba(13,20,36,.10); }
html.dnv #dn5Leg .dn5-lchip:not(:has(.dnv-n)){ padding-right:11px; }
html.dnv #dn5Leg .dn5-lchip .dnv-n{ display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; box-sizing:border-box; border-radius:999px;
  font-size:11px; font-weight:800; opacity:1; margin:0; background:color-mix(in srgb,currentColor 16%,transparent); font-variant-numeric:tabular-nums; }
html.dnv #dn5Leg .dn5-lx{ height:28px; display:inline-flex; align-items:center; border:1px dashed var(--dnv-line2); }
@media (max-width:860px), (pointer:coarse){
  html.dnv #dn5Leg{ border-radius:14px; margin:0 0 10px !important; border:0; }
  html.dnv #dn5Leg .dn5-ltit{ width:100%; justify-content:center; margin:0; }
}
